@runmedev/react-components 3.14.1 → 3.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app/index.js CHANGED
@@ -6643,7 +6643,7 @@ Open Dashboard to configure it`)},A=function(){var be;const je=(0,W.getContext)(
6643
6643
  \*****************************/Object.defineProperty(t,"__esModule",{value:!0}),t.ClientMessages=t.setContext=t.activate=void 0;const e=Qs("./src/constants.ts");Object.defineProperty(t,"ClientMessages",{enumerable:!0,get:function(){return e.ClientMessages}});const n=Qs("./src/client/utils.ts");Object.defineProperty(t,"setContext",{enumerable:!0,get:function(){return n.setContext}}),Qs("./src/client/components/index.ts");const r=s=>((0,n.setContext)(s),{renderOutputItem(c,i){var o,u,l;const a=c.json();switch(a.type){case e.OutputType.vercel:if(a.output.error){d(a.output.error);break}const f=document.createElement(e.RENDERERS.VercelOutput);f.setAttribute("content",JSON.stringify(a.output)),i.appendChild(f);break;case e.OutputType.daggerCall:if(!((o=a.output)!=null&&o.cellId))return;const p=document.createElement(e.RENDERERS.DaggerCli);p.setAttribute("cellId",a.output.cellId);const v={...a.output,cli:{status:"active"}};p.setAttribute("state",JSON.stringify(v)),i.appendChild(p);break;case e.OutputType.deno:if((u=a.output)!=null&&u.error){d(a.output.error);break}const m=a.output||{},b=document.createElement(e.RENDERERS.DenoOutput);b.setAttribute("state",JSON.stringify(m)),i.appendChild(b);break;case e.OutputType.outputItems:const y=decodeURIComponent(escape(window.atob(a.output.content))),_=document.createElement(e.RENDERERS.ShellOutput);_.innerHTML=y,i.appendChild(_);const S=document.createElement(e.RENDERERS.ShellOutputItems);S.setAttribute("id",a.output.id),S.setAttribute("content",y),i.appendChild(S);break;case e.OutputType.annotations:const C=document.createElement(e.RENDERERS.EditAnnotations);C.setAttribute("annotations",JSON.stringify(a.output.annotations??[])),C.setAttribute("validationErrors",JSON.stringify(a.output.validationErrors??[])),C.setAttribute("settings",JSON.stringify(a.output.settings)),i.appendChild(C);break;case e.OutputType.terminal:const x=document.createElement(e.RENDERERS.TerminalView);x.setAttribute("id",a.output["runme.dev/id"]),x.setAttribute("fontFamily",a.output.fontFamily),typeof a.output.fontSize=="number"&&x.setAttribute("fontSize",a.output.fontSize.toString()),a.output.cursorStyle&&x.setAttribute("cursorStyle",a.output.cursorStyle),typeof a.output.cursorBlink=="boolean"&&x.setAttribute("cursorBlink",a.output.cursorBlink?"true":"false"),typeof a.output.cursorWidth=="number"&&x.setAttribute("cursorWidth",a.output.cursorWidth.toString()),typeof a.output.smoothScrollDuration=="number"&&x.setAttribute("smoothScrollDuration",a.output.smoothScrollDuration.toString()),typeof a.output.scrollback=="number"&&x.setAttribute("scrollback",a.output.scrollback.toString()),a.output.initialRows!==void 0&&x.setAttribute("initialRows",a.output.initialRows.toString()),a.output.content!==void 0&&x.setAttribute("initialContent",a.output.content),a.output.isAutoSaveEnabled&&x.setAttribute("isAutoSaveEnabled",a.output.isAutoSaveEnabled.toString()),a.output.isPlatformAuthEnabled&&x.setAttribute("isPlatformAuthEnabled",a.output.isPlatformAuthEnabled.toString()),a.output.isDaggerOutput&&x.setAttribute("isDaggerOutput",a.output.isDaggerOutput.toString()),i.appendChild(x);break;case e.OutputType.error:d(a.output);break;case e.OutputType.github:const j=document.createElement(e.RENDERERS.GitHubWorkflowViewer);(l=a.output)!=null&&l.content&&j.setAttribute("state",JSON.stringify(a.output)),i.appendChild(j);break;case e.OutputType.gcp:const k=document.createElement(e.RENDERERS.GCPView);a.output&&k.setAttribute("state",JSON.stringify(a.output)),i.appendChild(k);break;case e.OutputType.aws:const T=document.createElement(e.RENDERERS.AWSView);a.output&&T.setAttribute("state",JSON.stringify(a.output)),i.appendChild(T);break;default:i.innerHTML="No renderer found!"}function d(f){i.innerHTML=`⚠️ ${f}`}},disposeOutputItem(){}});t.activate=r})();const _c=su.ClientMessages;su.__esModule;su.activate;const j8=su.setContext,k8=Gi("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),T8=RN(k8,0),O8=Zg(T8),A8=Gi("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),fj=Gi("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[A8,$h]),Rv=Ph(fj,3),I8=Ph(fj,4);var Nv=function(t,e){return Nv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Nv(t,e)};function Zi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Nv(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function R8(t,e,n,r){function s(c){return c instanceof n?c:new n(function(i){i(c)})}return new(n||(n=Promise))(function(c,i){function o(a){try{l(r.next(a))}catch(d){i(d)}}function u(a){try{l(r.throw(a))}catch(d){i(d)}}function l(a){a.done?c(a.value):s(a.value).then(o,u)}l((r=r.apply(t,[])).next())})}function pj(t,e){var n={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},r,s,c,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(l){return function(a){return u([l,a])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,s&&(c=l[0]&2?s.return:l[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,l[1])).done)return c;switch(s=0,c&&(l=[l[0]&2,c.value]),l[0]){case 0:case 1:c=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,s=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(c=n.trys,!(c=c.length>0&&c[c.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!c||l[1]>c[0]&&l[1]<c[3])){n.label=l[1];break}if(l[0]===6&&n.label<c[1]){n.label=c[1],c=l;break}if(c&&n.label<c[2]){n.label=c[2],n.ops.push(l);break}c[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(a){l=[6,a],s=0}finally{r=c=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Fa(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ri(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,c=[],i;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)c.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return c}function Vi(t,e,n){if(arguments.length===2)for(var r=0,s=e.length,c;r<s;r++)(c||!(r in e))&&(c||(c=Array.prototype.slice.call(e,0,r)),c[r]=e[r]);return t.concat(c||Array.prototype.slice.call(e))}function Ra(t){return this instanceof Ra?(this.v=t,this):new Ra(t)}function N8(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(v){return Promise.resolve(v).then(p,d)}}function o(p,v){r[p]&&(s[p]=function(m){return new Promise(function(b,y){c.push([p,m,b,y])>1||u(p,m)})},v&&(s[p]=v(s[p])))}function u(p,v){try{l(r[p](v))}catch(m){f(c[0][3],m)}}function l(p){p.value instanceof Ra?Promise.resolve(p.value.v).then(a,d):f(c[0][2],p)}function a(p){u("next",p)}function d(p){u("throw",p)}function f(p,v){p(v),c.shift(),c.length&&u(c[0][0],c[0][1])}}function L8(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Fa=="function"?Fa(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(c){n[c]=t[c]&&function(i){return new Promise(function(o,u){i=t[c](i),s(o,u,i.done,i.value)})}}function s(c,i,o,u){Promise.resolve(u).then(function(l){c({value:l,done:o})},i)}}function Nt(t){return typeof t=="function"}function mj(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Im=mj(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
6644
6644
  `+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
6645
6645
  `):"",this.name="UnsubscriptionError",this.errors=e}});function ch(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var iu=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,s,c;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var o=Fa(i),u=o.next();!u.done;u=o.next()){var l=u.value;l.remove(this)}}catch(m){e={error:m}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}else i.remove(this);var a=this.initialTeardown;if(Nt(a))try{a()}catch(m){c=m instanceof Im?m.errors:[m]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=Fa(d),p=f.next();!p.done;p=f.next()){var v=p.value;try{Dw(v)}catch(m){c=c??[],m instanceof Im?c=Vi(Vi([],ri(c)),ri(m.errors)):c.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(c)throw new Im(c)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Dw(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ch(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ch(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),vj=iu.EMPTY;function gj(t){return t instanceof iu||t&&"closed"in t&&Nt(t.remove)&&Nt(t.add)&&Nt(t.unsubscribe)}function Dw(t){Nt(t)?t():t.unsubscribe()}var D8={Promise:void 0},M8={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Vi([t,e],ri(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function bj(t){M8.setTimeout(function(){throw t})}function Pc(){}function Gd(t){t()}var e0=function(t){Zi(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,gj(n)&&n.add(r)):r.destination=B8,r}return e.create=function(n,r,s){return new $c(n,r,s)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(iu),P8=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Td(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Td(r)}else Td(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Td(n)}},t}(),$c=function(t){Zi(e,t);function e(n,r,s){var c=t.call(this)||this,i;return Nt(n)||!n?i={next:n??void 0,error:r??void 0,complete:s??void 0}:i=n,c.destination=new P8(i),c}return e}(e0);function Td(t){bj(t)}function $8(t){throw t}var B8={closed:!0,next:Pc,error:$8,complete:Pc},t0=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Hh(t){return t}function U8(t){return t.length===0?Hh:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var hn=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var s=this,c=V8(e)?e:new $c(e,n,r);return Gd(function(){var i=s,o=i.operator,u=i.source;c.add(o?o.call(c,u):u?s._subscribe(c):s._trySubscribe(c))}),c},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Mw(n),new n(function(s,c){var i=new $c({next:function(o){try{e(o)}catch(u){c(u),i.unsubscribe()}},error:c,complete:s});r.subscribe(i)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[t0]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return U8(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Mw(e),new e(function(r,s){var c;n.subscribe(function(i){return c=i},function(i){return s(i)},function(){return r(c)})})},t.create=function(e){return new t(e)},t}();function Mw(t){var e;return(e=t??D8.Promise)!==null&&e!==void 0?e:Promise}function F8(t){return t&&Nt(t.next)&&Nt(t.error)&&Nt(t.complete)}function V8(t){return t&&t instanceof e0||F8(t)&&gj(t)}function z8(t){return Nt(t==null?void 0:t.lift)}function Nn(t){return function(e){if(z8(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function an(t,e,n,r,s){return new H8(t,e,n,r,s)}var H8=function(t){Zi(e,t);function e(n,r,s,c,i,o){var u=t.call(this,n)||this;return u.onFinalize=i,u.shouldUnsubscribe=o,u._next=r?function(l){try{r(l)}catch(a){n.error(a)}}:t.prototype._next,u._error=c?function(l){try{c(l)}catch(a){n.error(a)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=s?function(){try{s()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(e0),W8=mj(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Dr=function(t){Zi(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Pw(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new W8},e.prototype.next=function(n){var r=this;Gd(function(){var s,c;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var i=Fa(r.currentObservers),o=i.next();!o.done;o=i.next()){var u=o.value;u.next(n)}}catch(l){s={error:l}}finally{try{o&&!o.done&&(c=i.return)&&c.call(i)}finally{if(s)throw s.error}}}})},e.prototype.error=function(n){var r=this;Gd(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var s=r.observers;s.length;)s.shift().error(n)}})},e.prototype.complete=function(){var n=this;Gd(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,s=this,c=s.hasError,i=s.isStopped,o=s.observers;return c||i?vj:(this.currentObservers=null,o.push(n),new iu(function(){r.currentObservers=null,ch(o,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,s=r.hasError,c=r.thrownError,i=r.isStopped;s?n.error(c):i&&n.complete()},e.prototype.asObservable=function(){var n=new hn;return n.source=this,n},e.create=function(n,r){return new Pw(n,r)},e}(hn),Pw=function(t){Zi(e,t);function e(n,r){var s=t.call(this)||this;return s.destination=n,s.source=r,s}return e.prototype.next=function(n){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.next)===null||s===void 0||s.call(r,n)},e.prototype.error=function(n){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.error)===null||s===void 0||s.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,s;return(s=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&s!==void 0?s:vj},e}(Dr),G8={now:function(){return Date.now()}},Z8=function(t){Zi(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(iu),$w={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Vi([t,e],ri(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},Y8=function(t){Zi(e,t);function e(n,r){var s=t.call(this,n,r)||this;return s.scheduler=n,s.work=r,s.pending=!1,s}return e.prototype.schedule=function(n,r){var s;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var c=this.id,i=this.scheduler;return c!=null&&(this.id=this.recycleAsyncId(i,c,r)),this.pending=!0,this.delay=r,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(i,this.id,r),this},e.prototype.requestAsyncId=function(n,r,s){return s===void 0&&(s=0),$w.setInterval(n.flush.bind(n,this),s)},e.prototype.recycleAsyncId=function(n,r,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return r;r!=null&&$w.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(n,r);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var s=!1,c;try{this.work(n)}catch(i){s=!0,c=i||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),c},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,s=n.scheduler,c=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ch(c,this),r!=null&&(this.id=this.recycleAsyncId(s,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Z8),Bw=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=G8.now,t}(),K8=function(t){Zi(e,t);function e(n,r){r===void 0&&(r=Bw.now);var s=t.call(this,n,r)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var s;this._active=!0;do if(s=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,s){for(;n=r.shift();)n.unsubscribe();throw s}},e}(Bw),Wh=new K8(Y8),X8=Wh,yj=new hn(function(t){return t.complete()});function _j(t){return t&&Nt(t.schedule)}function n0(t){return t[t.length-1]}function q8(t){return Nt(n0(t))?t.pop():void 0}function wj(t){return _j(n0(t))?t.pop():void 0}function J8(t,e){return typeof n0(t)=="number"?t.pop():e}var r0=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Sj(t){return Nt(t==null?void 0:t.then)}function xj(t){return Nt(t[t0])}function Cj(t){return Symbol.asyncIterator&&Nt(t==null?void 0:t[Symbol.asyncIterator])}function Ej(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Q8(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var jj=Q8();function kj(t){return Nt(t==null?void 0:t[jj])}function Tj(t){return N8(this,arguments,function(){var e,n,r,s;return pj(this,function(c){switch(c.label){case 0:e=t.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,Ra(e.read())];case 3:return n=c.sent(),r=n.value,s=n.done,s?[4,Ra(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,Ra(r)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Oj(t){return Nt(t==null?void 0:t.getReader)}function xn(t){if(t instanceof hn)return t;if(t!=null){if(xj(t))return e7(t);if(r0(t))return t7(t);if(Sj(t))return n7(t);if(Cj(t))return Aj(t);if(kj(t))return r7(t);if(Oj(t))return s7(t)}throw Ej(t)}function e7(t){return new hn(function(e){var n=t[t0]();if(Nt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function t7(t){return new hn(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function n7(t){return new hn(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,bj)})}function r7(t){return new hn(function(e){var n,r;try{for(var s=Fa(t),c=s.next();!c.done;c=s.next()){var i=c.value;if(e.next(i),e.closed)return}}catch(o){n={error:o}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}e.complete()})}function Aj(t){return new hn(function(e){i7(t,e).catch(function(n){return e.error(n)})})}function s7(t){return Aj(Tj(t))}function i7(t,e){var n,r,s,c;return R8(this,void 0,void 0,function(){var i,o;return pj(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=L8(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=u.sent(),s={error:o},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Ro(t,e,n,r,s){r===void 0&&(r=0),s===void 0&&(s=!1);var c=e.schedule(function(){n(),s?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(c),!s)return c}function Ij(t,e){return e===void 0&&(e=0),Nn(function(n,r){n.subscribe(an(r,function(s){return Ro(r,t,function(){return r.next(s)},e)},function(){return Ro(r,t,function(){return r.complete()},e)},function(s){return Ro(r,t,function(){return r.error(s)},e)}))})}function Rj(t,e){return e===void 0&&(e=0),Nn(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function o7(t,e){return xn(t).pipe(Rj(e),Ij(e))}function a7(t,e){return xn(t).pipe(Rj(e),Ij(e))}function l7(t,e){return new hn(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function c7(t,e){return new hn(function(n){var r;return Ro(n,e,function(){r=t[jj](),Ro(n,e,function(){var s,c,i;try{s=r.next(),c=s.value,i=s.done}catch(o){n.error(o);return}i?n.complete():n.next(c)},0,!0)}),function(){return Nt(r==null?void 0:r.return)&&r.return()}})}function Nj(t,e){if(!t)throw new Error("Iterable cannot be null");return new hn(function(n){Ro(n,e,function(){var r=t[Symbol.asyncIterator]();Ro(n,e,function(){r.next().then(function(s){s.done?n.complete():n.next(s.value)})},0,!0)})})}function u7(t,e){return Nj(Tj(t),e)}function d7(t,e){if(t!=null){if(xj(t))return o7(t,e);if(r0(t))return l7(t,e);if(Sj(t))return a7(t,e);if(Cj(t))return Nj(t,e);if(kj(t))return c7(t,e);if(Oj(t))return u7(t,e)}throw Ej(t)}function Lj(t,e){return e?d7(t,e):xn(t)}function h7(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=wj(t);return Lj(t,n)}function f7(t){return t instanceof Date&&!isNaN(t)}function br(t,e){return Nn(function(n,r){var s=0;n.subscribe(an(r,function(c){r.next(t.call(e,c,s++))}))})}var p7=Array.isArray;function m7(t,e){return p7(e)?t.apply(void 0,Vi([],ri(e))):t(e)}function v7(t){return br(function(e){return m7(t,e)})}function g7(t,e,n,r,s,c,i,o){var u=[],l=0,a=0,d=!1,f=function(){d&&!u.length&&!l&&e.complete()},p=function(m){return l<r?v(m):u.push(m)},v=function(m){l++;var b=!1;xn(n(m,a++)).subscribe(an(e,function(y){e.next(y)},function(){b=!0},void 0,function(){if(b)try{l--;for(var y=function(){var _=u.shift();i||v(_)};u.length&&l<r;)y();f()}catch(_){e.error(_)}}))};return t.subscribe(an(e,p,function(){d=!0,f()})),function(){}}function Bc(t,e,n){return n===void 0&&(n=1/0),Nt(e)?Bc(function(r,s){return br(function(c,i){return e(r,c,s,i)})(xn(t(r,s)))},n):(typeof e=="number"&&(n=e),Nn(function(r,s){return g7(r,s,t,n)}))}function b7(t){return t===void 0&&(t=1/0),Bc(Hh,t)}function y7(t){return new hn(function(e){xn(t()).subscribe(e)})}var _7={connector:function(){return new Dr},resetOnDisconnect:!0};function jo(t,e){e===void 0&&(e=_7);var n=null,r=e.connector,s=e.resetOnDisconnect,c=s===void 0?!0:s,i=r(),o=new hn(function(u){return i.subscribe(u)});return o.connect=function(){return(!n||n.closed)&&(n=y7(function(){return t}).subscribe(i),c&&n.add(function(){return i=r()})),n},o}var w7=["addListener","removeListener"],S7=["addEventListener","removeEventListener"],x7=["on","off"];function Lv(t,e,n,r){if(Nt(n)&&(r=n,n=void 0),r)return Lv(t,e,n).pipe(v7(r));var s=ri(j7(t)?S7.map(function(o){return function(u){return t[o](e,u,n)}}):C7(t)?w7.map(Uw(t,e)):E7(t)?x7.map(Uw(t,e)):[],2),c=s[0],i=s[1];if(!c&&r0(t))return Bc(function(o){return Lv(o,e,n)})(xn(t));if(!c)throw new TypeError("Invalid event target");return new hn(function(o){var u=function(){for(var l=[],a=0;a<arguments.length;a++)l[a]=arguments[a];return o.next(1<l.length?l:l[0])};return c(u),function(){return i(u)}})}function Uw(t,e){return function(n){return function(r){return t[n](e,r)}}}function C7(t){return Nt(t.addListener)&&Nt(t.removeListener)}function E7(t){return Nt(t.on)&&Nt(t.off)}function j7(t){return Nt(t.addEventListener)&&Nt(t.removeEventListener)}function wc(t,e,n){t===void 0&&(t=0),n===void 0&&(n=X8);var r=-1;return e!=null&&(_j(e)?n=e:r=e),new hn(function(s){var c=f7(t)?+t-n.now():t;c<0&&(c=0);var i=0;return n.schedule(function(){s.closed||(s.next(i++),0<=r?this.schedule(void 0,r):s.complete())},c)})}function k7(t,e){return e===void 0&&(e=Wh),wc(t,t,e)}function T7(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=wj(t),r=J8(t,1/0),s=t;return s.length?s.length===1?xn(s[0]):b7(r)(Lj(s,n)):yj}var O7=Array.isArray;function A7(t){return t.length===1&&O7(t[0])?t[0]:t}function Ii(t,e){return Nn(function(n,r){var s=0;n.subscribe(an(r,function(c){return t.call(e,c,s++)&&r.next(c)}))})}function I7(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t=A7(t),t.length===1?xn(t[0]):new hn(R7(t))}function R7(t){return function(e){for(var n=[],r=function(c){n.push(xn(t[c]).subscribe(an(e,function(i){if(n){for(var o=0;o<n.length;o++)o!==c&&n[o].unsubscribe();n=null}e.next(i)})))},s=0;n&&!e.closed&&s<t.length;s++)r(s)}}function N7(t){return Nn(function(e,n){var r=null,s=null,c=function(){s==null||s.unsubscribe();var i=r;r=[],i&&n.next(i),xn(t()).subscribe(s=an(n,c,Pc))};c(),e.subscribe(an(n,function(i){return r==null?void 0:r.push(i)},function(){r&&n.next(r),n.complete()},void 0,function(){return r=s=null}))})}function Dj(t){return Nn(function(e,n){var r=null,s=!1,c;r=e.subscribe(an(n,void 0,void 0,function(i){c=xn(t(i,Dj(t)(e))),r?(r.unsubscribe(),r=null,c.subscribe(n)):s=!0})),s&&(r.unsubscribe(),r=null,c.subscribe(n))})}function L7(t,e,n,r,s){return function(c,i){var o=n,u=e,l=0;c.subscribe(an(i,function(a){var d=l++;u=o?t(u,a,d):(o=!0,a),i.next(u)},s))}}function Fw(t){return t<=0?function(){return yj}:Nn(function(e,n){var r=0;e.subscribe(an(n,function(s){++r<=t&&(n.next(s),t<=r&&n.complete())}))})}function D7(t){return Nn(function(e,n){try{e.subscribe(n)}finally{n.add(t)}})}function M7(t,e){return Nn(L7(t,e,arguments.length>=2,!0))}function P7(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new Dr}:e,r=t.resetOnError,s=r===void 0?!0:r,c=t.resetOnComplete,i=c===void 0?!0:c,o=t.resetOnRefCountZero,u=o===void 0?!0:o;return function(l){var a,d,f,p=0,v=!1,m=!1,b=function(){d==null||d.unsubscribe(),d=void 0},y=function(){b(),a=f=void 0,v=m=!1},_=function(){var S=a;y(),S==null||S.unsubscribe()};return Nn(function(S,C){p++,!m&&!v&&b();var x=f=f??n();C.add(function(){p--,p===0&&!m&&!v&&(d=Rm(_,u))}),x.subscribe(C),!a&&p>0&&(a=new $c({next:function(j){return x.next(j)},error:function(j){m=!0,b(),d=Rm(y,s,j),x.error(j)},complete:function(){v=!0,b(),d=Rm(y,i),x.complete()}}),xn(S).subscribe(a))})(l)}}function Rm(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var s=new $c({next:function(){s.unsubscribe(),t()}});return xn(e.apply(void 0,Vi([],ri(n)))).subscribe(s)}}function $7(t){return Nn(function(e,n){var r=!1,s=an(n,function(){s==null||s.unsubscribe(),r=!0},Pc);xn(t).subscribe(s),e.subscribe(an(n,function(c){return r&&n.next(c)}))})}function Vw(t,e){return Nn(function(n,r){var s=null,c=0,i=!1,o=function(){return i&&!s&&r.complete()};n.subscribe(an(r,function(u){s==null||s.unsubscribe();var l=0,a=c++;xn(t(u,a)).subscribe(s=an(r,function(d){return r.next(e?e(u,d,a,l++):d)},function(){s=null,o()}))},function(){i=!0,o()}))})}function Od(t,e){return e===void 0&&(e=!1),Nn(function(n,r){var s=0;n.subscribe(an(r,function(c){var i=t(c,s++);(i||e)&&r.next(c),!i&&r.complete()}))})}function zw(t,e,n){var r=Nt(t)||e||n?{next:t,error:e,complete:n}:t;return r?Nn(function(s,c){var i;(i=r.subscribe)===null||i===void 0||i.call(r);var o=!0;s.subscribe(an(c,function(u){var l;(l=r.next)===null||l===void 0||l.call(r,u),c.next(u)},function(){var u;o=!1,(u=r.complete)===null||u===void 0||u.call(r),c.complete()},function(u){var l;o=!1,(l=r.error)===null||l===void 0||l.call(r,u),c.error(u)},function(){var u,l;o&&((u=r.unsubscribe)===null||u===void 0||u.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):Hh}function B7(t,e){return Nn(function(n,r){var s=e??{},c=s.leading,i=c===void 0?!0:c,o=s.trailing,u=o===void 0?!1:o,l=!1,a=null,d=null,f=!1,p=function(){d==null||d.unsubscribe(),d=null,u&&(b(),f&&r.complete())},v=function(){d=null,f&&r.complete()},m=function(y){return d=xn(t(y)).subscribe(an(r,p,v))},b=function(){if(l){l=!1;var y=a;a=null,r.next(y),!f&&m(y)}};n.subscribe(an(r,function(y){l=!0,a=y,!(d&&!d.closed)&&(i?b():m(y))},function(){f=!0,!(u&&l&&d&&!d.closed)&&r.complete()}))})}function Hw(t,e,n){e===void 0&&(e=Wh);var r=wc(t,e);return B7(function(){return r},n)}function Nm(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=q8(t);return Nn(function(r,s){for(var c=t.length,i=new Array(c),o=t.map(function(){return!1}),u=!1,l=function(d){xn(t[d]).subscribe(an(s,function(f){i[d]=f,!u&&!o[d]&&(o[d]=!0,(u=o.every(Hh))&&(o=null))},Pc))},a=0;a<c;a++)l(a);r.subscribe(an(s,function(d){if(u){var f=Vi([d],ri(i));s.next(n?n.apply(void 0,Vi([],ri(f))):f)}}))})}const Mj="0123456789ABCDEFGHJKMNPQRSTVWXYZ",uh=32,U7=16,Pj=10,Ww=0xffffffffffff;var Oo;(function(t){t.Base32IncorrectEncoding="B32_ENC_INVALID",t.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",t.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",t.EncodeTimeNegative="ENC_TIME_NEG",t.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",t.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",t.PRNGDetectFailure="PRNG_DETECT",t.ULIDInvalid="ULID_INVALID",t.Unexpected="UNEXPECTED",t.UUIDInvalid="UUID_INVALID"})(Oo||(Oo={}));class hc extends Error{constructor(e,n){super(`${n} (${e})`),this.name="ULIDError",this.code=e}}function F7(t){const e=Math.floor(t()*uh)%uh;return Mj.charAt(e)}function V7(t){const e=z7(),n=e&&(e.crypto||e.msCrypto)||null;if(typeof(n==null?void 0:n.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return n.getRandomValues(r),r[0]/255};if(typeof(n==null?void 0:n.randomBytes)=="function")return()=>n.randomBytes(1).readUInt8()/255;throw new hc(Oo.PRNGDetectFailure,"Failed to find a reliable PRNG")}function z7(){return G7()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function H7(t,e){let n="";for(;t>0;t--)n=F7(e)+n;return n}function W7(t,e=Pj){if(isNaN(t))throw new hc(Oo.EncodeTimeValueMalformed,`Time must be a number: ${t}`);if(t>Ww)throw new hc(Oo.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Ww}: ${t}`);if(t<0)throw new hc(Oo.EncodeTimeNegative,`Time must be positive: ${t}`);if(Number.isInteger(t)===!1)throw new hc(Oo.EncodeTimeValueMalformed,`Time must be an integer: ${t}`);let n,r="";for(let s=e;s>0;s--)n=t%uh,r=Mj.charAt(n)+r,t=(t-n)/uh;return r}function G7(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Z7(t,e){const n=V7(),r=Date.now();return W7(r,Pj)+H7(U7,n)}const Tn=[];for(let t=0;t<256;++t)Tn.push((t+256).toString(16).slice(1));function Y7(t,e=0){return(Tn[t[e+0]]+Tn[t[e+1]]+Tn[t[e+2]]+Tn[t[e+3]]+"-"+Tn[t[e+4]]+Tn[t[e+5]]+"-"+Tn[t[e+6]]+Tn[t[e+7]]+"-"+Tn[t[e+8]]+Tn[t[e+9]]+"-"+Tn[t[e+10]]+Tn[t[e+11]]+Tn[t[e+12]]+Tn[t[e+13]]+Tn[t[e+14]]+Tn[t[e+15]]).toLowerCase()}let Lm;const K7=new Uint8Array(16);function X7(){if(!Lm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Lm=crypto.getRandomValues.bind(crypto)}return Lm(K7)}const q7=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gw={randomUUID:q7};function J7(t,e,n){var r;if(Gw.randomUUID&&!t)return Gw.randomUUID();t=t||{};const s=t.random??((r=t.rng)==null?void 0:r.call(t))??X7();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Y7(s)}const Q7=5e3,eL=1e3,Ad=4e3,Zw=1e3;var $j=(t=>(t.CONTINUOUS="CONTINUOUS",t.INITIAL="INITIAL",t))($j||{});class Bj{constructor({knownID:e,runID:n,sequence:r},{runnerEndpoint:s,authorization:c,autoReconnect:i}){Ht(this,"callback"),Ht(this,"queue",new Dr),Ht(this,"subscriptions",[]),Ht(this,"reconnect",new Dr),Ht(this,"client",new hn),Ht(this,"_latencies",new Dr),Ht(this,"_latenciesConnectable",jo(this._latencies.asObservable().pipe(M7((o,u)=>{if(u.latency<0){const l=o.get(u.streamID);l&&o.set(u.streamID,{...l,readyState:u.readyState})}else o.set(u.streamID,u);return o},new Map)))),Ht(this,"_errors",new Dr),Ht(this,"_errorsConnectable",jo(this._errors.asObservable())),Ht(this,"_stdout",new Dr),Ht(this,"_stderr",new Dr),Ht(this,"_exitCode",new Dr),Ht(this,"_pid",new Dr),Ht(this,"_mimeType",new Dr),Ht(this,"_stdoutConnectable",jo(this._stdout.asObservable())),Ht(this,"_stderrConnectable",jo(this._stderr.asObservable())),Ht(this,"_exitCodeConnectable",jo(this._exitCode.asObservable())),Ht(this,"_pidConnectable",jo(this._pid.asObservable())),Ht(this,"_mimeTypeConnectable",jo(this._mimeType.asObservable())),Ht(this,"knownID"),Ht(this,"runID"),Ht(this,"sequence"),Ht(this,"runnerEndpoint"),Ht(this,"authorization"),Ht(this,"autoReconnect"),this.knownID=e,this.runID=n,this.sequence=r,this.runnerEndpoint=s,this.authorization=c,this.autoReconnect=i,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(Hw(Zw,Wh,{leading:!0,trailing:!0}),Vw(o=>this.useSocketClient(o.streamID).pipe(Vw(u=>this.useHeartbeat(u,o))))).pipe(P7()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return k7(eL).pipe(Ii(()=>this.autoReconnect),Nm(this.reconnect),Ii(([,e])=>e.heartbeat==="CONTINUOUS"),Nm(this.latencies),br(([,e])=>Array.from(e.values()).filter(n=>n.readyState===WebSocket.OPEN&&n.latency>=Ad)),Ii(e=>e.length>0),Hw(Zw)).subscribe({next:e=>{console.log(new Date,"Triggering reconnect",e),this.connect()},complete:()=>{console.log("Monitor complete")},error:e=>{console.error("Error in monitor",e)}})}process(){const e=this.client.pipe(Ii(s=>(s==null?void 0:s.readyState)===WebSocket.OPEN),Fw(1)),n=this.queue.pipe(N7(()=>e),Ii(s=>s.length>0),br(s=>s.sort((c,i)=>{const o=u=>{var l;return!!((l=u.payload.value)!=null&&l.config)};return o(i)?1:o(c)?-1:0}))),r=this.queue.pipe($7(e));return T7(n.pipe(Bc(s=>s)),r).pipe(Nm(this.client),Od(([,s])=>s.readyState===WebSocket.OPEN),br(([s,c])=>Kw({req:s,authorization:this.authorization,socket:c,knownID:this.knownID,runID:this.runID}))).subscribe({error:s=>{this._errors.next(s)}})}useSocketClient(e){return new hn(n=>{const r=new URL(this.runnerEndpoint);r.searchParams.set("id",e),r.searchParams.set("runID",this.runID);const s=new WebSocket(r.toString()),c=l=>{if(console.log(new Date,`WebSocket transport ${e} closed`,l),l.code===1005){n.complete();return}if(this.autoReconnect){this.connect();return}},i=l=>{console.log(new Date,`WebSocket transport ${e} error`,l),this.autoReconnect||n.error(l)},o=l=>{var a,d;if(typeof l.data!="string"){console.warn("Unexpected WebSocket message type:",typeof l.data);return}let f;try{f=Yw(l.data),console.log("Received WebsocketResponse:",f)}catch(m){console.error("Failed to parse WebsocketResponse:",m)}const p=f.status;if(p&&p.code!==O8.OK){n.error(p);return}if(f.pong)return;const v=f.payload.value;if(v.stdoutData&&v.stdoutData.length>0&&((a=this.callback)==null||a.call(this,{type:_c.terminalStdout,output:{"runme.dev/id":this.knownID,data:v.stdoutData}}),this._stdout.next(v.stdoutData)),v.stderrData&&v.stderrData.length>0&&((d=this.callback)==null||d.call(this,{type:_c.terminalStderr,output:{"runme.dev/id":this.knownID,data:v.stderrData}}),this._stderr.next(v.stderrData)),v.exitCode!==void 0&&(this._exitCode.next(v.exitCode),n.complete()),v.pid!==void 0&&this._pid.next(v.pid),v.mimeType){const m=v.mimeType.split(";")[0];this._mimeType.next(m)}},u=()=>{console.log(new Date,`✅ Connected WebSocket for block ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),n.next(s)};return s.addEventListener("close",c),s.addEventListener("error",i),s.addEventListener("message",o),s.addEventListener("open",u),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for block ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),s.removeEventListener("close",c),s.removeEventListener("error",i),s.removeEventListener("message",o),s.removeEventListener("open",u),s.close()}})}setCallback(e){this.callback=e}sendExecuteRequest(e){this.queue.next($n(Rv,{payload:{value:e,case:"executeRequest"}}))}useHeartbeat(e,{streamID:n,heartbeat:r}){return new hn(s=>{const c=Lv(e,"message").pipe(Od(()=>e.readyState===WebSocket.OPEN),br(u=>Yw(u.data)),br(u=>u.pong),Ii(u=>u!==void 0),br(u=>({receivedAt:BigInt(Date.now()),pong:u}))),i=(r==="INITIAL"?wc(0):wc(0,Q7)).pipe(Od(()=>e.readyState===WebSocket.OPEN),br(()=>{const u={timestamp:BigInt(Date.now())};return $n(Rv,{ping:u})}),zw(u=>{Kw({req:u,authorization:this.authorization,socket:e})}),br(u=>u.ping)).pipe(Ii(u=>(u==null?void 0:u.timestamp)!==void 0),Bc(u=>I7(c.pipe(Ii(l=>l.pong.timestamp===u.timestamp),Fw(1),br(l=>{const a=u.timestamp,d=l.receivedAt;return Number(d-a)})),wc(Ad).pipe(br(()=>{throw new Error(`Pong not received within ${Ad}ms for stream ${n}`)}))).pipe(Dj(l=>(this._latencies.next({streamID:n,latency:Ad,readyState:e.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",l.message),h7(null))))),D7(()=>{this._latencies.next({streamID:n,latency:-1,readyState:e.readyState,updatedAt:BigInt(Date.now())})}),zw(u=>{u!==null&&this._latencies.next({streamID:n,latency:u,readyState:e.readyState,updatedAt:BigInt(Date.now())})})),o=[];return o.push(i.subscribe({error:u=>{console.error("Unexpected error sending heartbeat",u)}})),s.next(e),()=>{o.forEach(u=>u.unsubscribe())}})}connect(e="CONTINUOUS"){const n=tL(),r=this.latencies.pipe(br(s=>{const c=s.get(n);return c===void 0?null:c}),Od(s=>(s==null?void 0:s.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:n,heartbeat:e}),r}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(e=>e.unsubscribe())}}function Yw(t){const e=JSON.parse(t);return f8(I8,e)}function Kw({req:t,authorization:e,socket:n,knownID:r,runID:s}){r&&(t.knownId=r),s&&(t.runId=s);const{bearerToken:c}=e;c&&t&&(t.authorization=`Bearer ${c}`),n.send(JSON.stringify(r8(Rv,t)))}function tL(){return J7().replace(/-/g,"")}function Uj(){return`run_${Z7()}`}function nL({blockID:t,runID:e,sequence:n,commands:r,runner:s,settings:c={},onStdout:i,onStderr:o,onExitCode:u,onPid:l,onMimeType:a}){var d;const{rows:f=20,className:p,fontSize:v=12,fontFamily:m="monospace",takeFocus:b=!0,scrollToFit:y=!0}=c,_=D.useMemo(()=>{if(!(!t||!e||!s.endpoint))return console.log("Creating stream",t,e,s.endpoint),new Bj({knownID:t,runID:e,sequence:n},{runnerEndpoint:s.endpoint,authorization:s.authorization,autoReconnect:s.reconnect})},[t,e,n,s]);D.useEffect(()=>{const k=_==null?void 0:_.connect().subscribe(T=>console.log(`Heartbeat latency for streamID ${T==null?void 0:T.streamID} (${(T==null?void 0:T.readyState)===1?"open":"closed"}): ${T==null?void 0:T.latency}ms`));return()=>{k==null||k.unsubscribe(),_==null||_.close()}},[_]);let S=$n(Ow,{rows:34,cols:100,x:0,y:0});const C=D.useMemo(()=>$n(Am,{sessionStrategy:XN.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:"sh",background:!1,fileExtension:"",env:[`RUNME_ID=${t}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],source:{case:"commands",value:{items:r}},interactive:!0,mode:BN.INLINE,runId:e,knownId:t},winsize:S}),[t,r,S]),x=D.useMemo(()=>{var k;return{output:{"runme.dev/id":(k=C.config)==null?void 0:k.knownId,fontFamily:m||"monospace",fontSize:v||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:b,scrollToFit:y,smoothScrollDuration:0,scrollback:4e3,initialRows:f,content:"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[m,v,b,f,(d=C.config)==null?void 0:d.knownId,y]),j=new TextEncoder;return j8({postMessage:k=>{if(k.type===_c.terminalOpen||k.type===_c.terminalResize){const T=Number(k.output.terminalDimensions.columns),A=Number(k.output.terminalDimensions.rows);if(Number.isFinite(T)&&Number.isFinite(A)){if(S.cols===T&&S.rows===A)return;S=$n(Ow,{cols:T,rows:A,x:0,y:0});const L=$n(Am,{winsize:S});_==null||_.sendExecuteRequest(L)}}if(k.type===_c.terminalStdin){const T=j.encode(k.output.input),A=$n(Am,{inputData:T});_==null||_.sendExecuteRequest(A)}},onDidReceiveMessage:k=>{_==null||_.setCallback(k)}}),D.useEffect(()=>{const k=_==null?void 0:_.stdout.subscribe(T=>{i==null||i(T)});return()=>k==null?void 0:k.unsubscribe()},[_,i]),D.useEffect(()=>{const k=_==null?void 0:_.stderr.subscribe(T=>{o==null||o(T)});return()=>k==null?void 0:k.unsubscribe()},[_,o]),D.useEffect(()=>{const k=_==null?void 0:_.exitCode.subscribe(T=>{u==null||u(T),_==null||_.close()});return()=>k==null?void 0:k.unsubscribe()},[_,u]),D.useEffect(()=>{const k=_==null?void 0:_.pid.subscribe(T=>{l==null||l(T)});return()=>k==null?void 0:k.unsubscribe()},[_,l]),D.useEffect(()=>{const k=_==null?void 0:_.mimeType.subscribe(T=>{a==null||a(T)});return()=>k==null?void 0:k.unsubscribe()},[_,a]),D.useEffect(()=>{!_||!C||(console.log("useEffect invoked - Commands changed:",JSON.stringify(C.config.source.value)),_==null||_.sendExecuteRequest(C))},[C,_]),J.jsx("div",{className:p,ref:k=>{if(!k||k.hasChildNodes())return;const T=document.createElement("terminal-view");T.setAttribute("buttons","false"),T.setAttribute("id",x.output["runme.dev/id"]),T.setAttribute("fontFamily",x.output.fontFamily),typeof x.output.fontSize=="number"&&T.setAttribute("fontSize",x.output.fontSize.toString()),x.output.cursorStyle&&T.setAttribute("cursorStyle",x.output.cursorStyle),typeof x.output.cursorBlink=="boolean"&&T.setAttribute("cursorBlink",x.output.cursorBlink?"true":"false"),typeof x.output.cursorWidth=="number"&&T.setAttribute("cursorWidth",x.output.cursorWidth.toString()),typeof x.output.takeFocus=="boolean"&&T.setAttribute("takeFocus",x.output.takeFocus?"true":"false"),typeof x.output.smoothScrollDuration=="number"&&T.setAttribute("smoothScrollDuration",x.output.smoothScrollDuration.toString()),typeof x.output.scrollback=="number"&&T.setAttribute("scrollback",x.output.scrollback.toString()),x.output.initialRows!==void 0&&T.setAttribute("initialRows",x.output.initialRows.toString()),x.output.content!==void 0&&T.setAttribute("initialContent",x.output.content),x.output.isAutoSaveEnabled&&T.setAttribute("isAutoSaveEnabled",x.output.isAutoSaveEnabled.toString()),x.output.isPlatformAuthEnabled&&T.setAttribute("isPlatformAuthEnabled",x.output.isPlatformAuthEnabled.toString()),k.appendChild(T);const A=document.createElement("div");A.setAttribute("className","h-1"),k.appendChild(A),setTimeout(()=>{y&&!rL(A)&&A.scrollIntoView({behavior:"smooth"})},0)}})}function rL(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function Uc(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let s=t.charAt(r);switch(s){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(s),e=!1;break;default:e&&(e=!1,s=s.toUpperCase()),n.push(s);break}}return n.join("")}const sL=new Set(["constructor","toString","toJSON","valueOf"]);function Fc(t){return sL.has(t)?t+"$":t}function iL(){let t=0,e=0;for(let r=0;r<28;r+=7){let s=this.buf[this.pos++];if(t|=(s&127)<<r,(s&128)==0)return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(n&15)<<28,e=(n&112)>>4,(n&128)==0)return this.assertBounds(),[t,e];for(let r=3;r<=31;r+=7){let s=this.buf[this.pos++];if(e|=(s&127)<<r,(s&128)==0)return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function Dm(t,e,n){for(let c=0;c<28;c=c+7){const i=t>>>c,o=!(!(i>>>7)&&e==0),u=(o?i|128:i)&255;if(n.push(u),!o)return}const r=t>>>28&15|(e&7)<<4,s=e>>3!=0;if(n.push((s?r|128:r)&255),!!s){for(let c=3;c<31;c=c+7){const i=e>>>c,o=!!(i>>>7),u=(o?i|128:i)&255;if(n.push(u),!o)return}n.push(e>>>31&1)}}const Zd=4294967296;function Xw(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let r=0,s=0;function c(i,o){const u=Number(t.slice(i,o));s*=n,r=r*n+u,r>=Zd&&(s=s+(r/Zd|0),r=r%Zd)}return c(-24,-18),c(-18,-12),c(-12,-6),c(-6),e?Vj(r,s):s0(r,s)}function oL(t,e){let n=s0(t,e);const r=n.hi&2147483648;r&&(n=Vj(n.lo,n.hi));const s=Fj(n.lo,n.hi);return r?"-"+s:s}function Fj(t,e){if({lo:t,hi:e}=aL(t,e),e<=2097151)return String(Zd*e+t);const n=t&16777215,r=(t>>>24|e<<8)&16777215,s=e>>16&65535;let c=n+r*6777216+s*6710656,i=r+s*8147497,o=s*2;const u=1e7;return c>=u&&(i+=Math.floor(c/u),c%=u),i>=u&&(o+=Math.floor(i/u),i%=u),o.toString()+qw(i)+qw(c)}function aL(t,e){return{lo:t>>>0,hi:e>>>0}}function s0(t,e){return{lo:t|0,hi:e|0}}function Vj(t,e){return e=~e,t?t=~t+1:e+=1,s0(t,e)}const qw=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Jw(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function lL(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;(t&128)!==0&&n<10;n++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var Qw={};const Zt=cL();function cL(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof Qw!="object"||Qw.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),s=BigInt("0"),c=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){const o=typeof i=="bigint"?i:BigInt(i);if(o>r||o<n)throw new Error(`invalid int64: ${i}`);return o},uParse(i){const o=typeof i=="bigint"?i:BigInt(i);if(o>c||o<s)throw new Error(`invalid uint64: ${i}`);return o},enc(i){return t.setBigInt64(0,this.parse(i),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(i){return t.setBigInt64(0,this.uParse(i),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(i,o){return t.setInt32(0,i,!0),t.setInt32(4,o,!0),t.getBigInt64(0,!0)},uDec(i,o){return t.setInt32(0,i,!0),t.setInt32(4,o,!0),t.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(n){return typeof n!="string"&&(n=n.toString()),eS(n),n},uParse(n){return typeof n!="string"&&(n=n.toString()),tS(n),n},enc(n){return typeof n!="string"&&(n=n.toString()),eS(n),Xw(n)},uEnc(n){return typeof n!="string"&&(n=n.toString()),tS(n),Xw(n)},dec(n,r){return oL(n,r)},uDec(n,r){return Fj(n,r)}}}function eS(t){if(!/^-?[0-9]+$/.test(t))throw new Error("invalid int64: "+t)}function tS(t){if(!/^[0-9]+$/.test(t))throw new Error("invalid uint64: "+t)}var we;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(we||(we={}));function Do(t,e){switch(t){case we.STRING:return"";case we.BOOL:return!1;case we.DOUBLE:case we.FLOAT:return 0;case we.INT64:case we.UINT64:case we.SFIXED64:case we.FIXED64:case we.SINT64:return e?"0":Zt.zero;case we.BYTES:return new Uint8Array(0);default:return 0}}function uL(t,e){switch(t){case we.BOOL:return e===!1;case we.STRING:return e==="";case we.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}const zj=2,qs=Symbol.for("reflect unsafe local");function Hj(t,e){const n=t[e.localName].case;return n===void 0?n:e.fields.find(r=>r.localName===n)}function dL(t,e){const n=e.localName;if(e.oneof)return t[e.oneof.localName].case===n;if(e.presence!=zj)return t[n]!==void 0&&Object.prototype.hasOwnProperty.call(t,n);switch(e.fieldKind){case"list":return t[n].length>0;case"map":return Object.keys(t[n]).length>0;case"scalar":return!uL(e.scalar,t[n]);case"enum":return t[n]!==e.enum.values[0].number}throw new Error("message field with implicit presence")}function Vc(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==void 0}function Wj(t,e){if(e.oneof){const n=t[e.oneof.localName];return n.case===e.localName?n.value:void 0}return t[e.localName]}function Gj(t,e,n){e.oneof?t[e.oneof.localName]={case:e.localName,value:n}:t[e.localName]=n}function hL(t,e){const n=e.localName;if(e.oneof){const r=e.oneof.localName;t[r].case===n&&(t[r]={case:void 0})}else if(e.presence!=zj)delete t[n];else switch(e.fieldKind){case"map":t[n]={};break;case"list":t[n]=[];break;case"enum":t[n]=e.enum.values[0].number;break;case"scalar":t[n]=Do(e.scalar,e.longAsString);break}}function i0(t){for(const e of t.field)Vc(e,"jsonName")||(e.jsonName=Uc(e.name));t.nestedType.forEach(i0)}function fL(t,e){const n=t.values.find(r=>r.name===e);if(!n)throw new Error(`cannot parse ${t} default value: ${e}`);return n.number}function pL(t,e){switch(t){case we.STRING:return e;case we.BYTES:{const n=mL(e);if(n===!1)throw new Error(`cannot parse ${we[t]} default value: ${e}`);return n}case we.INT64:case we.SFIXED64:case we.SINT64:return Zt.parse(e);case we.UINT64:case we.FIXED64:return Zt.uParse(e);case we.DOUBLE:case we.FLOAT:switch(e){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(e)}case we.BOOL:return e==="true";case we.INT32:case we.UINT32:case we.SINT32:case we.FIXED32:case we.SFIXED32:return parseInt(e,10)}}function mL(t){const e=[],n={tail:t,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(r){if(this.tail.length>=r){const s=this.tail.substring(0,r);return this.tail=this.tail.substring(r),s}return!1}};for(;n.next();)switch(n.c){case"\\":if(n.next())switch(n.c){case"\\":e.push(n.c.charCodeAt(0));break;case"b":e.push(8);break;case"f":e.push(12);break;case"n":e.push(10);break;case"r":e.push(13);break;case"t":e.push(9);break;case"v":e.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const r=n.c,s=n.take(2);if(s===!1)return!1;const c=parseInt(r+s,8);if(Number.isNaN(c))return!1;e.push(c);break}case"x":{const r=n.c,s=n.take(2);if(s===!1)return!1;const c=parseInt(r+s,16);if(Number.isNaN(c))return!1;e.push(c);break}case"u":{const r=n.c,s=n.take(4);if(s===!1)return!1;const c=parseInt(r+s,16);if(Number.isNaN(c))return!1;const i=new Uint8Array(4);new DataView(i.buffer).setInt32(0,c,!0),e.push(i[0],i[1],i[2],i[3]);break}case"U":{const r=n.c,s=n.take(8);if(s===!1)return!1;const c=Zt.uEnc(r+s),i=new Uint8Array(8),o=new DataView(i.buffer);o.setInt32(0,c.lo,!0),o.setInt32(4,c.hi,!0),e.push(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);break}}break;default:e.push(n.c.charCodeAt(0))}return new Uint8Array(e)}function*Dv(t){switch(t.kind){case"file":for(const e of t.messages)yield e,yield*Dv(e);yield*t.enums,yield*t.services,yield*t.extensions;break;case"message":for(const e of t.nestedMessages)yield e,yield*Dv(e);yield*t.nestedEnums,yield*t.nestedExtensions;break}}function Zj(...t){const e=vL();if(!t.length)return e;if("$typeName"in t[0]&&t[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of t[0].file)iS(r,e);return e}if("$typeName"in t[0]){let i=function(o){const u=[];for(const l of o.dependency){if(e.getFile(l)!=null||c.has(l))continue;const a=s(l);if(!a)throw new Error(`Unable to resolve ${l}, imported by ${o.name}`);"kind"in a?e.addFile(a,!1,!0):(c.add(a.name),u.push(a))}return u.concat(...u.map(i))};var n=i;const r=t[0],s=t[1],c=new Set;for(const o of[r,...i(r)].reverse())iS(o,e)}else for(const r of t)for(const s of r.files)e.addFile(s);return e}function vL(){const t=new Map,e=new Map,n=new Map;return{kind:"registry",types:t,extendees:e,[Symbol.iterator](){return t.values()},get files(){return n.values()},addFile(r,s,c){if(n.set(r.proto.name,r),!s)for(const i of Dv(r))this.add(i);if(c)for(const i of r.dependencies)this.addFile(i,s,c)},add(r){if(r.kind=="extension"){let s=e.get(r.extendee.typeName);s||e.set(r.extendee.typeName,s=new Map),s.set(r.number,r)}t.set(r.typeName,r)},get(r){return t.get(r)},getFile(r){return n.get(r)},getMessage(r){const s=t.get(r);return(s==null?void 0:s.kind)=="message"?s:void 0},getEnum(r){const s=t.get(r);return(s==null?void 0:s.kind)=="enum"?s:void 0},getExtension(r){const s=t.get(r);return(s==null?void 0:s.kind)=="extension"?s:void 0},getExtensionFor(r,s){var c;return(c=e.get(r.typeName))===null||c===void 0?void 0:c.get(s)},getService(r){const s=t.get(r);return(s==null?void 0:s.kind)=="service"?s:void 0}}}const gL=998,bL=999,yL=9,zc=10,Sc=11,_L=12,nS=14,o0=3,wL=2,rS=1,SL=0,Mm=1,sS=2,xL=3,CL=1,EL=2,jL=1,Yj={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2}};function iS(t,e){var n,r;const s={kind:"file",proto:t,deprecated:(r=(n=t.options)===null||n===void 0?void 0:n.deprecated)!==null&&r!==void 0?r:!1,edition:AL(t),name:t.name.replace(/\.proto$/,""),dependencies:IL(t,e),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${t.name}`}},c=new Map,i={get(o){return c.get(o)},add(o){var u;Xr(((u=o.proto.options)===null||u===void 0?void 0:u.mapEntry)===!0),c.set(o.typeName,o)}};for(const o of t.enumType)Kj(o,s,void 0,e);for(const o of t.messageType)Xj(o,s,void 0,e,i);for(const o of t.service)kL(o,s,e);Mv(s,e);for(const o of c.values())Pv(o,e,i);for(const o of s.messages)Pv(o,e,i),Mv(o,e);e.addFile(s,!0)}function Mv(t,e){switch(t.kind){case"file":for(const n of t.proto.extension){const r=$v(n,t,e);t.extensions.push(r),e.add(r)}break;case"message":for(const n of t.proto.extension){const r=$v(n,t,e);t.nestedExtensions.push(r),e.add(r)}for(const n of t.nestedMessages)Mv(n,e);break}}function Pv(t,e,n){const r=t.proto.oneofDecl.map(c=>OL(c,t)),s=new Set;for(const c of t.proto.field){const i=LL(c,r),o=$v(c,t,e,i,n);t.fields.push(o),t.field[o.localName]=o,i===void 0?t.members.push(o):(i.fields.push(o),s.has(i)||(s.add(i),t.members.push(i)))}for(const c of r.filter(i=>s.has(i)))t.oneofs.push(c);for(const c of t.nestedMessages)Pv(c,e,n)}function Kj(t,e,n,r){var s,c,i,o,u;const l=RL(t.name,t.value),a={kind:"enum",proto:t,deprecated:(c=(s=t.options)===null||s===void 0?void 0:s.deprecated)!==null&&c!==void 0?c:!1,file:e,parent:n,open:!0,name:t.name,typeName:Gh(t,n,e),value:{},values:[],sharedPrefix:l,toString(){return`enum ${this.typeName}`}};a.open=$L(a),r.add(a);for(const d of t.value){const f=d.name;a.values.push(a.value[d.number]={kind:"enum_value",proto:d,deprecated:(o=(i=d.options)===null||i===void 0?void 0:i.deprecated)!==null&&o!==void 0?o:!1,parent:a,name:f,localName:Fc(l==null?f:f.substring(l.length)),number:d.number,toString(){return`enum value ${a.typeName}.${f}`}})}((u=n==null?void 0:n.nestedEnums)!==null&&u!==void 0?u:e.enums).push(a)}function Xj(t,e,n,r,s){var c,i,o,u;const l={kind:"message",proto:t,deprecated:(i=(c=t.options)===null||c===void 0?void 0:c.deprecated)!==null&&i!==void 0?i:!1,file:e,parent:n,name:t.name,typeName:Gh(t,n,e),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((o=t.options)===null||o===void 0?void 0:o.mapEntry)===!0?s.add(l):(((u=n==null?void 0:n.nestedMessages)!==null&&u!==void 0?u:e.messages).push(l),r.add(l));for(const a of t.enumType)Kj(a,e,l,r);for(const a of t.nestedType)Xj(a,e,l,r,s)}function kL(t,e,n){var r,s;const c={kind:"service",proto:t,deprecated:(s=(r=t.options)===null||r===void 0?void 0:r.deprecated)!==null&&s!==void 0?s:!1,file:e,name:t.name,typeName:Gh(t,void 0,e),methods:[],method:{},toString(){return`service ${this.typeName}`}};e.services.push(c),n.add(c);for(const i of t.method){const o=TL(i,c,n);c.methods.push(o),c.method[o.localName]=o}}function TL(t,e,n){var r,s,c,i;let o;t.clientStreaming&&t.serverStreaming?o="bidi_streaming":t.clientStreaming?o="client_streaming":t.serverStreaming?o="server_streaming":o="unary";const u=n.getMessage(Ks(t.inputType)),l=n.getMessage(Ks(t.outputType));Xr(u,`invalid MethodDescriptorProto: input_type ${t.inputType} not found`),Xr(l,`invalid MethodDescriptorProto: output_type ${t.inputType} not found`);const a=t.name;return{kind:"rpc",proto:t,deprecated:(s=(r=t.options)===null||r===void 0?void 0:r.deprecated)!==null&&s!==void 0?s:!1,parent:e,name:a,localName:Fc(a.length?Fc(a[0].toLowerCase()+a.substring(1)):a),methodKind:o,input:u,output:l,idempotency:(i=(c=t.options)===null||c===void 0?void 0:c.idempotencyLevel)!==null&&i!==void 0?i:SL,toString(){return`rpc ${e.typeName}.${a}`}}}function OL(t,e){return{kind:"oneof",proto:t,deprecated:!1,parent:e,fields:[],name:t.name,localName:Fc(Uc(t.name)),toString(){return`oneof ${e.typeName}.${this.name}`}}}function $v(t,e,n,r,s){var c,i,o;const u=s===void 0,l={kind:"field",proto:t,deprecated:(i=(c=t.options)===null||c===void 0?void 0:c.deprecated)!==null&&i!==void 0?i:!1,name:t.name,number:t.number,scalar:void 0,message:void 0,enum:void 0,presence:DL(t,r,u,e),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(u){const p=e.kind=="file"?e:e.file,v=e.kind=="file"?void 0:e,m=Gh(t,v,p);l.kind="extension",l.file=p,l.parent=v,l.oneof=void 0,l.typeName=m,l.jsonName=`[${m}]`,l.toString=()=>`extension ${m}`;const b=n.getMessage(Ks(t.extendee));Xr(b,`invalid FieldDescriptorProto: extendee ${t.extendee} not found`),l.extendee=b}else{const p=e;Xr(p.kind=="message"),l.parent=p,l.oneof=r,l.localName=r?Uc(t.name):Fc(Uc(t.name)),l.jsonName=t.jsonName,l.toString=()=>`field ${p.typeName}.${t.name}`}const a=t.label,d=t.type,f=(o=t.options)===null||o===void 0?void 0:o.jstype;if(a===o0){const p=d==Sc?s==null?void 0:s.get(Ks(t.typeName)):void 0;if(p){l.fieldKind="map";const{key:v,value:m}=PL(p);return l.mapKey=v.scalar,l.mapKind=m.fieldKind,l.message=m.message,l.delimitedEncoding=!1,l.enum=m.enum,l.scalar=m.scalar,l}switch(l.fieldKind="list",d){case Sc:case zc:l.listKind="message",l.message=n.getMessage(Ks(t.typeName)),Xr(l.message),l.delimitedEncoding=oS(t,e);break;case nS:l.listKind="enum",l.enum=n.getEnum(Ks(t.typeName)),Xr(l.enum);break;default:l.listKind="scalar",l.scalar=d,l.longAsString=f==rS;break}return l.packed=ML(t,e),l}switch(d){case Sc:case zc:l.fieldKind="message",l.message=n.getMessage(Ks(t.typeName)),Xr(l.message,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),l.delimitedEncoding=oS(t,e),l.getDefaultValue=()=>{};break;case nS:{const p=n.getEnum(Ks(t.typeName));Xr(p!==void 0,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),l.fieldKind="enum",l.enum=n.getEnum(Ks(t.typeName)),l.getDefaultValue=()=>Vc(t,"defaultValue")?fL(p,t.defaultValue):void 0;break}default:{l.fieldKind="scalar",l.scalar=d,l.longAsString=f==rS,l.getDefaultValue=()=>Vc(t,"defaultValue")?pL(d,t.defaultValue):void 0;break}}return l}function AL(t){switch(t.syntax){case"":case"proto2":return gL;case"proto3":return bL;case"editions":if(t.edition in Yj)return t.edition;throw new Error(`${t.name}: unsupported edition`);default:throw new Error(`${t.name}: unsupported syntax "${t.syntax}"`)}}function IL(t,e){return t.dependency.map(n=>{const r=e.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${t.name}`);return r})}function RL(t,e){const n=NL(t)+"_";for(const r of e){if(!r.name.toLowerCase().startsWith(n))return;const s=r.name.substring(n.length);if(s.length==0||/^\d/.test(s))return}return n}function NL(t){return(t.substring(0,1)+t.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()}function Gh(t,e,n){let r;return e?r=`${e.typeName}.${t.name}`:n.proto.package.length>0?r=`${n.proto.package}.${t.name}`:r=`${t.name}`,r}function Ks(t){return t.startsWith(".")?t.substring(1):t}function LL(t,e){if(!Vc(t,"oneofIndex")||t.proto3Optional)return;const n=e[t.oneofIndex];return Xr(n,`invalid FieldDescriptorProto: oneof #${t.oneofIndex} for field #${t.number} not found`),n}function DL(t,e,n,r){if(t.label==wL)return xL;if(t.label==o0)return sS;if(e||t.proto3Optional||n)return Mm;const s=Va("fieldPresence",{proto:t,parent:r});return s==sS&&(t.type==Sc||t.type==zc)?Mm:s}function ML(t,e){if(t.label!=o0)return!1;switch(t.type){case yL:case _L:case zc:case Sc:return!1}const n=t.options;return n&&Vc(n,"packed")?n.packed:CL==Va("repeatedFieldEncoding",{proto:t,parent:e})}function PL(t){const e=t.fields.find(r=>r.number===1),n=t.fields.find(r=>r.number===2);return Xr(e&&e.fieldKind=="scalar"&&e.scalar!=we.BYTES&&e.scalar!=we.FLOAT&&e.scalar!=we.DOUBLE&&n&&n.fieldKind!="list"&&n.fieldKind!="map"),{key:e,value:n}}function $L(t){var e;return jL==Va("enumType",{proto:t.proto,parent:(e=t.parent)!==null&&e!==void 0?e:t.file})}function oS(t,e){return t.type==zc?!0:EL==Va("messageEncoding",{proto:t,parent:e})}function Va(t,e){var n,r;const s=(n=e.proto.options)===null||n===void 0?void 0:n.features;if(s){const c=s[t];if(c!=0)return c}if("kind"in e){if(e.kind=="message")return Va(t,(r=e.parent)!==null&&r!==void 0?r:e.file);const c=Yj[e.edition];if(!c)throw new Error(`feature default for edition ${e.edition} not found`);return c[t]}return Va(t,e.parent)}function Xr(t,e){if(!t)throw new Error(e)}function BL(t){const e=UL(t);return e.messageType.forEach(i0),Zj(e,()=>{}).getFile(e.name)}function UL(t){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],service:[],extension:[]},t),{messageType:t.messageType.map(qj),enumType:t.enumType.map(Jj)}))}function qj(t){var e,n,r,s,c,i,o,u;return{$typeName:"google.protobuf.DescriptorProto",name:t.name,field:(n=(e=t.field)===null||e===void 0?void 0:e.map(FL))!==null&&n!==void 0?n:[],extension:[],nestedType:(s=(r=t.nestedType)===null||r===void 0?void 0:r.map(qj))!==null&&s!==void 0?s:[],enumType:(i=(c=t.enumType)===null||c===void 0?void 0:c.map(Jj))!==null&&i!==void 0?i:[],extensionRange:(u=(o=t.extensionRange)===null||o===void 0?void 0:o.map(l=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},l)))!==null&&u!==void 0?u:[],oneofDecl:[],reservedRange:[],reservedName:[]}}function FL(t){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},t),{options:t.options?VL(t.options):void 0}))}function VL(t){var e,n,r;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},t),{targets:(e=t.targets)!==null&&e!==void 0?e:[],editionDefaults:(r=(n=t.editionDefaults)===null||n===void 0?void 0:n.map(c=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},c)))!==null&&r!==void 0?r:[],uninterpretedOption:[]}))}function Jj(t){return{$typeName:"google.protobuf.EnumDescriptorProto",name:t.name,reservedName:[],reservedRange:[],value:t.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))}}function a0(t){const e=HL();let n=t.length*3/4;t[t.length-2]=="="?n-=2:t[t.length-1]=="="&&(n-=1);let r=new Uint8Array(n),s=0,c=0,i,o=0;for(let u=0;u<t.length;u++){if(i=e[t.charCodeAt(u)],i===void 0)switch(t[u]){case"=":c=0;case`
6646
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(c){case 0:o=i,c=1;break;case 1:r[s++]=o<<2|(i&48)>>4,o=i,c=2;break;case 2:r[s++]=(o&15)<<4|(i&60)>>2,o=i,c=3;break;case 3:r[s++]=(o&3)<<6|i,c=0;break}}if(c==1)throw Error("invalid base64 string");return r.subarray(0,s)}function zL(t,e="std"){const n=Qj(e),r=e=="std";let s="",c=0,i,o=0;for(let u=0;u<t.length;u++)switch(i=t[u],c){case 0:s+=n[i>>2],o=(i&3)<<4,c=1;break;case 1:s+=n[o|i>>4],o=(i&15)<<2,c=2;break;case 2:s+=n[o|i>>6],s+=n[i&63],c=0;break}return c&&(s+=n[o],r&&(s+="=",c==1&&(s+="="))),s}let Id,aS,Ea;function Qj(t){return Id||(Id="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),aS=Id.slice(0,-2).concat("-","_")),t=="url"?aS:Id}function HL(){if(!Ea){Ea=[];const t=Qj("std");for(let e=0;e<t.length;e++)Ea[t[e].charCodeAt(0)]=e;Ea[45]=t.indexOf("+"),Ea[95]=t.indexOf("/")}return Ea}function l0(t,e){return t!==null&&typeof t=="object"&&"$typeName"in t&&typeof t.$typeName=="string"?e===void 0?!0:e.typeName===t.$typeName:!1}const WL=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class nr extends Error{constructor(e,n,r="FieldValueInvalidError"){super(n),this.name=r,this.field=()=>e}}function GL(t){return t instanceof Error&&WL.includes(t.name)&&"field"in t&&typeof t.field=="function"}function zi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function c0(t,e){var n,r,s,c;if(zi(t)&&qs in t&&"add"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){const i=e,o=t.field();return i.listKind==o.listKind&&i.scalar===o.scalar&&((n=i.message)===null||n===void 0?void 0:n.typeName)===((r=o.message)===null||r===void 0?void 0:r.typeName)&&((s=i.enum)===null||s===void 0?void 0:s.typeName)===((c=o.enum)===null||c===void 0?void 0:c.typeName)}return!0}return!1}function u0(t,e){var n,r,s,c;if(zi(t)&&qs in t&&"has"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){const i=e,o=t.field();return i.mapKey===o.mapKey&&i.mapKind==o.mapKind&&i.scalar===o.scalar&&((n=i.message)===null||n===void 0?void 0:n.typeName)===((r=o.message)===null||r===void 0?void 0:r.typeName)&&((s=i.enum)===null||s===void 0?void 0:s.typeName)===((c=o.enum)===null||c===void 0?void 0:c.typeName)}return!0}return!1}function Zh(t,e){return zi(t)&&qs in t&&"desc"in t&&zi(t.desc)&&t.desc.kind==="message"&&(e===void 0||t.desc.typeName==e.typeName)}const Pm=Symbol.for("@bufbuild/protobuf/text-encoding");function d0(){if(globalThis[Pm]==null){const t=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[Pm]={encodeUtf8(n){return t.encode(n)},decodeUtf8(n){return e.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return globalThis[Pm]}var on;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(on||(on={}));const e3=34028234663852886e22,t3=-34028234663852886e22,n3=4294967295,r3=2147483647,s3=-2147483648;class i3{constructor(e=d0().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let s=0;s<this.chunks.length;s++)e+=this.chunks[s].length;let n=new Uint8Array(e),r=0;for(let s=0;s<this.chunks.length;s++)n.set(this.chunks[s],r),r+=this.chunks[s].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(lS(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return $m(e),Jw(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){ZL(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){lS(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){$m(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return $m(e),e=(e<<1^e>>31)>>>0,Jw(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),s=Zt.enc(e);return r.setInt32(0,s.lo,!0),r.setInt32(4,s.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),s=Zt.uEnc(e);return r.setInt32(0,s.lo,!0),r.setInt32(4,s.hi,!0),this.raw(n)}int64(e){let n=Zt.enc(e);return Dm(n.lo,n.hi,this.buf),this}sint64(e){const n=Zt.enc(e),r=n.hi>>31,s=n.lo<<1^r,c=(n.hi<<1|n.lo>>>31)^r;return Dm(s,c,this.buf),this}uint64(e){const n=Zt.uEnc(e);return Dm(n.lo,n.hi,this.buf),this}}class h0{constructor(e,n=d0().decodeUtf8){this.decodeUtf8=n,this.varint64=iL,this.uint32=lL,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,r=e&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(e,n){let r=this.pos;switch(e){case on.Varint:for(;this.buf[this.pos++]&128;);break;case on.Bit64:this.pos+=4;case on.Bit32:this.pos+=4;break;case on.LengthDelimited:let s=this.uint32();this.pos+=s;break;case on.StartGroup:for(;;){const[c,i]=this.tag();if(i===on.EndGroup){if(n!==void 0&&c!==n)throw new Error("invalid end group tag");break}this.skip(i,c)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Zt.dec(...this.varint64())}uint64(){return Zt.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),r=-(e&1);return e=(e>>>1|(n&1)<<31)^r,n=n>>>1^r,Zt.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Zt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Zt.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function $m(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>r3||t<s3)throw new Error("invalid int32: "+t)}function lS(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>n3||t<0)throw new Error("invalid uint32: "+t)}function ZL(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>e3||t<t3))throw new Error("invalid float32: "+t)}function To(t,e){const n=t.fieldKind=="list"?c0(e,t):t.fieldKind=="map"?u0(e,t):f0(t,e);if(n===!0)return;let r;switch(t.fieldKind){case"list":r=`expected ${l3(t)}, got ${Sn(e)}`;break;case"map":r=`expected ${c3(t)}, got ${Sn(e)}`;break;default:r=dh(t,e,n)}return new nr(t,r)}function cS(t,e,n){const r=f0(t,n);if(r!==!0)return new nr(t,`list item #${e+1}: ${dh(t,n,r)}`)}function YL(t,e,n){const r=o3(e,t.mapKey);if(r!==!0)return new nr(t,`invalid map key: ${dh({scalar:t.mapKey},e,r)}`);const s=f0(t,n);if(s!==!0)return new nr(t,`map entry ${Sn(e)}: ${dh(t,n,s)}`)}function f0(t,e){return t.scalar!==void 0?o3(e,t.scalar):t.enum!==void 0?t.enum.open?Number.isInteger(e):t.enum.values.some(n=>n.number===e):Zh(e,t.message)}function o3(t,e){switch(e){case we.DOUBLE:return typeof t=="number";case we.FLOAT:return typeof t!="number"?!1:Number.isNaN(t)||!Number.isFinite(t)?!0:t>e3||t<t3?`${t.toFixed()} out of range`:!0;case we.INT32:case we.SFIXED32:case we.SINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>r3||t<s3?`${t.toFixed()} out of range`:!0;case we.FIXED32:case we.UINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>n3||t<0?`${t.toFixed()} out of range`:!0;case we.BOOL:return typeof t=="boolean";case we.STRING:return typeof t!="string"?!1:d0().checkUtf8(t)||"invalid UTF8";case we.BYTES:return t instanceof Uint8Array;case we.INT64:case we.SFIXED64:case we.SINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return Zt.parse(t),!0}catch{return`${t} out of range`}return!1;case we.FIXED64:case we.UINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return Zt.uParse(t),!0}catch{return`${t} out of range`}return!1}}function dh(t,e,n){return n=typeof n=="string"?`: ${n}`:`, got ${Sn(e)}`,t.scalar!==void 0?`expected ${KL(t.scalar)}`+n:t.enum!==void 0?`expected ${t.enum.toString()}`+n:`expected ${a3(t.message)}`+n}function Sn(t){switch(typeof t){case"object":return t===null?"null":t instanceof Uint8Array?`Uint8Array(${t.length})`:Array.isArray(t)?`Array(${t.length})`:c0(t)?l3(t.field()):u0(t)?c3(t.field()):Zh(t)?a3(t.desc):l0(t)?`message ${t.$typeName}`:"object";case"string":return t.length>30?"string":`"${t.split('"').join('\\"')}"`;case"boolean":return String(t);case"number":return String(t);case"bigint":return String(t)+"n";default:return typeof t}}function a3(t){return`ReflectMessage (${t.typeName})`}function l3(t){switch(t.listKind){case"message":return`ReflectList (${t.message.toString()})`;case"enum":return`ReflectList (${t.enum.toString()})`;case"scalar":return`ReflectList (${we[t.scalar]})`}}function c3(t){switch(t.mapKind){case"message":return`ReflectMap (${we[t.mapKey]}, ${t.message.toString()})`;case"enum":return`ReflectMap (${we[t.mapKey]}, ${t.enum.toString()})`;case"scalar":return`ReflectMap (${we[t.mapKey]}, ${we[t.scalar]})`}}function KL(t){switch(t){case we.STRING:return"string";case we.BOOL:return"boolean";case we.INT64:case we.SINT64:case we.SFIXED64:return"bigint (int64)";case we.UINT64:case we.FIXED64:return"bigint (uint64)";case we.BYTES:return"Uint8Array";case we.DOUBLE:return"number (float64)";case we.FLOAT:return"number (float32)";case we.FIXED32:case we.UINT32:return"number (uint32)";case we.INT32:case we.SFIXED32:case we.SINT32:return"number (int32)"}}function XL(t){return u3(t.$typeName)}function ou(t){const e=t.fields[0];return u3(t.typeName)&&e!==void 0&&e.fieldKind=="scalar"&&e.name=="value"&&e.number==1}function u3(t){return t.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(t.substring(16))}const qL=999,JL=998,Yd=2;function mn(t,e){if(l0(e,t))return e;const n=rD(t);return e!==void 0&&QL(t,n,e),n}function QL(t,e,n){for(const r of t.members){let s=n[r.localName];if(s==null)continue;let c;if(r.kind=="oneof"){const i=Hj(n,r);if(!i)continue;c=i,s=Wj(n,i)}else c=r;switch(c.fieldKind){case"message":s=p0(c,s);break;case"scalar":s=d3(c,s);break;case"list":s=tD(c,s);break;case"map":s=eD(c,s);break}Gj(e,c,s)}return e}function d3(t,e){return t.scalar==we.BYTES?m0(e):e}function eD(t,e){if(zi(e)){if(t.scalar==we.BYTES)return uS(e,m0);if(t.mapKind=="message")return uS(e,n=>p0(t,n))}return e}function tD(t,e){if(Array.isArray(e)){if(t.scalar==we.BYTES)return e.map(m0);if(t.listKind=="message")return e.map(n=>p0(t,n))}return e}function p0(t,e){if(t.fieldKind=="message"&&!t.oneof&&ou(t.message))return d3(t.message.fields[0],e);if(zi(e)){if(t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!=="google.protobuf.Value")return e;if(!l0(e,t.message))return mn(t.message,e)}return e}function m0(t){return Array.isArray(t)?new Uint8Array(t):t}function uS(t,e){const n={};for(const r of Object.entries(t))n[r[0]]=e(r[1]);return n}const nD=Symbol(),dS=new WeakMap;function rD(t){let e;if(sD(t)){const n=dS.get(t);let r,s;if(n)({prototype:r,members:s}=n);else{r={},s=new Set;for(const c of t.members)c.kind!="oneof"&&(c.fieldKind!="scalar"&&c.fieldKind!="enum"||c.presence!=Yd&&(s.add(c),r[c.localName]=Bm(c)));dS.set(t,{prototype:r,members:s})}e=Object.create(r),e.$typeName=t.typeName;for(const c of t.members)s.has(c)||c.kind=="field"&&(c.fieldKind=="message"||(c.fieldKind=="scalar"||c.fieldKind=="enum")&&c.presence!=Yd)||(e[c.localName]=Bm(c))}else{e={$typeName:t.typeName};for(const n of t.members)(n.kind=="oneof"||n.presence==Yd)&&(e[n.localName]=Bm(n))}return e}function sD(t){switch(t.file.edition){case qL:return!1;case JL:return!0;default:return t.fields.some(e=>e.presence!=Yd&&e.fieldKind!="message"&&!e.oneof)}}function Bm(t){if(t.kind=="oneof")return{case:void 0};if(t.fieldKind=="list")return[];if(t.fieldKind=="map")return{};if(t.fieldKind=="message")return nD;const e=t.getDefaultValue();return e!==void 0?t.fieldKind=="scalar"&&t.longAsString?e.toString():e:t.fieldKind=="scalar"?Do(t.scalar,t.longAsString):t.enum.values[0].number}function or(t,e,n=!0){return new h3(t,e,n)}class h3{get sortedFields(){var e;return(e=this._sortedFields)!==null&&e!==void 0?e:this._sortedFields=this.desc.fields.concat().sort((n,r)=>n.number-r.number)}constructor(e,n,r=!0){this.lists=new Map,this.maps=new Map,this.check=r,this.desc=e,this.message=this[qs]=n??mn(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(n=>[n.number,n]))),this._fieldsByNumber.get(e)}oneofCase(e){return oc(this.message,e),Hj(this.message,e)}isSet(e){return oc(this.message,e),dL(this.message,e)}clear(e){oc(this.message,e),hL(this.message,e)}get(e){oc(this.message,e);const n=Wj(this.message,e);switch(e.fieldKind){case"list":let r=this.lists.get(e);return(!r||r[qs]!==n)&&this.lists.set(e,r=new iD(e,n,this.check)),r;case"map":let s=this.maps.get(e);return(!s||s[qs]!==n)&&this.maps.set(e,s=new oD(e,n,this.check)),s;case"message":return g0(e,n,this.check);case"scalar":return n===void 0?Do(e.scalar,!1):b0(e,n);case"enum":return n??e.enum.values[0].number}}set(e,n){if(oc(this.message,e),this.check){const s=To(e,n);if(s)throw s}let r;e.fieldKind=="message"?r=v0(e,n):u0(n)||c0(n)?r=n[qs]:r=y0(e,n),Gj(this.message,e,r)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function oc(t,e){if(e.parent.typeName!==t.$typeName)throw new nr(e,`cannot use ${e.toString()} with message ${t.$typeName}`,"ForeignFieldError")}class iD{field(){return this._field}get size(){return this._arr.length}constructor(e,n,r){this._field=e,this._arr=this[qs]=n,this.check=r}get(e){const n=this._arr[e];return n===void 0?void 0:Um(this._field,n,this.check)}set(e,n){if(e<0||e>=this._arr.length)throw new nr(this._field,`list item #${e+1}: out of range`);if(this.check){const r=cS(this._field,e,n);if(r)throw r}this._arr[e]=hS(this._field,n)}add(e){if(this.check){const n=cS(this._field,this._arr.length,e);if(n)throw n}this._arr.push(hS(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield Um(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,Um(this._field,this._arr[e],this.check)]}}class oD{constructor(e,n,r=!0){this.obj=this[qs]=n??{},this.check=r,this._field=e}field(){return this._field}set(e,n){if(this.check){const r=YL(this._field,e,n);if(r)throw r}return this.obj[Rd(e)]=aD(this._field,n),this}delete(e){const n=Rd(e),r=Object.prototype.hasOwnProperty.call(this.obj,n);return r&&delete this.obj[n],r}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let n=this.obj[Rd(e)];return n!==void 0&&(n=Fm(this._field,n,this.check)),n}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Rd(e))}*keys(){for(const e of Object.keys(this.obj))yield fS(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[fS(e[0],this._field.mapKey),Fm(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield Fm(this._field,e,this.check)}forEach(e,n){for(const r of this.entries())e.call(n,r[1],r[0],this)}}function v0(t,e){return Zh(e)?XL(e.message)&&!t.oneof&&t.fieldKind=="message"?e.message.value:e.desc.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"?p3(e.message):e.message:e}function g0(t,e,n){return e!==void 0&&(ou(t.message)&&!t.oneof&&t.fieldKind=="message"?e={$typeName:t.message.typeName,value:b0(t.message.fields[0],e)}:t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"&&zi(e)&&(e=f3(e))),new h3(t.message,e,n)}function hS(t,e){return t.listKind=="message"?v0(t,e):y0(t,e)}function Um(t,e,n){return t.listKind=="message"?g0(t,e,n):b0(t,e)}function aD(t,e){return t.mapKind=="message"?v0(t,e):y0(t,e)}function Fm(t,e,n){return t.mapKind=="message"?g0(t,e,n):e}function Rd(t){return typeof t=="string"||typeof t=="number"?t:String(t)}function fS(t,e){switch(e){case we.STRING:return t;case we.INT32:case we.FIXED32:case we.UINT32:case we.SFIXED32:case we.SINT32:{const n=Number.parseInt(t);if(Number.isFinite(n))return n;break}case we.BOOL:switch(t){case"true":return!0;case"false":return!1}break;case we.UINT64:case we.FIXED64:try{return Zt.uParse(t)}catch{}break;default:try{return Zt.parse(t)}catch{}break}return t}function b0(t,e){switch(t.scalar){case we.INT64:case we.SFIXED64:case we.SINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=Zt.parse(e));break;case we.FIXED64:case we.UINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=Zt.uParse(e));break}return e}function y0(t,e){switch(t.scalar){case we.INT64:case we.SFIXED64:case we.SINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Zt.parse(e));break;case we.FIXED64:case we.UINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Zt.uParse(e));break}return e}function f3(t){const e={$typeName:"google.protobuf.Struct",fields:{}};if(zi(t))for(const[n,r]of Object.entries(t))e.fields[n]=v3(r);return e}function p3(t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=m3(r);return e}function m3(t){switch(t.kind.case){case"structValue":return p3(t.kind.value);case"listValue":return t.kind.value.values.map(m3);case"nullValue":case void 0:return null;default:return t.kind.value}}function v3(t){const e={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:0};else if(Array.isArray(t)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(t))for(const r of t)n.values.push(v3(r));e.kind={case:"listValue",value:n}}else e.kind={case:"structValue",value:f3(t)};break}return e}const lD=3,pS={writeUnknownFields:!0};function cD(t){return t?Object.assign(Object.assign({},pS),t):pS}function g3(t,e,n){return hh(new i3,cD(n),or(t,e)).finish()}function hh(t,e,n){var r;for(const s of n.sortedFields){if(!n.isSet(s)){if(s.presence==lD)throw new Error(`cannot encode ${s} to binary: required field not set`);continue}b3(t,e,n,s)}if(e.writeUnknownFields)for(const{no:s,wireType:c,data:i}of(r=n.getUnknown())!==null&&r!==void 0?r:[])t.tag(s,c).raw(i);return t}function b3(t,e,n,r){var s;switch(r.fieldKind){case"scalar":case"enum":fh(t,n.desc.typeName,r.name,(s=r.scalar)!==null&&s!==void 0?s:we.INT32,r.number,n.get(r));break;case"list":uD(t,e,r,n.get(r));break;case"message":y3(t,e,r,n.get(r));break;case"map":for(const[c,i]of n.get(r))dD(t,e,r,c,i);break}}function fh(t,e,n,r,s,c){_3(t.tag(s,hD(r)),e,n,r,c)}function y3(t,e,n,r){n.delimitedEncoding?hh(t.tag(n.number,on.StartGroup),e,r).tag(n.number,on.EndGroup):hh(t.tag(n.number,on.LengthDelimited).fork(),e,r).join()}function uD(t,e,n,r){var s;if(n.listKind=="message"){for(const i of r)y3(t,e,n,i);return}const c=(s=n.scalar)!==null&&s!==void 0?s:we.INT32;if(n.packed){if(!r.size)return;t.tag(n.number,on.LengthDelimited).fork();for(const i of r)_3(t,n.parent.typeName,n.name,c,i);t.join();return}for(const i of r)fh(t,n.parent.typeName,n.name,c,n.number,i)}function dD(t,e,n,r,s){var c;switch(t.tag(n.number,on.LengthDelimited).fork(),fh(t,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":fh(t,n.parent.typeName,n.name,(c=n.scalar)!==null&&c!==void 0?c:we.INT32,2,s);break;case"message":hh(t.tag(2,on.LengthDelimited).fork(),e,s).join();break}t.join()}function _3(t,e,n,r,s){try{switch(r){case we.STRING:t.string(s);break;case we.BOOL:t.bool(s);break;case we.DOUBLE:t.double(s);break;case we.FLOAT:t.float(s);break;case we.INT32:t.int32(s);break;case we.INT64:t.int64(s);break;case we.UINT64:t.uint64(s);break;case we.FIXED64:t.fixed64(s);break;case we.BYTES:t.bytes(s);break;case we.FIXED32:t.fixed32(s);break;case we.SFIXED32:t.sfixed32(s);break;case we.SFIXED64:t.sfixed64(s);break;case we.SINT64:t.sint64(s);break;case we.UINT32:t.uint32(s);break;case we.SINT32:t.sint32(s);break}}catch(c){throw c instanceof Error?new Error(`cannot encode field ${e}.${n} to binary: ${c.message}`):c}}function hD(t){switch(t){case we.BYTES:case we.STRING:return on.LengthDelimited;case we.DOUBLE:case we.FIXED64:case we.SFIXED64:return on.Bit64;case we.FIXED32:case we.SFIXED32:case we.FLOAT:return on.Bit32;default:return on.Varint}}function fD(t,e){return w3(or(t,e)).message}function w3(t){const e=or(t.desc);for(const r of t.fields)if(t.isSet(r))switch(r.fieldKind){case"list":const s=e.get(r);for(const i of t.get(r))s.add(Vm(r,i));break;case"map":const c=e.get(r);for(const i of t.get(r).entries())c.set(i[0],Vm(r,i[1]));break;default:{e.set(r,Vm(r,t.get(r)));break}}const n=t.getUnknown();return n&&n.length>0&&e.setUnknown([...n]),e}function Vm(t,e){return t.message!==void 0&&Zh(e)?w3(e):t.scalar==we.BYTES&&e instanceof Uint8Array?e.slice():e}function au(t,e,...n){return n.reduce((r,s)=>r.nestedMessages[s],t.messages[e])}function pD(t,e,...n){if(n.length==0)return t.enums[e];const r=n.pop();return n.reduce((s,c)=>s.nestedMessages[c],t.messages[e]).nestedEnums[r]}function Yh(t){const e={};for(const n of t.values)e[n.localName]=n.number,e[n.number]=n.localName;return e}const mD=BL({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false"},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]}]}),vD=au(mD,1);var mS;(function(t){t[t.DECLARATION=0]="DECLARATION",t[t.UNVERIFIED=1]="UNVERIFIED"})(mS||(mS={}));var vS;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.GROUP=10]="GROUP",t[t.MESSAGE=11]="MESSAGE",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.ENUM=14]="ENUM",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(vS||(vS={}));var gS;(function(t){t[t.OPTIONAL=1]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.REQUIRED=2]="REQUIRED"})(gS||(gS={}));var bS;(function(t){t[t.SPEED=1]="SPEED",t[t.CODE_SIZE=2]="CODE_SIZE",t[t.LITE_RUNTIME=3]="LITE_RUNTIME"})(bS||(bS={}));var yS;(function(t){t[t.STRING=0]="STRING",t[t.CORD=1]="CORD",t[t.STRING_PIECE=2]="STRING_PIECE"})(yS||(yS={}));var _S;(function(t){t[t.JS_NORMAL=0]="JS_NORMAL",t[t.JS_STRING=1]="JS_STRING",t[t.JS_NUMBER=2]="JS_NUMBER"})(_S||(_S={}));var wS;(function(t){t[t.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",t[t.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",t[t.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(wS||(wS={}));var SS;(function(t){t[t.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",t[t.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",t[t.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",t[t.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",t[t.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",t[t.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",t[t.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",t[t.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",t[t.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",t[t.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(SS||(SS={}));var xS;(function(t){t[t.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",t[t.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",t[t.IDEMPOTENT=2]="IDEMPOTENT"})(xS||(xS={}));var CS;(function(t){t[t.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",t[t.EXPLICIT=1]="EXPLICIT",t[t.IMPLICIT=2]="IMPLICIT",t[t.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(CS||(CS={}));var ES;(function(t){t[t.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(ES||(ES={}));var jS;(function(t){t[t.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",t[t.PACKED=1]="PACKED",t[t.EXPANDED=2]="EXPANDED"})(jS||(jS={}));var kS;(function(t){t[t.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",t[t.VERIFY=2]="VERIFY",t[t.NONE=3]="NONE"})(kS||(kS={}));var TS;(function(t){t[t.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",t[t.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",t[t.DELIMITED=2]="DELIMITED"})(TS||(TS={}));var OS;(function(t){t[t.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",t[t.ALLOW=1]="ALLOW",t[t.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(OS||(OS={}));var AS;(function(t){t[t.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",t[t.STYLE2024=1]="STYLE2024",t[t.STYLE_LEGACY=2]="STYLE_LEGACY"})(AS||(AS={}));var IS;(function(t){t[t.NONE=0]="NONE",t[t.SET=1]="SET",t[t.ALIAS=2]="ALIAS"})(IS||(IS={}));var RS;(function(t){t[t.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",t[t.EDITION_LEGACY=900]="EDITION_LEGACY",t[t.EDITION_PROTO2=998]="EDITION_PROTO2",t[t.EDITION_PROTO3=999]="EDITION_PROTO3",t[t.EDITION_2023=1e3]="EDITION_2023",t[t.EDITION_2024=1001]="EDITION_2024",t[t.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",t[t.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",t[t.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",t[t.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",t[t.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",t[t.EDITION_MAX=2147483647]="EDITION_MAX"})(RS||(RS={}));function _0(t,e,...n){if(n.length==0)return t.enums[e];const r=n.pop();return n.reduce((s,c)=>s.nestedMessages[c],t.messages[e]).nestedEnums[r]}const NS={readUnknownFields:!0};function gD(t){return t?Object.assign(Object.assign({},NS),t):NS}function lu(t,e,n){const r=or(t,void 0,!1);return S3(r,new h0(e),gD(n),!1,e.byteLength),r.message}function S3(t,e,n,r,s){var c;const i=r?e.len:e.pos+s;let o,u;const l=(c=t.getUnknown())!==null&&c!==void 0?c:[];for(;e.pos<i&&([o,u]=e.tag(),!(r&&u==on.EndGroup));){const a=t.findNumber(o);if(!a){const d=e.skip(u,o);n.readUnknownFields&&l.push({no:o,wireType:u,data:d});continue}x3(t,e,a,u,n)}if(r&&(u!=on.EndGroup||o!==s))throw new Error("invalid end group tag");l.length>0&&t.setUnknown(l)}function x3(t,e,n,r,s){switch(n.fieldKind){case"scalar":t.set(n,za(e,n.scalar));break;case"enum":t.set(n,za(e,we.INT32));break;case"message":t.set(n,w0(e,s,n,t.get(n)));break;case"list":yD(e,r,t.get(n),s);break;case"map":bD(e,t.get(n),s);break}}function bD(t,e,n){const r=e.field();let s,c;const i=t.pos+t.uint32();for(;t.pos<i;){const[o]=t.tag();switch(o){case 1:s=za(t,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":c=za(t,r.scalar);break;case"enum":c=t.int32();break;case"message":c=w0(t,n,r);break}break}}if(s===void 0&&(s=Do(r.mapKey,!1)),c===void 0)switch(r.mapKind){case"scalar":c=Do(r.scalar,!1);break;case"enum":c=r.enum.values[0].number;break;case"message":c=or(r.message,void 0,!1);break}e.set(s,c)}function yD(t,e,n,r){var s;const c=n.field();if(c.listKind==="message"){n.add(w0(t,r,c));return}const i=(s=c.scalar)!==null&&s!==void 0?s:we.INT32;if(!(e==on.LengthDelimited&&i!=we.STRING&&i!=we.BYTES)){n.add(za(t,i));return}const u=t.uint32()+t.pos;for(;t.pos<u;)n.add(za(t,i))}function w0(t,e,n,r){const s=n.delimitedEncoding,c=r??or(n.message,void 0,!1);return S3(c,t,e,s,s?n.number:t.uint32()),c}function za(t,e){switch(e){case we.STRING:return t.string();case we.BOOL:return t.bool();case we.DOUBLE:return t.double();case we.FLOAT:return t.float();case we.INT32:return t.int32();case we.INT64:return t.int64();case we.UINT64:return t.uint64();case we.FIXED64:return t.fixed64();case we.BYTES:return t.bytes();case we.FIXED32:return t.fixed32();case we.SFIXED32:return t.sfixed32();case we.SFIXED64:return t.sfixed64();case we.SINT64:return t.sint64();case we.UINT32:return t.uint32();case we.SINT32:return t.sint32()}}function Yi(t,e){var n;const r=lu(vD,a0(t));return r.messageType.forEach(i0),r.dependency=(n=e==null?void 0:e.map(c=>c.proto.name))!==null&&n!==void 0?n:[],Zj(r,c=>e==null?void 0:e.find(i=>i.proto.name===c)).getFile(r.name)}function Qa(t,e,...n){return n.reduce((r,s)=>r.nestedMessages[s],t.messages[e])}function _D(t,e,...n){if(n.length>0)throw new Error;return t.services[e]}const wD=Yi("ChZhZ2VudC9maWxlc2VhcmNoLnByb3RvIlEKEEZpbGVTZWFyY2hSZXN1bHQSDgoGRmlsZUlEGAEgASgJEhAKCEZpbGVOYW1lGAIgASgJEg0KBVNjb3JlGAMgASgBEgwKBExpbmsYBCABKAlCNVozZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL2FnZW50YgZwcm90bzM"),Ki=Yi("ChJhZ2VudC9ibG9ja3MucHJvdG8ipAIKBUJsb2NrEhgKBGtpbmQYASABKA4yCi5CbG9ja0tpbmQSEAoIbGFuZ3VhZ2UYAiABKAkSEAoIY29udGVudHMYAyABKAkSCgoCaWQYByABKAkSJgoIbWV0YWRhdGEYCCADKAsyFC5CbG9jay5NZXRhZGF0YUVudHJ5EhgKBHJvbGUYCSABKA4yCi5CbG9ja1JvbGUSLgoTZmlsZV9zZWFyY2hfcmVzdWx0cxgKIAMoCzIRLkZpbGVTZWFyY2hSZXN1bHQSHQoHb3V0cHV0cxgLIAMoCzIMLkJsb2NrT3V0cHV0Eg8KB2NhbGxfaWQYDCABKAkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIk4KC0Jsb2NrT3V0cHV0Eh8KBWl0ZW1zGAEgAygLMhAuQmxvY2tPdXRwdXRJdGVtEh4KBGtpbmQYAiABKA4yEC5CbG9ja091dHB1dEtpbmQiMgoPQmxvY2tPdXRwdXRJdGVtEgwKBG1pbWUYASABKAkSEQoJdGV4dF9kYXRhGAIgASgJImQKD0dlbmVyYXRlUmVxdWVzdBIWCgZibG9ja3MYASADKAsyBi5CbG9jaxIcChRwcmV2aW91c19yZXNwb25zZV9pZBgCIAEoCRIbChNvcGVuYWlfYWNjZXNzX3Rva2VuGAMgASgJIj8KEEdlbmVyYXRlUmVzcG9uc2USFgoGYmxvY2tzGAEgAygLMgYuQmxvY2sSEwoLcmVzcG9uc2VfaWQYAiABKAkqUgoJQmxvY2tLaW5kEhYKElVOS05PV05fQkxPQ0tfS0lORBAAEgoKBk1BUktVUBABEggKBENPREUQAhIXChNGSUxFX1NFQVJDSF9SRVNVTFRTEAMqUgoJQmxvY2tSb2xlEhYKEkJMT0NLX1JPTEVfVU5LTk9XThAAEhMKD0JMT0NLX1JPTEVfVVNFUhABEhgKFEJMT0NLX1JPTEVfQVNTSVNUQU5UEAIqSAoPQmxvY2tPdXRwdXRLaW5kEh0KGVVOS05PV05fQkxPQ0tfT1VUUFVUX0tJTkQQABIKCgZTVERPVVQQARIKCgZTVERFUlIQAjJECg1CbG9ja3NTZXJ2aWNlEjMKCEdlbmVyYXRlEhAuR2VuZXJhdGVSZXF1ZXN0GhEuR2VuZXJhdGVSZXNwb25zZSIAMAFCNVozZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL2FnZW50YgZwcm90bzM",[wD]),xc=Qa(Ki,0),SD=Qa(Ki,1),xD=Qa(Ki,2),CD=Qa(Ki,3),ED=_0(Ki,0),vs=Yh(ED),jD=_0(Ki,1),si=Yh(jD),kD=_0(Ki,2),LS=Yh(kD),TD=_D(Ki,0),OD=Yi("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),C3=Yi("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),AD=au(C3,0);function ID(t,e,n){let r=!1;return n||(n=mn(AD),r=!0),n.value=g3(t,e),n.typeUrl=LD(e.$typeName),r?n:void 0}function RD(t,e){if(t.typeUrl==="")return!1;const n=typeof e=="string"?e:e.typeName,r=E3(t.typeUrl);return n===r}function ND(t,e){if(t.typeUrl==="")return;const n=e.kind=="message"?e:e.getMessage(E3(t.typeUrl));if(!(!n||!RD(t,n)))return lu(n,t.value)}function LD(t){return`type.googleapis.com/${t}`}function E3(t){const e=t.lastIndexOf("/"),n=e>=0?t.substring(e+1):t;if(!n.length)throw new Error(`invalid type url: ${t}`);return n}const S0=Yi("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),DD=au(S0,0),j3=au(S0,1),MD=au(S0,2);var Bv;(function(t){t[t.NULL_VALUE=0]="NULL_VALUE"})(Bv||(Bv={}));function PD(t,e){k3(e,t);const n=BD(t.$unknown,e),[r,s,c]=Kh(e);for(const i of n)x3(r,new h0(i.data),s,i.wireType,{readUnknownFields:!0});return c()}function $D(t,e,n){var r;k3(e,t);const s=((r=t.$unknown)!==null&&r!==void 0?r:[]).filter(l=>l.no!==e.number),[c,i]=Kh(e,n),o=new i3;b3(o,{writeUnknownFields:!0},c,i);const u=new h0(o.finish());for(;u.pos<u.len;){const[l,a]=u.tag(),d=u.skip(a,l);s.push({no:l,wireType:a,data:d})}t.$unknown=s}function BD(t,e){if(t===void 0)return[];if(e.fieldKind==="enum"||e.fieldKind==="scalar"){for(let n=t.length-1;n>=0;--n)if(t[n].no==e.number)return[t[n]];return[]}return t.filter(n=>n.no===e.number)}function Kh(t,e){const n=t.typeName,r=Object.assign(Object.assign({},t),{kind:"field",parent:t.extendee,localName:n}),s=Object.assign(Object.assign({},t.extendee),{fields:[r],members:[r],oneofs:[]}),c=mn(s,e!==void 0?{[n]:e}:void 0);return[or(s,c),r,()=>{const i=c[n];if(i===void 0){const o=t.message;return ou(o)?Do(o.fields[0].scalar,o.fields[0].longAsString):mn(o)}return i}]}function k3(t,e){if(t.extendee.typeName!=e.$typeName)throw new Error(`extension ${t.typeName} can only be applied to message ${t.extendee.typeName}`)}const UD=3,FD=2,DS={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function VD(t){return t?Object.assign(Object.assign({},DS),t):DS}function zD(t,e,n){return cu(or(t,e),VD(n))}function HD(t,e,n){var r;const s=zD(t,e,n);return JSON.stringify(s,null,(r=n==null?void 0:n.prettySpaces)!==null&&r!==void 0?r:0)}function cu(t,e){var n;const r=YD(t,e);if(r!==void 0)return r;const s={};for(const c of t.sortedFields){if(!t.isSet(c)){if(c.presence==UD)throw new Error(`cannot encode ${c} to JSON: required field not set`);if(!e.alwaysEmitImplicit||c.presence!==FD)continue}const i=MS(c,t.get(c),e);i!==void 0&&(s[ZD(c,e)]=i)}if(e.registry){const c=new Set;for(const{no:i}of(n=t.getUnknown())!==null&&n!==void 0?n:[])if(!c.has(i)){c.add(i);const o=e.registry.getExtensionFor(t.desc,i);if(!o)continue;const u=PD(t.message,o),[l,a]=Kh(o,u),d=MS(a,l.get(a),e);d!==void 0&&(s[o.jsonName]=d)}}return s}function MS(t,e,n){switch(t.fieldKind){case"scalar":return Xh(t,e);case"message":return cu(e,n);case"enum":return x0(t.enum,e,n.enumAsInteger);case"list":return GD(e,n);case"map":return WD(e,n)}}function WD(t,e){const n=t.field(),r={};switch(n.mapKind){case"scalar":for(const[s,c]of t)r[s]=Xh(n,c);break;case"message":for(const[s,c]of t)r[s]=cu(c,e);break;case"enum":for(const[s,c]of t)r[s]=x0(n.enum,c,e.enumAsInteger);break}return e.alwaysEmitImplicit||t.size>0?r:void 0}function GD(t,e){const n=t.field(),r=[];switch(n.listKind){case"scalar":for(const s of t)r.push(Xh(n,s));break;case"enum":for(const s of t)r.push(x0(n.enum,s,e.enumAsInteger));break;case"message":for(const s of t)r.push(cu(s,e));break}return e.alwaysEmitImplicit||r.length>0?r:void 0}function x0(t,e,n){var r;if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: expected number, got ${Sn(e)}`);if(t.typeName=="google.protobuf.NullValue")return null;if(n)return e;const s=t.value[e];return(r=s==null?void 0:s.name)!==null&&r!==void 0?r:e}function Xh(t,e){var n,r,s,c,i,o;switch(t.scalar){case we.INT32:case we.SFIXED32:case we.SINT32:case we.FIXED32:case we.UINT32:if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: ${(n=To(t,e))===null||n===void 0?void 0:n.message}`);return e;case we.FLOAT:case we.DOUBLE:if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: ${(r=To(t,e))===null||r===void 0?void 0:r.message}`);return Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case we.STRING:if(typeof e!="string")throw new Error(`cannot encode ${t} to JSON: ${(s=To(t,e))===null||s===void 0?void 0:s.message}`);return e;case we.BOOL:if(typeof e!="boolean")throw new Error(`cannot encode ${t} to JSON: ${(c=To(t,e))===null||c===void 0?void 0:c.message}`);return e;case we.UINT64:case we.FIXED64:case we.INT64:case we.SFIXED64:case we.SINT64:if(typeof e!="bigint"&&typeof e!="string")throw new Error(`cannot encode ${t} to JSON: ${(i=To(t,e))===null||i===void 0?void 0:i.message}`);return e.toString();case we.BYTES:if(e instanceof Uint8Array)return zL(e);throw new Error(`cannot encode ${t} to JSON: ${(o=To(t,e))===null||o===void 0?void 0:o.message}`)}}function ZD(t,e){return e.useProtoFieldName?t.name:t.jsonName}function YD(t,e){if(t.desc.typeName.startsWith("google.protobuf."))switch(t.desc.typeName){case"google.protobuf.Any":return KD(t.message,e);case"google.protobuf.Timestamp":return JD(t.message);case"google.protobuf.Duration":return XD(t.message);case"google.protobuf.FieldMask":return qD(t.message);case"google.protobuf.Struct":return T3(t.message);case"google.protobuf.Value":return C0(t.message);case"google.protobuf.ListValue":return O3(t.message);default:if(ou(t.desc)){const n=t.desc.fields[0];return Xh(n,t.get(n))}return}}function KD(t,e){if(t.typeUrl==="")return{};const{registry:n}=e;let r,s;if(n&&(r=ND(t,n),r&&(s=n.getMessage(r.$typeName))),!s||!r)throw new Error(`cannot encode message ${t.$typeName} to JSON: "${t.typeUrl}" is not in the type registry`);let c=cu(or(s,r),e);return(s.typeName.startsWith("google.protobuf.")||c===null||Array.isArray(c)||typeof c!="object")&&(c={value:c}),c["@type"]=t.typeUrl,c}function XD(t){if(Number(t.seconds)>315576e6||Number(t.seconds)<-315576e6)throw new Error(`cannot encode message ${t.$typeName} to JSON: value out of range`);let e=t.seconds.toString();if(t.nanos!==0){let n=Math.abs(t.nanos).toString();n="0".repeat(9-n.length)+n,n.substring(3)==="000000"?n=n.substring(0,3):n.substring(6)==="000"&&(n=n.substring(0,6)),e+="."+n,t.nanos<0&&Number(t.seconds)==0&&(e="-"+e)}return e+"s"}function qD(t){return t.paths.map(e=>{if(e.match(/_[0-9]?_/g)||e.match(/[A-Z]/g))throw new Error(`cannot encode message ${t.$typeName} to JSON: lowerCamelCase of path name "`+e+'" is irreversible');return Uc(e)}).join(",")}function T3(t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=C0(r);return e}function C0(t){switch(t.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(t.kind.value))throw new Error(`${t.$typeName} cannot be NaN or Infinity`);return t.kind.value;case"boolValue":return t.kind.value;case"stringValue":return t.kind.value;case"structValue":return T3(t.kind.value);case"listValue":return O3(t.kind.value);default:throw new Error(`${t.$typeName} must have a value`)}}function O3(t){return t.values.map(C0)}function JD(t){const e=Number(t.seconds)*1e3;if(e<Date.parse("0001-01-01T00:00:00Z")||e>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${t.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(t.nanos<0)throw new Error(`cannot encode message ${t.$typeName} to JSON: nanos must not be negative`);let n="Z";if(t.nanos>0){const r=(t.nanos+1e9).toString().substring(1);r.substring(3)==="000000"?n="."+r.substring(0,3)+"Z":r.substring(6)==="000"?n="."+r.substring(0,6)+"Z":n="."+r+"Z"}return new Date(e).toISOString().replace(".000Z",n)}const PS={ignoreUnknownFields:!1};function QD(t){return t?Object.assign(Object.assign({},PS),t):PS}function eM(t,e,n){return A3(t,aM(e,t.typeName),n)}function A3(t,e,n){const r=or(t);try{Ha(r,e,QD(n))}catch(s){throw GL(s)?new Error(`cannot decode ${s.field()} from JSON: ${s.message}`,{cause:s}):s}return r.message}function Ha(t,e,n){var r;if(lM(t,e,n))return;if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode ${t.desc} from JSON: ${Sn(e)}`);const s=new Map,c=new Map;for(const i of t.desc.fields)c.set(i.name,i).set(i.jsonName,i);for(const[i,o]of Object.entries(e)){const u=c.get(i);if(u){if(u.oneof){if(o===null&&u.fieldKind=="scalar")continue;const l=s.get(u.oneof);if(l!==void 0)throw new nr(u.oneof,`oneof set multiple times by ${l.name} and ${u.name}`);s.set(u.oneof,u)}$S(t,u,o,n)}else{let l;if(i.startsWith("[")&&i.endsWith("]")&&(l=(r=n.registry)===null||r===void 0?void 0:r.getExtension(i.substring(1,i.length-1)))&&l.extendee.typeName===t.desc.typeName){const[a,d,f]=Kh(l);$S(a,d,o,n),$D(t.message,l,f())}if(!l&&!n.ignoreUnknownFields)throw new Error(`cannot decode ${t.desc} from JSON: key "${i}" is unknown`)}}}function $S(t,e,n,r){switch(e.fieldKind){case"scalar":iM(t,e,n);break;case"enum":sM(t,e,n,r);break;case"message":rM(t,e,n,r);break;case"list":nM(t.get(e),n,r);break;case"map":tM(t.get(e),n,r);break}}function tM(t,e,n){if(e===null)return;const r=t.field();if(typeof e!="object"||Array.isArray(e))throw new nr(r,"expected object, got "+Sn(e));for(const[s,c]of Object.entries(e)){if(c===null)throw new nr(r,"map value must not be null");let i;switch(r.mapKind){case"message":const u=or(r.message);Ha(u,c,n),i=u;break;case"enum":if(i=E0(r.enum,c,n.ignoreUnknownFields,!0),i===qh)return;break;case"scalar":i=Qh(r,c,!0);break}const o=oM(r.mapKey,s);t.set(o,i)}}function nM(t,e,n){if(e===null)return;const r=t.field();if(!Array.isArray(e))throw new nr(r,"expected Array, got "+Sn(e));for(const s of e){if(s===null)throw new nr(r,"list item must not be null");switch(r.listKind){case"message":const c=or(r.message);Ha(c,s,n),t.add(c);break;case"enum":const i=E0(r.enum,s,n.ignoreUnknownFields,!0);i!==qh&&t.add(i);break;case"scalar":t.add(Qh(r,s,!0));break}}}function rM(t,e,n,r){if(n===null&&e.message.typeName!="google.protobuf.Value"){t.clear(e);return}const s=t.isSet(e)?t.get(e):or(e.message);Ha(s,n,r),t.set(e,s)}function sM(t,e,n,r){const s=E0(e.enum,n,r.ignoreUnknownFields,!1);s===Jh?t.clear(e):s!==qh&&t.set(e,s)}function iM(t,e,n){const r=Qh(e,n,!1);r===Jh?t.clear(e):t.set(e,r)}const qh=Symbol();function E0(t,e,n,r){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:r?t.values[0].number:Jh;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const s=t.values.find(c=>c.name===e);if(s!==void 0)return s.number;if(n)return qh;break}throw new Error(`cannot decode ${t} from JSON: ${Sn(e)}`)}const Jh=Symbol();function Qh(t,e,n){if(e===null)return n?Do(t.scalar,!1):Jh;switch(t.scalar){case we.DOUBLE:case we.FLOAT:if(e==="NaN")return NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof e=="number"){if(Number.isNaN(e))throw new nr(t,"unexpected NaN number");if(!Number.isFinite(e))throw new nr(t,"unexpected infinite number");break}if(typeof e=="string"){if(e===""||e.trim().length!==e.length)break;const r=Number(e);if(!Number.isFinite(r))break;return r}break;case we.INT32:case we.FIXED32:case we.SFIXED32:case we.SINT32:case we.UINT32:return I3(e);case we.BYTES:if(typeof e=="string"){if(e==="")return new Uint8Array(0);try{return a0(e)}catch(r){const s=r instanceof Error?r.message:String(r);throw new nr(t,s)}}break}return e}function oM(t,e){switch(t){case we.BOOL:switch(e){case"true":return!0;case"false":return!1}return e;case we.INT32:case we.FIXED32:case we.UINT32:case we.SFIXED32:case we.SINT32:return I3(e);default:return e}}function I3(t){if(typeof t=="string"){if(t===""||t.trim().length!==t.length)return t;const e=Number(t);return Number.isNaN(e)?t:e}return t}function aM(t,e){try{return JSON.parse(t)}catch(n){const r=n instanceof Error?n.message:String(n);throw new Error(`cannot decode message ${e} from JSON: ${r}`,{cause:n})}}function lM(t,e,n){if(!t.desc.typeName.startsWith("google.protobuf."))return!1;switch(t.desc.typeName){case"google.protobuf.Any":return cM(t.message,e,n),!0;case"google.protobuf.Timestamp":return uM(t.message,e),!0;case"google.protobuf.Duration":return dM(t.message,e),!0;case"google.protobuf.FieldMask":return hM(t.message,e),!0;case"google.protobuf.Struct":return R3(t.message,e),!0;case"google.protobuf.Value":return j0(t.message,e),!0;case"google.protobuf.ListValue":return N3(t.message,e),!0;default:if(ou(t.desc)){const r=t.desc.fields[0];return e===null?t.clear(r):t.set(r,Qh(r,e,!0)),!0}return!1}}function cM(t,e,n){var r;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${t.$typeName} from JSON: expected object but got ${Sn(e)}`);if(Object.keys(e).length==0)return;const s=e["@type"];if(typeof s!="string"||s=="")throw new Error(`cannot decode message ${t.$typeName} from JSON: "@type" is empty`);const c=s.includes("/")?s.substring(s.lastIndexOf("/")+1):s;if(!c.length)throw new Error(`cannot decode message ${t.$typeName} from JSON: "@type" is invalid`);const i=(r=n.registry)===null||r===void 0?void 0:r.getMessage(c);if(!i)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${s} is not in the type registry`);const o=or(i);if(c.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(e,"value")){const u=e.value;Ha(o,u,n)}else{const u=Object.assign({},e);delete u["@type"],Ha(o,u,n)}ID(o.desc,o.message,t)}function uM(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);const n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error(`cannot decode message ${t.$typeName} from JSON: invalid RFC 3339 string`);const r=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(r))throw new Error(`cannot decode message ${t.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${t.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);t.seconds=Zt.parse(r/1e3),t.nanos=0,n[7]&&(t.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9)}function dM(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);const n=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);const r=Number(n[1]);if(r>315576e6||r<-315576e6)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);if(t.seconds=Zt.parse(r),typeof n[2]!="string")return;const s=n[2]+"0".repeat(9-n[2].length);t.nanos=parseInt(s),(r<0||Object.is(r,-0))&&(t.nanos=-t.nanos)}function hM(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);if(e==="")return;function n(r){if(r.includes("_"))throw new Error(`cannot decode message ${t.$typeName} from JSON: path names must be lowerCamelCase`);const s=r.replace(/[A-Z]/g,c=>"_"+c.toLowerCase());return s[0]==="_"?s.substring(1):s}t.paths=e.split(",").map(n)}function R3(t,e){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error(`cannot decode message ${t.$typeName} from JSON ${Sn(e)}`);for(const[n,r]of Object.entries(e)){const s=mn(j3);j0(s,r),t.fields[n]=s}}function j0(t,e){switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:Bv.NULL_VALUE};else if(Array.isArray(e)){const n=mn(MD);N3(n,e),t.kind={case:"listValue",value:n}}else{const n=mn(DD);R3(n,e),t.kind={case:"structValue",value:n}}break;default:throw new Error(`cannot decode message ${t.$typeName} from JSON ${Sn(e)}`)}return t}function N3(t,e){if(!Array.isArray(e))throw new Error(`cannot decode message ${t.$typeName} from JSON ${Sn(e)}`);for(const n of e){const r=mn(j3);j0(r,n),t.values.push(r)}}const On=[];for(let t=0;t<256;++t)On.push((t+256).toString(16).slice(1));function fM(t,e=0){return(On[t[e+0]]+On[t[e+1]]+On[t[e+2]]+On[t[e+3]]+"-"+On[t[e+4]]+On[t[e+5]]+"-"+On[t[e+6]]+On[t[e+7]]+"-"+On[t[e+8]]+On[t[e+9]]+"-"+On[t[e+10]]+On[t[e+11]]+On[t[e+12]]+On[t[e+13]]+On[t[e+14]]+On[t[e+15]]).toLowerCase()}let zm;const pM=new Uint8Array(16);function mM(){if(!zm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zm=crypto.getRandomValues.bind(crypto)}return zm(pM)}const vM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),BS={randomUUID:vM};function US(t,e,n){var s;if(BS.randomUUID&&!t)return BS.randomUUID();t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??mM();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,fM(r)}const gM=Yi("ChdhZ2VudC9jcmVkZW50aWFscy5wcm90byKhAQoKT0F1dGhUb2tlbhIUCgxhY2Nlc3NfdG9rZW4YASABKAkSEgoKdG9rZW5fdHlwZRgCIAEoCRIVCg1yZWZyZXNoX3Rva2VuGAMgASgJEhIKCmV4cGlyZXNfYXQYBCABKAMSKgoGZXhwaXJ5GAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBISCgpleHBpcmVzX2luGAYgASgDQjVaM2dpdGh1Yi5jb20vcnVubWVkZXYvcnVubWUvdjMvYXBpL2dlbi9wcm90by9nby9hZ2VudGIGcHJvdG8z",[OD]),FS=Qa(gM,0),bM=["agent-session","cassie-session"],yM=["agent-oauth-token","cassie-oauth-token"];function ef(){for(const t of bM){const e=document.cookie.split("; ").find(r=>r.startsWith(t+"=")),n=e==null?void 0:e.split("=")[1];if(n&&n.length>0)return n}}function _M(){let t=mn(FS);for(const e of yM){const n=document.cookie.split("; ").find(s=>s.startsWith(e+"=")),r=n==null?void 0:n.split("=")[1];if(r&&r.length>0)try{const s=decodeURIComponent(r),c=JSON.parse(s);return t=A3(FS,c),t}catch(s){console.error("Failed to parse OAuthToken:",s)}}return t}var xt;(function(t){t[t.Canceled=1]="Canceled",t[t.Unknown=2]="Unknown",t[t.InvalidArgument=3]="InvalidArgument",t[t.DeadlineExceeded=4]="DeadlineExceeded",t[t.NotFound=5]="NotFound",t[t.AlreadyExists=6]="AlreadyExists",t[t.PermissionDenied=7]="PermissionDenied",t[t.ResourceExhausted=8]="ResourceExhausted",t[t.FailedPrecondition=9]="FailedPrecondition",t[t.Aborted=10]="Aborted",t[t.OutOfRange=11]="OutOfRange",t[t.Unimplemented=12]="Unimplemented",t[t.Internal=13]="Internal",t[t.Unavailable=14]="Unavailable",t[t.DataLoss=15]="DataLoss",t[t.Unauthenticated=16]="Unauthenticated"})(xt||(xt={}));function VS(t){const e=xt[t];return typeof e!="string"?t.toString():e[0].toLowerCase()+e.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class Bt extends Error{constructor(e,n=xt.Unknown,r,s,c){super(wM(e,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=n,this.metadata=new Headers(r??{}),this.details=s??[],this.cause=c}static from(e,n=xt.Unknown){return e instanceof Bt?e:e instanceof Error?e.name=="AbortError"?new Bt(e.message,xt.Canceled):new Bt(e.message,n,void 0,void 0,e):new Bt(String(e),n,void 0,void 0,e)}static[Symbol.hasInstance](e){return e instanceof Error?Object.getPrototypeOf(e)===Bt.prototype?!0:e.name==="ConnectError"&&"code"in e&&typeof e.code=="number"&&"metadata"in e&&"details"in e&&Array.isArray(e.details)&&"rawMessage"in e&&typeof e.rawMessage=="string"&&"cause"in e:!1}findDetails(e){const n=e.kind==="message"?{getMessage:s=>s===e.typeName?e:void 0}:e,r=[];for(const s of this.details){if("desc"in s){n.getMessage(s.desc.typeName)&&r.push(mn(s.desc,s.value));continue}const c=n.getMessage(s.type);if(c)try{r.push(lu(c,s.value))}catch{}}return r}}function wM(t,e){return t.length?`[${VS(e)}] ${t}`:`[${VS(e)}]`}function SM(t,e,n){try{const r=a0(t);return e?lu(e,r,n):r}catch(r){throw Bt.from(r,xt.DataLoss)}}function xM(t,e){const n={};for(const r of t.methods){const s=e(r);s!=null&&(n[r.localName]=s)}return n}const zS=1;function HS(t){let e,n=new Uint8Array(0);function r(s){const c=new Uint8Array(n.length+s.length);c.set(n),c.set(s,n.length),n=c}return new ReadableStream({start(){e=t.getReader()},async pull(s){let c;for(;;){if(c===void 0&&n.byteLength>=5){let u=0;for(let l=1;l<5;l++)u=(u<<8)+n[l];c={flags:n[0],length:u}}if(c!==void 0&&n.byteLength>=c.length+5)break;const o=await e.read();if(o.done)break;r(o.value)}if(c===void 0){if(n.byteLength==0){s.close();return}s.error(new Bt("premature end of stream",xt.DataLoss));return}const i=n.subarray(5,5+c.length);n=n.subarray(5+c.length),s.enqueue({flags:c.flags,data:i})}})}function WS(t,e){const n=new Uint8Array(e.length+5);n.set(e,5);const r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,t),r.setUint32(1,e.length),n}var CM=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(c){n[c]=t[c]&&function(i){return new Promise(function(o,u){i=t[c](i),s(o,u,i.done,i.value)})}}function s(c,i,o,u){Promise.resolve(u).then(function(l){c({value:l,done:o})},i)}},Hc=function(t){return this instanceof Hc?(this.v=t,this):new Hc(t)},EM=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(v){return Promise.resolve(v).then(p,d)}}function o(p,v){r[p]&&(s[p]=function(m){return new Promise(function(b,y){c.push([p,m,b,y])>1||u(p,m)})},v&&(s[p]=v(s[p])))}function u(p,v){try{l(r[p](v))}catch(m){f(c[0][3],m)}}function l(p){p.value instanceof Hc?Promise.resolve(p.value.v).then(a,d):f(c[0][2],p)}function a(p){u("next",p)}function d(p){u("throw",p)}function f(p,v){p(v),c.shift(),c.length&&u(c[0][0],c[0][1])}},jM=function(t){var e,n;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,c){e[s]=t[s]?function(i){return(n=!n)?{value:Hc(t[s](i)),done:!1}:c?c(i):i}:c}};function kM(t){return EM(this,arguments,function*(){yield Hc(yield*jM(CM(t)))})}var L3=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(c){n[c]=t[c]&&function(i){return new Promise(function(o,u){i=t[c](i),s(o,u,i.done,i.value)})}}function s(c,i,o,u){Promise.resolve(u).then(function(l){c({value:l,done:o})},i)}},Wa=function(t){return this instanceof Wa?(this.v=t,this):new Wa(t)},TM=function(t){var e,n;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,c){e[s]=t[s]?function(i){return(n=!n)?{value:Wa(t[s](i)),done:!1}:c?c(i):i}:c}},OM=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(v){return Promise.resolve(v).then(p,d)}}function o(p,v){r[p]&&(s[p]=function(m){return new Promise(function(b,y){c.push([p,m,b,y])>1||u(p,m)})},v&&(s[p]=v(s[p])))}function u(p,v){try{l(r[p](v))}catch(m){f(c[0][3],m)}}function l(p){p.value instanceof Wa?Promise.resolve(p.value.v).then(a,d):f(c[0][2],p)}function a(p){u("next",p)}function d(p){u("throw",p)}function f(p,v){p(v),c.shift(),c.length&&u(c[0][0],c[0][1])}};function AM(t,e){return xM(t,n=>{switch(n.methodKind){case"unary":return IM(e,n);case"server_streaming":return RM(e,n);case"client_streaming":return NM(e,n);case"bidi_streaming":return LM(e,n);default:return null}})}function IM(t,e){return async function(n,r){var s,c;const i=await t.unary(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues);return(s=r==null?void 0:r.onHeader)===null||s===void 0||s.call(r,i.header),(c=r==null?void 0:r.onTrailer)===null||c===void 0||c.call(r,i.trailer),i.message}}function RM(t,e){return function(n,r){return D3(t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,kM([n]),r==null?void 0:r.contextValues),r)}}function NM(t,e){return async function(n,r){var s,c,i,o,u,l;const a=await t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues);(u=r==null?void 0:r.onHeader)===null||u===void 0||u.call(r,a.header);let d,f=0;try{for(var p=!0,v=L3(a.message),m;m=await v.next(),s=m.done,!s;p=!0)o=m.value,p=!1,d=o,f++}catch(b){c={error:b}}finally{try{!p&&!s&&(i=v.return)&&await i.call(v)}finally{if(c)throw c.error}}if(!d)throw new Bt("protocol error: missing response message",xt.Unimplemented);if(f>1)throw new Bt("protocol error: received extra messages for client streaming method",xt.Unimplemented);return(l=r==null?void 0:r.onTrailer)===null||l===void 0||l.call(r,a.trailer),d}}function LM(t,e){return function(n,r){return D3(t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues),r)}}function D3(t,e){const n=function(){return OM(this,arguments,function*(){var r,s;const c=yield Wa(t);(r=e==null?void 0:e.onHeader)===null||r===void 0||r.call(e,c.header),yield Wa(yield*TM(L3(c.message))),(s=e==null?void 0:e.onTrailer)===null||s===void 0||s.call(e,c.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function DM(...t){const e=new AbortController,n=t.filter(s=>s!==void 0).concat(e.signal);for(const s of n){if(s.aborted){r.apply(s);break}s.addEventListener("abort",r)}function r(){e.signal.aborted||e.abort(M3(this));for(const s of n)s.removeEventListener("abort",r)}return e}function MM(t){const e=new AbortController,n=()=>{e.abort(new Bt("the operation timed out",xt.DeadlineExceeded))};let r;return t!==void 0&&(t<=0?n():r=setTimeout(n,t)),{signal:e.signal,cleanup:()=>clearTimeout(r)}}function M3(t){if(!t.aborted)return;if(t.reason!==void 0)return t.reason;const e=new Error("This operation was aborted");return e.name="AbortError",e}function GS(){return{get(t){return t.id in this?this[t.id]:t.defaultValue},set(t,e){return this[t.id]=e,this},delete(t){return delete this[t.id],this}}}const Hm=128;function ZS(t){const e=new Headers,n=new TextDecoder().decode(t).split(`\r
6646
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(c){case 0:o=i,c=1;break;case 1:r[s++]=o<<2|(i&48)>>4,o=i,c=2;break;case 2:r[s++]=(o&15)<<4|(i&60)>>2,o=i,c=3;break;case 3:r[s++]=(o&3)<<6|i,c=0;break}}if(c==1)throw Error("invalid base64 string");return r.subarray(0,s)}function zL(t,e="std"){const n=Qj(e),r=e=="std";let s="",c=0,i,o=0;for(let u=0;u<t.length;u++)switch(i=t[u],c){case 0:s+=n[i>>2],o=(i&3)<<4,c=1;break;case 1:s+=n[o|i>>4],o=(i&15)<<2,c=2;break;case 2:s+=n[o|i>>6],s+=n[i&63],c=0;break}return c&&(s+=n[o],r&&(s+="=",c==1&&(s+="="))),s}let Id,aS,Ea;function Qj(t){return Id||(Id="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),aS=Id.slice(0,-2).concat("-","_")),t=="url"?aS:Id}function HL(){if(!Ea){Ea=[];const t=Qj("std");for(let e=0;e<t.length;e++)Ea[t[e].charCodeAt(0)]=e;Ea[45]=t.indexOf("+"),Ea[95]=t.indexOf("/")}return Ea}function l0(t,e){return t!==null&&typeof t=="object"&&"$typeName"in t&&typeof t.$typeName=="string"?e===void 0?!0:e.typeName===t.$typeName:!1}const WL=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class nr extends Error{constructor(e,n,r="FieldValueInvalidError"){super(n),this.name=r,this.field=()=>e}}function GL(t){return t instanceof Error&&WL.includes(t.name)&&"field"in t&&typeof t.field=="function"}function zi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function c0(t,e){var n,r,s,c;if(zi(t)&&qs in t&&"add"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){const i=e,o=t.field();return i.listKind==o.listKind&&i.scalar===o.scalar&&((n=i.message)===null||n===void 0?void 0:n.typeName)===((r=o.message)===null||r===void 0?void 0:r.typeName)&&((s=i.enum)===null||s===void 0?void 0:s.typeName)===((c=o.enum)===null||c===void 0?void 0:c.typeName)}return!0}return!1}function u0(t,e){var n,r,s,c;if(zi(t)&&qs in t&&"has"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){const i=e,o=t.field();return i.mapKey===o.mapKey&&i.mapKind==o.mapKind&&i.scalar===o.scalar&&((n=i.message)===null||n===void 0?void 0:n.typeName)===((r=o.message)===null||r===void 0?void 0:r.typeName)&&((s=i.enum)===null||s===void 0?void 0:s.typeName)===((c=o.enum)===null||c===void 0?void 0:c.typeName)}return!0}return!1}function Zh(t,e){return zi(t)&&qs in t&&"desc"in t&&zi(t.desc)&&t.desc.kind==="message"&&(e===void 0||t.desc.typeName==e.typeName)}const Pm=Symbol.for("@bufbuild/protobuf/text-encoding");function d0(){if(globalThis[Pm]==null){const t=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[Pm]={encodeUtf8(n){return t.encode(n)},decodeUtf8(n){return e.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return globalThis[Pm]}var on;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(on||(on={}));const e3=34028234663852886e22,t3=-34028234663852886e22,n3=4294967295,r3=2147483647,s3=-2147483648;class i3{constructor(e=d0().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let s=0;s<this.chunks.length;s++)e+=this.chunks[s].length;let n=new Uint8Array(e),r=0;for(let s=0;s<this.chunks.length;s++)n.set(this.chunks[s],r),r+=this.chunks[s].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(lS(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return $m(e),Jw(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){ZL(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){lS(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){$m(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return $m(e),e=(e<<1^e>>31)>>>0,Jw(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),s=Zt.enc(e);return r.setInt32(0,s.lo,!0),r.setInt32(4,s.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),s=Zt.uEnc(e);return r.setInt32(0,s.lo,!0),r.setInt32(4,s.hi,!0),this.raw(n)}int64(e){let n=Zt.enc(e);return Dm(n.lo,n.hi,this.buf),this}sint64(e){const n=Zt.enc(e),r=n.hi>>31,s=n.lo<<1^r,c=(n.hi<<1|n.lo>>>31)^r;return Dm(s,c,this.buf),this}uint64(e){const n=Zt.uEnc(e);return Dm(n.lo,n.hi,this.buf),this}}class h0{constructor(e,n=d0().decodeUtf8){this.decodeUtf8=n,this.varint64=iL,this.uint32=lL,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,r=e&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(e,n){let r=this.pos;switch(e){case on.Varint:for(;this.buf[this.pos++]&128;);break;case on.Bit64:this.pos+=4;case on.Bit32:this.pos+=4;break;case on.LengthDelimited:let s=this.uint32();this.pos+=s;break;case on.StartGroup:for(;;){const[c,i]=this.tag();if(i===on.EndGroup){if(n!==void 0&&c!==n)throw new Error("invalid end group tag");break}this.skip(i,c)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Zt.dec(...this.varint64())}uint64(){return Zt.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),r=-(e&1);return e=(e>>>1|(n&1)<<31)^r,n=n>>>1^r,Zt.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Zt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Zt.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function $m(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>r3||t<s3)throw new Error("invalid int32: "+t)}function lS(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>n3||t<0)throw new Error("invalid uint32: "+t)}function ZL(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>e3||t<t3))throw new Error("invalid float32: "+t)}function To(t,e){const n=t.fieldKind=="list"?c0(e,t):t.fieldKind=="map"?u0(e,t):f0(t,e);if(n===!0)return;let r;switch(t.fieldKind){case"list":r=`expected ${l3(t)}, got ${Sn(e)}`;break;case"map":r=`expected ${c3(t)}, got ${Sn(e)}`;break;default:r=dh(t,e,n)}return new nr(t,r)}function cS(t,e,n){const r=f0(t,n);if(r!==!0)return new nr(t,`list item #${e+1}: ${dh(t,n,r)}`)}function YL(t,e,n){const r=o3(e,t.mapKey);if(r!==!0)return new nr(t,`invalid map key: ${dh({scalar:t.mapKey},e,r)}`);const s=f0(t,n);if(s!==!0)return new nr(t,`map entry ${Sn(e)}: ${dh(t,n,s)}`)}function f0(t,e){return t.scalar!==void 0?o3(e,t.scalar):t.enum!==void 0?t.enum.open?Number.isInteger(e):t.enum.values.some(n=>n.number===e):Zh(e,t.message)}function o3(t,e){switch(e){case we.DOUBLE:return typeof t=="number";case we.FLOAT:return typeof t!="number"?!1:Number.isNaN(t)||!Number.isFinite(t)?!0:t>e3||t<t3?`${t.toFixed()} out of range`:!0;case we.INT32:case we.SFIXED32:case we.SINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>r3||t<s3?`${t.toFixed()} out of range`:!0;case we.FIXED32:case we.UINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>n3||t<0?`${t.toFixed()} out of range`:!0;case we.BOOL:return typeof t=="boolean";case we.STRING:return typeof t!="string"?!1:d0().checkUtf8(t)||"invalid UTF8";case we.BYTES:return t instanceof Uint8Array;case we.INT64:case we.SFIXED64:case we.SINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return Zt.parse(t),!0}catch{return`${t} out of range`}return!1;case we.FIXED64:case we.UINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return Zt.uParse(t),!0}catch{return`${t} out of range`}return!1}}function dh(t,e,n){return n=typeof n=="string"?`: ${n}`:`, got ${Sn(e)}`,t.scalar!==void 0?`expected ${KL(t.scalar)}`+n:t.enum!==void 0?`expected ${t.enum.toString()}`+n:`expected ${a3(t.message)}`+n}function Sn(t){switch(typeof t){case"object":return t===null?"null":t instanceof Uint8Array?`Uint8Array(${t.length})`:Array.isArray(t)?`Array(${t.length})`:c0(t)?l3(t.field()):u0(t)?c3(t.field()):Zh(t)?a3(t.desc):l0(t)?`message ${t.$typeName}`:"object";case"string":return t.length>30?"string":`"${t.split('"').join('\\"')}"`;case"boolean":return String(t);case"number":return String(t);case"bigint":return String(t)+"n";default:return typeof t}}function a3(t){return`ReflectMessage (${t.typeName})`}function l3(t){switch(t.listKind){case"message":return`ReflectList (${t.message.toString()})`;case"enum":return`ReflectList (${t.enum.toString()})`;case"scalar":return`ReflectList (${we[t.scalar]})`}}function c3(t){switch(t.mapKind){case"message":return`ReflectMap (${we[t.mapKey]}, ${t.message.toString()})`;case"enum":return`ReflectMap (${we[t.mapKey]}, ${t.enum.toString()})`;case"scalar":return`ReflectMap (${we[t.mapKey]}, ${we[t.scalar]})`}}function KL(t){switch(t){case we.STRING:return"string";case we.BOOL:return"boolean";case we.INT64:case we.SINT64:case we.SFIXED64:return"bigint (int64)";case we.UINT64:case we.FIXED64:return"bigint (uint64)";case we.BYTES:return"Uint8Array";case we.DOUBLE:return"number (float64)";case we.FLOAT:return"number (float32)";case we.FIXED32:case we.UINT32:return"number (uint32)";case we.INT32:case we.SFIXED32:case we.SINT32:return"number (int32)"}}function XL(t){return u3(t.$typeName)}function ou(t){const e=t.fields[0];return u3(t.typeName)&&e!==void 0&&e.fieldKind=="scalar"&&e.name=="value"&&e.number==1}function u3(t){return t.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(t.substring(16))}const qL=999,JL=998,Yd=2;function mn(t,e){if(l0(e,t))return e;const n=rD(t);return e!==void 0&&QL(t,n,e),n}function QL(t,e,n){for(const r of t.members){let s=n[r.localName];if(s==null)continue;let c;if(r.kind=="oneof"){const i=Hj(n,r);if(!i)continue;c=i,s=Wj(n,i)}else c=r;switch(c.fieldKind){case"message":s=p0(c,s);break;case"scalar":s=d3(c,s);break;case"list":s=tD(c,s);break;case"map":s=eD(c,s);break}Gj(e,c,s)}return e}function d3(t,e){return t.scalar==we.BYTES?m0(e):e}function eD(t,e){if(zi(e)){if(t.scalar==we.BYTES)return uS(e,m0);if(t.mapKind=="message")return uS(e,n=>p0(t,n))}return e}function tD(t,e){if(Array.isArray(e)){if(t.scalar==we.BYTES)return e.map(m0);if(t.listKind=="message")return e.map(n=>p0(t,n))}return e}function p0(t,e){if(t.fieldKind=="message"&&!t.oneof&&ou(t.message))return d3(t.message.fields[0],e);if(zi(e)){if(t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!=="google.protobuf.Value")return e;if(!l0(e,t.message))return mn(t.message,e)}return e}function m0(t){return Array.isArray(t)?new Uint8Array(t):t}function uS(t,e){const n={};for(const r of Object.entries(t))n[r[0]]=e(r[1]);return n}const nD=Symbol(),dS=new WeakMap;function rD(t){let e;if(sD(t)){const n=dS.get(t);let r,s;if(n)({prototype:r,members:s}=n);else{r={},s=new Set;for(const c of t.members)c.kind!="oneof"&&(c.fieldKind!="scalar"&&c.fieldKind!="enum"||c.presence!=Yd&&(s.add(c),r[c.localName]=Bm(c)));dS.set(t,{prototype:r,members:s})}e=Object.create(r),e.$typeName=t.typeName;for(const c of t.members)s.has(c)||c.kind=="field"&&(c.fieldKind=="message"||(c.fieldKind=="scalar"||c.fieldKind=="enum")&&c.presence!=Yd)||(e[c.localName]=Bm(c))}else{e={$typeName:t.typeName};for(const n of t.members)(n.kind=="oneof"||n.presence==Yd)&&(e[n.localName]=Bm(n))}return e}function sD(t){switch(t.file.edition){case qL:return!1;case JL:return!0;default:return t.fields.some(e=>e.presence!=Yd&&e.fieldKind!="message"&&!e.oneof)}}function Bm(t){if(t.kind=="oneof")return{case:void 0};if(t.fieldKind=="list")return[];if(t.fieldKind=="map")return{};if(t.fieldKind=="message")return nD;const e=t.getDefaultValue();return e!==void 0?t.fieldKind=="scalar"&&t.longAsString?e.toString():e:t.fieldKind=="scalar"?Do(t.scalar,t.longAsString):t.enum.values[0].number}function or(t,e,n=!0){return new h3(t,e,n)}class h3{get sortedFields(){var e;return(e=this._sortedFields)!==null&&e!==void 0?e:this._sortedFields=this.desc.fields.concat().sort((n,r)=>n.number-r.number)}constructor(e,n,r=!0){this.lists=new Map,this.maps=new Map,this.check=r,this.desc=e,this.message=this[qs]=n??mn(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(n=>[n.number,n]))),this._fieldsByNumber.get(e)}oneofCase(e){return oc(this.message,e),Hj(this.message,e)}isSet(e){return oc(this.message,e),dL(this.message,e)}clear(e){oc(this.message,e),hL(this.message,e)}get(e){oc(this.message,e);const n=Wj(this.message,e);switch(e.fieldKind){case"list":let r=this.lists.get(e);return(!r||r[qs]!==n)&&this.lists.set(e,r=new iD(e,n,this.check)),r;case"map":let s=this.maps.get(e);return(!s||s[qs]!==n)&&this.maps.set(e,s=new oD(e,n,this.check)),s;case"message":return g0(e,n,this.check);case"scalar":return n===void 0?Do(e.scalar,!1):b0(e,n);case"enum":return n??e.enum.values[0].number}}set(e,n){if(oc(this.message,e),this.check){const s=To(e,n);if(s)throw s}let r;e.fieldKind=="message"?r=v0(e,n):u0(n)||c0(n)?r=n[qs]:r=y0(e,n),Gj(this.message,e,r)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function oc(t,e){if(e.parent.typeName!==t.$typeName)throw new nr(e,`cannot use ${e.toString()} with message ${t.$typeName}`,"ForeignFieldError")}class iD{field(){return this._field}get size(){return this._arr.length}constructor(e,n,r){this._field=e,this._arr=this[qs]=n,this.check=r}get(e){const n=this._arr[e];return n===void 0?void 0:Um(this._field,n,this.check)}set(e,n){if(e<0||e>=this._arr.length)throw new nr(this._field,`list item #${e+1}: out of range`);if(this.check){const r=cS(this._field,e,n);if(r)throw r}this._arr[e]=hS(this._field,n)}add(e){if(this.check){const n=cS(this._field,this._arr.length,e);if(n)throw n}this._arr.push(hS(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield Um(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,Um(this._field,this._arr[e],this.check)]}}class oD{constructor(e,n,r=!0){this.obj=this[qs]=n??{},this.check=r,this._field=e}field(){return this._field}set(e,n){if(this.check){const r=YL(this._field,e,n);if(r)throw r}return this.obj[Rd(e)]=aD(this._field,n),this}delete(e){const n=Rd(e),r=Object.prototype.hasOwnProperty.call(this.obj,n);return r&&delete this.obj[n],r}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let n=this.obj[Rd(e)];return n!==void 0&&(n=Fm(this._field,n,this.check)),n}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Rd(e))}*keys(){for(const e of Object.keys(this.obj))yield fS(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[fS(e[0],this._field.mapKey),Fm(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield Fm(this._field,e,this.check)}forEach(e,n){for(const r of this.entries())e.call(n,r[1],r[0],this)}}function v0(t,e){return Zh(e)?XL(e.message)&&!t.oneof&&t.fieldKind=="message"?e.message.value:e.desc.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"?p3(e.message):e.message:e}function g0(t,e,n){return e!==void 0&&(ou(t.message)&&!t.oneof&&t.fieldKind=="message"?e={$typeName:t.message.typeName,value:b0(t.message.fields[0],e)}:t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"&&zi(e)&&(e=f3(e))),new h3(t.message,e,n)}function hS(t,e){return t.listKind=="message"?v0(t,e):y0(t,e)}function Um(t,e,n){return t.listKind=="message"?g0(t,e,n):b0(t,e)}function aD(t,e){return t.mapKind=="message"?v0(t,e):y0(t,e)}function Fm(t,e,n){return t.mapKind=="message"?g0(t,e,n):e}function Rd(t){return typeof t=="string"||typeof t=="number"?t:String(t)}function fS(t,e){switch(e){case we.STRING:return t;case we.INT32:case we.FIXED32:case we.UINT32:case we.SFIXED32:case we.SINT32:{const n=Number.parseInt(t);if(Number.isFinite(n))return n;break}case we.BOOL:switch(t){case"true":return!0;case"false":return!1}break;case we.UINT64:case we.FIXED64:try{return Zt.uParse(t)}catch{}break;default:try{return Zt.parse(t)}catch{}break}return t}function b0(t,e){switch(t.scalar){case we.INT64:case we.SFIXED64:case we.SINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=Zt.parse(e));break;case we.FIXED64:case we.UINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=Zt.uParse(e));break}return e}function y0(t,e){switch(t.scalar){case we.INT64:case we.SFIXED64:case we.SINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Zt.parse(e));break;case we.FIXED64:case we.UINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Zt.uParse(e));break}return e}function f3(t){const e={$typeName:"google.protobuf.Struct",fields:{}};if(zi(t))for(const[n,r]of Object.entries(t))e.fields[n]=v3(r);return e}function p3(t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=m3(r);return e}function m3(t){switch(t.kind.case){case"structValue":return p3(t.kind.value);case"listValue":return t.kind.value.values.map(m3);case"nullValue":case void 0:return null;default:return t.kind.value}}function v3(t){const e={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:0};else if(Array.isArray(t)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(t))for(const r of t)n.values.push(v3(r));e.kind={case:"listValue",value:n}}else e.kind={case:"structValue",value:f3(t)};break}return e}const lD=3,pS={writeUnknownFields:!0};function cD(t){return t?Object.assign(Object.assign({},pS),t):pS}function g3(t,e,n){return hh(new i3,cD(n),or(t,e)).finish()}function hh(t,e,n){var r;for(const s of n.sortedFields){if(!n.isSet(s)){if(s.presence==lD)throw new Error(`cannot encode ${s} to binary: required field not set`);continue}b3(t,e,n,s)}if(e.writeUnknownFields)for(const{no:s,wireType:c,data:i}of(r=n.getUnknown())!==null&&r!==void 0?r:[])t.tag(s,c).raw(i);return t}function b3(t,e,n,r){var s;switch(r.fieldKind){case"scalar":case"enum":fh(t,n.desc.typeName,r.name,(s=r.scalar)!==null&&s!==void 0?s:we.INT32,r.number,n.get(r));break;case"list":uD(t,e,r,n.get(r));break;case"message":y3(t,e,r,n.get(r));break;case"map":for(const[c,i]of n.get(r))dD(t,e,r,c,i);break}}function fh(t,e,n,r,s,c){_3(t.tag(s,hD(r)),e,n,r,c)}function y3(t,e,n,r){n.delimitedEncoding?hh(t.tag(n.number,on.StartGroup),e,r).tag(n.number,on.EndGroup):hh(t.tag(n.number,on.LengthDelimited).fork(),e,r).join()}function uD(t,e,n,r){var s;if(n.listKind=="message"){for(const i of r)y3(t,e,n,i);return}const c=(s=n.scalar)!==null&&s!==void 0?s:we.INT32;if(n.packed){if(!r.size)return;t.tag(n.number,on.LengthDelimited).fork();for(const i of r)_3(t,n.parent.typeName,n.name,c,i);t.join();return}for(const i of r)fh(t,n.parent.typeName,n.name,c,n.number,i)}function dD(t,e,n,r,s){var c;switch(t.tag(n.number,on.LengthDelimited).fork(),fh(t,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":fh(t,n.parent.typeName,n.name,(c=n.scalar)!==null&&c!==void 0?c:we.INT32,2,s);break;case"message":hh(t.tag(2,on.LengthDelimited).fork(),e,s).join();break}t.join()}function _3(t,e,n,r,s){try{switch(r){case we.STRING:t.string(s);break;case we.BOOL:t.bool(s);break;case we.DOUBLE:t.double(s);break;case we.FLOAT:t.float(s);break;case we.INT32:t.int32(s);break;case we.INT64:t.int64(s);break;case we.UINT64:t.uint64(s);break;case we.FIXED64:t.fixed64(s);break;case we.BYTES:t.bytes(s);break;case we.FIXED32:t.fixed32(s);break;case we.SFIXED32:t.sfixed32(s);break;case we.SFIXED64:t.sfixed64(s);break;case we.SINT64:t.sint64(s);break;case we.UINT32:t.uint32(s);break;case we.SINT32:t.sint32(s);break}}catch(c){throw c instanceof Error?new Error(`cannot encode field ${e}.${n} to binary: ${c.message}`):c}}function hD(t){switch(t){case we.BYTES:case we.STRING:return on.LengthDelimited;case we.DOUBLE:case we.FIXED64:case we.SFIXED64:return on.Bit64;case we.FIXED32:case we.SFIXED32:case we.FLOAT:return on.Bit32;default:return on.Varint}}function fD(t,e){return w3(or(t,e)).message}function w3(t){const e=or(t.desc);for(const r of t.fields)if(t.isSet(r))switch(r.fieldKind){case"list":const s=e.get(r);for(const i of t.get(r))s.add(Vm(r,i));break;case"map":const c=e.get(r);for(const i of t.get(r).entries())c.set(i[0],Vm(r,i[1]));break;default:{e.set(r,Vm(r,t.get(r)));break}}const n=t.getUnknown();return n&&n.length>0&&e.setUnknown([...n]),e}function Vm(t,e){return t.message!==void 0&&Zh(e)?w3(e):t.scalar==we.BYTES&&e instanceof Uint8Array?e.slice():e}function au(t,e,...n){return n.reduce((r,s)=>r.nestedMessages[s],t.messages[e])}function pD(t,e,...n){if(n.length==0)return t.enums[e];const r=n.pop();return n.reduce((s,c)=>s.nestedMessages[c],t.messages[e]).nestedEnums[r]}function Yh(t){const e={};for(const n of t.values)e[n.localName]=n.number,e[n.number]=n.localName;return e}const mD=BL({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false"},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]}]}),vD=au(mD,1);var mS;(function(t){t[t.DECLARATION=0]="DECLARATION",t[t.UNVERIFIED=1]="UNVERIFIED"})(mS||(mS={}));var vS;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.GROUP=10]="GROUP",t[t.MESSAGE=11]="MESSAGE",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.ENUM=14]="ENUM",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(vS||(vS={}));var gS;(function(t){t[t.OPTIONAL=1]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.REQUIRED=2]="REQUIRED"})(gS||(gS={}));var bS;(function(t){t[t.SPEED=1]="SPEED",t[t.CODE_SIZE=2]="CODE_SIZE",t[t.LITE_RUNTIME=3]="LITE_RUNTIME"})(bS||(bS={}));var yS;(function(t){t[t.STRING=0]="STRING",t[t.CORD=1]="CORD",t[t.STRING_PIECE=2]="STRING_PIECE"})(yS||(yS={}));var _S;(function(t){t[t.JS_NORMAL=0]="JS_NORMAL",t[t.JS_STRING=1]="JS_STRING",t[t.JS_NUMBER=2]="JS_NUMBER"})(_S||(_S={}));var wS;(function(t){t[t.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",t[t.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",t[t.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(wS||(wS={}));var SS;(function(t){t[t.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",t[t.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",t[t.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",t[t.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",t[t.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",t[t.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",t[t.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",t[t.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",t[t.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",t[t.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(SS||(SS={}));var xS;(function(t){t[t.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",t[t.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",t[t.IDEMPOTENT=2]="IDEMPOTENT"})(xS||(xS={}));var CS;(function(t){t[t.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",t[t.EXPLICIT=1]="EXPLICIT",t[t.IMPLICIT=2]="IMPLICIT",t[t.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(CS||(CS={}));var ES;(function(t){t[t.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(ES||(ES={}));var jS;(function(t){t[t.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",t[t.PACKED=1]="PACKED",t[t.EXPANDED=2]="EXPANDED"})(jS||(jS={}));var kS;(function(t){t[t.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",t[t.VERIFY=2]="VERIFY",t[t.NONE=3]="NONE"})(kS||(kS={}));var TS;(function(t){t[t.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",t[t.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",t[t.DELIMITED=2]="DELIMITED"})(TS||(TS={}));var OS;(function(t){t[t.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",t[t.ALLOW=1]="ALLOW",t[t.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(OS||(OS={}));var AS;(function(t){t[t.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",t[t.STYLE2024=1]="STYLE2024",t[t.STYLE_LEGACY=2]="STYLE_LEGACY"})(AS||(AS={}));var IS;(function(t){t[t.NONE=0]="NONE",t[t.SET=1]="SET",t[t.ALIAS=2]="ALIAS"})(IS||(IS={}));var RS;(function(t){t[t.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",t[t.EDITION_LEGACY=900]="EDITION_LEGACY",t[t.EDITION_PROTO2=998]="EDITION_PROTO2",t[t.EDITION_PROTO3=999]="EDITION_PROTO3",t[t.EDITION_2023=1e3]="EDITION_2023",t[t.EDITION_2024=1001]="EDITION_2024",t[t.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",t[t.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",t[t.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",t[t.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",t[t.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",t[t.EDITION_MAX=2147483647]="EDITION_MAX"})(RS||(RS={}));function _0(t,e,...n){if(n.length==0)return t.enums[e];const r=n.pop();return n.reduce((s,c)=>s.nestedMessages[c],t.messages[e]).nestedEnums[r]}const NS={readUnknownFields:!0};function gD(t){return t?Object.assign(Object.assign({},NS),t):NS}function lu(t,e,n){const r=or(t,void 0,!1);return S3(r,new h0(e),gD(n),!1,e.byteLength),r.message}function S3(t,e,n,r,s){var c;const i=r?e.len:e.pos+s;let o,u;const l=(c=t.getUnknown())!==null&&c!==void 0?c:[];for(;e.pos<i&&([o,u]=e.tag(),!(r&&u==on.EndGroup));){const a=t.findNumber(o);if(!a){const d=e.skip(u,o);n.readUnknownFields&&l.push({no:o,wireType:u,data:d});continue}x3(t,e,a,u,n)}if(r&&(u!=on.EndGroup||o!==s))throw new Error("invalid end group tag");l.length>0&&t.setUnknown(l)}function x3(t,e,n,r,s){switch(n.fieldKind){case"scalar":t.set(n,za(e,n.scalar));break;case"enum":t.set(n,za(e,we.INT32));break;case"message":t.set(n,w0(e,s,n,t.get(n)));break;case"list":yD(e,r,t.get(n),s);break;case"map":bD(e,t.get(n),s);break}}function bD(t,e,n){const r=e.field();let s,c;const i=t.pos+t.uint32();for(;t.pos<i;){const[o]=t.tag();switch(o){case 1:s=za(t,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":c=za(t,r.scalar);break;case"enum":c=t.int32();break;case"message":c=w0(t,n,r);break}break}}if(s===void 0&&(s=Do(r.mapKey,!1)),c===void 0)switch(r.mapKind){case"scalar":c=Do(r.scalar,!1);break;case"enum":c=r.enum.values[0].number;break;case"message":c=or(r.message,void 0,!1);break}e.set(s,c)}function yD(t,e,n,r){var s;const c=n.field();if(c.listKind==="message"){n.add(w0(t,r,c));return}const i=(s=c.scalar)!==null&&s!==void 0?s:we.INT32;if(!(e==on.LengthDelimited&&i!=we.STRING&&i!=we.BYTES)){n.add(za(t,i));return}const u=t.uint32()+t.pos;for(;t.pos<u;)n.add(za(t,i))}function w0(t,e,n,r){const s=n.delimitedEncoding,c=r??or(n.message,void 0,!1);return S3(c,t,e,s,s?n.number:t.uint32()),c}function za(t,e){switch(e){case we.STRING:return t.string();case we.BOOL:return t.bool();case we.DOUBLE:return t.double();case we.FLOAT:return t.float();case we.INT32:return t.int32();case we.INT64:return t.int64();case we.UINT64:return t.uint64();case we.FIXED64:return t.fixed64();case we.BYTES:return t.bytes();case we.FIXED32:return t.fixed32();case we.SFIXED32:return t.sfixed32();case we.SFIXED64:return t.sfixed64();case we.SINT64:return t.sint64();case we.UINT32:return t.uint32();case we.SINT32:return t.sint32()}}function Yi(t,e){var n;const r=lu(vD,a0(t));return r.messageType.forEach(i0),r.dependency=(n=e==null?void 0:e.map(c=>c.proto.name))!==null&&n!==void 0?n:[],Zj(r,c=>e==null?void 0:e.find(i=>i.proto.name===c)).getFile(r.name)}function Qa(t,e,...n){return n.reduce((r,s)=>r.nestedMessages[s],t.messages[e])}function _D(t,e,...n){if(n.length>0)throw new Error;return t.services[e]}const wD=Yi("ChlhZ2VudC92MS9maWxlc2VhcmNoLnByb3RvEghhZ2VudC52MSJTChBGaWxlU2VhcmNoUmVzdWx0Eg8KB2ZpbGVfaWQYASABKAkSEQoJZmlsZV9uYW1lGAIgASgJEg0KBXNjb3JlGAMgASgBEgwKBGxpbmsYBCABKAlCQFo+Z2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL2FnZW50L3YxO2FnZW50djFiBnByb3RvMw"),Ki=Yi("ChVhZ2VudC92MS9ibG9ja3MucHJvdG8SCGFnZW50LnYxItECCgVCbG9jaxIhCgRraW5kGAEgASgOMhMuYWdlbnQudjEuQmxvY2tLaW5kEhAKCGxhbmd1YWdlGAIgASgJEhAKCGNvbnRlbnRzGAMgASgJEgoKAmlkGAcgASgJEi8KCG1ldGFkYXRhGAggAygLMh0uYWdlbnQudjEuQmxvY2suTWV0YWRhdGFFbnRyeRIhCgRyb2xlGAkgASgOMhMuYWdlbnQudjEuQmxvY2tSb2xlEjcKE2ZpbGVfc2VhcmNoX3Jlc3VsdHMYCiADKAsyGi5hZ2VudC52MS5GaWxlU2VhcmNoUmVzdWx0EiYKB291dHB1dHMYCyADKAsyFS5hZ2VudC52MS5CbG9ja091dHB1dBIPCgdjYWxsX2lkGAwgASgJGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASJgCgtCbG9ja091dHB1dBIoCgVpdGVtcxgBIAMoCzIZLmFnZW50LnYxLkJsb2NrT3V0cHV0SXRlbRInCgRraW5kGAIgASgOMhkuYWdlbnQudjEuQmxvY2tPdXRwdXRLaW5kIjIKD0Jsb2NrT3V0cHV0SXRlbRIMCgRtaW1lGAEgASgJEhEKCXRleHRfZGF0YRgCIAEoCSJtCg9HZW5lcmF0ZVJlcXVlc3QSHwoGYmxvY2tzGAEgAygLMg8uYWdlbnQudjEuQmxvY2sSHAoUcHJldmlvdXNfcmVzcG9uc2VfaWQYAiABKAkSGwoTb3BlbmFpX2FjY2Vzc190b2tlbhgDIAEoCSJIChBHZW5lcmF0ZVJlc3BvbnNlEh8KBmJsb2NrcxgBIAMoCzIPLmFnZW50LnYxLkJsb2NrEhMKC3Jlc3BvbnNlX2lkGAIgASgJKncKCUJsb2NrS2luZBIaChZCTE9DS19LSU5EX1VOU1BFQ0lGSUVEEAASFQoRQkxPQ0tfS0lORF9NQVJLVVAQARITCg9CTE9DS19LSU5EX0NPREUQAhIiCh5CTE9DS19LSU5EX0ZJTEVfU0VBUkNIX1JFU1VMVFMQAypWCglCbG9ja1JvbGUSGgoWQkxPQ0tfUk9MRV9VTlNQRUNJRklFRBAAEhMKD0JMT0NLX1JPTEVfVVNFUhABEhgKFEJMT0NLX1JPTEVfQVNTSVNUQU5UEAIqcAoPQmxvY2tPdXRwdXRLaW5kEiEKHUJMT0NLX09VVFBVVF9LSU5EX1VOU1BFQ0lGSUVEEAASHAoYQkxPQ0tfT1VUUFVUX0tJTkRfU1RET1VUEAESHAoYQkxPQ0tfT1VUUFVUX0tJTkRfU1RERVJSEAIyVgoNQmxvY2tzU2VydmljZRJFCghHZW5lcmF0ZRIZLmFnZW50LnYxLkdlbmVyYXRlUmVxdWVzdBoaLmFnZW50LnYxLkdlbmVyYXRlUmVzcG9uc2UiADABQkBaPmdpdGh1Yi5jb20vcnVubWVkZXYvcnVubWUvdjMvYXBpL2dlbi9wcm90by9nby9hZ2VudC92MTthZ2VudHYxYgZwcm90bzM",[wD]),xc=Qa(Ki,0),SD=Qa(Ki,1),xD=Qa(Ki,2),CD=Qa(Ki,3),ED=_0(Ki,0),vs=Yh(ED),jD=_0(Ki,1),si=Yh(jD),kD=_0(Ki,2),LS=Yh(kD),TD=_D(Ki,0),OD=Yi("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),C3=Yi("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),AD=au(C3,0);function ID(t,e,n){let r=!1;return n||(n=mn(AD),r=!0),n.value=g3(t,e),n.typeUrl=LD(e.$typeName),r?n:void 0}function RD(t,e){if(t.typeUrl==="")return!1;const n=typeof e=="string"?e:e.typeName,r=E3(t.typeUrl);return n===r}function ND(t,e){if(t.typeUrl==="")return;const n=e.kind=="message"?e:e.getMessage(E3(t.typeUrl));if(!(!n||!RD(t,n)))return lu(n,t.value)}function LD(t){return`type.googleapis.com/${t}`}function E3(t){const e=t.lastIndexOf("/"),n=e>=0?t.substring(e+1):t;if(!n.length)throw new Error(`invalid type url: ${t}`);return n}const S0=Yi("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),DD=au(S0,0),j3=au(S0,1),MD=au(S0,2);var Bv;(function(t){t[t.NULL_VALUE=0]="NULL_VALUE"})(Bv||(Bv={}));function PD(t,e){k3(e,t);const n=BD(t.$unknown,e),[r,s,c]=Kh(e);for(const i of n)x3(r,new h0(i.data),s,i.wireType,{readUnknownFields:!0});return c()}function $D(t,e,n){var r;k3(e,t);const s=((r=t.$unknown)!==null&&r!==void 0?r:[]).filter(l=>l.no!==e.number),[c,i]=Kh(e,n),o=new i3;b3(o,{writeUnknownFields:!0},c,i);const u=new h0(o.finish());for(;u.pos<u.len;){const[l,a]=u.tag(),d=u.skip(a,l);s.push({no:l,wireType:a,data:d})}t.$unknown=s}function BD(t,e){if(t===void 0)return[];if(e.fieldKind==="enum"||e.fieldKind==="scalar"){for(let n=t.length-1;n>=0;--n)if(t[n].no==e.number)return[t[n]];return[]}return t.filter(n=>n.no===e.number)}function Kh(t,e){const n=t.typeName,r=Object.assign(Object.assign({},t),{kind:"field",parent:t.extendee,localName:n}),s=Object.assign(Object.assign({},t.extendee),{fields:[r],members:[r],oneofs:[]}),c=mn(s,e!==void 0?{[n]:e}:void 0);return[or(s,c),r,()=>{const i=c[n];if(i===void 0){const o=t.message;return ou(o)?Do(o.fields[0].scalar,o.fields[0].longAsString):mn(o)}return i}]}function k3(t,e){if(t.extendee.typeName!=e.$typeName)throw new Error(`extension ${t.typeName} can only be applied to message ${t.extendee.typeName}`)}const UD=3,FD=2,DS={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function VD(t){return t?Object.assign(Object.assign({},DS),t):DS}function zD(t,e,n){return cu(or(t,e),VD(n))}function HD(t,e,n){var r;const s=zD(t,e,n);return JSON.stringify(s,null,(r=n==null?void 0:n.prettySpaces)!==null&&r!==void 0?r:0)}function cu(t,e){var n;const r=YD(t,e);if(r!==void 0)return r;const s={};for(const c of t.sortedFields){if(!t.isSet(c)){if(c.presence==UD)throw new Error(`cannot encode ${c} to JSON: required field not set`);if(!e.alwaysEmitImplicit||c.presence!==FD)continue}const i=MS(c,t.get(c),e);i!==void 0&&(s[ZD(c,e)]=i)}if(e.registry){const c=new Set;for(const{no:i}of(n=t.getUnknown())!==null&&n!==void 0?n:[])if(!c.has(i)){c.add(i);const o=e.registry.getExtensionFor(t.desc,i);if(!o)continue;const u=PD(t.message,o),[l,a]=Kh(o,u),d=MS(a,l.get(a),e);d!==void 0&&(s[o.jsonName]=d)}}return s}function MS(t,e,n){switch(t.fieldKind){case"scalar":return Xh(t,e);case"message":return cu(e,n);case"enum":return x0(t.enum,e,n.enumAsInteger);case"list":return GD(e,n);case"map":return WD(e,n)}}function WD(t,e){const n=t.field(),r={};switch(n.mapKind){case"scalar":for(const[s,c]of t)r[s]=Xh(n,c);break;case"message":for(const[s,c]of t)r[s]=cu(c,e);break;case"enum":for(const[s,c]of t)r[s]=x0(n.enum,c,e.enumAsInteger);break}return e.alwaysEmitImplicit||t.size>0?r:void 0}function GD(t,e){const n=t.field(),r=[];switch(n.listKind){case"scalar":for(const s of t)r.push(Xh(n,s));break;case"enum":for(const s of t)r.push(x0(n.enum,s,e.enumAsInteger));break;case"message":for(const s of t)r.push(cu(s,e));break}return e.alwaysEmitImplicit||r.length>0?r:void 0}function x0(t,e,n){var r;if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: expected number, got ${Sn(e)}`);if(t.typeName=="google.protobuf.NullValue")return null;if(n)return e;const s=t.value[e];return(r=s==null?void 0:s.name)!==null&&r!==void 0?r:e}function Xh(t,e){var n,r,s,c,i,o;switch(t.scalar){case we.INT32:case we.SFIXED32:case we.SINT32:case we.FIXED32:case we.UINT32:if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: ${(n=To(t,e))===null||n===void 0?void 0:n.message}`);return e;case we.FLOAT:case we.DOUBLE:if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: ${(r=To(t,e))===null||r===void 0?void 0:r.message}`);return Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case we.STRING:if(typeof e!="string")throw new Error(`cannot encode ${t} to JSON: ${(s=To(t,e))===null||s===void 0?void 0:s.message}`);return e;case we.BOOL:if(typeof e!="boolean")throw new Error(`cannot encode ${t} to JSON: ${(c=To(t,e))===null||c===void 0?void 0:c.message}`);return e;case we.UINT64:case we.FIXED64:case we.INT64:case we.SFIXED64:case we.SINT64:if(typeof e!="bigint"&&typeof e!="string")throw new Error(`cannot encode ${t} to JSON: ${(i=To(t,e))===null||i===void 0?void 0:i.message}`);return e.toString();case we.BYTES:if(e instanceof Uint8Array)return zL(e);throw new Error(`cannot encode ${t} to JSON: ${(o=To(t,e))===null||o===void 0?void 0:o.message}`)}}function ZD(t,e){return e.useProtoFieldName?t.name:t.jsonName}function YD(t,e){if(t.desc.typeName.startsWith("google.protobuf."))switch(t.desc.typeName){case"google.protobuf.Any":return KD(t.message,e);case"google.protobuf.Timestamp":return JD(t.message);case"google.protobuf.Duration":return XD(t.message);case"google.protobuf.FieldMask":return qD(t.message);case"google.protobuf.Struct":return T3(t.message);case"google.protobuf.Value":return C0(t.message);case"google.protobuf.ListValue":return O3(t.message);default:if(ou(t.desc)){const n=t.desc.fields[0];return Xh(n,t.get(n))}return}}function KD(t,e){if(t.typeUrl==="")return{};const{registry:n}=e;let r,s;if(n&&(r=ND(t,n),r&&(s=n.getMessage(r.$typeName))),!s||!r)throw new Error(`cannot encode message ${t.$typeName} to JSON: "${t.typeUrl}" is not in the type registry`);let c=cu(or(s,r),e);return(s.typeName.startsWith("google.protobuf.")||c===null||Array.isArray(c)||typeof c!="object")&&(c={value:c}),c["@type"]=t.typeUrl,c}function XD(t){if(Number(t.seconds)>315576e6||Number(t.seconds)<-315576e6)throw new Error(`cannot encode message ${t.$typeName} to JSON: value out of range`);let e=t.seconds.toString();if(t.nanos!==0){let n=Math.abs(t.nanos).toString();n="0".repeat(9-n.length)+n,n.substring(3)==="000000"?n=n.substring(0,3):n.substring(6)==="000"&&(n=n.substring(0,6)),e+="."+n,t.nanos<0&&Number(t.seconds)==0&&(e="-"+e)}return e+"s"}function qD(t){return t.paths.map(e=>{if(e.match(/_[0-9]?_/g)||e.match(/[A-Z]/g))throw new Error(`cannot encode message ${t.$typeName} to JSON: lowerCamelCase of path name "`+e+'" is irreversible');return Uc(e)}).join(",")}function T3(t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=C0(r);return e}function C0(t){switch(t.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(t.kind.value))throw new Error(`${t.$typeName} cannot be NaN or Infinity`);return t.kind.value;case"boolValue":return t.kind.value;case"stringValue":return t.kind.value;case"structValue":return T3(t.kind.value);case"listValue":return O3(t.kind.value);default:throw new Error(`${t.$typeName} must have a value`)}}function O3(t){return t.values.map(C0)}function JD(t){const e=Number(t.seconds)*1e3;if(e<Date.parse("0001-01-01T00:00:00Z")||e>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${t.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(t.nanos<0)throw new Error(`cannot encode message ${t.$typeName} to JSON: nanos must not be negative`);let n="Z";if(t.nanos>0){const r=(t.nanos+1e9).toString().substring(1);r.substring(3)==="000000"?n="."+r.substring(0,3)+"Z":r.substring(6)==="000"?n="."+r.substring(0,6)+"Z":n="."+r+"Z"}return new Date(e).toISOString().replace(".000Z",n)}const PS={ignoreUnknownFields:!1};function QD(t){return t?Object.assign(Object.assign({},PS),t):PS}function eM(t,e,n){return A3(t,aM(e,t.typeName),n)}function A3(t,e,n){const r=or(t);try{Ha(r,e,QD(n))}catch(s){throw GL(s)?new Error(`cannot decode ${s.field()} from JSON: ${s.message}`,{cause:s}):s}return r.message}function Ha(t,e,n){var r;if(lM(t,e,n))return;if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode ${t.desc} from JSON: ${Sn(e)}`);const s=new Map,c=new Map;for(const i of t.desc.fields)c.set(i.name,i).set(i.jsonName,i);for(const[i,o]of Object.entries(e)){const u=c.get(i);if(u){if(u.oneof){if(o===null&&u.fieldKind=="scalar")continue;const l=s.get(u.oneof);if(l!==void 0)throw new nr(u.oneof,`oneof set multiple times by ${l.name} and ${u.name}`);s.set(u.oneof,u)}$S(t,u,o,n)}else{let l;if(i.startsWith("[")&&i.endsWith("]")&&(l=(r=n.registry)===null||r===void 0?void 0:r.getExtension(i.substring(1,i.length-1)))&&l.extendee.typeName===t.desc.typeName){const[a,d,f]=Kh(l);$S(a,d,o,n),$D(t.message,l,f())}if(!l&&!n.ignoreUnknownFields)throw new Error(`cannot decode ${t.desc} from JSON: key "${i}" is unknown`)}}}function $S(t,e,n,r){switch(e.fieldKind){case"scalar":iM(t,e,n);break;case"enum":sM(t,e,n,r);break;case"message":rM(t,e,n,r);break;case"list":nM(t.get(e),n,r);break;case"map":tM(t.get(e),n,r);break}}function tM(t,e,n){if(e===null)return;const r=t.field();if(typeof e!="object"||Array.isArray(e))throw new nr(r,"expected object, got "+Sn(e));for(const[s,c]of Object.entries(e)){if(c===null)throw new nr(r,"map value must not be null");let i;switch(r.mapKind){case"message":const u=or(r.message);Ha(u,c,n),i=u;break;case"enum":if(i=E0(r.enum,c,n.ignoreUnknownFields,!0),i===qh)return;break;case"scalar":i=Qh(r,c,!0);break}const o=oM(r.mapKey,s);t.set(o,i)}}function nM(t,e,n){if(e===null)return;const r=t.field();if(!Array.isArray(e))throw new nr(r,"expected Array, got "+Sn(e));for(const s of e){if(s===null)throw new nr(r,"list item must not be null");switch(r.listKind){case"message":const c=or(r.message);Ha(c,s,n),t.add(c);break;case"enum":const i=E0(r.enum,s,n.ignoreUnknownFields,!0);i!==qh&&t.add(i);break;case"scalar":t.add(Qh(r,s,!0));break}}}function rM(t,e,n,r){if(n===null&&e.message.typeName!="google.protobuf.Value"){t.clear(e);return}const s=t.isSet(e)?t.get(e):or(e.message);Ha(s,n,r),t.set(e,s)}function sM(t,e,n,r){const s=E0(e.enum,n,r.ignoreUnknownFields,!1);s===Jh?t.clear(e):s!==qh&&t.set(e,s)}function iM(t,e,n){const r=Qh(e,n,!1);r===Jh?t.clear(e):t.set(e,r)}const qh=Symbol();function E0(t,e,n,r){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:r?t.values[0].number:Jh;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const s=t.values.find(c=>c.name===e);if(s!==void 0)return s.number;if(n)return qh;break}throw new Error(`cannot decode ${t} from JSON: ${Sn(e)}`)}const Jh=Symbol();function Qh(t,e,n){if(e===null)return n?Do(t.scalar,!1):Jh;switch(t.scalar){case we.DOUBLE:case we.FLOAT:if(e==="NaN")return NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof e=="number"){if(Number.isNaN(e))throw new nr(t,"unexpected NaN number");if(!Number.isFinite(e))throw new nr(t,"unexpected infinite number");break}if(typeof e=="string"){if(e===""||e.trim().length!==e.length)break;const r=Number(e);if(!Number.isFinite(r))break;return r}break;case we.INT32:case we.FIXED32:case we.SFIXED32:case we.SINT32:case we.UINT32:return I3(e);case we.BYTES:if(typeof e=="string"){if(e==="")return new Uint8Array(0);try{return a0(e)}catch(r){const s=r instanceof Error?r.message:String(r);throw new nr(t,s)}}break}return e}function oM(t,e){switch(t){case we.BOOL:switch(e){case"true":return!0;case"false":return!1}return e;case we.INT32:case we.FIXED32:case we.UINT32:case we.SFIXED32:case we.SINT32:return I3(e);default:return e}}function I3(t){if(typeof t=="string"){if(t===""||t.trim().length!==t.length)return t;const e=Number(t);return Number.isNaN(e)?t:e}return t}function aM(t,e){try{return JSON.parse(t)}catch(n){const r=n instanceof Error?n.message:String(n);throw new Error(`cannot decode message ${e} from JSON: ${r}`,{cause:n})}}function lM(t,e,n){if(!t.desc.typeName.startsWith("google.protobuf."))return!1;switch(t.desc.typeName){case"google.protobuf.Any":return cM(t.message,e,n),!0;case"google.protobuf.Timestamp":return uM(t.message,e),!0;case"google.protobuf.Duration":return dM(t.message,e),!0;case"google.protobuf.FieldMask":return hM(t.message,e),!0;case"google.protobuf.Struct":return R3(t.message,e),!0;case"google.protobuf.Value":return j0(t.message,e),!0;case"google.protobuf.ListValue":return N3(t.message,e),!0;default:if(ou(t.desc)){const r=t.desc.fields[0];return e===null?t.clear(r):t.set(r,Qh(r,e,!0)),!0}return!1}}function cM(t,e,n){var r;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${t.$typeName} from JSON: expected object but got ${Sn(e)}`);if(Object.keys(e).length==0)return;const s=e["@type"];if(typeof s!="string"||s=="")throw new Error(`cannot decode message ${t.$typeName} from JSON: "@type" is empty`);const c=s.includes("/")?s.substring(s.lastIndexOf("/")+1):s;if(!c.length)throw new Error(`cannot decode message ${t.$typeName} from JSON: "@type" is invalid`);const i=(r=n.registry)===null||r===void 0?void 0:r.getMessage(c);if(!i)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${s} is not in the type registry`);const o=or(i);if(c.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(e,"value")){const u=e.value;Ha(o,u,n)}else{const u=Object.assign({},e);delete u["@type"],Ha(o,u,n)}ID(o.desc,o.message,t)}function uM(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);const n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error(`cannot decode message ${t.$typeName} from JSON: invalid RFC 3339 string`);const r=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(r))throw new Error(`cannot decode message ${t.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${t.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);t.seconds=Zt.parse(r/1e3),t.nanos=0,n[7]&&(t.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9)}function dM(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);const n=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);const r=Number(n[1]);if(r>315576e6||r<-315576e6)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);if(t.seconds=Zt.parse(r),typeof n[2]!="string")return;const s=n[2]+"0".repeat(9-n[2].length);t.nanos=parseInt(s),(r<0||Object.is(r,-0))&&(t.nanos=-t.nanos)}function hM(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${Sn(e)}`);if(e==="")return;function n(r){if(r.includes("_"))throw new Error(`cannot decode message ${t.$typeName} from JSON: path names must be lowerCamelCase`);const s=r.replace(/[A-Z]/g,c=>"_"+c.toLowerCase());return s[0]==="_"?s.substring(1):s}t.paths=e.split(",").map(n)}function R3(t,e){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error(`cannot decode message ${t.$typeName} from JSON ${Sn(e)}`);for(const[n,r]of Object.entries(e)){const s=mn(j3);j0(s,r),t.fields[n]=s}}function j0(t,e){switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:Bv.NULL_VALUE};else if(Array.isArray(e)){const n=mn(MD);N3(n,e),t.kind={case:"listValue",value:n}}else{const n=mn(DD);R3(n,e),t.kind={case:"structValue",value:n}}break;default:throw new Error(`cannot decode message ${t.$typeName} from JSON ${Sn(e)}`)}return t}function N3(t,e){if(!Array.isArray(e))throw new Error(`cannot decode message ${t.$typeName} from JSON ${Sn(e)}`);for(const n of e){const r=mn(j3);j0(r,n),t.values.push(r)}}const On=[];for(let t=0;t<256;++t)On.push((t+256).toString(16).slice(1));function fM(t,e=0){return(On[t[e+0]]+On[t[e+1]]+On[t[e+2]]+On[t[e+3]]+"-"+On[t[e+4]]+On[t[e+5]]+"-"+On[t[e+6]]+On[t[e+7]]+"-"+On[t[e+8]]+On[t[e+9]]+"-"+On[t[e+10]]+On[t[e+11]]+On[t[e+12]]+On[t[e+13]]+On[t[e+14]]+On[t[e+15]]).toLowerCase()}let zm;const pM=new Uint8Array(16);function mM(){if(!zm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zm=crypto.getRandomValues.bind(crypto)}return zm(pM)}const vM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),BS={randomUUID:vM};function US(t,e,n){var s;if(BS.randomUUID&&!t)return BS.randomUUID();t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??mM();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,fM(r)}const gM=Yi("ChphZ2VudC92MS9jcmVkZW50aWFscy5wcm90bxIIYWdlbnQudjEioQEKCk9BdXRoVG9rZW4SFAoMYWNjZXNzX3Rva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkSFQoNcmVmcmVzaF90b2tlbhgDIAEoCRISCgpleHBpcmVzX2F0GAQgASgDEioKBmV4cGlyeRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEgoKZXhwaXJlc19pbhgGIAEoA0JAWj5naXRodWIuY29tL3J1bm1lZGV2L3J1bm1lL3YzL2FwaS9nZW4vcHJvdG8vZ28vYWdlbnQvdjE7YWdlbnR2MWIGcHJvdG8z",[OD]),FS=Qa(gM,0),bM=["agent-session","cassie-session"],yM=["agent-oauth-token","cassie-oauth-token"];function ef(){for(const t of bM){const e=document.cookie.split("; ").find(r=>r.startsWith(t+"=")),n=e==null?void 0:e.split("=")[1];if(n&&n.length>0)return n}}function _M(){let t=mn(FS);for(const e of yM){const n=document.cookie.split("; ").find(s=>s.startsWith(e+"=")),r=n==null?void 0:n.split("=")[1];if(r&&r.length>0)try{const s=decodeURIComponent(r),c=JSON.parse(s);return t=A3(FS,c),t}catch(s){console.error("Failed to parse OAuthToken:",s)}}return t}var xt;(function(t){t[t.Canceled=1]="Canceled",t[t.Unknown=2]="Unknown",t[t.InvalidArgument=3]="InvalidArgument",t[t.DeadlineExceeded=4]="DeadlineExceeded",t[t.NotFound=5]="NotFound",t[t.AlreadyExists=6]="AlreadyExists",t[t.PermissionDenied=7]="PermissionDenied",t[t.ResourceExhausted=8]="ResourceExhausted",t[t.FailedPrecondition=9]="FailedPrecondition",t[t.Aborted=10]="Aborted",t[t.OutOfRange=11]="OutOfRange",t[t.Unimplemented=12]="Unimplemented",t[t.Internal=13]="Internal",t[t.Unavailable=14]="Unavailable",t[t.DataLoss=15]="DataLoss",t[t.Unauthenticated=16]="Unauthenticated"})(xt||(xt={}));function VS(t){const e=xt[t];return typeof e!="string"?t.toString():e[0].toLowerCase()+e.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class Bt extends Error{constructor(e,n=xt.Unknown,r,s,c){super(wM(e,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=n,this.metadata=new Headers(r??{}),this.details=s??[],this.cause=c}static from(e,n=xt.Unknown){return e instanceof Bt?e:e instanceof Error?e.name=="AbortError"?new Bt(e.message,xt.Canceled):new Bt(e.message,n,void 0,void 0,e):new Bt(String(e),n,void 0,void 0,e)}static[Symbol.hasInstance](e){return e instanceof Error?Object.getPrototypeOf(e)===Bt.prototype?!0:e.name==="ConnectError"&&"code"in e&&typeof e.code=="number"&&"metadata"in e&&"details"in e&&Array.isArray(e.details)&&"rawMessage"in e&&typeof e.rawMessage=="string"&&"cause"in e:!1}findDetails(e){const n=e.kind==="message"?{getMessage:s=>s===e.typeName?e:void 0}:e,r=[];for(const s of this.details){if("desc"in s){n.getMessage(s.desc.typeName)&&r.push(mn(s.desc,s.value));continue}const c=n.getMessage(s.type);if(c)try{r.push(lu(c,s.value))}catch{}}return r}}function wM(t,e){return t.length?`[${VS(e)}] ${t}`:`[${VS(e)}]`}function SM(t,e,n){try{const r=a0(t);return e?lu(e,r,n):r}catch(r){throw Bt.from(r,xt.DataLoss)}}function xM(t,e){const n={};for(const r of t.methods){const s=e(r);s!=null&&(n[r.localName]=s)}return n}const zS=1;function HS(t){let e,n=new Uint8Array(0);function r(s){const c=new Uint8Array(n.length+s.length);c.set(n),c.set(s,n.length),n=c}return new ReadableStream({start(){e=t.getReader()},async pull(s){let c;for(;;){if(c===void 0&&n.byteLength>=5){let u=0;for(let l=1;l<5;l++)u=(u<<8)+n[l];c={flags:n[0],length:u}}if(c!==void 0&&n.byteLength>=c.length+5)break;const o=await e.read();if(o.done)break;r(o.value)}if(c===void 0){if(n.byteLength==0){s.close();return}s.error(new Bt("premature end of stream",xt.DataLoss));return}const i=n.subarray(5,5+c.length);n=n.subarray(5+c.length),s.enqueue({flags:c.flags,data:i})}})}function WS(t,e){const n=new Uint8Array(e.length+5);n.set(e,5);const r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,t),r.setUint32(1,e.length),n}var CM=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(c){n[c]=t[c]&&function(i){return new Promise(function(o,u){i=t[c](i),s(o,u,i.done,i.value)})}}function s(c,i,o,u){Promise.resolve(u).then(function(l){c({value:l,done:o})},i)}},Hc=function(t){return this instanceof Hc?(this.v=t,this):new Hc(t)},EM=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(v){return Promise.resolve(v).then(p,d)}}function o(p,v){r[p]&&(s[p]=function(m){return new Promise(function(b,y){c.push([p,m,b,y])>1||u(p,m)})},v&&(s[p]=v(s[p])))}function u(p,v){try{l(r[p](v))}catch(m){f(c[0][3],m)}}function l(p){p.value instanceof Hc?Promise.resolve(p.value.v).then(a,d):f(c[0][2],p)}function a(p){u("next",p)}function d(p){u("throw",p)}function f(p,v){p(v),c.shift(),c.length&&u(c[0][0],c[0][1])}},jM=function(t){var e,n;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,c){e[s]=t[s]?function(i){return(n=!n)?{value:Hc(t[s](i)),done:!1}:c?c(i):i}:c}};function kM(t){return EM(this,arguments,function*(){yield Hc(yield*jM(CM(t)))})}var L3=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(c){n[c]=t[c]&&function(i){return new Promise(function(o,u){i=t[c](i),s(o,u,i.done,i.value)})}}function s(c,i,o,u){Promise.resolve(u).then(function(l){c({value:l,done:o})},i)}},Wa=function(t){return this instanceof Wa?(this.v=t,this):new Wa(t)},TM=function(t){var e,n;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,c){e[s]=t[s]?function(i){return(n=!n)?{value:Wa(t[s](i)),done:!1}:c?c(i):i}:c}},OM=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(v){return Promise.resolve(v).then(p,d)}}function o(p,v){r[p]&&(s[p]=function(m){return new Promise(function(b,y){c.push([p,m,b,y])>1||u(p,m)})},v&&(s[p]=v(s[p])))}function u(p,v){try{l(r[p](v))}catch(m){f(c[0][3],m)}}function l(p){p.value instanceof Wa?Promise.resolve(p.value.v).then(a,d):f(c[0][2],p)}function a(p){u("next",p)}function d(p){u("throw",p)}function f(p,v){p(v),c.shift(),c.length&&u(c[0][0],c[0][1])}};function AM(t,e){return xM(t,n=>{switch(n.methodKind){case"unary":return IM(e,n);case"server_streaming":return RM(e,n);case"client_streaming":return NM(e,n);case"bidi_streaming":return LM(e,n);default:return null}})}function IM(t,e){return async function(n,r){var s,c;const i=await t.unary(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues);return(s=r==null?void 0:r.onHeader)===null||s===void 0||s.call(r,i.header),(c=r==null?void 0:r.onTrailer)===null||c===void 0||c.call(r,i.trailer),i.message}}function RM(t,e){return function(n,r){return D3(t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,kM([n]),r==null?void 0:r.contextValues),r)}}function NM(t,e){return async function(n,r){var s,c,i,o,u,l;const a=await t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues);(u=r==null?void 0:r.onHeader)===null||u===void 0||u.call(r,a.header);let d,f=0;try{for(var p=!0,v=L3(a.message),m;m=await v.next(),s=m.done,!s;p=!0)o=m.value,p=!1,d=o,f++}catch(b){c={error:b}}finally{try{!p&&!s&&(i=v.return)&&await i.call(v)}finally{if(c)throw c.error}}if(!d)throw new Bt("protocol error: missing response message",xt.Unimplemented);if(f>1)throw new Bt("protocol error: received extra messages for client streaming method",xt.Unimplemented);return(l=r==null?void 0:r.onTrailer)===null||l===void 0||l.call(r,a.trailer),d}}function LM(t,e){return function(n,r){return D3(t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues),r)}}function D3(t,e){const n=function(){return OM(this,arguments,function*(){var r,s;const c=yield Wa(t);(r=e==null?void 0:e.onHeader)===null||r===void 0||r.call(e,c.header),yield Wa(yield*TM(L3(c.message))),(s=e==null?void 0:e.onTrailer)===null||s===void 0||s.call(e,c.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function DM(...t){const e=new AbortController,n=t.filter(s=>s!==void 0).concat(e.signal);for(const s of n){if(s.aborted){r.apply(s);break}s.addEventListener("abort",r)}function r(){e.signal.aborted||e.abort(M3(this));for(const s of n)s.removeEventListener("abort",r)}return e}function MM(t){const e=new AbortController,n=()=>{e.abort(new Bt("the operation timed out",xt.DeadlineExceeded))};let r;return t!==void 0&&(t<=0?n():r=setTimeout(n,t)),{signal:e.signal,cleanup:()=>clearTimeout(r)}}function M3(t){if(!t.aborted)return;if(t.reason!==void 0)return t.reason;const e=new Error("This operation was aborted");return e.name="AbortError",e}function GS(){return{get(t){return t.id in this?this[t.id]:t.defaultValue},set(t,e){return this[t.id]=e,this},delete(t){return delete this[t.id],this}}}const Hm=128;function ZS(t){const e=new Headers,n=new TextDecoder().decode(t).split(`\r
6647
6647
  `);for(const r of n){if(r==="")continue;const s=r.indexOf(":");if(s>0){const c=r.substring(0,s).trim(),i=r.substring(s+1).trim();e.append(c,i)}}return e}const PM="Content-Type",$M="Grpc-Timeout",Ga="Grpc-Status",P3="Grpc-Message",BM="Grpc-Status-Details-Bin",YS="User-Agent",Wm="X-User-Agent",UM="X-Grpc-Web",FM="application/grpc-web+proto",VM="application/grpc-web+json",zM=Yi("CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z",[C3]),HM=Qa(zM,0),WM="0";function $3(t){var e;const n=t.get(BM);if(n!=null){const s=SM(n,HM);if(s.code==0)return;const c=new Bt(s.message,s.code,t);return c.details=s.details.map(i=>({type:i.typeUrl.substring(i.typeUrl.lastIndexOf("/")+1),value:i.value})),c}const r=t.get(Ga);if(r!=null){if(r===WM)return;const s=parseInt(r,10);return s in xt?new Bt(decodeURIComponent((e=t.get(P3))!==null&&e!==void 0?e:""),s,t):new Bt(`invalid grpc-status: ${r}`,xt.Internal,t)}}function KS(t,e){return t.toString().replace(/\/?$/,`/${e.parent.typeName}/${e.name}`)}function B3(t,e){return mn(t,e)}function GM(t,e){function n(r){return r.done===!0?r:{done:r.done,value:B3(t,r.value)}}return{[Symbol.asyncIterator](){const r=e[Symbol.asyncIterator](),s={next:()=>r.next().then(n)};return r.throw!==void 0&&(s.throw=c=>r.throw(c).then(n)),r.return!==void 0&&(s.return=c=>r.return(c).then(n)),s}}}function U3(t,e){var n;return(n=e==null?void 0:e.concat().reverse().reduce((r,s)=>s(r),t))!==null&&n!==void 0?n:t}function ZM(t){var e;const n=Object.assign({},t);return(e=n.ignoreUnknownFields)!==null&&e!==void 0||(n.ignoreUnknownFields=!0),n}function XS(t,e,n,r){const s=e?qS(t.input,r):JS(t.input,n);return{parse:(e?qS(t.output,r):JS(t.output,n)).parse,serialize:s.serialize}}function qS(t,e){return{parse(n){try{return lu(t,n,e)}catch(r){const s=r instanceof Error?r.message:String(r);throw new Bt(`parse binary: ${s}`,xt.Internal)}},serialize(n){try{return g3(t,n,e)}catch(r){const s=r instanceof Error?r.message:String(r);throw new Bt(`serialize binary: ${s}`,xt.Internal)}}}}function JS(t,e){var n,r;const s=(n=e==null?void 0:e.textEncoder)!==null&&n!==void 0?n:new TextEncoder,c=(r=e==null?void 0:e.textDecoder)!==null&&r!==void 0?r:new TextDecoder,i=ZM(e);return{parse(o){try{const u=c.decode(o);return eM(t,u,i)}catch(u){throw Bt.from(u,xt.InvalidArgument)}},serialize(o){try{const u=HD(t,o,i);return s.encode(u)}catch(u){throw Bt.from(u,xt.Internal)}}}}function YM(t){const e=U3(t.next,t.interceptors),[n,r,s]=F3(t),c=Object.assign(Object.assign({},t.req),{message:B3(t.req.method.input,t.req.message),signal:n});return e(c).then(i=>(s(),i),r)}function KM(t){const e=U3(t.next,t.interceptors),[n,r,s]=F3(t),c=Object.assign(Object.assign({},t.req),{message:GM(t.req.method.input,t.req.message),signal:n});let i=!1;return n.addEventListener("abort",function(){var o,u;const l=t.req.message[Symbol.asyncIterator]();i||(o=l.throw)===null||o===void 0||o.call(l,this.reason).catch(()=>{}),(u=l.return)===null||u===void 0||u.call(l).catch(()=>{})}),e(c).then(o=>Object.assign(Object.assign({},o),{message:{[Symbol.asyncIterator](){const u=o.message[Symbol.asyncIterator]();return{next(){return u.next().then(l=>(l.done==!0&&(i=!0,s()),l),r)}}}}}),r)}function F3(t){const{signal:e,cleanup:n}=MM(t.timeoutMs),r=DM(t.signal,e);return[r.signal,function(c){const i=Bt.from(e.aborted?M3(e):c);return r.abort(i),n(),Promise.reject(i)},function(){n(),r.abort()}]}function XM(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function QS(t,e){const n=$3(t);if(n)throw e.forEach((r,s)=>{n.metadata.append(s,r)}),n;if(!e.has(Ga)&&!t.has(Ga))throw new Bt("protocol error: missing status",xt.Internal)}function e2(t,e,n,r){const s=new Headers(n??{});s.set(PM,t?FM:VM),s.set(UM,"1");let c="connect-es/2.0.2";return c=s.has(YS)?s.get(YS):s.has(Wm)?s.get(Wm):c,s.set(Wm,c),e!==void 0&&s.set($M,`${e}m`),s}function qM(t){switch(t){case 400:return xt.Internal;case 401:return xt.Unauthenticated;case 403:return xt.PermissionDenied;case 404:return xt.Unimplemented;case 429:return xt.Unavailable;case 502:return xt.Unavailable;case 503:return xt.Unavailable;case 504:return xt.Unavailable;default:return xt.Unknown}}function t2(t,e){var n;if(t>=200&&t<300)return{foundStatus:e.has(Ga),headerError:$3(e)};throw new Bt(decodeURIComponent((n=e.get(P3))!==null&&n!==void 0?n:`HTTP ${t}`),qM(t),e)}var Ao=function(t){return this instanceof Ao?(this.v=t,this):new Ao(t)},JM=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(v){return Promise.resolve(v).then(p,d)}}function o(p,v){r[p]&&(s[p]=function(m){return new Promise(function(b,y){c.push([p,m,b,y])>1||u(p,m)})},v&&(s[p]=v(s[p])))}function u(p,v){try{l(r[p](v))}catch(m){f(c[0][3],m)}}function l(p){p.value instanceof Ao?Promise.resolve(p.value.v).then(a,d):f(c[0][2],p)}function a(p){u("next",p)}function d(p){u("throw",p)}function f(p,v){p(v),c.shift(),c.length&&u(c[0][0],c[0][1])}};const n2={redirect:"error"};function QM(t){var e;XM();const n=(e=t.useBinaryFormat)!==null&&e!==void 0?e:!0;return{async unary(r,s,c,i,o,u){const{serialize:l,parse:a}=XS(r,n,t.jsonOptions,t.binaryOptions);return c=c===void 0?t.defaultTimeoutMs:c<=0?void 0:c,await YM({interceptors:t.interceptors,signal:s,timeoutMs:c,req:{stream:!1,service:r.parent,method:r,requestMethod:"POST",url:KS(t.baseUrl,r),header:e2(n,c,i),contextValues:u??GS(),message:o},next:async d=>{var f;const v=await((f=t.fetch)!==null&&f!==void 0?f:globalThis.fetch)(d.url,Object.assign(Object.assign({},n2),{method:d.requestMethod,headers:d.header,signal:d.signal,body:WS(0,l(d.message))})),{headerError:m}=t2(v.status,v.headers);if(!v.body)throw m!==void 0?m:"missing response body";const b=HS(v.body).getReader();let y,_;for(;;){const S=await b.read();if(S.done)break;const{flags:C,data:x}=S.value;if((C&zS)===zS)throw new Bt("protocol error: received unsupported compressed output",xt.Internal);if(C===Hm){if(y!==void 0)throw"extra trailer";y=ZS(x);continue}if(_!==void 0)throw new Bt("extra message",xt.Unimplemented);_=a(x)}if(y===void 0)throw m!==void 0?m:new Bt("missing trailer",v.headers.has(Ga)?xt.Unimplemented:xt.Unknown);if(QS(y,v.headers),_===void 0)throw new Bt("missing message",y.has(Ga)?xt.Unimplemented:xt.Unknown);return{stream:!1,service:r.parent,method:r,header:v.headers,message:_,trailer:y}}})},async stream(r,s,c,i,o,u){const{serialize:l,parse:a}=XS(r,n,t.jsonOptions,t.binaryOptions);function d(p,v,m,b,y){return JM(this,arguments,function*(){const S=HS(p).getReader();if(v){if(!(yield Ao(S.read())).done)throw"extra data for trailers-only";return yield Ao(void 0)}let C=!1;for(;;){const x=yield Ao(S.read());if(x.done)break;const{flags:j,data:k}=x.value;if((j&Hm)===Hm){if(C)throw"extra trailer";C=!0;const T=ZS(k);QS(T,b),T.forEach((A,L)=>m.set(L,A));continue}if(C)throw"extra message";yield yield Ao(a(k))}if("throwIfAborted"in y&&y.throwIfAborted(),!C)throw"missing trailer"})}async function f(p){if(r.methodKind!="server_streaming")throw"The fetch API does not support streaming request bodies";const v=await p[Symbol.asyncIterator]().next();if(v.done==!0)throw"missing request message";return WS(0,l(v.value))}return c=c===void 0?t.defaultTimeoutMs:c<=0?void 0:c,KM({interceptors:t.interceptors,signal:s,timeoutMs:c,req:{stream:!0,service:r.parent,method:r,requestMethod:"POST",url:KS(t.baseUrl,r),header:e2(n,c,i),contextValues:u??GS(),message:o},next:async p=>{var v;const b=await((v=t.fetch)!==null&&v!==void 0?v:globalThis.fetch)(p.url,Object.assign(Object.assign({},n2),{method:p.requestMethod,headers:p.header,signal:p.signal,body:await f(p.message)})),{foundStatus:y,headerError:_}=t2(b.status,b.headers);if(_!=null)throw _;if(!b.body)throw"missing response body";const S=new Headers;return Object.assign(Object.assign({},p),{header:b.headers,trailer:S,message:d(b.body,y,S,b.headers,p.signal)})}})}}}const V3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ph=32,eP=16,z3=10,r2=0xffffffffffff;var Io;(function(t){t.Base32IncorrectEncoding="B32_ENC_INVALID",t.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",t.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",t.EncodeTimeNegative="ENC_TIME_NEG",t.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",t.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",t.PRNGDetectFailure="PRNG_DETECT",t.ULIDInvalid="ULID_INVALID",t.Unexpected="UNEXPECTED",t.UUIDInvalid="UUID_INVALID"})(Io||(Io={}));class fc extends Error{constructor(e,n){super(`${n} (${e})`),this.name="ULIDError",this.code=e}}function tP(t){const e=Math.floor(t()*ph)%ph;return V3.charAt(e)}function nP(t){const e=rP(),n=e&&(e.crypto||e.msCrypto)||null;if(typeof(n==null?void 0:n.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return n.getRandomValues(r),r[0]/255};if(typeof(n==null?void 0:n.randomBytes)=="function")return()=>n.randomBytes(1).readUInt8()/255;throw new fc(Io.PRNGDetectFailure,"Failed to find a reliable PRNG")}function rP(){return oP()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function sP(t,e){let n="";for(;t>0;t--)n=tP(e)+n;return n}function iP(t,e=z3){if(isNaN(t))throw new fc(Io.EncodeTimeValueMalformed,`Time must be a number: ${t}`);if(t>r2)throw new fc(Io.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${r2}: ${t}`);if(t<0)throw new fc(Io.EncodeTimeNegative,`Time must be positive: ${t}`);if(Number.isInteger(t)===!1)throw new fc(Io.EncodeTimeValueMalformed,`Time must be an integer: ${t}`);let n,r="";for(let s=e;s>0;s--)n=t%ph,r=V3.charAt(n)+r,t=(t-n)/ph;return r}function oP(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function aP(t,e){const n=nP(),r=Date.now();return iP(r,z3)+sP(eP,n)}const H3=D.createContext(void 0),es=()=>{const t=D.useContext(H3);if(!t)throw new Error("useSettings must be used within a SettingsProvider");return t},lP=({children:t,requireAuth:e,webApp:n})=>{const[r,s]=D.useState(null),c=D.useMemo(()=>{const a=window.location.hostname==="localhost",d=window.location.protocol==="http:",f=window.location.port==="4173"||window.location.port==="5173",p=a&&d&&f;let v=new URL(window.location.href);n!=null&&n.runner&&(v=new URL(n.runner));const m={requireAuth:!1,agentEndpoint:p?"http://localhost:8080":window.location.origin,webApp:{runner:p?"ws://localhost:8080/ws":`${v.protocol==="https:"?"wss:":"ws:"}//${v.host}/ws`,reconnect:(n==null?void 0:n.reconnect)??!0,invertedOrder:(n==null?void 0:n.invertedOrder)??!1}};return e!==void 0&&(m.requireAuth=e),m},[e,n]),[i,o]=D.useState(()=>{const a=localStorage.getItem("cloudAssistantSettings"),d=a?JSON.parse(a):{};return d&&d.webApp&&d.webApp.reconnect!==void 0&&(d.webApp.reconnect=c.webApp.reconnect),a?{...c,...d}:c});D.useEffect(()=>{localStorage.setItem("cloudAssistantSettings",JSON.stringify(i))},[i]);const u=D.useCallback(async()=>{if(!i.webApp.runner)return;s(null);const a=new Bj({knownID:`check_${aP()}`,runID:Uj(),sequence:0},{runnerEndpoint:i.webApp.runner,authorization:{bearerToken:ef()},autoReconnect:!1}),d=[];return d.push(a.errors.subscribe({next:f=>s(f)})),d.push(a.connect($j.INITIAL).subscribe(f=>{f!==null&&(console.log(`Initial heartbeat latency for streamID ${f.streamID} (${f.readyState===1?"open":"closed"}): ${f.latency}ms`),a.close())})),()=>{d.forEach(f=>f.unsubscribe())}},[i.webApp.runner]);D.useEffect(()=>{u()},[u]);const l=a=>{o(d=>({...d,...a,webApp:{...d.webApp,...a.webApp}}))};return J.jsx(H3.Provider,{value:{checkRunnerAuth:u,defaultSettings:c,runnerError:r,settings:i,updateSettings:l},children:t})},W3=D.createContext(void 0),cP=()=>{const t=D.useContext(W3);if(!t)throw new Error("useClient must be used within a ClientProvider");return t},uP=({children:t})=>{const[e,n]=D.useState(),{settings:r}=es();return D.useEffect(()=>{n(hP(r.agentEndpoint))},[r.agentEndpoint]),J.jsx(W3.Provider,{value:{client:e,setClient:n},children:t})},dP=t=>{const e=Bt.from(t);e.code===xt.Unauthenticated&&(window.location.href=`/login?error=${encodeURIComponent(e.name)}&error_description=${encodeURIComponent(e.message)}`)};function hP(t){console.log(`initializing the client: baseURL ${t}`);const e=QM({baseUrl:t,interceptors:[n=>r=>{const s=ef();return s&&r.header.set("Authorization",`Bearer ${s}`),n(r).catch(c=>{throw dP(c),c})}]});return AM(TD,e)}const G3=D.createContext(void 0),Xi=()=>{const t=D.useContext(G3);if(!t)throw new Error("useBlock must be used within a BlockProvider");return t},fP=({children:t})=>{const{settings:e}=es(),[n,r]=D.useState(0),[s,c]=D.useState(!1),[i,o]=D.useState(!1),[u,l]=D.useState(),a=()=>{r(N=>N+1)},{client:d}=cP(),[f,p]=D.useState({blocks:{},positions:[]}),v=D.useMemo(()=>e.webApp.invertedOrder,[e.webApp.invertedOrder]);D.useEffect(()=>{p(N=>({...N,positions:[...N.positions].reverse()}))},[v]);const m=D.useMemo(()=>f.positions.map(N=>f.blocks[N]).filter(N=>!!N&&(N.kind===vs.MARKUP||N.kind===vs.CODE)),[f.blocks,f.positions]),b=D.useMemo(()=>f.positions.map(N=>f.blocks[N]).filter(N=>!!N&&N.kind===vs.CODE),[f.blocks,f.positions]),y=D.useMemo(()=>f.positions.map(N=>f.blocks[N]).filter(N=>!!N&&N.kind===vs.FILE_SEARCH_RESULTS),[f.blocks,f.positions]),_=()=>({chat:m,actions:b,files:y}),S=N=>{const M=fD(xc,N);return M.outputs=N.outputs.map(F=>mn(SD,{items:F.items.map(Z=>mn(xD,Z)),kind:F.kind})),M},C=async N=>{const M=_M(),F=mn(CD,{blocks:N,previousResponseId:u});F.openaiAccessToken=M.accessToken,M.accessToken||console.error("No access token found");try{const Z=d.generate(F);for await(const Y of Z){for(const X of Y.blocks)o(!1),k(X);l(Y.responseId)}}catch(Z){console.log(Z)}finally{o(!1),c(!1)}},x=async N=>{if(!N.trim())return;const M=mn(xc,{id:`user_${US()}`,role:si.USER,kind:vs.MARKUP,contents:N});k(M),c(!0),o(!0),await C([M])},j=async N=>{N.outputs.length!==0&&(console.log("sending output block",N.id,"previousResponseId",u),c(!0),o(!0),await C([N]))},k=N=>{p(M=>{if(!M.blocks[N.id]){const F=v?[N.id,...M.positions]:[...M.positions,N.id];return{blocks:{...M.blocks,[N.id]:N},positions:F}}return{...M,blocks:{...M.blocks,[N.id]:N}}})},T=()=>{p({blocks:{},positions:[]}),r(0),l(void 0)},A=()=>{const N=mn(xc,{id:`code_${US()}`,role:si.USER,kind:vs.CODE,contents:""});k(N)},L=N=>{if(b.find(F=>F.id===N.id)){const F=new CustomEvent("runCodeBlock",{detail:{blockId:N.id}});window.dispatchEvent(F)}};return J.jsx(G3.Provider,{value:{useColumns:_,sequence:n,incrementSequence:a,sendOutputBlock:j,createOutputBlock:S,sendUserBlock:x,addCodeBlock:A,isInputDisabled:s,isTyping:i,runCodeBlock:L,resetSession:T},children:t})},pP=mn(xc,{kind:vs.MARKUP,role:si.ASSISTANT,contents:"..."});function mP(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function i2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?s2(Object(n),!0).forEach(function(r){mP(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s2(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vP(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,c;for(c=0;c<r.length;c++)s=r[c],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function gP(t,e){if(t==null)return{};var n=vP(t,e),r,s;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(s=0;s<c.length;s++)r=c[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function bP(t,e){return yP(t)||_P(t,e)||wP(t,e)||SP()}function yP(t){if(Array.isArray(t))return t}function _P(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,s=!1,c=void 0;try{for(var i=t[Symbol.iterator](),o;!(r=(o=i.next()).done)&&(n.push(o.value),!(e&&n.length===e));r=!0);}catch(u){s=!0,c=u}finally{try{!r&&i.return!=null&&i.return()}finally{if(s)throw c}}return n}}function wP(t,e){if(t){if(typeof t=="string")return o2(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o2(t,e)}}function o2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function SP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6648
6648
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xP(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function l2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?a2(Object(n),!0).forEach(function(r){xP(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a2(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function CP(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(s,c){return c(s)},r)}}function pc(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),c=0;c<r;c++)s[c]=arguments[c];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return e.apply(n,[].concat(s,o))}}}function mh(t){return{}.toString.call(t).includes("Object")}function EP(t){return!Object.keys(t).length}function Wc(t){return typeof t=="function"}function jP(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function kP(t,e){return mh(e)||Mi("changeType"),Object.keys(e).some(function(n){return!jP(t,n)})&&Mi("changeField"),e}function TP(t){Wc(t)||Mi("selectorType")}function OP(t){Wc(t)||mh(t)||Mi("handlerType"),mh(t)&&Object.values(t).some(function(e){return!Wc(e)})&&Mi("handlersType")}function AP(t){t||Mi("initialIsRequired"),mh(t)||Mi("initialType"),EP(t)&&Mi("initialContent")}function IP(t,e){throw new Error(t[e]||t.default)}var RP={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Mi=pc(IP)(RP),Nd={changes:kP,selector:TP,handler:OP,initial:AP};function NP(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Nd.initial(t),Nd.handler(e);var n={current:t},r=pc(MP)(n,e),s=pc(DP)(n),c=pc(Nd.changes)(t),i=pc(LP)(n);function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(a){return a};return Nd.selector(l),l(n.current)}function u(l){CP(r,s,c,i)(l)}return[o,u]}function LP(t,e){return Wc(e)?e(t.current):e}function DP(t,e){return t.current=l2(l2({},t.current),e),e}function MP(t,e,n){return Wc(e)?e(t.current):Object.keys(n).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,t.current[r])}),n}var PP={create:NP},$P={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function BP(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),c=0;c<r;c++)s[c]=arguments[c];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return e.apply(n,[].concat(s,o))}}}function UP(t){return{}.toString.call(t).includes("Object")}function FP(t){return t||c2("configIsRequired"),UP(t)||c2("configType"),t.urls?(VP(),{paths:{vs:t.urls.monacoBase}}):t}function VP(){console.warn(Z3.deprecation)}function zP(t,e){throw new Error(t[e]||t.default)}var Z3={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
6649
6649
  You are using deprecated way of configuration.
@@ -6655,7 +6655,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
6655
6655
 
6656
6656
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
6657
6657
  `},c2=BP(zP)(Z3),HP={config:FP},WP=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(c,i){return i(c)},s)}};function Y3(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],Y3(t[n],e[n]))}),i2(i2({},t),e)}var GP={type:"cancelation",msg:"operation is manually canceled"};function Gm(t){var e=!1,n=new Promise(function(r,s){t.then(function(c){return e?s(GP):r(c)}),t.catch(s)});return n.cancel=function(){return e=!0},n}var ZP=PP.create({config:$P,isInitialized:!1,resolve:null,reject:null,monaco:null}),K3=bP(ZP,2),uu=K3[0],tf=K3[1];function YP(t){var e=HP.config(t),n=e.monaco,r=gP(e,["monaco"]);tf(function(s){return{config:Y3(s.config,r),monaco:n}})}function KP(){var t=uu(function(e){var n=e.monaco,r=e.isInitialized,s=e.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!t.isInitialized){if(tf({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Gm(Zm);if(window.monaco&&window.monaco.editor)return X3(window.monaco),t.resolve(window.monaco),Gm(Zm);WP(XP,JP)(QP)}return Gm(Zm)}function XP(t){return document.body.appendChild(t)}function qP(t){var e=document.createElement("script");return t&&(e.src=t),e}function JP(t){var e=uu(function(r){var s=r.config,c=r.reject;return{config:s,reject:c}}),n=qP("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function QP(){var t=uu(function(n){var r=n.config,s=n.resolve,c=n.reject;return{config:r,resolve:s,reject:c}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){X3(n),t.resolve(n)},function(n){t.reject(n)})}function X3(t){uu().monaco||tf({monaco:t})}function e$(){return uu(function(t){var e=t.monaco;return e})}var Zm=new Promise(function(t,e){return tf({resolve:t,reject:e})}),q3={config:YP,init:KP,__getMonacoInstance:e$},t$={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ym=t$,n$={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},r$=n$;function s$({children:t}){return Qn.createElement("div",{style:r$.container},t)}var i$=s$,o$=i$;function a$({width:t,height:e,isEditorReady:n,loading:r,_ref:s,className:c,wrapperProps:i}){return Qn.createElement("section",{style:{...Ym.wrapper,width:t,height:e},...i},!n&&Qn.createElement(o$,null,r),Qn.createElement("div",{ref:s,style:{...Ym.fullWidth,...!n&&Ym.hide},className:c}))}var l$=a$,J3=D.memo(l$);function c$(t){D.useEffect(t,[])}var Q3=c$;function u$(t,e,n=!0){let r=D.useRef(!0);D.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var _r=u$;function Cc(){}function Oa(t,e,n,r){return d$(t,r)||h$(t,e,n,r)}function d$(t,e){return t.editor.getModel(ek(t,e))}function h$(t,e,n,r){return t.editor.createModel(e,n,r?ek(t,r):void 0)}function ek(t,e){return t.Uri.parse(e)}function f$({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:c,modifiedModelPath:i,keepCurrentOriginalModel:o=!1,keepCurrentModifiedModel:u=!1,theme:l="light",loading:a="Loading...",options:d={},height:f="100%",width:p="100%",className:v,wrapperProps:m={},beforeMount:b=Cc,onMount:y=Cc}){let[_,S]=D.useState(!1),[C,x]=D.useState(!0),j=D.useRef(null),k=D.useRef(null),T=D.useRef(null),A=D.useRef(y),L=D.useRef(b),N=D.useRef(!1);Q3(()=>{let Y=q3.init();return Y.then(X=>(k.current=X)&&x(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>j.current?Z():Y.cancel()}),_r(()=>{if(j.current&&k.current){let Y=j.current.getOriginalEditor(),X=Oa(k.current,t||"",r||n||"text",c||"");X!==Y.getModel()&&Y.setModel(X)}},[c],_),_r(()=>{if(j.current&&k.current){let Y=j.current.getModifiedEditor(),X=Oa(k.current,e||"",s||n||"text",i||"");X!==Y.getModel()&&Y.setModel(X)}},[i],_),_r(()=>{let Y=j.current.getModifiedEditor();Y.getOption(k.current.editor.EditorOption.readOnly)?Y.setValue(e||""):e!==Y.getValue()&&(Y.executeEdits("",[{range:Y.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),Y.pushUndoStop())},[e],_),_r(()=>{var Y,X;(X=(Y=j.current)==null?void 0:Y.getModel())==null||X.original.setValue(t||"")},[t],_),_r(()=>{let{original:Y,modified:X}=j.current.getModel();k.current.editor.setModelLanguage(Y,r||n||"text"),k.current.editor.setModelLanguage(X,s||n||"text")},[n,r,s],_),_r(()=>{var Y;(Y=k.current)==null||Y.editor.setTheme(l)},[l],_),_r(()=>{var Y;(Y=j.current)==null||Y.updateOptions(d)},[d],_);let M=D.useCallback(()=>{var Q;if(!k.current)return;L.current(k.current);let Y=Oa(k.current,t||"",r||n||"text",c||""),X=Oa(k.current,e||"",s||n||"text",i||"");(Q=j.current)==null||Q.setModel({original:Y,modified:X})},[n,e,s,t,r,c,i]),F=D.useCallback(()=>{var Y;!N.current&&T.current&&(j.current=k.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...d}),M(),(Y=k.current)==null||Y.editor.setTheme(l),S(!0),N.current=!0)},[d,l,M]);D.useEffect(()=>{_&&A.current(j.current,k.current)},[_]),D.useEffect(()=>{!C&&!_&&F()},[C,_,F]);function Z(){var X,Q,$,U;let Y=(X=j.current)==null?void 0:X.getModel();o||((Q=Y==null?void 0:Y.original)==null||Q.dispose()),u||(($=Y==null?void 0:Y.modified)==null||$.dispose()),(U=j.current)==null||U.dispose()}return Qn.createElement(J3,{width:p,height:f,isEditorReady:_,loading:a,_ref:T,className:v,wrapperProps:m})}var p$=f$;D.memo(p$);function m$(t){let e=D.useRef();return D.useEffect(()=>{e.current=t},[t]),e.current}var v$=m$,Ld=new Map;function g$({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:s,path:c,theme:i="light",line:o,loading:u="Loading...",options:l={},overrideServices:a={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p="100%",height:v="100%",className:m,wrapperProps:b={},beforeMount:y=Cc,onMount:_=Cc,onChange:S,onValidate:C=Cc}){let[x,j]=D.useState(!1),[k,T]=D.useState(!0),A=D.useRef(null),L=D.useRef(null),N=D.useRef(null),M=D.useRef(_),F=D.useRef(y),Z=D.useRef(),Y=D.useRef(r),X=v$(c),Q=D.useRef(!1),$=D.useRef(!1);Q3(()=>{let W=q3.init();return W.then(G=>(A.current=G)&&T(!1)).catch(G=>(G==null?void 0:G.type)!=="cancelation"&&console.error("Monaco initialization: error:",G)),()=>L.current?I():W.cancel()}),_r(()=>{var G,B,ee,re;let W=Oa(A.current,t||r||"",e||s||"",c||n||"");W!==((G=L.current)==null?void 0:G.getModel())&&(d&&Ld.set(X,(B=L.current)==null?void 0:B.saveViewState()),(ee=L.current)==null||ee.setModel(W),d&&((re=L.current)==null||re.restoreViewState(Ld.get(c))))},[c],x),_r(()=>{var W;(W=L.current)==null||W.updateOptions(l)},[l],x),_r(()=>{!L.current||r===void 0||(L.current.getOption(A.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&($.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),$.current=!1))},[r],x),_r(()=>{var G,B;let W=(G=L.current)==null?void 0:G.getModel();W&&s&&((B=A.current)==null||B.editor.setModelLanguage(W,s))},[s],x),_r(()=>{var W;o!==void 0&&((W=L.current)==null||W.revealLine(o))},[o],x),_r(()=>{var W;(W=A.current)==null||W.editor.setTheme(i)},[i],x);let U=D.useCallback(()=>{var W;if(!(!N.current||!A.current)&&!Q.current){F.current(A.current);let G=c||n,B=Oa(A.current,r||t||"",e||s||"",G||"");L.current=(W=A.current)==null?void 0:W.editor.create(N.current,{model:B,automaticLayout:!0,...l},a),d&&L.current.restoreViewState(Ld.get(G)),A.current.editor.setTheme(i),o!==void 0&&L.current.revealLine(o),j(!0),Q.current=!0}},[t,e,n,r,s,c,l,a,d,i,o]);D.useEffect(()=>{x&&M.current(L.current,A.current)},[x]),D.useEffect(()=>{!k&&!x&&U()},[k,x,U]),Y.current=r,D.useEffect(()=>{var W,G;x&&S&&((W=Z.current)==null||W.dispose(),Z.current=(G=L.current)==null?void 0:G.onDidChangeModelContent(B=>{$.current||S(L.current.getValue(),B)}))},[x,S]),D.useEffect(()=>{if(x){let W=A.current.editor.onDidChangeMarkers(G=>{var ee;let B=(ee=L.current.getModel())==null?void 0:ee.uri;if(B&&G.find(re=>re.path===B.path)){let re=A.current.editor.getModelMarkers({resource:B});C==null||C(re)}});return()=>{W==null||W.dispose()}}return()=>{}},[x,C]);function I(){var W,G;(W=Z.current)==null||W.dispose(),f?d&&Ld.set(c,L.current.saveViewState()):(G=L.current.getModel())==null||G.dispose(),L.current.dispose()}return Qn.createElement(J3,{width:p,height:v,isEditorReady:x,loading:u,_ref:N,className:m,wrapperProps:b})}var b$=g$,y$=D.memo(b$),_$=y$;const w$=D.memo(({id:t,value:e,fontSize:n=14,fontFamily:r="monospace",onChange:s,onEnter:c})=>{const i=D.useRef(c),o=D.useRef(null),u=D.useRef(null),[l,a]=D.useState("140px"),[d,f]=D.useState(!1),p=D.useRef(0),v=D.useRef(0);D.useEffect(()=>{i.current=c},[c]),D.useEffect(()=>{const y=S=>{if(!d)return;const C=S.clientY-p.current,x=Math.max(100,v.current+C);a(`${x}px`),o.current&&o.current.layout()},_=()=>{f(!1),document.body.style.cursor="default"};return d&&(document.addEventListener("mousemove",y),document.addEventListener("mouseup",_)),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",_)}},[d]);const m=(y,_)=>{o.current=y,_!=null&&_.editor&&(_.editor.setTheme("vs-dark"),y&&(y.onKeyDown(S=>{S.ctrlKey&&S.keyCode===3&&i.current()}),e===""&&y.focus()))},b=y=>{var _;f(!0),p.current=y.clientY,v.current=((_=u.current)==null?void 0:_.clientHeight)||140,document.body.style.cursor="ns-resize",y.preventDefault()};return J.jsxs("div",{className:"pb-1 w-full",ref:u,children:[J.jsx("div",{className:"rounded-md overflow-hidden",children:J.jsx(_$,{height:l,width:"100%",defaultLanguage:"shellscript",value:e,options:{scrollbar:{alwaysConsumeMouseWheel:!1},minimap:{enabled:!1},theme:"vs-dark",wordWrap:"wordWrapColumn",fontSize:n,fontFamily:r,lineHeight:20},onChange:y=>y&&(s==null?void 0:s(y)),onMount:m,className:"rounded-lg",wrapperProps:{className:"rounded-lg"}},t)}),J.jsx("div",{className:"h-2 w-full cursor-ns-resize",onMouseDown:b})]})},(t,e)=>t.value===e.value),S$=()=>J.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:J.jsx("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4338 7.5L4 3.57925Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",stroke:"currentColor",strokeWidth:"0.5"})}),x$=()=>J.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:J.jsx("path",{d:"M7.5 1.5C4.5 1.5 2 4 2 7C2 8.9 3 10.5 4.5 11.5L4 12.5C2 11.5 1 9.2 1 7C1 3.5 4 0.5 7.5 0.5C11 0.5 14 3.5 14 7C14 9.2 13 11.5 11 12.5L10.5 11.5C12 10.5 13 8.9 13 7C13 4 10.5 1.5 7.5 1.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),C$=()=>J.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:J.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"#22c55e",fillRule:"evenodd",clipRule:"evenodd",stroke:"#22c55e",strokeWidth:"1"})}),E$=({exitCode:t})=>J.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[J.jsx("circle",{cx:"12",cy:"12",r:"20",fill:"#ef4444",fillOpacity:"0.3"}),J.jsx("text",{x:"50%",y:"50%",dominantBaseline:"middle",textAnchor:"middle",fill:"#ef4444",fontSize:"10",fontWeight:"bold",children:t})]});function j$(){return J.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:J.jsx("path",{d:"M7.5 0.75C7.91421 0.75 8.25 1.08579 8.25 1.5V7.25H14C14.4142 7.25 14.75 7.58579 14.75 8C14.75 8.41421 14.4142 8.75 14 8.75H8.25V14.5C8.25 14.9142 7.91421 15.25 7.5 15.25C7.08579 15.25 6.75 14.9142 6.75 14.5V8.75H1C0.585786 8.75 0.25 8.41421 0.25 8C0.25 7.58579 0.585786 7.25 1 7.25H6.75V1.5C6.75 1.08579 7.08579 0.75 7.5 0.75Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",strokeWidth:"0.5"})})}function k$(){return J.jsx("svg",{width:"28",height:"28",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:J.jsx("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.3",fillRule:"evenodd",clipRule:"evenodd"})})}const u2=14,d2="monospace";function T$({pid:t,exitCode:e,onClick:n}){return J.jsxs(Di,{variant:"soft",onClick:n,children:[e===null&&t===null&&J.jsx(S$,{}),e===null&&t!==null&&J.jsx("div",{className:"animate-spin",children:J.jsx(x$,{})}),e!==null&&e===0&&J.jsx(C$,{}),e!==null&&e>0&&J.jsx(E$,{exitCode:e})]})}const O$=D.memo(({blockID:t,runID:e,sequence:n,value:r,settings:s={},onStdout:c,onStderr:i,onExitCode:o,onPid:u,onMimeType:l})=>{const{webApp:a}=es().settings;return r!=""&&e!=""&&J.jsx(nL,{blockID:t,runID:e,sequence:n,commands:r.split(`
6658
- `),runner:{endpoint:a.runner,reconnect:a.reconnect,authorization:{bearerToken:ef()}},settings:s,onPid:u,onStdout:c,onStderr:i,onExitCode:o,onMimeType:l})},(t,e)=>t.blockID===e.blockID&&JSON.stringify(t.value)===JSON.stringify(e.value)&&t.runID===e.runID);function A$({block:t}){const{settings:e}=es(),n=e.webApp.invertedOrder,{createOutputBlock:r,sendOutputBlock:s,incrementSequence:c,sequence:i}=Xi(),[o,u]=D.useState(t.contents),[l,a]=D.useState(!1),[d,f]=D.useState({value:"",runID:""}),[p,v]=D.useState(null),[m,b]=D.useState(null),[y,_]=D.useState(null),[S,C]=D.useState(""),[x,j]=D.useState(""),[k,T]=D.useState(""),[A,L]=D.useState(null),N=D.useCallback((Z=!1)=>{C(""),j(""),v(null),b(null),a(Z),c(),f({value:o,runID:Uj()})},[o,c]);D.useEffect(()=>{const Z=Y=>{Y.detail.blockId===t.id&&N()};return window.addEventListener("runCodeBlock",Z),()=>{window.removeEventListener("runCodeBlock",Z)}},[t.id,N]);const M=D.useMemo(()=>p===null||m===null||d.runID===""||!Number.isFinite(p)||!Number.isInteger(m)?null:r({...t,outputs:[{$typeName:"BlockOutput",kind:LS.STDOUT,items:[{$typeName:"BlockOutputItem",mime:y||"text/plain",textData:S}]},{$typeName:"BlockOutput",kind:LS.STDERR,items:[{$typeName:"BlockOutputItem",mime:y||"text/plain",textData:x}]}]}),[t,r,S,x,y,p,m,d.runID]);D.useEffect(()=>{!M||k===d.runID||(T(d.runID),s(M))},[s,M,d.runID,k]),D.useEffect(()=>{k!==d.runID&&L(i)},[i,d.runID,k]),D.useEffect(()=>{u(t.contents)},[t.contents]);const F=D.useMemo(()=>A?A.toString():" ",[A]);return J.jsx("div",{children:J.jsx(bs,{className:"w-full p-2",children:J.jsxs("div",{className:"flex justify-between items-top",children:[J.jsxs("div",{className:"flex flex-col items-center",children:[J.jsx(T$,{pid:p,exitCode:m,onClick:()=>{N(!0)}}),J.jsxs(tn,{size:"2",className:"mt-1 p-2 font-bold text-gray-400 font-mono",children:["[",F,"]"]})]}),J.jsxs(vE,{className:"whitespace-nowrap overflow-hidden flex-1 ml-2",children:[J.jsx(w$,{id:t.id,value:o,fontSize:u2,fontFamily:d2,onChange:Z=>{v(null),b(null),u(Z)},onEnter:()=>N()},t.id),J.jsx(O$,{runID:d.runID,blockID:t.id,sequence:A||0,value:d.value,settings:{takeFocus:l,scrollToFit:!n,className:"rounded-md overflow-hidden",rows:14,fontSize:u2,fontFamily:d2},onStdout:Z=>C(Y=>Y+new TextDecoder().decode(Z)),onStderr:Z=>j(Y=>Y+new TextDecoder().decode(Z)),onPid:v,onExitCode:b,onMimeType:_},d.runID)]})]})})})}function h2(){const{useColumns:t,addCodeBlock:e}=Xi(),{settings:n}=es(),{actions:r}=t(),s=D.useRef(null);return D.useEffect(()=>{var c;n.webApp.invertedOrder||(c=s.current)==null||c.scrollIntoView({behavior:"smooth"})},[r,n.webApp.invertedOrder]),J.jsxs("div",{className:"flex flex-col h-full",children:[J.jsxs("div",{className:"flex items-center mb-2",children:[J.jsx(tn,{size:"5",weight:"bold",className:"pr-2",children:"Actions"}),J.jsx(Di,{variant:"ghost",size:"1",className:"cursor-pointer",onClick:e,children:J.jsx(j$,{})})]}),J.jsxs(Dh,{type:"auto",scrollbars:"vertical",className:"flex-1 p-2",children:[r.map(c=>J.jsx(A$,{block:c},c.id)),J.jsx("div",{ref:s})]})]})}function I$(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const R$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,L$={};function f2(t,e){return(L$.jsx?N$:R$).test(t)}const D$=/[ \t\n\f\r]/g;function M$(t){return typeof t=="object"?t.type==="text"?p2(t.value):!1:p2(t)}function p2(t){return t.replace(D$,"")===""}class du{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}du.prototype.normal={};du.prototype.property={};du.prototype.space=void 0;function tk(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new du(n,r,e)}function Uv(t){return t.toLowerCase()}class ar{constructor(e,n){this.attribute=n,this.property=e}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let P$=0;const dt=Po(),dn=Po(),nk=Po(),Ue=Po(),$t=Po(),Na=Po(),gr=Po();function Po(){return 2**++P$}const Fv=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:dn,commaOrSpaceSeparated:gr,commaSeparated:Na,number:Ue,overloadedBoolean:nk,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Km=Object.keys(Fv);class k0 extends ar{constructor(e,n,r,s){let c=-1;if(super(e,n),m2(this,"space",s),typeof r=="number")for(;++c<Km.length;){const i=Km[c];m2(this,Km[c],(r&Fv[i])===Fv[i])}}}k0.prototype.defined=!0;function m2(t,e,n){n&&(t[e]=n)}function el(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const c=new k0(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),e[r]=c,n[Uv(r)]=r,n[Uv(c.attribute)]=r}return new du(e,n,t.space)}const rk=el({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:$t,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Ue,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:$t,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:dn,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function sk(t,e){return e in t?t[e]:e}function ik(t,e){return sk(t,e.toLowerCase())}const $$=el({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Na,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:$t,autoFocus:dt,autoPlay:dt,blocking:$t,capture:null,charSet:null,checked:dt,cite:null,className:$t,cols:Ue,colSpan:null,content:null,contentEditable:dn,controls:dt,controlsList:$t,coords:Ue|Na,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:nk,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:$t,height:Ue,hidden:dt,high:Ue,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:$t,itemRef:$t,itemScope:dt,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:Ue,pattern:null,ping:$t,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:$t,required:dt,reversed:dt,rows:Ue,rowSpan:Ue,sandbox:$t,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:dn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:ik}),B$=el({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:gr,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Na,g2:Na,glyphName:Na,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:gr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gr,rev:gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gr,requiredFeatures:gr,requiredFonts:gr,requiredFormats:gr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:gr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gr,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sk}),ok=el({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),ak=el({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ik}),lk=el({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),U$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},F$=/[A-Z]/g,v2=/-[a-z]/g,V$=/^data[-\w.:]+$/i;function z$(t,e){const n=Uv(e);let r=e,s=ar;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&V$.test(e)){if(e.charAt(4)==="-"){const c=e.slice(5).replace(v2,W$);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=e.slice(4);if(!v2.test(c)){let i=c.replace(F$,H$);i.charAt(0)!=="-"&&(i="-"+i),e="data"+i}}s=k0}return new s(r,e)}function H$(t){return"-"+t.toLowerCase()}function W$(t){return t.charAt(1).toUpperCase()}const G$=tk([rk,$$,ok,ak,lk],"html"),T0=tk([rk,B$,ok,ak,lk],"svg");function Z$(t){return t.join(" ").trim()}var ja={},Xm,g2;function Y$(){if(g2)return Xm;g2=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
6658
+ `),runner:{endpoint:a.runner,reconnect:a.reconnect,authorization:{bearerToken:ef()}},settings:s,onPid:u,onStdout:c,onStderr:i,onExitCode:o,onMimeType:l})},(t,e)=>t.blockID===e.blockID&&JSON.stringify(t.value)===JSON.stringify(e.value)&&t.runID===e.runID);function A$({block:t}){const{settings:e}=es(),n=e.webApp.invertedOrder,{createOutputBlock:r,sendOutputBlock:s,incrementSequence:c,sequence:i}=Xi(),[o,u]=D.useState(t.contents),[l,a]=D.useState(!1),[d,f]=D.useState({value:"",runID:""}),[p,v]=D.useState(null),[m,b]=D.useState(null),[y,_]=D.useState(null),[S,C]=D.useState(""),[x,j]=D.useState(""),[k,T]=D.useState(""),[A,L]=D.useState(null),N=D.useCallback((Z=!1)=>{C(""),j(""),v(null),b(null),a(Z),c(),f({value:o,runID:Uj()})},[o,c]);D.useEffect(()=>{const Z=Y=>{Y.detail.blockId===t.id&&N()};return window.addEventListener("runCodeBlock",Z),()=>{window.removeEventListener("runCodeBlock",Z)}},[t.id,N]);const M=D.useMemo(()=>p===null||m===null||d.runID===""||!Number.isFinite(p)||!Number.isInteger(m)?null:r({...t,outputs:[{$typeName:"agent.v1.BlockOutput",kind:LS.STDOUT,items:[{$typeName:"agent.v1.BlockOutputItem",mime:y||"text/plain",textData:S}]},{$typeName:"agent.v1.BlockOutput",kind:LS.STDERR,items:[{$typeName:"agent.v1.BlockOutputItem",mime:y||"text/plain",textData:x}]}]}),[t,r,S,x,y,p,m,d.runID]);D.useEffect(()=>{!M||k===d.runID||(T(d.runID),s(M))},[s,M,d.runID,k]),D.useEffect(()=>{k!==d.runID&&L(i)},[i,d.runID,k]),D.useEffect(()=>{u(t.contents)},[t.contents]);const F=D.useMemo(()=>A?A.toString():" ",[A]);return J.jsx("div",{children:J.jsx(bs,{className:"w-full p-2",children:J.jsxs("div",{className:"flex justify-between items-top",children:[J.jsxs("div",{className:"flex flex-col items-center",children:[J.jsx(T$,{pid:p,exitCode:m,onClick:()=>{N(!0)}}),J.jsxs(tn,{size:"2",className:"mt-1 p-2 font-bold text-gray-400 font-mono",children:["[",F,"]"]})]}),J.jsxs(vE,{className:"whitespace-nowrap overflow-hidden flex-1 ml-2",children:[J.jsx(w$,{id:t.id,value:o,fontSize:u2,fontFamily:d2,onChange:Z=>{v(null),b(null),u(Z)},onEnter:()=>N()},t.id),J.jsx(O$,{runID:d.runID,blockID:t.id,sequence:A||0,value:d.value,settings:{takeFocus:l,scrollToFit:!n,className:"rounded-md overflow-hidden",rows:14,fontSize:u2,fontFamily:d2},onStdout:Z=>C(Y=>Y+new TextDecoder().decode(Z)),onStderr:Z=>j(Y=>Y+new TextDecoder().decode(Z)),onPid:v,onExitCode:b,onMimeType:_},d.runID)]})]})})})}function h2(){const{useColumns:t,addCodeBlock:e}=Xi(),{settings:n}=es(),{actions:r}=t(),s=D.useRef(null),c=D.useRef(null);return D.useEffect(()=>{var i,o;if(n.webApp.invertedOrder){(i=s.current)==null||i.scrollIntoView({behavior:"smooth"});return}(o=c.current)==null||o.scrollIntoView({behavior:"smooth"})},[r,n.webApp.invertedOrder]),J.jsxs("div",{className:"flex flex-col h-full",children:[J.jsxs("div",{className:"flex items-center mb-2",children:[J.jsx(tn,{size:"5",weight:"bold",className:"pr-2",children:"Actions"}),J.jsx(Di,{variant:"ghost",size:"1",className:"cursor-pointer",onClick:e,children:J.jsx(j$,{})})]}),J.jsxs(Dh,{type:"auto",scrollbars:"vertical",className:"flex-1 p-2",children:[J.jsx("div",{ref:s}),r.map(i=>J.jsx(A$,{block:i},i.id)),J.jsx("div",{ref:c})]})]})}function I$(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const R$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,L$={};function f2(t,e){return(L$.jsx?N$:R$).test(t)}const D$=/[ \t\n\f\r]/g;function M$(t){return typeof t=="object"?t.type==="text"?p2(t.value):!1:p2(t)}function p2(t){return t.replace(D$,"")===""}class du{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}du.prototype.normal={};du.prototype.property={};du.prototype.space=void 0;function tk(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new du(n,r,e)}function Uv(t){return t.toLowerCase()}class ar{constructor(e,n){this.attribute=n,this.property=e}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let P$=0;const dt=Po(),dn=Po(),nk=Po(),Ue=Po(),$t=Po(),Na=Po(),gr=Po();function Po(){return 2**++P$}const Fv=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:dn,commaOrSpaceSeparated:gr,commaSeparated:Na,number:Ue,overloadedBoolean:nk,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Km=Object.keys(Fv);class k0 extends ar{constructor(e,n,r,s){let c=-1;if(super(e,n),m2(this,"space",s),typeof r=="number")for(;++c<Km.length;){const i=Km[c];m2(this,Km[c],(r&Fv[i])===Fv[i])}}}k0.prototype.defined=!0;function m2(t,e,n){n&&(t[e]=n)}function el(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const c=new k0(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),e[r]=c,n[Uv(r)]=r,n[Uv(c.attribute)]=r}return new du(e,n,t.space)}const rk=el({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:$t,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Ue,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:$t,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:dn,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function sk(t,e){return e in t?t[e]:e}function ik(t,e){return sk(t,e.toLowerCase())}const $$=el({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Na,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:$t,autoFocus:dt,autoPlay:dt,blocking:$t,capture:null,charSet:null,checked:dt,cite:null,className:$t,cols:Ue,colSpan:null,content:null,contentEditable:dn,controls:dt,controlsList:$t,coords:Ue|Na,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:nk,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:$t,height:Ue,hidden:dt,high:Ue,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:$t,itemRef:$t,itemScope:dt,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:Ue,pattern:null,ping:$t,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:$t,required:dt,reversed:dt,rows:Ue,rowSpan:Ue,sandbox:$t,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:dn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:ik}),B$=el({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:gr,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Na,g2:Na,glyphName:Na,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:gr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gr,rev:gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gr,requiredFeatures:gr,requiredFonts:gr,requiredFormats:gr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:gr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gr,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sk}),ok=el({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),ak=el({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ik}),lk=el({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),U$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},F$=/[A-Z]/g,v2=/-[a-z]/g,V$=/^data[-\w.:]+$/i;function z$(t,e){const n=Uv(e);let r=e,s=ar;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&V$.test(e)){if(e.charAt(4)==="-"){const c=e.slice(5).replace(v2,W$);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=e.slice(4);if(!v2.test(c)){let i=c.replace(F$,H$);i.charAt(0)!=="-"&&(i="-"+i),e="data"+i}}s=k0}return new s(r,e)}function H$(t){return"-"+t.toLowerCase()}function W$(t){return t.charAt(1).toUpperCase()}const G$=tk([rk,$$,ok,ak,lk],"html"),T0=tk([rk,B$,ok,ak,lk],"svg");function Z$(t){return t.join(" ").trim()}var ja={},Xm,g2;function Y$(){if(g2)return Xm;g2=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
6659
6659
  `,l="/",a="*",d="",f="comment",p="declaration";Xm=function(m,b){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];b=b||{};var y=1,_=1;function S(F){var Z=F.match(e);Z&&(y+=Z.length);var Y=F.lastIndexOf(u);_=~Y?F.length-Y:_+F.length}function C(){var F={line:y,column:_};return function(Z){return Z.position=new x(F),T(),Z}}function x(F){this.start=F,this.end={line:y,column:_},this.source=b.source}x.prototype.content=m;function j(F){var Z=new Error(b.source+":"+y+":"+_+": "+F);if(Z.reason=F,Z.filename=b.source,Z.line=y,Z.column=_,Z.source=m,!b.silent)throw Z}function k(F){var Z=F.exec(m);if(Z){var Y=Z[0];return S(Y),m=m.slice(Y.length),Z}}function T(){k(n)}function A(F){var Z;for(F=F||[];Z=L();)Z!==!1&&F.push(Z);return F}function L(){var F=C();if(!(l!=m.charAt(0)||a!=m.charAt(1))){for(var Z=2;d!=m.charAt(Z)&&(a!=m.charAt(Z)||l!=m.charAt(Z+1));)++Z;if(Z+=2,d===m.charAt(Z-1))return j("End of comment missing");var Y=m.slice(2,Z-2);return _+=2,S(Y),m=m.slice(Z),_+=2,F({type:f,comment:Y})}}function N(){var F=C(),Z=k(r);if(Z){if(L(),!k(s))return j("property missing ':'");var Y=k(c),X=F({type:p,property:v(Z[0].replace(t,d)),value:Y?v(Y[0].replace(t,d)):d});return k(i),X}}function M(){var F=[];A(F);for(var Z;Z=N();)Z!==!1&&(F.push(Z),A(F));return F}return T(),M()};function v(m){return m?m.replace(o,d):d}return Xm}var b2;function K$(){if(b2)return ja;b2=1;var t=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0}),ja.default=n;var e=t(Y$());function n(r,s){var c=null;if(!r||typeof r!="string")return c;var i=(0,e.default)(r),o=typeof s=="function";return i.forEach(function(u){if(u.type==="declaration"){var l=u.property,a=u.value;o?s(l,a,u):a&&(c=c||{},c[l]=a)}}),c}return ja}var ac={},y2;function X$(){if(y2)return ac;y2=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(l){return!l||n.test(l)||t.test(l)},i=function(l,a){return a.toUpperCase()},o=function(l,a){return"".concat(a,"-")},u=function(l,a){return a===void 0&&(a={}),c(l)?l:(l=l.toLowerCase(),a.reactCompat?l=l.replace(s,o):l=l.replace(r,o),l.replace(e,i))};return ac.camelCase=u,ac}var lc,_2;function q$(){if(_2)return lc;_2=1;var t=lc&&lc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(K$()),n=X$();function r(s,c){var i={};return!s||typeof s!="string"||(0,e.default)(s,function(o,u){o&&u&&(i[(0,n.camelCase)(o,c)]=u)}),i}return r.default=r,lc=r,lc}var J$=q$();const Q$=Kc(J$),ck=uk("end"),O0=uk("start");function uk(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function eB(t){const e=O0(t),n=ck(t);if(e&&n)return{start:e,end:n}}function Ec(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?w2(t.position):"start"in t||"end"in t?w2(t):"line"in t||"column"in t?Vv(t):""}function Vv(t){return S2(t&&t.line)+":"+S2(t&&t.column)}function w2(t){return Vv(t&&t.start)+"-"+Vv(t&&t.end)}function S2(t){return t&&typeof t=="number"?t:1}class Bn extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",c={},i=!1;if(n&&("line"in n&&"column"in n?c={place:n}:"start"in n&&"end"in n?c={place:n}:"type"in n?c={ancestors:[n],place:n.position}:c={...n}),typeof e=="string"?s=e:!c.cause&&e&&(i=!0,s=e.message,c.cause=e),!c.ruleId&&!c.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?c.ruleId=r:(c.source=r.slice(0,u),c.ruleId=r.slice(u+1))}if(!c.place&&c.ancestors&&c.ancestors){const u=c.ancestors[c.ancestors.length-1];u&&(c.place=u.position)}const o=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=o?o.line:void 0,this.name=Ec(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=i&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual,this.expected,this.note,this.url}}Bn.prototype.file="";Bn.prototype.name="";Bn.prototype.reason="";Bn.prototype.message="";Bn.prototype.stack="";Bn.prototype.column=void 0;Bn.prototype.line=void 0;Bn.prototype.ancestors=void 0;Bn.prototype.cause=void 0;Bn.prototype.fatal=void 0;Bn.prototype.place=void 0;Bn.prototype.ruleId=void 0;Bn.prototype.source=void 0;const A0={}.hasOwnProperty,tB=new Map,nB=/[A-Z]/g,rB=new Set(["table","tbody","thead","tfoot","tr"]),sB=new Set(["td","th"]),dk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function iB(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=fB(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=hB(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?T0:G$,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},c=hk(s,t,void 0);return c&&typeof c!="string"?c:s.create(t,s.Fragment,{children:c||void 0},void 0)}function hk(t,e,n){if(e.type==="element")return oB(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return aB(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return cB(t,e,n);if(e.type==="mdxjsEsm")return lB(t,e);if(e.type==="root")return uB(t,e,n);if(e.type==="text")return dB(t,e)}function oB(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=T0,t.schema=s),t.ancestors.push(e);const c=pk(t,e.tagName,!1),i=pB(t,e);let o=R0(t,e);return rB.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!M$(u):!0})),fk(t,i,c,e),I0(i,o),t.ancestors.pop(),t.schema=r,t.create(e,c,i,n)}function aB(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Gc(t,e.position)}function lB(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Gc(t,e.position)}function cB(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=T0,t.schema=s),t.ancestors.push(e);const c=e.name===null?t.Fragment:pk(t,e.name,!0),i=mB(t,e),o=R0(t,e);return fk(t,i,c,e),I0(i,o),t.ancestors.pop(),t.schema=r,t.create(e,c,i,n)}function uB(t,e,n){const r={};return I0(r,R0(t,e)),t.create(e,t.Fragment,r,n)}function dB(t,e){return e.value}function fk(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function I0(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function hB(t,e,n){return r;function r(s,c,i,o){const l=Array.isArray(i.children)?n:e;return o?l(c,i,o):l(c,i)}}function fB(t,e){return n;function n(r,s,c,i){const o=Array.isArray(c.children),u=O0(r);return e(s,c,i,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function pB(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&A0.call(e.properties,s)){const c=vB(t,s,e.properties[s]);if(c){const[i,o]=c;t.tableCellAlignToStyle&&i==="align"&&typeof o=="string"&&sB.has(e.tagName)?r=o:n[i]=o}}if(r){const c=n.style||(n.style={});c[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mB(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const c=r.data.estree.body[0];c.type;const i=c.expression;i.type;const o=i.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else Gc(t,e.position);else{const s=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,c=t.evaluater.evaluateExpression(o.expression)}else Gc(t,e.position);else c=r.value===null?!0:r.value;n[s]=c}return n}function R0(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:tB;for(;++r<e.children.length;){const c=e.children[r];let i;if(t.passKeys){const u=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(u){const l=s.get(u)||0;i=u+"-"+l,s.set(u,l+1)}}const o=hk(t,c,i);o!==void 0&&n.push(o)}return n}function vB(t,e,n){const r=z$(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?I$(n):Z$(n)),r.property==="style"){let s=typeof n=="object"?n:gB(t,String(n));return t.stylePropertyNameCase==="css"&&(s=bB(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?U$[r.property]||r.property:r.attribute,n]}}function gB(t,e){try{return Q$(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new Bn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=dk+"#cannot-parse-style-attribute",s}}function pk(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let c=-1,i;for(;++c<s.length;){const o=f2(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};i=i?{type:"MemberExpression",object:i,property:o,computed:!!(c&&o.type==="Literal"),optional:!1}:o}r=i}else r=f2(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return A0.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);Gc(t)}function Gc(t,e){const n=new Bn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=dk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function bB(t){const e={};let n;for(n in t)A0.call(t,n)&&(e[yB(n)]=t[n]);return e}function yB(t){let e=t.replace(nB,_B);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function _B(t){return"-"+t.toLowerCase()}const qm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},wB={};function SB(t,e){const n=wB,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return mk(t,r,s)}function mk(t,e,n){if(xB(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return x2(t.children,e,n)}return Array.isArray(t)?x2(t,e,n):""}function x2(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=mk(t[s],e,n);return r.join("")}function xB(t){return!!(t&&typeof t=="object")}const C2=document.createElement("i");function N0(t){const e="&"+t+";";C2.innerHTML=e;const n=C2.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ss(t,e,n,r){const s=t.length;let c=0,i;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(e,n),t.splice(...i);else for(n&&t.splice(e,n);c<r.length;)i=r.slice(c,c+1e4),i.unshift(e,0),t.splice(...i),c+=1e4,e+=1e4}function Mr(t,e){return t.length>0?(Ss(t,t.length,0,e),t):e}const E2={}.hasOwnProperty;function CB(t){const e={};let n=-1;for(;++n<t.length;)EB(e,t[n]);return e}function EB(t,e){let n;for(n in e){const s=(E2.call(t,n)?t[n]:void 0)||(t[n]={}),c=e[n];let i;if(c)for(i in c){E2.call(s,i)||(s[i]=[]);const o=c[i];jB(s[i],Array.isArray(o)?o:o?[o]:[])}}}function jB(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Ss(t,0,0,r)}function vk(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function La(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ys=qi(/[A-Za-z]/),Sr=qi(/[\dA-Za-z]/),kB=qi(/[#-'*+\--9=?A-Z^-~]/);function zv(t){return t!==null&&(t<32||t===127)}const Hv=qi(/\d/),TB=qi(/[\dA-Fa-f]/),OB=qi(/[!-/:-@[-`{-~]/);function at(t){return t!==null&&t<-2}function rr(t){return t!==null&&(t<0||t===32)}function Ot(t){return t===-2||t===-1||t===32}const AB=qi(new RegExp("\\p{P}|\\p{S}","u")),IB=qi(/\s/);function qi(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function tl(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const c=t.charCodeAt(n);let i="";if(c===37&&Sr(t.charCodeAt(n+1))&&Sr(t.charCodeAt(n+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(i=String.fromCharCode(c));else if(c>55295&&c<57344){const o=t.charCodeAt(n+1);c<56320&&o>56319&&o<57344?(i=String.fromCharCode(c,o),s=1):i="�"}else i=String.fromCharCode(c);i&&(e.push(t.slice(r,n),encodeURIComponent(i)),r=n+s+1,i=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function Ut(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let c=0;return i;function i(u){return Ot(u)?(t.enter(n),o(u)):e(u)}function o(u){return Ot(u)&&c++<s?(t.consume(u),o):(t.exit(n),e(u))}}const RB={tokenize:NB};function NB(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ut(t,e,"linePrefix")}function s(o){return t.enter("paragraph"),c(o)}function c(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,i(o)}function i(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return at(o)?(t.consume(o),t.exit("chunkText"),c):(t.consume(o),i)}}const LB={tokenize:DB},j2={tokenize:MB};function DB(t){const e=this,n=[];let r=0,s,c,i;return o;function o(S){if(r<n.length){const C=n[r];return e.containerState=C[1],t.attempt(C[0].continuation,u,l)(S)}return l(S)}function u(S){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&_();const C=e.events.length;let x=C,j;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){j=e.events[x][1].end;break}y(r);let k=C;for(;k<e.events.length;)e.events[k][1].end={...j},k++;return Ss(e.events,x+1,0,e.events.slice(C)),e.events.length=k,l(S)}return o(S)}function l(S){if(r===n.length){if(!s)return f(S);if(s.currentConstruct&&s.currentConstruct.concrete)return v(S);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(j2,a,d)(S)}function a(S){return s&&_(),y(r),f(S)}function d(S){return e.parser.lazy[e.now().line]=r!==n.length,i=e.now().offset,v(S)}function f(S){return e.containerState={},t.attempt(j2,p,v)(S)}function p(S){return r++,n.push([e.currentConstruct,e.containerState]),f(S)}function v(S){if(S===null){s&&_(),y(0),t.consume(S);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),m(S)}function m(S){if(S===null){b(t.exit("chunkFlow"),!0),y(0),t.consume(S);return}return at(S)?(t.consume(S),b(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(S),m)}function b(S,C){const x=e.sliceStream(S);if(C&&x.push(null),S.previous=c,c&&(c.next=S),c=S,s.defineSkip(S.start),s.write(x),e.parser.lazy[S.start.line]){let j=s.events.length;for(;j--;)if(s.events[j][1].start.offset<i&&(!s.events[j][1].end||s.events[j][1].end.offset>i))return;const k=e.events.length;let T=k,A,L;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(A){L=e.events[T][1].end;break}A=!0}for(y(r),j=k;j<e.events.length;)e.events[j][1].end={...L},j++;Ss(e.events,T+1,0,e.events.slice(k)),e.events.length=j}}function y(S){let C=n.length;for(;C-- >S;){const x=n[C];e.containerState=x[1],x[0].exit.call(e,t)}n.length=S}function _(){s.write([null]),c=void 0,s=void 0,e.containerState._closeFlow=void 0}}function MB(t,e,n){return Ut(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function k2(t){if(t===null||rr(t)||IB(t))return 1;if(AB(t))return 2}function L0(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const c=t[s].resolveAll;c&&!r.includes(c)&&(e=c(e,n),r.push(c))}return e}const Wv={name:"attention",resolveAll:PB,tokenize:$B};function PB(t,e){let n=-1,r,s,c,i,o,u,l,a;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d={...t[r][1].end},f={...t[n][1].start};T2(d,-u),T2(f,u),i={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...t[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:f},c={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:u>1?"strong":"emphasis",start:{...i.start},end:{...o.end}},t[r][1].end={...i.start},t[n][1].start={...o.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=Mr(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=Mr(l,[["enter",s,e],["enter",i,e],["exit",i,e],["enter",c,e]]),l=Mr(l,L0(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=Mr(l,[["exit",c,e],["enter",o,e],["exit",o,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(a=2,l=Mr(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):a=0,Ss(t,r-1,n-r+3,l),n=r+l.length-a-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function $B(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=k2(r);let c;return i;function i(u){return c=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===c)return t.consume(u),o;const l=t.exit("attentionSequence"),a=k2(u),d=!a||a===2&&s||n.includes(u),f=!s||s===2&&a||n.includes(r);return l._open=!!(c===42?d:d&&(s||!f)),l._close=!!(c===42?f:f&&(a||!d)),e(u)}}function T2(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const BB={name:"autolink",tokenize:UB};function UB(t,e,n){let r=0;return s;function s(p){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),c}function c(p){return ys(p)?(t.consume(p),i):p===64?n(p):l(p)}function i(p){return p===43||p===45||p===46||Sr(p)?(r=1,o(p)):l(p)}function o(p){return p===58?(t.consume(p),r=0,u):(p===43||p===45||p===46||Sr(p))&&r++<32?(t.consume(p),o):(r=0,l(p))}function u(p){return p===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):p===null||p===32||p===60||zv(p)?n(p):(t.consume(p),u)}function l(p){return p===64?(t.consume(p),a):kB(p)?(t.consume(p),l):n(p)}function a(p){return Sr(p)?d(p):n(p)}function d(p){return p===46?(t.consume(p),r=0,a):p===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):f(p)}function f(p){if((p===45||Sr(p))&&r++<63){const v=p===45?f:d;return t.consume(p),v}return n(p)}}const nf={partial:!0,tokenize:FB};function FB(t,e,n){return r;function r(c){return Ot(c)?Ut(t,s,"linePrefix")(c):s(c)}function s(c){return c===null||at(c)?e(c):n(c)}}const gk={continuation:{tokenize:zB},exit:HB,name:"blockQuote",tokenize:VB};function VB(t,e,n){const r=this;return s;function s(i){if(i===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(i),t.exit("blockQuoteMarker"),c}return n(i)}function c(i){return Ot(i)?(t.enter("blockQuotePrefixWhitespace"),t.consume(i),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(i))}}function zB(t,e,n){const r=this;return s;function s(i){return Ot(i)?Ut(t,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):c(i)}function c(i){return t.attempt(gk,e,n)(i)}}function HB(t){t.exit("blockQuote")}const bk={name:"characterEscape",tokenize:WB};function WB(t,e,n){return r;function r(c){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(c),t.exit("escapeMarker"),s}function s(c){return OB(c)?(t.enter("characterEscapeValue"),t.consume(c),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(c)}}const yk={name:"characterReference",tokenize:GB};function GB(t,e,n){const r=this;let s=0,c,i;return o;function o(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),u}function u(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),c=31,i=Sr,a(d))}function l(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),c=6,i=TB,a):(t.enter("characterReferenceValue"),c=7,i=Hv,a(d))}function a(d){if(d===59&&s){const f=t.exit("characterReferenceValue");return i===Sr&&!N0(r.sliceSerialize(f))?n(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return i(d)&&s++<c?(t.consume(d),a):n(d)}}const O2={partial:!0,tokenize:YB},A2={concrete:!0,name:"codeFenced",tokenize:ZB};function ZB(t,e,n){const r=this,s={partial:!0,tokenize:x};let c=0,i=0,o;return u;function u(j){return l(j)}function l(j){const k=r.events[r.events.length-1];return c=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,o=j,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),a(j)}function a(j){return j===o?(i++,t.consume(j),a):i<3?n(j):(t.exit("codeFencedFenceSequence"),Ot(j)?Ut(t,d,"whitespace")(j):d(j))}function d(j){return j===null||at(j)?(t.exit("codeFencedFence"),r.interrupt?e(j):t.check(O2,m,C)(j)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),f(j))}function f(j){return j===null||at(j)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(j)):Ot(j)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ut(t,p,"whitespace")(j)):j===96&&j===o?n(j):(t.consume(j),f)}function p(j){return j===null||at(j)?d(j):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===null||at(j)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(j)):j===96&&j===o?n(j):(t.consume(j),v)}function m(j){return t.attempt(s,C,b)(j)}function b(j){return t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),y}function y(j){return c>0&&Ot(j)?Ut(t,_,"linePrefix",c+1)(j):_(j)}function _(j){return j===null||at(j)?t.check(O2,m,C)(j):(t.enter("codeFlowValue"),S(j))}function S(j){return j===null||at(j)?(t.exit("codeFlowValue"),_(j)):(t.consume(j),S)}function C(j){return t.exit("codeFenced"),e(j)}function x(j,k,T){let A=0;return L;function L(Y){return j.enter("lineEnding"),j.consume(Y),j.exit("lineEnding"),N}function N(Y){return j.enter("codeFencedFence"),Ot(Y)?Ut(j,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):M(Y)}function M(Y){return Y===o?(j.enter("codeFencedFenceSequence"),F(Y)):T(Y)}function F(Y){return Y===o?(A++,j.consume(Y),F):A>=i?(j.exit("codeFencedFenceSequence"),Ot(Y)?Ut(j,Z,"whitespace")(Y):Z(Y)):T(Y)}function Z(Y){return Y===null||at(Y)?(j.exit("codeFencedFence"),k(Y)):T(Y)}}}function YB(t,e,n){const r=this;return s;function s(i){return i===null?n(i):(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),c)}function c(i){return r.parser.lazy[r.now().line]?n(i):e(i)}}const Jm={name:"codeIndented",tokenize:XB},KB={partial:!0,tokenize:qB};function XB(t,e,n){const r=this;return s;function s(l){return t.enter("codeIndented"),Ut(t,c,"linePrefix",5)(l)}function c(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?i(l):n(l)}function i(l){return l===null?u(l):at(l)?t.attempt(KB,i,u)(l):(t.enter("codeFlowValue"),o(l))}function o(l){return l===null||at(l)?(t.exit("codeFlowValue"),i(l)):(t.consume(l),o)}function u(l){return t.exit("codeIndented"),e(l)}}function qB(t,e,n){const r=this;return s;function s(i){return r.parser.lazy[r.now().line]?n(i):at(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),s):Ut(t,c,"linePrefix",5)(i)}function c(i){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(i):at(i)?s(i):n(i)}}const JB={name:"codeText",previous:eU,resolve:QB,tokenize:tU};function QB(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function eU(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tU(t,e,n){let r=0,s,c;return i;function i(d){return t.enter("codeText"),t.enter("codeTextSequence"),o(d)}function o(d){return d===96?(t.consume(d),r++,o):(t.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),u):d===96?(c=t.enter("codeTextSequence"),s=0,a(d)):at(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),u):(t.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||at(d)?(t.exit("codeTextData"),u(d)):(t.consume(d),l)}function a(d){return d===96?(t.consume(d),s++,a):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(c.type="codeTextData",l(d))}}class nU{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&cc(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),cc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),cc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);cc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);cc(this.left,n.reverse())}}}function cc(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function _k(t){const e={};let n=-1,r,s,c,i,o,u,l;const a=new nU(t);for(;++n<a.length;){for(;n in e;)n=e[n];if(r=a.get(n),n&&r[1].type==="chunkFlow"&&a.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,c=0,c<u.length&&u[c][1].type==="lineEndingBlank"&&(c+=2),c<u.length&&u[c][1].type==="content"))for(;++c<u.length&&u[c][1].type!=="content";)u[c][1].type==="chunkText"&&(u[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,rU(a,n)),n=e[n],l=!0);else if(r[1]._container){for(c=n,s=void 0;c--;)if(i=a.get(c),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(s&&(a.get(s)[1].type="lineEndingBlank"),i[1].type="lineEnding",s=c);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;s&&(r[1].end={...a.get(s)[1].start},o=a.slice(s,n),o.unshift(r),a.splice(s,n-s+1,o))}}return Ss(t,0,Number.POSITIVE_INFINITY,a.slice(0)),!l}function rU(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const c=[];let i=n._tokenizer;i||(i=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const o=i.events,u=[],l={};let a,d,f=-1,p=n,v=0,m=0;const b=[m];for(;p;){for(;t.get(++s)[1]!==p;);c.push(s),p._tokenizer||(a=r.sliceStream(p),p.next||a.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(a),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(m=f+1,b.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),f=b.length;f--;){const y=o.slice(b[f],b[f+1]),_=c.pop();u.push([_,_+y.length-1]),t.splice(_,2,y)}for(u.reverse(),f=-1;++f<u.length;)l[v+u[f][0]]=v+u[f][1],v+=u[f][1]-u[f][0]-1;return l}const sU={resolve:oU,tokenize:aU},iU={partial:!0,tokenize:lU};function oU(t){return _k(t),t}function aU(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(o)}function s(o){return o===null?c(o):at(o)?t.check(iU,i,c)(o):(t.consume(o),s)}function c(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function i(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function lU(t,e,n){const r=this;return s;function s(i){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Ut(t,c,"linePrefix")}function c(i){if(i===null||at(i))return n(i);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(i):t.interrupt(r.parser.constructs.flow,n,e)(i)}}function wk(t,e,n,r,s,c,i,o,u){const l=u||Number.POSITIVE_INFINITY;let a=0;return d;function d(y){return y===60?(t.enter(r),t.enter(s),t.enter(c),t.consume(y),t.exit(c),f):y===null||y===32||y===41||zv(y)?n(y):(t.enter(r),t.enter(i),t.enter(o),t.enter("chunkString",{contentType:"string"}),m(y))}function f(y){return y===62?(t.enter(c),t.consume(y),t.exit(c),t.exit(s),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(t.exit("chunkString"),t.exit(o),f(y)):y===null||y===60||at(y)?n(y):(t.consume(y),y===92?v:p)}function v(y){return y===60||y===62||y===92?(t.consume(y),p):p(y)}function m(y){return!a&&(y===null||y===41||rr(y))?(t.exit("chunkString"),t.exit(o),t.exit(i),t.exit(r),e(y)):a<l&&y===40?(t.consume(y),a++,m):y===41?(t.consume(y),a--,m):y===null||y===32||y===40||zv(y)?n(y):(t.consume(y),y===92?b:m)}function b(y){return y===40||y===41||y===92?(t.consume(y),m):m(y)}}function Sk(t,e,n,r,s,c){const i=this;let o=0,u;return l;function l(p){return t.enter(r),t.enter(s),t.consume(p),t.exit(s),t.enter(c),a}function a(p){return o>999||p===null||p===91||p===93&&!u||p===94&&!o&&"_hiddenFootnoteSupport"in i.parser.constructs?n(p):p===93?(t.exit(c),t.enter(s),t.consume(p),t.exit(s),t.exit(r),e):at(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),a):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||at(p)||o++>999?(t.exit("chunkString"),a(p)):(t.consume(p),u||(u=!Ot(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(t.consume(p),o++,d):d(p)}}function xk(t,e,n,r,s,c){let i;return o;function o(f){return f===34||f===39||f===40?(t.enter(r),t.enter(s),t.consume(f),t.exit(s),i=f===40?41:f,u):n(f)}function u(f){return f===i?(t.enter(s),t.consume(f),t.exit(s),t.exit(r),e):(t.enter(c),l(f))}function l(f){return f===i?(t.exit(c),u(i)):f===null?n(f):at(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Ut(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),a(f))}function a(f){return f===i||f===null||at(f)?(t.exit("chunkString"),l(f)):(t.consume(f),f===92?d:a)}function d(f){return f===i||f===92?(t.consume(f),a):a(f)}}function jc(t,e){let n;return r;function r(s){return at(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):Ot(s)?Ut(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const cU={name:"definition",tokenize:dU},uU={partial:!0,tokenize:hU};function dU(t,e,n){const r=this;let s;return c;function c(p){return t.enter("definition"),i(p)}function i(p){return Sk.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return s=La(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),u):n(p)}function u(p){return rr(p)?jc(t,l)(p):l(p)}function l(p){return wk(t,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function a(p){return t.attempt(uU,d,d)(p)}function d(p){return Ot(p)?Ut(t,f,"whitespace")(p):f(p)}function f(p){return p===null||at(p)?(t.exit("definition"),r.parser.defined.push(s),e(p)):n(p)}}function hU(t,e,n){return r;function r(o){return rr(o)?jc(t,s)(o):n(o)}function s(o){return xk(t,c,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function c(o){return Ot(o)?Ut(t,i,"whitespace")(o):i(o)}function i(o){return o===null||at(o)?e(o):n(o)}}const fU={name:"hardBreakEscape",tokenize:pU};function pU(t,e,n){return r;function r(c){return t.enter("hardBreakEscape"),t.consume(c),s}function s(c){return at(c)?(t.exit("hardBreakEscape"),e(c)):n(c)}}const mU={name:"headingAtx",resolve:vU,tokenize:gU};function vU(t,e){let n=t.length-2,r=3,s,c;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},c={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ss(t,r,n-r+1,[["enter",s,e],["enter",c,e],["exit",c,e],["exit",s,e]])),t}function gU(t,e,n){let r=0;return s;function s(a){return t.enter("atxHeading"),c(a)}function c(a){return t.enter("atxHeadingSequence"),i(a)}function i(a){return a===35&&r++<6?(t.consume(a),i):a===null||rr(a)?(t.exit("atxHeadingSequence"),o(a)):n(a)}function o(a){return a===35?(t.enter("atxHeadingSequence"),u(a)):a===null||at(a)?(t.exit("atxHeading"),e(a)):Ot(a)?Ut(t,o,"whitespace")(a):(t.enter("atxHeadingText"),l(a))}function u(a){return a===35?(t.consume(a),u):(t.exit("atxHeadingSequence"),o(a))}function l(a){return a===null||a===35||rr(a)?(t.exit("atxHeadingText"),o(a)):(t.consume(a),l)}}const bU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],I2=["pre","script","style","textarea"],yU={concrete:!0,name:"htmlFlow",resolveTo:SU,tokenize:xU},_U={partial:!0,tokenize:EU},wU={partial:!0,tokenize:CU};function SU(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function xU(t,e,n){const r=this;let s,c,i,o,u;return l;function l(B){return a(B)}function a(B){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(B),d}function d(B){return B===33?(t.consume(B),f):B===47?(t.consume(B),c=!0,m):B===63?(t.consume(B),s=3,r.interrupt?e:I):ys(B)?(t.consume(B),i=String.fromCharCode(B),b):n(B)}function f(B){return B===45?(t.consume(B),s=2,p):B===91?(t.consume(B),s=5,o=0,v):ys(B)?(t.consume(B),s=4,r.interrupt?e:I):n(B)}function p(B){return B===45?(t.consume(B),r.interrupt?e:I):n(B)}function v(B){const ee="CDATA[";return B===ee.charCodeAt(o++)?(t.consume(B),o===ee.length?r.interrupt?e:M:v):n(B)}function m(B){return ys(B)?(t.consume(B),i=String.fromCharCode(B),b):n(B)}function b(B){if(B===null||B===47||B===62||rr(B)){const ee=B===47,re=i.toLowerCase();return!ee&&!c&&I2.includes(re)?(s=1,r.interrupt?e(B):M(B)):bU.includes(i.toLowerCase())?(s=6,ee?(t.consume(B),y):r.interrupt?e(B):M(B)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):c?_(B):S(B))}return B===45||Sr(B)?(t.consume(B),i+=String.fromCharCode(B),b):n(B)}function y(B){return B===62?(t.consume(B),r.interrupt?e:M):n(B)}function _(B){return Ot(B)?(t.consume(B),_):L(B)}function S(B){return B===47?(t.consume(B),L):B===58||B===95||ys(B)?(t.consume(B),C):Ot(B)?(t.consume(B),S):L(B)}function C(B){return B===45||B===46||B===58||B===95||Sr(B)?(t.consume(B),C):x(B)}function x(B){return B===61?(t.consume(B),j):Ot(B)?(t.consume(B),x):S(B)}function j(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),u=B,k):Ot(B)?(t.consume(B),j):T(B)}function k(B){return B===u?(t.consume(B),u=null,A):B===null||at(B)?n(B):(t.consume(B),k)}function T(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||rr(B)?x(B):(t.consume(B),T)}function A(B){return B===47||B===62||Ot(B)?S(B):n(B)}function L(B){return B===62?(t.consume(B),N):n(B)}function N(B){return B===null||at(B)?M(B):Ot(B)?(t.consume(B),N):n(B)}function M(B){return B===45&&s===2?(t.consume(B),X):B===60&&s===1?(t.consume(B),Q):B===62&&s===4?(t.consume(B),W):B===63&&s===3?(t.consume(B),I):B===93&&s===5?(t.consume(B),U):at(B)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(_U,G,F)(B)):B===null||at(B)?(t.exit("htmlFlowData"),F(B)):(t.consume(B),M)}function F(B){return t.check(wU,Z,G)(B)}function Z(B){return t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),Y}function Y(B){return B===null||at(B)?F(B):(t.enter("htmlFlowData"),M(B))}function X(B){return B===45?(t.consume(B),I):M(B)}function Q(B){return B===47?(t.consume(B),i="",$):M(B)}function $(B){if(B===62){const ee=i.toLowerCase();return I2.includes(ee)?(t.consume(B),W):M(B)}return ys(B)&&i.length<8?(t.consume(B),i+=String.fromCharCode(B),$):M(B)}function U(B){return B===93?(t.consume(B),I):M(B)}function I(B){return B===62?(t.consume(B),W):B===45&&s===2?(t.consume(B),I):M(B)}function W(B){return B===null||at(B)?(t.exit("htmlFlowData"),G(B)):(t.consume(B),W)}function G(B){return t.exit("htmlFlow"),e(B)}}function CU(t,e,n){const r=this;return s;function s(i){return at(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),c):n(i)}function c(i){return r.parser.lazy[r.now().line]?n(i):e(i)}}function EU(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(nf,e,n)}}const jU={name:"htmlText",tokenize:kU};function kU(t,e,n){const r=this;let s,c,i;return o;function o(I){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(I),u}function u(I){return I===33?(t.consume(I),l):I===47?(t.consume(I),x):I===63?(t.consume(I),S):ys(I)?(t.consume(I),T):n(I)}function l(I){return I===45?(t.consume(I),a):I===91?(t.consume(I),c=0,v):ys(I)?(t.consume(I),_):n(I)}function a(I){return I===45?(t.consume(I),p):n(I)}function d(I){return I===null?n(I):I===45?(t.consume(I),f):at(I)?(i=d,Q(I)):(t.consume(I),d)}function f(I){return I===45?(t.consume(I),p):d(I)}function p(I){return I===62?X(I):I===45?f(I):d(I)}function v(I){const W="CDATA[";return I===W.charCodeAt(c++)?(t.consume(I),c===W.length?m:v):n(I)}function m(I){return I===null?n(I):I===93?(t.consume(I),b):at(I)?(i=m,Q(I)):(t.consume(I),m)}function b(I){return I===93?(t.consume(I),y):m(I)}function y(I){return I===62?X(I):I===93?(t.consume(I),y):m(I)}function _(I){return I===null||I===62?X(I):at(I)?(i=_,Q(I)):(t.consume(I),_)}function S(I){return I===null?n(I):I===63?(t.consume(I),C):at(I)?(i=S,Q(I)):(t.consume(I),S)}function C(I){return I===62?X(I):S(I)}function x(I){return ys(I)?(t.consume(I),j):n(I)}function j(I){return I===45||Sr(I)?(t.consume(I),j):k(I)}function k(I){return at(I)?(i=k,Q(I)):Ot(I)?(t.consume(I),k):X(I)}function T(I){return I===45||Sr(I)?(t.consume(I),T):I===47||I===62||rr(I)?A(I):n(I)}function A(I){return I===47?(t.consume(I),X):I===58||I===95||ys(I)?(t.consume(I),L):at(I)?(i=A,Q(I)):Ot(I)?(t.consume(I),A):X(I)}function L(I){return I===45||I===46||I===58||I===95||Sr(I)?(t.consume(I),L):N(I)}function N(I){return I===61?(t.consume(I),M):at(I)?(i=N,Q(I)):Ot(I)?(t.consume(I),N):A(I)}function M(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),s=I,F):at(I)?(i=M,Q(I)):Ot(I)?(t.consume(I),M):(t.consume(I),Z)}function F(I){return I===s?(t.consume(I),s=void 0,Y):I===null?n(I):at(I)?(i=F,Q(I)):(t.consume(I),F)}function Z(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||rr(I)?A(I):(t.consume(I),Z)}function Y(I){return I===47||I===62||rr(I)?A(I):n(I)}function X(I){return I===62?(t.consume(I),t.exit("htmlTextData"),t.exit("htmlText"),e):n(I)}function Q(I){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),$}function $(I){return Ot(I)?Ut(t,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):U(I)}function U(I){return t.enter("htmlTextData"),i(I)}}const D0={name:"labelEnd",resolveAll:IU,resolveTo:RU,tokenize:NU},TU={tokenize:LU},OU={tokenize:DU},AU={tokenize:MU};function IU(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&Ss(t,0,t.length,n),t}function RU(t,e){let n=t.length,r=0,s,c,i,o;for(;n--;)if(s=t[n][1],c){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(i){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(c=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(i=n);const u={type:t[c][1].type==="labelLink"?"link":"image",start:{...t[c][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[c][1].start},end:{...t[i][1].end}},a={type:"labelText",start:{...t[c+r+2][1].end},end:{...t[i-2][1].start}};return o=[["enter",u,e],["enter",l,e]],o=Mr(o,t.slice(c+1,c+r+3)),o=Mr(o,[["enter",a,e]]),o=Mr(o,L0(e.parser.constructs.insideSpan.null,t.slice(c+r+4,i-3),e)),o=Mr(o,[["exit",a,e],t[i-2],t[i-1],["exit",l,e]]),o=Mr(o,t.slice(i+1)),o=Mr(o,[["exit",u,e]]),Ss(t,c,t.length,o),t}function NU(t,e,n){const r=this;let s=r.events.length,c,i;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){c=r.events[s][1];break}return o;function o(f){return c?c._inactive?d(f):(i=r.parser.defined.includes(La(r.sliceSerialize({start:c.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelEnd"),u):n(f)}function u(f){return f===40?t.attempt(TU,a,i?a:d)(f):f===91?t.attempt(OU,a,i?l:d)(f):i?a(f):d(f)}function l(f){return t.attempt(AU,a,d)(f)}function a(f){return e(f)}function d(f){return c._balanced=!0,n(f)}}function LU(t,e,n){return r;function r(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),s}function s(d){return rr(d)?jc(t,c)(d):c(d)}function c(d){return d===41?a(d):wk(t,i,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return rr(d)?jc(t,u)(d):a(d)}function o(d){return n(d)}function u(d){return d===34||d===39||d===40?xk(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):a(d)}function l(d){return rr(d)?jc(t,a)(d):a(d)}function a(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}function DU(t,e,n){const r=this;return s;function s(o){return Sk.call(r,t,c,i,"reference","referenceMarker","referenceString")(o)}function c(o){return r.parser.defined.includes(La(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function i(o){return n(o)}}function MU(t,e,n){return r;function r(c){return t.enter("reference"),t.enter("referenceMarker"),t.consume(c),t.exit("referenceMarker"),s}function s(c){return c===93?(t.enter("referenceMarker"),t.consume(c),t.exit("referenceMarker"),t.exit("reference"),e):n(c)}}const PU={name:"labelStartImage",resolveAll:D0.resolveAll,tokenize:$U};function $U(t,e,n){const r=this;return s;function s(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),c}function c(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),i):n(o)}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const BU={name:"labelStartLink",resolveAll:D0.resolveAll,tokenize:UU};function UU(t,e,n){const r=this;return s;function s(i){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelLink"),c}function c(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(i):e(i)}}const Qm={name:"lineEnding",tokenize:FU};function FU(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Ut(t,e,"linePrefix")}}const Kd={name:"thematicBreak",tokenize:VU};function VU(t,e,n){let r=0,s;return c;function c(l){return t.enter("thematicBreak"),i(l)}function i(l){return s=l,o(l)}function o(l){return l===s?(t.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||at(l))?(t.exit("thematicBreak"),e(l)):n(l)}function u(l){return l===s?(t.consume(l),r++,u):(t.exit("thematicBreakSequence"),Ot(l)?Ut(t,o,"whitespace")(l):o(l))}}const Jn={continuation:{tokenize:GU},exit:YU,name:"list",tokenize:WU},zU={partial:!0,tokenize:KU},HU={partial:!0,tokenize:ZU};function WU(t,e,n){const r=this,s=r.events[r.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,i=0;return o;function o(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Hv(p)){if(r.containerState.type||(r.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(Kd,n,l)(p):l(p);if(!r.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(p)}return n(p)}function u(p){return Hv(p)&&++i<10?(t.consume(p),u):(!r.interrupt||i<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),l(p)):n(p)}function l(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,t.check(nf,r.interrupt?n:a,t.attempt(zU,f,d))}function a(p){return r.containerState.initialBlankLine=!0,c++,f(p)}function d(p){return Ot(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=c+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function GU(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(nf,s,c);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ut(t,e,"listItemIndent",r.containerState.size+1)(o)}function c(o){return r.containerState.furtherBlankLines||!Ot(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(HU,e,i)(o))}function i(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ut(t,t.attempt(Jn,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function ZU(t,e,n){const r=this;return Ut(t,s,"listItemIndent",r.containerState.size+1);function s(c){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?e(c):n(c)}}function YU(t){t.exit(this.containerState.type)}function KU(t,e,n){const r=this;return Ut(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const i=r.events[r.events.length-1];return!Ot(c)&&i&&i[1].type==="listItemPrefixWhitespace"?e(c):n(c)}}const R2={name:"setextUnderline",resolveTo:XU,tokenize:qU};function XU(t,e){let n=t.length,r,s,c;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!c&&t[n][1].type==="definition"&&(c=n);const i={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",c?(t.splice(s,0,["enter",i,e]),t.splice(c+1,0,["exit",t[r][1],e]),t[r][1].end={...t[c][1].end}):t[r][1]=i,t.push(["exit",i,e]),t}function qU(t,e,n){const r=this;let s;return c;function c(l){let a=r.events.length,d;for(;a--;)if(r.events[a][1].type!=="lineEnding"&&r.events[a][1].type!=="linePrefix"&&r.events[a][1].type!=="content"){d=r.events[a][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(t.enter("setextHeadingLine"),s=l,i(l)):n(l)}function i(l){return t.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===s?(t.consume(l),o):(t.exit("setextHeadingLineSequence"),Ot(l)?Ut(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||at(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const JU={tokenize:QU};function QU(t){const e=this,n=t.attempt(nf,r,t.attempt(this.parser.constructs.flowInitial,s,Ut(t,t.attempt(this.parser.constructs.flow,s,t.attempt(sU,s)),"linePrefix")));return n;function r(c){if(c===null){t.consume(c);return}return t.enter("lineEndingBlank"),t.consume(c),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const eF={resolveAll:Ek()},tF=Ck("string"),nF=Ck("text");function Ck(t){return{resolveAll:Ek(t==="text"?rF:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],c=n.attempt(s,i,o);return i;function i(a){return l(a)?c(a):o(a)}function o(a){if(a===null){n.consume(a);return}return n.enter("data"),n.consume(a),u}function u(a){return l(a)?(n.exit("data"),c(a)):(n.consume(a),u)}function l(a){if(a===null)return!0;const d=s[a];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Ek(t){return e;function e(n,r){let s=-1,c;for(;++s<=n.length;)c===void 0?n[s]&&n[s][1].type==="data"&&(c=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==c+2&&(n[c][1].end=n[s-1][1].end,n.splice(c+2,s-c-2),s=c+2),c=void 0);return t?t(n,r):n}}function rF(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let c=s.length,i=-1,o=0,u;for(;c--;){const l=s[c];if(typeof l=="string"){for(i=l.length;l.charCodeAt(i-1)===32;)o++,i--;if(i)break;i=-1}else if(l===-2)u=!0,o++;else if(l!==-1){c++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const l={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?i:r.start._bufferIndex+i,_index:r.start._index+c,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const sF={42:Jn,43:Jn,45:Jn,48:Jn,49:Jn,50:Jn,51:Jn,52:Jn,53:Jn,54:Jn,55:Jn,56:Jn,57:Jn,62:gk},iF={91:cU},oF={[-2]:Jm,[-1]:Jm,32:Jm},aF={35:mU,42:Kd,45:[R2,Kd],60:yU,61:R2,95:Kd,96:A2,126:A2},lF={38:yk,92:bk},cF={[-5]:Qm,[-4]:Qm,[-3]:Qm,33:PU,38:yk,42:Wv,60:[BB,jU],91:BU,92:[fU,bk],93:D0,95:Wv,96:JB},uF={null:[Wv,eF]},dF={null:[42,95]},hF={null:[]},fF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dF,contentInitial:iF,disable:hF,document:sF,flow:aF,flowInitial:oF,insideSpan:uF,string:lF,text:cF},Symbol.toStringTag,{value:"Module"}));function pF(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},c=[];let i=[],o=[];const u={attempt:k(x),check:k(j),consume:_,enter:S,exit:C,interrupt:k(j,{interrupt:!0})},l={code:null,containerState:{},defineSkip:m,events:[],now:v,parser:t,previous:null,sliceSerialize:f,sliceStream:p,write:d};let a=e.tokenize.call(l,u);return e.resolveAll&&c.push(e),l;function d(N){return i=Mr(i,N),b(),i[i.length-1]!==null?[]:(T(e,0),l.events=L0(c,l.events,l),l.events)}function f(N,M){return vF(p(N),M)}function p(N){return mF(i,N)}function v(){const{_bufferIndex:N,_index:M,line:F,column:Z,offset:Y}=r;return{_bufferIndex:N,_index:M,line:F,column:Z,offset:Y}}function m(N){s[N.line]=N.column,L()}function b(){let N;for(;r._index<i.length;){const M=i[r._index];if(typeof M=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<M.length;)y(M.charCodeAt(r._bufferIndex));else y(M)}}function y(N){a=a(N)}function _(N){at(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,L()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=N}function S(N,M){const F=M||{};return F.type=N,F.start=v(),l.events.push(["enter",F,l]),o.push(F),F}function C(N){const M=o.pop();return M.end=v(),l.events.push(["exit",M,l]),M}function x(N,M){T(N,M.from)}function j(N,M){M.restore()}function k(N,M){return F;function F(Z,Y,X){let Q,$,U,I;return Array.isArray(Z)?G(Z):"tokenize"in Z?G([Z]):W(Z);function W(K){return V;function V(ce){const oe=ce!==null&&K[ce],xe=ce!==null&&K.null,he=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(xe)?xe:xe?[xe]:[]];return G(he)(ce)}}function G(K){return Q=K,$=0,K.length===0?X:B(K[$])}function B(K){return V;function V(ce){return I=A(),U=K,K.partial||(l.currentConstruct=K),K.name&&l.parser.constructs.disable.null.includes(K.name)?re():K.tokenize.call(M?Object.assign(Object.create(l),M):l,u,ee,re)(ce)}}function ee(K){return N(U,I),Y}function re(K){return I.restore(),++$<Q.length?B(Q[$]):X}}}function T(N,M){N.resolveAll&&!c.includes(N)&&c.push(N),N.resolve&&Ss(l.events,M,l.events.length-M,N.resolve(l.events.slice(M),l)),N.resolveTo&&(l.events=N.resolveTo(l.events,l))}function A(){const N=v(),M=l.previous,F=l.currentConstruct,Z=l.events.length,Y=Array.from(o);return{from:Z,restore:X};function X(){r=N,l.previous=M,l.currentConstruct=F,l.events.length=Z,o=Y,L()}}function L(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function mF(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,c=e.end._bufferIndex;let i;if(n===s)i=[t[n].slice(r,c)];else{if(i=t.slice(n,s),r>-1){const o=i[0];typeof o=="string"?i[0]=o.slice(r):i.shift()}c>0&&i.push(t[s].slice(0,c))}return i}function vF(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const c=t[n];let i;if(typeof c=="string")i=c;else switch(c){case-5:{i="\r";break}case-4:{i=`
6660
6660
  `;break}case-3:{i=`\r
6661
6661
  `;break}case-2:{i=e?" ":" ";break}case-1:{if(!e&&s)continue;i=" ";break}default:i=String.fromCharCode(c)}s=c===-2,r.push(i)}return r.join("")}function gF(t){const r={constructs:CB([fF,...(t||{}).extensions||[]]),content:s(RB),defined:[],document:s(LB),flow:s(JU),lazy:{},string:s(tF),text:s(nF)};return r;function s(c){return i;function i(o){return pF(r,c,o)}}}function bF(t){for(;!_k(t););return t}const N2=/[\0\t\n\r]/g;function yF(){let t=1,e="",n=!0,r;return s;function s(c,i,o){const u=[];let l,a,d,f,p;for(c=e+(typeof c=="string"?c.toString():new TextDecoder(i||void 0).decode(c)),d=0,e="",n&&(c.charCodeAt(0)===65279&&d++,n=void 0);d<c.length;){if(N2.lastIndex=d,l=N2.exec(c),f=l&&l.index!==void 0?l.index:c.length,p=c.charCodeAt(f),!l){e=c.slice(d);break}if(p===10&&d===f&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),d<f&&(u.push(c.slice(d,f)),t+=f-d),p){case 0:{u.push(65533),t++;break}case 9:{for(a=Math.ceil(t/4)*4,u.push(-2);t++<a;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}d=f+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const _F=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wF(t){return t.replace(_F,SF)}function SF(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),c=s===120||s===88;return vk(n.slice(c?2:1),c?16:10)}return N0(n)||t}const jk={}.hasOwnProperty;function xF(t,e,n){return typeof e!="string"&&(n=e,e=void 0),CF(n)(bF(gF(n).document().write(yF()(t,e,!0))))}function CF(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(ue),autolinkProtocol:A,autolinkEmail:A,atxHeading:c(be),blockQuote:c(xe),characterEscape:A,characterReference:A,codeFenced:c(he),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:c(he,i),codeText:c(Pe,i),codeTextData:A,data:A,codeFlowValue:A,definition:c(Ie),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:c(Ye),hardBreakEscape:c(je),hardBreakTrailing:c(je),htmlFlow:c(ie,i),htmlFlowData:A,htmlText:c(ie,i),htmlTextData:A,image:c(se),label:i,link:c(ue),listItem:c(Ee),listItemValue:f,listOrdered:c(ve,d),listUnordered:c(ve),paragraph:c(Oe),reference:B,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:c(be),strong:c(Je),thematicBreak:c(He)},exit:{atxHeading:u(),atxHeadingSequence:x,autolink:u(),autolinkEmail:oe,autolinkProtocol:ce,blockQuote:u(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:K,characterReference:V,codeFenced:u(b),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:L,codeIndented:u(y),codeText:u(Y),codeTextData:L,data:L,definition:u(),definitionDestinationString:C,definitionLabelString:_,definitionTitleString:S,emphasis:u(),hardBreakEscape:u(M),hardBreakTrailing:u(M),htmlFlow:u(F),htmlFlowData:L,htmlText:u(Z),htmlTextData:L,image:u(Q),label:U,labelText:$,lineEnding:N,link:u(X),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ee,resourceDestinationString:I,resourceTitleString:W,resource:G,setextHeading:u(T),setextHeadingLineSequence:k,setextHeadingText:j,strong:u(),thematicBreak:u()}};kk(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(_e){let de={type:"root",children:[]};const Fe={stack:[de],tokenStack:[],config:e,enter:o,exit:l,buffer:i,resume:a,data:n},We=[];let nt=-1;for(;++nt<_e.length;)if(_e[nt][1].type==="listOrdered"||_e[nt][1].type==="listUnordered")if(_e[nt][0]==="enter")We.push(nt);else{const et=We.pop();nt=s(_e,et,nt)}for(nt=-1;++nt<_e.length;){const et=e[_e[nt][0]];jk.call(et,_e[nt][1].type)&&et[_e[nt][1].type].call(Object.assign({sliceSerialize:_e[nt][2].sliceSerialize},Fe),_e[nt][1])}if(Fe.tokenStack.length>0){const et=Fe.tokenStack[Fe.tokenStack.length-1];(et[1]||L2).call(Fe,void 0,et[0])}for(de.position={start:Ri(_e.length>0?_e[0][1].start:{line:1,column:1,offset:0}),end:Ri(_e.length>0?_e[_e.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<e.transforms.length;)de=e.transforms[nt](de)||de;return de}function s(_e,de,Fe){let We=de-1,nt=-1,et=!1,Et,vt,pt,Vt;for(;++We<=Fe;){const lt=_e[We];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?nt++:nt--,Vt=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(Et&&!Vt&&!nt&&!pt&&(pt=We),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!nt&&lt[0]==="enter"&&lt[1].type==="listItemPrefix"||nt===-1&&lt[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(Et){let ut=We;for(vt=void 0;ut--;){const jt=_e[ut];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;vt&&(_e[vt][1].type="lineEndingBlank",et=!0),jt[1].type="lineEnding",vt=ut}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}pt&&(!vt||pt<vt)&&(Et._spread=!0),Et.end=Object.assign({},vt?_e[vt][1].start:lt[1].end),_e.splice(vt||We,0,["exit",Et,lt[2]]),We++,Fe++}if(lt[1].type==="listItemPrefix"){const ut={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};Et=ut,_e.splice(We,0,["enter",ut,lt[2]]),We++,Fe++,pt=void 0,Vt=!0}}}return _e[de][1]._spread=et,Fe}function c(_e,de){return Fe;function Fe(We){o.call(this,_e(We),We),de&&de.call(this,We)}}function i(){this.stack.push({type:"fragment",children:[]})}function o(_e,de,Fe){this.stack[this.stack.length-1].children.push(_e),this.stack.push(_e),this.tokenStack.push([de,Fe||void 0]),_e.position={start:Ri(de.start),end:void 0}}function u(_e){return de;function de(Fe){_e&&_e.call(this,Fe),l.call(this,Fe)}}function l(_e,de){const Fe=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==_e.type&&(de?de.call(this,_e,We[0]):(We[1]||L2).call(this,_e,We[0]));else throw new Error("Cannot close `"+_e.type+"` ("+Ec({start:_e.start,end:_e.end})+"): it’s not open");Fe.position.end=Ri(_e.end)}function a(){return SB(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(_e){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(_e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.lang=_e}function v(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.meta=_e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.value=_e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.value=_e.replace(/(\r?\n|\r)$/g,"")}function _(_e){const de=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=de,Fe.identifier=La(this.sliceSerialize(_e)).toLowerCase()}function S(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.title=_e}function C(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.url=_e}function x(_e){const de=this.stack[this.stack.length-1];if(!de.depth){const Fe=this.sliceSerialize(_e).length;de.depth=Fe}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function k(_e){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(_e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function A(_e){const Fe=this.stack[this.stack.length-1].children;let We=Fe[Fe.length-1];(!We||We.type!=="text")&&(We=Ke(),We.position={start:Ri(_e.start),end:void 0},Fe.push(We)),this.stack.push(We)}function L(_e){const de=this.stack.pop();de.value+=this.sliceSerialize(_e),de.position.end=Ri(_e.end)}function N(_e){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Fe=de.children[de.children.length-1];Fe.position.end=Ri(_e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(de.type)&&(A.call(this,_e),L.call(this,_e))}function M(){this.data.atHardBreak=!0}function F(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.value=_e}function Z(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.value=_e}function Y(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.value=_e}function X(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=de,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function Q(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=de,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function $(_e){const de=this.sliceSerialize(_e),Fe=this.stack[this.stack.length-2];Fe.label=wF(de),Fe.identifier=La(de).toLowerCase()}function U(){const _e=this.stack[this.stack.length-1],de=this.resume(),Fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Fe.type==="link"){const We=_e.children;Fe.children=We}else Fe.alt=de}function I(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.url=_e}function W(){const _e=this.resume(),de=this.stack[this.stack.length-1];de.title=_e}function G(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function ee(_e){const de=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=de,Fe.identifier=La(this.sliceSerialize(_e)).toLowerCase(),this.data.referenceType="full"}function re(_e){this.data.characterReferenceType=_e.type}function K(_e){const de=this.sliceSerialize(_e),Fe=this.data.characterReferenceType;let We;Fe?(We=vk(de,Fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=N0(de);const nt=this.stack[this.stack.length-1];nt.value+=We}function V(_e){const de=this.stack.pop();de.position.end=Ri(_e.end)}function ce(_e){L.call(this,_e);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(_e)}function oe(_e){L.call(this,_e);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(_e)}function xe(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function Pe(){return{type:"inlineCode",value:""}}function Ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ye(){return{type:"emphasis",children:[]}}function be(){return{type:"heading",depth:0,children:[]}}function je(){return{type:"break"}}function ie(){return{type:"html",value:""}}function se(){return{type:"image",title:null,url:"",alt:null}}function ue(){return{type:"link",title:null,url:"",children:[]}}function ve(_e){return{type:"list",ordered:_e.type==="listOrdered",start:null,spread:_e._spread,children:[]}}function Ee(_e){return{type:"listItem",spread:_e._spread,checked:null,children:[]}}function Oe(){return{type:"paragraph",children:[]}}function Je(){return{type:"strong",children:[]}}function Ke(){return{type:"text",value:""}}function He(){return{type:"thematicBreak"}}}function Ri(t){return{line:t.line,column:t.column,offset:t.offset}}function kk(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?kk(t,r):EF(t,r)}}function EF(t,e){let n;for(n in e)if(jk.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function L2(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Ec({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Ec({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Ec({start:e.start,end:e.end})+") is still open")}function jF(t){const e=this;e.parser=n;function n(r){return xF(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function kF(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function TF(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
@@ -6668,7 +6668,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
6668
6668
  `});++r<t.length;)r&&n.push({type:"text",value:`
6669
6669
  `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
6670
6670
  `}),n}function V2(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function z2(t,e){const n=vV(t,e),r=n.one(t,void 0),s=iV(n),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
6671
- `},s),c}function wV(t,e){return t&&"run"in t?async function(n,r){const s=z2(n,{file:r,...e});await t.run(s,r)}:function(n,r){return z2(n,{file:r,...t||e})}}function H2(t){if(t)throw t}var ev,W2;function SV(){if(W2)return ev;W2=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},c=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var a=t.call(l,"constructor"),d=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!a&&!d)return!1;var f;for(f in l);return typeof f>"u"||t.call(l,f)},i=function(l,a){n&&a.name==="__proto__"?n(l,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):l[a.name]=a.newValue},o=function(l,a){if(a==="__proto__")if(t.call(l,a)){if(r)return r(l,a).value}else return;return l[a]};return ev=function u(){var l,a,d,f,p,v,m=arguments[0],b=1,y=arguments.length,_=!1;for(typeof m=="boolean"&&(_=m,m=arguments[1]||{},b=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});b<y;++b)if(l=arguments[b],l!=null)for(a in l)d=o(m,a),f=o(l,a),m!==f&&(_&&f&&(c(f)||(p=s(f)))?(p?(p=!1,v=d&&s(d)?d:[]):v=d&&c(d)?d:{},i(m,{name:a,newValue:u(_,v,f)})):typeof f<"u"&&i(m,{name:a,newValue:f}));return m},ev}var xV=SV();const tv=Kc(xV);function Zv(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function CV(){const t=[],e={run:n,use:r};return e;function n(...s){let c=-1;const i=s.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);o(null,...s);function o(u,...l){const a=t[++c];let d=-1;if(u){i(u);return}for(;++d<s.length;)(l[d]===null||l[d]===void 0)&&(l[d]=s[d]);s=l,a?EV(a,o)(...l):i(null,...l)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function EV(t,e){let n;return r;function r(...i){const o=t.length>i.length;let u;o&&i.push(s);try{u=t.apply(this,i)}catch(l){const a=l;if(o&&n)throw a;return s(a)}o||(u&&u.then&&typeof u.then=="function"?u.then(c,s):u instanceof Error?s(u):c(u))}function s(i,...o){n||(n=!0,e(i,...o))}function c(i){s(null,i)}}const ms={basename:jV,dirname:kV,extname:TV,join:OV,sep:"/"};function jV(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');hu(t);let n=0,r=-1,s=t.length,c;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(c){n=s+1;break}}else r<0&&(c=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let i=-1,o=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(c){n=s+1;break}}else i<0&&(c=!0,i=s+1),o>-1&&(t.codePointAt(s)===e.codePointAt(o--)?o<0&&(r=s):(o=-1,r=i));return n===r?r=i:r<0&&(r=t.length),t.slice(n,r)}function kV(t){if(hu(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function TV(t){hu(t);let e=t.length,n=-1,r=0,s=-1,c=0,i;for(;e--;){const o=t.codePointAt(e);if(o===47){if(i){r=e+1;break}continue}n<0&&(i=!0,n=e+1),o===46?s<0?s=e:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||n<0||c===0||c===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function OV(...t){let e=-1,n;for(;++e<t.length;)hu(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":AV(n)}function AV(t){hu(t);const e=t.codePointAt(0)===47;let n=IV(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function IV(t,e){let n="",r=0,s=-1,c=0,i=-1,o,u;for(;++i<=t.length;){if(i<t.length)o=t.codePointAt(i);else{if(o===47)break;o=47}if(o===47){if(!(s===i-1||c===1))if(s!==i-1&&c===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),s=i,c=0;continue}}else if(n.length>0){n="",r=0,s=i,c=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,i):n=t.slice(s+1,i),r=i-s-1;s=i,c=0}else o===46&&c>-1?c++:c=-1}return n}function hu(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const RV={cwd:NV};function NV(){return"/"}function Yv(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function LV(t){if(typeof t=="string")t=new URL(t);else if(!Yv(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return DV(t)}function DV(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const nv=["history","path","basename","stem","extname","dirname"];class Mk{constructor(e){let n;e?Yv(e)?n={path:e}:typeof e=="string"||MV(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":RV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nv.length;){const c=nv[r];c in n&&n[c]!==void 0&&n[c]!==null&&(this[c]=c==="history"?[...n[c]]:n[c])}let s;for(s in n)nv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ms.basename(this.path):void 0}set basename(e){sv(e,"basename"),rv(e,"basename"),this.path=ms.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ms.dirname(this.path):void 0}set dirname(e){G2(this.basename,"dirname"),this.path=ms.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ms.extname(this.path):void 0}set extname(e){if(rv(e,"extname"),G2(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ms.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Yv(e)&&(e=LV(e)),sv(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ms.basename(this.path,this.extname):void 0}set stem(e){sv(e,"stem"),rv(e,"stem"),this.path=ms.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new Bn(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function rv(t,e){if(t&&t.includes(ms.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ms.sep+"`")}function sv(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function G2(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function MV(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const PV=function(t){const r=this.constructor.prototype,s=r[t],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,r),c},$V={}.hasOwnProperty;class U0 extends PV{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CV()}copy(){const e=new U0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(tv(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(av("data",this.frozen),this.namespace[e]=n,this):$V.call(this.namespace,e)&&this.namespace[e]||void 0:e?(av("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Pd(e),r=this.parser||this.Parser;return iv("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),iv("process",this.parser||this.Parser),ov("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(c,i){const o=Pd(e),u=r.parse(o);r.run(u,o,function(a,d,f){if(a||!d||!f)return l(a);const p=d,v=r.stringify(p,f);FV(v)?f.value=v:f.result=v,l(a,f)});function l(a,d){a||!d?i(a):c?c(d):n(void 0,d)}}}processSync(e){let n=!1,r;return this.freeze(),iv("processSync",this.parser||this.Parser),ov("processSync",this.compiler||this.Compiler),this.process(e,s),Y2("processSync","process",n),r;function s(c,i){n=!0,H2(c),r=i}}run(e,n,r){Z2(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?c(void 0,r):new Promise(c);function c(i,o){const u=Pd(n);s.run(e,u,l);function l(a,d,f){const p=d||e;a?o(a):i?i(p):r(void 0,p,f)}}}runSync(e,n){let r=!1,s;return this.run(e,n,c),Y2("runSync","run",r),s;function c(i,o){H2(i),s=o,r=!0}}stringify(e,n){this.freeze();const r=Pd(n),s=this.compiler||this.Compiler;return ov("stringify",s),Z2(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if(av("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):i(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function c(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[a,...d]=l;u(a,d)}else i(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function i(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(l.plugins),l.settings&&(s.settings=tv(!0,s.settings,l.settings))}function o(l){let a=-1;if(l!=null)if(Array.isArray(l))for(;++a<l.length;){const d=l[a];c(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,a){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===l){f=d;break}if(f===-1)r.push([l,...a]);else if(a.length>0){let[p,...v]=a;const m=r[f][1];Zv(m)&&Zv(p)&&(p=tv(!0,m,p)),r[f]=[l,p,...v]}}}}const BV=new U0().freeze();function iv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ov(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function av(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Z2(t){if(!Zv(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Y2(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Pd(t){return UV(t)?t:new Mk(t)}function UV(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function FV(t){return typeof t=="string"||VV(t)}function VV(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const zV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",K2=[],X2={allowDangerousHtml:!0},HV=/^(https?|ircs?|mailto|xmpp)$/i,WV=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function GV(t){const e=ZV(t),n=YV(t);return KV(e.runSync(e.parse(n),n),t)}function ZV(t){const e=t.rehypePlugins||K2,n=t.remarkPlugins||K2,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...X2}:X2;return BV().use(jF).use(n).use(wV,r).use(e)}function YV(t){const e=t.children||"",n=new Mk;return typeof e=="string"&&(n.value=e),n}function KV(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,c=e.disallowedElements,i=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||XV;for(const a of WV)Object.hasOwn(e,a.from)&&(""+a.from+(a.to?"use `"+a.to+"` instead":"remove it")+zV+a.id,void 0);return Dk(t,l),iB(t,{Fragment:J.Fragment,components:s,ignoreInvalidStyle:!0,jsx:J.jsx,jsxs:J.jsxs,passKeys:!0,passNode:!0});function l(a,d,f){if(a.type==="raw"&&f&&typeof d=="number")return i?f.children.splice(d,1):f.children[d]={type:"text",value:a.value},d;if(a.type==="element"){let p;for(p in qm)if(Object.hasOwn(qm,p)&&Object.hasOwn(a.properties,p)){const v=a.properties[p],m=qm[p];(m===null||m.includes(a.tagName))&&(a.properties[p]=u(String(v||""),p,a))}}if(a.type==="element"){let p=n?!n.includes(a.tagName):c?c.includes(a.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(a,d,f)),p&&f&&typeof d=="number")return o&&a.children?f.children.splice(d,1,...a.children):f.children.splice(d,1),d}}}function XV(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||HV.test(t.slice(0,e))?t:""}const Pk=({role:t,children:e})=>{const n=t===si.USER?"self-end":"self-start",r=t===si.USER?"indigo":"gray";return J.jsx(Lh,{highContrast:!0,color:r,className:`${n} max-w-[80%] break-words m-1`,children:J.jsx(Rc,{children:e})})},qV=({block:t})=>J.jsx(Pk,{role:si.USER,children:t.contents}),JV=({block:t})=>J.jsx(Pk,{role:si.ASSISTANT,children:J.jsx(GV,{components:{code:({children:e,...n})=>J.jsx("pre",{className:"whitespace-pre-wrap",children:J.jsx("code",{...n,children:String(e).replace(/\n$/,"")})})},children:t.contents})}),QV=D.memo(({block:t,isRecentCodeBlock:e,onClick:n})=>{var l,a;const{runCodeBlock:r}=Xi(),{settings:s}=es(),c=((a=(l=t.contents)==null?void 0:l.split(/&&|;|\n|\\n/)[0])==null?void 0:a.substring(0,50))||"",i=()=>{n?n():r(t)},o=s.webApp.invertedOrder?"justify-end":"justify-start",u=J.jsx("span",{className:"text-xs text-gray-400 p-2",children:"Press CTRL+ENTER to run"});return J.jsxs("div",{className:`flex ${o} items-center h-full`,children:[e&&s.webApp.invertedOrder&&u,J.jsxs("div",{className:"flex items-center m-1 p-2 bg-[#1e1e1e] rounded-md max-w-[60%] cursor-pointer",onClick:i,children:[J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:J.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),J.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-1",children:[J.jsx("polyline",{points:"4 17 10 11 4 5"}),J.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),J.jsx("span",{className:"text-sm text-[#d4d4d4] italic truncate max-w-4/5",children:c})]}),e&&!s.webApp.invertedOrder&&u]})},(t,e)=>t.block.id===e.block.id&&JSON.stringify(t.block.contents)===JSON.stringify(e.block.contents)&&t.isRecentCodeBlock===e.isRecentCodeBlock),q2=({block:t,isRecentCodeBlock:e})=>{if(t.kind===vs.CODE)return J.jsx(QV,{block:t,isRecentCodeBlock:e},t.id);switch(t.role){case si.USER:return J.jsx(qV,{block:t});case si.ASSISTANT:return J.jsx(JV,{block:t});default:return null}},J2=()=>{const{useColumns:t,isTyping:e}=Xi(),{settings:n}=es(),{chat:r}=t(),s=D.useRef(null);D.useEffect(()=>{var u;n.webApp.invertedOrder||(u=s.current)==null||u.scrollIntoView({behavior:"smooth"})},[r,n.webApp.invertedOrder]);const c=n.webApp.invertedOrder?0:r.length-1,o=J.jsx("div",{className:"flex justify-start items-center h-full",children:J.jsx(q2,{block:pP})});return J.jsxs("div",{className:"overflow-y-clip p-1 flex flex-col whitespace-pre-wrap",children:[e&&n.webApp.invertedOrder&&o,r.map((u,l)=>J.jsx(q2,{block:u,isRecentCodeBlock:u.kind===vs.CODE&&l===c&&!e},l)),e&&!n.webApp.invertedOrder&&o,J.jsx("div",{ref:s})]})},Q2=()=>{const{sendUserBlock:t,isInputDisabled:e}=Xi(),[n,r]=D.useState(""),s=D.useRef(null);D.useEffect(()=>{var o;(o=s.current)==null||o.focus()},[]);const c=o=>{o.preventDefault(),n.trim()&&(t(n),r(""))},i=o=>{if(o.key==="Enter"&&!o.shiftKey){o.preventDefault();const u=o.currentTarget.form;u&&u.requestSubmit()}};return J.jsx("form",{onSubmit:c,className:"flex w-full",children:J.jsxs(In,{className:"w-full flex flex-nowrap items-start gap-4 m-2",children:[J.jsx(ih,{name:"userInput",value:n,onChange:o=>r(o.target.value),onKeyDown:i,placeholder:"Enter your question",size:"3",className:"flex-grow min-w-0",ref:s,rows:2,style:{resize:"vertical"}}),J.jsx(Di,{type:"submit",disabled:e,children:J.jsx(k$,{})})]})})};function ex(){const{useColumns:t,runCodeBlock:e}=Xi(),{settings:n}=es(),{chat:r}=t(),s=D.useRef(null);D.useEffect(()=>{const i=u=>{if(u.ctrlKey&&u.key==="Enter"){const l=n.webApp.invertedOrder?r[0]:r[r.length-1];(l==null?void 0:l.kind)===vs.CODE&&e(l)}},o=s.current;if(o)return o.addEventListener("keydown",i),()=>o.removeEventListener("keydown",i)},[r,e,n.webApp.invertedOrder]);const c=n.webApp.invertedOrder?"flex-col":"flex-col-reverse";return J.jsxs("div",{ref:s,className:"flex flex-col h-full",children:[J.jsx(tn,{size:"5",weight:"bold",className:"mb-2",children:"How can I help you?"}),J.jsx(Dh,{type:"auto",scrollbars:"vertical",className:"flex-1 p-4",children:J.jsx("div",{className:`flex ${c} h-full w-full`,children:n.webApp.invertedOrder?J.jsxs(J.Fragment,{children:[J.jsx(Q2,{}),J.jsx(J2,{})]}):J.jsxs(J.Fragment,{children:[J.jsx(Q2,{}),J.jsx(J2,{})]})})})]})}const ez=()=>{const{useColumns:t}=Xi(),{files:e}=t(),n=D.useRef(null),r=()=>{var i;(i=n.current)==null||i.scrollIntoView({behavior:"smooth"})},s=D.useMemo(()=>{let i=mn(xc,{});return e.length>0&&(i=e[e.length-1]),i},[e]);D.useEffect(()=>{r()},[s]);const c=s.fileSearchResults.length>0;return J.jsxs("div",{className:"flex flex-col h-full",children:[J.jsx(tn,{size:"5",weight:"bold",className:"mb-2",children:"Files"}),J.jsx(Dh,{type:"auto",scrollbars:"vertical",className:"flex-1 pt-4",children:c?J.jsxs("div",{className:"grow",children:[s.fileSearchResults.map(i=>J.jsx("div",{className:"mb-2",children:J.jsx(bs,{p:"2",style:{borderRadius:"6px",border:"1px solid var(--gray-5)"},children:J.jsx(tn,{size:"2",weight:"medium",children:J.jsx(Ag,{href:i.Link,target:"_blank",className:"text-blue-500 hover:underline",children:i.FileName})})})},i.FileID)),J.jsx("div",{ref:n,className:"h-1"})]}):J.jsxs("div",{children:[J.jsx("div",{children:"No search results yet"}),J.jsx("div",{ref:n,className:"h-1"})]})})]})},tz=Yi("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),nz=pD(tz,0),Kv=Yh(nz);function rz(){const{runnerError:t}=es(),[e]=o9(),n=D.useMemo(()=>t&&!(t instanceof Error)?Kv[t.code]??t.code:e.get("error"),[t,e]),r=D.useMemo(()=>t&&!(t instanceof Error)?t.message:e.get("error_description"),[t,e]),s=()=>{window.location.href="/oidc/login"};return J.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[n&&J.jsxs(Lh,{color:"red",children:[J.jsxs(Rc,{className:"font-bold",children:["Error: ",n]}),r&&J.jsx(Rc,{children:r})]}),J.jsx(Di,{size:"4",onClick:s,className:"cursor-pointer",children:"Login"})]})}const sz=()=>J.jsxs(gE,{size:"3",style:{padding:"2rem",textAlign:"center"},children:[J.jsx(aE,{size:"8",mb:"4",children:"404"}),J.jsx(tn,{size:"5",color:"gray",children:"Page not found"}),J.jsx(tn,{as:"p",mt:"4",children:"The page you're looking for doesn't exist or has been moved."}),J.jsxs(tn,{as:"p",mt:"4",children:["Click"," ",J.jsx(Ag,{href:"/",underline:"always",children:"here"})," ","to go back home."]})]});function iz(){const t=Sh(),{settings:e,updateSettings:n,runnerError:r,defaultSettings:s}=es(),[c,i]=D.useState(!1),[o,u]=D.useState(e.agentEndpoint),[l,a]=D.useState(e.webApp.runner),[d,f]=D.useState(e.webApp.invertedOrder),p=()=>{n({agentEndpoint:o,webApp:{runner:l,reconnect:e.webApp.reconnect,invertedOrder:d}}),i(!0)};D.useEffect(()=>{c&&(i(!1),r&&t("/"))},[r,c,t]);const v=()=>{u(s.agentEndpoint),a(s.webApp.runner),f(s.webApp.invertedOrder)},m=D.useMemo(()=>{if(r&&!(!r||typeof r!="object"||!("message"in r)))return r.message},[r]),b=o!==e.agentEndpoint||l!==e.webApp.runner||d!==e.webApp.invertedOrder;return J.jsxs(bs,{className:"w-full mx-auto",children:[J.jsx(tn,{size:"5",weight:"bold",className:"mb-2",children:"Settings"}),J.jsxs(bs,{className:"mt-4",children:[J.jsxs(In,{direction:"column",gap:"4",children:[J.jsxs(In,{direction:"column",gap:"2",children:[J.jsx(tn,{size:"3",weight:"bold",children:"Agent Endpoint Configuration"}),J.jsx(tn,{size:"2",color:"gray",children:"Configure the endpoint URL for the AI agent. Changes will take effect after saving."}),J.jsx(ih,{size:"3",placeholder:"Enter AI endpoint URL",value:o,onChange:y=>u(y.target.value)})]}),J.jsxs(In,{direction:"column",gap:"2",children:[J.jsx(tn,{size:"3",weight:"bold",children:"Runner Endpoint Configuration"}),J.jsx(tn,{size:"2",color:"gray",children:"Configure the WebSocket endpoint URL for the runner. Changes will take effect after saving."}),r&&J.jsx(Lh,{color:"red",children:J.jsxs(Rc,{className:"font-bold",children:["Runner error",m?": "+m:""]})}),J.jsx(ih,{size:"3",placeholder:"Enter Runner WebSocket endpoint URL",value:l,onChange:y=>a(y.target.value)}),J.jsx(tn,{size:"2",color:"gray",children:"Revert will reset endpoints to the default values, including protocol http(s), based on the current page."})]}),J.jsxs(In,{direction:"column",gap:"2",children:[J.jsx(tn,{size:"3",weight:"bold",children:"User Experience Mode"}),J.jsx(tn,{as:"label",size:"2",children:J.jsxs(In,{gap:"2",children:["Document Mode",J.jsx(bE,{checked:d,onCheckedChange:f}),"Console Mode"]})})]})]}),J.jsxs(In,{gap:"3",justify:"end",mt:"4",children:[J.jsx(Di,{size:"2",variant:"soft",onClick:()=>t("/"),children:"Back"}),J.jsx(Di,{size:"2",variant:"soft",onClick:v,children:"Revert"}),J.jsx(Di,{size:"2",onClick:p,disabled:!b,children:"Save"})]})]})]})}function Ct(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function tx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function of(...t){return e=>{let n=!1;const r=t.map(s=>{const c=tx(s,e);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let s=0;s<r.length;s++){const c=r[s];typeof c=="function"?c():tx(t[s],null)}}}}function sr(...t){return D.useCallback(of(...t),t)}function fu(t,e=[]){let n=[];function r(c,i){const o=D.createContext(i),u=n.length;n=[...n,i];const l=d=>{var y;const{scope:f,children:p,...v}=d,m=((y=f==null?void 0:f[t])==null?void 0:y[u])||o,b=D.useMemo(()=>v,Object.values(v));return J.jsx(m.Provider,{value:b,children:p})};l.displayName=c+"Provider";function a(d,f){var m;const p=((m=f==null?void 0:f[t])==null?void 0:m[u])||o,v=D.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${c}\``)}return[l,a]}const s=()=>{const c=n.map(i=>D.createContext(i));return function(o){const u=(o==null?void 0:o[t])||c;return D.useMemo(()=>({[`__scope${t}`]:{...o,[t]:u}}),[o,u])}};return s.scopeName=t,[r,oz(s,...e)]}function oz(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(c){const i=r.reduce((o,{useScope:u,scopeName:l})=>{const d=u(c)[`__scope${l}`];return{...o,...d}},{});return D.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var Mo=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},az=vx[" useInsertionEffect ".trim().toString()]||Mo;function $k({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,c,i]=lz({defaultProp:e,onChange:n}),o=t!==void 0,u=o?t:s;{const a=D.useRef(t!==void 0);D.useEffect(()=>{const d=a.current;d!==o&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),a.current=o},[o,r])}const l=D.useCallback(a=>{var d;if(o){const f=cz(a)?a(t):a;f!==t&&((d=i.current)==null||d.call(i,f))}else c(a)},[o,t,c,i]);return[u,l]}function lz({defaultProp:t,onChange:e}){const[n,r]=D.useState(t),s=D.useRef(n),c=D.useRef(e);return az(()=>{c.current=e},[e]),D.useEffect(()=>{var i;s.current!==n&&((i=c.current)==null||i.call(c,n),s.current=n)},[n,s]),[n,r,c]}function cz(t){return typeof t=="function"}function bh(t){const e=uz(t),n=D.forwardRef((r,s)=>{const{children:c,...i}=r,o=D.Children.toArray(c),u=o.find(hz);if(u){const l=u.props.children,a=o.map(d=>d===u?D.Children.count(l)>1?D.Children.only(null):D.isValidElement(l)?l.props.children:null:d);return J.jsx(e,{...i,ref:s,children:D.isValidElement(l)?D.cloneElement(l,void 0,a):null})}return J.jsx(e,{...i,ref:s,children:c})});return n.displayName=`${t}.Slot`,n}function uz(t){const e=D.forwardRef((n,r)=>{const{children:s,...c}=n;if(D.isValidElement(s)){const i=pz(s),o=fz(c,s.props);return s.type!==D.Fragment&&(o.ref=r?of(r,i):i),D.cloneElement(s,o)}return D.Children.count(s)>1?D.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var dz=Symbol("radix.slottable");function hz(t){return D.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dz}function fz(t,e){const n={...e};for(const r in e){const s=t[r],c=e[r];/^on[A-Z]/.test(r)?s&&c?n[r]=(...o)=>{const u=c(...o);return s(...o),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...c}:r==="className"&&(n[r]=[s,c].filter(Boolean).join(" "))}return{...t,...n}}function pz(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var mz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lr=mz.reduce((t,e)=>{const n=bh(`Primitive.${e}`),r=D.forwardRef((s,c)=>{const{asChild:i,...o}=s,u=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),J.jsx(u,{...o,ref:c})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Bk(t,e){t&&og.flushSync(()=>t.dispatchEvent(e))}function Uk(t){const e=t+"CollectionProvider",[n,r]=fu(e),[s,c]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:b,children:y}=m,_=Qn.useRef(null),S=Qn.useRef(new Map).current;return J.jsx(s,{scope:b,itemMap:S,collectionRef:_,children:y})};i.displayName=e;const o=t+"CollectionSlot",u=bh(o),l=Qn.forwardRef((m,b)=>{const{scope:y,children:_}=m,S=c(o,y),C=sr(b,S.collectionRef);return J.jsx(u,{ref:C,children:_})});l.displayName=o;const a=t+"CollectionItemSlot",d="data-radix-collection-item",f=bh(a),p=Qn.forwardRef((m,b)=>{const{scope:y,children:_,...S}=m,C=Qn.useRef(null),x=sr(b,C),j=c(a,y);return Qn.useEffect(()=>(j.itemMap.set(C,{ref:C,...S}),()=>void j.itemMap.delete(C))),J.jsx(f,{[d]:"",ref:x,children:_})});p.displayName=a;function v(m){const b=c(t+"CollectionConsumer",m);return Qn.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const S=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((j,k)=>S.indexOf(j.ref.current)-S.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:l,ItemSlot:p},v,r]}var vz=D.createContext(void 0);function Fk(t){const e=D.useContext(vz);return t||e||"ltr"}function ii(t){const e=D.useRef(t);return D.useEffect(()=>{e.current=t}),D.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function gz(t,e=globalThis==null?void 0:globalThis.document){const n=ii(t);D.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var bz="DismissableLayer",Xv="dismissableLayer.update",yz="dismissableLayer.pointerDownOutside",_z="dismissableLayer.focusOutside",nx,Vk=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zk=D.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:i,onDismiss:o,...u}=t,l=D.useContext(Vk),[a,d]=D.useState(null),f=(a==null?void 0:a.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=D.useState({}),v=sr(e,k=>d(k)),m=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(b),_=a?m.indexOf(a):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=_>=y,x=xz(k=>{const T=k.target,A=[...l.branches].some(L=>L.contains(T));!C||A||(s==null||s(k),i==null||i(k),k.defaultPrevented||o==null||o())},f),j=Cz(k=>{const T=k.target;[...l.branches].some(L=>L.contains(T))||(c==null||c(k),i==null||i(k),k.defaultPrevented||o==null||o())},f);return gz(k=>{_===l.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&o&&(k.preventDefault(),o()))},f),D.useEffect(()=>{if(a)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(nx=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(a)),l.layers.add(a),rx(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nx)}},[a,f,n,l]),D.useEffect(()=>()=>{a&&(l.layers.delete(a),l.layersWithOutsidePointerEventsDisabled.delete(a),rx())},[a,l]),D.useEffect(()=>{const k=()=>p({});return document.addEventListener(Xv,k),()=>document.removeEventListener(Xv,k)},[]),J.jsx(lr.div,{...u,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...t.style},onFocusCapture:Ct(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Ct(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Ct(t.onPointerDownCapture,x.onPointerDownCapture)})});zk.displayName=bz;var wz="DismissableLayerBranch",Sz=D.forwardRef((t,e)=>{const n=D.useContext(Vk),r=D.useRef(null),s=sr(e,r);return D.useEffect(()=>{const c=r.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),J.jsx(lr.div,{...t,ref:s})});Sz.displayName=wz;function xz(t,e=globalThis==null?void 0:globalThis.document){const n=ii(t),r=D.useRef(!1),s=D.useRef(()=>{});return D.useEffect(()=>{const c=o=>{if(o.target&&!r.current){let u=function(){Hk(yz,n,l,{discrete:!0})};const l={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=u,e.addEventListener("click",s.current,{once:!0})):u()}else e.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",c),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Cz(t,e=globalThis==null?void 0:globalThis.document){const n=ii(t),r=D.useRef(!1);return D.useEffect(()=>{const s=c=>{c.target&&!r.current&&Hk(_z,n,{originalEvent:c},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rx(){const t=new CustomEvent(Xv);document.dispatchEvent(t)}function Hk(t,e,n,{discrete:r}){const s=n.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Bk(s,c):s.dispatchEvent(c)}var lv=0;function Ez(){D.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sx()),document.body.insertAdjacentElement("beforeend",t[1]??sx()),lv++,()=>{lv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),lv--}},[])}function sx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var cv="focusScope.autoFocusOnMount",uv="focusScope.autoFocusOnUnmount",ix={bubbles:!1,cancelable:!0},jz="FocusScope",Wk=D.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...i}=t,[o,u]=D.useState(null),l=ii(s),a=ii(c),d=D.useRef(null),f=sr(e,m=>u(m)),p=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(r){let m=function(S){if(p.paused||!o)return;const C=S.target;o.contains(C)?d.current=C:Li(d.current,{select:!0})},b=function(S){if(p.paused||!o)return;const C=S.relatedTarget;C!==null&&(o.contains(C)||Li(d.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Li(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",b);const _=new MutationObserver(y);return o&&_.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",b),_.disconnect()}}},[r,o,p.paused]),D.useEffect(()=>{if(o){ax.add(p);const m=document.activeElement;if(!o.contains(m)){const y=new CustomEvent(cv,ix);o.addEventListener(cv,l),o.dispatchEvent(y),y.defaultPrevented||(kz(Rz(Gk(o)),{select:!0}),document.activeElement===m&&Li(o))}return()=>{o.removeEventListener(cv,l),setTimeout(()=>{const y=new CustomEvent(uv,ix);o.addEventListener(uv,a),o.dispatchEvent(y),y.defaultPrevented||Li(m??document.body,{select:!0}),o.removeEventListener(uv,a),ax.remove(p)},0)}}},[o,l,a,p]);const v=D.useCallback(m=>{if(!n&&!r||p.paused)return;const b=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(b&&y){const _=m.currentTarget,[S,C]=Tz(_);S&&C?!m.shiftKey&&y===C?(m.preventDefault(),n&&Li(S,{select:!0})):m.shiftKey&&y===S&&(m.preventDefault(),n&&Li(C,{select:!0})):y===_&&m.preventDefault()}},[n,r,p.paused]);return J.jsx(lr.div,{tabIndex:-1,...i,ref:f,onKeyDown:v})});Wk.displayName=jz;function kz(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function Tz(t){const e=Gk(t),n=ox(e,t),r=ox(e.reverse(),t);return[n,r]}function Gk(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function ox(t,e){for(const n of t)if(!Oz(n,{upTo:e}))return n}function Oz(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Az(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Az(t)&&e&&t.select()}}var ax=Iz();function Iz(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=lx(t,e),t.unshift(e)},remove(e){var n;t=lx(t,e),(n=t[0])==null||n.resume()}}}function lx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Rz(t){return t.filter(e=>e.tagName!=="A")}var Nz=vx[" useId ".trim().toString()]||(()=>{}),Lz=0;function qv(t){const[e,n]=D.useState(Nz());return Mo(()=>{n(r=>r??String(Lz++))},[t]),t||(e?`radix-${e}`:"")}var Dz="Arrow",Zk=D.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...c}=t;return J.jsx(lr.svg,{...c,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:J.jsx("polygon",{points:"0,0 30,0 15,10"})})});Zk.displayName=Dz;var Mz=Zk;function Pz(t){const[e,n]=D.useState(void 0);return Mo(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let i,o;if("borderBoxSize"in c){const u=c.borderBoxSize,l=Array.isArray(u)?u[0]:u;i=l.inlineSize,o=l.blockSize}else i=t.offsetWidth,o=t.offsetHeight;n({width:i,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var F0="Popper",[Yk,Kk]=fu(F0),[$z,Xk]=Yk(F0),qk=t=>{const{__scopePopper:e,children:n}=t,[r,s]=D.useState(null);return J.jsx($z,{scope:e,anchor:r,onAnchorChange:s,children:n})};qk.displayName=F0;var Jk="PopperAnchor",Qk=D.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,c=Xk(Jk,n),i=D.useRef(null),o=sr(e,i);return D.useEffect(()=>{c.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:J.jsx(lr.div,{...s,ref:o})});Qk.displayName=Jk;var V0="PopperContent",[Bz,Uz]=Yk(V0),e5=D.forwardRef((t,e)=>{var V,ce,oe,xe,he,Pe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:c="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:a=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=t,b=Xk(V0,n),[y,_]=D.useState(null),S=sr(e,Ie=>_(Ie)),[C,x]=D.useState(null),j=Pz(C),k=(j==null?void 0:j.width)??0,T=(j==null?void 0:j.height)??0,A=r+(c!=="center"?"-"+c:""),L=typeof a=="number"?a:{top:0,right:0,bottom:0,left:0,...a},N=Array.isArray(l)?l:[l],M=N.length>0,F={padding:L,boundary:N.filter(Vz),altBoundary:M},{refs:Z,floatingStyles:Y,placement:X,isPositioned:Q,middlewareData:$}=pC({strategy:"fixed",placement:A,whileElementsMounted:(...Ie)=>hC(...Ie,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[mC({mainAxis:s+T,alignmentAxis:i}),u&&vC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?gC():void 0,...F}),u&&bC({...F}),yC({...F,apply:({elements:Ie,rects:Ye,availableWidth:be,availableHeight:je})=>{const{width:ie,height:se}=Ye.reference,ue=Ie.floating.style;ue.setProperty("--radix-popper-available-width",`${be}px`),ue.setProperty("--radix-popper-available-height",`${je}px`),ue.setProperty("--radix-popper-anchor-width",`${ie}px`),ue.setProperty("--radix-popper-anchor-height",`${se}px`)}}),C&&wC({element:C,padding:o}),zz({arrowWidth:k,arrowHeight:T}),f&&_C({strategy:"referenceHidden",...F})]}),[U,I]=r5(X),W=ii(v);Mo(()=>{Q&&(W==null||W())},[Q,W]);const G=(V=$.arrow)==null?void 0:V.x,B=(ce=$.arrow)==null?void 0:ce.y,ee=((oe=$.arrow)==null?void 0:oe.centerOffset)!==0,[re,K]=D.useState();return Mo(()=>{y&&K(window.getComputedStyle(y).zIndex)},[y]),J.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:Q?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(xe=$.transformOrigin)==null?void 0:xe.x,(he=$.transformOrigin)==null?void 0:he.y].join(" "),...((Pe=$.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:J.jsx(Bz,{scope:n,placedSide:U,onArrowChange:x,arrowX:G,arrowY:B,shouldHideArrow:ee,children:J.jsx(lr.div,{"data-side":U,"data-align":I,...m,ref:S,style:{...m.style,animation:Q?void 0:"none"}})})})});e5.displayName=V0;var t5="PopperArrow",Fz={top:"bottom",right:"left",bottom:"top",left:"right"},n5=D.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,c=Uz(t5,r),i=Fz[c.placedSide];return J.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:J.jsx(Mz,{...s,ref:n,style:{...s.style,display:"block"}})})});n5.displayName=t5;function Vz(t){return t!==null}var zz=t=>({name:"transformOrigin",options:t,fn(e){var b,y,_;const{placement:n,rects:r,middlewareData:s}=e,i=((b=s.arrow)==null?void 0:b.centerOffset)!==0,o=i?0:t.arrowWidth,u=i?0:t.arrowHeight,[l,a]=r5(n),d={start:"0%",center:"50%",end:"100%"}[a],f=(((y=s.arrow)==null?void 0:y.x)??0)+o/2,p=(((_=s.arrow)==null?void 0:_.y)??0)+u/2;let v="",m="";return l==="bottom"?(v=i?d:`${f}px`,m=`${-u}px`):l==="top"?(v=i?d:`${f}px`,m=`${r.floating.height+u}px`):l==="right"?(v=`${-u}px`,m=i?d:`${p}px`):l==="left"&&(v=`${r.floating.width+u}px`,m=i?d:`${p}px`),{data:{x:v,y:m}}}});function r5(t){const[e,n="center"]=t.split("-");return[e,n]}var Hz=qk,Wz=Qk,Gz=e5,Zz=n5;function Yz(t,e){return D.useReducer((n,r)=>e[n][r]??n,t)}var af=t=>{const{present:e,children:n}=t,r=Kz(e),s=typeof n=="function"?n({present:r.isPresent}):D.Children.only(n),c=sr(r.ref,Xz(s));return typeof n=="function"||r.isPresent?D.cloneElement(s,{ref:c}):null};af.displayName="Presence";function Kz(t){const[e,n]=D.useState(),r=D.useRef(null),s=D.useRef(t),c=D.useRef("none"),i=t?"mounted":"unmounted",[o,u]=Yz(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=$d(r.current);c.current=o==="mounted"?l:"none"},[o]),Mo(()=>{const l=r.current,a=s.current;if(a!==t){const f=c.current,p=$d(l);t?u("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(a&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),Mo(()=>{if(e){let l;const a=e.ownerDocument.defaultView??window,d=p=>{const m=$d(r.current).includes(p.animationName);if(p.target===e&&m&&(u("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",l=a.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},f=p=>{p.target===e&&(c.current=$d(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{a.clearTimeout(l),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:D.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $d(t){return(t==null?void 0:t.animationName)||"none"}function Xz(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var dv="rovingFocusGroup.onEntryFocus",qz={bubbles:!1,cancelable:!0},pu="RovingFocusGroup",[Jv,s5,Jz]=Uk(pu),[Qz,i5]=fu(pu,[Jz]),[eH,tH]=Qz(pu),o5=D.forwardRef((t,e)=>J.jsx(Jv.Provider,{scope:t.__scopeRovingFocusGroup,children:J.jsx(Jv.Slot,{scope:t.__scopeRovingFocusGroup,children:J.jsx(nH,{...t,ref:e})})}));o5.displayName=pu;var nH=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:c,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:a=!1,...d}=t,f=D.useRef(null),p=sr(e,f),v=Fk(c),[m,b]=$k({prop:i,defaultProp:o??null,onChange:u,caller:pu}),[y,_]=D.useState(!1),S=ii(l),C=s5(n),x=D.useRef(!1),[j,k]=D.useState(0);return D.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(dv,S),()=>T.removeEventListener(dv,S)},[S]),J.jsx(eH,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:m,onItemFocus:D.useCallback(T=>b(T),[b]),onItemShiftTab:D.useCallback(()=>_(!0),[]),onFocusableItemAdd:D.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:D.useCallback(()=>k(T=>T-1),[]),children:J.jsx(lr.div,{tabIndex:y||j===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Ct(t.onMouseDown,()=>{x.current=!0}),onFocus:Ct(t.onFocus,T=>{const A=!x.current;if(T.target===T.currentTarget&&A&&!y){const L=new CustomEvent(dv,qz);if(T.currentTarget.dispatchEvent(L),!L.defaultPrevented){const N=C().filter(X=>X.focusable),M=N.find(X=>X.active),F=N.find(X=>X.id===m),Y=[M,F,...N].filter(Boolean).map(X=>X.ref.current);c5(Y,a)}}x.current=!1}),onBlur:Ct(t.onBlur,()=>_(!1))})})}),a5="RovingFocusGroupItem",l5=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:c,children:i,...o}=t,u=qv(),l=c||u,a=tH(a5,n),d=a.currentTabStopId===l,f=s5(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:m}=a;return D.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),J.jsx(Jv.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:J.jsx(lr.span,{tabIndex:d?0:-1,"data-orientation":a.orientation,...o,ref:e,onMouseDown:Ct(t.onMouseDown,b=>{r?a.onItemFocus(l):b.preventDefault()}),onFocus:Ct(t.onFocus,()=>a.onItemFocus(l)),onKeyDown:Ct(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){a.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=iH(b,a.orientation,a.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let S=f().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const C=S.indexOf(b.currentTarget);S=a.loop?oH(S,C+1):S.slice(C+1)}setTimeout(()=>c5(S))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});l5.displayName=a5;var rH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sH(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function iH(t,e,n){const r=sH(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rH[r]}function c5(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function oH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var aH=o5,lH=l5,Qv=["Enter"," "],cH=["ArrowDown","PageUp","Home"],u5=["ArrowUp","PageDown","End"],uH=[...cH,...u5],dH={ltr:[...Qv,"ArrowRight"],rtl:[...Qv,"ArrowLeft"]},hH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mu="Menu",[Zc,fH,pH]=Uk(mu),[$o,d5]=fu(mu,[pH,Kk,i5]),lf=Kk(),h5=i5(),[mH,nl]=$o(mu),[vH,vu]=$o(mu),f5=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:c,modal:i=!0}=t,o=lf(e),[u,l]=D.useState(null),a=D.useRef(!1),d=ii(c),f=Fk(s);return D.useEffect(()=>{const p=()=>{a.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>a.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),J.jsx(Hz,{...o,children:J.jsx(mH,{scope:e,open:n,onOpenChange:d,content:u,onContentChange:l,children:J.jsx(vH,{scope:e,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:a,dir:f,modal:i,children:r})})})};f5.displayName=mu;var gH="MenuAnchor",z0=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=lf(n);return J.jsx(Wz,{...s,...r,ref:e})});z0.displayName=gH;var bH="MenuPortal",[KW,p5]=$o(bH,{forceMount:void 0}),Pr="MenuContent",[yH,H0]=$o(Pr),m5=D.forwardRef((t,e)=>{const n=p5(Pr,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,c=nl(Pr,t.__scopeMenu),i=vu(Pr,t.__scopeMenu);return J.jsx(Zc.Provider,{scope:t.__scopeMenu,children:J.jsx(af,{present:r||c.open,children:J.jsx(Zc.Slot,{scope:t.__scopeMenu,children:i.modal?J.jsx(_H,{...s,ref:e}):J.jsx(wH,{...s,ref:e})})})})}),_H=D.forwardRef((t,e)=>{const n=nl(Pr,t.__scopeMenu),r=D.useRef(null),s=sr(e,r);return D.useEffect(()=>{const c=r.current;if(c)return _6(c)},[]),J.jsx(W0,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ct(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),wH=D.forwardRef((t,e)=>{const n=nl(Pr,t.__scopeMenu);return J.jsx(W0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),SH=bh("MenuContent.ScrollLock"),W0=D.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:v,...m}=t,b=nl(Pr,n),y=vu(Pr,n),_=lf(n),S=h5(n),C=fH(n),[x,j]=D.useState(null),k=D.useRef(null),T=sr(e,k,b.onContentChange),A=D.useRef(0),L=D.useRef(""),N=D.useRef(0),M=D.useRef(null),F=D.useRef("right"),Z=D.useRef(0),Y=v?Yx:D.Fragment,X=v?{as:SH,allowPinchZoom:!0}:void 0,Q=U=>{var V,ce;const I=L.current+U,W=C().filter(oe=>!oe.disabled),G=document.activeElement,B=(V=W.find(oe=>oe.ref.current===G))==null?void 0:V.textValue,ee=W.map(oe=>oe.textValue),re=LH(ee,I,B),K=(ce=W.find(oe=>oe.textValue===re))==null?void 0:ce.ref.current;(function oe(xe){L.current=xe,window.clearTimeout(A.current),xe!==""&&(A.current=window.setTimeout(()=>oe(""),1e3))})(I),K&&setTimeout(()=>K.focus())};D.useEffect(()=>()=>window.clearTimeout(A.current),[]),Ez();const $=D.useCallback(U=>{var W,G;return F.current===((W=M.current)==null?void 0:W.side)&&MH(U,(G=M.current)==null?void 0:G.area)},[]);return J.jsx(yH,{scope:n,searchRef:L,onItemEnter:D.useCallback(U=>{$(U)&&U.preventDefault()},[$]),onItemLeave:D.useCallback(U=>{var I;$(U)||((I=k.current)==null||I.focus(),j(null))},[$]),onTriggerLeave:D.useCallback(U=>{$(U)&&U.preventDefault()},[$]),pointerGraceTimerRef:N,onPointerGraceIntentChange:D.useCallback(U=>{M.current=U},[]),children:J.jsx(Y,{...X,children:J.jsx(Wk,{asChild:!0,trapped:s,onMountAutoFocus:Ct(c,U=>{var I;U.preventDefault(),(I=k.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:J.jsx(zk,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:J.jsx(aH,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:j,onEntryFocus:Ct(u,U=>{y.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:J.jsx(Gz,{role:"menu","aria-orientation":"vertical","data-state":I5(b.open),"data-radix-menu-content":"",dir:y.dir,..._,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:Ct(m.onKeyDown,U=>{const W=U.target.closest("[data-radix-menu-content]")===U.currentTarget,G=U.ctrlKey||U.altKey||U.metaKey,B=U.key.length===1;W&&(U.key==="Tab"&&U.preventDefault(),!G&&B&&Q(U.key));const ee=k.current;if(U.target!==ee||!uH.includes(U.key))return;U.preventDefault();const K=C().filter(V=>!V.disabled).map(V=>V.ref.current);u5.includes(U.key)&&K.reverse(),RH(K)}),onBlur:Ct(t.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:Ct(t.onPointerMove,Yc(U=>{const I=U.target,W=Z.current!==U.clientX;if(U.currentTarget.contains(I)&&W){const G=U.clientX>Z.current?"right":"left";F.current=G,Z.current=U.clientX}}))})})})})})})});m5.displayName=Pr;var xH="MenuGroup",G0=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return J.jsx(lr.div,{role:"group",...r,ref:e})});G0.displayName=xH;var CH="MenuLabel",v5=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return J.jsx(lr.div,{...r,ref:e})});v5.displayName=CH;var yh="MenuItem",cx="menu.itemSelect",cf=D.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,c=D.useRef(null),i=vu(yh,t.__scopeMenu),o=H0(yh,t.__scopeMenu),u=sr(e,c),l=D.useRef(!1),a=()=>{const d=c.current;if(!n&&d){const f=new CustomEvent(cx,{bubbles:!0,cancelable:!0});d.addEventListener(cx,p=>r==null?void 0:r(p),{once:!0}),Bk(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return J.jsx(g5,{...s,ref:u,disabled:n,onClick:Ct(t.onClick,a),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),l.current=!0},onPointerUp:Ct(t.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Ct(t.onKeyDown,d=>{const f=o.searchRef.current!=="";n||f&&d.key===" "||Qv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});cf.displayName=yh;var g5=D.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...c}=t,i=H0(yh,n),o=h5(n),u=D.useRef(null),l=sr(e,u),[a,d]=D.useState(!1),[f,p]=D.useState("");return D.useEffect(()=>{const v=u.current;v&&p((v.textContent??"").trim())},[c.children]),J.jsx(Zc.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:J.jsx(lH,{asChild:!0,...o,focusable:!r,children:J.jsx(lr.div,{role:"menuitem","data-highlighted":a?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...c,ref:l,onPointerMove:Ct(t.onPointerMove,Yc(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ct(t.onPointerLeave,Yc(v=>i.onItemLeave(v))),onFocus:Ct(t.onFocus,()=>d(!0)),onBlur:Ct(t.onBlur,()=>d(!1))})})})}),EH="MenuCheckboxItem",b5=D.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return J.jsx(x5,{scope:t.__scopeMenu,checked:n,children:J.jsx(cf,{role:"menuitemcheckbox","aria-checked":_h(n)?"mixed":n,...s,ref:e,"data-state":Y0(n),onSelect:Ct(s.onSelect,()=>r==null?void 0:r(_h(n)?!0:!n),{checkForDefaultPrevented:!1})})})});b5.displayName=EH;var y5="MenuRadioGroup",[jH,kH]=$o(y5,{value:void 0,onValueChange:()=>{}}),_5=D.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,c=ii(r);return J.jsx(jH,{scope:t.__scopeMenu,value:n,onValueChange:c,children:J.jsx(G0,{...s,ref:e})})});_5.displayName=y5;var w5="MenuRadioItem",S5=D.forwardRef((t,e)=>{const{value:n,...r}=t,s=kH(w5,t.__scopeMenu),c=n===s.value;return J.jsx(x5,{scope:t.__scopeMenu,checked:c,children:J.jsx(cf,{role:"menuitemradio","aria-checked":c,...r,ref:e,"data-state":Y0(c),onSelect:Ct(r.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,n)},{checkForDefaultPrevented:!1})})})});S5.displayName=w5;var Z0="MenuItemIndicator",[x5,TH]=$o(Z0,{checked:!1}),C5=D.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,c=TH(Z0,n);return J.jsx(af,{present:r||_h(c.checked)||c.checked===!0,children:J.jsx(lr.span,{...s,ref:e,"data-state":Y0(c.checked)})})});C5.displayName=Z0;var OH="MenuSeparator",E5=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return J.jsx(lr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});E5.displayName=OH;var AH="MenuArrow",j5=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=lf(n);return J.jsx(Zz,{...s,...r,ref:e})});j5.displayName=AH;var IH="MenuSub",[XW,k5]=$o(IH),mc="MenuSubTrigger",T5=D.forwardRef((t,e)=>{const n=nl(mc,t.__scopeMenu),r=vu(mc,t.__scopeMenu),s=k5(mc,t.__scopeMenu),c=H0(mc,t.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:u}=c,l={__scopeMenu:t.__scopeMenu},a=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>a,[a]),D.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),u(null)}},[o,u]),J.jsx(z0,{asChild:!0,...l,children:J.jsx(g5,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":I5(n.open),...t,ref:of(e,s.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ct(t.onPointerMove,Yc(d=>{c.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!i.current&&(c.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),a()},100))})),onPointerLeave:Ct(t.onPointerLeave,Yc(d=>{var p,v;a();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const m=(v=n.content)==null?void 0:v.dataset.side,b=m==="right",y=b?-5:5,_=f[b?"left":"right"],S=f[b?"right":"left"];c.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:_,y:f.top},{x:S,y:f.top},{x:S,y:f.bottom},{x:_,y:f.bottom}],side:m}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(d),d.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Ct(t.onKeyDown,d=>{var p;const f=c.searchRef.current!=="";t.disabled||f&&d.key===" "||dH[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});T5.displayName=mc;var O5="MenuSubContent",A5=D.forwardRef((t,e)=>{const n=p5(Pr,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,c=nl(Pr,t.__scopeMenu),i=vu(Pr,t.__scopeMenu),o=k5(O5,t.__scopeMenu),u=D.useRef(null),l=sr(e,u);return J.jsx(Zc.Provider,{scope:t.__scopeMenu,children:J.jsx(af,{present:r||c.open,children:J.jsx(Zc.Slot,{scope:t.__scopeMenu,children:J.jsx(W0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{var d;i.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:Ct(t.onFocusOutside,a=>{a.target!==o.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Ct(t.onEscapeKeyDown,a=>{i.onClose(),a.preventDefault()}),onKeyDown:Ct(t.onKeyDown,a=>{var p;const d=a.currentTarget.contains(a.target),f=hH[i.dir].includes(a.key);d&&f&&(c.onOpenChange(!1),(p=o.trigger)==null||p.focus(),a.preventDefault())})})})})})});A5.displayName=O5;function I5(t){return t?"open":"closed"}function _h(t){return t==="indeterminate"}function Y0(t){return _h(t)?"indeterminate":t?"checked":"unchecked"}function RH(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function NH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function LH(t,e,n){const s=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,c=n?t.indexOf(n):-1;let i=NH(t,Math.max(c,0));s.length===1&&(i=i.filter(l=>l!==n));const u=i.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function DH(t,e){const{x:n,y:r}=t;let s=!1;for(let c=0,i=e.length-1;c<e.length;i=c++){const o=e[c],u=e[i],l=o.x,a=o.y,d=u.x,f=u.y;a>r!=f>r&&n<(d-l)*(r-a)/(f-a)+l&&(s=!s)}return s}function MH(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return DH(n,e)}function Yc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var PH=f5,$H=z0,BH=m5,UH=G0,FH=v5,VH=cf,zH=b5,HH=_5,WH=S5,GH=C5,ZH=E5,YH=j5,KH=T5,XH=A5,uf="DropdownMenu",[qH,qW]=fu(uf,[d5]),cr=d5(),[JH,R5]=qH(uf),N5=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:c,onOpenChange:i,modal:o=!0}=t,u=cr(e),l=D.useRef(null),[a,d]=$k({prop:s,defaultProp:c??!1,onChange:i,caller:uf});return J.jsx(JH,{scope:e,triggerId:qv(),triggerRef:l,contentId:qv(),open:a,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:o,children:J.jsx(PH,{...u,open:a,onOpenChange:d,dir:r,modal:o,children:n})})};N5.displayName=uf;var L5="DropdownMenuTrigger",D5=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,c=R5(L5,n),i=cr(n);return J.jsx($H,{asChild:!0,...i,children:J.jsx(lr.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:of(e,c.triggerRef),onPointerDown:Ct(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(c.onOpenToggle(),c.open||o.preventDefault())}),onKeyDown:Ct(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&c.onOpenToggle(),o.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});D5.displayName=L5;var M5="DropdownMenuContent",P5=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=R5(M5,n),c=cr(n),i=D.useRef(!1);return J.jsx(BH,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...r,ref:e,onCloseAutoFocus:Ct(t.onCloseAutoFocus,o=>{var u;i.current||(u=s.triggerRef.current)==null||u.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:Ct(t.onInteractOutside,o=>{const u=o.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,a=u.button===2||l;(!s.modal||a)&&(i.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});P5.displayName=M5;var QH="DropdownMenuGroup",eW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(UH,{...s,...r,ref:e})});eW.displayName=QH;var tW="DropdownMenuLabel",nW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(FH,{...s,...r,ref:e})});nW.displayName=tW;var rW="DropdownMenuItem",$5=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(VH,{...s,...r,ref:e})});$5.displayName=rW;var sW="DropdownMenuCheckboxItem",iW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(zH,{...s,...r,ref:e})});iW.displayName=sW;var oW="DropdownMenuRadioGroup",aW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(HH,{...s,...r,ref:e})});aW.displayName=oW;var lW="DropdownMenuRadioItem",cW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(WH,{...s,...r,ref:e})});cW.displayName=lW;var uW="DropdownMenuItemIndicator",dW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(GH,{...s,...r,ref:e})});dW.displayName=uW;var hW="DropdownMenuSeparator",fW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(ZH,{...s,...r,ref:e})});fW.displayName=hW;var pW="DropdownMenuArrow",mW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(YH,{...s,...r,ref:e})});mW.displayName=pW;var vW="DropdownMenuSubTrigger",gW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(KH,{...s,...r,ref:e})});gW.displayName=vW;var bW="DropdownMenuSubContent",yW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(XH,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yW.displayName=bW;var _W=N5,wW=D5,SW=P5,xW=$5;function CW(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,c;for(c=0;c<r.length;c++)s=r[c],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}var EW=["color"],jW=D.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,s=CW(t,EW);return D.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:e}),D.createElement("path",{d:"M7.5 0.875C5.49797 0.875 3.875 2.49797 3.875 4.5C3.875 6.15288 4.98124 7.54738 6.49373 7.98351C5.2997 8.12901 4.27557 8.55134 3.50407 9.31167C2.52216 10.2794 2.02502 11.72 2.02502 13.5999C2.02502 13.8623 2.23769 14.0749 2.50002 14.0749C2.76236 14.0749 2.97502 13.8623 2.97502 13.5999C2.97502 11.8799 3.42786 10.7206 4.17091 9.9883C4.91536 9.25463 6.02674 8.87499 7.49995 8.87499C8.97317 8.87499 10.0846 9.25463 10.8291 9.98831C11.5721 10.7206 12.025 11.8799 12.025 13.5999C12.025 13.8623 12.2376 14.0749 12.5 14.0749C12.7623 14.075 12.975 13.8623 12.975 13.6C12.975 11.72 12.4778 10.2794 11.4959 9.31166C10.7244 8.55135 9.70025 8.12903 8.50625 7.98352C10.0187 7.5474 11.125 6.15289 11.125 4.5C11.125 2.49797 9.50203 0.875 7.5 0.875ZM4.825 4.5C4.825 3.02264 6.02264 1.825 7.5 1.825C8.97736 1.825 10.175 3.02264 10.175 4.5C10.175 5.97736 8.97736 7.175 7.5 7.175C6.02264 7.175 4.825 5.97736 4.825 4.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});class vc extends Error{}vc.prototype.name="InvalidTokenError";function kW(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function TW(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return kW(e)}catch{return atob(e)}}function OW(t,e){if(typeof t!="string")throw new vc("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new vc(`Invalid token specified: missing part #${n+1}`);let s;try{s=TW(r)}catch(c){throw new vc(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(s)}catch(c){throw new vc(`Invalid token specified: invalid json for part #${n+1} (${c.message})`)}}var hv={exports:{}},fv={exports:{}},ux;function AW(){return ux||(ux=1,function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(n,r){return n<<r|n>>>32-r},rotr:function(n,r){return n<<32-r|n>>>r},endian:function(n){if(n.constructor==Number)return e.rotl(n,8)&16711935|e.rotl(n,24)&4278255360;for(var r=0;r<n.length;r++)n[r]=e.endian(n[r]);return n},randomBytes:function(n){for(var r=[];n>0;n--)r.push(Math.floor(Math.random()*256));return r},bytesToWords:function(n){for(var r=[],s=0,c=0;s<n.length;s++,c+=8)r[c>>>5]|=n[s]<<24-c%32;return r},wordsToBytes:function(n){for(var r=[],s=0;s<n.length*32;s+=8)r.push(n[s>>>5]>>>24-s%32&255);return r},bytesToHex:function(n){for(var r=[],s=0;s<n.length;s++)r.push((n[s]>>>4).toString(16)),r.push((n[s]&15).toString(16));return r.join("")},hexToBytes:function(n){for(var r=[],s=0;s<n.length;s+=2)r.push(parseInt(n.substr(s,2),16));return r},bytesToBase64:function(n){for(var r=[],s=0;s<n.length;s+=3)for(var c=n[s]<<16|n[s+1]<<8|n[s+2],i=0;i<4;i++)s*8+i*6<=n.length*8?r.push(t.charAt(c>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var r=[],s=0,c=0;s<n.length;c=++s%4)c!=0&&r.push((t.indexOf(n.charAt(s-1))&Math.pow(2,-2*c+8)-1)<<c*2|t.indexOf(n.charAt(s))>>>6-c*2);return r}};fv.exports=e}()),fv.exports}var pv,dx;function hx(){if(dx)return pv;dx=1;var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],r=0;r<e.length;r++)n.push(e.charCodeAt(r)&255);return n},bytesToString:function(e){for(var n=[],r=0;r<e.length;r++)n.push(String.fromCharCode(e[r]));return n.join("")}}};return pv=t,pv}/*!
6671
+ `},s),c}function wV(t,e){return t&&"run"in t?async function(n,r){const s=z2(n,{file:r,...e});await t.run(s,r)}:function(n,r){return z2(n,{file:r,...t||e})}}function H2(t){if(t)throw t}var ev,W2;function SV(){if(W2)return ev;W2=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},c=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var a=t.call(l,"constructor"),d=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!a&&!d)return!1;var f;for(f in l);return typeof f>"u"||t.call(l,f)},i=function(l,a){n&&a.name==="__proto__"?n(l,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):l[a.name]=a.newValue},o=function(l,a){if(a==="__proto__")if(t.call(l,a)){if(r)return r(l,a).value}else return;return l[a]};return ev=function u(){var l,a,d,f,p,v,m=arguments[0],b=1,y=arguments.length,_=!1;for(typeof m=="boolean"&&(_=m,m=arguments[1]||{},b=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});b<y;++b)if(l=arguments[b],l!=null)for(a in l)d=o(m,a),f=o(l,a),m!==f&&(_&&f&&(c(f)||(p=s(f)))?(p?(p=!1,v=d&&s(d)?d:[]):v=d&&c(d)?d:{},i(m,{name:a,newValue:u(_,v,f)})):typeof f<"u"&&i(m,{name:a,newValue:f}));return m},ev}var xV=SV();const tv=Kc(xV);function Zv(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function CV(){const t=[],e={run:n,use:r};return e;function n(...s){let c=-1;const i=s.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);o(null,...s);function o(u,...l){const a=t[++c];let d=-1;if(u){i(u);return}for(;++d<s.length;)(l[d]===null||l[d]===void 0)&&(l[d]=s[d]);s=l,a?EV(a,o)(...l):i(null,...l)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function EV(t,e){let n;return r;function r(...i){const o=t.length>i.length;let u;o&&i.push(s);try{u=t.apply(this,i)}catch(l){const a=l;if(o&&n)throw a;return s(a)}o||(u&&u.then&&typeof u.then=="function"?u.then(c,s):u instanceof Error?s(u):c(u))}function s(i,...o){n||(n=!0,e(i,...o))}function c(i){s(null,i)}}const ms={basename:jV,dirname:kV,extname:TV,join:OV,sep:"/"};function jV(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');hu(t);let n=0,r=-1,s=t.length,c;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(c){n=s+1;break}}else r<0&&(c=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let i=-1,o=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(c){n=s+1;break}}else i<0&&(c=!0,i=s+1),o>-1&&(t.codePointAt(s)===e.codePointAt(o--)?o<0&&(r=s):(o=-1,r=i));return n===r?r=i:r<0&&(r=t.length),t.slice(n,r)}function kV(t){if(hu(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function TV(t){hu(t);let e=t.length,n=-1,r=0,s=-1,c=0,i;for(;e--;){const o=t.codePointAt(e);if(o===47){if(i){r=e+1;break}continue}n<0&&(i=!0,n=e+1),o===46?s<0?s=e:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||n<0||c===0||c===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function OV(...t){let e=-1,n;for(;++e<t.length;)hu(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":AV(n)}function AV(t){hu(t);const e=t.codePointAt(0)===47;let n=IV(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function IV(t,e){let n="",r=0,s=-1,c=0,i=-1,o,u;for(;++i<=t.length;){if(i<t.length)o=t.codePointAt(i);else{if(o===47)break;o=47}if(o===47){if(!(s===i-1||c===1))if(s!==i-1&&c===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),s=i,c=0;continue}}else if(n.length>0){n="",r=0,s=i,c=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,i):n=t.slice(s+1,i),r=i-s-1;s=i,c=0}else o===46&&c>-1?c++:c=-1}return n}function hu(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const RV={cwd:NV};function NV(){return"/"}function Yv(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function LV(t){if(typeof t=="string")t=new URL(t);else if(!Yv(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return DV(t)}function DV(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const nv=["history","path","basename","stem","extname","dirname"];class Mk{constructor(e){let n;e?Yv(e)?n={path:e}:typeof e=="string"||MV(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":RV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nv.length;){const c=nv[r];c in n&&n[c]!==void 0&&n[c]!==null&&(this[c]=c==="history"?[...n[c]]:n[c])}let s;for(s in n)nv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ms.basename(this.path):void 0}set basename(e){sv(e,"basename"),rv(e,"basename"),this.path=ms.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ms.dirname(this.path):void 0}set dirname(e){G2(this.basename,"dirname"),this.path=ms.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ms.extname(this.path):void 0}set extname(e){if(rv(e,"extname"),G2(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ms.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Yv(e)&&(e=LV(e)),sv(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ms.basename(this.path,this.extname):void 0}set stem(e){sv(e,"stem"),rv(e,"stem"),this.path=ms.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new Bn(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function rv(t,e){if(t&&t.includes(ms.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ms.sep+"`")}function sv(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function G2(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function MV(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const PV=function(t){const r=this.constructor.prototype,s=r[t],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,r),c},$V={}.hasOwnProperty;class U0 extends PV{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CV()}copy(){const e=new U0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(tv(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(av("data",this.frozen),this.namespace[e]=n,this):$V.call(this.namespace,e)&&this.namespace[e]||void 0:e?(av("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Pd(e),r=this.parser||this.Parser;return iv("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),iv("process",this.parser||this.Parser),ov("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(c,i){const o=Pd(e),u=r.parse(o);r.run(u,o,function(a,d,f){if(a||!d||!f)return l(a);const p=d,v=r.stringify(p,f);FV(v)?f.value=v:f.result=v,l(a,f)});function l(a,d){a||!d?i(a):c?c(d):n(void 0,d)}}}processSync(e){let n=!1,r;return this.freeze(),iv("processSync",this.parser||this.Parser),ov("processSync",this.compiler||this.Compiler),this.process(e,s),Y2("processSync","process",n),r;function s(c,i){n=!0,H2(c),r=i}}run(e,n,r){Z2(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?c(void 0,r):new Promise(c);function c(i,o){const u=Pd(n);s.run(e,u,l);function l(a,d,f){const p=d||e;a?o(a):i?i(p):r(void 0,p,f)}}}runSync(e,n){let r=!1,s;return this.run(e,n,c),Y2("runSync","run",r),s;function c(i,o){H2(i),s=o,r=!0}}stringify(e,n){this.freeze();const r=Pd(n),s=this.compiler||this.Compiler;return ov("stringify",s),Z2(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if(av("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):i(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function c(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[a,...d]=l;u(a,d)}else i(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function i(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(l.plugins),l.settings&&(s.settings=tv(!0,s.settings,l.settings))}function o(l){let a=-1;if(l!=null)if(Array.isArray(l))for(;++a<l.length;){const d=l[a];c(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,a){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===l){f=d;break}if(f===-1)r.push([l,...a]);else if(a.length>0){let[p,...v]=a;const m=r[f][1];Zv(m)&&Zv(p)&&(p=tv(!0,m,p)),r[f]=[l,p,...v]}}}}const BV=new U0().freeze();function iv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ov(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function av(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Z2(t){if(!Zv(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Y2(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Pd(t){return UV(t)?t:new Mk(t)}function UV(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function FV(t){return typeof t=="string"||VV(t)}function VV(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const zV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",K2=[],X2={allowDangerousHtml:!0},HV=/^(https?|ircs?|mailto|xmpp)$/i,WV=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function GV(t){const e=ZV(t),n=YV(t);return KV(e.runSync(e.parse(n),n),t)}function ZV(t){const e=t.rehypePlugins||K2,n=t.remarkPlugins||K2,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...X2}:X2;return BV().use(jF).use(n).use(wV,r).use(e)}function YV(t){const e=t.children||"",n=new Mk;return typeof e=="string"&&(n.value=e),n}function KV(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,c=e.disallowedElements,i=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||XV;for(const a of WV)Object.hasOwn(e,a.from)&&(""+a.from+(a.to?"use `"+a.to+"` instead":"remove it")+zV+a.id,void 0);return Dk(t,l),iB(t,{Fragment:J.Fragment,components:s,ignoreInvalidStyle:!0,jsx:J.jsx,jsxs:J.jsxs,passKeys:!0,passNode:!0});function l(a,d,f){if(a.type==="raw"&&f&&typeof d=="number")return i?f.children.splice(d,1):f.children[d]={type:"text",value:a.value},d;if(a.type==="element"){let p;for(p in qm)if(Object.hasOwn(qm,p)&&Object.hasOwn(a.properties,p)){const v=a.properties[p],m=qm[p];(m===null||m.includes(a.tagName))&&(a.properties[p]=u(String(v||""),p,a))}}if(a.type==="element"){let p=n?!n.includes(a.tagName):c?c.includes(a.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(a,d,f)),p&&f&&typeof d=="number")return o&&a.children?f.children.splice(d,1,...a.children):f.children.splice(d,1),d}}}function XV(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||HV.test(t.slice(0,e))?t:""}const Pk=({role:t,children:e})=>{const n=t===si.USER?"self-end":"self-start",r=t===si.USER?"indigo":"gray";return J.jsx(Lh,{highContrast:!0,color:r,className:`${n} max-w-[80%] break-words m-1`,children:J.jsx(Rc,{children:e})})},qV=({block:t})=>J.jsx(Pk,{role:si.USER,children:t.contents}),JV=({block:t})=>J.jsx(Pk,{role:si.ASSISTANT,children:J.jsx(GV,{components:{code:({children:e,...n})=>J.jsx("pre",{className:"whitespace-pre-wrap",children:J.jsx("code",{...n,children:String(e).replace(/\n$/,"")})})},children:t.contents})}),QV=D.memo(({block:t,isRecentCodeBlock:e,onClick:n})=>{var l,a;const{runCodeBlock:r}=Xi(),{settings:s}=es(),c=((a=(l=t.contents)==null?void 0:l.split(/&&|;|\n|\\n/)[0])==null?void 0:a.substring(0,50))||"",i=()=>{n?n():r(t)},o=s.webApp.invertedOrder?"justify-end":"justify-start",u=J.jsx("span",{className:"text-xs text-gray-400 p-2",children:"Press CTRL+ENTER to run"});return J.jsxs("div",{className:`flex ${o} items-center h-full`,children:[e&&s.webApp.invertedOrder&&u,J.jsxs("div",{className:"flex items-center m-1 p-2 bg-[#1e1e1e] rounded-md max-w-[60%] cursor-pointer",onClick:i,children:[J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:J.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),J.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-1",children:[J.jsx("polyline",{points:"4 17 10 11 4 5"}),J.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),J.jsx("span",{className:"text-sm text-[#d4d4d4] italic truncate max-w-4/5",children:c})]}),e&&!s.webApp.invertedOrder&&u]})},(t,e)=>t.block.id===e.block.id&&JSON.stringify(t.block.contents)===JSON.stringify(e.block.contents)&&t.isRecentCodeBlock===e.isRecentCodeBlock),q2=({block:t,isRecentCodeBlock:e})=>{if(t.kind===vs.CODE)return J.jsx(QV,{block:t,isRecentCodeBlock:e},t.id);switch(t.role){case si.USER:return J.jsx(qV,{block:t});case si.ASSISTANT:return J.jsx(JV,{block:t});default:return null}},J2=()=>{const{useColumns:t,isTyping:e}=Xi(),{settings:n}=es(),{chat:r}=t(),s=D.useRef(null);D.useEffect(()=>{var u;n.webApp.invertedOrder||(u=s.current)==null||u.scrollIntoView({behavior:"smooth"})},[r,n.webApp.invertedOrder]);const c=n.webApp.invertedOrder?0:r.length-1,o=J.jsx("div",{className:"flex justify-start items-center h-full",children:J.jsx(q2,{block:pP})});return J.jsxs("div",{className:"overflow-y-clip p-1 flex flex-col whitespace-pre-wrap",children:[e&&n.webApp.invertedOrder&&o,r.map((u,l)=>J.jsx(q2,{block:u,isRecentCodeBlock:u.kind===vs.CODE&&l===c&&!e},l)),e&&!n.webApp.invertedOrder&&o,J.jsx("div",{ref:s})]})},Q2=()=>{const{sendUserBlock:t,isInputDisabled:e}=Xi(),[n,r]=D.useState(""),s=D.useRef(null);D.useEffect(()=>{var o;(o=s.current)==null||o.focus()},[]);const c=o=>{o.preventDefault(),n.trim()&&(t(n),r(""))},i=o=>{if(o.key==="Enter"&&!o.shiftKey){o.preventDefault();const u=o.currentTarget.form;u&&u.requestSubmit()}};return J.jsx("form",{onSubmit:c,className:"flex w-full",children:J.jsxs(In,{className:"w-full flex flex-nowrap items-start gap-4 m-2",children:[J.jsx(ih,{name:"userInput",value:n,onChange:o=>r(o.target.value),onKeyDown:i,placeholder:"Enter your question",size:"3",className:"flex-grow min-w-0",ref:s,rows:2,style:{resize:"vertical"}}),J.jsx(Di,{type:"submit",disabled:e,children:J.jsx(k$,{})})]})})};function ex(){const{useColumns:t,runCodeBlock:e}=Xi(),{settings:n}=es(),{chat:r}=t(),s=D.useRef(null);D.useEffect(()=>{const i=u=>{if(u.ctrlKey&&u.key==="Enter"){const l=n.webApp.invertedOrder?r[0]:r[r.length-1];(l==null?void 0:l.kind)===vs.CODE&&e(l)}},o=s.current;if(o)return o.addEventListener("keydown",i),()=>o.removeEventListener("keydown",i)},[r,e,n.webApp.invertedOrder]);const c=n.webApp.invertedOrder?"flex-col":"flex-col-reverse";return J.jsxs("div",{ref:s,className:"flex flex-col h-full",children:[J.jsx(tn,{size:"5",weight:"bold",className:"mb-2",children:"How can I help you?"}),J.jsx(Dh,{type:"auto",scrollbars:"vertical",className:"flex-1 p-4",children:J.jsx("div",{className:`flex ${c} h-full w-full`,children:n.webApp.invertedOrder?J.jsxs(J.Fragment,{children:[J.jsx(Q2,{}),J.jsx(J2,{})]}):J.jsxs(J.Fragment,{children:[J.jsx(Q2,{}),J.jsx(J2,{})]})})})]})}const ez=()=>{const{useColumns:t}=Xi(),{files:e}=t(),n=D.useRef(null),r=()=>{var i;(i=n.current)==null||i.scrollIntoView({behavior:"smooth"})},s=D.useMemo(()=>{let i=mn(xc,{});return e.length>0&&(i=e[e.length-1]),i},[e]);D.useEffect(()=>{r()},[s]);const c=s.fileSearchResults.length>0;return J.jsxs("div",{className:"flex flex-col h-full",children:[J.jsx(tn,{size:"5",weight:"bold",className:"mb-2",children:"Files"}),J.jsx(Dh,{type:"auto",scrollbars:"vertical",className:"flex-1 pt-4",children:c?J.jsxs("div",{className:"grow",children:[s.fileSearchResults.map(i=>J.jsx("div",{className:"mb-2",children:J.jsx(bs,{p:"2",style:{borderRadius:"6px",border:"1px solid var(--gray-5)"},children:J.jsx(tn,{size:"2",weight:"medium",children:J.jsx(Ag,{href:i.link,target:"_blank",className:"text-blue-500 hover:underline",children:i.fileName})})})},i.fileId)),J.jsx("div",{ref:n,className:"h-1"})]}):J.jsxs("div",{children:[J.jsx("div",{children:"No search results yet"}),J.jsx("div",{ref:n,className:"h-1"})]})})]})},tz=Yi("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),nz=pD(tz,0),Kv=Yh(nz);function rz(){const{runnerError:t}=es(),[e]=o9(),n=D.useMemo(()=>t&&!(t instanceof Error)?Kv[t.code]??t.code:e.get("error"),[t,e]),r=D.useMemo(()=>t&&!(t instanceof Error)?t.message:e.get("error_description"),[t,e]),s=()=>{window.location.href="/oidc/login"};return J.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[n&&J.jsxs(Lh,{color:"red",children:[J.jsxs(Rc,{className:"font-bold",children:["Error: ",n]}),r&&J.jsx(Rc,{children:r})]}),J.jsx(Di,{size:"4",onClick:s,className:"cursor-pointer",children:"Login"})]})}const sz=()=>J.jsxs(gE,{size:"3",style:{padding:"2rem",textAlign:"center"},children:[J.jsx(aE,{size:"8",mb:"4",children:"404"}),J.jsx(tn,{size:"5",color:"gray",children:"Page not found"}),J.jsx(tn,{as:"p",mt:"4",children:"The page you're looking for doesn't exist or has been moved."}),J.jsxs(tn,{as:"p",mt:"4",children:["Click"," ",J.jsx(Ag,{href:"/",underline:"always",children:"here"})," ","to go back home."]})]});function iz(){const t=Sh(),{settings:e,updateSettings:n,runnerError:r,defaultSettings:s}=es(),[c,i]=D.useState(!1),[o,u]=D.useState(e.agentEndpoint),[l,a]=D.useState(e.webApp.runner),[d,f]=D.useState(e.webApp.invertedOrder),p=()=>{n({agentEndpoint:o,webApp:{runner:l,reconnect:e.webApp.reconnect,invertedOrder:d}}),i(!0)};D.useEffect(()=>{c&&(i(!1),r&&t("/"))},[r,c,t]);const v=()=>{u(s.agentEndpoint),a(s.webApp.runner),f(s.webApp.invertedOrder)},m=D.useMemo(()=>{if(r&&!(!r||typeof r!="object"||!("message"in r)))return r.message},[r]),b=o!==e.agentEndpoint||l!==e.webApp.runner||d!==e.webApp.invertedOrder;return J.jsxs(bs,{className:"w-full mx-auto",children:[J.jsx(tn,{size:"5",weight:"bold",className:"mb-2",children:"Settings"}),J.jsxs(bs,{className:"mt-4",children:[J.jsxs(In,{direction:"column",gap:"4",children:[J.jsxs(In,{direction:"column",gap:"2",children:[J.jsx(tn,{size:"3",weight:"bold",children:"Agent Endpoint Configuration"}),J.jsx(tn,{size:"2",color:"gray",children:"Configure the endpoint URL for the AI agent. Changes will take effect after saving."}),J.jsx(ih,{size:"3",placeholder:"Enter AI endpoint URL",value:o,onChange:y=>u(y.target.value)})]}),J.jsxs(In,{direction:"column",gap:"2",children:[J.jsx(tn,{size:"3",weight:"bold",children:"Runner Endpoint Configuration"}),J.jsx(tn,{size:"2",color:"gray",children:"Configure the WebSocket endpoint URL for the runner. Changes will take effect after saving."}),r&&J.jsx(Lh,{color:"red",children:J.jsxs(Rc,{className:"font-bold",children:["Runner error",m?": "+m:""]})}),J.jsx(ih,{size:"3",placeholder:"Enter Runner WebSocket endpoint URL",value:l,onChange:y=>a(y.target.value)}),J.jsx(tn,{size:"2",color:"gray",children:"Revert will reset endpoints to the default values, including protocol http(s), based on the current page."})]}),J.jsxs(In,{direction:"column",gap:"2",children:[J.jsx(tn,{size:"3",weight:"bold",children:"User Experience Mode"}),J.jsx(tn,{as:"label",size:"2",children:J.jsxs(In,{gap:"2",children:["Document Mode",J.jsx(bE,{checked:d,onCheckedChange:f}),"Console Mode"]})})]})]}),J.jsxs(In,{gap:"3",justify:"end",mt:"4",children:[J.jsx(Di,{size:"2",variant:"soft",onClick:()=>t("/"),children:"Back"}),J.jsx(Di,{size:"2",variant:"soft",onClick:v,children:"Revert"}),J.jsx(Di,{size:"2",onClick:p,disabled:!b,children:"Save"})]})]})]})}function Ct(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function tx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function of(...t){return e=>{let n=!1;const r=t.map(s=>{const c=tx(s,e);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let s=0;s<r.length;s++){const c=r[s];typeof c=="function"?c():tx(t[s],null)}}}}function sr(...t){return D.useCallback(of(...t),t)}function fu(t,e=[]){let n=[];function r(c,i){const o=D.createContext(i),u=n.length;n=[...n,i];const l=d=>{var y;const{scope:f,children:p,...v}=d,m=((y=f==null?void 0:f[t])==null?void 0:y[u])||o,b=D.useMemo(()=>v,Object.values(v));return J.jsx(m.Provider,{value:b,children:p})};l.displayName=c+"Provider";function a(d,f){var m;const p=((m=f==null?void 0:f[t])==null?void 0:m[u])||o,v=D.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${c}\``)}return[l,a]}const s=()=>{const c=n.map(i=>D.createContext(i));return function(o){const u=(o==null?void 0:o[t])||c;return D.useMemo(()=>({[`__scope${t}`]:{...o,[t]:u}}),[o,u])}};return s.scopeName=t,[r,oz(s,...e)]}function oz(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(c){const i=r.reduce((o,{useScope:u,scopeName:l})=>{const d=u(c)[`__scope${l}`];return{...o,...d}},{});return D.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var Mo=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},az=vx[" useInsertionEffect ".trim().toString()]||Mo;function $k({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,c,i]=lz({defaultProp:e,onChange:n}),o=t!==void 0,u=o?t:s;{const a=D.useRef(t!==void 0);D.useEffect(()=>{const d=a.current;d!==o&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),a.current=o},[o,r])}const l=D.useCallback(a=>{var d;if(o){const f=cz(a)?a(t):a;f!==t&&((d=i.current)==null||d.call(i,f))}else c(a)},[o,t,c,i]);return[u,l]}function lz({defaultProp:t,onChange:e}){const[n,r]=D.useState(t),s=D.useRef(n),c=D.useRef(e);return az(()=>{c.current=e},[e]),D.useEffect(()=>{var i;s.current!==n&&((i=c.current)==null||i.call(c,n),s.current=n)},[n,s]),[n,r,c]}function cz(t){return typeof t=="function"}function bh(t){const e=uz(t),n=D.forwardRef((r,s)=>{const{children:c,...i}=r,o=D.Children.toArray(c),u=o.find(hz);if(u){const l=u.props.children,a=o.map(d=>d===u?D.Children.count(l)>1?D.Children.only(null):D.isValidElement(l)?l.props.children:null:d);return J.jsx(e,{...i,ref:s,children:D.isValidElement(l)?D.cloneElement(l,void 0,a):null})}return J.jsx(e,{...i,ref:s,children:c})});return n.displayName=`${t}.Slot`,n}function uz(t){const e=D.forwardRef((n,r)=>{const{children:s,...c}=n;if(D.isValidElement(s)){const i=pz(s),o=fz(c,s.props);return s.type!==D.Fragment&&(o.ref=r?of(r,i):i),D.cloneElement(s,o)}return D.Children.count(s)>1?D.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var dz=Symbol("radix.slottable");function hz(t){return D.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dz}function fz(t,e){const n={...e};for(const r in e){const s=t[r],c=e[r];/^on[A-Z]/.test(r)?s&&c?n[r]=(...o)=>{const u=c(...o);return s(...o),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...c}:r==="className"&&(n[r]=[s,c].filter(Boolean).join(" "))}return{...t,...n}}function pz(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var mz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lr=mz.reduce((t,e)=>{const n=bh(`Primitive.${e}`),r=D.forwardRef((s,c)=>{const{asChild:i,...o}=s,u=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),J.jsx(u,{...o,ref:c})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Bk(t,e){t&&og.flushSync(()=>t.dispatchEvent(e))}function Uk(t){const e=t+"CollectionProvider",[n,r]=fu(e),[s,c]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:b,children:y}=m,_=Qn.useRef(null),S=Qn.useRef(new Map).current;return J.jsx(s,{scope:b,itemMap:S,collectionRef:_,children:y})};i.displayName=e;const o=t+"CollectionSlot",u=bh(o),l=Qn.forwardRef((m,b)=>{const{scope:y,children:_}=m,S=c(o,y),C=sr(b,S.collectionRef);return J.jsx(u,{ref:C,children:_})});l.displayName=o;const a=t+"CollectionItemSlot",d="data-radix-collection-item",f=bh(a),p=Qn.forwardRef((m,b)=>{const{scope:y,children:_,...S}=m,C=Qn.useRef(null),x=sr(b,C),j=c(a,y);return Qn.useEffect(()=>(j.itemMap.set(C,{ref:C,...S}),()=>void j.itemMap.delete(C))),J.jsx(f,{[d]:"",ref:x,children:_})});p.displayName=a;function v(m){const b=c(t+"CollectionConsumer",m);return Qn.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const S=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((j,k)=>S.indexOf(j.ref.current)-S.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:l,ItemSlot:p},v,r]}var vz=D.createContext(void 0);function Fk(t){const e=D.useContext(vz);return t||e||"ltr"}function ii(t){const e=D.useRef(t);return D.useEffect(()=>{e.current=t}),D.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function gz(t,e=globalThis==null?void 0:globalThis.document){const n=ii(t);D.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var bz="DismissableLayer",Xv="dismissableLayer.update",yz="dismissableLayer.pointerDownOutside",_z="dismissableLayer.focusOutside",nx,Vk=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zk=D.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:i,onDismiss:o,...u}=t,l=D.useContext(Vk),[a,d]=D.useState(null),f=(a==null?void 0:a.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=D.useState({}),v=sr(e,k=>d(k)),m=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(b),_=a?m.indexOf(a):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=_>=y,x=xz(k=>{const T=k.target,A=[...l.branches].some(L=>L.contains(T));!C||A||(s==null||s(k),i==null||i(k),k.defaultPrevented||o==null||o())},f),j=Cz(k=>{const T=k.target;[...l.branches].some(L=>L.contains(T))||(c==null||c(k),i==null||i(k),k.defaultPrevented||o==null||o())},f);return gz(k=>{_===l.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&o&&(k.preventDefault(),o()))},f),D.useEffect(()=>{if(a)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(nx=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(a)),l.layers.add(a),rx(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nx)}},[a,f,n,l]),D.useEffect(()=>()=>{a&&(l.layers.delete(a),l.layersWithOutsidePointerEventsDisabled.delete(a),rx())},[a,l]),D.useEffect(()=>{const k=()=>p({});return document.addEventListener(Xv,k),()=>document.removeEventListener(Xv,k)},[]),J.jsx(lr.div,{...u,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...t.style},onFocusCapture:Ct(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Ct(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Ct(t.onPointerDownCapture,x.onPointerDownCapture)})});zk.displayName=bz;var wz="DismissableLayerBranch",Sz=D.forwardRef((t,e)=>{const n=D.useContext(Vk),r=D.useRef(null),s=sr(e,r);return D.useEffect(()=>{const c=r.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),J.jsx(lr.div,{...t,ref:s})});Sz.displayName=wz;function xz(t,e=globalThis==null?void 0:globalThis.document){const n=ii(t),r=D.useRef(!1),s=D.useRef(()=>{});return D.useEffect(()=>{const c=o=>{if(o.target&&!r.current){let u=function(){Hk(yz,n,l,{discrete:!0})};const l={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=u,e.addEventListener("click",s.current,{once:!0})):u()}else e.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",c),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Cz(t,e=globalThis==null?void 0:globalThis.document){const n=ii(t),r=D.useRef(!1);return D.useEffect(()=>{const s=c=>{c.target&&!r.current&&Hk(_z,n,{originalEvent:c},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rx(){const t=new CustomEvent(Xv);document.dispatchEvent(t)}function Hk(t,e,n,{discrete:r}){const s=n.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Bk(s,c):s.dispatchEvent(c)}var lv=0;function Ez(){D.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sx()),document.body.insertAdjacentElement("beforeend",t[1]??sx()),lv++,()=>{lv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),lv--}},[])}function sx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var cv="focusScope.autoFocusOnMount",uv="focusScope.autoFocusOnUnmount",ix={bubbles:!1,cancelable:!0},jz="FocusScope",Wk=D.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...i}=t,[o,u]=D.useState(null),l=ii(s),a=ii(c),d=D.useRef(null),f=sr(e,m=>u(m)),p=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(r){let m=function(S){if(p.paused||!o)return;const C=S.target;o.contains(C)?d.current=C:Li(d.current,{select:!0})},b=function(S){if(p.paused||!o)return;const C=S.relatedTarget;C!==null&&(o.contains(C)||Li(d.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Li(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",b);const _=new MutationObserver(y);return o&&_.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",b),_.disconnect()}}},[r,o,p.paused]),D.useEffect(()=>{if(o){ax.add(p);const m=document.activeElement;if(!o.contains(m)){const y=new CustomEvent(cv,ix);o.addEventListener(cv,l),o.dispatchEvent(y),y.defaultPrevented||(kz(Rz(Gk(o)),{select:!0}),document.activeElement===m&&Li(o))}return()=>{o.removeEventListener(cv,l),setTimeout(()=>{const y=new CustomEvent(uv,ix);o.addEventListener(uv,a),o.dispatchEvent(y),y.defaultPrevented||Li(m??document.body,{select:!0}),o.removeEventListener(uv,a),ax.remove(p)},0)}}},[o,l,a,p]);const v=D.useCallback(m=>{if(!n&&!r||p.paused)return;const b=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(b&&y){const _=m.currentTarget,[S,C]=Tz(_);S&&C?!m.shiftKey&&y===C?(m.preventDefault(),n&&Li(S,{select:!0})):m.shiftKey&&y===S&&(m.preventDefault(),n&&Li(C,{select:!0})):y===_&&m.preventDefault()}},[n,r,p.paused]);return J.jsx(lr.div,{tabIndex:-1,...i,ref:f,onKeyDown:v})});Wk.displayName=jz;function kz(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function Tz(t){const e=Gk(t),n=ox(e,t),r=ox(e.reverse(),t);return[n,r]}function Gk(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function ox(t,e){for(const n of t)if(!Oz(n,{upTo:e}))return n}function Oz(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Az(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Az(t)&&e&&t.select()}}var ax=Iz();function Iz(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=lx(t,e),t.unshift(e)},remove(e){var n;t=lx(t,e),(n=t[0])==null||n.resume()}}}function lx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Rz(t){return t.filter(e=>e.tagName!=="A")}var Nz=vx[" useId ".trim().toString()]||(()=>{}),Lz=0;function qv(t){const[e,n]=D.useState(Nz());return Mo(()=>{n(r=>r??String(Lz++))},[t]),t||(e?`radix-${e}`:"")}var Dz="Arrow",Zk=D.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...c}=t;return J.jsx(lr.svg,{...c,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:J.jsx("polygon",{points:"0,0 30,0 15,10"})})});Zk.displayName=Dz;var Mz=Zk;function Pz(t){const[e,n]=D.useState(void 0);return Mo(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let i,o;if("borderBoxSize"in c){const u=c.borderBoxSize,l=Array.isArray(u)?u[0]:u;i=l.inlineSize,o=l.blockSize}else i=t.offsetWidth,o=t.offsetHeight;n({width:i,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var F0="Popper",[Yk,Kk]=fu(F0),[$z,Xk]=Yk(F0),qk=t=>{const{__scopePopper:e,children:n}=t,[r,s]=D.useState(null);return J.jsx($z,{scope:e,anchor:r,onAnchorChange:s,children:n})};qk.displayName=F0;var Jk="PopperAnchor",Qk=D.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,c=Xk(Jk,n),i=D.useRef(null),o=sr(e,i);return D.useEffect(()=>{c.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:J.jsx(lr.div,{...s,ref:o})});Qk.displayName=Jk;var V0="PopperContent",[Bz,Uz]=Yk(V0),e5=D.forwardRef((t,e)=>{var V,ce,oe,xe,he,Pe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:c="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:a=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=t,b=Xk(V0,n),[y,_]=D.useState(null),S=sr(e,Ie=>_(Ie)),[C,x]=D.useState(null),j=Pz(C),k=(j==null?void 0:j.width)??0,T=(j==null?void 0:j.height)??0,A=r+(c!=="center"?"-"+c:""),L=typeof a=="number"?a:{top:0,right:0,bottom:0,left:0,...a},N=Array.isArray(l)?l:[l],M=N.length>0,F={padding:L,boundary:N.filter(Vz),altBoundary:M},{refs:Z,floatingStyles:Y,placement:X,isPositioned:Q,middlewareData:$}=pC({strategy:"fixed",placement:A,whileElementsMounted:(...Ie)=>hC(...Ie,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[mC({mainAxis:s+T,alignmentAxis:i}),u&&vC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?gC():void 0,...F}),u&&bC({...F}),yC({...F,apply:({elements:Ie,rects:Ye,availableWidth:be,availableHeight:je})=>{const{width:ie,height:se}=Ye.reference,ue=Ie.floating.style;ue.setProperty("--radix-popper-available-width",`${be}px`),ue.setProperty("--radix-popper-available-height",`${je}px`),ue.setProperty("--radix-popper-anchor-width",`${ie}px`),ue.setProperty("--radix-popper-anchor-height",`${se}px`)}}),C&&wC({element:C,padding:o}),zz({arrowWidth:k,arrowHeight:T}),f&&_C({strategy:"referenceHidden",...F})]}),[U,I]=r5(X),W=ii(v);Mo(()=>{Q&&(W==null||W())},[Q,W]);const G=(V=$.arrow)==null?void 0:V.x,B=(ce=$.arrow)==null?void 0:ce.y,ee=((oe=$.arrow)==null?void 0:oe.centerOffset)!==0,[re,K]=D.useState();return Mo(()=>{y&&K(window.getComputedStyle(y).zIndex)},[y]),J.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:Q?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(xe=$.transformOrigin)==null?void 0:xe.x,(he=$.transformOrigin)==null?void 0:he.y].join(" "),...((Pe=$.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:J.jsx(Bz,{scope:n,placedSide:U,onArrowChange:x,arrowX:G,arrowY:B,shouldHideArrow:ee,children:J.jsx(lr.div,{"data-side":U,"data-align":I,...m,ref:S,style:{...m.style,animation:Q?void 0:"none"}})})})});e5.displayName=V0;var t5="PopperArrow",Fz={top:"bottom",right:"left",bottom:"top",left:"right"},n5=D.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,c=Uz(t5,r),i=Fz[c.placedSide];return J.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:J.jsx(Mz,{...s,ref:n,style:{...s.style,display:"block"}})})});n5.displayName=t5;function Vz(t){return t!==null}var zz=t=>({name:"transformOrigin",options:t,fn(e){var b,y,_;const{placement:n,rects:r,middlewareData:s}=e,i=((b=s.arrow)==null?void 0:b.centerOffset)!==0,o=i?0:t.arrowWidth,u=i?0:t.arrowHeight,[l,a]=r5(n),d={start:"0%",center:"50%",end:"100%"}[a],f=(((y=s.arrow)==null?void 0:y.x)??0)+o/2,p=(((_=s.arrow)==null?void 0:_.y)??0)+u/2;let v="",m="";return l==="bottom"?(v=i?d:`${f}px`,m=`${-u}px`):l==="top"?(v=i?d:`${f}px`,m=`${r.floating.height+u}px`):l==="right"?(v=`${-u}px`,m=i?d:`${p}px`):l==="left"&&(v=`${r.floating.width+u}px`,m=i?d:`${p}px`),{data:{x:v,y:m}}}});function r5(t){const[e,n="center"]=t.split("-");return[e,n]}var Hz=qk,Wz=Qk,Gz=e5,Zz=n5;function Yz(t,e){return D.useReducer((n,r)=>e[n][r]??n,t)}var af=t=>{const{present:e,children:n}=t,r=Kz(e),s=typeof n=="function"?n({present:r.isPresent}):D.Children.only(n),c=sr(r.ref,Xz(s));return typeof n=="function"||r.isPresent?D.cloneElement(s,{ref:c}):null};af.displayName="Presence";function Kz(t){const[e,n]=D.useState(),r=D.useRef(null),s=D.useRef(t),c=D.useRef("none"),i=t?"mounted":"unmounted",[o,u]=Yz(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=$d(r.current);c.current=o==="mounted"?l:"none"},[o]),Mo(()=>{const l=r.current,a=s.current;if(a!==t){const f=c.current,p=$d(l);t?u("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(a&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),Mo(()=>{if(e){let l;const a=e.ownerDocument.defaultView??window,d=p=>{const m=$d(r.current).includes(p.animationName);if(p.target===e&&m&&(u("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",l=a.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},f=p=>{p.target===e&&(c.current=$d(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{a.clearTimeout(l),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:D.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $d(t){return(t==null?void 0:t.animationName)||"none"}function Xz(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var dv="rovingFocusGroup.onEntryFocus",qz={bubbles:!1,cancelable:!0},pu="RovingFocusGroup",[Jv,s5,Jz]=Uk(pu),[Qz,i5]=fu(pu,[Jz]),[eH,tH]=Qz(pu),o5=D.forwardRef((t,e)=>J.jsx(Jv.Provider,{scope:t.__scopeRovingFocusGroup,children:J.jsx(Jv.Slot,{scope:t.__scopeRovingFocusGroup,children:J.jsx(nH,{...t,ref:e})})}));o5.displayName=pu;var nH=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:c,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:a=!1,...d}=t,f=D.useRef(null),p=sr(e,f),v=Fk(c),[m,b]=$k({prop:i,defaultProp:o??null,onChange:u,caller:pu}),[y,_]=D.useState(!1),S=ii(l),C=s5(n),x=D.useRef(!1),[j,k]=D.useState(0);return D.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(dv,S),()=>T.removeEventListener(dv,S)},[S]),J.jsx(eH,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:m,onItemFocus:D.useCallback(T=>b(T),[b]),onItemShiftTab:D.useCallback(()=>_(!0),[]),onFocusableItemAdd:D.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:D.useCallback(()=>k(T=>T-1),[]),children:J.jsx(lr.div,{tabIndex:y||j===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Ct(t.onMouseDown,()=>{x.current=!0}),onFocus:Ct(t.onFocus,T=>{const A=!x.current;if(T.target===T.currentTarget&&A&&!y){const L=new CustomEvent(dv,qz);if(T.currentTarget.dispatchEvent(L),!L.defaultPrevented){const N=C().filter(X=>X.focusable),M=N.find(X=>X.active),F=N.find(X=>X.id===m),Y=[M,F,...N].filter(Boolean).map(X=>X.ref.current);c5(Y,a)}}x.current=!1}),onBlur:Ct(t.onBlur,()=>_(!1))})})}),a5="RovingFocusGroupItem",l5=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:c,children:i,...o}=t,u=qv(),l=c||u,a=tH(a5,n),d=a.currentTabStopId===l,f=s5(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:m}=a;return D.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),J.jsx(Jv.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:J.jsx(lr.span,{tabIndex:d?0:-1,"data-orientation":a.orientation,...o,ref:e,onMouseDown:Ct(t.onMouseDown,b=>{r?a.onItemFocus(l):b.preventDefault()}),onFocus:Ct(t.onFocus,()=>a.onItemFocus(l)),onKeyDown:Ct(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){a.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=iH(b,a.orientation,a.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let S=f().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const C=S.indexOf(b.currentTarget);S=a.loop?oH(S,C+1):S.slice(C+1)}setTimeout(()=>c5(S))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});l5.displayName=a5;var rH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sH(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function iH(t,e,n){const r=sH(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rH[r]}function c5(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function oH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var aH=o5,lH=l5,Qv=["Enter"," "],cH=["ArrowDown","PageUp","Home"],u5=["ArrowUp","PageDown","End"],uH=[...cH,...u5],dH={ltr:[...Qv,"ArrowRight"],rtl:[...Qv,"ArrowLeft"]},hH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mu="Menu",[Zc,fH,pH]=Uk(mu),[$o,d5]=fu(mu,[pH,Kk,i5]),lf=Kk(),h5=i5(),[mH,nl]=$o(mu),[vH,vu]=$o(mu),f5=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:c,modal:i=!0}=t,o=lf(e),[u,l]=D.useState(null),a=D.useRef(!1),d=ii(c),f=Fk(s);return D.useEffect(()=>{const p=()=>{a.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>a.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),J.jsx(Hz,{...o,children:J.jsx(mH,{scope:e,open:n,onOpenChange:d,content:u,onContentChange:l,children:J.jsx(vH,{scope:e,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:a,dir:f,modal:i,children:r})})})};f5.displayName=mu;var gH="MenuAnchor",z0=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=lf(n);return J.jsx(Wz,{...s,...r,ref:e})});z0.displayName=gH;var bH="MenuPortal",[KW,p5]=$o(bH,{forceMount:void 0}),Pr="MenuContent",[yH,H0]=$o(Pr),m5=D.forwardRef((t,e)=>{const n=p5(Pr,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,c=nl(Pr,t.__scopeMenu),i=vu(Pr,t.__scopeMenu);return J.jsx(Zc.Provider,{scope:t.__scopeMenu,children:J.jsx(af,{present:r||c.open,children:J.jsx(Zc.Slot,{scope:t.__scopeMenu,children:i.modal?J.jsx(_H,{...s,ref:e}):J.jsx(wH,{...s,ref:e})})})})}),_H=D.forwardRef((t,e)=>{const n=nl(Pr,t.__scopeMenu),r=D.useRef(null),s=sr(e,r);return D.useEffect(()=>{const c=r.current;if(c)return _6(c)},[]),J.jsx(W0,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ct(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),wH=D.forwardRef((t,e)=>{const n=nl(Pr,t.__scopeMenu);return J.jsx(W0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),SH=bh("MenuContent.ScrollLock"),W0=D.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:v,...m}=t,b=nl(Pr,n),y=vu(Pr,n),_=lf(n),S=h5(n),C=fH(n),[x,j]=D.useState(null),k=D.useRef(null),T=sr(e,k,b.onContentChange),A=D.useRef(0),L=D.useRef(""),N=D.useRef(0),M=D.useRef(null),F=D.useRef("right"),Z=D.useRef(0),Y=v?Yx:D.Fragment,X=v?{as:SH,allowPinchZoom:!0}:void 0,Q=U=>{var V,ce;const I=L.current+U,W=C().filter(oe=>!oe.disabled),G=document.activeElement,B=(V=W.find(oe=>oe.ref.current===G))==null?void 0:V.textValue,ee=W.map(oe=>oe.textValue),re=LH(ee,I,B),K=(ce=W.find(oe=>oe.textValue===re))==null?void 0:ce.ref.current;(function oe(xe){L.current=xe,window.clearTimeout(A.current),xe!==""&&(A.current=window.setTimeout(()=>oe(""),1e3))})(I),K&&setTimeout(()=>K.focus())};D.useEffect(()=>()=>window.clearTimeout(A.current),[]),Ez();const $=D.useCallback(U=>{var W,G;return F.current===((W=M.current)==null?void 0:W.side)&&MH(U,(G=M.current)==null?void 0:G.area)},[]);return J.jsx(yH,{scope:n,searchRef:L,onItemEnter:D.useCallback(U=>{$(U)&&U.preventDefault()},[$]),onItemLeave:D.useCallback(U=>{var I;$(U)||((I=k.current)==null||I.focus(),j(null))},[$]),onTriggerLeave:D.useCallback(U=>{$(U)&&U.preventDefault()},[$]),pointerGraceTimerRef:N,onPointerGraceIntentChange:D.useCallback(U=>{M.current=U},[]),children:J.jsx(Y,{...X,children:J.jsx(Wk,{asChild:!0,trapped:s,onMountAutoFocus:Ct(c,U=>{var I;U.preventDefault(),(I=k.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:J.jsx(zk,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:J.jsx(aH,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:j,onEntryFocus:Ct(u,U=>{y.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:J.jsx(Gz,{role:"menu","aria-orientation":"vertical","data-state":I5(b.open),"data-radix-menu-content":"",dir:y.dir,..._,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:Ct(m.onKeyDown,U=>{const W=U.target.closest("[data-radix-menu-content]")===U.currentTarget,G=U.ctrlKey||U.altKey||U.metaKey,B=U.key.length===1;W&&(U.key==="Tab"&&U.preventDefault(),!G&&B&&Q(U.key));const ee=k.current;if(U.target!==ee||!uH.includes(U.key))return;U.preventDefault();const K=C().filter(V=>!V.disabled).map(V=>V.ref.current);u5.includes(U.key)&&K.reverse(),RH(K)}),onBlur:Ct(t.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:Ct(t.onPointerMove,Yc(U=>{const I=U.target,W=Z.current!==U.clientX;if(U.currentTarget.contains(I)&&W){const G=U.clientX>Z.current?"right":"left";F.current=G,Z.current=U.clientX}}))})})})})})})});m5.displayName=Pr;var xH="MenuGroup",G0=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return J.jsx(lr.div,{role:"group",...r,ref:e})});G0.displayName=xH;var CH="MenuLabel",v5=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return J.jsx(lr.div,{...r,ref:e})});v5.displayName=CH;var yh="MenuItem",cx="menu.itemSelect",cf=D.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,c=D.useRef(null),i=vu(yh,t.__scopeMenu),o=H0(yh,t.__scopeMenu),u=sr(e,c),l=D.useRef(!1),a=()=>{const d=c.current;if(!n&&d){const f=new CustomEvent(cx,{bubbles:!0,cancelable:!0});d.addEventListener(cx,p=>r==null?void 0:r(p),{once:!0}),Bk(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return J.jsx(g5,{...s,ref:u,disabled:n,onClick:Ct(t.onClick,a),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),l.current=!0},onPointerUp:Ct(t.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Ct(t.onKeyDown,d=>{const f=o.searchRef.current!=="";n||f&&d.key===" "||Qv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});cf.displayName=yh;var g5=D.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...c}=t,i=H0(yh,n),o=h5(n),u=D.useRef(null),l=sr(e,u),[a,d]=D.useState(!1),[f,p]=D.useState("");return D.useEffect(()=>{const v=u.current;v&&p((v.textContent??"").trim())},[c.children]),J.jsx(Zc.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:J.jsx(lH,{asChild:!0,...o,focusable:!r,children:J.jsx(lr.div,{role:"menuitem","data-highlighted":a?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...c,ref:l,onPointerMove:Ct(t.onPointerMove,Yc(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ct(t.onPointerLeave,Yc(v=>i.onItemLeave(v))),onFocus:Ct(t.onFocus,()=>d(!0)),onBlur:Ct(t.onBlur,()=>d(!1))})})})}),EH="MenuCheckboxItem",b5=D.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return J.jsx(x5,{scope:t.__scopeMenu,checked:n,children:J.jsx(cf,{role:"menuitemcheckbox","aria-checked":_h(n)?"mixed":n,...s,ref:e,"data-state":Y0(n),onSelect:Ct(s.onSelect,()=>r==null?void 0:r(_h(n)?!0:!n),{checkForDefaultPrevented:!1})})})});b5.displayName=EH;var y5="MenuRadioGroup",[jH,kH]=$o(y5,{value:void 0,onValueChange:()=>{}}),_5=D.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,c=ii(r);return J.jsx(jH,{scope:t.__scopeMenu,value:n,onValueChange:c,children:J.jsx(G0,{...s,ref:e})})});_5.displayName=y5;var w5="MenuRadioItem",S5=D.forwardRef((t,e)=>{const{value:n,...r}=t,s=kH(w5,t.__scopeMenu),c=n===s.value;return J.jsx(x5,{scope:t.__scopeMenu,checked:c,children:J.jsx(cf,{role:"menuitemradio","aria-checked":c,...r,ref:e,"data-state":Y0(c),onSelect:Ct(r.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,n)},{checkForDefaultPrevented:!1})})})});S5.displayName=w5;var Z0="MenuItemIndicator",[x5,TH]=$o(Z0,{checked:!1}),C5=D.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,c=TH(Z0,n);return J.jsx(af,{present:r||_h(c.checked)||c.checked===!0,children:J.jsx(lr.span,{...s,ref:e,"data-state":Y0(c.checked)})})});C5.displayName=Z0;var OH="MenuSeparator",E5=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return J.jsx(lr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});E5.displayName=OH;var AH="MenuArrow",j5=D.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=lf(n);return J.jsx(Zz,{...s,...r,ref:e})});j5.displayName=AH;var IH="MenuSub",[XW,k5]=$o(IH),mc="MenuSubTrigger",T5=D.forwardRef((t,e)=>{const n=nl(mc,t.__scopeMenu),r=vu(mc,t.__scopeMenu),s=k5(mc,t.__scopeMenu),c=H0(mc,t.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:u}=c,l={__scopeMenu:t.__scopeMenu},a=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>a,[a]),D.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),u(null)}},[o,u]),J.jsx(z0,{asChild:!0,...l,children:J.jsx(g5,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":I5(n.open),...t,ref:of(e,s.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ct(t.onPointerMove,Yc(d=>{c.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!i.current&&(c.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),a()},100))})),onPointerLeave:Ct(t.onPointerLeave,Yc(d=>{var p,v;a();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const m=(v=n.content)==null?void 0:v.dataset.side,b=m==="right",y=b?-5:5,_=f[b?"left":"right"],S=f[b?"right":"left"];c.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:_,y:f.top},{x:S,y:f.top},{x:S,y:f.bottom},{x:_,y:f.bottom}],side:m}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(d),d.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Ct(t.onKeyDown,d=>{var p;const f=c.searchRef.current!=="";t.disabled||f&&d.key===" "||dH[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});T5.displayName=mc;var O5="MenuSubContent",A5=D.forwardRef((t,e)=>{const n=p5(Pr,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,c=nl(Pr,t.__scopeMenu),i=vu(Pr,t.__scopeMenu),o=k5(O5,t.__scopeMenu),u=D.useRef(null),l=sr(e,u);return J.jsx(Zc.Provider,{scope:t.__scopeMenu,children:J.jsx(af,{present:r||c.open,children:J.jsx(Zc.Slot,{scope:t.__scopeMenu,children:J.jsx(W0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{var d;i.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:Ct(t.onFocusOutside,a=>{a.target!==o.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Ct(t.onEscapeKeyDown,a=>{i.onClose(),a.preventDefault()}),onKeyDown:Ct(t.onKeyDown,a=>{var p;const d=a.currentTarget.contains(a.target),f=hH[i.dir].includes(a.key);d&&f&&(c.onOpenChange(!1),(p=o.trigger)==null||p.focus(),a.preventDefault())})})})})})});A5.displayName=O5;function I5(t){return t?"open":"closed"}function _h(t){return t==="indeterminate"}function Y0(t){return _h(t)?"indeterminate":t?"checked":"unchecked"}function RH(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function NH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function LH(t,e,n){const s=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,c=n?t.indexOf(n):-1;let i=NH(t,Math.max(c,0));s.length===1&&(i=i.filter(l=>l!==n));const u=i.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function DH(t,e){const{x:n,y:r}=t;let s=!1;for(let c=0,i=e.length-1;c<e.length;i=c++){const o=e[c],u=e[i],l=o.x,a=o.y,d=u.x,f=u.y;a>r!=f>r&&n<(d-l)*(r-a)/(f-a)+l&&(s=!s)}return s}function MH(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return DH(n,e)}function Yc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var PH=f5,$H=z0,BH=m5,UH=G0,FH=v5,VH=cf,zH=b5,HH=_5,WH=S5,GH=C5,ZH=E5,YH=j5,KH=T5,XH=A5,uf="DropdownMenu",[qH,qW]=fu(uf,[d5]),cr=d5(),[JH,R5]=qH(uf),N5=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:c,onOpenChange:i,modal:o=!0}=t,u=cr(e),l=D.useRef(null),[a,d]=$k({prop:s,defaultProp:c??!1,onChange:i,caller:uf});return J.jsx(JH,{scope:e,triggerId:qv(),triggerRef:l,contentId:qv(),open:a,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:o,children:J.jsx(PH,{...u,open:a,onOpenChange:d,dir:r,modal:o,children:n})})};N5.displayName=uf;var L5="DropdownMenuTrigger",D5=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,c=R5(L5,n),i=cr(n);return J.jsx($H,{asChild:!0,...i,children:J.jsx(lr.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:of(e,c.triggerRef),onPointerDown:Ct(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(c.onOpenToggle(),c.open||o.preventDefault())}),onKeyDown:Ct(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&c.onOpenToggle(),o.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});D5.displayName=L5;var M5="DropdownMenuContent",P5=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=R5(M5,n),c=cr(n),i=D.useRef(!1);return J.jsx(BH,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...r,ref:e,onCloseAutoFocus:Ct(t.onCloseAutoFocus,o=>{var u;i.current||(u=s.triggerRef.current)==null||u.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:Ct(t.onInteractOutside,o=>{const u=o.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,a=u.button===2||l;(!s.modal||a)&&(i.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});P5.displayName=M5;var QH="DropdownMenuGroup",eW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(UH,{...s,...r,ref:e})});eW.displayName=QH;var tW="DropdownMenuLabel",nW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(FH,{...s,...r,ref:e})});nW.displayName=tW;var rW="DropdownMenuItem",$5=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(VH,{...s,...r,ref:e})});$5.displayName=rW;var sW="DropdownMenuCheckboxItem",iW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(zH,{...s,...r,ref:e})});iW.displayName=sW;var oW="DropdownMenuRadioGroup",aW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(HH,{...s,...r,ref:e})});aW.displayName=oW;var lW="DropdownMenuRadioItem",cW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(WH,{...s,...r,ref:e})});cW.displayName=lW;var uW="DropdownMenuItemIndicator",dW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(GH,{...s,...r,ref:e})});dW.displayName=uW;var hW="DropdownMenuSeparator",fW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(ZH,{...s,...r,ref:e})});fW.displayName=hW;var pW="DropdownMenuArrow",mW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(YH,{...s,...r,ref:e})});mW.displayName=pW;var vW="DropdownMenuSubTrigger",gW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(KH,{...s,...r,ref:e})});gW.displayName=vW;var bW="DropdownMenuSubContent",yW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=cr(n);return J.jsx(XH,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yW.displayName=bW;var _W=N5,wW=D5,SW=P5,xW=$5;function CW(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,c;for(c=0;c<r.length;c++)s=r[c],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}var EW=["color"],jW=D.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,s=CW(t,EW);return D.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:e}),D.createElement("path",{d:"M7.5 0.875C5.49797 0.875 3.875 2.49797 3.875 4.5C3.875 6.15288 4.98124 7.54738 6.49373 7.98351C5.2997 8.12901 4.27557 8.55134 3.50407 9.31167C2.52216 10.2794 2.02502 11.72 2.02502 13.5999C2.02502 13.8623 2.23769 14.0749 2.50002 14.0749C2.76236 14.0749 2.97502 13.8623 2.97502 13.5999C2.97502 11.8799 3.42786 10.7206 4.17091 9.9883C4.91536 9.25463 6.02674 8.87499 7.49995 8.87499C8.97317 8.87499 10.0846 9.25463 10.8291 9.98831C11.5721 10.7206 12.025 11.8799 12.025 13.5999C12.025 13.8623 12.2376 14.0749 12.5 14.0749C12.7623 14.075 12.975 13.8623 12.975 13.6C12.975 11.72 12.4778 10.2794 11.4959 9.31166C10.7244 8.55135 9.70025 8.12903 8.50625 7.98352C10.0187 7.5474 11.125 6.15289 11.125 4.5C11.125 2.49797 9.50203 0.875 7.5 0.875ZM4.825 4.5C4.825 3.02264 6.02264 1.825 7.5 1.825C8.97736 1.825 10.175 3.02264 10.175 4.5C10.175 5.97736 8.97736 7.175 7.5 7.175C6.02264 7.175 4.825 5.97736 4.825 4.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});class vc extends Error{}vc.prototype.name="InvalidTokenError";function kW(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function TW(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return kW(e)}catch{return atob(e)}}function OW(t,e){if(typeof t!="string")throw new vc("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new vc(`Invalid token specified: missing part #${n+1}`);let s;try{s=TW(r)}catch(c){throw new vc(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(s)}catch(c){throw new vc(`Invalid token specified: invalid json for part #${n+1} (${c.message})`)}}var hv={exports:{}},fv={exports:{}},ux;function AW(){return ux||(ux=1,function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(n,r){return n<<r|n>>>32-r},rotr:function(n,r){return n<<32-r|n>>>r},endian:function(n){if(n.constructor==Number)return e.rotl(n,8)&16711935|e.rotl(n,24)&4278255360;for(var r=0;r<n.length;r++)n[r]=e.endian(n[r]);return n},randomBytes:function(n){for(var r=[];n>0;n--)r.push(Math.floor(Math.random()*256));return r},bytesToWords:function(n){for(var r=[],s=0,c=0;s<n.length;s++,c+=8)r[c>>>5]|=n[s]<<24-c%32;return r},wordsToBytes:function(n){for(var r=[],s=0;s<n.length*32;s+=8)r.push(n[s>>>5]>>>24-s%32&255);return r},bytesToHex:function(n){for(var r=[],s=0;s<n.length;s++)r.push((n[s]>>>4).toString(16)),r.push((n[s]&15).toString(16));return r.join("")},hexToBytes:function(n){for(var r=[],s=0;s<n.length;s+=2)r.push(parseInt(n.substr(s,2),16));return r},bytesToBase64:function(n){for(var r=[],s=0;s<n.length;s+=3)for(var c=n[s]<<16|n[s+1]<<8|n[s+2],i=0;i<4;i++)s*8+i*6<=n.length*8?r.push(t.charAt(c>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var r=[],s=0,c=0;s<n.length;c=++s%4)c!=0&&r.push((t.indexOf(n.charAt(s-1))&Math.pow(2,-2*c+8)-1)<<c*2|t.indexOf(n.charAt(s))>>>6-c*2);return r}};fv.exports=e}()),fv.exports}var pv,dx;function hx(){if(dx)return pv;dx=1;var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],r=0;r<e.length;r++)n.push(e.charCodeAt(r)&255);return n},bytesToString:function(e){for(var n=[],r=0;r<e.length;r++)n.push(String.fromCharCode(e[r]));return n.join("")}}};return pv=t,pv}/*!
6672
6672
  * Determine if an object is a Buffer
6673
6673
  *
6674
6674
  * @author Feross Aboukhadijeh <https://feross.org>