diff --git a/extensions/next-edit-suggestions/server/language-server.js b/extensions/next-edit-suggestions/server/language-server.js index 927c94832f7e..4a0cd8748be3 100644 --- a/extensions/next-edit-suggestions/server/language-server.js +++ b/extensions/next-edit-suggestions/server/language-server.js @@ -1,98 +1,98 @@ -"use strict";var yC=Object.create;var Qs=Object.defineProperty;var _C=Object.getOwnPropertyDescriptor;var bC=Object.getOwnPropertyNames;var wC=Object.getPrototypeOf,xC=Object.prototype.hasOwnProperty;var te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xn=(e,t)=>{for(var n in t)Qs(e,n,{get:t[n],enumerable:!0})},qy=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of bC(t))!xC.call(e,r)&&r!==n&&Qs(e,r,{get:()=>t[r],enumerable:!(o=_C(t,r))||o.enumerable});return e};var cr=(e,t,n)=>(n=e!=null?yC(wC(e)):{},qy(t||!e||!e.__esModule?Qs(n,"default",{value:e,enumerable:!0}):n,e)),kC=e=>qy(Qs({},"__esModule",{value:!0}),e);var rl=te(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.thenable=Ot.typedArray=Ot.stringArray=Ot.array=Ot.func=Ot.error=Ot.number=Ot.string=Ot.boolean=void 0;function IC(e){return e===!0||e===!1}Ot.boolean=IC;function Zy(e){return typeof e=="string"||e instanceof String}Ot.string=Zy;function TC(e){return typeof e=="number"||e instanceof Number}Ot.number=TC;function $C(e){return e instanceof Error}Ot.error=$C;function Vy(e){return typeof e=="function"}Ot.func=Vy;function Wy(e){return Array.isArray(e)}Ot.array=Wy;function PC(e){return Wy(e)&&e.every(t=>Zy(t))}Ot.stringArray=PC;function EC(e,t){return Array.isArray(e)&&e.every(t)}Ot.typedArray=EC;function CC(e){return e&&Vy(e.then)}Ot.thenable=CC});var mi=te(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.stringArray=Jt.array=Jt.func=Jt.error=Jt.number=Jt.string=Jt.boolean=void 0;function RC(e){return e===!0||e===!1}Jt.boolean=RC;function Hy(e){return typeof e=="string"||e instanceof String}Jt.string=Hy;function OC(e){return typeof e=="number"||e instanceof Number}Jt.number=OC;function DC(e){return e instanceof Error}Jt.error=DC;function jC(e){return typeof e=="function"}Jt.func=jC;function Jy(e){return Array.isArray(e)}Jt.array=Jy;function NC(e){return Jy(e)&&e.every(t=>Hy(t))}Jt.stringArray=NC});var Dd=te(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.Message=Te.NotificationType9=Te.NotificationType8=Te.NotificationType7=Te.NotificationType6=Te.NotificationType5=Te.NotificationType4=Te.NotificationType3=Te.NotificationType2=Te.NotificationType1=Te.NotificationType0=Te.NotificationType=Te.RequestType9=Te.RequestType8=Te.RequestType7=Te.RequestType6=Te.RequestType5=Te.RequestType4=Te.RequestType3=Te.RequestType2=Te.RequestType1=Te.RequestType=Te.RequestType0=Te.AbstractMessageSignature=Te.ParameterStructures=Te.ResponseError=Te.ErrorCodes=void 0;var _o=mi(),ud;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(ud||(Te.ErrorCodes=ud={}));var cd=class e extends Error{constructor(t,n,o){super(n),this.code=_o.number(t)?t:ud.UnknownErrorCode,this.data=o,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};Te.ResponseError=cd;var dr=class e{constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};Te.ParameterStructures=dr;dr.auto=new dr("auto");dr.byPosition=new dr("byPosition");dr.byName=new dr("byName");var _t=class{constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return dr.auto}};Te.AbstractMessageSignature=_t;var dd=class extends _t{constructor(t){super(t,0)}};Te.RequestType0=dd;var pd=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Te.RequestType=pd;var fd=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Te.RequestType1=fd;var md=class extends _t{constructor(t){super(t,2)}};Te.RequestType2=md;var hd=class extends _t{constructor(t){super(t,3)}};Te.RequestType3=hd;var gd=class extends _t{constructor(t){super(t,4)}};Te.RequestType4=gd;var vd=class extends _t{constructor(t){super(t,5)}};Te.RequestType5=vd;var yd=class extends _t{constructor(t){super(t,6)}};Te.RequestType6=yd;var _d=class extends _t{constructor(t){super(t,7)}};Te.RequestType7=_d;var bd=class extends _t{constructor(t){super(t,8)}};Te.RequestType8=bd;var wd=class extends _t{constructor(t){super(t,9)}};Te.RequestType9=wd;var xd=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Te.NotificationType=xd;var kd=class extends _t{constructor(t){super(t,0)}};Te.NotificationType0=kd;var Sd=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Te.NotificationType1=Sd;var Id=class extends _t{constructor(t){super(t,2)}};Te.NotificationType2=Id;var Td=class extends _t{constructor(t){super(t,3)}};Te.NotificationType3=Td;var $d=class extends _t{constructor(t){super(t,4)}};Te.NotificationType4=$d;var Pd=class extends _t{constructor(t){super(t,5)}};Te.NotificationType5=Pd;var Ed=class extends _t{constructor(t){super(t,6)}};Te.NotificationType6=Ed;var Cd=class extends _t{constructor(t){super(t,7)}};Te.NotificationType7=Cd;var Rd=class extends _t{constructor(t){super(t,8)}};Te.NotificationType8=Rd;var Od=class extends _t{constructor(t){super(t,9)}};Te.NotificationType9=Od;var By;(function(e){function t(r){let i=r;return i&&_o.string(i.method)&&(_o.string(i.id)||_o.number(i.id))}e.isRequest=t;function n(r){let i=r;return i&&_o.string(i.method)&&r.id===void 0}e.isNotification=n;function o(r){let i=r;return i&&(i.result!==void 0||!!i.error)&&(_o.string(i.id)||_o.number(i.id)||i.id===null)}e.isResponse=o})(By||(Te.Message=By={}))});var Nd=te(Vn=>{"use strict";var Gy;Object.defineProperty(Vn,"__esModule",{value:!0});Vn.LRUCache=Vn.LinkedMap=Vn.Touch=void 0;var Bt;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(Bt||(Vn.Touch=Bt={}));var nl=class{constructor(){this[Gy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,n=Bt.None){let o=this._map.get(t);if(o)return n!==Bt.None&&this.touch(o,n),o.value}set(t,n,o=Bt.None){let r=this._map.get(t);if(r)r.value=n,o!==Bt.None&&this.touch(r,o);else{switch(r={key:t,value:n,next:void 0,previous:void 0},o){case Bt.None:this.addItemLast(r);break;case Bt.First:this.addItemFirst(r);break;case Bt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(t,r),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){let o=this._state,r=this._head;for(;r;){if(n?t.bind(n)(r.value,r.key,this):t(r.value,r.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let t=this._state,n=this._head,o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){let t=this._state,n=this._head,o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){let t=this._state,n=this._head,o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(Gy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,o=this.size;for(;n&&o>t;)this._map.delete(n.key),n=n.next,o--;this._head=n,this._size=o,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let n=t.next,o=t.previous;if(!n||!o)throw new Error("Invalid list");n.previous=o,o.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Bt.First&&n!==Bt.Last)){if(n===Bt.First){if(t===this._head)return;let o=t.next,r=t.previous;t===this._tail?(r.next=void 0,this._tail=r):(o.previous=r,r.next=o),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===Bt.Last){if(t===this._tail)return;let o=t.next,r=t.previous;t===this._head?(o.previous=void 0,this._head=o):(o.previous=r,r.next=o),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((n,o)=>{t.push([o,n])}),t}fromJSON(t){this.clear();for(let[n,o]of t)this.set(n,o)}};Vn.LinkedMap=nl;var jd=class extends nl{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=Bt.AsNew){return super.get(t,n)}peek(t){return super.get(t,Bt.None)}set(t,n){return super.set(t,n,Bt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Vn.LRUCache=jd});var Yy=te(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.Disposable=void 0;var Ky;(function(e){function t(n){return{dispose:n}}e.create=t})(Ky||(ol.Disposable=Ky={}))});var Wn=te(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var Md;function Ad(){if(Md===void 0)throw new Error("No runtime abstraction layer installed");return Md}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Md=n}e.install=t})(Ad||(Ad={}));zd.default=Ad});var gi=te(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.Emitter=hi.Event=void 0;var MC=Wn(),Xy;(function(e){let t={dispose(){}};e.None=function(){return t}})(Xy||(hi.Event=Xy={}));var qd=class{add(t,n=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(o)&&o.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let o=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new qd),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),r.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(r),r}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};hi.Emitter=il;il._noop=function(){}});var ll=te(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.CancellationTokenSource=vi.CancellationToken=void 0;var AC=Wn(),zC=mi(),Ud=gi(),al;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ud.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ud.Event.None});function t(n){let o=n;return o&&(o===e.None||o===e.Cancelled||zC.boolean(o.isCancellationRequested)&&!!o.onCancellationRequested)}e.is=t})(al||(vi.CancellationToken=al={}));var qC=Object.freeze(function(e,t){let n=(0,AC.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),sl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?qC:(this._emitter||(this._emitter=new Ud.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Ld=class{get token(){return this._token||(this._token=new sl),this._token}cancel(){this._token?this._token.cancel():this._token=al.Cancelled}dispose(){this._token?this._token instanceof sl&&this._token.dispose():this._token=al.None}};vi.CancellationTokenSource=Ld});var Qy=te(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.SharedArrayReceiverStrategy=yi.SharedArraySenderStrategy=void 0;var UC=ll(),Ia;(function(e){e.Continue=0,e.Cancelled=1})(Ia||(Ia={}));var Fd=class{constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let n=new SharedArrayBuffer(4),o=new Int32Array(n,0,1);o[0]=Ia.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){let o=this.buffers.get(n);if(o===void 0)return;let r=new Int32Array(o,0,1);Atomics.store(r,0,Ia.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};yi.SharedArraySenderStrategy=Fd;var Zd=class{constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ia.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Vd=class{constructor(t){this.token=new Zd(t)}cancel(){}dispose(){}},Wd=class{constructor(){this.kind="request"}createCancellationTokenSource(t){let n=t.$cancellationData;return n===void 0?new UC.CancellationTokenSource:new Vd(n)}};yi.SharedArrayReceiverStrategy=Wd});var Jd=te(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.Semaphore=void 0;var LC=Wn(),Hd=class{constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,o)=>{this._waiting.push({thunk:t,resolve:n,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,LC.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=t.thunk();n instanceof Promise?n.then(o=>{this._active--,t.resolve(o),this.runNext()},o=>{this._active--,t.reject(o),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}};ul.Semaphore=Hd});var t_=te(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ReadableStreamMessageReader=Hn.AbstractMessageReader=Hn.MessageReader=void 0;var Gd=Wn(),_i=mi(),Bd=gi(),FC=Jd(),e_;(function(e){function t(n){let o=n;return o&&_i.func(o.listen)&&_i.func(o.dispose)&&_i.func(o.onError)&&_i.func(o.onClose)&&_i.func(o.onPartialMessage)}e.is=t})(e_||(Hn.MessageReader=e_={}));var cl=class{constructor(){this.errorEmitter=new Bd.Emitter,this.closeEmitter=new Bd.Emitter,this.partialMessageEmitter=new Bd.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${_i.string(t.message)?t.message:"unknown"}`)}};Hn.AbstractMessageReader=cl;var Kd;(function(e){function t(n){let o,r,i,s=new Map,l,u=new Map;if(n===void 0||typeof n=="string")o=n??"utf-8";else{if(o=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,s.set(i.name,i)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)s.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(l=n.contentTypeDecoder,u.set(l.name,l)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=(0,Gd.default)().applicationJson.decoder,u.set(l.name,l)),{charset:o,contentDecoder:i,contentDecoders:s,contentTypeDecoder:l,contentTypeDecoders:u}}e.fromOptions=t})(Kd||(Kd={}));var Yd=class extends cl{constructor(t,n){super(),this.readable=t,this.options=Kd.fromOptions(n),this.buffer=(0,Gd.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new FC.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let n=this.readable.onData(o=>{this.onData(o)});return this.readable.onError(o=>this.fireError(o)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let o=this.buffer.tryReadHeaders(!0);if(!o)return;let r=o.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(o))}`));return}let i=parseInt(r);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${r}`));return}this.nextMessageLength=i}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let o=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,r=await this.options.contentTypeDecoder.decode(o,this.options);this.callback(r)}).catch(o=>{this.fireError(o)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Gd.default)().timer.setTimeout((t,n)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Hn.ReadableStreamMessageReader=Yd});var a_=te(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WriteableStreamMessageWriter=Jn.AbstractMessageWriter=Jn.MessageWriter=void 0;var r_=Wn(),Ta=mi(),ZC=Jd(),n_=gi(),VC="Content-Length: ",o_=`\r -`,i_;(function(e){function t(n){let o=n;return o&&Ta.func(o.dispose)&&Ta.func(o.onClose)&&Ta.func(o.onError)&&Ta.func(o.write)}e.is=t})(i_||(Jn.MessageWriter=i_={}));var dl=class{constructor(){this.errorEmitter=new n_.Emitter,this.closeEmitter=new n_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,n,o){this.errorEmitter.fire([this.asError(t),n,o])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${Ta.string(t.message)?t.message:"unknown"}`)}};Jn.AbstractMessageWriter=dl;var Xd;(function(e){function t(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,r_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,r_.default)().applicationJson.encoder}}e.fromOptions=t})(Xd||(Xd={}));var Qd=class extends dl{constructor(t,n){super(),this.writable=t,this.options=Xd.fromOptions(n),this.errorCount=0,this.writeSemaphore=new ZC.Semaphore(1),this.writable.onError(o=>this.fireError(o)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(o=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(o):o).then(o=>{let r=[];return r.push(VC,o.byteLength.toString(),o_),r.push(o_),this.doWrite(t,r,o)},o=>{throw this.fireError(o),o}))}async doWrite(t,n,o){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(o)}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){this.writable.end()}};Jn.WriteableStreamMessageWriter=Qd});var s_=te(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.AbstractMessageBuffer=void 0;var WC=13,HC=10,JC=`\r -`,ep=class{constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let n=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let n=0,o=0,r=0,i=0;e:for(;othis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(i)}if(this._chunks[0].byteLength>t){let i=this._chunks[0],s=this.asNative(i,t);return this._chunks[0]=i.slice(t),this._totalLength-=t,s}let n=this.allocNative(t),o=0,r=0;for(;t>0;){let i=this._chunks[r];if(i.byteLength>t){let s=i.slice(0,t);n.set(s,o),o+=t,this._chunks[r]=i.slice(t),this._totalLength-=t,t-=t}else n.set(i,o),o+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,t-=i.byteLength}return n}};pl.AbstractMessageBuffer=ep});var p_=te(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createMessageConnection=Ne.ConnectionOptions=Ne.MessageStrategy=Ne.CancellationStrategy=Ne.CancellationSenderStrategy=Ne.CancellationReceiverStrategy=Ne.RequestCancellationReceiverStrategy=Ne.IdCancellationReceiverStrategy=Ne.ConnectionStrategy=Ne.ConnectionError=Ne.ConnectionErrors=Ne.LogTraceNotification=Ne.SetTraceNotification=Ne.TraceFormat=Ne.TraceValues=Ne.Trace=Ne.NullLogger=Ne.ProgressType=Ne.ProgressToken=void 0;var l_=Wn(),It=mi(),Ce=Dd(),u_=Nd(),$a=gi(),tp=ll(),Ca;(function(e){e.type=new Ce.NotificationType("$/cancelRequest")})(Ca||(Ca={}));var rp;(function(e){function t(n){return typeof n=="string"||typeof n=="number"}e.is=t})(rp||(Ne.ProgressToken=rp={}));var Pa;(function(e){e.type=new Ce.NotificationType("$/progress")})(Pa||(Pa={}));var np=class{constructor(){}};Ne.ProgressType=np;var op;(function(e){function t(n){return It.func(n)}e.is=t})(op||(op={}));Ne.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Xe;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"})(Xe||(Ne.Trace=Xe={}));var c_;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"})(c_||(Ne.TraceValues=c_={}));(function(e){function t(o){if(!It.string(o))return e.Off;switch(o=o.toLowerCase(),o){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function n(o){switch(o){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}e.toString=n})(Xe||(Ne.Trace=Xe={}));var $r;(function(e){e.Text="text",e.JSON="json"})($r||(Ne.TraceFormat=$r={}));(function(e){function t(n){return It.string(n)?(n=n.toLowerCase(),n==="json"?e.JSON:e.Text):e.Text}e.fromString=t})($r||(Ne.TraceFormat=$r={}));var ip;(function(e){e.type=new Ce.NotificationType("$/setTrace")})(ip||(Ne.SetTraceNotification=ip={}));var fl;(function(e){e.type=new Ce.NotificationType("$/logTrace")})(fl||(Ne.LogTraceNotification=fl={}));var Ea;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"})(Ea||(Ne.ConnectionErrors=Ea={}));var bi=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};Ne.ConnectionError=bi;var ap;(function(e){function t(n){let o=n;return o&&It.func(o.cancelUndispatched)}e.is=t})(ap||(Ne.ConnectionStrategy=ap={}));var ml;(function(e){function t(n){let o=n;return o&&(o.kind===void 0||o.kind==="id")&&It.func(o.createCancellationTokenSource)&&(o.dispose===void 0||It.func(o.dispose))}e.is=t})(ml||(Ne.IdCancellationReceiverStrategy=ml={}));var sp;(function(e){function t(n){let o=n;return o&&o.kind==="request"&&It.func(o.createCancellationTokenSource)&&(o.dispose===void 0||It.func(o.dispose))}e.is=t})(sp||(Ne.RequestCancellationReceiverStrategy=sp={}));var hl;(function(e){e.Message=Object.freeze({createCancellationTokenSource(n){return new tp.CancellationTokenSource}});function t(n){return ml.is(n)||sp.is(n)}e.is=t})(hl||(Ne.CancellationReceiverStrategy=hl={}));var gl;(function(e){e.Message=Object.freeze({sendCancellation(n,o){return n.sendNotification(Ca.type,{id:o})},cleanup(n){}});function t(n){let o=n;return o&&It.func(o.sendCancellation)&&It.func(o.cleanup)}e.is=t})(gl||(Ne.CancellationSenderStrategy=gl={}));var vl;(function(e){e.Message=Object.freeze({receiver:hl.Message,sender:gl.Message});function t(n){let o=n;return o&&hl.is(o.receiver)&&gl.is(o.sender)}e.is=t})(vl||(Ne.CancellationStrategy=vl={}));var yl;(function(e){function t(n){let o=n;return o&&It.func(o.handleMessage)}e.is=t})(yl||(Ne.MessageStrategy=yl={}));var d_;(function(e){function t(n){let o=n;return o&&(vl.is(o.cancellationStrategy)||ap.is(o.connectionStrategy)||yl.is(o.messageStrategy))}e.is=t})(d_||(Ne.ConnectionOptions=d_={}));var Gr;(function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"})(Gr||(Gr={}));function BC(e,t,n,o){let r=n!==void 0?n:Ne.NullLogger,i=0,s=0,l=0,u="2.0",c,d=new Map,m,_=new Map,h=new Map,b,k=new u_.LinkedMap,T=new Map,R=new Set,g=new Map,v=Xe.Off,C=$r.Text,O,N=Gr.New,K=new $a.Emitter,ee=new $a.Emitter,E=new $a.Emitter,le=new $a.Emitter,z=new $a.Emitter,ye=o&&o.cancellationStrategy?o.cancellationStrategy:vl.Message;function D(y){if(y===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+y.toString()}function U(y){return y===null?"res-unknown-"+(++l).toString():"res-"+y.toString()}function A(){return"not-"+(++s).toString()}function L(y,q){Ce.Message.isRequest(q)?y.set(D(q.id),q):Ce.Message.isResponse(q)?y.set(U(q.id),q):y.set(A(),q)}function B(y){}function ne(){return N===Gr.Listening}function W(){return N===Gr.Closed}function pe(){return N===Gr.Disposed}function Pe(){(N===Gr.New||N===Gr.Listening)&&(N=Gr.Closed,ee.fire(void 0))}function Ie(y){K.fire([y,void 0,void 0])}function Le(y){K.fire(y)}e.onClose(Pe),e.onError(Ie),t.onClose(Pe),t.onError(Le);function oe(){b||k.size===0||(b=(0,l_.default)().timer.setImmediate(()=>{b=void 0,ge()}))}function J(y){Ce.Message.isRequest(y)?se(y):Ce.Message.isNotification(y)?F(y):Ce.Message.isResponse(y)?me(y):xe(y)}function ge(){if(k.size===0)return;let y=k.shift();try{let q=o?.messageStrategy;yl.is(q)?q.handleMessage(y,J):J(y)}finally{oe()}}let we=y=>{try{if(Ce.Message.isNotification(y)&&y.method===Ca.type.method){let q=y.params.id,G=D(q),ve=k.get(G);if(Ce.Message.isRequest(ve)){let We=o?.connectionStrategy,lt=We&&We.cancelUndispatched?We.cancelUndispatched(ve,B):void 0;if(lt&&(lt.error!==void 0||lt.result!==void 0)){k.delete(G),g.delete(q),lt.id=ve.id,sr(lt,y.method,Date.now()),t.write(lt).catch(()=>r.error("Sending response for canceled message failed."));return}}let Be=g.get(q);if(Be!==void 0){Be.cancel(),lr(y);return}else R.add(q)}L(k,y)}finally{oe()}};function se(y){if(pe())return;function q(ze,tt,$e){let ct={jsonrpc:u,id:y.id};ze instanceof Ce.ResponseError?ct.error=ze.toJson():ct.result=ze===void 0?null:ze,sr(ct,tt,$e),t.write(ct).catch(()=>r.error("Sending response failed."))}function G(ze,tt,$e){let ct={jsonrpc:u,id:y.id,error:ze.toJson()};sr(ct,tt,$e),t.write(ct).catch(()=>r.error("Sending response failed."))}function ve(ze,tt,$e){ze===void 0&&(ze=null);let ct={jsonrpc:u,id:y.id,result:ze};sr(ct,tt,$e),t.write(ct).catch(()=>r.error("Sending response failed."))}Sr(y);let Be=d.get(y.method),We,lt;Be&&(We=Be.type,lt=Be.handler);let ut=Date.now();if(lt||c){let ze=y.id??String(Date.now()),tt=ml.is(ye.receiver)?ye.receiver.createCancellationTokenSource(ze):ye.receiver.createCancellationTokenSource(y);y.id!==null&&R.has(y.id)&&tt.cancel(),y.id!==null&&g.set(ze,tt);try{let $e;if(lt)if(y.params===void 0){if(We!==void 0&&We.numberOfParams!==0){G(new Ce.ResponseError(Ce.ErrorCodes.InvalidParams,`Request ${y.method} defines ${We.numberOfParams} params but received none.`),y.method,ut);return}$e=lt(tt.token)}else if(Array.isArray(y.params)){if(We!==void 0&&We.parameterStructures===Ce.ParameterStructures.byName){G(new Ce.ResponseError(Ce.ErrorCodes.InvalidParams,`Request ${y.method} defines parameters by name but received parameters by position`),y.method,ut);return}$e=lt(...y.params,tt.token)}else{if(We!==void 0&&We.parameterStructures===Ce.ParameterStructures.byPosition){G(new Ce.ResponseError(Ce.ErrorCodes.InvalidParams,`Request ${y.method} defines parameters by position but received parameters by name`),y.method,ut);return}$e=lt(y.params,tt.token)}else c&&($e=c(y.method,y.params,tt.token));let ct=$e;$e?ct.then?ct.then(bt=>{g.delete(ze),q(bt,y.method,ut)},bt=>{g.delete(ze),bt instanceof Ce.ResponseError?G(bt,y.method,ut):bt&&It.string(bt.message)?G(new Ce.ResponseError(Ce.ErrorCodes.InternalError,`Request ${y.method} failed with message: ${bt.message}`),y.method,ut):G(new Ce.ResponseError(Ce.ErrorCodes.InternalError,`Request ${y.method} failed unexpectedly without providing any details.`),y.method,ut)}):(g.delete(ze),q($e,y.method,ut)):(g.delete(ze),ve($e,y.method,ut))}catch($e){g.delete(ze),$e instanceof Ce.ResponseError?q($e,y.method,ut):$e&&It.string($e.message)?G(new Ce.ResponseError(Ce.ErrorCodes.InternalError,`Request ${y.method} failed with message: ${$e.message}`),y.method,ut):G(new Ce.ResponseError(Ce.ErrorCodes.InternalError,`Request ${y.method} failed unexpectedly without providing any details.`),y.method,ut)}}else G(new Ce.ResponseError(Ce.ErrorCodes.MethodNotFound,`Unhandled method ${y.method}`),y.method,ut)}function me(y){if(!pe())if(y.id===null)y.error?r.error(`Received response message without id: Error is: -${JSON.stringify(y.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let q=y.id,G=T.get(q);if(et(y,G),G!==void 0){T.delete(q);try{if(y.error){let ve=y.error;G.reject(new Ce.ResponseError(ve.code,ve.message,ve.data))}else if(y.result!==void 0)G.resolve(y.result);else throw new Error("Should never happen.")}catch(ve){ve.message?r.error(`Response handler '${G.method}' failed with message: ${ve.message}`):r.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function F(y){if(pe())return;let q,G;if(y.method===Ca.type.method){let ve=y.params.id;R.delete(ve),lr(y);return}else{let ve=_.get(y.method);ve&&(G=ve.handler,q=ve.type)}if(G||m)try{if(lr(y),G)if(y.params===void 0)q!==void 0&&q.numberOfParams!==0&&q.parameterStructures!==Ce.ParameterStructures.byName&&r.error(`Notification ${y.method} defines ${q.numberOfParams} params but received none.`),G();else if(Array.isArray(y.params)){let ve=y.params;y.method===Pa.type.method&&ve.length===2&&rp.is(ve[0])?G({token:ve[0],value:ve[1]}):(q!==void 0&&(q.parameterStructures===Ce.ParameterStructures.byName&&r.error(`Notification ${y.method} defines parameters by name but received parameters by position`),q.numberOfParams!==y.params.length&&r.error(`Notification ${y.method} defines ${q.numberOfParams} params but received ${ve.length} arguments`)),G(...ve))}else q!==void 0&&q.parameterStructures===Ce.ParameterStructures.byPosition&&r.error(`Notification ${y.method} defines parameters by position but received parameters by name`),G(y.params);else m&&m(y.method,y.params)}catch(ve){ve.message?r.error(`Notification handler '${y.method}' failed with message: ${ve.message}`):r.error(`Notification handler '${y.method}' failed unexpectedly.`)}else E.fire(y)}function xe(y){if(!y){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(y,null,4)}`);let q=y;if(It.string(q.id)||It.number(q.id)){let G=q.id,ve=T.get(G);ve&&ve.reject(new Error("The received response has neither a result nor an error property."))}}function je(y){if(y!=null)switch(v){case Xe.Verbose:return JSON.stringify(y,null,4);case Xe.Compact:return JSON.stringify(y);default:return}}function Me(y){if(!(v===Xe.Off||!O))if(C===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&y.params&&(q=`Params: ${je(y.params)} +"use strict";var NR=Object.create;var Qs=Object.defineProperty;var MR=Object.getOwnPropertyDescriptor;var AR=Object.getOwnPropertyNames;var zR=Object.getPrototypeOf,qR=Object.prototype.hasOwnProperty;var te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kn=(e,t)=>{for(var n in t)Qs(e,n,{get:t[n],enumerable:!0})},Hy=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of AR(t))!qR.call(e,r)&&r!==n&&Qs(e,r,{get:()=>t[r],enumerable:!(o=MR(t,r))||o.enumerable});return e};var Lt=(e,t,n)=>(n=e!=null?NR(zR(e)):{},Hy(t||!e||!e.__esModule?Qs(n,"default",{value:e,enumerable:!0}):n,e)),UR=e=>Hy(Qs({},"__esModule",{value:!0}),e);var rl=te(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.thenable=Ot.typedArray=Ot.stringArray=Ot.array=Ot.func=Ot.error=Ot.number=Ot.string=Ot.boolean=void 0;function FR(e){return e===!0||e===!1}Ot.boolean=FR;function Ky(e){return typeof e=="string"||e instanceof String}Ot.string=Ky;function ZR(e){return typeof e=="number"||e instanceof Number}Ot.number=ZR;function VR(e){return e instanceof Error}Ot.error=VR;function Yy(e){return typeof e=="function"}Ot.func=Yy;function Xy(e){return Array.isArray(e)}Ot.array=Xy;function WR(e){return Xy(e)&&e.every(t=>Ky(t))}Ot.stringArray=WR;function HR(e,t){return Array.isArray(e)&&e.every(t)}Ot.typedArray=HR;function JR(e){return e&&Yy(e.then)}Ot.thenable=JR});var gi=te(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.stringArray=Bt.array=Bt.func=Bt.error=Bt.number=Bt.string=Bt.boolean=void 0;function BR(e){return e===!0||e===!1}Bt.boolean=BR;function Qy(e){return typeof e=="string"||e instanceof String}Bt.string=Qy;function GR(e){return typeof e=="number"||e instanceof Number}Bt.number=GR;function KR(e){return e instanceof Error}Bt.error=KR;function YR(e){return typeof e=="function"}Bt.func=YR;function e_(e){return Array.isArray(e)}Bt.array=e_;function XR(e){return e_(e)&&e.every(t=>Qy(t))}Bt.stringArray=XR});var Nd=te(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.Message=Ie.NotificationType9=Ie.NotificationType8=Ie.NotificationType7=Ie.NotificationType6=Ie.NotificationType5=Ie.NotificationType4=Ie.NotificationType3=Ie.NotificationType2=Ie.NotificationType1=Ie.NotificationType0=Ie.NotificationType=Ie.RequestType9=Ie.RequestType8=Ie.RequestType7=Ie.RequestType6=Ie.RequestType5=Ie.RequestType4=Ie.RequestType3=Ie.RequestType2=Ie.RequestType1=Ie.RequestType=Ie.RequestType0=Ie.AbstractMessageSignature=Ie.ParameterStructures=Ie.ResponseError=Ie.ErrorCodes=void 0;var wo=gi(),dd;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(dd||(Ie.ErrorCodes=dd={}));var pd=class e extends Error{constructor(t,n,o){super(n),this.code=wo.number(t)?t:dd.UnknownErrorCode,this.data=o,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};Ie.ResponseError=pd;var dr=class e{constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};Ie.ParameterStructures=dr;dr.auto=new dr("auto");dr.byPosition=new dr("byPosition");dr.byName=new dr("byName");var _t=class{constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return dr.auto}};Ie.AbstractMessageSignature=_t;var fd=class extends _t{constructor(t){super(t,0)}};Ie.RequestType0=fd;var md=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Ie.RequestType=md;var hd=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Ie.RequestType1=hd;var gd=class extends _t{constructor(t){super(t,2)}};Ie.RequestType2=gd;var vd=class extends _t{constructor(t){super(t,3)}};Ie.RequestType3=vd;var yd=class extends _t{constructor(t){super(t,4)}};Ie.RequestType4=yd;var _d=class extends _t{constructor(t){super(t,5)}};Ie.RequestType5=_d;var bd=class extends _t{constructor(t){super(t,6)}};Ie.RequestType6=bd;var wd=class extends _t{constructor(t){super(t,7)}};Ie.RequestType7=wd;var xd=class extends _t{constructor(t){super(t,8)}};Ie.RequestType8=xd;var kd=class extends _t{constructor(t){super(t,9)}};Ie.RequestType9=kd;var Sd=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Ie.NotificationType=Sd;var Td=class extends _t{constructor(t){super(t,0)}};Ie.NotificationType0=Td;var Id=class extends _t{constructor(t,n=dr.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Ie.NotificationType1=Id;var $d=class extends _t{constructor(t){super(t,2)}};Ie.NotificationType2=$d;var Pd=class extends _t{constructor(t){super(t,3)}};Ie.NotificationType3=Pd;var Ed=class extends _t{constructor(t){super(t,4)}};Ie.NotificationType4=Ed;var Rd=class extends _t{constructor(t){super(t,5)}};Ie.NotificationType5=Rd;var Cd=class extends _t{constructor(t){super(t,6)}};Ie.NotificationType6=Cd;var Od=class extends _t{constructor(t){super(t,7)}};Ie.NotificationType7=Od;var Dd=class extends _t{constructor(t){super(t,8)}};Ie.NotificationType8=Dd;var jd=class extends _t{constructor(t){super(t,9)}};Ie.NotificationType9=jd;var t_;(function(e){function t(r){let i=r;return i&&wo.string(i.method)&&(wo.string(i.id)||wo.number(i.id))}e.isRequest=t;function n(r){let i=r;return i&&wo.string(i.method)&&r.id===void 0}e.isNotification=n;function o(r){let i=r;return i&&(i.result!==void 0||!!i.error)&&(wo.string(i.id)||wo.number(i.id)||i.id===null)}e.isResponse=o})(t_||(Ie.Message=t_={}))});var Ad=te(Wn=>{"use strict";var r_;Object.defineProperty(Wn,"__esModule",{value:!0});Wn.LRUCache=Wn.LinkedMap=Wn.Touch=void 0;var Gt;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(Gt||(Wn.Touch=Gt={}));var nl=class{constructor(){this[r_]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,n=Gt.None){let o=this._map.get(t);if(o)return n!==Gt.None&&this.touch(o,n),o.value}set(t,n,o=Gt.None){let r=this._map.get(t);if(r)r.value=n,o!==Gt.None&&this.touch(r,o);else{switch(r={key:t,value:n,next:void 0,previous:void 0},o){case Gt.None:this.addItemLast(r);break;case Gt.First:this.addItemFirst(r);break;case Gt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(t,r),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){let o=this._state,r=this._head;for(;r;){if(n?t.bind(n)(r.value,r.key,this):t(r.value,r.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let t=this._state,n=this._head,o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){let t=this._state,n=this._head,o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){let t=this._state,n=this._head,o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(r_=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,o=this.size;for(;n&&o>t;)this._map.delete(n.key),n=n.next,o--;this._head=n,this._size=o,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let n=t.next,o=t.previous;if(!n||!o)throw new Error("Invalid list");n.previous=o,o.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Gt.First&&n!==Gt.Last)){if(n===Gt.First){if(t===this._head)return;let o=t.next,r=t.previous;t===this._tail?(r.next=void 0,this._tail=r):(o.previous=r,r.next=o),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===Gt.Last){if(t===this._tail)return;let o=t.next,r=t.previous;t===this._head?(o.previous=void 0,this._head=o):(o.previous=r,r.next=o),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((n,o)=>{t.push([o,n])}),t}fromJSON(t){this.clear();for(let[n,o]of t)this.set(n,o)}};Wn.LinkedMap=nl;var Md=class extends nl{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=Gt.AsNew){return super.get(t,n)}peek(t){return super.get(t,Gt.None)}set(t,n){return super.set(t,n,Gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Wn.LRUCache=Md});var o_=te(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.Disposable=void 0;var n_;(function(e){function t(n){return{dispose:n}}e.create=t})(n_||(ol.Disposable=n_={}))});var Hn=te(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var zd;function qd(){if(zd===void 0)throw new Error("No runtime abstraction layer installed");return zd}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");zd=n}e.install=t})(qd||(qd={}));Ud.default=qd});var yi=te(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.Emitter=vi.Event=void 0;var QR=Hn(),i_;(function(e){let t={dispose(){}};e.None=function(){return t}})(i_||(vi.Event=i_={}));var Ld=class{add(t,n=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(o)&&o.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let o=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new Ld),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),r.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(r),r}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};vi.Emitter=il;il._noop=function(){}});var ll=te(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.CancellationTokenSource=_i.CancellationToken=void 0;var eC=Hn(),tC=gi(),Fd=yi(),al;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Fd.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Fd.Event.None});function t(n){let o=n;return o&&(o===e.None||o===e.Cancelled||tC.boolean(o.isCancellationRequested)&&!!o.onCancellationRequested)}e.is=t})(al||(_i.CancellationToken=al={}));var rC=Object.freeze(function(e,t){let n=(0,eC.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),sl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?rC:(this._emitter||(this._emitter=new Fd.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Zd=class{get token(){return this._token||(this._token=new sl),this._token}cancel(){this._token?this._token.cancel():this._token=al.Cancelled}dispose(){this._token?this._token instanceof sl&&this._token.dispose():this._token=al.None}};_i.CancellationTokenSource=Zd});var a_=te(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.SharedArrayReceiverStrategy=bi.SharedArraySenderStrategy=void 0;var nC=ll(),$a;(function(e){e.Continue=0,e.Cancelled=1})($a||($a={}));var Vd=class{constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let n=new SharedArrayBuffer(4),o=new Int32Array(n,0,1);o[0]=$a.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){let o=this.buffers.get(n);if(o===void 0)return;let r=new Int32Array(o,0,1);Atomics.store(r,0,$a.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};bi.SharedArraySenderStrategy=Vd;var Wd=class{constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===$a.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Hd=class{constructor(t){this.token=new Wd(t)}cancel(){}dispose(){}},Jd=class{constructor(){this.kind="request"}createCancellationTokenSource(t){let n=t.$cancellationData;return n===void 0?new nC.CancellationTokenSource:new Hd(n)}};bi.SharedArrayReceiverStrategy=Jd});var Gd=te(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.Semaphore=void 0;var oC=Hn(),Bd=class{constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,o)=>{this._waiting.push({thunk:t,resolve:n,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,oC.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=t.thunk();n instanceof Promise?n.then(o=>{this._active--,t.resolve(o),this.runNext()},o=>{this._active--,t.reject(o),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}};ul.Semaphore=Bd});var l_=te(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ReadableStreamMessageReader=Jn.AbstractMessageReader=Jn.MessageReader=void 0;var Yd=Hn(),wi=gi(),Kd=yi(),iC=Gd(),s_;(function(e){function t(n){let o=n;return o&&wi.func(o.listen)&&wi.func(o.dispose)&&wi.func(o.onError)&&wi.func(o.onClose)&&wi.func(o.onPartialMessage)}e.is=t})(s_||(Jn.MessageReader=s_={}));var cl=class{constructor(){this.errorEmitter=new Kd.Emitter,this.closeEmitter=new Kd.Emitter,this.partialMessageEmitter=new Kd.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${wi.string(t.message)?t.message:"unknown"}`)}};Jn.AbstractMessageReader=cl;var Xd;(function(e){function t(n){let o,r,i,s=new Map,l,u=new Map;if(n===void 0||typeof n=="string")o=n??"utf-8";else{if(o=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,s.set(i.name,i)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)s.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(l=n.contentTypeDecoder,u.set(l.name,l)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=(0,Yd.default)().applicationJson.decoder,u.set(l.name,l)),{charset:o,contentDecoder:i,contentDecoders:s,contentTypeDecoder:l,contentTypeDecoders:u}}e.fromOptions=t})(Xd||(Xd={}));var Qd=class extends cl{constructor(t,n){super(),this.readable=t,this.options=Xd.fromOptions(n),this.buffer=(0,Yd.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new iC.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let n=this.readable.onData(o=>{this.onData(o)});return this.readable.onError(o=>this.fireError(o)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let o=this.buffer.tryReadHeaders(!0);if(!o)return;let r=o.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(o))}`));return}let i=parseInt(r);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${r}`));return}this.nextMessageLength=i}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let o=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,r=await this.options.contentTypeDecoder.decode(o,this.options);this.callback(r)}).catch(o=>{this.fireError(o)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Yd.default)().timer.setTimeout((t,n)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Jn.ReadableStreamMessageReader=Qd});var f_=te(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.WriteableStreamMessageWriter=Bn.AbstractMessageWriter=Bn.MessageWriter=void 0;var u_=Hn(),Pa=gi(),aC=Gd(),c_=yi(),sC="Content-Length: ",d_=`\r +`,p_;(function(e){function t(n){let o=n;return o&&Pa.func(o.dispose)&&Pa.func(o.onClose)&&Pa.func(o.onError)&&Pa.func(o.write)}e.is=t})(p_||(Bn.MessageWriter=p_={}));var dl=class{constructor(){this.errorEmitter=new c_.Emitter,this.closeEmitter=new c_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,n,o){this.errorEmitter.fire([this.asError(t),n,o])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${Pa.string(t.message)?t.message:"unknown"}`)}};Bn.AbstractMessageWriter=dl;var ep;(function(e){function t(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,u_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,u_.default)().applicationJson.encoder}}e.fromOptions=t})(ep||(ep={}));var tp=class extends dl{constructor(t,n){super(),this.writable=t,this.options=ep.fromOptions(n),this.errorCount=0,this.writeSemaphore=new aC.Semaphore(1),this.writable.onError(o=>this.fireError(o)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(o=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(o):o).then(o=>{let r=[];return r.push(sC,o.byteLength.toString(),d_),r.push(d_),this.doWrite(t,r,o)},o=>{throw this.fireError(o),o}))}async doWrite(t,n,o){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(o)}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){this.writable.end()}};Bn.WriteableStreamMessageWriter=tp});var m_=te(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.AbstractMessageBuffer=void 0;var lC=13,uC=10,cC=`\r +`,rp=class{constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let n=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let n=0,o=0,r=0,i=0;e:for(;othis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(i)}if(this._chunks[0].byteLength>t){let i=this._chunks[0],s=this.asNative(i,t);return this._chunks[0]=i.slice(t),this._totalLength-=t,s}let n=this.allocNative(t),o=0,r=0;for(;t>0;){let i=this._chunks[r];if(i.byteLength>t){let s=i.slice(0,t);n.set(s,o),o+=t,this._chunks[r]=i.slice(t),this._totalLength-=t,t-=t}else n.set(i,o),o+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,t-=i.byteLength}return n}};pl.AbstractMessageBuffer=rp});var __=te(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createMessageConnection=Ne.ConnectionOptions=Ne.MessageStrategy=Ne.CancellationStrategy=Ne.CancellationSenderStrategy=Ne.CancellationReceiverStrategy=Ne.RequestCancellationReceiverStrategy=Ne.IdCancellationReceiverStrategy=Ne.ConnectionStrategy=Ne.ConnectionError=Ne.ConnectionErrors=Ne.LogTraceNotification=Ne.SetTraceNotification=Ne.TraceFormat=Ne.TraceValues=Ne.Trace=Ne.NullLogger=Ne.ProgressType=Ne.ProgressToken=void 0;var h_=Hn(),Tt=gi(),Re=Nd(),g_=Ad(),Ea=yi(),np=ll(),Oa;(function(e){e.type=new Re.NotificationType("$/cancelRequest")})(Oa||(Oa={}));var op;(function(e){function t(n){return typeof n=="string"||typeof n=="number"}e.is=t})(op||(Ne.ProgressToken=op={}));var Ra;(function(e){e.type=new Re.NotificationType("$/progress")})(Ra||(Ra={}));var ip=class{constructor(){}};Ne.ProgressType=ip;var ap;(function(e){function t(n){return Tt.func(n)}e.is=t})(ap||(ap={}));Ne.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Xe;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"})(Xe||(Ne.Trace=Xe={}));var v_;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"})(v_||(Ne.TraceValues=v_={}));(function(e){function t(o){if(!Tt.string(o))return e.Off;switch(o=o.toLowerCase(),o){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function n(o){switch(o){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}e.toString=n})(Xe||(Ne.Trace=Xe={}));var $r;(function(e){e.Text="text",e.JSON="json"})($r||(Ne.TraceFormat=$r={}));(function(e){function t(n){return Tt.string(n)?(n=n.toLowerCase(),n==="json"?e.JSON:e.Text):e.Text}e.fromString=t})($r||(Ne.TraceFormat=$r={}));var sp;(function(e){e.type=new Re.NotificationType("$/setTrace")})(sp||(Ne.SetTraceNotification=sp={}));var fl;(function(e){e.type=new Re.NotificationType("$/logTrace")})(fl||(Ne.LogTraceNotification=fl={}));var Ca;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"})(Ca||(Ne.ConnectionErrors=Ca={}));var xi=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};Ne.ConnectionError=xi;var lp;(function(e){function t(n){let o=n;return o&&Tt.func(o.cancelUndispatched)}e.is=t})(lp||(Ne.ConnectionStrategy=lp={}));var ml;(function(e){function t(n){let o=n;return o&&(o.kind===void 0||o.kind==="id")&&Tt.func(o.createCancellationTokenSource)&&(o.dispose===void 0||Tt.func(o.dispose))}e.is=t})(ml||(Ne.IdCancellationReceiverStrategy=ml={}));var up;(function(e){function t(n){let o=n;return o&&o.kind==="request"&&Tt.func(o.createCancellationTokenSource)&&(o.dispose===void 0||Tt.func(o.dispose))}e.is=t})(up||(Ne.RequestCancellationReceiverStrategy=up={}));var hl;(function(e){e.Message=Object.freeze({createCancellationTokenSource(n){return new np.CancellationTokenSource}});function t(n){return ml.is(n)||up.is(n)}e.is=t})(hl||(Ne.CancellationReceiverStrategy=hl={}));var gl;(function(e){e.Message=Object.freeze({sendCancellation(n,o){return n.sendNotification(Oa.type,{id:o})},cleanup(n){}});function t(n){let o=n;return o&&Tt.func(o.sendCancellation)&&Tt.func(o.cleanup)}e.is=t})(gl||(Ne.CancellationSenderStrategy=gl={}));var vl;(function(e){e.Message=Object.freeze({receiver:hl.Message,sender:gl.Message});function t(n){let o=n;return o&&hl.is(o.receiver)&&gl.is(o.sender)}e.is=t})(vl||(Ne.CancellationStrategy=vl={}));var yl;(function(e){function t(n){let o=n;return o&&Tt.func(o.handleMessage)}e.is=t})(yl||(Ne.MessageStrategy=yl={}));var y_;(function(e){function t(n){let o=n;return o&&(vl.is(o.cancellationStrategy)||lp.is(o.connectionStrategy)||yl.is(o.messageStrategy))}e.is=t})(y_||(Ne.ConnectionOptions=y_={}));var Kr;(function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"})(Kr||(Kr={}));function dC(e,t,n,o){let r=n!==void 0?n:Ne.NullLogger,i=0,s=0,l=0,u="2.0",c,d=new Map,m,_=new Map,h=new Map,b,k=new g_.LinkedMap,I=new Map,C=new Set,g=new Map,v=Xe.Off,R=$r.Text,O,N=Kr.New,K=new Ea.Emitter,ee=new Ea.Emitter,E=new Ea.Emitter,le=new Ea.Emitter,z=new Ea.Emitter,ye=o&&o.cancellationStrategy?o.cancellationStrategy:vl.Message;function D(y){if(y===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+y.toString()}function U(y){return y===null?"res-unknown-"+(++l).toString():"res-"+y.toString()}function A(){return"not-"+(++s).toString()}function L(y,q){Re.Message.isRequest(q)?y.set(D(q.id),q):Re.Message.isResponse(q)?y.set(U(q.id),q):y.set(A(),q)}function B(y){}function ne(){return N===Kr.Listening}function W(){return N===Kr.Closed}function pe(){return N===Kr.Disposed}function Pe(){(N===Kr.New||N===Kr.Listening)&&(N=Kr.Closed,ee.fire(void 0))}function Te(y){K.fire([y,void 0,void 0])}function Le(y){K.fire(y)}e.onClose(Pe),e.onError(Te),t.onClose(Pe),t.onError(Le);function oe(){b||k.size===0||(b=(0,h_.default)().timer.setImmediate(()=>{b=void 0,ge()}))}function J(y){Re.Message.isRequest(y)?se(y):Re.Message.isNotification(y)?F(y):Re.Message.isResponse(y)?me(y):xe(y)}function ge(){if(k.size===0)return;let y=k.shift();try{let q=o?.messageStrategy;yl.is(q)?q.handleMessage(y,J):J(y)}finally{oe()}}let we=y=>{try{if(Re.Message.isNotification(y)&&y.method===Oa.type.method){let q=y.params.id,G=D(q),ve=k.get(G);if(Re.Message.isRequest(ve)){let We=o?.connectionStrategy,st=We&&We.cancelUndispatched?We.cancelUndispatched(ve,B):void 0;if(st&&(st.error!==void 0||st.result!==void 0)){k.delete(G),g.delete(q),st.id=ve.id,lr(st,y.method,Date.now()),t.write(st).catch(()=>r.error("Sending response for canceled message failed."));return}}let Be=g.get(q);if(Be!==void 0){Be.cancel(),ur(y);return}else C.add(q)}L(k,y)}finally{oe()}};function se(y){if(pe())return;function q(ze,tt,$e){let ut={jsonrpc:u,id:y.id};ze instanceof Re.ResponseError?ut.error=ze.toJson():ut.result=ze===void 0?null:ze,lr(ut,tt,$e),t.write(ut).catch(()=>r.error("Sending response failed."))}function G(ze,tt,$e){let ut={jsonrpc:u,id:y.id,error:ze.toJson()};lr(ut,tt,$e),t.write(ut).catch(()=>r.error("Sending response failed."))}function ve(ze,tt,$e){ze===void 0&&(ze=null);let ut={jsonrpc:u,id:y.id,result:ze};lr(ut,tt,$e),t.write(ut).catch(()=>r.error("Sending response failed."))}Sr(y);let Be=d.get(y.method),We,st;Be&&(We=Be.type,st=Be.handler);let lt=Date.now();if(st||c){let ze=y.id??String(Date.now()),tt=ml.is(ye.receiver)?ye.receiver.createCancellationTokenSource(ze):ye.receiver.createCancellationTokenSource(y);y.id!==null&&C.has(y.id)&&tt.cancel(),y.id!==null&&g.set(ze,tt);try{let $e;if(st)if(y.params===void 0){if(We!==void 0&&We.numberOfParams!==0){G(new Re.ResponseError(Re.ErrorCodes.InvalidParams,`Request ${y.method} defines ${We.numberOfParams} params but received none.`),y.method,lt);return}$e=st(tt.token)}else if(Array.isArray(y.params)){if(We!==void 0&&We.parameterStructures===Re.ParameterStructures.byName){G(new Re.ResponseError(Re.ErrorCodes.InvalidParams,`Request ${y.method} defines parameters by name but received parameters by position`),y.method,lt);return}$e=st(...y.params,tt.token)}else{if(We!==void 0&&We.parameterStructures===Re.ParameterStructures.byPosition){G(new Re.ResponseError(Re.ErrorCodes.InvalidParams,`Request ${y.method} defines parameters by position but received parameters by name`),y.method,lt);return}$e=st(y.params,tt.token)}else c&&($e=c(y.method,y.params,tt.token));let ut=$e;$e?ut.then?ut.then(bt=>{g.delete(ze),q(bt,y.method,lt)},bt=>{g.delete(ze),bt instanceof Re.ResponseError?G(bt,y.method,lt):bt&&Tt.string(bt.message)?G(new Re.ResponseError(Re.ErrorCodes.InternalError,`Request ${y.method} failed with message: ${bt.message}`),y.method,lt):G(new Re.ResponseError(Re.ErrorCodes.InternalError,`Request ${y.method} failed unexpectedly without providing any details.`),y.method,lt)}):(g.delete(ze),q($e,y.method,lt)):(g.delete(ze),ve($e,y.method,lt))}catch($e){g.delete(ze),$e instanceof Re.ResponseError?q($e,y.method,lt):$e&&Tt.string($e.message)?G(new Re.ResponseError(Re.ErrorCodes.InternalError,`Request ${y.method} failed with message: ${$e.message}`),y.method,lt):G(new Re.ResponseError(Re.ErrorCodes.InternalError,`Request ${y.method} failed unexpectedly without providing any details.`),y.method,lt)}}else G(new Re.ResponseError(Re.ErrorCodes.MethodNotFound,`Unhandled method ${y.method}`),y.method,lt)}function me(y){if(!pe())if(y.id===null)y.error?r.error(`Received response message without id: Error is: +${JSON.stringify(y.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let q=y.id,G=I.get(q);if(et(y,G),G!==void 0){I.delete(q);try{if(y.error){let ve=y.error;G.reject(new Re.ResponseError(ve.code,ve.message,ve.data))}else if(y.result!==void 0)G.resolve(y.result);else throw new Error("Should never happen.")}catch(ve){ve.message?r.error(`Response handler '${G.method}' failed with message: ${ve.message}`):r.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function F(y){if(pe())return;let q,G;if(y.method===Oa.type.method){let ve=y.params.id;C.delete(ve),ur(y);return}else{let ve=_.get(y.method);ve&&(G=ve.handler,q=ve.type)}if(G||m)try{if(ur(y),G)if(y.params===void 0)q!==void 0&&q.numberOfParams!==0&&q.parameterStructures!==Re.ParameterStructures.byName&&r.error(`Notification ${y.method} defines ${q.numberOfParams} params but received none.`),G();else if(Array.isArray(y.params)){let ve=y.params;y.method===Ra.type.method&&ve.length===2&&op.is(ve[0])?G({token:ve[0],value:ve[1]}):(q!==void 0&&(q.parameterStructures===Re.ParameterStructures.byName&&r.error(`Notification ${y.method} defines parameters by name but received parameters by position`),q.numberOfParams!==y.params.length&&r.error(`Notification ${y.method} defines ${q.numberOfParams} params but received ${ve.length} arguments`)),G(...ve))}else q!==void 0&&q.parameterStructures===Re.ParameterStructures.byPosition&&r.error(`Notification ${y.method} defines parameters by position but received parameters by name`),G(y.params);else m&&m(y.method,y.params)}catch(ve){ve.message?r.error(`Notification handler '${y.method}' failed with message: ${ve.message}`):r.error(`Notification handler '${y.method}' failed unexpectedly.`)}else E.fire(y)}function xe(y){if(!y){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(y,null,4)}`);let q=y;if(Tt.string(q.id)||Tt.number(q.id)){let G=q.id,ve=I.get(G);ve&&ve.reject(new Error("The received response has neither a result nor an error property."))}}function je(y){if(y!=null)switch(v){case Xe.Verbose:return JSON.stringify(y,null,4);case Xe.Compact:return JSON.stringify(y);default:return}}function Me(y){if(!(v===Xe.Off||!O))if(R===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&y.params&&(q=`Params: ${je(y.params)} -`),O.log(`Sending request '${y.method} - (${y.id})'.`,q)}else Mt("send-request",y)}function Qt(y){if(!(v===Xe.Off||!O))if(C===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&(y.params?q=`Params: ${je(y.params)} +`),O.log(`Sending request '${y.method} - (${y.id})'.`,q)}else Mt("send-request",y)}function er(y){if(!(v===Xe.Off||!O))if(R===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&(y.params?q=`Params: ${je(y.params)} `:q=`No parameters provided. -`),O.log(`Sending notification '${y.method}'.`,q)}else Mt("send-notification",y)}function sr(y,q,G){if(!(v===Xe.Off||!O))if(C===$r.Text){let ve;(v===Xe.Verbose||v===Xe.Compact)&&(y.error&&y.error.data?ve=`Error data: ${je(y.error.data)} +`),O.log(`Sending notification '${y.method}'.`,q)}else Mt("send-notification",y)}function lr(y,q,G){if(!(v===Xe.Off||!O))if(R===$r.Text){let ve;(v===Xe.Verbose||v===Xe.Compact)&&(y.error&&y.error.data?ve=`Error data: ${je(y.error.data)} `:y.result?ve=`Result: ${je(y.result)} `:y.error===void 0&&(ve=`No result returned. -`)),O.log(`Sending response '${q} - (${y.id})'. Processing request took ${Date.now()-G}ms`,ve)}else Mt("send-response",y)}function Sr(y){if(!(v===Xe.Off||!O))if(C===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&y.params&&(q=`Params: ${je(y.params)} +`)),O.log(`Sending response '${q} - (${y.id})'. Processing request took ${Date.now()-G}ms`,ve)}else Mt("send-response",y)}function Sr(y){if(!(v===Xe.Off||!O))if(R===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&y.params&&(q=`Params: ${je(y.params)} -`),O.log(`Received request '${y.method} - (${y.id})'.`,q)}else Mt("receive-request",y)}function lr(y){if(!(v===Xe.Off||!O||y.method===fl.type.method))if(C===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&(y.params?q=`Params: ${je(y.params)} +`),O.log(`Received request '${y.method} - (${y.id})'.`,q)}else Mt("receive-request",y)}function ur(y){if(!(v===Xe.Off||!O||y.method===fl.type.method))if(R===$r.Text){let q;(v===Xe.Verbose||v===Xe.Compact)&&(y.params?q=`Params: ${je(y.params)} `:q=`No parameters provided. -`),O.log(`Received notification '${y.method}'.`,q)}else Mt("receive-notification",y)}function et(y,q){if(!(v===Xe.Off||!O))if(C===$r.Text){let G;if((v===Xe.Verbose||v===Xe.Compact)&&(y.error&&y.error.data?G=`Error data: ${je(y.error.data)} +`),O.log(`Received notification '${y.method}'.`,q)}else Mt("receive-notification",y)}function et(y,q){if(!(v===Xe.Off||!O))if(R===$r.Text){let G;if((v===Xe.Verbose||v===Xe.Compact)&&(y.error&&y.error.data?G=`Error data: ${je(y.error.data)} `:y.result?G=`Result: ${je(y.result)} `:y.error===void 0&&(G=`No result returned. -`)),q){let ve=y.error?` Request failed: ${y.error.message} (${y.error.code}).`:"";O.log(`Received response '${q.method} - (${y.id})' in ${Date.now()-q.timerStart}ms.${ve}`,G)}else O.log(`Received response ${y.id} without active response promise.`,G)}else Mt("receive-response",y)}function Mt(y,q){if(!O||v===Xe.Off)return;let G={isLSPMessage:!0,type:y,message:q,timestamp:Date.now()};O.log(G)}function ur(){if(W())throw new bi(Ea.Closed,"Connection is closed.");if(pe())throw new bi(Ea.Disposed,"Connection is disposed.")}function sn(){if(ne())throw new bi(Ea.AlreadyListening,"Connection is already listening")}function ln(){if(!ne())throw new Error("Call listen() first.")}function Ht(y){return y===void 0?null:y}function Hr(y){if(y!==null)return y}function Jr(y){return y!=null&&!Array.isArray(y)&&typeof y=="object"}function Dr(y,q){switch(y){case Ce.ParameterStructures.auto:return Jr(q)?Hr(q):[Ht(q)];case Ce.ParameterStructures.byName:if(!Jr(q))throw new Error("Received parameters by name but param is not an object literal.");return Hr(q);case Ce.ParameterStructures.byPosition:return[Ht(q)];default:throw new Error(`Unknown parameter structure ${y.toString()}`)}}function Br(y,q){let G,ve=y.numberOfParams;switch(ve){case 0:G=void 0;break;case 1:G=Dr(y.parameterStructures,q[0]);break;default:G=[];for(let Be=0;Be{ur();let G,ve;if(It.string(y)){G=y;let We=q[0],lt=0,ut=Ce.ParameterStructures.auto;Ce.ParameterStructures.is(We)&&(lt=1,ut=We);let ze=q.length,tt=ze-lt;switch(tt){case 0:ve=void 0;break;case 1:ve=Dr(ut,q[lt]);break;default:if(ut===Ce.ParameterStructures.byName)throw new Error(`Received ${tt} parameters for 'by Name' notification parameter structure.`);ve=q.slice(lt,ze).map($e=>Ht($e));break}}else{let We=q;G=y.method,ve=Br(y,We)}let Be={jsonrpc:u,method:G,params:ve};return Qt(Be),t.write(Be).catch(We=>{throw r.error("Sending notification failed."),We})},onNotification:(y,q)=>{ur();let G;return It.func(y)?m=y:q&&(It.string(y)?(G=y,_.set(y,{type:void 0,handler:q})):(G=y.method,_.set(y.method,{type:y,handler:q}))),{dispose:()=>{G!==void 0?_.delete(G):m=void 0}}},onProgress:(y,q,G)=>{if(h.has(q))throw new Error(`Progress handler for token ${q} already registered`);return h.set(q,G),{dispose:()=>{h.delete(q)}}},sendProgress:(y,q,G)=>x.sendNotification(Pa.type,{token:q,value:G}),onUnhandledProgress:le.event,sendRequest:(y,...q)=>{ur(),ln();let G,ve,Be;if(It.string(y)){G=y;let ze=q[0],tt=q[q.length-1],$e=0,ct=Ce.ParameterStructures.auto;Ce.ParameterStructures.is(ze)&&($e=1,ct=ze);let bt=q.length;tp.CancellationToken.is(tt)&&(bt=bt-1,Be=tt);let dt=bt-$e;switch(dt){case 0:ve=void 0;break;case 1:ve=Dr(ct,q[$e]);break;default:if(ct===Ce.ParameterStructures.byName)throw new Error(`Received ${dt} parameters for 'by Name' request parameter structure.`);ve=q.slice($e,bt).map(Fn=>Ht(Fn));break}}else{let ze=q;G=y.method,ve=Br(y,ze);let tt=y.numberOfParams;Be=tp.CancellationToken.is(ze[tt])?ze[tt]:void 0}let We=i++,lt;Be&&(lt=Be.onCancellationRequested(()=>{let ze=ye.sender.sendCancellation(x,We);return ze===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${We}`),Promise.resolve()):ze.catch(()=>{r.log(`Sending cancellation messages for id ${We} failed`)})}));let ut={jsonrpc:u,id:We,method:G,params:ve};return Me(ut),typeof ye.sender.enableCancellation=="function"&&ye.sender.enableCancellation(ut),new Promise(async(ze,tt)=>{let $e=dt=>{ze(dt),ye.sender.cleanup(We),lt?.dispose()},ct=dt=>{tt(dt),ye.sender.cleanup(We),lt?.dispose()},bt={method:G,timerStart:Date.now(),resolve:$e,reject:ct};try{await t.write(ut),T.set(We,bt)}catch(dt){throw r.error("Sending request failed."),bt.reject(new Ce.ResponseError(Ce.ErrorCodes.MessageWriteError,dt.message?dt.message:"Unknown reason")),dt}})},onRequest:(y,q)=>{ur();let G=null;return op.is(y)?(G=void 0,c=y):It.string(y)?(G=null,q!==void 0&&(G=y,d.set(y,{handler:q,type:void 0}))):q!==void 0&&(G=y.method,d.set(y.method,{type:y,handler:q})),{dispose:()=>{G!==null&&(G!==void 0?d.delete(G):c=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(y,q,G)=>{let ve=!1,Be=$r.Text;G!==void 0&&(It.boolean(G)?ve=G:(ve=G.sendNotification||!1,Be=G.traceFormat||$r.Text)),v=y,C=Be,v===Xe.Off?O=void 0:O=q,ve&&!W()&&!pe()&&await x.sendNotification(ip.type,{value:Xe.toString(y)})},onError:K.event,onClose:ee.event,onUnhandledNotification:E.event,onDispose:z.event,end:()=>{t.end()},dispose:()=>{if(pe())return;N=Gr.Disposed,z.fire(void 0);let y=new Ce.ResponseError(Ce.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let q of T.values())q.reject(y);T=new Map,g=new Map,R=new Set,k=new u_.LinkedMap,It.func(t.dispose)&&t.dispose(),It.func(e.dispose)&&e.dispose()},listen:()=>{ur(),sn(),N=Gr.Listening,e.listen(we)},inspect:()=>{(0,l_.default)().console.log("inspect")}};return x.onNotification(fl.type,y=>{if(v===Xe.Off||!O)return;let q=v===Xe.Verbose||v===Xe.Compact;O.log(y.message,q?y.verbose:void 0)}),x.onNotification(Pa.type,y=>{let q=h.get(y.token);q?q(y.value):le.fire(y)}),x}Ne.createMessageConnection=BC});var _l=te(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.ProgressType=Z.ProgressToken=Z.createMessageConnection=Z.NullLogger=Z.ConnectionOptions=Z.ConnectionStrategy=Z.AbstractMessageBuffer=Z.WriteableStreamMessageWriter=Z.AbstractMessageWriter=Z.MessageWriter=Z.ReadableStreamMessageReader=Z.AbstractMessageReader=Z.MessageReader=Z.SharedArrayReceiverStrategy=Z.SharedArraySenderStrategy=Z.CancellationToken=Z.CancellationTokenSource=Z.Emitter=Z.Event=Z.Disposable=Z.LRUCache=Z.Touch=Z.LinkedMap=Z.ParameterStructures=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.ErrorCodes=Z.ResponseError=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType0=Z.RequestType=Z.Message=Z.RAL=void 0;Z.MessageStrategy=Z.CancellationStrategy=Z.CancellationSenderStrategy=Z.CancellationReceiverStrategy=Z.ConnectionError=Z.ConnectionErrors=Z.LogTraceNotification=Z.SetTraceNotification=Z.TraceFormat=Z.TraceValues=Z.Trace=void 0;var ht=Dd();Object.defineProperty(Z,"Message",{enumerable:!0,get:function(){return ht.Message}});Object.defineProperty(Z,"RequestType",{enumerable:!0,get:function(){return ht.RequestType}});Object.defineProperty(Z,"RequestType0",{enumerable:!0,get:function(){return ht.RequestType0}});Object.defineProperty(Z,"RequestType1",{enumerable:!0,get:function(){return ht.RequestType1}});Object.defineProperty(Z,"RequestType2",{enumerable:!0,get:function(){return ht.RequestType2}});Object.defineProperty(Z,"RequestType3",{enumerable:!0,get:function(){return ht.RequestType3}});Object.defineProperty(Z,"RequestType4",{enumerable:!0,get:function(){return ht.RequestType4}});Object.defineProperty(Z,"RequestType5",{enumerable:!0,get:function(){return ht.RequestType5}});Object.defineProperty(Z,"RequestType6",{enumerable:!0,get:function(){return ht.RequestType6}});Object.defineProperty(Z,"RequestType7",{enumerable:!0,get:function(){return ht.RequestType7}});Object.defineProperty(Z,"RequestType8",{enumerable:!0,get:function(){return ht.RequestType8}});Object.defineProperty(Z,"RequestType9",{enumerable:!0,get:function(){return ht.RequestType9}});Object.defineProperty(Z,"ResponseError",{enumerable:!0,get:function(){return ht.ResponseError}});Object.defineProperty(Z,"ErrorCodes",{enumerable:!0,get:function(){return ht.ErrorCodes}});Object.defineProperty(Z,"NotificationType",{enumerable:!0,get:function(){return ht.NotificationType}});Object.defineProperty(Z,"NotificationType0",{enumerable:!0,get:function(){return ht.NotificationType0}});Object.defineProperty(Z,"NotificationType1",{enumerable:!0,get:function(){return ht.NotificationType1}});Object.defineProperty(Z,"NotificationType2",{enumerable:!0,get:function(){return ht.NotificationType2}});Object.defineProperty(Z,"NotificationType3",{enumerable:!0,get:function(){return ht.NotificationType3}});Object.defineProperty(Z,"NotificationType4",{enumerable:!0,get:function(){return ht.NotificationType4}});Object.defineProperty(Z,"NotificationType5",{enumerable:!0,get:function(){return ht.NotificationType5}});Object.defineProperty(Z,"NotificationType6",{enumerable:!0,get:function(){return ht.NotificationType6}});Object.defineProperty(Z,"NotificationType7",{enumerable:!0,get:function(){return ht.NotificationType7}});Object.defineProperty(Z,"NotificationType8",{enumerable:!0,get:function(){return ht.NotificationType8}});Object.defineProperty(Z,"NotificationType9",{enumerable:!0,get:function(){return ht.NotificationType9}});Object.defineProperty(Z,"ParameterStructures",{enumerable:!0,get:function(){return ht.ParameterStructures}});var lp=Nd();Object.defineProperty(Z,"LinkedMap",{enumerable:!0,get:function(){return lp.LinkedMap}});Object.defineProperty(Z,"LRUCache",{enumerable:!0,get:function(){return lp.LRUCache}});Object.defineProperty(Z,"Touch",{enumerable:!0,get:function(){return lp.Touch}});var GC=Yy();Object.defineProperty(Z,"Disposable",{enumerable:!0,get:function(){return GC.Disposable}});var f_=gi();Object.defineProperty(Z,"Event",{enumerable:!0,get:function(){return f_.Event}});Object.defineProperty(Z,"Emitter",{enumerable:!0,get:function(){return f_.Emitter}});var m_=ll();Object.defineProperty(Z,"CancellationTokenSource",{enumerable:!0,get:function(){return m_.CancellationTokenSource}});Object.defineProperty(Z,"CancellationToken",{enumerable:!0,get:function(){return m_.CancellationToken}});var h_=Qy();Object.defineProperty(Z,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return h_.SharedArraySenderStrategy}});Object.defineProperty(Z,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return h_.SharedArrayReceiverStrategy}});var up=t_();Object.defineProperty(Z,"MessageReader",{enumerable:!0,get:function(){return up.MessageReader}});Object.defineProperty(Z,"AbstractMessageReader",{enumerable:!0,get:function(){return up.AbstractMessageReader}});Object.defineProperty(Z,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return up.ReadableStreamMessageReader}});var cp=a_();Object.defineProperty(Z,"MessageWriter",{enumerable:!0,get:function(){return cp.MessageWriter}});Object.defineProperty(Z,"AbstractMessageWriter",{enumerable:!0,get:function(){return cp.AbstractMessageWriter}});Object.defineProperty(Z,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return cp.WriteableStreamMessageWriter}});var KC=s_();Object.defineProperty(Z,"AbstractMessageBuffer",{enumerable:!0,get:function(){return KC.AbstractMessageBuffer}});var Lt=p_();Object.defineProperty(Z,"ConnectionStrategy",{enumerable:!0,get:function(){return Lt.ConnectionStrategy}});Object.defineProperty(Z,"ConnectionOptions",{enumerable:!0,get:function(){return Lt.ConnectionOptions}});Object.defineProperty(Z,"NullLogger",{enumerable:!0,get:function(){return Lt.NullLogger}});Object.defineProperty(Z,"createMessageConnection",{enumerable:!0,get:function(){return Lt.createMessageConnection}});Object.defineProperty(Z,"ProgressToken",{enumerable:!0,get:function(){return Lt.ProgressToken}});Object.defineProperty(Z,"ProgressType",{enumerable:!0,get:function(){return Lt.ProgressType}});Object.defineProperty(Z,"Trace",{enumerable:!0,get:function(){return Lt.Trace}});Object.defineProperty(Z,"TraceValues",{enumerable:!0,get:function(){return Lt.TraceValues}});Object.defineProperty(Z,"TraceFormat",{enumerable:!0,get:function(){return Lt.TraceFormat}});Object.defineProperty(Z,"SetTraceNotification",{enumerable:!0,get:function(){return Lt.SetTraceNotification}});Object.defineProperty(Z,"LogTraceNotification",{enumerable:!0,get:function(){return Lt.LogTraceNotification}});Object.defineProperty(Z,"ConnectionErrors",{enumerable:!0,get:function(){return Lt.ConnectionErrors}});Object.defineProperty(Z,"ConnectionError",{enumerable:!0,get:function(){return Lt.ConnectionError}});Object.defineProperty(Z,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Lt.CancellationReceiverStrategy}});Object.defineProperty(Z,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Lt.CancellationSenderStrategy}});Object.defineProperty(Z,"CancellationStrategy",{enumerable:!0,get:function(){return Lt.CancellationStrategy}});Object.defineProperty(Z,"MessageStrategy",{enumerable:!0,get:function(){return Lt.MessageStrategy}});var YC=Wn();Z.RAL=YC.default});var y_=te(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var g_=require("util"),kn=_l(),bl=class e extends kn.AbstractMessageBuffer{constructor(t="utf-8"){super(t)}emptyBuffer(){return e.emptyBuffer}fromString(t,n){return Buffer.from(t,n)}toString(t,n){return t instanceof Buffer?t.toString(n):new g_.TextDecoder(n).decode(t)}asNative(t,n){return n===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,n):Buffer.from(t,0,n)}allocNative(t){return Buffer.allocUnsafe(t)}};bl.emptyBuffer=Buffer.allocUnsafe(0);var dp=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),kn.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),kn.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),kn.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),kn.Disposable.create(()=>this.stream.off("data",t))}},pp=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),kn.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),kn.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),kn.Disposable.create(()=>this.stream.off("end",t))}write(t,n){return new Promise((o,r)=>{let i=s=>{s==null?o():r(s)};typeof t=="string"?this.stream.write(t,n,i):this.stream.write(t,i)})}end(){this.stream.end()}},v_=Object.freeze({messageBuffer:Object.freeze({create:e=>new bl(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new g_.TextDecoder(t.charset).decode(e)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:e=>new dp(e),asWritableStream:e=>new pp(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let o=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(o)}},setImmediate(e,...t){let n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){let o=setInterval(e,t,...n);return{dispose:()=>clearInterval(o)}}})});function fp(){return v_}(function(e){function t(){kn.RAL.install(v_)}e.install=t})(fp||(fp={}));mp.default=fp});var xo=te(He=>{"use strict";var XC=He&&He.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),QC=He&&He.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&XC(t,e,n)};Object.defineProperty(He,"__esModule",{value:!0});He.createMessageConnection=He.createServerSocketTransport=He.createClientSocketTransport=He.createServerPipeTransport=He.createClientPipeTransport=He.generateRandomPipeName=He.StreamMessageWriter=He.StreamMessageReader=He.SocketMessageWriter=He.SocketMessageReader=He.PortMessageWriter=He.PortMessageReader=He.IPCMessageWriter=He.IPCMessageReader=void 0;var wi=y_();wi.default.install();var __=require("path"),eR=require("os"),tR=require("crypto"),kl=require("net"),Pr=_l();QC(_l(),He);var hp=class extends Pr.AbstractMessageReader{constructor(t){super(),this.process=t;let n=this.process;n.on("error",o=>this.fireError(o)),n.on("close",()=>this.fireClose())}listen(t){return this.process.on("message",t),Pr.Disposable.create(()=>this.process.off("message",t))}};He.IPCMessageReader=hp;var gp=class extends Pr.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let n=this.process;n.on("error",o=>this.fireError(o)),n.on("close",()=>this.fireClose)}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,t)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};He.IPCMessageWriter=gp;var vp=class extends Pr.AbstractMessageReader{constructor(t){super(),this.onData=new Pr.Emitter,t.on("close",()=>this.fireClose),t.on("error",n=>this.fireError(n)),t.on("message",n=>{this.onData.fire(n)})}listen(t){return this.onData.event(t)}};He.PortMessageReader=vp;var yp=class extends Pr.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",n=>this.fireError(n))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};He.PortMessageWriter=yp;var bo=class extends Pr.ReadableStreamMessageReader{constructor(t,n="utf-8"){super((0,wi.default)().stream.asReadableStream(t),n)}};He.SocketMessageReader=bo;var wo=class extends Pr.WriteableStreamMessageWriter{constructor(t,n){super((0,wi.default)().stream.asWritableStream(t),n),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};He.SocketMessageWriter=wo;var wl=class extends Pr.ReadableStreamMessageReader{constructor(t,n){super((0,wi.default)().stream.asReadableStream(t),n)}};He.StreamMessageReader=wl;var xl=class extends Pr.WriteableStreamMessageWriter{constructor(t,n){super((0,wi.default)().stream.asWritableStream(t),n)}};He.StreamMessageWriter=xl;var b_=process.env.XDG_RUNTIME_DIR,rR=new Map([["linux",107],["darwin",103]]);function nR(){let e=(0,tR.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;b_?t=__.join(b_,`vscode-ipc-${e}.sock`):t=__.join(eR.tmpdir(),`vscode-${e}.sock`);let n=rR.get(process.platform);return n!==void 0&&t.length>n&&(0,wi.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t}He.generateRandomPipeName=nR;function oR(e,t="utf-8"){let n,o=new Promise((r,i)=>{n=r});return new Promise((r,i)=>{let s=(0,kl.createServer)(l=>{s.close(),n([new bo(l,t),new wo(l,t)])});s.on("error",i),s.listen(e,()=>{s.removeListener("error",i),r({onConnected:()=>o})})})}He.createClientPipeTransport=oR;function iR(e,t="utf-8"){let n=(0,kl.createConnection)(e);return[new bo(n,t),new wo(n,t)]}He.createServerPipeTransport=iR;function aR(e,t="utf-8"){let n,o=new Promise((r,i)=>{n=r});return new Promise((r,i)=>{let s=(0,kl.createServer)(l=>{s.close(),n([new bo(l,t),new wo(l,t)])});s.on("error",i),s.listen(e,"127.0.0.1",()=>{s.removeListener("error",i),r({onConnected:()=>o})})})}He.createClientSocketTransport=aR;function sR(e,t="utf-8"){let n=(0,kl.createConnection)(e,"127.0.0.1");return[new bo(n,t),new wo(n,t)]}He.createServerSocketTransport=sR;function lR(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function uR(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function cR(e,t,n,o){n||(n=Pr.NullLogger);let r=lR(e)?new wl(e):e,i=uR(t)?new xl(t):t;return Pr.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,Pr.createMessageConnection)(r,i,n,o)}He.createMessageConnection=cR});var _p=te((G6,w_)=>{"use strict";w_.exports=xo()});var Il=te((x_,Sl)=>{(function(e){if(typeof Sl=="object"&&typeof Sl.exports=="object"){var t=e(require,x_);t!==void 0&&(Sl.exports=t)}else typeof define=="function"&&define.amd&&define(["require","exports"],e)})(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0;var n;(function(f){function I($){return typeof $=="string"}f.is=I})(n||(t.DocumentUri=n={}));var o;(function(f){function I($){return typeof $=="string"}f.is=I})(o||(t.URI=o={}));var r;(function(f){f.MIN_VALUE=-2147483648,f.MAX_VALUE=2147483647;function I($){return typeof $=="number"&&f.MIN_VALUE<=$&&$<=f.MAX_VALUE}f.is=I})(r||(t.integer=r={}));var i;(function(f){f.MIN_VALUE=0,f.MAX_VALUE=2147483647;function I($){return typeof $=="number"&&f.MIN_VALUE<=$&&$<=f.MAX_VALUE}f.is=I})(i||(t.uinteger=i={}));var s;(function(f){function I(w,p){return w===Number.MAX_VALUE&&(w=i.MAX_VALUE),p===Number.MAX_VALUE&&(p=i.MAX_VALUE),{line:w,character:p}}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&P.uinteger(p.line)&&P.uinteger(p.character)}f.is=$})(s||(t.Position=s={}));var l;(function(f){function I(w,p,M,H){if(P.uinteger(w)&&P.uinteger(p)&&P.uinteger(M)&&P.uinteger(H))return{start:s.create(w,p),end:s.create(M,H)};if(s.is(w)&&s.is(p))return{start:w,end:p};throw new Error("Range#create called with invalid arguments[".concat(w,", ").concat(p,", ").concat(M,", ").concat(H,"]"))}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&s.is(p.start)&&s.is(p.end)}f.is=$})(l||(t.Range=l={}));var u;(function(f){function I(w,p){return{uri:w,range:p}}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&l.is(p.range)&&(P.string(p.uri)||P.undefined(p.uri))}f.is=$})(u||(t.Location=u={}));var c;(function(f){function I(w,p,M,H){return{targetUri:w,targetRange:p,targetSelectionRange:M,originSelectionRange:H}}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&l.is(p.targetRange)&&P.string(p.targetUri)&&l.is(p.targetSelectionRange)&&(l.is(p.originSelectionRange)||P.undefined(p.originSelectionRange))}f.is=$})(c||(t.LocationLink=c={}));var d;(function(f){function I(w,p,M,H){return{red:w,green:p,blue:M,alpha:H}}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&P.numberRange(p.red,0,1)&&P.numberRange(p.green,0,1)&&P.numberRange(p.blue,0,1)&&P.numberRange(p.alpha,0,1)}f.is=$})(d||(t.Color=d={}));var m;(function(f){function I(w,p){return{range:w,color:p}}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&l.is(p.range)&&d.is(p.color)}f.is=$})(m||(t.ColorInformation=m={}));var _;(function(f){function I(w,p,M){return{label:w,textEdit:p,additionalTextEdits:M}}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&P.string(p.label)&&(P.undefined(p.textEdit)||O.is(p))&&(P.undefined(p.additionalTextEdits)||P.typedArray(p.additionalTextEdits,O.is))}f.is=$})(_||(t.ColorPresentation=_={}));var h;(function(f){f.Comment="comment",f.Imports="imports",f.Region="region"})(h||(t.FoldingRangeKind=h={}));var b;(function(f){function I(w,p,M,H,Oe,yt){var Ke={startLine:w,endLine:p};return P.defined(M)&&(Ke.startCharacter=M),P.defined(H)&&(Ke.endCharacter=H),P.defined(Oe)&&(Ke.kind=Oe),P.defined(yt)&&(Ke.collapsedText=yt),Ke}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&P.uinteger(p.startLine)&&P.uinteger(p.startLine)&&(P.undefined(p.startCharacter)||P.uinteger(p.startCharacter))&&(P.undefined(p.endCharacter)||P.uinteger(p.endCharacter))&&(P.undefined(p.kind)||P.string(p.kind))}f.is=$})(b||(t.FoldingRange=b={}));var k;(function(f){function I(w,p){return{location:w,message:p}}f.create=I;function $(w){var p=w;return P.defined(p)&&u.is(p.location)&&P.string(p.message)}f.is=$})(k||(t.DiagnosticRelatedInformation=k={}));var T;(function(f){f.Error=1,f.Warning=2,f.Information=3,f.Hint=4})(T||(t.DiagnosticSeverity=T={}));var R;(function(f){f.Unnecessary=1,f.Deprecated=2})(R||(t.DiagnosticTag=R={}));var g;(function(f){function I($){var w=$;return P.objectLiteral(w)&&P.string(w.href)}f.is=I})(g||(t.CodeDescription=g={}));var v;(function(f){function I(w,p,M,H,Oe,yt){var Ke={range:w,message:p};return P.defined(M)&&(Ke.severity=M),P.defined(H)&&(Ke.code=H),P.defined(Oe)&&(Ke.source=Oe),P.defined(yt)&&(Ke.relatedInformation=yt),Ke}f.create=I;function $(w){var p,M=w;return P.defined(M)&&l.is(M.range)&&P.string(M.message)&&(P.number(M.severity)||P.undefined(M.severity))&&(P.integer(M.code)||P.string(M.code)||P.undefined(M.code))&&(P.undefined(M.codeDescription)||P.string((p=M.codeDescription)===null||p===void 0?void 0:p.href))&&(P.string(M.source)||P.undefined(M.source))&&(P.undefined(M.relatedInformation)||P.typedArray(M.relatedInformation,k.is))}f.is=$})(v||(t.Diagnostic=v={}));var C;(function(f){function I(w,p){for(var M=[],H=2;H0&&(Oe.arguments=M),Oe}f.create=I;function $(w){var p=w;return P.defined(p)&&P.string(p.title)&&P.string(p.command)}f.is=$})(C||(t.Command=C={}));var O;(function(f){function I(M,H){return{range:M,newText:H}}f.replace=I;function $(M,H){return{range:{start:M,end:M},newText:H}}f.insert=$;function w(M){return{range:M,newText:""}}f.del=w;function p(M){var H=M;return P.objectLiteral(H)&&P.string(H.newText)&&l.is(H.range)}f.is=p})(O||(t.TextEdit=O={}));var N;(function(f){function I(w,p,M){var H={label:w};return p!==void 0&&(H.needsConfirmation=p),M!==void 0&&(H.description=M),H}f.create=I;function $(w){var p=w;return P.objectLiteral(p)&&P.string(p.label)&&(P.boolean(p.needsConfirmation)||p.needsConfirmation===void 0)&&(P.string(p.description)||p.description===void 0)}f.is=$})(N||(t.ChangeAnnotation=N={}));var K;(function(f){function I($){var w=$;return P.string(w)}f.is=I})(K||(t.ChangeAnnotationIdentifier=K={}));var ee;(function(f){function I(M,H,Oe){return{range:M,newText:H,annotationId:Oe}}f.replace=I;function $(M,H,Oe){return{range:{start:M,end:M},newText:H,annotationId:Oe}}f.insert=$;function w(M,H){return{range:M,newText:"",annotationId:H}}f.del=w;function p(M){var H=M;return O.is(H)&&(N.is(H.annotationId)||K.is(H.annotationId))}f.is=p})(ee||(t.AnnotatedTextEdit=ee={}));var E;(function(f){function I(w,p){return{textDocument:w,edits:p}}f.create=I;function $(w){var p=w;return P.defined(p)&&W.is(p.textDocument)&&Array.isArray(p.edits)}f.is=$})(E||(t.TextDocumentEdit=E={}));var le;(function(f){function I(w,p,M){var H={kind:"create",uri:w};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(H.options=p),M!==void 0&&(H.annotationId=M),H}f.create=I;function $(w){var p=w;return p&&p.kind==="create"&&P.string(p.uri)&&(p.options===void 0||(p.options.overwrite===void 0||P.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||P.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||K.is(p.annotationId))}f.is=$})(le||(t.CreateFile=le={}));var z;(function(f){function I(w,p,M,H){var Oe={kind:"rename",oldUri:w,newUri:p};return M!==void 0&&(M.overwrite!==void 0||M.ignoreIfExists!==void 0)&&(Oe.options=M),H!==void 0&&(Oe.annotationId=H),Oe}f.create=I;function $(w){var p=w;return p&&p.kind==="rename"&&P.string(p.oldUri)&&P.string(p.newUri)&&(p.options===void 0||(p.options.overwrite===void 0||P.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||P.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||K.is(p.annotationId))}f.is=$})(z||(t.RenameFile=z={}));var ye;(function(f){function I(w,p,M){var H={kind:"delete",uri:w};return p!==void 0&&(p.recursive!==void 0||p.ignoreIfNotExists!==void 0)&&(H.options=p),M!==void 0&&(H.annotationId=M),H}f.create=I;function $(w){var p=w;return p&&p.kind==="delete"&&P.string(p.uri)&&(p.options===void 0||(p.options.recursive===void 0||P.boolean(p.options.recursive))&&(p.options.ignoreIfNotExists===void 0||P.boolean(p.options.ignoreIfNotExists)))&&(p.annotationId===void 0||K.is(p.annotationId))}f.is=$})(ye||(t.DeleteFile=ye={}));var D;(function(f){function I($){var w=$;return w&&(w.changes!==void 0||w.documentChanges!==void 0)&&(w.documentChanges===void 0||w.documentChanges.every(function(p){return P.string(p.kind)?le.is(p)||z.is(p)||ye.is(p):E.is(p)}))}f.is=I})(D||(t.WorkspaceEdit=D={}));var U=(function(){function f(I,$){this.edits=I,this.changeAnnotations=$}return f.prototype.insert=function(I,$,w){var p,M;if(w===void 0?p=O.insert(I,$):K.is(w)?(M=w,p=ee.insert(I,$,w)):(this.assertChangeAnnotations(this.changeAnnotations),M=this.changeAnnotations.manage(w),p=ee.insert(I,$,M)),this.edits.push(p),M!==void 0)return M},f.prototype.replace=function(I,$,w){var p,M;if(w===void 0?p=O.replace(I,$):K.is(w)?(M=w,p=ee.replace(I,$,w)):(this.assertChangeAnnotations(this.changeAnnotations),M=this.changeAnnotations.manage(w),p=ee.replace(I,$,M)),this.edits.push(p),M!==void 0)return M},f.prototype.delete=function(I,$){var w,p;if($===void 0?w=O.del(I):K.is($)?(p=$,w=ee.del(I,$)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage($),w=ee.del(I,p)),this.edits.push(w),p!==void 0)return p},f.prototype.add=function(I){this.edits.push(I)},f.prototype.all=function(){return this.edits},f.prototype.clear=function(){this.edits.splice(0,this.edits.length)},f.prototype.assertChangeAnnotations=function(I){if(I===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},f})(),A=(function(){function f(I){this._annotations=I===void 0?Object.create(null):I,this._counter=0,this._size=0}return f.prototype.all=function(){return this._annotations},Object.defineProperty(f.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),f.prototype.manage=function(I,$){var w;if(K.is(I)?w=I:(w=this.nextId(),$=I),this._annotations[w]!==void 0)throw new Error("Id ".concat(w," is already in use."));if($===void 0)throw new Error("No annotation provided for id ".concat(w));return this._annotations[w]=$,this._size++,w},f.prototype.nextId=function(){return this._counter++,this._counter.toString()},f})(),L=(function(){function f(I){var $=this;this._textEditChanges=Object.create(null),I!==void 0?(this._workspaceEdit=I,I.documentChanges?(this._changeAnnotations=new A(I.changeAnnotations),I.changeAnnotations=this._changeAnnotations.all(),I.documentChanges.forEach(function(w){if(E.is(w)){var p=new U(w.edits,$._changeAnnotations);$._textEditChanges[w.textDocument.uri]=p}})):I.changes&&Object.keys(I.changes).forEach(function(w){var p=new U(I.changes[w]);$._textEditChanges[w]=p})):this._workspaceEdit={}}return Object.defineProperty(f.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),f.prototype.getTextEditChange=function(I){if(W.is(I)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var $={uri:I.uri,version:I.version},w=this._textEditChanges[$.uri];if(!w){var p=[],M={textDocument:$,edits:p};this._workspaceEdit.documentChanges.push(M),w=new U(p,this._changeAnnotations),this._textEditChanges[$.uri]=w}return w}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var w=this._textEditChanges[I];if(!w){var p=[];this._workspaceEdit.changes[I]=p,w=new U(p),this._textEditChanges[I]=w}return w}},f.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new A,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},f.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},f.prototype.createFile=function(I,$,w){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;N.is($)||K.is($)?p=$:w=$;var M,H;if(p===void 0?M=le.create(I,w):(H=K.is(p)?p:this._changeAnnotations.manage(p),M=le.create(I,w,H)),this._workspaceEdit.documentChanges.push(M),H!==void 0)return H},f.prototype.renameFile=function(I,$,w,p){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var M;N.is(w)||K.is(w)?M=w:p=w;var H,Oe;if(M===void 0?H=z.create(I,$,p):(Oe=K.is(M)?M:this._changeAnnotations.manage(M),H=z.create(I,$,p,Oe)),this._workspaceEdit.documentChanges.push(H),Oe!==void 0)return Oe},f.prototype.deleteFile=function(I,$,w){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;N.is($)||K.is($)?p=$:w=$;var M,H;if(p===void 0?M=ye.create(I,w):(H=K.is(p)?p:this._changeAnnotations.manage(p),M=ye.create(I,w,H)),this._workspaceEdit.documentChanges.push(M),H!==void 0)return H},f})();t.WorkspaceChange=L;var B;(function(f){function I(w){return{uri:w}}f.create=I;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)}f.is=$})(B||(t.TextDocumentIdentifier=B={}));var ne;(function(f){function I(w,p){return{uri:w,version:p}}f.create=I;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)&&P.integer(p.version)}f.is=$})(ne||(t.VersionedTextDocumentIdentifier=ne={}));var W;(function(f){function I(w,p){return{uri:w,version:p}}f.create=I;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)&&(p.version===null||P.integer(p.version))}f.is=$})(W||(t.OptionalVersionedTextDocumentIdentifier=W={}));var pe;(function(f){function I(w,p,M,H){return{uri:w,languageId:p,version:M,text:H}}f.create=I;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)&&P.string(p.languageId)&&P.integer(p.version)&&P.string(p.text)}f.is=$})(pe||(t.TextDocumentItem=pe={}));var Pe;(function(f){f.PlainText="plaintext",f.Markdown="markdown";function I($){var w=$;return w===f.PlainText||w===f.Markdown}f.is=I})(Pe||(t.MarkupKind=Pe={}));var Ie;(function(f){function I($){var w=$;return P.objectLiteral($)&&Pe.is(w.kind)&&P.string(w.value)}f.is=I})(Ie||(t.MarkupContent=Ie={}));var Le;(function(f){f.Text=1,f.Method=2,f.Function=3,f.Constructor=4,f.Field=5,f.Variable=6,f.Class=7,f.Interface=8,f.Module=9,f.Property=10,f.Unit=11,f.Value=12,f.Enum=13,f.Keyword=14,f.Snippet=15,f.Color=16,f.File=17,f.Reference=18,f.Folder=19,f.EnumMember=20,f.Constant=21,f.Struct=22,f.Event=23,f.Operator=24,f.TypeParameter=25})(Le||(t.CompletionItemKind=Le={}));var oe;(function(f){f.PlainText=1,f.Snippet=2})(oe||(t.InsertTextFormat=oe={}));var J;(function(f){f.Deprecated=1})(J||(t.CompletionItemTag=J={}));var ge;(function(f){function I(w,p,M){return{newText:w,insert:p,replace:M}}f.create=I;function $(w){var p=w;return p&&P.string(p.newText)&&l.is(p.insert)&&l.is(p.replace)}f.is=$})(ge||(t.InsertReplaceEdit=ge={}));var we;(function(f){f.asIs=1,f.adjustIndentation=2})(we||(t.InsertTextMode=we={}));var se;(function(f){function I($){var w=$;return w&&(P.string(w.detail)||w.detail===void 0)&&(P.string(w.description)||w.description===void 0)}f.is=I})(se||(t.CompletionItemLabelDetails=se={}));var me;(function(f){function I($){return{label:$}}f.create=I})(me||(t.CompletionItem=me={}));var F;(function(f){function I($,w){return{items:$||[],isIncomplete:!!w}}f.create=I})(F||(t.CompletionList=F={}));var xe;(function(f){function I(w){return w.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}f.fromPlainText=I;function $(w){var p=w;return P.string(p)||P.objectLiteral(p)&&P.string(p.language)&&P.string(p.value)}f.is=$})(xe||(t.MarkedString=xe={}));var je;(function(f){function I($){var w=$;return!!w&&P.objectLiteral(w)&&(Ie.is(w.contents)||xe.is(w.contents)||P.typedArray(w.contents,xe.is))&&($.range===void 0||l.is($.range))}f.is=I})(je||(t.Hover=je={}));var Me;(function(f){function I($,w){return w?{label:$,documentation:w}:{label:$}}f.create=I})(Me||(t.ParameterInformation=Me={}));var Qt;(function(f){function I($,w){for(var p=[],M=2;M{cr();let G,ve;if(Tt.string(y)){G=y;let We=q[0],st=0,lt=Re.ParameterStructures.auto;Re.ParameterStructures.is(We)&&(st=1,lt=We);let ze=q.length,tt=ze-st;switch(tt){case 0:ve=void 0;break;case 1:ve=Dr(lt,q[st]);break;default:if(lt===Re.ParameterStructures.byName)throw new Error(`Received ${tt} parameters for 'by Name' notification parameter structure.`);ve=q.slice(st,ze).map($e=>Jt($e));break}}else{let We=q;G=y.method,ve=Gr(y,We)}let Be={jsonrpc:u,method:G,params:ve};return er(Be),t.write(Be).catch(We=>{throw r.error("Sending notification failed."),We})},onNotification:(y,q)=>{cr();let G;return Tt.func(y)?m=y:q&&(Tt.string(y)?(G=y,_.set(y,{type:void 0,handler:q})):(G=y.method,_.set(y.method,{type:y,handler:q}))),{dispose:()=>{G!==void 0?_.delete(G):m=void 0}}},onProgress:(y,q,G)=>{if(h.has(q))throw new Error(`Progress handler for token ${q} already registered`);return h.set(q,G),{dispose:()=>{h.delete(q)}}},sendProgress:(y,q,G)=>x.sendNotification(Ra.type,{token:q,value:G}),onUnhandledProgress:le.event,sendRequest:(y,...q)=>{cr(),un();let G,ve,Be;if(Tt.string(y)){G=y;let ze=q[0],tt=q[q.length-1],$e=0,ut=Re.ParameterStructures.auto;Re.ParameterStructures.is(ze)&&($e=1,ut=ze);let bt=q.length;np.CancellationToken.is(tt)&&(bt=bt-1,Be=tt);let ct=bt-$e;switch(ct){case 0:ve=void 0;break;case 1:ve=Dr(ut,q[$e]);break;default:if(ut===Re.ParameterStructures.byName)throw new Error(`Received ${ct} parameters for 'by Name' request parameter structure.`);ve=q.slice($e,bt).map(Zn=>Jt(Zn));break}}else{let ze=q;G=y.method,ve=Gr(y,ze);let tt=y.numberOfParams;Be=np.CancellationToken.is(ze[tt])?ze[tt]:void 0}let We=i++,st;Be&&(st=Be.onCancellationRequested(()=>{let ze=ye.sender.sendCancellation(x,We);return ze===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${We}`),Promise.resolve()):ze.catch(()=>{r.log(`Sending cancellation messages for id ${We} failed`)})}));let lt={jsonrpc:u,id:We,method:G,params:ve};return Me(lt),typeof ye.sender.enableCancellation=="function"&&ye.sender.enableCancellation(lt),new Promise(async(ze,tt)=>{let $e=ct=>{ze(ct),ye.sender.cleanup(We),st?.dispose()},ut=ct=>{tt(ct),ye.sender.cleanup(We),st?.dispose()},bt={method:G,timerStart:Date.now(),resolve:$e,reject:ut};try{await t.write(lt),I.set(We,bt)}catch(ct){throw r.error("Sending request failed."),bt.reject(new Re.ResponseError(Re.ErrorCodes.MessageWriteError,ct.message?ct.message:"Unknown reason")),ct}})},onRequest:(y,q)=>{cr();let G=null;return ap.is(y)?(G=void 0,c=y):Tt.string(y)?(G=null,q!==void 0&&(G=y,d.set(y,{handler:q,type:void 0}))):q!==void 0&&(G=y.method,d.set(y.method,{type:y,handler:q})),{dispose:()=>{G!==null&&(G!==void 0?d.delete(G):c=void 0)}}},hasPendingResponse:()=>I.size>0,trace:async(y,q,G)=>{let ve=!1,Be=$r.Text;G!==void 0&&(Tt.boolean(G)?ve=G:(ve=G.sendNotification||!1,Be=G.traceFormat||$r.Text)),v=y,R=Be,v===Xe.Off?O=void 0:O=q,ve&&!W()&&!pe()&&await x.sendNotification(sp.type,{value:Xe.toString(y)})},onError:K.event,onClose:ee.event,onUnhandledNotification:E.event,onDispose:z.event,end:()=>{t.end()},dispose:()=>{if(pe())return;N=Kr.Disposed,z.fire(void 0);let y=new Re.ResponseError(Re.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let q of I.values())q.reject(y);I=new Map,g=new Map,C=new Set,k=new g_.LinkedMap,Tt.func(t.dispose)&&t.dispose(),Tt.func(e.dispose)&&e.dispose()},listen:()=>{cr(),ln(),N=Kr.Listening,e.listen(we)},inspect:()=>{(0,h_.default)().console.log("inspect")}};return x.onNotification(fl.type,y=>{if(v===Xe.Off||!O)return;let q=v===Xe.Verbose||v===Xe.Compact;O.log(y.message,q?y.verbose:void 0)}),x.onNotification(Ra.type,y=>{let q=h.get(y.token);q?q(y.value):le.fire(y)}),x}Ne.createMessageConnection=dC});var _l=te(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.ProgressType=Z.ProgressToken=Z.createMessageConnection=Z.NullLogger=Z.ConnectionOptions=Z.ConnectionStrategy=Z.AbstractMessageBuffer=Z.WriteableStreamMessageWriter=Z.AbstractMessageWriter=Z.MessageWriter=Z.ReadableStreamMessageReader=Z.AbstractMessageReader=Z.MessageReader=Z.SharedArrayReceiverStrategy=Z.SharedArraySenderStrategy=Z.CancellationToken=Z.CancellationTokenSource=Z.Emitter=Z.Event=Z.Disposable=Z.LRUCache=Z.Touch=Z.LinkedMap=Z.ParameterStructures=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.ErrorCodes=Z.ResponseError=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType0=Z.RequestType=Z.Message=Z.RAL=void 0;Z.MessageStrategy=Z.CancellationStrategy=Z.CancellationSenderStrategy=Z.CancellationReceiverStrategy=Z.ConnectionError=Z.ConnectionErrors=Z.LogTraceNotification=Z.SetTraceNotification=Z.TraceFormat=Z.TraceValues=Z.Trace=void 0;var ht=Nd();Object.defineProperty(Z,"Message",{enumerable:!0,get:function(){return ht.Message}});Object.defineProperty(Z,"RequestType",{enumerable:!0,get:function(){return ht.RequestType}});Object.defineProperty(Z,"RequestType0",{enumerable:!0,get:function(){return ht.RequestType0}});Object.defineProperty(Z,"RequestType1",{enumerable:!0,get:function(){return ht.RequestType1}});Object.defineProperty(Z,"RequestType2",{enumerable:!0,get:function(){return ht.RequestType2}});Object.defineProperty(Z,"RequestType3",{enumerable:!0,get:function(){return ht.RequestType3}});Object.defineProperty(Z,"RequestType4",{enumerable:!0,get:function(){return ht.RequestType4}});Object.defineProperty(Z,"RequestType5",{enumerable:!0,get:function(){return ht.RequestType5}});Object.defineProperty(Z,"RequestType6",{enumerable:!0,get:function(){return ht.RequestType6}});Object.defineProperty(Z,"RequestType7",{enumerable:!0,get:function(){return ht.RequestType7}});Object.defineProperty(Z,"RequestType8",{enumerable:!0,get:function(){return ht.RequestType8}});Object.defineProperty(Z,"RequestType9",{enumerable:!0,get:function(){return ht.RequestType9}});Object.defineProperty(Z,"ResponseError",{enumerable:!0,get:function(){return ht.ResponseError}});Object.defineProperty(Z,"ErrorCodes",{enumerable:!0,get:function(){return ht.ErrorCodes}});Object.defineProperty(Z,"NotificationType",{enumerable:!0,get:function(){return ht.NotificationType}});Object.defineProperty(Z,"NotificationType0",{enumerable:!0,get:function(){return ht.NotificationType0}});Object.defineProperty(Z,"NotificationType1",{enumerable:!0,get:function(){return ht.NotificationType1}});Object.defineProperty(Z,"NotificationType2",{enumerable:!0,get:function(){return ht.NotificationType2}});Object.defineProperty(Z,"NotificationType3",{enumerable:!0,get:function(){return ht.NotificationType3}});Object.defineProperty(Z,"NotificationType4",{enumerable:!0,get:function(){return ht.NotificationType4}});Object.defineProperty(Z,"NotificationType5",{enumerable:!0,get:function(){return ht.NotificationType5}});Object.defineProperty(Z,"NotificationType6",{enumerable:!0,get:function(){return ht.NotificationType6}});Object.defineProperty(Z,"NotificationType7",{enumerable:!0,get:function(){return ht.NotificationType7}});Object.defineProperty(Z,"NotificationType8",{enumerable:!0,get:function(){return ht.NotificationType8}});Object.defineProperty(Z,"NotificationType9",{enumerable:!0,get:function(){return ht.NotificationType9}});Object.defineProperty(Z,"ParameterStructures",{enumerable:!0,get:function(){return ht.ParameterStructures}});var cp=Ad();Object.defineProperty(Z,"LinkedMap",{enumerable:!0,get:function(){return cp.LinkedMap}});Object.defineProperty(Z,"LRUCache",{enumerable:!0,get:function(){return cp.LRUCache}});Object.defineProperty(Z,"Touch",{enumerable:!0,get:function(){return cp.Touch}});var pC=o_();Object.defineProperty(Z,"Disposable",{enumerable:!0,get:function(){return pC.Disposable}});var b_=yi();Object.defineProperty(Z,"Event",{enumerable:!0,get:function(){return b_.Event}});Object.defineProperty(Z,"Emitter",{enumerable:!0,get:function(){return b_.Emitter}});var w_=ll();Object.defineProperty(Z,"CancellationTokenSource",{enumerable:!0,get:function(){return w_.CancellationTokenSource}});Object.defineProperty(Z,"CancellationToken",{enumerable:!0,get:function(){return w_.CancellationToken}});var x_=a_();Object.defineProperty(Z,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return x_.SharedArraySenderStrategy}});Object.defineProperty(Z,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return x_.SharedArrayReceiverStrategy}});var dp=l_();Object.defineProperty(Z,"MessageReader",{enumerable:!0,get:function(){return dp.MessageReader}});Object.defineProperty(Z,"AbstractMessageReader",{enumerable:!0,get:function(){return dp.AbstractMessageReader}});Object.defineProperty(Z,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return dp.ReadableStreamMessageReader}});var pp=f_();Object.defineProperty(Z,"MessageWriter",{enumerable:!0,get:function(){return pp.MessageWriter}});Object.defineProperty(Z,"AbstractMessageWriter",{enumerable:!0,get:function(){return pp.AbstractMessageWriter}});Object.defineProperty(Z,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return pp.WriteableStreamMessageWriter}});var fC=m_();Object.defineProperty(Z,"AbstractMessageBuffer",{enumerable:!0,get:function(){return fC.AbstractMessageBuffer}});var Ft=__();Object.defineProperty(Z,"ConnectionStrategy",{enumerable:!0,get:function(){return Ft.ConnectionStrategy}});Object.defineProperty(Z,"ConnectionOptions",{enumerable:!0,get:function(){return Ft.ConnectionOptions}});Object.defineProperty(Z,"NullLogger",{enumerable:!0,get:function(){return Ft.NullLogger}});Object.defineProperty(Z,"createMessageConnection",{enumerable:!0,get:function(){return Ft.createMessageConnection}});Object.defineProperty(Z,"ProgressToken",{enumerable:!0,get:function(){return Ft.ProgressToken}});Object.defineProperty(Z,"ProgressType",{enumerable:!0,get:function(){return Ft.ProgressType}});Object.defineProperty(Z,"Trace",{enumerable:!0,get:function(){return Ft.Trace}});Object.defineProperty(Z,"TraceValues",{enumerable:!0,get:function(){return Ft.TraceValues}});Object.defineProperty(Z,"TraceFormat",{enumerable:!0,get:function(){return Ft.TraceFormat}});Object.defineProperty(Z,"SetTraceNotification",{enumerable:!0,get:function(){return Ft.SetTraceNotification}});Object.defineProperty(Z,"LogTraceNotification",{enumerable:!0,get:function(){return Ft.LogTraceNotification}});Object.defineProperty(Z,"ConnectionErrors",{enumerable:!0,get:function(){return Ft.ConnectionErrors}});Object.defineProperty(Z,"ConnectionError",{enumerable:!0,get:function(){return Ft.ConnectionError}});Object.defineProperty(Z,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ft.CancellationReceiverStrategy}});Object.defineProperty(Z,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ft.CancellationSenderStrategy}});Object.defineProperty(Z,"CancellationStrategy",{enumerable:!0,get:function(){return Ft.CancellationStrategy}});Object.defineProperty(Z,"MessageStrategy",{enumerable:!0,get:function(){return Ft.MessageStrategy}});var mC=Hn();Z.RAL=mC.default});var T_=te(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var k_=require("util"),Sn=_l(),bl=class e extends Sn.AbstractMessageBuffer{constructor(t="utf-8"){super(t)}emptyBuffer(){return e.emptyBuffer}fromString(t,n){return Buffer.from(t,n)}toString(t,n){return t instanceof Buffer?t.toString(n):new k_.TextDecoder(n).decode(t)}asNative(t,n){return n===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,n):Buffer.from(t,0,n)}allocNative(t){return Buffer.allocUnsafe(t)}};bl.emptyBuffer=Buffer.allocUnsafe(0);var fp=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),Sn.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Sn.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Sn.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),Sn.Disposable.create(()=>this.stream.off("data",t))}},mp=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),Sn.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Sn.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Sn.Disposable.create(()=>this.stream.off("end",t))}write(t,n){return new Promise((o,r)=>{let i=s=>{s==null?o():r(s)};typeof t=="string"?this.stream.write(t,n,i):this.stream.write(t,i)})}end(){this.stream.end()}},S_=Object.freeze({messageBuffer:Object.freeze({create:e=>new bl(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new k_.TextDecoder(t.charset).decode(e)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:e=>new fp(e),asWritableStream:e=>new mp(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let o=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(o)}},setImmediate(e,...t){let n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){let o=setInterval(e,t,...n);return{dispose:()=>clearInterval(o)}}})});function hp(){return S_}(function(e){function t(){Sn.RAL.install(S_)}e.install=t})(hp||(hp={}));gp.default=hp});var So=te(He=>{"use strict";var hC=He&&He.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),gC=He&&He.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&hC(t,e,n)};Object.defineProperty(He,"__esModule",{value:!0});He.createMessageConnection=He.createServerSocketTransport=He.createClientSocketTransport=He.createServerPipeTransport=He.createClientPipeTransport=He.generateRandomPipeName=He.StreamMessageWriter=He.StreamMessageReader=He.SocketMessageWriter=He.SocketMessageReader=He.PortMessageWriter=He.PortMessageReader=He.IPCMessageWriter=He.IPCMessageReader=void 0;var ki=T_();ki.default.install();var I_=require("path"),vC=require("os"),yC=require("crypto"),kl=require("net"),Pr=_l();gC(_l(),He);var vp=class extends Pr.AbstractMessageReader{constructor(t){super(),this.process=t;let n=this.process;n.on("error",o=>this.fireError(o)),n.on("close",()=>this.fireClose())}listen(t){return this.process.on("message",t),Pr.Disposable.create(()=>this.process.off("message",t))}};He.IPCMessageReader=vp;var yp=class extends Pr.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let n=this.process;n.on("error",o=>this.fireError(o)),n.on("close",()=>this.fireClose)}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,t)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};He.IPCMessageWriter=yp;var _p=class extends Pr.AbstractMessageReader{constructor(t){super(),this.onData=new Pr.Emitter,t.on("close",()=>this.fireClose),t.on("error",n=>this.fireError(n)),t.on("message",n=>{this.onData.fire(n)})}listen(t){return this.onData.event(t)}};He.PortMessageReader=_p;var bp=class extends Pr.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",n=>this.fireError(n))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};He.PortMessageWriter=bp;var xo=class extends Pr.ReadableStreamMessageReader{constructor(t,n="utf-8"){super((0,ki.default)().stream.asReadableStream(t),n)}};He.SocketMessageReader=xo;var ko=class extends Pr.WriteableStreamMessageWriter{constructor(t,n){super((0,ki.default)().stream.asWritableStream(t),n),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};He.SocketMessageWriter=ko;var wl=class extends Pr.ReadableStreamMessageReader{constructor(t,n){super((0,ki.default)().stream.asReadableStream(t),n)}};He.StreamMessageReader=wl;var xl=class extends Pr.WriteableStreamMessageWriter{constructor(t,n){super((0,ki.default)().stream.asWritableStream(t),n)}};He.StreamMessageWriter=xl;var $_=process.env.XDG_RUNTIME_DIR,_C=new Map([["linux",107],["darwin",103]]);function bC(){let e=(0,yC.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;$_?t=I_.join($_,`vscode-ipc-${e}.sock`):t=I_.join(vC.tmpdir(),`vscode-${e}.sock`);let n=_C.get(process.platform);return n!==void 0&&t.length>n&&(0,ki.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t}He.generateRandomPipeName=bC;function wC(e,t="utf-8"){let n,o=new Promise((r,i)=>{n=r});return new Promise((r,i)=>{let s=(0,kl.createServer)(l=>{s.close(),n([new xo(l,t),new ko(l,t)])});s.on("error",i),s.listen(e,()=>{s.removeListener("error",i),r({onConnected:()=>o})})})}He.createClientPipeTransport=wC;function xC(e,t="utf-8"){let n=(0,kl.createConnection)(e);return[new xo(n,t),new ko(n,t)]}He.createServerPipeTransport=xC;function kC(e,t="utf-8"){let n,o=new Promise((r,i)=>{n=r});return new Promise((r,i)=>{let s=(0,kl.createServer)(l=>{s.close(),n([new xo(l,t),new ko(l,t)])});s.on("error",i),s.listen(e,"127.0.0.1",()=>{s.removeListener("error",i),r({onConnected:()=>o})})})}He.createClientSocketTransport=kC;function SC(e,t="utf-8"){let n=(0,kl.createConnection)(e,"127.0.0.1");return[new xo(n,t),new ko(n,t)]}He.createServerSocketTransport=SC;function TC(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function IC(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function $C(e,t,n,o){n||(n=Pr.NullLogger);let r=TC(e)?new wl(e):e,i=IC(t)?new xl(t):t;return Pr.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,Pr.createMessageConnection)(r,i,n,o)}He.createMessageConnection=$C});var wp=te((yZ,P_)=>{"use strict";P_.exports=So()});var Tl=te((E_,Sl)=>{(function(e){if(typeof Sl=="object"&&typeof Sl.exports=="object"){var t=e(require,E_);t!==void 0&&(Sl.exports=t)}else typeof define=="function"&&define.amd&&define(["require","exports"],e)})(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0;var n;(function(f){function T($){return typeof $=="string"}f.is=T})(n||(t.DocumentUri=n={}));var o;(function(f){function T($){return typeof $=="string"}f.is=T})(o||(t.URI=o={}));var r;(function(f){f.MIN_VALUE=-2147483648,f.MAX_VALUE=2147483647;function T($){return typeof $=="number"&&f.MIN_VALUE<=$&&$<=f.MAX_VALUE}f.is=T})(r||(t.integer=r={}));var i;(function(f){f.MIN_VALUE=0,f.MAX_VALUE=2147483647;function T($){return typeof $=="number"&&f.MIN_VALUE<=$&&$<=f.MAX_VALUE}f.is=T})(i||(t.uinteger=i={}));var s;(function(f){function T(w,p){return w===Number.MAX_VALUE&&(w=i.MAX_VALUE),p===Number.MAX_VALUE&&(p=i.MAX_VALUE),{line:w,character:p}}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&P.uinteger(p.line)&&P.uinteger(p.character)}f.is=$})(s||(t.Position=s={}));var l;(function(f){function T(w,p,M,H){if(P.uinteger(w)&&P.uinteger(p)&&P.uinteger(M)&&P.uinteger(H))return{start:s.create(w,p),end:s.create(M,H)};if(s.is(w)&&s.is(p))return{start:w,end:p};throw new Error("Range#create called with invalid arguments[".concat(w,", ").concat(p,", ").concat(M,", ").concat(H,"]"))}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&s.is(p.start)&&s.is(p.end)}f.is=$})(l||(t.Range=l={}));var u;(function(f){function T(w,p){return{uri:w,range:p}}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&l.is(p.range)&&(P.string(p.uri)||P.undefined(p.uri))}f.is=$})(u||(t.Location=u={}));var c;(function(f){function T(w,p,M,H){return{targetUri:w,targetRange:p,targetSelectionRange:M,originSelectionRange:H}}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&l.is(p.targetRange)&&P.string(p.targetUri)&&l.is(p.targetSelectionRange)&&(l.is(p.originSelectionRange)||P.undefined(p.originSelectionRange))}f.is=$})(c||(t.LocationLink=c={}));var d;(function(f){function T(w,p,M,H){return{red:w,green:p,blue:M,alpha:H}}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&P.numberRange(p.red,0,1)&&P.numberRange(p.green,0,1)&&P.numberRange(p.blue,0,1)&&P.numberRange(p.alpha,0,1)}f.is=$})(d||(t.Color=d={}));var m;(function(f){function T(w,p){return{range:w,color:p}}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&l.is(p.range)&&d.is(p.color)}f.is=$})(m||(t.ColorInformation=m={}));var _;(function(f){function T(w,p,M){return{label:w,textEdit:p,additionalTextEdits:M}}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&P.string(p.label)&&(P.undefined(p.textEdit)||O.is(p))&&(P.undefined(p.additionalTextEdits)||P.typedArray(p.additionalTextEdits,O.is))}f.is=$})(_||(t.ColorPresentation=_={}));var h;(function(f){f.Comment="comment",f.Imports="imports",f.Region="region"})(h||(t.FoldingRangeKind=h={}));var b;(function(f){function T(w,p,M,H,Oe,yt){var Ke={startLine:w,endLine:p};return P.defined(M)&&(Ke.startCharacter=M),P.defined(H)&&(Ke.endCharacter=H),P.defined(Oe)&&(Ke.kind=Oe),P.defined(yt)&&(Ke.collapsedText=yt),Ke}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&P.uinteger(p.startLine)&&P.uinteger(p.startLine)&&(P.undefined(p.startCharacter)||P.uinteger(p.startCharacter))&&(P.undefined(p.endCharacter)||P.uinteger(p.endCharacter))&&(P.undefined(p.kind)||P.string(p.kind))}f.is=$})(b||(t.FoldingRange=b={}));var k;(function(f){function T(w,p){return{location:w,message:p}}f.create=T;function $(w){var p=w;return P.defined(p)&&u.is(p.location)&&P.string(p.message)}f.is=$})(k||(t.DiagnosticRelatedInformation=k={}));var I;(function(f){f.Error=1,f.Warning=2,f.Information=3,f.Hint=4})(I||(t.DiagnosticSeverity=I={}));var C;(function(f){f.Unnecessary=1,f.Deprecated=2})(C||(t.DiagnosticTag=C={}));var g;(function(f){function T($){var w=$;return P.objectLiteral(w)&&P.string(w.href)}f.is=T})(g||(t.CodeDescription=g={}));var v;(function(f){function T(w,p,M,H,Oe,yt){var Ke={range:w,message:p};return P.defined(M)&&(Ke.severity=M),P.defined(H)&&(Ke.code=H),P.defined(Oe)&&(Ke.source=Oe),P.defined(yt)&&(Ke.relatedInformation=yt),Ke}f.create=T;function $(w){var p,M=w;return P.defined(M)&&l.is(M.range)&&P.string(M.message)&&(P.number(M.severity)||P.undefined(M.severity))&&(P.integer(M.code)||P.string(M.code)||P.undefined(M.code))&&(P.undefined(M.codeDescription)||P.string((p=M.codeDescription)===null||p===void 0?void 0:p.href))&&(P.string(M.source)||P.undefined(M.source))&&(P.undefined(M.relatedInformation)||P.typedArray(M.relatedInformation,k.is))}f.is=$})(v||(t.Diagnostic=v={}));var R;(function(f){function T(w,p){for(var M=[],H=2;H0&&(Oe.arguments=M),Oe}f.create=T;function $(w){var p=w;return P.defined(p)&&P.string(p.title)&&P.string(p.command)}f.is=$})(R||(t.Command=R={}));var O;(function(f){function T(M,H){return{range:M,newText:H}}f.replace=T;function $(M,H){return{range:{start:M,end:M},newText:H}}f.insert=$;function w(M){return{range:M,newText:""}}f.del=w;function p(M){var H=M;return P.objectLiteral(H)&&P.string(H.newText)&&l.is(H.range)}f.is=p})(O||(t.TextEdit=O={}));var N;(function(f){function T(w,p,M){var H={label:w};return p!==void 0&&(H.needsConfirmation=p),M!==void 0&&(H.description=M),H}f.create=T;function $(w){var p=w;return P.objectLiteral(p)&&P.string(p.label)&&(P.boolean(p.needsConfirmation)||p.needsConfirmation===void 0)&&(P.string(p.description)||p.description===void 0)}f.is=$})(N||(t.ChangeAnnotation=N={}));var K;(function(f){function T($){var w=$;return P.string(w)}f.is=T})(K||(t.ChangeAnnotationIdentifier=K={}));var ee;(function(f){function T(M,H,Oe){return{range:M,newText:H,annotationId:Oe}}f.replace=T;function $(M,H,Oe){return{range:{start:M,end:M},newText:H,annotationId:Oe}}f.insert=$;function w(M,H){return{range:M,newText:"",annotationId:H}}f.del=w;function p(M){var H=M;return O.is(H)&&(N.is(H.annotationId)||K.is(H.annotationId))}f.is=p})(ee||(t.AnnotatedTextEdit=ee={}));var E;(function(f){function T(w,p){return{textDocument:w,edits:p}}f.create=T;function $(w){var p=w;return P.defined(p)&&W.is(p.textDocument)&&Array.isArray(p.edits)}f.is=$})(E||(t.TextDocumentEdit=E={}));var le;(function(f){function T(w,p,M){var H={kind:"create",uri:w};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(H.options=p),M!==void 0&&(H.annotationId=M),H}f.create=T;function $(w){var p=w;return p&&p.kind==="create"&&P.string(p.uri)&&(p.options===void 0||(p.options.overwrite===void 0||P.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||P.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||K.is(p.annotationId))}f.is=$})(le||(t.CreateFile=le={}));var z;(function(f){function T(w,p,M,H){var Oe={kind:"rename",oldUri:w,newUri:p};return M!==void 0&&(M.overwrite!==void 0||M.ignoreIfExists!==void 0)&&(Oe.options=M),H!==void 0&&(Oe.annotationId=H),Oe}f.create=T;function $(w){var p=w;return p&&p.kind==="rename"&&P.string(p.oldUri)&&P.string(p.newUri)&&(p.options===void 0||(p.options.overwrite===void 0||P.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||P.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||K.is(p.annotationId))}f.is=$})(z||(t.RenameFile=z={}));var ye;(function(f){function T(w,p,M){var H={kind:"delete",uri:w};return p!==void 0&&(p.recursive!==void 0||p.ignoreIfNotExists!==void 0)&&(H.options=p),M!==void 0&&(H.annotationId=M),H}f.create=T;function $(w){var p=w;return p&&p.kind==="delete"&&P.string(p.uri)&&(p.options===void 0||(p.options.recursive===void 0||P.boolean(p.options.recursive))&&(p.options.ignoreIfNotExists===void 0||P.boolean(p.options.ignoreIfNotExists)))&&(p.annotationId===void 0||K.is(p.annotationId))}f.is=$})(ye||(t.DeleteFile=ye={}));var D;(function(f){function T($){var w=$;return w&&(w.changes!==void 0||w.documentChanges!==void 0)&&(w.documentChanges===void 0||w.documentChanges.every(function(p){return P.string(p.kind)?le.is(p)||z.is(p)||ye.is(p):E.is(p)}))}f.is=T})(D||(t.WorkspaceEdit=D={}));var U=(function(){function f(T,$){this.edits=T,this.changeAnnotations=$}return f.prototype.insert=function(T,$,w){var p,M;if(w===void 0?p=O.insert(T,$):K.is(w)?(M=w,p=ee.insert(T,$,w)):(this.assertChangeAnnotations(this.changeAnnotations),M=this.changeAnnotations.manage(w),p=ee.insert(T,$,M)),this.edits.push(p),M!==void 0)return M},f.prototype.replace=function(T,$,w){var p,M;if(w===void 0?p=O.replace(T,$):K.is(w)?(M=w,p=ee.replace(T,$,w)):(this.assertChangeAnnotations(this.changeAnnotations),M=this.changeAnnotations.manage(w),p=ee.replace(T,$,M)),this.edits.push(p),M!==void 0)return M},f.prototype.delete=function(T,$){var w,p;if($===void 0?w=O.del(T):K.is($)?(p=$,w=ee.del(T,$)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage($),w=ee.del(T,p)),this.edits.push(w),p!==void 0)return p},f.prototype.add=function(T){this.edits.push(T)},f.prototype.all=function(){return this.edits},f.prototype.clear=function(){this.edits.splice(0,this.edits.length)},f.prototype.assertChangeAnnotations=function(T){if(T===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},f})(),A=(function(){function f(T){this._annotations=T===void 0?Object.create(null):T,this._counter=0,this._size=0}return f.prototype.all=function(){return this._annotations},Object.defineProperty(f.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),f.prototype.manage=function(T,$){var w;if(K.is(T)?w=T:(w=this.nextId(),$=T),this._annotations[w]!==void 0)throw new Error("Id ".concat(w," is already in use."));if($===void 0)throw new Error("No annotation provided for id ".concat(w));return this._annotations[w]=$,this._size++,w},f.prototype.nextId=function(){return this._counter++,this._counter.toString()},f})(),L=(function(){function f(T){var $=this;this._textEditChanges=Object.create(null),T!==void 0?(this._workspaceEdit=T,T.documentChanges?(this._changeAnnotations=new A(T.changeAnnotations),T.changeAnnotations=this._changeAnnotations.all(),T.documentChanges.forEach(function(w){if(E.is(w)){var p=new U(w.edits,$._changeAnnotations);$._textEditChanges[w.textDocument.uri]=p}})):T.changes&&Object.keys(T.changes).forEach(function(w){var p=new U(T.changes[w]);$._textEditChanges[w]=p})):this._workspaceEdit={}}return Object.defineProperty(f.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),f.prototype.getTextEditChange=function(T){if(W.is(T)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var $={uri:T.uri,version:T.version},w=this._textEditChanges[$.uri];if(!w){var p=[],M={textDocument:$,edits:p};this._workspaceEdit.documentChanges.push(M),w=new U(p,this._changeAnnotations),this._textEditChanges[$.uri]=w}return w}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var w=this._textEditChanges[T];if(!w){var p=[];this._workspaceEdit.changes[T]=p,w=new U(p),this._textEditChanges[T]=w}return w}},f.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new A,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},f.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},f.prototype.createFile=function(T,$,w){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;N.is($)||K.is($)?p=$:w=$;var M,H;if(p===void 0?M=le.create(T,w):(H=K.is(p)?p:this._changeAnnotations.manage(p),M=le.create(T,w,H)),this._workspaceEdit.documentChanges.push(M),H!==void 0)return H},f.prototype.renameFile=function(T,$,w,p){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var M;N.is(w)||K.is(w)?M=w:p=w;var H,Oe;if(M===void 0?H=z.create(T,$,p):(Oe=K.is(M)?M:this._changeAnnotations.manage(M),H=z.create(T,$,p,Oe)),this._workspaceEdit.documentChanges.push(H),Oe!==void 0)return Oe},f.prototype.deleteFile=function(T,$,w){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;N.is($)||K.is($)?p=$:w=$;var M,H;if(p===void 0?M=ye.create(T,w):(H=K.is(p)?p:this._changeAnnotations.manage(p),M=ye.create(T,w,H)),this._workspaceEdit.documentChanges.push(M),H!==void 0)return H},f})();t.WorkspaceChange=L;var B;(function(f){function T(w){return{uri:w}}f.create=T;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)}f.is=$})(B||(t.TextDocumentIdentifier=B={}));var ne;(function(f){function T(w,p){return{uri:w,version:p}}f.create=T;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)&&P.integer(p.version)}f.is=$})(ne||(t.VersionedTextDocumentIdentifier=ne={}));var W;(function(f){function T(w,p){return{uri:w,version:p}}f.create=T;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)&&(p.version===null||P.integer(p.version))}f.is=$})(W||(t.OptionalVersionedTextDocumentIdentifier=W={}));var pe;(function(f){function T(w,p,M,H){return{uri:w,languageId:p,version:M,text:H}}f.create=T;function $(w){var p=w;return P.defined(p)&&P.string(p.uri)&&P.string(p.languageId)&&P.integer(p.version)&&P.string(p.text)}f.is=$})(pe||(t.TextDocumentItem=pe={}));var Pe;(function(f){f.PlainText="plaintext",f.Markdown="markdown";function T($){var w=$;return w===f.PlainText||w===f.Markdown}f.is=T})(Pe||(t.MarkupKind=Pe={}));var Te;(function(f){function T($){var w=$;return P.objectLiteral($)&&Pe.is(w.kind)&&P.string(w.value)}f.is=T})(Te||(t.MarkupContent=Te={}));var Le;(function(f){f.Text=1,f.Method=2,f.Function=3,f.Constructor=4,f.Field=5,f.Variable=6,f.Class=7,f.Interface=8,f.Module=9,f.Property=10,f.Unit=11,f.Value=12,f.Enum=13,f.Keyword=14,f.Snippet=15,f.Color=16,f.File=17,f.Reference=18,f.Folder=19,f.EnumMember=20,f.Constant=21,f.Struct=22,f.Event=23,f.Operator=24,f.TypeParameter=25})(Le||(t.CompletionItemKind=Le={}));var oe;(function(f){f.PlainText=1,f.Snippet=2})(oe||(t.InsertTextFormat=oe={}));var J;(function(f){f.Deprecated=1})(J||(t.CompletionItemTag=J={}));var ge;(function(f){function T(w,p,M){return{newText:w,insert:p,replace:M}}f.create=T;function $(w){var p=w;return p&&P.string(p.newText)&&l.is(p.insert)&&l.is(p.replace)}f.is=$})(ge||(t.InsertReplaceEdit=ge={}));var we;(function(f){f.asIs=1,f.adjustIndentation=2})(we||(t.InsertTextMode=we={}));var se;(function(f){function T($){var w=$;return w&&(P.string(w.detail)||w.detail===void 0)&&(P.string(w.description)||w.description===void 0)}f.is=T})(se||(t.CompletionItemLabelDetails=se={}));var me;(function(f){function T($){return{label:$}}f.create=T})(me||(t.CompletionItem=me={}));var F;(function(f){function T($,w){return{items:$||[],isIncomplete:!!w}}f.create=T})(F||(t.CompletionList=F={}));var xe;(function(f){function T(w){return w.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}f.fromPlainText=T;function $(w){var p=w;return P.string(p)||P.objectLiteral(p)&&P.string(p.language)&&P.string(p.value)}f.is=$})(xe||(t.MarkedString=xe={}));var je;(function(f){function T($){var w=$;return!!w&&P.objectLiteral(w)&&(Te.is(w.contents)||xe.is(w.contents)||P.typedArray(w.contents,xe.is))&&($.range===void 0||l.is($.range))}f.is=T})(je||(t.Hover=je={}));var Me;(function(f){function T($,w){return w?{label:$,documentation:w}:{label:$}}f.create=T})(Me||(t.ParameterInformation=Me={}));var er;(function(f){function T($,w){for(var p=[],M=2;M=0;nr--){var Ir=yt[nr],jr=M.offsetAt(Ir.range.start),Fe=M.offsetAt(Ir.range.end);if(Fe<=Ke)Oe=Oe.substring(0,jr)+Ir.newText+Oe.substring(Fe,Oe.length);else throw new Error("Overlapping edit");Ke=jr}return Oe}f.applyEdits=w;function p(M,H){if(M.length<=1)return M;var Oe=M.length/2|0,yt=M.slice(0,Oe),Ke=M.slice(Oe);p(yt,H),p(Ke,H);for(var nr=0,Ir=0,jr=0;nr=0;or--){var Tr=yt[or],jr=M.offsetAt(Tr.range.start),Fe=M.offsetAt(Tr.range.end);if(Fe<=Ke)Oe=Oe.substring(0,jr)+Tr.newText+Oe.substring(Fe,Oe.length);else throw new Error("Overlapping edit");Ke=jr}return Oe}f.applyEdits=w;function p(M,H){if(M.length<=1)return M;var Oe=M.length/2|0,yt=M.slice(0,Oe),Ke=M.slice(Oe);p(yt,H),p(Ke,H);for(var or=0,Tr=0,jr=0;or0&&I.push($.length),this._lineOffsets=I}return this._lineOffsets},f.prototype.positionAt=function(I){I=Math.max(Math.min(I,this._content.length),0);var $=this.getLineOffsets(),w=0,p=$.length;if(p===0)return s.create(0,I);for(;wI?p=M:w=M+1}var H=w-1;return s.create(H,I-$[H])},f.prototype.offsetAt=function(I){var $=this.getLineOffsets();if(I.line>=$.length)return this._content.length;if(I.line<0)return 0;var w=$[I.line],p=I.line+1<$.length?$[I.line+1]:this._content.length;return Math.max(Math.min(w+I.character,p),w)},Object.defineProperty(f.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),f})(),P;(function(f){var I=Object.prototype.toString;function $(Fe){return typeof Fe<"u"}f.defined=$;function w(Fe){return typeof Fe>"u"}f.undefined=w;function p(Fe){return Fe===!0||Fe===!1}f.boolean=p;function M(Fe){return I.call(Fe)==="[object String]"}f.string=M;function H(Fe){return I.call(Fe)==="[object Number]"}f.number=H;function Oe(Fe,Zn,pi){return I.call(Fe)==="[object Number]"&&Zn<=Fe&&Fe<=pi}f.numberRange=Oe;function yt(Fe){return I.call(Fe)==="[object Number]"&&-2147483648<=Fe&&Fe<=2147483647}f.integer=yt;function Ke(Fe){return I.call(Fe)==="[object Number]"&&0<=Fe&&Fe<=2147483647}f.uinteger=Ke;function nr(Fe){return I.call(Fe)==="[object Function]"}f.func=nr;function Ir(Fe){return Fe!==null&&typeof Fe=="object"}f.objectLiteral=Ir;function jr(Fe,Zn){return Array.isArray(Fe)&&Fe.every(Zn)}f.typedArray=jr})(P||(P={}))})});var xt=te(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.ProtocolNotificationType=pr.ProtocolNotificationType0=pr.ProtocolRequestType=pr.ProtocolRequestType0=pr.RegistrationType=pr.MessageDirection=void 0;var xi=xo(),k_;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(k_||(pr.MessageDirection=k_={}));var bp=class{constructor(t){this.method=t}};pr.RegistrationType=bp;var wp=class extends xi.RequestType0{constructor(t){super(t)}};pr.ProtocolRequestType0=wp;var xp=class extends xi.RequestType{constructor(t){super(t,xi.ParameterStructures.byName)}};pr.ProtocolRequestType=xp;var kp=class extends xi.NotificationType0{constructor(t){super(t)}};pr.ProtocolNotificationType0=kp;var Sp=class extends xi.NotificationType{constructor(t){super(t,xi.ParameterStructures.byName)}};pr.ProtocolNotificationType=Sp});var Tl=te(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.objectLiteral=Dt.typedArray=Dt.stringArray=Dt.array=Dt.func=Dt.error=Dt.number=Dt.string=Dt.boolean=void 0;function dR(e){return e===!0||e===!1}Dt.boolean=dR;function S_(e){return typeof e=="string"||e instanceof String}Dt.string=S_;function pR(e){return typeof e=="number"||e instanceof Number}Dt.number=pR;function fR(e){return e instanceof Error}Dt.error=fR;function mR(e){return typeof e=="function"}Dt.func=mR;function I_(e){return Array.isArray(e)}Dt.array=I_;function hR(e){return I_(e)&&e.every(t=>S_(t))}Dt.stringArray=hR;function gR(e,t){return Array.isArray(e)&&e.every(t)}Dt.typedArray=gR;function vR(e){return e!==null&&typeof e=="object"}Dt.objectLiteral=vR});var P_=te($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.ImplementationRequest=void 0;var T_=xt(),$_;(function(e){e.method="textDocument/implementation",e.messageDirection=T_.MessageDirection.clientToServer,e.type=new T_.ProtocolRequestType(e.method)})($_||($l.ImplementationRequest=$_={}))});var R_=te(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.TypeDefinitionRequest=void 0;var E_=xt(),C_;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=E_.MessageDirection.clientToServer,e.type=new E_.ProtocolRequestType(e.method)})(C_||(Pl.TypeDefinitionRequest=C_={}))});var j_=te(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.DidChangeWorkspaceFoldersNotification=ki.WorkspaceFoldersRequest=void 0;var El=xt(),O_;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=El.MessageDirection.serverToClient,e.type=new El.ProtocolRequestType0(e.method)})(O_||(ki.WorkspaceFoldersRequest=O_={}));var D_;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=El.MessageDirection.clientToServer,e.type=new El.ProtocolNotificationType(e.method)})(D_||(ki.DidChangeWorkspaceFoldersNotification=D_={}))});var A_=te(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.ConfigurationRequest=void 0;var N_=xt(),M_;(function(e){e.method="workspace/configuration",e.messageDirection=N_.MessageDirection.serverToClient,e.type=new N_.ProtocolRequestType(e.method)})(M_||(Cl.ConfigurationRequest=M_={}))});var U_=te(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.ColorPresentationRequest=Si.DocumentColorRequest=void 0;var Rl=xt(),z_;(function(e){e.method="textDocument/documentColor",e.messageDirection=Rl.MessageDirection.clientToServer,e.type=new Rl.ProtocolRequestType(e.method)})(z_||(Si.DocumentColorRequest=z_={}));var q_;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=Rl.MessageDirection.clientToServer,e.type=new Rl.ProtocolRequestType(e.method)})(q_||(Si.ColorPresentationRequest=q_={}))});var Z_=te(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.FoldingRangeRefreshRequest=Ii.FoldingRangeRequest=void 0;var Ol=xt(),L_;(function(e){e.method="textDocument/foldingRange",e.messageDirection=Ol.MessageDirection.clientToServer,e.type=new Ol.ProtocolRequestType(e.method)})(L_||(Ii.FoldingRangeRequest=L_={}));var F_;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Ol.MessageDirection.serverToClient,e.type=new Ol.ProtocolRequestType0(e.method)})(F_||(Ii.FoldingRangeRefreshRequest=F_={}))});var H_=te(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DeclarationRequest=void 0;var V_=xt(),W_;(function(e){e.method="textDocument/declaration",e.messageDirection=V_.MessageDirection.clientToServer,e.type=new V_.ProtocolRequestType(e.method)})(W_||(Dl.DeclarationRequest=W_={}))});var G_=te(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.SelectionRangeRequest=void 0;var J_=xt(),B_;(function(e){e.method="textDocument/selectionRange",e.messageDirection=J_.MessageDirection.clientToServer,e.type=new J_.ProtocolRequestType(e.method)})(B_||(jl.SelectionRangeRequest=B_={}))});var Q_=te(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.WorkDoneProgressCancelNotification=Bn.WorkDoneProgressCreateRequest=Bn.WorkDoneProgress=void 0;var yR=xo(),Nl=xt(),K_;(function(e){e.type=new yR.ProgressType;function t(n){return n===e.type}e.is=t})(K_||(Bn.WorkDoneProgress=K_={}));var Y_;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Nl.MessageDirection.serverToClient,e.type=new Nl.ProtocolRequestType(e.method)})(Y_||(Bn.WorkDoneProgressCreateRequest=Y_={}));var X_;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Nl.MessageDirection.clientToServer,e.type=new Nl.ProtocolNotificationType(e.method)})(X_||(Bn.WorkDoneProgressCancelNotification=X_={}))});var nb=te(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.CallHierarchyOutgoingCallsRequest=Gn.CallHierarchyIncomingCallsRequest=Gn.CallHierarchyPrepareRequest=void 0;var Ti=xt(),eb;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=Ti.MessageDirection.clientToServer,e.type=new Ti.ProtocolRequestType(e.method)})(eb||(Gn.CallHierarchyPrepareRequest=eb={}));var tb;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=Ti.MessageDirection.clientToServer,e.type=new Ti.ProtocolRequestType(e.method)})(tb||(Gn.CallHierarchyIncomingCallsRequest=tb={}));var rb;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=Ti.MessageDirection.clientToServer,e.type=new Ti.ProtocolRequestType(e.method)})(rb||(Gn.CallHierarchyOutgoingCallsRequest=rb={}))});var ub=te(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.SemanticTokensRefreshRequest=fr.SemanticTokensRangeRequest=fr.SemanticTokensDeltaRequest=fr.SemanticTokensRequest=fr.SemanticTokensRegistrationType=fr.TokenFormat=void 0;var Sn=xt(),ob;(function(e){e.Relative="relative"})(ob||(fr.TokenFormat=ob={}));var Ra;(function(e){e.method="textDocument/semanticTokens",e.type=new Sn.RegistrationType(e.method)})(Ra||(fr.SemanticTokensRegistrationType=Ra={}));var ib;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=Sn.MessageDirection.clientToServer,e.type=new Sn.ProtocolRequestType(e.method),e.registrationMethod=Ra.method})(ib||(fr.SemanticTokensRequest=ib={}));var ab;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=Sn.MessageDirection.clientToServer,e.type=new Sn.ProtocolRequestType(e.method),e.registrationMethod=Ra.method})(ab||(fr.SemanticTokensDeltaRequest=ab={}));var sb;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=Sn.MessageDirection.clientToServer,e.type=new Sn.ProtocolRequestType(e.method),e.registrationMethod=Ra.method})(sb||(fr.SemanticTokensRangeRequest=sb={}));var lb;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=Sn.MessageDirection.serverToClient,e.type=new Sn.ProtocolRequestType0(e.method)})(lb||(fr.SemanticTokensRefreshRequest=lb={}))});var pb=te(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.ShowDocumentRequest=void 0;var cb=xt(),db;(function(e){e.method="window/showDocument",e.messageDirection=cb.MessageDirection.serverToClient,e.type=new cb.ProtocolRequestType(e.method)})(db||(Ml.ShowDocumentRequest=db={}))});var hb=te(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.LinkedEditingRangeRequest=void 0;var fb=xt(),mb;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=fb.MessageDirection.clientToServer,e.type=new fb.ProtocolRequestType(e.method)})(mb||(Al.LinkedEditingRangeRequest=mb={}))});var kb=te(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.WillDeleteFilesRequest=Gt.DidDeleteFilesNotification=Gt.DidRenameFilesNotification=Gt.WillRenameFilesRequest=Gt.DidCreateFilesNotification=Gt.WillCreateFilesRequest=Gt.FileOperationPatternKind=void 0;var Nr=xt(),gb;(function(e){e.file="file",e.folder="folder"})(gb||(Gt.FileOperationPatternKind=gb={}));var vb;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method)})(vb||(Gt.WillCreateFilesRequest=vb={}));var yb;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolNotificationType(e.method)})(yb||(Gt.DidCreateFilesNotification=yb={}));var _b;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method)})(_b||(Gt.WillRenameFilesRequest=_b={}));var bb;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolNotificationType(e.method)})(bb||(Gt.DidRenameFilesNotification=bb={}));var wb;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolNotificationType(e.method)})(wb||(Gt.DidDeleteFilesNotification=wb={}));var xb;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method)})(xb||(Gt.WillDeleteFilesRequest=xb={}))});var Pb=te(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.MonikerRequest=Kn.MonikerKind=Kn.UniquenessLevel=void 0;var Sb=xt(),Ib;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(Ib||(Kn.UniquenessLevel=Ib={}));var Tb;(function(e){e.$import="import",e.$export="export",e.local="local"})(Tb||(Kn.MonikerKind=Tb={}));var $b;(function(e){e.method="textDocument/moniker",e.messageDirection=Sb.MessageDirection.clientToServer,e.type=new Sb.ProtocolRequestType(e.method)})($b||(Kn.MonikerRequest=$b={}))});var Ob=te(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.TypeHierarchySubtypesRequest=Yn.TypeHierarchySupertypesRequest=Yn.TypeHierarchyPrepareRequest=void 0;var $i=xt(),Eb;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=$i.MessageDirection.clientToServer,e.type=new $i.ProtocolRequestType(e.method)})(Eb||(Yn.TypeHierarchyPrepareRequest=Eb={}));var Cb;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=$i.MessageDirection.clientToServer,e.type=new $i.ProtocolRequestType(e.method)})(Cb||(Yn.TypeHierarchySupertypesRequest=Cb={}));var Rb;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=$i.MessageDirection.clientToServer,e.type=new $i.ProtocolRequestType(e.method)})(Rb||(Yn.TypeHierarchySubtypesRequest=Rb={}))});var Nb=te(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InlineValueRefreshRequest=Pi.InlineValueRequest=void 0;var zl=xt(),Db;(function(e){e.method="textDocument/inlineValue",e.messageDirection=zl.MessageDirection.clientToServer,e.type=new zl.ProtocolRequestType(e.method)})(Db||(Pi.InlineValueRequest=Db={}));var jb;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=zl.MessageDirection.serverToClient,e.type=new zl.ProtocolRequestType0(e.method)})(jb||(Pi.InlineValueRefreshRequest=jb={}))});var qb=te(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.InlayHintRefreshRequest=Xn.InlayHintResolveRequest=Xn.InlayHintRequest=void 0;var Ei=xt(),Mb;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Ei.MessageDirection.clientToServer,e.type=new Ei.ProtocolRequestType(e.method)})(Mb||(Xn.InlayHintRequest=Mb={}));var Ab;(function(e){e.method="inlayHint/resolve",e.messageDirection=Ei.MessageDirection.clientToServer,e.type=new Ei.ProtocolRequestType(e.method)})(Ab||(Xn.InlayHintResolveRequest=Ab={}));var zb;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Ei.MessageDirection.serverToClient,e.type=new Ei.ProtocolRequestType0(e.method)})(zb||(Xn.InlayHintRefreshRequest=zb={}))});var Hb=te(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DiagnosticRefreshRequest=Mr.WorkspaceDiagnosticRequest=Mr.DocumentDiagnosticRequest=Mr.DocumentDiagnosticReportKind=Mr.DiagnosticServerCancellationData=void 0;var Wb=xo(),_R=Tl(),Ci=xt(),Ub;(function(e){function t(n){let o=n;return o&&_R.boolean(o.retriggerRequest)}e.is=t})(Ub||(Mr.DiagnosticServerCancellationData=Ub={}));var Lb;(function(e){e.Full="full",e.Unchanged="unchanged"})(Lb||(Mr.DocumentDiagnosticReportKind=Lb={}));var Fb;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Ci.MessageDirection.clientToServer,e.type=new Ci.ProtocolRequestType(e.method),e.partialResult=new Wb.ProgressType})(Fb||(Mr.DocumentDiagnosticRequest=Fb={}));var Zb;(function(e){e.method="workspace/diagnostic",e.messageDirection=Ci.MessageDirection.clientToServer,e.type=new Ci.ProtocolRequestType(e.method),e.partialResult=new Wb.ProgressType})(Zb||(Mr.WorkspaceDiagnosticRequest=Zb={}));var Vb;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Ci.MessageDirection.serverToClient,e.type=new Ci.ProtocolRequestType0(e.method)})(Vb||(Mr.DiagnosticRefreshRequest=Vb={}))});var Qb=te(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.DidCloseNotebookDocumentNotification=Et.DidSaveNotebookDocumentNotification=Et.DidChangeNotebookDocumentNotification=Et.NotebookCellArrayChange=Et.DidOpenNotebookDocumentNotification=Et.NotebookDocumentSyncRegistrationType=Et.NotebookDocument=Et.NotebookCell=Et.ExecutionSummary=Et.NotebookCellKind=void 0;var Oa=Il(),Kr=Tl(),un=xt(),Ip;(function(e){e.Markup=1,e.Code=2;function t(n){return n===1||n===2}e.is=t})(Ip||(Et.NotebookCellKind=Ip={}));var Tp;(function(e){function t(r,i){let s={executionOrder:r};return(i===!0||i===!1)&&(s.success=i),s}e.create=t;function n(r){let i=r;return Kr.objectLiteral(i)&&Oa.uinteger.is(i.executionOrder)&&(i.success===void 0||Kr.boolean(i.success))}e.is=n;function o(r,i){return r===i?!0:r==null||i===null||i===void 0?!1:r.executionOrder===i.executionOrder&&r.success===i.success}e.equals=o})(Tp||(Et.ExecutionSummary=Tp={}));var ql;(function(e){function t(i,s){return{kind:i,document:s}}e.create=t;function n(i){let s=i;return Kr.objectLiteral(s)&&Ip.is(s.kind)&&Oa.DocumentUri.is(s.document)&&(s.metadata===void 0||Kr.objectLiteral(s.metadata))}e.is=n;function o(i,s){let l=new Set;return i.document!==s.document&&l.add("document"),i.kind!==s.kind&&l.add("kind"),i.executionSummary!==s.executionSummary&&l.add("executionSummary"),(i.metadata!==void 0||s.metadata!==void 0)&&!r(i.metadata,s.metadata)&&l.add("metadata"),(i.executionSummary!==void 0||s.executionSummary!==void 0)&&!Tp.equals(i.executionSummary,s.executionSummary)&&l.add("executionSummary"),l}e.diff=o;function r(i,s){if(i===s)return!0;if(i==null||s===null||s===void 0||typeof i!=typeof s||typeof i!="object")return!1;let l=Array.isArray(i),u=Array.isArray(s);if(l!==u)return!1;if(l&&u){if(i.length!==s.length)return!1;for(let c=0;c{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.InlineCompletionRequest=void 0;var ew=xt(),tw;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=ew.MessageDirection.clientToServer,e.type=new ew.ProtocolRequestType(e.method)})(tw||(Ul.InlineCompletionRequest=tw={}))});var hx=te(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var ie=xt(),nw=Il(),qt=Tl(),bR=P_();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return bR.ImplementationRequest}});var wR=R_();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return wR.TypeDefinitionRequest}});var dx=j_();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return dx.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return dx.DidChangeWorkspaceFoldersNotification}});var xR=A_();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return xR.ConfigurationRequest}});var px=U_();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return px.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return px.ColorPresentationRequest}});var fx=Z_();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return fx.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return fx.FoldingRangeRefreshRequest}});var kR=H_();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return kR.DeclarationRequest}});var SR=G_();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return SR.SelectionRangeRequest}});var Rp=Q_();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return Rp.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Rp.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Rp.WorkDoneProgressCancelNotification}});var Op=nb();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Op.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Op.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Op.CallHierarchyPrepareRequest}});var Oi=ub();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return Oi.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return Oi.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Oi.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Oi.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Oi.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Oi.SemanticTokensRegistrationType}});var IR=pb();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return IR.ShowDocumentRequest}});var TR=hb();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return TR.LinkedEditingRangeRequest}});var ko=kb();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return ko.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return ko.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return ko.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return ko.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return ko.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return ko.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return ko.WillDeleteFilesRequest}});var Dp=Pb();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Dp.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Dp.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Dp.MonikerRequest}});var jp=Ob();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return jp.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return jp.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return jp.TypeHierarchySupertypesRequest}});var mx=Nb();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return mx.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return mx.InlineValueRefreshRequest}});var Np=qb();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return Np.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Np.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Np.InlayHintRefreshRequest}});var Da=Hb();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Da.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Da.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Da.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Da.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Da.DiagnosticRefreshRequest}});var cn=Qb();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return cn.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return cn.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return cn.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return cn.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return cn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return cn.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return cn.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return cn.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return cn.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return cn.DidCloseNotebookDocumentNotification}});var $R=rw();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return $R.InlineCompletionRequest}});var $p;(function(e){function t(n){let o=n;return qt.string(o)||qt.string(o.language)||qt.string(o.scheme)||qt.string(o.pattern)}e.is=t})($p||(S.TextDocumentFilter=$p={}));var Pp;(function(e){function t(n){let o=n;return qt.objectLiteral(o)&&(qt.string(o.notebookType)||qt.string(o.scheme)||qt.string(o.pattern))}e.is=t})(Pp||(S.NotebookDocumentFilter=Pp={}));var Ep;(function(e){function t(n){let o=n;return qt.objectLiteral(o)&&(qt.string(o.notebook)||Pp.is(o.notebook))&&(o.language===void 0||qt.string(o.language))}e.is=t})(Ep||(S.NotebookCellTextDocumentFilter=Ep={}));var Cp;(function(e){function t(n){if(!Array.isArray(n))return!1;for(let o of n)if(!qt.string(o)&&!$p.is(o)&&!Ep.is(o))return!1;return!0}e.is=t})(Cp||(S.DocumentSelector=Cp={}));var ow;(function(e){e.method="client/registerCapability",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType(e.method)})(ow||(S.RegistrationRequest=ow={}));var iw;(function(e){e.method="client/unregisterCapability",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType(e.method)})(iw||(S.UnregistrationRequest=iw={}));var aw;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete"})(aw||(S.ResourceOperationKind=aw={}));var sw;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"})(sw||(S.FailureHandlingKind=sw={}));var lw;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"})(lw||(S.PositionEncodingKind=lw={}));var uw;(function(e){function t(n){let o=n;return o&&qt.string(o.id)&&o.id.length>0}e.hasId=t})(uw||(S.StaticRegistrationOptions=uw={}));var cw;(function(e){function t(n){let o=n;return o&&(o.documentSelector===null||Cp.is(o.documentSelector))}e.is=t})(cw||(S.TextDocumentRegistrationOptions=cw={}));var dw;(function(e){function t(o){let r=o;return qt.objectLiteral(r)&&(r.workDoneProgress===void 0||qt.boolean(r.workDoneProgress))}e.is=t;function n(o){let r=o;return r&&qt.boolean(r.workDoneProgress)}e.hasWorkDoneProgress=n})(dw||(S.WorkDoneProgressOptions=dw={}));var pw;(function(e){e.method="initialize",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(pw||(S.InitializeRequest=pw={}));var fw;(function(e){e.unknownProtocolVersion=1})(fw||(S.InitializeErrorCodes=fw={}));var mw;(function(e){e.method="initialized",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(mw||(S.InitializedNotification=mw={}));var hw;(function(e){e.method="shutdown",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType0(e.method)})(hw||(S.ShutdownRequest=hw={}));var gw;(function(e){e.method="exit",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType0(e.method)})(gw||(S.ExitNotification=gw={}));var vw;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(vw||(S.DidChangeConfigurationNotification=vw={}));var yw;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(yw||(S.MessageType=yw={}));var _w;(function(e){e.method="window/showMessage",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(_w||(S.ShowMessageNotification=_w={}));var bw;(function(e){e.method="window/showMessageRequest",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType(e.method)})(bw||(S.ShowMessageRequest=bw={}));var ww;(function(e){e.method="window/logMessage",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(ww||(S.LogMessageNotification=ww={}));var xw;(function(e){e.method="telemetry/event",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(xw||(S.TelemetryEventNotification=xw={}));var kw;(function(e){e.None=0,e.Full=1,e.Incremental=2})(kw||(S.TextDocumentSyncKind=kw={}));var Sw;(function(e){e.method="textDocument/didOpen",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Sw||(S.DidOpenTextDocumentNotification=Sw={}));var Iw;(function(e){function t(o){let r=o;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}e.isIncremental=t;function n(o){let r=o;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}e.isFull=n})(Iw||(S.TextDocumentContentChangeEvent=Iw={}));var Tw;(function(e){e.method="textDocument/didChange",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Tw||(S.DidChangeTextDocumentNotification=Tw={}));var $w;(function(e){e.method="textDocument/didClose",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})($w||(S.DidCloseTextDocumentNotification=$w={}));var Pw;(function(e){e.method="textDocument/didSave",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Pw||(S.DidSaveTextDocumentNotification=Pw={}));var Ew;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(Ew||(S.TextDocumentSaveReason=Ew={}));var Cw;(function(e){e.method="textDocument/willSave",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Cw||(S.WillSaveTextDocumentNotification=Cw={}));var Rw;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Rw||(S.WillSaveTextDocumentWaitUntilRequest=Rw={}));var Ow;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Ow||(S.DidChangeWatchedFilesNotification=Ow={}));var Dw;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(Dw||(S.FileChangeType=Dw={}));var jw;(function(e){function t(n){let o=n;return qt.objectLiteral(o)&&(nw.URI.is(o.baseUri)||nw.WorkspaceFolder.is(o.baseUri))&&qt.string(o.pattern)}e.is=t})(jw||(S.RelativePattern=jw={}));var Nw;(function(e){e.Create=1,e.Change=2,e.Delete=4})(Nw||(S.WatchKind=Nw={}));var Mw;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(Mw||(S.PublishDiagnosticsNotification=Mw={}));var Aw;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Aw||(S.CompletionTriggerKind=Aw={}));var zw;(function(e){e.method="textDocument/completion",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(zw||(S.CompletionRequest=zw={}));var qw;(function(e){e.method="completionItem/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(qw||(S.CompletionResolveRequest=qw={}));var Uw;(function(e){e.method="textDocument/hover",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Uw||(S.HoverRequest=Uw={}));var Lw;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(Lw||(S.SignatureHelpTriggerKind=Lw={}));var Fw;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Fw||(S.SignatureHelpRequest=Fw={}));var Zw;(function(e){e.method="textDocument/definition",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Zw||(S.DefinitionRequest=Zw={}));var Vw;(function(e){e.method="textDocument/references",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Vw||(S.ReferencesRequest=Vw={}));var Ww;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Ww||(S.DocumentHighlightRequest=Ww={}));var Hw;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Hw||(S.DocumentSymbolRequest=Hw={}));var Jw;(function(e){e.method="textDocument/codeAction",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Jw||(S.CodeActionRequest=Jw={}));var Bw;(function(e){e.method="codeAction/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Bw||(S.CodeActionResolveRequest=Bw={}));var Gw;(function(e){e.method="workspace/symbol",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Gw||(S.WorkspaceSymbolRequest=Gw={}));var Kw;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Kw||(S.WorkspaceSymbolResolveRequest=Kw={}));var Yw;(function(e){e.method="textDocument/codeLens",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Yw||(S.CodeLensRequest=Yw={}));var Xw;(function(e){e.method="codeLens/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Xw||(S.CodeLensResolveRequest=Xw={}));var Qw;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType0(e.method)})(Qw||(S.CodeLensRefreshRequest=Qw={}));var ex;(function(e){e.method="textDocument/documentLink",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ex||(S.DocumentLinkRequest=ex={}));var tx;(function(e){e.method="documentLink/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(tx||(S.DocumentLinkResolveRequest=tx={}));var rx;(function(e){e.method="textDocument/formatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(rx||(S.DocumentFormattingRequest=rx={}));var nx;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(nx||(S.DocumentRangeFormattingRequest=nx={}));var ox;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ox||(S.DocumentRangesFormattingRequest=ox={}));var ix;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ix||(S.DocumentOnTypeFormattingRequest=ix={}));var ax;(function(e){e.Identifier=1})(ax||(S.PrepareSupportDefaultBehavior=ax={}));var sx;(function(e){e.method="textDocument/rename",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(sx||(S.RenameRequest=sx={}));var lx;(function(e){e.method="textDocument/prepareRename",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(lx||(S.PrepareRenameRequest=lx={}));var ux;(function(e){e.method="workspace/executeCommand",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ux||(S.ExecuteCommandRequest=ux={}));var cx;(function(e){e.method="workspace/applyEdit",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType("workspace/applyEdit")})(cx||(S.ApplyWorkspaceEditRequest=cx={}))});var vx=te(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.createProtocolConnection=void 0;var gx=xo();function PR(e,t,n,o){return gx.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,gx.createMessageConnection)(e,t,n,o)}Ll.createProtocolConnection=PR});var _x=te(mr=>{"use strict";var ER=mr&&mr.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),Fl=mr&&mr.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&ER(t,e,n)};Object.defineProperty(mr,"__esModule",{value:!0});mr.LSPErrorCodes=mr.createProtocolConnection=void 0;Fl(xo(),mr);Fl(Il(),mr);Fl(xt(),mr);Fl(hx(),mr);var CR=vx();Object.defineProperty(mr,"createProtocolConnection",{enumerable:!0,get:function(){return CR.createProtocolConnection}});var yx;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(yx||(mr.LSPErrorCodes=yx={}))});var Ct=te(dn=>{"use strict";var RR=dn&&dn.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),bx=dn&&dn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&RR(t,e,n)};Object.defineProperty(dn,"__esModule",{value:!0});dn.createProtocolConnection=void 0;var OR=_p();bx(_p(),dn);bx(_x(),dn);function DR(e,t,n,o){return(0,OR.createMessageConnection)(e,t,n,o)}dn.createProtocolConnection=DR});var Mp=te(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.generateUuid=Ar.parse=Ar.isUUID=Ar.v4=Ar.empty=void 0;var ja=class{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},Na=class e extends ja{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}};Na._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Na._timeHighBits=["8","9","a","b"];Ar.empty=new ja("00000000-0000-0000-0000-000000000000");function wx(){return new Na}Ar.v4=wx;var jR=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xx(e){return jR.test(e)}Ar.isUUID=xx;function NR(e){if(!xx(e))throw new Error("invalid uuid");return new ja(e)}Ar.parse=NR;function MR(){return wx().asHex()}Ar.generateUuid=MR});var kx=te(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.attachPartialResult=eo.ProgressFeature=eo.attachWorkDone=void 0;var Qn=Ct(),AR=Mp(),So=class e{constructor(t,n){this._connection=t,this._token=n,e.Instances.set(this._token,this)}begin(t,n,o,r){let i={kind:"begin",title:t,percentage:n,message:o,cancellable:r};this._connection.sendProgress(Qn.WorkDoneProgress.type,this._token,i)}report(t,n){let o={kind:"report"};typeof t=="number"?(o.percentage=t,n!==void 0&&(o.message=n)):o.message=t,this._connection.sendProgress(Qn.WorkDoneProgress.type,this._token,o)}done(){e.Instances.delete(this._token),this._connection.sendProgress(Qn.WorkDoneProgress.type,this._token,{kind:"end"})}};So.Instances=new Map;var Zl=class extends So{constructor(t,n){super(t,n),this._source=new Qn.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ma=class{constructor(){}begin(){}report(){}done(){}},Vl=class extends Ma{constructor(){super(),this._source=new Qn.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function zR(e,t){if(t===void 0||t.workDoneToken===void 0)return new Ma;let n=t.workDoneToken;return delete t.workDoneToken,new So(e,n)}eo.attachWorkDone=zR;var qR=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Qn.WorkDoneProgressCancelNotification.type,n=>{let o=So.Instances.get(n.token);(o instanceof Zl||o instanceof Vl)&&o.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new Ma:new So(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0,AR.generateUuid)();return this.connection.sendRequest(Qn.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new Zl(this.connection,t))}else return Promise.resolve(new Vl)}};eo.ProgressFeature=qR;var Ap;(function(e){e.type=new Qn.ProgressType})(Ap||(Ap={}));var zp=class{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(Ap.type,this._token,t)}};function UR(e,t){if(t===void 0||t.partialResultToken===void 0)return;let n=t.partialResultToken;return delete t.partialResultToken,new zp(e,n)}eo.attachPartialResult=UR});var Sx=te(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.ConfigurationFeature=void 0;var LR=Ct(),FR=rl(),ZR=e=>class extends e{getConfiguration(t){return t?FR.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let n={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(LR.ConfigurationRequest.type,n).then(o=>Array.isArray(o)?Array.isArray(t)?o:o[0]:Array.isArray(t)?[]:null)}};Wl.ConfigurationFeature=ZR});var Ix=te(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.WorkspaceFoldersFeature=void 0;var Hl=Ct(),VR=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let n=t.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Hl.Emitter,this.connection.onNotification(Hl.DidChangeWorkspaceFoldersNotification.type,o=>{this._onDidChangeWorkspaceFolders.fire(o.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);let n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Hl.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Hl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Jl.WorkspaceFoldersFeature=VR});var Tx=te(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.CallHierarchyFeature=void 0;var qp=Ct(),WR=e=>class extends e{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(qp.CallHierarchyPrepareRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{let n=qp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onOutgoingCalls:t=>{let n=qp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};Bl.CallHierarchyFeature=WR});var Lp=te(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.SemanticTokensBuilder=to.SemanticTokensDiff=to.SemanticTokensFeature=void 0;var Gl=Ct(),HR=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Gl.SemanticTokensRefreshRequest.type),on:t=>{let n=Gl.SemanticTokensRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onDelta:t=>{let n=Gl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onRange:t=>{let n=Gl.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};to.SemanticTokensFeature=HR;var Kl=class{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){let t=this.originalSequence.length,n=this.modifiedSequence.length,o=0;for(;o=o&&i>=o&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r0&&(s-=this._prevLine,s===0&&(l-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=l,this._data[this._dataLen++]=o,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Kl(this._prevData,this._data).computeDiff()}:this.build()}};to.SemanticTokensBuilder=Up});var $x=te(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.ShowDocumentFeature=void 0;var JR=Ct(),BR=e=>class extends e{showDocument(t){return this.connection.sendRequest(JR.ShowDocumentRequest.type,t)}};Yl.ShowDocumentFeature=BR});var Px=te(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.FileOperationsFeature=void 0;var Di=Ct(),GR=e=>class extends e{onDidCreateFiles(t){return this.connection.onNotification(Di.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(Di.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(Di.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(Di.WillCreateFilesRequest.type,(n,o)=>t(n,o))}onWillRenameFiles(t){return this.connection.onRequest(Di.WillRenameFilesRequest.type,(n,o)=>t(n,o))}onWillDeleteFiles(t){return this.connection.onRequest(Di.WillDeleteFilesRequest.type,(n,o)=>t(n,o))}};Xl.FileOperationsFeature=GR});var Ex=te(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.LinkedEditingRangeFeature=void 0;var KR=Ct(),YR=e=>class extends e{onLinkedEditingRange(t){return this.connection.onRequest(KR.LinkedEditingRangeRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),void 0))}};Ql.LinkedEditingRangeFeature=YR});var Cx=te(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.TypeHierarchyFeature=void 0;var Fp=Ct(),XR=e=>class extends e{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(Fp.TypeHierarchyPrepareRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{let n=Fp.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onSubtypes:t=>{let n=Fp.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};eu.TypeHierarchyFeature=XR});var Ox=te(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.InlineValueFeature=void 0;var Rx=Ct(),QR=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Rx.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(Rx.InlineValueRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n)))}}};tu.InlineValueFeature=QR});var jx=te(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.FoldingRangeFeature=void 0;var Dx=Ct(),eO=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Dx.FoldingRangeRefreshRequest.type),on:t=>{let n=Dx.FoldingRangeRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};ru.FoldingRangeFeature=eO});var Nx=te(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.InlayHintFeature=void 0;var Zp=Ct(),tO=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Zp.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest(Zp.InlayHintRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest(Zp.InlayHintResolveRequest.type,(n,o)=>t(n,o))}}};nu.InlayHintFeature=tO});var Mx=te(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.DiagnosticFeature=void 0;var Aa=Ct(),rO=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Aa.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(Aa.DocumentDiagnosticRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Aa.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:t=>this.connection.onRequest(Aa.WorkspaceDiagnosticRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Aa.WorkspaceDiagnosticRequest.partialResult,n)))}}};ou.DiagnosticFeature=rO});var Wp=te(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.TextDocuments=void 0;var Io=Ct(),Vp=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new Io.Emitter,this._onDidOpen=new Io.Emitter,this._onDidClose=new Io.Emitter,this._onDidSave=new Io.Emitter,this._onWillSave=new Io.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=Io.TextDocumentSyncKind.Incremental;let n=[];return n.push(t.onDidOpenTextDocument(o=>{let r=o.textDocument,i=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,i);let s=Object.freeze({document:i});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),n.push(t.onDidChangeTextDocument(o=>{let r=o.textDocument,i=o.contentChanges;if(i.length===0)return;let{version:s}=r;if(s==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let l=this._syncedDocuments.get(r.uri);l!==void 0&&(l=this._configuration.update(l,i,s),this._syncedDocuments.set(r.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),n.push(t.onDidCloseTextDocument(o=>{let r=this._syncedDocuments.get(o.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(o.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),n.push(t.onWillSaveTextDocument(o=>{let r=this._syncedDocuments.get(o.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:o.reason}))})),n.push(t.onWillSaveTextDocumentWaitUntil((o,r)=>{let i=this._syncedDocuments.get(o.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:o.reason}),r):[]})),n.push(t.onDidSaveTextDocument(o=>{let r=this._syncedDocuments.get(o.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Io.Disposable.create(()=>{n.forEach(o=>o.dispose())})}};iu.TextDocuments=Vp});var Jp=te(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.NotebookDocuments=ji.NotebookSyncFeature=void 0;var zr=Ct(),Ax=Wp(),nO=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(zr.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(zr.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(zr.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(zr.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};ji.NotebookSyncFeature=nO;var au=class e{onDidOpenTextDocument(t){return this.openHandler=t,zr.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,zr.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,zr.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};au.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Hp=class{constructor(t){t instanceof Ax.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new Ax.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new zr.Emitter,this._onDidChange=new zr.Emitter,this._onDidSave=new zr.Emitter,this._onDidClose=new zr.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t=="string"?t:t.document,o=this.notebookCellMap.get(n);return o&&o[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(t){let n=new au,o=[];return o.push(this.cellTextDocuments.listen(n)),o.push(t.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let i of r.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),o.push(t.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let i=this.notebookDocuments.get(r.notebookDocument.uri);if(i===void 0)return;i.version=r.notebookDocument.version;let s=i.metadata,l=!1,u=r.change;u.metadata!==void 0&&(l=!0,i.metadata=u.metadata);let c=[],d=[],m=[],_=[];if(u.cells!==void 0){let R=u.cells;if(R.structure!==void 0){let g=R.structure.array;if(i.cells.splice(g.start,g.deleteCount,...g.cells!==void 0?g.cells:[]),R.structure.didOpen!==void 0)for(let v of R.structure.didOpen)n.openTextDocument({textDocument:v}),c.push(v.uri);if(R.structure.didClose)for(let v of R.structure.didClose)n.closeTextDocument({textDocument:v}),d.push(v.uri)}if(R.data!==void 0){let g=new Map(R.data.map(v=>[v.document,v]));for(let v=0;v<=i.cells.length;v++){let C=g.get(i.cells[v].document);if(C!==void 0){let O=i.cells.splice(v,1,C);if(m.push({old:O[0],new:C}),g.delete(C.document),g.size===0)break}}}if(R.textContent!==void 0)for(let g of R.textContent)n.changeTextDocument({textDocument:g.document,contentChanges:g.changes}),_.push(g.document.uri)}this.updateCellMap(i);let h={notebookDocument:i};l&&(h.metadata={old:s,new:i.metadata});let b=[];for(let R of c)b.push(this.getNotebookCell(R));let k=[];for(let R of d)k.push(this.getNotebookCell(R));let T=[];for(let R of _)T.push(this.getNotebookCell(R));(b.length>0||k.length>0||m.length>0||T.length>0)&&(h.cells={added:b,removed:k,changed:{data:m,textContent:T}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),o.push(t.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let i=this.notebookDocuments.get(r.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),o.push(t.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let i=this.notebookDocuments.get(r.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let s of r.cellTextDocuments)n.closeTextDocument({textDocument:s});this.notebookDocuments.delete(r.notebookDocument.uri);for(let s of i.cells)this.notebookCellMap.delete(s.document)}})),zr.Disposable.create(()=>{o.forEach(r=>r.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}};ji.NotebookDocuments=Hp});var zx=te(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MonikerFeature=void 0;var oO=Ct(),iO=e=>class extends e{get moniker(){return{on:t=>{let n=oO.MonikerRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};su.MonikerFeature=iO});var Qp=te(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConnection=Ye.combineFeatures=Ye.combineNotebooksFeatures=Ye.combineLanguagesFeatures=Ye.combineWorkspaceFeatures=Ye.combineWindowFeatures=Ye.combineClientFeatures=Ye.combineTracerFeatures=Ye.combineTelemetryFeatures=Ye.combineConsoleFeatures=Ye._NotebooksImpl=Ye._LanguagesImpl=Ye.BulkUnregistration=Ye.BulkRegistration=Ye.ErrorMessageTracker=void 0;var de=Ct(),qr=rl(),Gp=Mp(),De=kx(),aO=Sx(),sO=Ix(),lO=Tx(),uO=Lp(),cO=$x(),dO=Px(),pO=Ex(),fO=Cx(),mO=Ox(),hO=jx(),gO=Nx(),vO=Mx(),yO=Jp(),_O=zx();function Bp(e){if(e!==null)return e}var Kp=class{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||(n=0),n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}};Ye.ErrorMessageTracker=Kp;var lu=class{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(de.MessageType.Error,t)}warn(t){this.send(de.MessageType.Warning,t)}info(t){this.send(de.MessageType.Info,t)}log(t){this.send(de.MessageType.Log,t)}debug(t){this.send(de.MessageType.Debug,t)}send(t,n){this._rawConnection&&this._rawConnection.sendNotification(de.LogMessageNotification.type,{type:t,message:n}).catch(()=>{(0,de.RAL)().console.error("Sending log message failed")})}},Yp=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...n){let o={type:de.MessageType.Error,message:t,actions:n};return this.connection.sendRequest(de.ShowMessageRequest.type,o).then(Bp)}showWarningMessage(t,...n){let o={type:de.MessageType.Warning,message:t,actions:n};return this.connection.sendRequest(de.ShowMessageRequest.type,o).then(Bp)}showInformationMessage(t,...n){let o={type:de.MessageType.Info,message:t,actions:n};return this.connection.sendRequest(de.ShowMessageRequest.type,o).then(Bp)}},qx=(0,cO.ShowDocumentFeature)((0,De.ProgressFeature)(Yp)),Ux;(function(e){function t(){return new uu}e.create=t})(Ux||(Ye.BulkRegistration=Ux={}));var uu=class{constructor(){this._registrations=[],this._registered=new Set}add(t,n){let o=qr.string(t)?t:t.method;if(this._registered.has(o))throw new Error(`${o} is already added to this registration`);let r=Gp.generateUuid();this._registrations.push({id:r,method:o,registerOptions:n||{}}),this._registered.add(o)}asRegistrationParams(){return{registrations:this._registrations}}},Lx;(function(e){function t(){return new za(void 0,[])}e.create=t})(Lx||(Ye.BulkUnregistration=Lx={}));var za=class{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(o=>{this._unregistrations.set(o.method,o)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let o of this._unregistrations.values())t.push(o);let n={unregisterations:t};this._connection.sendRequest(de.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(t){let n=qr.string(t)?t:t.method,o=this._unregistrations.get(n);if(!o)return!1;let r={unregisterations:[o]};return this._connection.sendRequest(de.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(n)},i=>{this._connection.console.info(`Un-registering request handler for ${o.id} failed.`)}),!0}},cu=class{attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,o){return t instanceof uu?this.registerMany(t):t instanceof za?this.registerSingle1(t,n,o):this.registerSingle2(t,n)}registerSingle1(t,n,o){let r=qr.string(n)?n:n.method,i=Gp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:o||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(de.RegistrationRequest.type,s).then(l=>(t.add({id:i,method:r}),t),l=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(l)))}registerSingle2(t,n){let o=qr.string(t)?t:t.method,r=Gp.generateUuid(),i={registrations:[{id:r,method:o,registerOptions:n||{}}]};return this.connection.sendRequest(de.RegistrationRequest.type,i).then(s=>de.Disposable.create(()=>{this.unregisterSingle(r,o).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(s)))}unregisterSingle(t,n){let o={unregisterations:[{id:t,method:n}]};return this.connection.sendRequest(de.UnregistrationRequest.type,o).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let n=t.asRegistrationParams();return this.connection.sendRequest(de.RegistrationRequest.type,n).then(()=>new za(this._connection,n.registrations.map(o=>({id:o.id,method:o.method}))),o=>(this.connection.console.info("Bulk registration failed."),Promise.reject(o)))}},Xp=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function n(r){return r&&!!r.edit}let o=n(t)?t:{edit:t};return this.connection.sendRequest(de.ApplyWorkspaceEditRequest.type,o)}},Fx=(0,dO.FileOperationsFeature)((0,sO.WorkspaceFoldersFeature)((0,aO.ConfigurationFeature)(Xp))),du=class{constructor(){this._trace=de.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,n){this._trace!==de.Trace.Off&&this.connection.sendNotification(de.LogTraceNotification.type,{message:t,verbose:this._trace===de.Trace.Verbose?n:void 0}).catch(()=>{})}},pu=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(de.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},fu=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,De.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,De.attachPartialResult)(this.connection,n)}};Ye._LanguagesImpl=fu;var Zx=(0,hO.FoldingRangeFeature)((0,_O.MonikerFeature)((0,vO.DiagnosticFeature)((0,gO.InlayHintFeature)((0,mO.InlineValueFeature)((0,fO.TypeHierarchyFeature)((0,pO.LinkedEditingRangeFeature)((0,uO.SemanticTokensFeature)((0,lO.CallHierarchyFeature)(fu))))))))),mu=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,De.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,De.attachPartialResult)(this.connection,n)}};Ye._NotebooksImpl=mu;var Vx=(0,yO.NotebookSyncFeature)(mu);function Wx(e,t){return function(n){return t(e(n))}}Ye.combineConsoleFeatures=Wx;function Hx(e,t){return function(n){return t(e(n))}}Ye.combineTelemetryFeatures=Hx;function Jx(e,t){return function(n){return t(e(n))}}Ye.combineTracerFeatures=Jx;function Bx(e,t){return function(n){return t(e(n))}}Ye.combineClientFeatures=Bx;function Gx(e,t){return function(n){return t(e(n))}}Ye.combineWindowFeatures=Gx;function Kx(e,t){return function(n){return t(e(n))}}Ye.combineWorkspaceFeatures=Kx;function Yx(e,t){return function(n){return t(e(n))}}Ye.combineLanguagesFeatures=Yx;function Xx(e,t){return function(n){return t(e(n))}}Ye.combineNotebooksFeatures=Xx;function bO(e,t){function n(r,i,s){return r&&i?s(r,i):r||i}return{__brand:"features",console:n(e.console,t.console,Wx),tracer:n(e.tracer,t.tracer,Jx),telemetry:n(e.telemetry,t.telemetry,Hx),client:n(e.client,t.client,Bx),window:n(e.window,t.window,Gx),workspace:n(e.workspace,t.workspace,Kx),languages:n(e.languages,t.languages,Yx),notebooks:n(e.notebooks,t.notebooks,Xx)}}Ye.combineFeatures=bO;function wO(e,t,n){let o=n&&n.console?new(n.console(lu)):new lu,r=e(o);o.rawAttach(r);let i=n&&n.tracer?new(n.tracer(du)):new du,s=n&&n.telemetry?new(n.telemetry(pu)):new pu,l=n&&n.client?new(n.client(cu)):new cu,u=n&&n.window?new(n.window(qx)):new qx,c=n&&n.workspace?new(n.workspace(Fx)):new Fx,d=n&&n.languages?new(n.languages(Zx)):new Zx,m=n&&n.notebooks?new(n.notebooks(Vx)):new Vx,_=[o,i,s,l,u,c,d,m];function h(g){return g instanceof Promise?g:qr.thenable(g)?new Promise((v,C)=>{g.then(O=>v(O),O=>C(O))}):Promise.resolve(g)}let b,k,T,R={listen:()=>r.listen(),sendRequest:(g,...v)=>r.sendRequest(qr.string(g)?g:g.method,...v),onRequest:(g,v)=>r.onRequest(g,v),sendNotification:(g,v)=>{let C=qr.string(g)?g:g.method;return r.sendNotification(C,v)},onNotification:(g,v)=>r.onNotification(g,v),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:g=>(k=g,{dispose:()=>{k=void 0}}),onInitialized:g=>r.onNotification(de.InitializedNotification.type,g),onShutdown:g=>(b=g,{dispose:()=>{b=void 0}}),onExit:g=>(T=g,{dispose:()=>{T=void 0}}),get console(){return o},get telemetry(){return s},get tracer(){return i},get client(){return l},get window(){return u},get workspace(){return c},get languages(){return d},get notebooks(){return m},onDidChangeConfiguration:g=>r.onNotification(de.DidChangeConfigurationNotification.type,g),onDidChangeWatchedFiles:g=>r.onNotification(de.DidChangeWatchedFilesNotification.type,g),__textDocumentSync:void 0,onDidOpenTextDocument:g=>r.onNotification(de.DidOpenTextDocumentNotification.type,g),onDidChangeTextDocument:g=>r.onNotification(de.DidChangeTextDocumentNotification.type,g),onDidCloseTextDocument:g=>r.onNotification(de.DidCloseTextDocumentNotification.type,g),onWillSaveTextDocument:g=>r.onNotification(de.WillSaveTextDocumentNotification.type,g),onWillSaveTextDocumentWaitUntil:g=>r.onRequest(de.WillSaveTextDocumentWaitUntilRequest.type,g),onDidSaveTextDocument:g=>r.onNotification(de.DidSaveTextDocumentNotification.type,g),sendDiagnostics:g=>r.sendNotification(de.PublishDiagnosticsNotification.type,g),onHover:g=>r.onRequest(de.HoverRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),void 0)),onCompletion:g=>r.onRequest(de.CompletionRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onCompletionResolve:g=>r.onRequest(de.CompletionResolveRequest.type,g),onSignatureHelp:g=>r.onRequest(de.SignatureHelpRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),void 0)),onDeclaration:g=>r.onRequest(de.DeclarationRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDefinition:g=>r.onRequest(de.DefinitionRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onTypeDefinition:g=>r.onRequest(de.TypeDefinitionRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onImplementation:g=>r.onRequest(de.ImplementationRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onReferences:g=>r.onRequest(de.ReferencesRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDocumentHighlight:g=>r.onRequest(de.DocumentHighlightRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDocumentSymbol:g=>r.onRequest(de.DocumentSymbolRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onWorkspaceSymbol:g=>r.onRequest(de.WorkspaceSymbolRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onWorkspaceSymbolResolve:g=>r.onRequest(de.WorkspaceSymbolResolveRequest.type,g),onCodeAction:g=>r.onRequest(de.CodeActionRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onCodeActionResolve:g=>r.onRequest(de.CodeActionResolveRequest.type,(v,C)=>g(v,C)),onCodeLens:g=>r.onRequest(de.CodeLensRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onCodeLensResolve:g=>r.onRequest(de.CodeLensResolveRequest.type,(v,C)=>g(v,C)),onDocumentFormatting:g=>r.onRequest(de.DocumentFormattingRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),void 0)),onDocumentRangeFormatting:g=>r.onRequest(de.DocumentRangeFormattingRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),void 0)),onDocumentOnTypeFormatting:g=>r.onRequest(de.DocumentOnTypeFormattingRequest.type,(v,C)=>g(v,C)),onRenameRequest:g=>r.onRequest(de.RenameRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),void 0)),onPrepareRename:g=>r.onRequest(de.PrepareRenameRequest.type,(v,C)=>g(v,C)),onDocumentLinks:g=>r.onRequest(de.DocumentLinkRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDocumentLinkResolve:g=>r.onRequest(de.DocumentLinkResolveRequest.type,(v,C)=>g(v,C)),onDocumentColor:g=>r.onRequest(de.DocumentColorRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onColorPresentation:g=>r.onRequest(de.ColorPresentationRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onFoldingRanges:g=>r.onRequest(de.FoldingRangeRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onSelectionRanges:g=>r.onRequest(de.SelectionRangeRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onExecuteCommand:g=>r.onRequest(de.ExecuteCommandRequest.type,(v,C)=>g(v,C,(0,De.attachWorkDone)(r,v),void 0)),dispose:()=>r.dispose()};for(let g of _)g.attach(R);return r.onRequest(de.InitializeRequest.type,g=>{t.initialize(g),qr.string(g.trace)&&(i.trace=de.Trace.fromString(g.trace));for(let v of _)v.initialize(g.capabilities);if(k){let v=k(g,new de.CancellationTokenSource().token,(0,De.attachWorkDone)(r,g),void 0);return h(v).then(C=>{if(C instanceof de.ResponseError)return C;let O=C;O||(O={capabilities:{}});let N=O.capabilities;N||(N={},O.capabilities=N),N.textDocumentSync===void 0||N.textDocumentSync===null?N.textDocumentSync=qr.number(R.__textDocumentSync)?R.__textDocumentSync:de.TextDocumentSyncKind.None:!qr.number(N.textDocumentSync)&&!qr.number(N.textDocumentSync.change)&&(N.textDocumentSync.change=qr.number(R.__textDocumentSync)?R.__textDocumentSync:de.TextDocumentSyncKind.None);for(let K of _)K.fillServerCapabilities(N);return O})}else{let v={capabilities:{textDocumentSync:de.TextDocumentSyncKind.None}};for(let C of _)C.fillServerCapabilities(v.capabilities);return v}}),r.onRequest(de.ShutdownRequest.type,()=>{if(t.shutdownReceived=!0,b)return b(new de.CancellationTokenSource().token)}),r.onNotification(de.ExitNotification.type,()=>{try{T&&T()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}}),r.onNotification(de.SetTraceNotification.type,g=>{i.trace=de.Trace.fromString(g.value)}),R}Ye.createConnection=wO});var Qx=te(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.resolveModulePath=hr.FileSystem=hr.resolveGlobalYarnPath=hr.resolveGlobalNodePath=hr.resolve=hr.uriToFilePath=void 0;var xO=require("url"),Yr=require("path"),ef=require("fs"),of=require("child_process");function kO(e){let t=xO.parse(e);if(t.protocol!=="file:"||!t.path)return;let n=t.path.split("/");for(var o=0,r=n.length;o1){let i=n[0],s=n[1];i.length===0&&s.length>1&&s[1]===":"&&n.shift()}return Yr.normalize(n.join("/"))}hr.uriToFilePath=kO;function tf(){return process.platform==="win32"}function hu(e,t,n,o){let r="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((s,l)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(d=>c[d]=u[d]),t&&ef.existsSync(t)&&(c[r]?c[r]=t+Yr.delimiter+c[r]:c[r]=t,o&&o(`NODE_PATH value is: ${c[r]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let d=(0,of.fork)("",[],{cwd:n,env:c,execArgv:["-e",i]});if(d.pid===void 0){l(new Error(`Starting process to resolve node module ${e} failed`));return}d.on("error",_=>{l(_)}),d.on("message",_=>{_.c==="r"&&(d.send({c:"e"}),_.s?s(_.r):l(new Error(`Failed to resolve module: ${e}`)))});let m={c:"rs",a:e};d.send(m)}catch(d){l(d)}})}hr.resolve=hu;function rf(e){let t="npm",n=Object.create(null);Object.keys(process.env).forEach(i=>n[i]=process.env[i]),n.NO_UPDATE_NOTIFIER="true";let o={encoding:"utf8",env:n};tf()&&(t="npm.cmd",o.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,of.spawnSync)(t,["config","get","prefix"],o).stdout;if(!i){e&&e("'npm config get prefix' didn't return a value.");return}let s=i.trim();return e&&e(`'npm config get prefix' value is: ${s}`),s.length>0?tf()?Yr.join(s,"node_modules"):Yr.join(s,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}hr.resolveGlobalNodePath=rf;function SO(e){let t="yarn",n={encoding:"utf8"};tf()&&(t="yarn.cmd",n.shell=!0);let o=()=>{};try{process.on("SIGPIPE",o);let r=(0,of.spawnSync)(t,["global","dir","--json"],n),i=r.stdout;if(!i){e&&(e("'yarn global dir' didn't return a value."),r.stderr&&e(r.stderr));return}let s=i.trim().split(/\r?\n/);for(let l of s)try{let u=JSON.parse(l);if(u.type==="log")return Yr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",o)}}hr.resolveGlobalYarnPath=SO;var nf;(function(e){let t;function n(){return t!==void 0||(process.platform==="win32"?t=!1:t=!ef.existsSync(__filename.toUpperCase())||!ef.existsSync(__filename.toLowerCase())),t}e.isCaseSensitive=n;function o(r,i){return n()?Yr.normalize(i).indexOf(Yr.normalize(r))===0:Yr.normalize(i).toLowerCase().indexOf(Yr.normalize(r).toLowerCase())===0}e.isParent=o})(nf||(hr.FileSystem=nf={}));function IO(e,t,n,o){return n?(Yr.isAbsolute(n)||(n=Yr.join(e,n)),hu(t,n,n,o).then(r=>nf.isParent(n,r)?r:Promise.reject(new Error(`Failed to load ${t} from node path location.`))).then(void 0,r=>hu(t,rf(o),e,o))):hu(t,rf(o),e,o)}hr.resolveModulePath=IO});var af=te((nV,ek)=>{"use strict";ek.exports=Ct()});var tk=te(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.InlineCompletionFeature=void 0;var TO=Ct(),$O=e=>class extends e{get inlineCompletion(){return{on:t=>this.connection.onRequest(TO.InlineCompletionRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n)))}}};gu.InlineCompletionFeature=$O});var ok=te(Kt=>{"use strict";var PO=Kt&&Kt.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),nk=Kt&&Kt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&PO(t,e,n)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.ProposedFeatures=Kt.NotebookDocuments=Kt.TextDocuments=Kt.SemanticTokensBuilder=void 0;var EO=Lp();Object.defineProperty(Kt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return EO.SemanticTokensBuilder}});var CO=tk();nk(Ct(),Kt);var RO=Wp();Object.defineProperty(Kt,"TextDocuments",{enumerable:!0,get:function(){return RO.TextDocuments}});var OO=Jp();Object.defineProperty(Kt,"NotebookDocuments",{enumerable:!0,get:function(){return OO.NotebookDocuments}});nk(Qp(),Kt);var rk;(function(e){e.all={__brand:"features",languages:CO.InlineCompletionFeature}})(rk||(Kt.ProposedFeatures=rk={}))});var ck=te(Ur=>{"use strict";var DO=Ur&&Ur.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),lk=Ur&&Ur.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&DO(t,e,n)};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.createConnection=Ur.Files=void 0;var ik=require("node:util"),sf=rl(),jO=Qp(),qa=Qx(),To=af();lk(af(),Ur);lk(ok(),Ur);var ak;(function(e){e.uriToFilePath=qa.uriToFilePath,e.resolveGlobalNodePath=qa.resolveGlobalNodePath,e.resolveGlobalYarnPath=qa.resolveGlobalYarnPath,e.resolve=qa.resolve,e.resolveModulePath=qa.resolveModulePath})(ak||(Ur.Files=ak={}));var sk;function vu(){if(sk!==void 0)try{sk.end()}catch{}}var Ni=!1,uk;function NO(){let e="--clientProcessId";function t(n){try{let o=parseInt(n);isNaN(o)||(uk=setInterval(()=>{try{process.kill(o,0)}catch{vu(),process.exit(Ni?0:1)}},3e3))}catch{}}for(let n=2;n{let t=e.processId;sf.number(t)&&uk===void 0&&setInterval(()=>{try{process.kill(t,0)}catch{process.exit(Ni?0:1)}},3e3)},get shutdownReceived(){return Ni},set shutdownReceived(e){Ni=e},exit:e=>{vu(),process.exit(e)}};function AO(e,t,n,o){let r,i,s,l;return e!==void 0&&e.__brand==="features"&&(r=e,e=t,t=n,n=o),To.ConnectionStrategy.is(e)||To.ConnectionOptions.is(e)?l=e:(i=e,s=t,l=n),zO(i,s,l,r)}Ur.createConnection=AO;function zO(e,t,n,o){let r=!1;if(!e&&!t&&process.argv.length>2){let u,c,d=process.argv.slice(2);for(let m=0;m{vu(),process.exit(Ni?0:1)}),u.on("close",()=>{vu(),process.exit(Ni?0:1)})}let l=u=>{let c=(0,To.createProtocolConnection)(e,t,u,n);return r&&qO(u),c};return(0,jO.createConnection)(l,MO,o)}function qO(e){function t(o){return o.map(r=>typeof r=="string"?r:(0,ik.inspect)(r)).join(" ")}let n=new Map;console.assert=function(r,...i){if(!r)if(i.length===0)e.error("Assertion failed");else{let[s,...l]=i;e.error(`Assertion failed: ${s} ${t(l)}`)}},console.count=function(r="default"){let i=String(r),s=n.get(i)??0;s+=1,n.set(i,s),e.log(`${i}: ${i}`)},console.countReset=function(r){r===void 0?n.clear():n.delete(String(r))},console.debug=function(...r){e.log(t(r))},console.dir=function(r,i){e.log((0,ik.inspect)(r,i))},console.log=function(...r){e.log(t(r))},console.error=function(...r){e.error(t(r))},console.trace=function(...r){let i=new Error().stack.replace(/(.+\n){2}/,""),s="Trace";r.length!==0&&(s+=`: ${t(r)}`),e.log(`${s} -${i}`)},console.warn=function(...r){e.warn(t(r))}}});var pk=te((lV,dk)=>{"use strict";dk.exports=ck()});var mk=te((uV,fk)=>{var ro=require("constants"),UO=process.cwd,yu=null,LO=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return yu||(yu=UO.call(process)),yu};try{process.cwd()}catch{}typeof process.chdir=="function"&&(lf=process.chdir,process.chdir=function(e){yu=null,lf.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,lf));var lf;fk.exports=FO;function FO(e){ro.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=o(e.chmod),e.fchmod=o(e.fchmod),e.lchmod=o(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(d,m,_){_&&process.nextTick(_)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(d,m,_,h){h&&process.nextTick(h)},e.lchownSync=function(){}),LO==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(d){function m(_,h,b){var k=Date.now(),T=0;d(_,h,function R(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-k<6e4){setTimeout(function(){e.stat(h,function(v,C){v&&v.code==="ENOENT"?d(_,h,R):b(g)})},T),T<100&&(T+=10);return}b&&b(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(m,d),m})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(d){function m(_,h,b,k,T,R){var g;if(R&&typeof R=="function"){var v=0;g=function(C,O,N){if(C&&C.code==="EAGAIN"&&v<10)return v++,d.call(e,_,h,b,k,T,g);R.apply(this,arguments)}}return d.call(e,_,h,b,k,T,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(m,d),m})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(d){return function(m,_,h,b,k){for(var T=0;;)try{return d.call(e,m,_,h,b,k)}catch(R){if(R.code==="EAGAIN"&&T<10){T++;continue}throw R}}})(e.readSync);function t(d){d.lchmod=function(m,_,h){d.open(m,ro.O_WRONLY|ro.O_SYMLINK,_,function(b,k){if(b){h&&h(b);return}d.fchmod(k,_,function(T){d.close(k,function(R){h&&h(T||R)})})})},d.lchmodSync=function(m,_){var h=d.openSync(m,ro.O_WRONLY|ro.O_SYMLINK,_),b=!0,k;try{k=d.fchmodSync(h,_),b=!1}finally{if(b)try{d.closeSync(h)}catch{}else d.closeSync(h)}return k}}function n(d){ro.hasOwnProperty("O_SYMLINK")&&d.futimes?(d.lutimes=function(m,_,h,b){d.open(m,ro.O_SYMLINK,function(k,T){if(k){b&&b(k);return}d.futimes(T,_,h,function(R){d.close(T,function(g){b&&b(R||g)})})})},d.lutimesSync=function(m,_,h){var b=d.openSync(m,ro.O_SYMLINK),k,T=!0;try{k=d.futimesSync(b,_,h),T=!1}finally{if(T)try{d.closeSync(b)}catch{}else d.closeSync(b)}return k}):d.futimes&&(d.lutimes=function(m,_,h,b){b&&process.nextTick(b)},d.lutimesSync=function(){})}function o(d){return d&&function(m,_,h){return d.call(e,m,_,function(b){c(b)&&(b=null),h&&h.apply(this,arguments)})}}function r(d){return d&&function(m,_){try{return d.call(e,m,_)}catch(h){if(!c(h))throw h}}}function i(d){return d&&function(m,_,h,b){return d.call(e,m,_,h,function(k){c(k)&&(k=null),b&&b.apply(this,arguments)})}}function s(d){return d&&function(m,_,h){try{return d.call(e,m,_,h)}catch(b){if(!c(b))throw b}}}function l(d){return d&&function(m,_,h){typeof _=="function"&&(h=_,_=null);function b(k,T){T&&(T.uid<0&&(T.uid+=4294967296),T.gid<0&&(T.gid+=4294967296)),h&&h.apply(this,arguments)}return _?d.call(e,m,_,b):d.call(e,m,b)}}function u(d){return d&&function(m,_){var h=_?d.call(e,m,_):d.call(e,m);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function c(d){if(!d||d.code==="ENOSYS")return!0;var m=!process.getuid||process.getuid()!==0;return!!(m&&(d.code==="EINVAL"||d.code==="EPERM"))}}});var vk=te((cV,gk)=>{var hk=require("stream").Stream;gk.exports=ZO;function ZO(e){return{ReadStream:t,WriteStream:n};function t(o,r){if(!(this instanceof t))return new t(o,r);hk.call(this);var i=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var s=Object.keys(r),l=0,u=s.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(d,m){if(d){i.emit("error",d),i.readable=!1;return}i.fd=m,i.emit("open",m),i._read()})}function n(o,r){if(!(this instanceof n))return new n(o,r);hk.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),s=0,l=i.length;s= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var _k=te((dV,yk)=>{"use strict";yk.exports=WO;var VO=Object.getPrototypeOf||function(e){return e.__proto__};function WO(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:VO(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}});var pf=te((pV,df)=>{var Tt=require("fs"),HO=mk(),JO=vk(),BO=_k(),_u=require("util"),Ft,wu;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Ft=Symbol.for("graceful-fs.queue"),wu=Symbol.for("graceful-fs.previous")):(Ft="___graceful-fs.queue",wu="___graceful-fs.previous");function GO(){}function xk(e,t){Object.defineProperty(e,Ft,{get:function(){return t}})}var $o=GO;_u.debuglog?$o=_u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&($o=function(){var e=_u.format.apply(_u,arguments);e="GFS4: "+e.split(/\n/).join(` -GFS4: `),console.error(e)});Tt[Ft]||(bk=global[Ft]||[],xk(Tt,bk),Tt.close=(function(e){function t(n,o){return e.call(Tt,n,function(r){r||wk(),typeof o=="function"&&o.apply(this,arguments)})}return Object.defineProperty(t,wu,{value:e}),t})(Tt.close),Tt.closeSync=(function(e){function t(n){e.apply(Tt,arguments),wk()}return Object.defineProperty(t,wu,{value:e}),t})(Tt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){$o(Tt[Ft]),require("assert").equal(Tt[Ft].length,0)}));var bk;global[Ft]||xk(global,Tt[Ft]);df.exports=uf(BO(Tt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Tt.__patched&&(df.exports=uf(Tt),Tt.__patched=!0);function uf(e){HO(e),e.gracefulify=uf,e.createReadStream=O,e.createWriteStream=N;var t=e.readFile;e.readFile=n;function n(E,le,z){return typeof le=="function"&&(z=le,le=null),ye(E,le,z);function ye(D,U,A,L){return t(D,U,function(B){B&&(B.code==="EMFILE"||B.code==="ENFILE")?Mi([ye,[D,U,A],B,L||Date.now(),Date.now()]):typeof A=="function"&&A.apply(this,arguments)})}}var o=e.writeFile;e.writeFile=r;function r(E,le,z,ye){return typeof z=="function"&&(ye=z,z=null),D(E,le,z,ye);function D(U,A,L,B,ne){return o(U,A,L,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Mi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var i=e.appendFile;i&&(e.appendFile=s);function s(E,le,z,ye){return typeof z=="function"&&(ye=z,z=null),D(E,le,z,ye);function D(U,A,L,B,ne){return i(U,A,L,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Mi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(E,le,z,ye){return typeof z=="function"&&(ye=z,z=0),D(E,le,z,ye);function D(U,A,L,B,ne){return l(U,A,L,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Mi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var c=e.readdir;e.readdir=m;var d=/^v[0-5]\./;function m(E,le,z){typeof le=="function"&&(z=le,le=null);var ye=d.test(process.version)?function(A,L,B,ne){return c(A,D(A,L,B,ne))}:function(A,L,B,ne){return c(A,L,D(A,L,B,ne))};return ye(E,le,z);function D(U,A,L,B){return function(ne,W){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Mi([ye,[U,A,L],ne,B||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof L=="function"&&L.call(this,ne,W))}}}if(process.version.substr(0,4)==="v0.8"){var _=JO(e);R=_.ReadStream,v=_.WriteStream}var h=e.ReadStream;h&&(R.prototype=Object.create(h.prototype),R.prototype.open=g);var b=e.WriteStream;b&&(v.prototype=Object.create(b.prototype),v.prototype.open=C),Object.defineProperty(e,"ReadStream",{get:function(){return R},set:function(E){R=E},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(E){v=E},enumerable:!0,configurable:!0});var k=R;Object.defineProperty(e,"FileReadStream",{get:function(){return k},set:function(E){k=E},enumerable:!0,configurable:!0});var T=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return T},set:function(E){T=E},enumerable:!0,configurable:!0});function R(E,le){return this instanceof R?(h.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}function g(){var E=this;ee(E.path,E.flags,E.mode,function(le,z){le?(E.autoClose&&E.destroy(),E.emit("error",le)):(E.fd=z,E.emit("open",z),E.read())})}function v(E,le){return this instanceof v?(b.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function C(){var E=this;ee(E.path,E.flags,E.mode,function(le,z){le?(E.destroy(),E.emit("error",le)):(E.fd=z,E.emit("open",z))})}function O(E,le){return new e.ReadStream(E,le)}function N(E,le){return new e.WriteStream(E,le)}var K=e.open;e.open=ee;function ee(E,le,z,ye){return typeof z=="function"&&(ye=z,z=null),D(E,le,z,ye);function D(U,A,L,B,ne){return K(U,A,L,function(W,pe){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Mi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}return e}function Mi(e){$o("ENQUEUE",e[0].name,e[1]),Tt[Ft].push(e),cf()}var bu;function wk(){for(var e=Date.now(),t=0;t2&&(Tt[Ft][t][3]=e,Tt[Ft][t][4]=e);cf()}function cf(){if(clearTimeout(bu),bu=void 0,Tt[Ft].length!==0){var e=Tt[Ft].shift(),t=e[0],n=e[1],o=e[2],r=e[3],i=e[4];if(r===void 0)$o("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){$o("TIMEOUT",t.name,n);var s=n.pop();typeof s=="function"&&s.call(null,o)}else{var l=Date.now()-i,u=Math.max(i-r,1),c=Math.min(u*1.2,100);l>=c?($o("RETRY",t.name,n),t.apply(null,n.concat([r]))):Tt[Ft].push(e)}bu===void 0&&(bu=setTimeout(cf,0))}}});var Sk=te((fV,kk)=>{function Lr(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}kk.exports=Lr;Lr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Lr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Lr.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var o=this,r=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},n);return this._options.unref&&r.unref(),!0};Lr.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Lr.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};Lr.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};Lr.prototype.start=Lr.prototype.try;Lr.prototype.errors=function(){return this._errors};Lr.prototype.attempts=function(){return this._attempts};Lr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,o=0;o=n&&(t=r,n=s)}return t}});var Ik=te(Po=>{var KO=Sk();Po.operation=function(e){var t=Po.timeouts(e);return new KO(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};Po.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],r=0;r{Tk.exports=Ik()});var Pk=te((gV,xu)=>{xu.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&xu.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&xu.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Dk=te((vV,qi)=>{var kt=global.process,Eo=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Eo(kt)?(Ek=require("assert"),Ai=Pk(),Ck=/^win/i.test(kt.platform),Ua=require("events"),typeof Ua!="function"&&(Ua=Ua.EventEmitter),kt.__signal_exit_emitter__?Ut=kt.__signal_exit_emitter__:(Ut=kt.__signal_exit_emitter__=new Ua,Ut.count=0,Ut.emitted={}),Ut.infinite||(Ut.setMaxListeners(1/0),Ut.infinite=!0),qi.exports=function(e,t){if(!Eo(global.process))return function(){};Ek.equal(typeof e,"function","a callback must be provided for exit handler"),zi===!1&&ff();var n="exit";t&&t.alwaysLast&&(n="afterexit");var o=function(){Ut.removeListener(n,e),Ut.listeners("exit").length===0&&Ut.listeners("afterexit").length===0&&ku()};return Ut.on(n,e),o},ku=function(){!zi||!Eo(global.process)||(zi=!1,Ai.forEach(function(t){try{kt.removeListener(t,Su[t])}catch{}}),kt.emit=Iu,kt.reallyExit=mf,Ut.count-=1)},qi.exports.unload=ku,Co=function(t,n,o){Ut.emitted[t]||(Ut.emitted[t]=!0,Ut.emit(t,n,o))},Su={},Ai.forEach(function(e){Su[e]=function(){if(Eo(global.process)){var n=kt.listeners(e);n.length===Ut.count&&(ku(),Co("exit",null,e),Co("afterexit",null,e),Ck&&e==="SIGHUP"&&(e="SIGINT"),kt.kill(kt.pid,e))}}}),qi.exports.signals=function(){return Ai},zi=!1,ff=function(){zi||!Eo(global.process)||(zi=!0,Ut.count+=1,Ai=Ai.filter(function(t){try{return kt.on(t,Su[t]),!0}catch{return!1}}),kt.emit=Ok,kt.reallyExit=Rk)},qi.exports.load=ff,mf=kt.reallyExit,Rk=function(t){Eo(global.process)&&(kt.exitCode=t||0,Co("exit",kt.exitCode,null),Co("afterexit",kt.exitCode,null),mf.call(kt,kt.exitCode))},Iu=kt.emit,Ok=function(t,n){if(t==="exit"&&Eo(global.process)){n!==void 0&&(kt.exitCode=n);var o=Iu.apply(this,arguments);return Co("exit",kt.exitCode,null),Co("afterexit",kt.exitCode,null),o}else return Iu.apply(this,arguments)}):qi.exports=function(){return function(){}};var Ek,Ai,Ck,Ua,Ut,ku,Co,Su,zi,ff,mf,Rk,Iu,Ok});var Nk=te((yV,hf)=>{"use strict";var jk=Symbol();function YO(e,t,n){let o=t[jk];if(o)return t.stat(e,(i,s)=>{if(i)return n(i);n(null,s.mtime,o)});let r=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,r,r,i=>{if(i)return n(i);t.stat(e,(s,l)=>{if(s)return n(s);let u=l.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,jk,{value:u}),n(null,l.mtime,u)})})}function XO(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}hf.exports.probe=YO;hf.exports.getMtime=XO});var Uk=te((_V,Fa)=>{"use strict";var QO=require("path"),yf=pf(),eD=$k(),tD=Dk(),Mk=Nk(),In={};function La(e,t){return t.lockfilePath||`${e}.lock`}function _f(e,t,n){if(!t.realpath)return n(null,QO.resolve(e));t.fs.realpath(e,n)}function vf(e,t,n){let o=La(e,t);t.fs.mkdir(o,r=>{if(!r)return Mk.probe(o,t.fs,(i,s,l)=>{if(i)return t.fs.rmdir(o,()=>{}),n(i);n(null,s,l)});if(r.code!=="EEXIST")return n(r);if(t.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(o,(i,s)=>{if(i)return i.code==="ENOENT"?vf(e,{...t,stale:0},n):n(i);if(!Ak(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));zk(e,t,l=>{if(l)return n(l);vf(e,{...t,stale:0},n)})})})}function Ak(e,t){return e.mtime.getTime(){if(o&&o.code!=="ENOENT")return n(o);n()})}function Tu(e,t){let n=In[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(o,r)=>{let i=n.lastUpdate+t.stale{let c=n.lastUpdate+t.stale{throw o},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),_f(e,t,(o,r)=>{if(o)return n(o);let i=eD.operation(t.retries);i.attempt(()=>{vf(r,t,(s,l,u)=>{if(i.retry(s))return;if(s)return n(i.mainError());let c=In[r]={lockfilePath:La(r,t),mtime:l,mtimePrecision:u,options:t,lastUpdate:Date.now()};Tu(r,t),n(null,d=>{if(c.released)return d&&d(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));qk(r,{...t,realpath:!1},d)})})})})}function qk(e,t,n){t={fs:yf,realpath:!0,...t},_f(e,t,(o,r)=>{if(o)return n(o);let i=In[r];if(!i)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete In[r],zk(r,t,n)})}function nD(e,t,n){t={stale:1e4,realpath:!0,fs:yf,...t},t.stale=Math.max(t.stale||0,2e3),_f(e,t,(o,r)=>{if(o)return n(o);t.fs.stat(La(r,t),(i,s)=>i?i.code==="ENOENT"?n(null,!1):n(i):n(null,!Ak(s,t)))})}function oD(){return In}tD(()=>{for(let e in In){let t=In[e].options;try{t.fs.rmdirSync(La(e,t))}catch{}}});Fa.exports.lock=rD;Fa.exports.unlock=qk;Fa.exports.check=nD;Fa.exports.getLocks=oD});var Fk=te((bV,Lk)=>{"use strict";var iD=pf();function aD(e){let t=["mkdir","realpath","stat","rmdir","utimes"],n={...e};return t.forEach(o=>{n[o]=(...r)=>{let i=r.pop(),s;try{s=e[`${o}Sync`](...r)}catch(l){return i(l)}i(null,s)}}),n}function sD(e){return(...t)=>new Promise((n,o)=>{t.push((r,i)=>{r?o(r):n(i)}),e(...t)})}function lD(e){return(...t)=>{let n,o;if(t.push((r,i)=>{n=r,o=i}),e(...t),n)throw n;return o}}function uD(e){if(e={...e},e.fs=aD(e.fs||iD),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}Lk.exports={toPromise:sD,toSync:lD,toSyncOptions:uD}});var Vk=te((wV,no)=>{"use strict";var Ui=Uk(),{toPromise:$u,toSync:Pu,toSyncOptions:bf}=Fk();async function Zk(e,t){let n=await $u(Ui.lock)(e,t);return $u(n)}function cD(e,t){let n=Pu(Ui.lock)(e,bf(t));return Pu(n)}function dD(e,t){return $u(Ui.unlock)(e,t)}function pD(e,t){return Pu(Ui.unlock)(e,bf(t))}function fD(e,t){return $u(Ui.check)(e,t)}function mD(e,t){return Pu(Ui.check)(e,bf(t))}no.exports=Zk;no.exports.lock=Zk;no.exports.unlock=dD;no.exports.lockSync=cD;no.exports.unlockSync=pD;no.exports.check=fD;no.exports.checkSync=mD});var Fv=te((O9,p$)=>{"use strict";var Lv=Object.defineProperty,zq=Object.getOwnPropertyDescriptor,qq=Object.getOwnPropertyNames,Uq=Object.prototype.hasOwnProperty,Lq=(e,t)=>{for(var n in t)Lv(e,n,{get:t[n],enumerable:!0})},Fq=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qq(t))!Uq.call(e,r)&&r!==n&&Lv(e,r,{get:()=>t[r],enumerable:!(o=zq(t,r))||o.enumerable});return e},Zq=e=>Fq(Lv({},"__esModule",{value:!0}),e),c$={};Lq(c$,{SYMBOL_FOR_REQ_CONTEXT:()=>d$,getContext:()=>Vq});p$.exports=Zq(c$);var d$=Symbol.for("@vercel/request-context");function Vq(){return globalThis[d$]?.get?.()??{}}});var Ls=te((D9,m$)=>{"use strict";var Vv=Object.defineProperty,Wq=Object.getOwnPropertyDescriptor,Hq=Object.getOwnPropertyNames,Jq=Object.prototype.hasOwnProperty,Bq=(e,t)=>{for(var n in t)Vv(e,n,{get:t[n],enumerable:!0})},Gq=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Hq(t))!Jq.call(e,r)&&r!==n&&Vv(e,r,{get:()=>t[r],enumerable:!(o=Wq(t,r))||o.enumerable});return e},Kq=e=>Gq(Vv({},"__esModule",{value:!0}),e),f$={};Bq(f$,{VercelOidcTokenError:()=>Zv});m$.exports=Kq(f$);var Zv=class extends Error{constructor(t,n){super(t),this.name="VercelOidcTokenError",this.cause=n}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}});var y$=te((j9,v$)=>{"use strict";var Yq=Object.create,Vc=Object.defineProperty,Xq=Object.getOwnPropertyDescriptor,Qq=Object.getOwnPropertyNames,eU=Object.getPrototypeOf,tU=Object.prototype.hasOwnProperty,rU=(e,t)=>{for(var n in t)Vc(e,n,{get:t[n],enumerable:!0})},h$=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qq(t))!tU.call(e,r)&&r!==n&&Vc(e,r,{get:()=>t[r],enumerable:!(o=Xq(t,r))||o.enumerable});return e},Hv=(e,t,n)=>(n=e!=null?Yq(eU(e)):{},h$(t||!e||!e.__esModule?Vc(n,"default",{value:e,enumerable:!0}):n,e)),nU=e=>h$(Vc({},"__esModule",{value:!0}),e),g$={};rU(g$,{findRootDir:()=>aU,getUserDataDir:()=>sU});v$.exports=nU(g$);var Fs=Hv(require("path")),oU=Hv(require("fs")),Wv=Hv(require("os")),iU=Ls();function aU(){try{let e=process.cwd();for(;e!==Fs.default.dirname(e);){let t=Fs.default.join(e,".vercel");if(oU.default.existsSync(t))return e;e=Fs.default.dirname(e)}}catch{throw new iU.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function sU(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(Wv.default.platform()){case"darwin":return Fs.default.join(Wv.default.homedir(),"Library/Application Support");case"linux":return Fs.default.join(Wv.default.homedir(),".local/share");case"win32":return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}});var I$=te((N9,S$)=>{"use strict";var lU=Object.create,Wc=Object.defineProperty,uU=Object.getOwnPropertyDescriptor,cU=Object.getOwnPropertyNames,dU=Object.getPrototypeOf,pU=Object.prototype.hasOwnProperty,fU=(e,t)=>{for(var n in t)Wc(e,n,{get:t[n],enumerable:!0})},_$=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of cU(t))!pU.call(e,r)&&r!==n&&Wc(e,r,{get:()=>t[r],enumerable:!(o=uU(t,r))||o.enumerable});return e},b$=(e,t,n)=>(n=e!=null?lU(dU(e)):{},_$(t||!e||!e.__esModule?Wc(n,"default",{value:e,enumerable:!0}):n,e)),mU=e=>_$(Wc({},"__esModule",{value:!0}),e),w$={};fU(w$,{isValidAccessToken:()=>yU,readAuthConfig:()=>gU,writeAuthConfig:()=>vU});S$.exports=mU(w$);var Zs=b$(require("fs")),x$=b$(require("path")),hU=Vs();function k$(){let e=(0,hU.getVercelDataDir)();if(!e)throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return x$.join(e,"auth.json")}function gU(){try{let e=k$();if(!Zs.existsSync(e))return null;let t=Zs.readFileSync(e,"utf8");return t?JSON.parse(t):null}catch{return null}}function vU(e){let t=k$(),n=x$.dirname(t);Zs.existsSync(n)||Zs.mkdirSync(n,{mode:504,recursive:!0}),Zs.writeFileSync(t,JSON.stringify(e,null,2),{mode:384})}function yU(e,t=0){if(!e.token)return!1;if(typeof e.expiresAt!="number")return!0;let n=Math.floor(Date.now()/1e3),o=t/1e3;return e.expiresAt>=n+o}});var E$=te((M9,P$)=>{"use strict";var Gv=Object.defineProperty,_U=Object.getOwnPropertyDescriptor,bU=Object.getOwnPropertyNames,wU=Object.prototype.hasOwnProperty,xU=(e,t)=>{for(var n in t)Gv(e,n,{get:t[n],enumerable:!0})},kU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of bU(t))!wU.call(e,r)&&r!==n&&Gv(e,r,{get:()=>t[r],enumerable:!(o=_U(t,r))||o.enumerable});return e},SU=e=>kU(Gv({},"__esModule",{value:!0}),e),T$={};xU(T$,{processTokenResponse:()=>EU,refreshTokenRequest:()=>PU});P$.exports=SU(T$);var Jv=require("os"),IU="https://vercel.com",TU="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",$$=`@vercel/oidc node-${process.version} ${(0,Jv.platform)()} (${(0,Jv.arch)()}) ${(0,Jv.hostname)()}`,Bv=null;async function $U(){if(Bv)return Bv;let e=`${IU}/.well-known/openid-configuration`,t=await fetch(e,{headers:{"user-agent":$$}});if(!t.ok)throw new Error("Failed to discover OAuth endpoints");let n=await t.json();if(!n||typeof n.token_endpoint!="string")throw new Error("Invalid OAuth discovery response");let o=n.token_endpoint;return Bv=o,o}async function PU(e){let t=await $U();return await fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":$$},body:new URLSearchParams({client_id:TU,grant_type:"refresh_token",...e})})}async function EU(e){let t=await e.json();if(!e.ok){let n=typeof t=="object"&&t&&"error"in t?String(t.error):"Token refresh failed";return[new Error(n)]}return typeof t!="object"||t===null?[new Error("Invalid token response")]:typeof t.access_token!="string"?[new Error("Missing access_token in response")]:t.token_type!=="Bearer"?[new Error("Invalid token_type in response")]:typeof t.expires_in!="number"?[new Error("Missing expires_in in response")]:[null,t]}});var Qv=te((A9,R$)=>{"use strict";var Xv=Object.defineProperty,CU=Object.getOwnPropertyDescriptor,RU=Object.getOwnPropertyNames,OU=Object.prototype.hasOwnProperty,DU=(e,t)=>{for(var n in t)Xv(e,n,{get:t[n],enumerable:!0})},jU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of RU(t))!OU.call(e,r)&&r!==n&&Xv(e,r,{get:()=>t[r],enumerable:!(o=CU(t,r))||o.enumerable});return e},NU=e=>jU(Xv({},"__esModule",{value:!0}),e),C$={};DU(C$,{AccessTokenMissingError:()=>Kv,RefreshAccessTokenFailedError:()=>Yv});R$.exports=NU(C$);var Kv=class extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}},Yv=class extends Error{constructor(t){super("Failed to refresh authentication token.",{cause:t}),this.name="RefreshAccessTokenFailedError"}}});var Vs=te((z9,M$)=>{"use strict";var MU=Object.create,Hc=Object.defineProperty,AU=Object.getOwnPropertyDescriptor,zU=Object.getOwnPropertyNames,qU=Object.getPrototypeOf,UU=Object.prototype.hasOwnProperty,LU=(e,t)=>{for(var n in t)Hc(e,n,{get:t[n],enumerable:!0})},D$=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of zU(t))!UU.call(e,r)&&r!==n&&Hc(e,r,{get:()=>t[r],enumerable:!(o=AU(t,r))||o.enumerable});return e},j$=(e,t,n)=>(n=e!=null?MU(qU(e)):{},D$(t||!e||!e.__esModule?Hc(n,"default",{value:e,enumerable:!0}):n,e)),FU=e=>D$(Hc({},"__esModule",{value:!0}),e),N$={};LU(N$,{assertVercelOidcTokenResponse:()=>ey,findProjectInfo:()=>HU,getTokenPayload:()=>GU,getVercelDataDir:()=>ZU,getVercelOidcToken:()=>WU,getVercelToken:()=>VU,isExpired:()=>KU,loadToken:()=>BU,saveToken:()=>JU});M$.exports=FU(N$);var Ws=j$(require("path")),si=j$(require("fs")),pa=Ls(),Jc=y$(),ca=I$(),O$=E$(),da=Qv();function ZU(){let e="com.vercel.cli",t=(0,Jc.getUserDataDir)();return t?Ws.join(t,e):null}async function VU(e){let t=(0,ca.readAuthConfig)();if(!t?.token)throw new da.AccessTokenMissingError;if((0,ca.isValidAccessToken)(t,e?.expirationBufferMs))return t.token;if(!t.refreshToken)throw(0,ca.writeAuthConfig)({}),new da.RefreshAccessTokenFailedError("No refresh token available");try{let n=await(0,O$.refreshTokenRequest)({refresh_token:t.refreshToken}),[o,r]=await(0,O$.processTokenResponse)(n);if(o||!r)throw(0,ca.writeAuthConfig)({}),new da.RefreshAccessTokenFailedError(o);let i={token:r.access_token,expiresAt:Math.floor(Date.now()/1e3)+r.expires_in};return r.refresh_token&&(i.refreshToken=r.refresh_token),(0,ca.writeAuthConfig)(i),i.token}catch(n){throw(0,ca.writeAuthConfig)({}),n instanceof da.AccessTokenMissingError||n instanceof da.RefreshAccessTokenFailedError?n:new da.RefreshAccessTokenFailedError(n)}}async function WU(e,t,n){let o=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:""}`,r=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new pa.VercelOidcTokenError(`Failed to refresh OIDC token: ${r.statusText}`);let i=await r.json();return ey(i),i}function ey(e){if(!e||typeof e!="object")throw new TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in e)||typeof e.token!="string")throw new TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function HU(){let e=(0,Jc.findRootDir)();if(!e)throw new pa.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let t=Ws.join(e,".vercel","project.json");if(!si.existsSync(t))throw new pa.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let n=JSON.parse(si.readFileSync(t,"utf8"));if(typeof n.projectId!="string"&&typeof n.orgId!="string")throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:n.projectId,teamId:n.orgId}}function JU(e,t){let n=(0,Jc.getUserDataDir)();if(!n)throw new pa.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let o=Ws.join(n,"com.vercel.token",`${t}.json`),r=JSON.stringify(e);si.mkdirSync(Ws.dirname(o),{mode:504,recursive:!0}),si.writeFileSync(o,r),si.chmodSync(o,432)}function BU(e){let t=(0,Jc.getUserDataDir)();if(!t)throw new pa.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let n=Ws.join(t,"com.vercel.token",`${e}.json`);if(!si.existsSync(n))return null;let o=JSON.parse(si.readFileSync(n,"utf8"));return ey(o),o}function GU(e){let t=e.split(".");if(t.length!==3)throw new pa.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let n=t[1].replace(/-/g,"+").replace(/_/g,"/"),o=n.padEnd(n.length+(4-n.length%4)%4,"=");return JSON.parse(Buffer.from(o,"base64").toString("utf8"))}function KU(e,t=0){return e.exp*1e3{"use strict";var ty=Object.defineProperty,YU=Object.getOwnPropertyDescriptor,XU=Object.getOwnPropertyNames,QU=Object.prototype.hasOwnProperty,e4=(e,t)=>{for(var n in t)ty(e,n,{get:t[n],enumerable:!0})},t4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of XU(t))!QU.call(e,r)&&r!==n&&ty(e,r,{get:()=>t[r],enumerable:!(o=YU(t,r))||o.enumerable});return e},r4=e=>t4(ty({},"__esModule",{value:!0}),e),z$={};e4(z$,{refreshToken:()=>n4});q$.exports=r4(z$);var A$=Ls(),go=Vs();async function n4(e){let t=e?.project,n=e?.team;if(!t&&!n){let r=(0,go.findProjectInfo)();t=r.projectId,n=r.teamId}else if(!t||!n){let r=(0,go.findProjectInfo)();t=t??r.projectId,n=n??r.teamId}if(!t)throw new A$.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let o=(0,go.loadToken)(t);if(!o||(0,go.isExpired)((0,go.getTokenPayload)(o.token),e?.expirationBufferMs)){let r=await(0,go.getVercelToken)({expirationBufferMs:e?.expirationBufferMs});if(o=await(0,go.getVercelOidcToken)(r,t,n),!o)throw new A$.VercelOidcTokenError("Failed to refresh OIDC token");(0,go.saveToken)(o,t)}process.env.VERCEL_OIDC_TOKEN=o.token}});var Z$=te((U9,F$)=>{"use strict";var ny=Object.defineProperty,o4=Object.getOwnPropertyDescriptor,i4=Object.getOwnPropertyNames,a4=Object.prototype.hasOwnProperty,s4=(e,t)=>{for(var n in t)ny(e,n,{get:t[n],enumerable:!0})},l4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of i4(t))!a4.call(e,r)&&r!==n&&ny(e,r,{get:()=>t[r],enumerable:!(o=o4(t,r))||o.enumerable});return e},u4=e=>l4(ny({},"__esModule",{value:!0}),e),L$={};s4(L$,{getVercelOidcToken:()=>p4,getVercelOidcTokenSync:()=>ry});F$.exports=u4(L$);var c4=Fv(),d4=Ls();async function p4(e){let t="",n;try{t=ry()}catch(o){n=o}try{let[{getTokenPayload:o,isExpired:r},{refreshToken:i}]=await Promise.all([await Promise.resolve().then(()=>cr(Vs())),await Promise.resolve().then(()=>cr(U$()))]);(!t||r(o(t),e?.expirationBufferMs))&&(await i(e),t=ry())}catch(o){let r=n instanceof Error?n.message:"";throw o instanceof Error&&(r=`${r} -${o.message}`),r?new d4.VercelOidcTokenError(r):o}return t}function ry(){let e=(0,c4.getContext)().headers?.["x-vercel-oidc-token"]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw new Error("The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?");return e}});var iy=te((L9,J$)=>{"use strict";var oy=Object.defineProperty,f4=Object.getOwnPropertyDescriptor,m4=Object.getOwnPropertyNames,h4=Object.prototype.hasOwnProperty,g4=(e,t)=>{for(var n in t)oy(e,n,{get:t[n],enumerable:!0})},v4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m4(t))!h4.call(e,r)&&r!==n&&oy(e,r,{get:()=>t[r],enumerable:!(o=f4(t,r))||o.enumerable});return e},y4=e=>v4(oy({},"__esModule",{value:!0}),e),H$={};g4(H$,{AccessTokenMissingError:()=>W$.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>W$.RefreshAccessTokenFailedError,getContext:()=>_4.getContext,getVercelOidcToken:()=>V$.getVercelOidcToken,getVercelOidcTokenSync:()=>V$.getVercelOidcTokenSync,getVercelToken:()=>b4.getVercelToken});J$.exports=y4(H$);var V$=Z$(),_4=Fv(),W$=Qv(),b4=Vs()});var E6={};xn(E6,{log:()=>ot,sendStatus:()=>Tn});module.exports=kC(E6);var ba=cr(require("os"));var el=class e{constructor(t,n,o,r){this._uri=t,this._languageId=n,this._version=o,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),o=this.offsetAt(t.end);return this._content.substring(n,o)}return this._content}update(t,n){for(let o of t)if(e.isIncremental(o)){let r=Fy(o.range),i=this.offsetAt(r.start),s=this.offsetAt(r.end);this._content=this._content.substring(0,i)+o.text+this._content.substring(s,this._content.length);let l=Math.max(r.start.line,0),u=Math.max(r.end.line,0),c=this._lineOffsets,d=Uy(o.text,!1,i);if(u-l===d.length)for(let _=0,h=d.length;_t?r=s:o=s+1}let i=o-1;return t=this.ensureBeforeEOL(t,n[i]),{line:i,character:t-n[i]}}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let o=n[t.line];if(t.character<=0)return o;let r=t.line+1n&&Ly(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},tl;(function(e){function t(r,i,s,l){return new el(r,i,s,l)}e.create=t;function n(r,i,s){if(r instanceof el)return r.update(i,s),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function o(r,i){let s=r.getText(),l=ld(i.map(SC),(d,m)=>{let _=d.range.start.line-m.range.start.line;return _===0?d.range.start.character-m.range.start.character:_}),u=0,c=[];for(let d of l){let m=r.offsetAt(d.range.start);if(mu&&c.push(s.substring(u,m)),d.newText.length&&c.push(d.newText),u=r.offsetAt(d.range.end)}return c.push(s.substr(u)),c.join("")}e.applyEdits=o})(tl||(tl={}));function ld(e,t){if(e.length<=1)return e;let n=e.length/2|0,o=e.slice(0,n),r=e.slice(n);ld(o,t),ld(r,t);let i=0,s=0,l=0;for(;in.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function SC(e){let t=Fy(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var mt=cr(pk());var it=cr(require("fs")),Hk=cr(require("os")),Va=cr(require("path")),Fi=cr(Vk());var Za=cr(require("fs")),Wk=cr(require("os")),wf=cr(require("path")),Ro={baseUrl:"https://gateway.posit.ai",authUrl:"https://login.posit.cloud",apiUrl:"https://api.posit.ai",clientId:"rstudio-ide",scope:"prism"};function hD(){let e=Wk.homedir(),t=wf.join(e,".posit","assistant","settings.json");return Za.existsSync(t)?t:wf.join(e,".positai","settings.json")}function gD(){let e=hD();try{if(!Za.existsSync(e))return{...Ro};let t=Za.readFileSync(e,"utf-8"),r=JSON.parse(t)?.providers?.positai;if(!r)return{...Ro};let i=r.oauth,s=r?.baseUrl,l=i?.authHost,u=i?.apiHost,c=s||Ro.baseUrl;return{baseUrl:c,authUrl:l?`https://${l}`:Ro.authUrl,apiUrl:u?`https://${u}`:c.replace("gateway","api"),clientId:i?.clientId||Ro.clientId,scope:i?.scope||Ro.scope}}catch{return{...Ro}}}var Rt=gD();var Li=null,$n="auth:positai:oauth";function Wa(){let e=Hk.homedir(),t=Va.join(e,".posit","assistant","store","data.json");if(it.existsSync(t))return t;let n=Va.join(e,".positai","store","data.json");return it.existsSync(n)?n:t}function Jk(e){let t=e?.oauthAuth?.tokenData?.expiresAt;if(!t)return!0;let n=300*1e3;return Date.now()>=new Date(t).getTime()-n}var Ha={retries:{retries:5,minTimeout:100,maxTimeout:1e3},stale:1e4};function xf(e){let t=Va.dirname(e);it.existsSync(t)||it.mkdirSync(t,{recursive:!0})}async function vD(e){let t=Wa();xf(t);let n;try{it.existsSync(t)||it.writeFileSync(t,JSON.stringify({},null,2)),n=await Fi.default.lock(t,Ha);let o=JSON.parse(it.readFileSync(t,"utf-8")),r=new Date(Date.now()+e.expires_in*1e3).toISOString(),i={authenticated:!0,oauthAuth:{tokenData:{accessToken:e.access_token,refreshToken:e.refresh_token,expiresAt:r,tokenType:"Bearer",scope:e.scope},expiresAt:r,scope:e.scope}};o[$n]=i,it.writeFileSync(t,JSON.stringify(o,null,2)),ot(`[Auth] Tokens stored successfully, expires at ${r}`)}finally{n&&await n()}}async function kf(){let e=Wa();xf(e);let t;try{if(!it.existsSync(e)){it.writeFileSync(e,JSON.stringify({},null,2));return}t=await Fi.default.lock(e,Ha);let n=JSON.parse(it.readFileSync(e,"utf-8"));n[$n]={authenticated:!1},it.writeFileSync(e,JSON.stringify(n,null,2)),ot("[Auth] Cleared previous auth state")}finally{t&&await t()}}async function yD(e){let t=Wa();xf(t);let n;try{it.existsSync(t)||it.writeFileSync(t,JSON.stringify({},null,2)),n=await Fi.default.lock(t,Ha);let o=JSON.parse(it.readFileSync(t,"utf-8"));o[$n]={authenticated:!1,error:e},it.writeFileSync(t,JSON.stringify(o,null,2)),ot(`[Auth] Stored error state: ${e}`)}finally{n&&await n()}}function _D(e){return new Promise(t=>setTimeout(t,e))}async function bD(e,t){Li&&Li.abort(),Li=new AbortController;let n=`${Rt.authUrl}/oauth/token`,o=t*1e3;for(ot(`[Auth] Starting token polling with interval ${t}s`);!Li.signal.aborted&&(await _D(o),!Li.signal.aborted);){let r=new URLSearchParams({scope:Rt.scope,client_id:Rt.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e});try{let i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString(),signal:Li.signal});if(i.ok){let s=await i.json();await vD(s),ot("[Auth] Login successful, token stored");break}if(i.status===400){let s=await i.json();if(s.error==="authorization_pending")continue;if(s.error==="slow_down"){o+=5e3,ot(`[Auth] Slowing down polling to ${o/1e3}s`);continue}ot(`[Auth] Login failed: ${s.error}`),await yD(s.error);break}}catch(i){if(i.name==="AbortError")break;throw ot(`[Auth] Polling error: ${i.message}`),i}}}async function Bk(){await kf();let e=`${Rt.authUrl}/oauth/device/authorize`,t=new URLSearchParams({scope:Rt.scope,client_id:Rt.clientId});ot(`[Auth] Requesting device code from ${e}`);let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.toString()});if(!n.ok){let r=await n.text();throw ot(`[Auth] Device auth failed: ${n.status} ${r}`),new Error(`Device authorization failed: ${n.status}`)}let o=await n.json();return ot(`[Auth] Got device code, user_code: ${o.user_code}`),bD(o.device_code,o.interval).catch(r=>{ot(`[Auth] Polling failed: ${r.message}`)}),{userCode:o.user_code,verificationUri:o.verification_uri,verificationUriComplete:o.verification_uri_complete,deviceCode:o.device_code,interval:o.interval,expiresIn:o.expires_in}}async function wD(e){let t;try{t=await Fi.default.lock(e,Ha);let n=JSON.parse(it.readFileSync(e,"utf-8")),o=n[$n];if(o&&!Jk(o))return ot("[Auth] Token already refreshed by another process"),!0;let r=o?.oauthAuth?.tokenData;if(!r?.refreshToken)return ot("[Auth] No refresh token available"),!1;ot("[Auth] Refreshing access token...");let i=await fetch(`${Rt.authUrl}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:r.refreshToken,client_id:Rt.clientId,scope:r.scope||Rt.scope})});if(!i.ok)return ot(`[Auth] Token refresh failed: ${i.status}`),Tn("Token refresh failed","Error"),!1;let s=await i.json(),l=new Date(Date.now()+s.expires_in*1e3).toISOString(),u={...o,oauthAuth:{tokenData:{accessToken:s.access_token,refreshToken:s.refresh_token,expiresAt:l,tokenType:"Bearer",scope:r.scope||Rt.scope},expiresAt:l,scope:r.scope||Rt.scope}};return n[$n]=u,it.writeFileSync(e,JSON.stringify(n,null,2)),ot(`[Auth] Token refreshed successfully, expires at ${l}`),!0}catch(n){return ot(`[Auth] Token refresh error: ${n.message}`),!1}finally{t&&await t()}}async function xD(e){try{let t=await fetch(`${Rt.apiUrl}/v1/users/me`,{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});return t.ok?(await t.json()).email||null:(ot(`[Auth] Failed to fetch user email: HTTP ${t.status}`),null)}catch(t){return ot(`[Auth] Error fetching user email: ${t.message}`),null}}async function kD(e){let t=Wa(),n;try{if(!it.existsSync(t))return;n=await Fi.default.lock(t,Ha);let o=JSON.parse(it.readFileSync(t,"utf-8")),r=o[$n];r&&(r.userEmail=e,o[$n]=r,it.writeFileSync(t,JSON.stringify(o,null,2)),ot(`[Auth] Cached user email: ${e}`))}catch(o){ot(`[Auth] Failed to cache user email: ${o.message}`)}finally{n&&await n()}}async function Oo(){let e=Wa();if(!it.existsSync(e))return Tn("Not signed in","Error"),{status:"NotSignedIn",user:""};try{let t=it.readFileSync(e,"utf-8"),o=JSON.parse(t)[$n];if(!o)return Tn("Not signed in","Error"),{status:"NotSignedIn",user:""};if(o.error)return Tn(`Error: ${o.error}`,"Error"),{status:`Error: ${o.error}`,user:""};Jk(o)&&await wD(e)&&(o=JSON.parse(it.readFileSync(e,"utf-8"))[$n]);let r=o?.authenticated===!0,i=o?.oauthAuth?.tokenData?.accessToken;if(!r||!i||typeof i!="string")return Tn("Not signed in","Error"),{status:"NotSignedIn",user:""};Tn("Signed in","Normal");let s=o?.userEmail;return s||(ot("[Auth] No cached user email, fetching from /users/me"),s=await xD(i)??void 0,s?(ot(`[Auth] Fetched user email: ${s}`),kD(s)):ot("[Auth] Could not fetch user email, using placeholder")),{status:"OK",user:s||"[Posit AI User]",accessToken:i,baseUrl:Rt.baseUrl}}catch{return Tn("Not signed in","Error"),{status:"NotSignedIn",user:""}}}var Ja=class{diff(t,n,o={}){let r;typeof o=="function"?(r=o,o={}):"callback"in o&&(r=o.callback);let i=this.castInput(t,o),s=this.castInput(n,o),l=this.removeEmpty(this.tokenize(i,o)),u=this.removeEmpty(this.tokenize(s,o));return this.diffWithOptionsObj(l,u,o,r)}diffWithOptionsObj(t,n,o,r){var i;let s=g=>{if(g=this.postProcess(g,o),r){setTimeout(function(){r(g)},0);return}else return g},l=n.length,u=t.length,c=1,d=l+u;o.maxEditLength!=null&&(d=Math.min(d,o.maxEditLength));let m=(i=o.timeout)!==null&&i!==void 0?i:1/0,_=Date.now()+m,h=[{oldPos:-1,lastComponent:void 0}],b=this.extractCommon(h[0],n,t,0,o);if(h[0].oldPos+1>=u&&b+1>=l)return s(this.buildValues(h[0].lastComponent,n,t));let k=-1/0,T=1/0,R=()=>{for(let g=Math.max(k,-c);g<=Math.min(T,c);g+=2){let v,C=h[g-1],O=h[g+1];C&&(h[g-1]=void 0);let N=!1;if(O){let ee=O.oldPos-g;N=O&&0<=ee&&ee=u&&b+1>=l)return s(this.buildValues(v.lastComponent,n,t))||!0;h[g]=v,v.oldPos+1>=u&&(T=Math.min(T,g-1)),b+1>=l&&(k=Math.max(k,g+1))}c++};if(r)(function g(){setTimeout(function(){if(c>d||Date.now()>_)return r(void 0);R()||g()},0)})();else for(;c<=d&&Date.now()<=_;){let g=R();if(g)return g}}addToPath(t,n,o,r,i){let s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===o?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:n,removed:o,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:o,previousComponent:s}}}extractCommon(t,n,o,r,i){let s=n.length,l=o.length,u=t.oldPos,c=u-r,d=0;for(;c+1_.length?b:_}),d.value=this.join(m)}else d.value=this.join(n.slice(u,u+d.count));u+=d.count,d.added||(c+=d.count)}}return r}};var Sf=class extends Ja{constructor(){super(...arguments),this.tokenize=ID}equals(t,n,o){return o.ignoreWhitespace?((!o.newlineIsToken||!t.includes(` +`&&p++}w&&$.length>0&&T.push($.length),this._lineOffsets=T}return this._lineOffsets},f.prototype.positionAt=function(T){T=Math.max(Math.min(T,this._content.length),0);var $=this.getLineOffsets(),w=0,p=$.length;if(p===0)return s.create(0,T);for(;wT?p=M:w=M+1}var H=w-1;return s.create(H,T-$[H])},f.prototype.offsetAt=function(T){var $=this.getLineOffsets();if(T.line>=$.length)return this._content.length;if(T.line<0)return 0;var w=$[T.line],p=T.line+1<$.length?$[T.line+1]:this._content.length;return Math.max(Math.min(w+T.character,p),w)},Object.defineProperty(f.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),f})(),P;(function(f){var T=Object.prototype.toString;function $(Fe){return typeof Fe<"u"}f.defined=$;function w(Fe){return typeof Fe>"u"}f.undefined=w;function p(Fe){return Fe===!0||Fe===!1}f.boolean=p;function M(Fe){return T.call(Fe)==="[object String]"}f.string=M;function H(Fe){return T.call(Fe)==="[object Number]"}f.number=H;function Oe(Fe,Vn,mi){return T.call(Fe)==="[object Number]"&&Vn<=Fe&&Fe<=mi}f.numberRange=Oe;function yt(Fe){return T.call(Fe)==="[object Number]"&&-2147483648<=Fe&&Fe<=2147483647}f.integer=yt;function Ke(Fe){return T.call(Fe)==="[object Number]"&&0<=Fe&&Fe<=2147483647}f.uinteger=Ke;function or(Fe){return T.call(Fe)==="[object Function]"}f.func=or;function Tr(Fe){return Fe!==null&&typeof Fe=="object"}f.objectLiteral=Tr;function jr(Fe,Vn){return Array.isArray(Fe)&&Fe.every(Vn)}f.typedArray=jr})(P||(P={}))})});var xt=te(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.ProtocolNotificationType=pr.ProtocolNotificationType0=pr.ProtocolRequestType=pr.ProtocolRequestType0=pr.RegistrationType=pr.MessageDirection=void 0;var Si=So(),R_;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(R_||(pr.MessageDirection=R_={}));var xp=class{constructor(t){this.method=t}};pr.RegistrationType=xp;var kp=class extends Si.RequestType0{constructor(t){super(t)}};pr.ProtocolRequestType0=kp;var Sp=class extends Si.RequestType{constructor(t){super(t,Si.ParameterStructures.byName)}};pr.ProtocolRequestType=Sp;var Tp=class extends Si.NotificationType0{constructor(t){super(t)}};pr.ProtocolNotificationType0=Tp;var Ip=class extends Si.NotificationType{constructor(t){super(t,Si.ParameterStructures.byName)}};pr.ProtocolNotificationType=Ip});var Il=te(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.objectLiteral=Dt.typedArray=Dt.stringArray=Dt.array=Dt.func=Dt.error=Dt.number=Dt.string=Dt.boolean=void 0;function PC(e){return e===!0||e===!1}Dt.boolean=PC;function C_(e){return typeof e=="string"||e instanceof String}Dt.string=C_;function EC(e){return typeof e=="number"||e instanceof Number}Dt.number=EC;function RC(e){return e instanceof Error}Dt.error=RC;function CC(e){return typeof e=="function"}Dt.func=CC;function O_(e){return Array.isArray(e)}Dt.array=O_;function OC(e){return O_(e)&&e.every(t=>C_(t))}Dt.stringArray=OC;function DC(e,t){return Array.isArray(e)&&e.every(t)}Dt.typedArray=DC;function jC(e){return e!==null&&typeof e=="object"}Dt.objectLiteral=jC});var N_=te($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.ImplementationRequest=void 0;var D_=xt(),j_;(function(e){e.method="textDocument/implementation",e.messageDirection=D_.MessageDirection.clientToServer,e.type=new D_.ProtocolRequestType(e.method)})(j_||($l.ImplementationRequest=j_={}))});var z_=te(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.TypeDefinitionRequest=void 0;var M_=xt(),A_;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=M_.MessageDirection.clientToServer,e.type=new M_.ProtocolRequestType(e.method)})(A_||(Pl.TypeDefinitionRequest=A_={}))});var L_=te(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.DidChangeWorkspaceFoldersNotification=Ti.WorkspaceFoldersRequest=void 0;var El=xt(),q_;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=El.MessageDirection.serverToClient,e.type=new El.ProtocolRequestType0(e.method)})(q_||(Ti.WorkspaceFoldersRequest=q_={}));var U_;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=El.MessageDirection.clientToServer,e.type=new El.ProtocolNotificationType(e.method)})(U_||(Ti.DidChangeWorkspaceFoldersNotification=U_={}))});var V_=te(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.ConfigurationRequest=void 0;var F_=xt(),Z_;(function(e){e.method="workspace/configuration",e.messageDirection=F_.MessageDirection.serverToClient,e.type=new F_.ProtocolRequestType(e.method)})(Z_||(Rl.ConfigurationRequest=Z_={}))});var J_=te(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.ColorPresentationRequest=Ii.DocumentColorRequest=void 0;var Cl=xt(),W_;(function(e){e.method="textDocument/documentColor",e.messageDirection=Cl.MessageDirection.clientToServer,e.type=new Cl.ProtocolRequestType(e.method)})(W_||(Ii.DocumentColorRequest=W_={}));var H_;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=Cl.MessageDirection.clientToServer,e.type=new Cl.ProtocolRequestType(e.method)})(H_||(Ii.ColorPresentationRequest=H_={}))});var K_=te($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.FoldingRangeRefreshRequest=$i.FoldingRangeRequest=void 0;var Ol=xt(),B_;(function(e){e.method="textDocument/foldingRange",e.messageDirection=Ol.MessageDirection.clientToServer,e.type=new Ol.ProtocolRequestType(e.method)})(B_||($i.FoldingRangeRequest=B_={}));var G_;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Ol.MessageDirection.serverToClient,e.type=new Ol.ProtocolRequestType0(e.method)})(G_||($i.FoldingRangeRefreshRequest=G_={}))});var Q_=te(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DeclarationRequest=void 0;var Y_=xt(),X_;(function(e){e.method="textDocument/declaration",e.messageDirection=Y_.MessageDirection.clientToServer,e.type=new Y_.ProtocolRequestType(e.method)})(X_||(Dl.DeclarationRequest=X_={}))});var rb=te(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.SelectionRangeRequest=void 0;var eb=xt(),tb;(function(e){e.method="textDocument/selectionRange",e.messageDirection=eb.MessageDirection.clientToServer,e.type=new eb.ProtocolRequestType(e.method)})(tb||(jl.SelectionRangeRequest=tb={}))});var ab=te(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.WorkDoneProgressCancelNotification=Gn.WorkDoneProgressCreateRequest=Gn.WorkDoneProgress=void 0;var NC=So(),Nl=xt(),nb;(function(e){e.type=new NC.ProgressType;function t(n){return n===e.type}e.is=t})(nb||(Gn.WorkDoneProgress=nb={}));var ob;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Nl.MessageDirection.serverToClient,e.type=new Nl.ProtocolRequestType(e.method)})(ob||(Gn.WorkDoneProgressCreateRequest=ob={}));var ib;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Nl.MessageDirection.clientToServer,e.type=new Nl.ProtocolNotificationType(e.method)})(ib||(Gn.WorkDoneProgressCancelNotification=ib={}))});var cb=te(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.CallHierarchyOutgoingCallsRequest=Kn.CallHierarchyIncomingCallsRequest=Kn.CallHierarchyPrepareRequest=void 0;var Pi=xt(),sb;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=Pi.MessageDirection.clientToServer,e.type=new Pi.ProtocolRequestType(e.method)})(sb||(Kn.CallHierarchyPrepareRequest=sb={}));var lb;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=Pi.MessageDirection.clientToServer,e.type=new Pi.ProtocolRequestType(e.method)})(lb||(Kn.CallHierarchyIncomingCallsRequest=lb={}));var ub;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=Pi.MessageDirection.clientToServer,e.type=new Pi.ProtocolRequestType(e.method)})(ub||(Kn.CallHierarchyOutgoingCallsRequest=ub={}))});var gb=te(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.SemanticTokensRefreshRequest=fr.SemanticTokensRangeRequest=fr.SemanticTokensDeltaRequest=fr.SemanticTokensRequest=fr.SemanticTokensRegistrationType=fr.TokenFormat=void 0;var Tn=xt(),db;(function(e){e.Relative="relative"})(db||(fr.TokenFormat=db={}));var Da;(function(e){e.method="textDocument/semanticTokens",e.type=new Tn.RegistrationType(e.method)})(Da||(fr.SemanticTokensRegistrationType=Da={}));var pb;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=Tn.MessageDirection.clientToServer,e.type=new Tn.ProtocolRequestType(e.method),e.registrationMethod=Da.method})(pb||(fr.SemanticTokensRequest=pb={}));var fb;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=Tn.MessageDirection.clientToServer,e.type=new Tn.ProtocolRequestType(e.method),e.registrationMethod=Da.method})(fb||(fr.SemanticTokensDeltaRequest=fb={}));var mb;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=Tn.MessageDirection.clientToServer,e.type=new Tn.ProtocolRequestType(e.method),e.registrationMethod=Da.method})(mb||(fr.SemanticTokensRangeRequest=mb={}));var hb;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=Tn.MessageDirection.serverToClient,e.type=new Tn.ProtocolRequestType0(e.method)})(hb||(fr.SemanticTokensRefreshRequest=hb={}))});var _b=te(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.ShowDocumentRequest=void 0;var vb=xt(),yb;(function(e){e.method="window/showDocument",e.messageDirection=vb.MessageDirection.serverToClient,e.type=new vb.ProtocolRequestType(e.method)})(yb||(Ml.ShowDocumentRequest=yb={}))});var xb=te(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.LinkedEditingRangeRequest=void 0;var bb=xt(),wb;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=bb.MessageDirection.clientToServer,e.type=new bb.ProtocolRequestType(e.method)})(wb||(Al.LinkedEditingRangeRequest=wb={}))});var Rb=te(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.WillDeleteFilesRequest=Kt.DidDeleteFilesNotification=Kt.DidRenameFilesNotification=Kt.WillRenameFilesRequest=Kt.DidCreateFilesNotification=Kt.WillCreateFilesRequest=Kt.FileOperationPatternKind=void 0;var Nr=xt(),kb;(function(e){e.file="file",e.folder="folder"})(kb||(Kt.FileOperationPatternKind=kb={}));var Sb;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method)})(Sb||(Kt.WillCreateFilesRequest=Sb={}));var Tb;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolNotificationType(e.method)})(Tb||(Kt.DidCreateFilesNotification=Tb={}));var Ib;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method)})(Ib||(Kt.WillRenameFilesRequest=Ib={}));var $b;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolNotificationType(e.method)})($b||(Kt.DidRenameFilesNotification=$b={}));var Pb;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolNotificationType(e.method)})(Pb||(Kt.DidDeleteFilesNotification=Pb={}));var Eb;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method)})(Eb||(Kt.WillDeleteFilesRequest=Eb={}))});var Nb=te(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.MonikerRequest=Yn.MonikerKind=Yn.UniquenessLevel=void 0;var Cb=xt(),Ob;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(Ob||(Yn.UniquenessLevel=Ob={}));var Db;(function(e){e.$import="import",e.$export="export",e.local="local"})(Db||(Yn.MonikerKind=Db={}));var jb;(function(e){e.method="textDocument/moniker",e.messageDirection=Cb.MessageDirection.clientToServer,e.type=new Cb.ProtocolRequestType(e.method)})(jb||(Yn.MonikerRequest=jb={}))});var qb=te(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.TypeHierarchySubtypesRequest=Xn.TypeHierarchySupertypesRequest=Xn.TypeHierarchyPrepareRequest=void 0;var Ei=xt(),Mb;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=Ei.MessageDirection.clientToServer,e.type=new Ei.ProtocolRequestType(e.method)})(Mb||(Xn.TypeHierarchyPrepareRequest=Mb={}));var Ab;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=Ei.MessageDirection.clientToServer,e.type=new Ei.ProtocolRequestType(e.method)})(Ab||(Xn.TypeHierarchySupertypesRequest=Ab={}));var zb;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=Ei.MessageDirection.clientToServer,e.type=new Ei.ProtocolRequestType(e.method)})(zb||(Xn.TypeHierarchySubtypesRequest=zb={}))});var Fb=te(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.InlineValueRefreshRequest=Ri.InlineValueRequest=void 0;var zl=xt(),Ub;(function(e){e.method="textDocument/inlineValue",e.messageDirection=zl.MessageDirection.clientToServer,e.type=new zl.ProtocolRequestType(e.method)})(Ub||(Ri.InlineValueRequest=Ub={}));var Lb;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=zl.MessageDirection.serverToClient,e.type=new zl.ProtocolRequestType0(e.method)})(Lb||(Ri.InlineValueRefreshRequest=Lb={}))});var Hb=te(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.InlayHintRefreshRequest=Qn.InlayHintResolveRequest=Qn.InlayHintRequest=void 0;var Ci=xt(),Zb;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Ci.MessageDirection.clientToServer,e.type=new Ci.ProtocolRequestType(e.method)})(Zb||(Qn.InlayHintRequest=Zb={}));var Vb;(function(e){e.method="inlayHint/resolve",e.messageDirection=Ci.MessageDirection.clientToServer,e.type=new Ci.ProtocolRequestType(e.method)})(Vb||(Qn.InlayHintResolveRequest=Vb={}));var Wb;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Ci.MessageDirection.serverToClient,e.type=new Ci.ProtocolRequestType0(e.method)})(Wb||(Qn.InlayHintRefreshRequest=Wb={}))});var Qb=te(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DiagnosticRefreshRequest=Mr.WorkspaceDiagnosticRequest=Mr.DocumentDiagnosticRequest=Mr.DocumentDiagnosticReportKind=Mr.DiagnosticServerCancellationData=void 0;var Xb=So(),MC=Il(),Oi=xt(),Jb;(function(e){function t(n){let o=n;return o&&MC.boolean(o.retriggerRequest)}e.is=t})(Jb||(Mr.DiagnosticServerCancellationData=Jb={}));var Bb;(function(e){e.Full="full",e.Unchanged="unchanged"})(Bb||(Mr.DocumentDiagnosticReportKind=Bb={}));var Gb;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Oi.MessageDirection.clientToServer,e.type=new Oi.ProtocolRequestType(e.method),e.partialResult=new Xb.ProgressType})(Gb||(Mr.DocumentDiagnosticRequest=Gb={}));var Kb;(function(e){e.method="workspace/diagnostic",e.messageDirection=Oi.MessageDirection.clientToServer,e.type=new Oi.ProtocolRequestType(e.method),e.partialResult=new Xb.ProgressType})(Kb||(Mr.WorkspaceDiagnosticRequest=Kb={}));var Yb;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Oi.MessageDirection.serverToClient,e.type=new Oi.ProtocolRequestType0(e.method)})(Yb||(Mr.DiagnosticRefreshRequest=Yb={}))});var aw=te(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.DidCloseNotebookDocumentNotification=Et.DidSaveNotebookDocumentNotification=Et.DidChangeNotebookDocumentNotification=Et.NotebookCellArrayChange=Et.DidOpenNotebookDocumentNotification=Et.NotebookDocumentSyncRegistrationType=Et.NotebookDocument=Et.NotebookCell=Et.ExecutionSummary=Et.NotebookCellKind=void 0;var ja=Tl(),Yr=Il(),cn=xt(),$p;(function(e){e.Markup=1,e.Code=2;function t(n){return n===1||n===2}e.is=t})($p||(Et.NotebookCellKind=$p={}));var Pp;(function(e){function t(r,i){let s={executionOrder:r};return(i===!0||i===!1)&&(s.success=i),s}e.create=t;function n(r){let i=r;return Yr.objectLiteral(i)&&ja.uinteger.is(i.executionOrder)&&(i.success===void 0||Yr.boolean(i.success))}e.is=n;function o(r,i){return r===i?!0:r==null||i===null||i===void 0?!1:r.executionOrder===i.executionOrder&&r.success===i.success}e.equals=o})(Pp||(Et.ExecutionSummary=Pp={}));var ql;(function(e){function t(i,s){return{kind:i,document:s}}e.create=t;function n(i){let s=i;return Yr.objectLiteral(s)&&$p.is(s.kind)&&ja.DocumentUri.is(s.document)&&(s.metadata===void 0||Yr.objectLiteral(s.metadata))}e.is=n;function o(i,s){let l=new Set;return i.document!==s.document&&l.add("document"),i.kind!==s.kind&&l.add("kind"),i.executionSummary!==s.executionSummary&&l.add("executionSummary"),(i.metadata!==void 0||s.metadata!==void 0)&&!r(i.metadata,s.metadata)&&l.add("metadata"),(i.executionSummary!==void 0||s.executionSummary!==void 0)&&!Pp.equals(i.executionSummary,s.executionSummary)&&l.add("executionSummary"),l}e.diff=o;function r(i,s){if(i===s)return!0;if(i==null||s===null||s===void 0||typeof i!=typeof s||typeof i!="object")return!1;let l=Array.isArray(i),u=Array.isArray(s);if(l!==u)return!1;if(l&&u){if(i.length!==s.length)return!1;for(let c=0;c{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.InlineCompletionRequest=void 0;var sw=xt(),lw;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=sw.MessageDirection.clientToServer,e.type=new sw.ProtocolRequestType(e.method)})(lw||(Ul.InlineCompletionRequest=lw={}))});var xx=te(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var ie=xt(),cw=Tl(),qt=Il(),AC=N_();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return AC.ImplementationRequest}});var zC=z_();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return zC.TypeDefinitionRequest}});var yx=L_();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return yx.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return yx.DidChangeWorkspaceFoldersNotification}});var qC=V_();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return qC.ConfigurationRequest}});var _x=J_();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return _x.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return _x.ColorPresentationRequest}});var bx=K_();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return bx.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return bx.FoldingRangeRefreshRequest}});var UC=Q_();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return UC.DeclarationRequest}});var LC=rb();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return LC.SelectionRangeRequest}});var Dp=ab();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return Dp.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Dp.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Dp.WorkDoneProgressCancelNotification}});var jp=cb();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return jp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return jp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return jp.CallHierarchyPrepareRequest}});var ji=gb();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return ji.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return ji.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ji.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ji.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ji.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ji.SemanticTokensRegistrationType}});var FC=_b();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return FC.ShowDocumentRequest}});var ZC=xb();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return ZC.LinkedEditingRangeRequest}});var To=Rb();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return To.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return To.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return To.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return To.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return To.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return To.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return To.WillDeleteFilesRequest}});var Np=Nb();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Np.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Np.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Np.MonikerRequest}});var Mp=qb();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Mp.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Mp.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Mp.TypeHierarchySupertypesRequest}});var wx=Fb();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return wx.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return wx.InlineValueRefreshRequest}});var Ap=Hb();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return Ap.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Ap.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Ap.InlayHintRefreshRequest}});var Na=Qb();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Na.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Na.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Na.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Na.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Na.DiagnosticRefreshRequest}});var dn=aw();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return dn.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return dn.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return dn.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return dn.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return dn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return dn.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return dn.DidCloseNotebookDocumentNotification}});var VC=uw();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return VC.InlineCompletionRequest}});var Ep;(function(e){function t(n){let o=n;return qt.string(o)||qt.string(o.language)||qt.string(o.scheme)||qt.string(o.pattern)}e.is=t})(Ep||(S.TextDocumentFilter=Ep={}));var Rp;(function(e){function t(n){let o=n;return qt.objectLiteral(o)&&(qt.string(o.notebookType)||qt.string(o.scheme)||qt.string(o.pattern))}e.is=t})(Rp||(S.NotebookDocumentFilter=Rp={}));var Cp;(function(e){function t(n){let o=n;return qt.objectLiteral(o)&&(qt.string(o.notebook)||Rp.is(o.notebook))&&(o.language===void 0||qt.string(o.language))}e.is=t})(Cp||(S.NotebookCellTextDocumentFilter=Cp={}));var Op;(function(e){function t(n){if(!Array.isArray(n))return!1;for(let o of n)if(!qt.string(o)&&!Ep.is(o)&&!Cp.is(o))return!1;return!0}e.is=t})(Op||(S.DocumentSelector=Op={}));var dw;(function(e){e.method="client/registerCapability",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType(e.method)})(dw||(S.RegistrationRequest=dw={}));var pw;(function(e){e.method="client/unregisterCapability",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType(e.method)})(pw||(S.UnregistrationRequest=pw={}));var fw;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete"})(fw||(S.ResourceOperationKind=fw={}));var mw;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"})(mw||(S.FailureHandlingKind=mw={}));var hw;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"})(hw||(S.PositionEncodingKind=hw={}));var gw;(function(e){function t(n){let o=n;return o&&qt.string(o.id)&&o.id.length>0}e.hasId=t})(gw||(S.StaticRegistrationOptions=gw={}));var vw;(function(e){function t(n){let o=n;return o&&(o.documentSelector===null||Op.is(o.documentSelector))}e.is=t})(vw||(S.TextDocumentRegistrationOptions=vw={}));var yw;(function(e){function t(o){let r=o;return qt.objectLiteral(r)&&(r.workDoneProgress===void 0||qt.boolean(r.workDoneProgress))}e.is=t;function n(o){let r=o;return r&&qt.boolean(r.workDoneProgress)}e.hasWorkDoneProgress=n})(yw||(S.WorkDoneProgressOptions=yw={}));var _w;(function(e){e.method="initialize",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(_w||(S.InitializeRequest=_w={}));var bw;(function(e){e.unknownProtocolVersion=1})(bw||(S.InitializeErrorCodes=bw={}));var ww;(function(e){e.method="initialized",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(ww||(S.InitializedNotification=ww={}));var xw;(function(e){e.method="shutdown",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType0(e.method)})(xw||(S.ShutdownRequest=xw={}));var kw;(function(e){e.method="exit",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType0(e.method)})(kw||(S.ExitNotification=kw={}));var Sw;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Sw||(S.DidChangeConfigurationNotification=Sw={}));var Tw;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(Tw||(S.MessageType=Tw={}));var Iw;(function(e){e.method="window/showMessage",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(Iw||(S.ShowMessageNotification=Iw={}));var $w;(function(e){e.method="window/showMessageRequest",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType(e.method)})($w||(S.ShowMessageRequest=$w={}));var Pw;(function(e){e.method="window/logMessage",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(Pw||(S.LogMessageNotification=Pw={}));var Ew;(function(e){e.method="telemetry/event",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(Ew||(S.TelemetryEventNotification=Ew={}));var Rw;(function(e){e.None=0,e.Full=1,e.Incremental=2})(Rw||(S.TextDocumentSyncKind=Rw={}));var Cw;(function(e){e.method="textDocument/didOpen",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Cw||(S.DidOpenTextDocumentNotification=Cw={}));var Ow;(function(e){function t(o){let r=o;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}e.isIncremental=t;function n(o){let r=o;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}e.isFull=n})(Ow||(S.TextDocumentContentChangeEvent=Ow={}));var Dw;(function(e){e.method="textDocument/didChange",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Dw||(S.DidChangeTextDocumentNotification=Dw={}));var jw;(function(e){e.method="textDocument/didClose",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(jw||(S.DidCloseTextDocumentNotification=jw={}));var Nw;(function(e){e.method="textDocument/didSave",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Nw||(S.DidSaveTextDocumentNotification=Nw={}));var Mw;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(Mw||(S.TextDocumentSaveReason=Mw={}));var Aw;(function(e){e.method="textDocument/willSave",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(Aw||(S.WillSaveTextDocumentNotification=Aw={}));var zw;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(zw||(S.WillSaveTextDocumentWaitUntilRequest=zw={}));var qw;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolNotificationType(e.method)})(qw||(S.DidChangeWatchedFilesNotification=qw={}));var Uw;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(Uw||(S.FileChangeType=Uw={}));var Lw;(function(e){function t(n){let o=n;return qt.objectLiteral(o)&&(cw.URI.is(o.baseUri)||cw.WorkspaceFolder.is(o.baseUri))&&qt.string(o.pattern)}e.is=t})(Lw||(S.RelativePattern=Lw={}));var Fw;(function(e){e.Create=1,e.Change=2,e.Delete=4})(Fw||(S.WatchKind=Fw={}));var Zw;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolNotificationType(e.method)})(Zw||(S.PublishDiagnosticsNotification=Zw={}));var Vw;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Vw||(S.CompletionTriggerKind=Vw={}));var Ww;(function(e){e.method="textDocument/completion",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Ww||(S.CompletionRequest=Ww={}));var Hw;(function(e){e.method="completionItem/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Hw||(S.CompletionResolveRequest=Hw={}));var Jw;(function(e){e.method="textDocument/hover",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Jw||(S.HoverRequest=Jw={}));var Bw;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(Bw||(S.SignatureHelpTriggerKind=Bw={}));var Gw;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Gw||(S.SignatureHelpRequest=Gw={}));var Kw;(function(e){e.method="textDocument/definition",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Kw||(S.DefinitionRequest=Kw={}));var Yw;(function(e){e.method="textDocument/references",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Yw||(S.ReferencesRequest=Yw={}));var Xw;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Xw||(S.DocumentHighlightRequest=Xw={}));var Qw;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(Qw||(S.DocumentSymbolRequest=Qw={}));var ex;(function(e){e.method="textDocument/codeAction",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ex||(S.CodeActionRequest=ex={}));var tx;(function(e){e.method="codeAction/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(tx||(S.CodeActionResolveRequest=tx={}));var rx;(function(e){e.method="workspace/symbol",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(rx||(S.WorkspaceSymbolRequest=rx={}));var nx;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(nx||(S.WorkspaceSymbolResolveRequest=nx={}));var ox;(function(e){e.method="textDocument/codeLens",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ox||(S.CodeLensRequest=ox={}));var ix;(function(e){e.method="codeLens/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ix||(S.CodeLensResolveRequest=ix={}));var ax;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType0(e.method)})(ax||(S.CodeLensRefreshRequest=ax={}));var sx;(function(e){e.method="textDocument/documentLink",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(sx||(S.DocumentLinkRequest=sx={}));var lx;(function(e){e.method="documentLink/resolve",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(lx||(S.DocumentLinkResolveRequest=lx={}));var ux;(function(e){e.method="textDocument/formatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(ux||(S.DocumentFormattingRequest=ux={}));var cx;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(cx||(S.DocumentRangeFormattingRequest=cx={}));var dx;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(dx||(S.DocumentRangesFormattingRequest=dx={}));var px;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(px||(S.DocumentOnTypeFormattingRequest=px={}));var fx;(function(e){e.Identifier=1})(fx||(S.PrepareSupportDefaultBehavior=fx={}));var mx;(function(e){e.method="textDocument/rename",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(mx||(S.RenameRequest=mx={}));var hx;(function(e){e.method="textDocument/prepareRename",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(hx||(S.PrepareRenameRequest=hx={}));var gx;(function(e){e.method="workspace/executeCommand",e.messageDirection=ie.MessageDirection.clientToServer,e.type=new ie.ProtocolRequestType(e.method)})(gx||(S.ExecuteCommandRequest=gx={}));var vx;(function(e){e.method="workspace/applyEdit",e.messageDirection=ie.MessageDirection.serverToClient,e.type=new ie.ProtocolRequestType("workspace/applyEdit")})(vx||(S.ApplyWorkspaceEditRequest=vx={}))});var Sx=te(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.createProtocolConnection=void 0;var kx=So();function WC(e,t,n,o){return kx.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,kx.createMessageConnection)(e,t,n,o)}Ll.createProtocolConnection=WC});var Ix=te(mr=>{"use strict";var HC=mr&&mr.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),Fl=mr&&mr.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&HC(t,e,n)};Object.defineProperty(mr,"__esModule",{value:!0});mr.LSPErrorCodes=mr.createProtocolConnection=void 0;Fl(So(),mr);Fl(Tl(),mr);Fl(xt(),mr);Fl(xx(),mr);var JC=Sx();Object.defineProperty(mr,"createProtocolConnection",{enumerable:!0,get:function(){return JC.createProtocolConnection}});var Tx;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(Tx||(mr.LSPErrorCodes=Tx={}))});var Rt=te(pn=>{"use strict";var BC=pn&&pn.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),$x=pn&&pn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&BC(t,e,n)};Object.defineProperty(pn,"__esModule",{value:!0});pn.createProtocolConnection=void 0;var GC=wp();$x(wp(),pn);$x(Ix(),pn);function KC(e,t,n,o){return(0,GC.createMessageConnection)(e,t,n,o)}pn.createProtocolConnection=KC});var zp=te(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.generateUuid=Ar.parse=Ar.isUUID=Ar.v4=Ar.empty=void 0;var Ma=class{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},Aa=class e extends Ma{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}};Aa._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Aa._timeHighBits=["8","9","a","b"];Ar.empty=new Ma("00000000-0000-0000-0000-000000000000");function Px(){return new Aa}Ar.v4=Px;var YC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ex(e){return YC.test(e)}Ar.isUUID=Ex;function XC(e){if(!Ex(e))throw new Error("invalid uuid");return new Ma(e)}Ar.parse=XC;function QC(){return Px().asHex()}Ar.generateUuid=QC});var Rx=te(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.attachPartialResult=to.ProgressFeature=to.attachWorkDone=void 0;var eo=Rt(),eO=zp(),Io=class e{constructor(t,n){this._connection=t,this._token=n,e.Instances.set(this._token,this)}begin(t,n,o,r){let i={kind:"begin",title:t,percentage:n,message:o,cancellable:r};this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,i)}report(t,n){let o={kind:"report"};typeof t=="number"?(o.percentage=t,n!==void 0&&(o.message=n)):o.message=t,this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,o)}done(){e.Instances.delete(this._token),this._connection.sendProgress(eo.WorkDoneProgress.type,this._token,{kind:"end"})}};Io.Instances=new Map;var Zl=class extends Io{constructor(t,n){super(t,n),this._source=new eo.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},za=class{constructor(){}begin(){}report(){}done(){}},Vl=class extends za{constructor(){super(),this._source=new eo.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function tO(e,t){if(t===void 0||t.workDoneToken===void 0)return new za;let n=t.workDoneToken;return delete t.workDoneToken,new Io(e,n)}to.attachWorkDone=tO;var rO=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(eo.WorkDoneProgressCancelNotification.type,n=>{let o=Io.Instances.get(n.token);(o instanceof Zl||o instanceof Vl)&&o.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new za:new Io(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0,eO.generateUuid)();return this.connection.sendRequest(eo.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new Zl(this.connection,t))}else return Promise.resolve(new Vl)}};to.ProgressFeature=rO;var qp;(function(e){e.type=new eo.ProgressType})(qp||(qp={}));var Up=class{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(qp.type,this._token,t)}};function nO(e,t){if(t===void 0||t.partialResultToken===void 0)return;let n=t.partialResultToken;return delete t.partialResultToken,new Up(e,n)}to.attachPartialResult=nO});var Cx=te(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.ConfigurationFeature=void 0;var oO=Rt(),iO=rl(),aO=e=>class extends e{getConfiguration(t){return t?iO.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let n={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(oO.ConfigurationRequest.type,n).then(o=>Array.isArray(o)?Array.isArray(t)?o:o[0]:Array.isArray(t)?[]:null)}};Wl.ConfigurationFeature=aO});var Ox=te(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.WorkspaceFoldersFeature=void 0;var Hl=Rt(),sO=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let n=t.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Hl.Emitter,this.connection.onNotification(Hl.DidChangeWorkspaceFoldersNotification.type,o=>{this._onDidChangeWorkspaceFolders.fire(o.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);let n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Hl.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Hl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Jl.WorkspaceFoldersFeature=sO});var Dx=te(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.CallHierarchyFeature=void 0;var Lp=Rt(),lO=e=>class extends e{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(Lp.CallHierarchyPrepareRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{let n=Lp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onOutgoingCalls:t=>{let n=Lp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};Bl.CallHierarchyFeature=lO});var Zp=te(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.SemanticTokensBuilder=ro.SemanticTokensDiff=ro.SemanticTokensFeature=void 0;var Gl=Rt(),uO=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Gl.SemanticTokensRefreshRequest.type),on:t=>{let n=Gl.SemanticTokensRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onDelta:t=>{let n=Gl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onRange:t=>{let n=Gl.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};ro.SemanticTokensFeature=uO;var Kl=class{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){let t=this.originalSequence.length,n=this.modifiedSequence.length,o=0;for(;o=o&&i>=o&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r0&&(s-=this._prevLine,s===0&&(l-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=l,this._data[this._dataLen++]=o,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Kl(this._prevData,this._data).computeDiff()}:this.build()}};ro.SemanticTokensBuilder=Fp});var jx=te(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.ShowDocumentFeature=void 0;var cO=Rt(),dO=e=>class extends e{showDocument(t){return this.connection.sendRequest(cO.ShowDocumentRequest.type,t)}};Yl.ShowDocumentFeature=dO});var Nx=te(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.FileOperationsFeature=void 0;var Ni=Rt(),pO=e=>class extends e{onDidCreateFiles(t){return this.connection.onNotification(Ni.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(Ni.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(Ni.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(Ni.WillCreateFilesRequest.type,(n,o)=>t(n,o))}onWillRenameFiles(t){return this.connection.onRequest(Ni.WillRenameFilesRequest.type,(n,o)=>t(n,o))}onWillDeleteFiles(t){return this.connection.onRequest(Ni.WillDeleteFilesRequest.type,(n,o)=>t(n,o))}};Xl.FileOperationsFeature=pO});var Mx=te(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.LinkedEditingRangeFeature=void 0;var fO=Rt(),mO=e=>class extends e{onLinkedEditingRange(t){return this.connection.onRequest(fO.LinkedEditingRangeRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),void 0))}};Ql.LinkedEditingRangeFeature=mO});var Ax=te(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.TypeHierarchyFeature=void 0;var Vp=Rt(),hO=e=>class extends e{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(Vp.TypeHierarchyPrepareRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{let n=Vp.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))},onSubtypes:t=>{let n=Vp.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};eu.TypeHierarchyFeature=hO});var qx=te(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.InlineValueFeature=void 0;var zx=Rt(),gO=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(zx.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(zx.InlineValueRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n)))}}};tu.InlineValueFeature=gO});var Lx=te(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.FoldingRangeFeature=void 0;var Ux=Rt(),vO=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Ux.FoldingRangeRefreshRequest.type),on:t=>{let n=Ux.FoldingRangeRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};ru.FoldingRangeFeature=vO});var Fx=te(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.InlayHintFeature=void 0;var Wp=Rt(),yO=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Wp.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest(Wp.InlayHintRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest(Wp.InlayHintResolveRequest.type,(n,o)=>t(n,o))}}};nu.InlayHintFeature=yO});var Zx=te(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.DiagnosticFeature=void 0;var qa=Rt(),_O=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(qa.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(qa.DocumentDiagnosticRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(qa.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:t=>this.connection.onRequest(qa.WorkspaceDiagnosticRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(qa.WorkspaceDiagnosticRequest.partialResult,n)))}}};ou.DiagnosticFeature=_O});var Jp=te(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.TextDocuments=void 0;var $o=Rt(),Hp=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new $o.Emitter,this._onDidOpen=new $o.Emitter,this._onDidClose=new $o.Emitter,this._onDidSave=new $o.Emitter,this._onWillSave=new $o.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=$o.TextDocumentSyncKind.Incremental;let n=[];return n.push(t.onDidOpenTextDocument(o=>{let r=o.textDocument,i=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,i);let s=Object.freeze({document:i});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),n.push(t.onDidChangeTextDocument(o=>{let r=o.textDocument,i=o.contentChanges;if(i.length===0)return;let{version:s}=r;if(s==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let l=this._syncedDocuments.get(r.uri);l!==void 0&&(l=this._configuration.update(l,i,s),this._syncedDocuments.set(r.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),n.push(t.onDidCloseTextDocument(o=>{let r=this._syncedDocuments.get(o.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(o.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),n.push(t.onWillSaveTextDocument(o=>{let r=this._syncedDocuments.get(o.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:o.reason}))})),n.push(t.onWillSaveTextDocumentWaitUntil((o,r)=>{let i=this._syncedDocuments.get(o.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:o.reason}),r):[]})),n.push(t.onDidSaveTextDocument(o=>{let r=this._syncedDocuments.get(o.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),$o.Disposable.create(()=>{n.forEach(o=>o.dispose())})}};iu.TextDocuments=Hp});var Gp=te(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.NotebookDocuments=Mi.NotebookSyncFeature=void 0;var zr=Rt(),Vx=Jp(),bO=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(zr.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(zr.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(zr.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(zr.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};Mi.NotebookSyncFeature=bO;var au=class e{onDidOpenTextDocument(t){return this.openHandler=t,zr.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,zr.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,zr.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};au.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Bp=class{constructor(t){t instanceof Vx.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new Vx.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new zr.Emitter,this._onDidChange=new zr.Emitter,this._onDidSave=new zr.Emitter,this._onDidClose=new zr.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t=="string"?t:t.document,o=this.notebookCellMap.get(n);return o&&o[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(t){let n=new au,o=[];return o.push(this.cellTextDocuments.listen(n)),o.push(t.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let i of r.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),o.push(t.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let i=this.notebookDocuments.get(r.notebookDocument.uri);if(i===void 0)return;i.version=r.notebookDocument.version;let s=i.metadata,l=!1,u=r.change;u.metadata!==void 0&&(l=!0,i.metadata=u.metadata);let c=[],d=[],m=[],_=[];if(u.cells!==void 0){let C=u.cells;if(C.structure!==void 0){let g=C.structure.array;if(i.cells.splice(g.start,g.deleteCount,...g.cells!==void 0?g.cells:[]),C.structure.didOpen!==void 0)for(let v of C.structure.didOpen)n.openTextDocument({textDocument:v}),c.push(v.uri);if(C.structure.didClose)for(let v of C.structure.didClose)n.closeTextDocument({textDocument:v}),d.push(v.uri)}if(C.data!==void 0){let g=new Map(C.data.map(v=>[v.document,v]));for(let v=0;v<=i.cells.length;v++){let R=g.get(i.cells[v].document);if(R!==void 0){let O=i.cells.splice(v,1,R);if(m.push({old:O[0],new:R}),g.delete(R.document),g.size===0)break}}}if(C.textContent!==void 0)for(let g of C.textContent)n.changeTextDocument({textDocument:g.document,contentChanges:g.changes}),_.push(g.document.uri)}this.updateCellMap(i);let h={notebookDocument:i};l&&(h.metadata={old:s,new:i.metadata});let b=[];for(let C of c)b.push(this.getNotebookCell(C));let k=[];for(let C of d)k.push(this.getNotebookCell(C));let I=[];for(let C of _)I.push(this.getNotebookCell(C));(b.length>0||k.length>0||m.length>0||I.length>0)&&(h.cells={added:b,removed:k,changed:{data:m,textContent:I}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),o.push(t.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let i=this.notebookDocuments.get(r.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),o.push(t.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let i=this.notebookDocuments.get(r.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let s of r.cellTextDocuments)n.closeTextDocument({textDocument:s});this.notebookDocuments.delete(r.notebookDocument.uri);for(let s of i.cells)this.notebookCellMap.delete(s.document)}})),zr.Disposable.create(()=>{o.forEach(r=>r.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}};Mi.NotebookDocuments=Bp});var Wx=te(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MonikerFeature=void 0;var wO=Rt(),xO=e=>class extends e{get moniker(){return{on:t=>{let n=wO.MonikerRequest.type;return this.connection.onRequest(n,(o,r)=>t(o,r,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(n,o)))}}}};su.MonikerFeature=xO});var tf=te(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConnection=Ye.combineFeatures=Ye.combineNotebooksFeatures=Ye.combineLanguagesFeatures=Ye.combineWorkspaceFeatures=Ye.combineWindowFeatures=Ye.combineClientFeatures=Ye.combineTracerFeatures=Ye.combineTelemetryFeatures=Ye.combineConsoleFeatures=Ye._NotebooksImpl=Ye._LanguagesImpl=Ye.BulkUnregistration=Ye.BulkRegistration=Ye.ErrorMessageTracker=void 0;var de=Rt(),qr=rl(),Yp=zp(),De=Rx(),kO=Cx(),SO=Ox(),TO=Dx(),IO=Zp(),$O=jx(),PO=Nx(),EO=Mx(),RO=Ax(),CO=qx(),OO=Lx(),DO=Fx(),jO=Zx(),NO=Gp(),MO=Wx();function Kp(e){if(e!==null)return e}var Xp=class{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||(n=0),n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}};Ye.ErrorMessageTracker=Xp;var lu=class{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(de.MessageType.Error,t)}warn(t){this.send(de.MessageType.Warning,t)}info(t){this.send(de.MessageType.Info,t)}log(t){this.send(de.MessageType.Log,t)}debug(t){this.send(de.MessageType.Debug,t)}send(t,n){this._rawConnection&&this._rawConnection.sendNotification(de.LogMessageNotification.type,{type:t,message:n}).catch(()=>{(0,de.RAL)().console.error("Sending log message failed")})}},Qp=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...n){let o={type:de.MessageType.Error,message:t,actions:n};return this.connection.sendRequest(de.ShowMessageRequest.type,o).then(Kp)}showWarningMessage(t,...n){let o={type:de.MessageType.Warning,message:t,actions:n};return this.connection.sendRequest(de.ShowMessageRequest.type,o).then(Kp)}showInformationMessage(t,...n){let o={type:de.MessageType.Info,message:t,actions:n};return this.connection.sendRequest(de.ShowMessageRequest.type,o).then(Kp)}},Hx=(0,$O.ShowDocumentFeature)((0,De.ProgressFeature)(Qp)),Jx;(function(e){function t(){return new uu}e.create=t})(Jx||(Ye.BulkRegistration=Jx={}));var uu=class{constructor(){this._registrations=[],this._registered=new Set}add(t,n){let o=qr.string(t)?t:t.method;if(this._registered.has(o))throw new Error(`${o} is already added to this registration`);let r=Yp.generateUuid();this._registrations.push({id:r,method:o,registerOptions:n||{}}),this._registered.add(o)}asRegistrationParams(){return{registrations:this._registrations}}},Bx;(function(e){function t(){return new Ua(void 0,[])}e.create=t})(Bx||(Ye.BulkUnregistration=Bx={}));var Ua=class{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(o=>{this._unregistrations.set(o.method,o)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let o of this._unregistrations.values())t.push(o);let n={unregisterations:t};this._connection.sendRequest(de.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(t){let n=qr.string(t)?t:t.method,o=this._unregistrations.get(n);if(!o)return!1;let r={unregisterations:[o]};return this._connection.sendRequest(de.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(n)},i=>{this._connection.console.info(`Un-registering request handler for ${o.id} failed.`)}),!0}},cu=class{attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,o){return t instanceof uu?this.registerMany(t):t instanceof Ua?this.registerSingle1(t,n,o):this.registerSingle2(t,n)}registerSingle1(t,n,o){let r=qr.string(n)?n:n.method,i=Yp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:o||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(de.RegistrationRequest.type,s).then(l=>(t.add({id:i,method:r}),t),l=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(l)))}registerSingle2(t,n){let o=qr.string(t)?t:t.method,r=Yp.generateUuid(),i={registrations:[{id:r,method:o,registerOptions:n||{}}]};return this.connection.sendRequest(de.RegistrationRequest.type,i).then(s=>de.Disposable.create(()=>{this.unregisterSingle(r,o).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(s)))}unregisterSingle(t,n){let o={unregisterations:[{id:t,method:n}]};return this.connection.sendRequest(de.UnregistrationRequest.type,o).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let n=t.asRegistrationParams();return this.connection.sendRequest(de.RegistrationRequest.type,n).then(()=>new Ua(this._connection,n.registrations.map(o=>({id:o.id,method:o.method}))),o=>(this.connection.console.info("Bulk registration failed."),Promise.reject(o)))}},ef=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function n(r){return r&&!!r.edit}let o=n(t)?t:{edit:t};return this.connection.sendRequest(de.ApplyWorkspaceEditRequest.type,o)}},Gx=(0,PO.FileOperationsFeature)((0,SO.WorkspaceFoldersFeature)((0,kO.ConfigurationFeature)(ef))),du=class{constructor(){this._trace=de.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,n){this._trace!==de.Trace.Off&&this.connection.sendNotification(de.LogTraceNotification.type,{message:t,verbose:this._trace===de.Trace.Verbose?n:void 0}).catch(()=>{})}},pu=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(de.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},fu=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,De.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,De.attachPartialResult)(this.connection,n)}};Ye._LanguagesImpl=fu;var Kx=(0,OO.FoldingRangeFeature)((0,MO.MonikerFeature)((0,jO.DiagnosticFeature)((0,DO.InlayHintFeature)((0,CO.InlineValueFeature)((0,RO.TypeHierarchyFeature)((0,EO.LinkedEditingRangeFeature)((0,IO.SemanticTokensFeature)((0,TO.CallHierarchyFeature)(fu))))))))),mu=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,De.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,De.attachPartialResult)(this.connection,n)}};Ye._NotebooksImpl=mu;var Yx=(0,NO.NotebookSyncFeature)(mu);function Xx(e,t){return function(n){return t(e(n))}}Ye.combineConsoleFeatures=Xx;function Qx(e,t){return function(n){return t(e(n))}}Ye.combineTelemetryFeatures=Qx;function ek(e,t){return function(n){return t(e(n))}}Ye.combineTracerFeatures=ek;function tk(e,t){return function(n){return t(e(n))}}Ye.combineClientFeatures=tk;function rk(e,t){return function(n){return t(e(n))}}Ye.combineWindowFeatures=rk;function nk(e,t){return function(n){return t(e(n))}}Ye.combineWorkspaceFeatures=nk;function ok(e,t){return function(n){return t(e(n))}}Ye.combineLanguagesFeatures=ok;function ik(e,t){return function(n){return t(e(n))}}Ye.combineNotebooksFeatures=ik;function AO(e,t){function n(r,i,s){return r&&i?s(r,i):r||i}return{__brand:"features",console:n(e.console,t.console,Xx),tracer:n(e.tracer,t.tracer,ek),telemetry:n(e.telemetry,t.telemetry,Qx),client:n(e.client,t.client,tk),window:n(e.window,t.window,rk),workspace:n(e.workspace,t.workspace,nk),languages:n(e.languages,t.languages,ok),notebooks:n(e.notebooks,t.notebooks,ik)}}Ye.combineFeatures=AO;function zO(e,t,n){let o=n&&n.console?new(n.console(lu)):new lu,r=e(o);o.rawAttach(r);let i=n&&n.tracer?new(n.tracer(du)):new du,s=n&&n.telemetry?new(n.telemetry(pu)):new pu,l=n&&n.client?new(n.client(cu)):new cu,u=n&&n.window?new(n.window(Hx)):new Hx,c=n&&n.workspace?new(n.workspace(Gx)):new Gx,d=n&&n.languages?new(n.languages(Kx)):new Kx,m=n&&n.notebooks?new(n.notebooks(Yx)):new Yx,_=[o,i,s,l,u,c,d,m];function h(g){return g instanceof Promise?g:qr.thenable(g)?new Promise((v,R)=>{g.then(O=>v(O),O=>R(O))}):Promise.resolve(g)}let b,k,I,C={listen:()=>r.listen(),sendRequest:(g,...v)=>r.sendRequest(qr.string(g)?g:g.method,...v),onRequest:(g,v)=>r.onRequest(g,v),sendNotification:(g,v)=>{let R=qr.string(g)?g:g.method;return r.sendNotification(R,v)},onNotification:(g,v)=>r.onNotification(g,v),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:g=>(k=g,{dispose:()=>{k=void 0}}),onInitialized:g=>r.onNotification(de.InitializedNotification.type,g),onShutdown:g=>(b=g,{dispose:()=>{b=void 0}}),onExit:g=>(I=g,{dispose:()=>{I=void 0}}),get console(){return o},get telemetry(){return s},get tracer(){return i},get client(){return l},get window(){return u},get workspace(){return c},get languages(){return d},get notebooks(){return m},onDidChangeConfiguration:g=>r.onNotification(de.DidChangeConfigurationNotification.type,g),onDidChangeWatchedFiles:g=>r.onNotification(de.DidChangeWatchedFilesNotification.type,g),__textDocumentSync:void 0,onDidOpenTextDocument:g=>r.onNotification(de.DidOpenTextDocumentNotification.type,g),onDidChangeTextDocument:g=>r.onNotification(de.DidChangeTextDocumentNotification.type,g),onDidCloseTextDocument:g=>r.onNotification(de.DidCloseTextDocumentNotification.type,g),onWillSaveTextDocument:g=>r.onNotification(de.WillSaveTextDocumentNotification.type,g),onWillSaveTextDocumentWaitUntil:g=>r.onRequest(de.WillSaveTextDocumentWaitUntilRequest.type,g),onDidSaveTextDocument:g=>r.onNotification(de.DidSaveTextDocumentNotification.type,g),sendDiagnostics:g=>r.sendNotification(de.PublishDiagnosticsNotification.type,g),onHover:g=>r.onRequest(de.HoverRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),void 0)),onCompletion:g=>r.onRequest(de.CompletionRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onCompletionResolve:g=>r.onRequest(de.CompletionResolveRequest.type,g),onSignatureHelp:g=>r.onRequest(de.SignatureHelpRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),void 0)),onDeclaration:g=>r.onRequest(de.DeclarationRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDefinition:g=>r.onRequest(de.DefinitionRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onTypeDefinition:g=>r.onRequest(de.TypeDefinitionRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onImplementation:g=>r.onRequest(de.ImplementationRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onReferences:g=>r.onRequest(de.ReferencesRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDocumentHighlight:g=>r.onRequest(de.DocumentHighlightRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDocumentSymbol:g=>r.onRequest(de.DocumentSymbolRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onWorkspaceSymbol:g=>r.onRequest(de.WorkspaceSymbolRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onWorkspaceSymbolResolve:g=>r.onRequest(de.WorkspaceSymbolResolveRequest.type,g),onCodeAction:g=>r.onRequest(de.CodeActionRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onCodeActionResolve:g=>r.onRequest(de.CodeActionResolveRequest.type,(v,R)=>g(v,R)),onCodeLens:g=>r.onRequest(de.CodeLensRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onCodeLensResolve:g=>r.onRequest(de.CodeLensResolveRequest.type,(v,R)=>g(v,R)),onDocumentFormatting:g=>r.onRequest(de.DocumentFormattingRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),void 0)),onDocumentRangeFormatting:g=>r.onRequest(de.DocumentRangeFormattingRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),void 0)),onDocumentOnTypeFormatting:g=>r.onRequest(de.DocumentOnTypeFormattingRequest.type,(v,R)=>g(v,R)),onRenameRequest:g=>r.onRequest(de.RenameRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),void 0)),onPrepareRename:g=>r.onRequest(de.PrepareRenameRequest.type,(v,R)=>g(v,R)),onDocumentLinks:g=>r.onRequest(de.DocumentLinkRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onDocumentLinkResolve:g=>r.onRequest(de.DocumentLinkResolveRequest.type,(v,R)=>g(v,R)),onDocumentColor:g=>r.onRequest(de.DocumentColorRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onColorPresentation:g=>r.onRequest(de.ColorPresentationRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onFoldingRanges:g=>r.onRequest(de.FoldingRangeRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onSelectionRanges:g=>r.onRequest(de.SelectionRangeRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),(0,De.attachPartialResult)(r,v))),onExecuteCommand:g=>r.onRequest(de.ExecuteCommandRequest.type,(v,R)=>g(v,R,(0,De.attachWorkDone)(r,v),void 0)),dispose:()=>r.dispose()};for(let g of _)g.attach(C);return r.onRequest(de.InitializeRequest.type,g=>{t.initialize(g),qr.string(g.trace)&&(i.trace=de.Trace.fromString(g.trace));for(let v of _)v.initialize(g.capabilities);if(k){let v=k(g,new de.CancellationTokenSource().token,(0,De.attachWorkDone)(r,g),void 0);return h(v).then(R=>{if(R instanceof de.ResponseError)return R;let O=R;O||(O={capabilities:{}});let N=O.capabilities;N||(N={},O.capabilities=N),N.textDocumentSync===void 0||N.textDocumentSync===null?N.textDocumentSync=qr.number(C.__textDocumentSync)?C.__textDocumentSync:de.TextDocumentSyncKind.None:!qr.number(N.textDocumentSync)&&!qr.number(N.textDocumentSync.change)&&(N.textDocumentSync.change=qr.number(C.__textDocumentSync)?C.__textDocumentSync:de.TextDocumentSyncKind.None);for(let K of _)K.fillServerCapabilities(N);return O})}else{let v={capabilities:{textDocumentSync:de.TextDocumentSyncKind.None}};for(let R of _)R.fillServerCapabilities(v.capabilities);return v}}),r.onRequest(de.ShutdownRequest.type,()=>{if(t.shutdownReceived=!0,b)return b(new de.CancellationTokenSource().token)}),r.onNotification(de.ExitNotification.type,()=>{try{I&&I()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}}),r.onNotification(de.SetTraceNotification.type,g=>{i.trace=de.Trace.fromString(g.value)}),C}Ye.createConnection=zO});var ak=te(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.resolveModulePath=hr.FileSystem=hr.resolveGlobalYarnPath=hr.resolveGlobalNodePath=hr.resolve=hr.uriToFilePath=void 0;var qO=require("url"),Xr=require("path"),rf=require("fs"),sf=require("child_process");function UO(e){let t=qO.parse(e);if(t.protocol!=="file:"||!t.path)return;let n=t.path.split("/");for(var o=0,r=n.length;o1){let i=n[0],s=n[1];i.length===0&&s.length>1&&s[1]===":"&&n.shift()}return Xr.normalize(n.join("/"))}hr.uriToFilePath=UO;function nf(){return process.platform==="win32"}function hu(e,t,n,o){let r="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((s,l)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(d=>c[d]=u[d]),t&&rf.existsSync(t)&&(c[r]?c[r]=t+Xr.delimiter+c[r]:c[r]=t,o&&o(`NODE_PATH value is: ${c[r]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let d=(0,sf.fork)("",[],{cwd:n,env:c,execArgv:["-e",i]});if(d.pid===void 0){l(new Error(`Starting process to resolve node module ${e} failed`));return}d.on("error",_=>{l(_)}),d.on("message",_=>{_.c==="r"&&(d.send({c:"e"}),_.s?s(_.r):l(new Error(`Failed to resolve module: ${e}`)))});let m={c:"rs",a:e};d.send(m)}catch(d){l(d)}})}hr.resolve=hu;function of(e){let t="npm",n=Object.create(null);Object.keys(process.env).forEach(i=>n[i]=process.env[i]),n.NO_UPDATE_NOTIFIER="true";let o={encoding:"utf8",env:n};nf()&&(t="npm.cmd",o.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,sf.spawnSync)(t,["config","get","prefix"],o).stdout;if(!i){e&&e("'npm config get prefix' didn't return a value.");return}let s=i.trim();return e&&e(`'npm config get prefix' value is: ${s}`),s.length>0?nf()?Xr.join(s,"node_modules"):Xr.join(s,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}hr.resolveGlobalNodePath=of;function LO(e){let t="yarn",n={encoding:"utf8"};nf()&&(t="yarn.cmd",n.shell=!0);let o=()=>{};try{process.on("SIGPIPE",o);let r=(0,sf.spawnSync)(t,["global","dir","--json"],n),i=r.stdout;if(!i){e&&(e("'yarn global dir' didn't return a value."),r.stderr&&e(r.stderr));return}let s=i.trim().split(/\r?\n/);for(let l of s)try{let u=JSON.parse(l);if(u.type==="log")return Xr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",o)}}hr.resolveGlobalYarnPath=LO;var af;(function(e){let t;function n(){return t!==void 0||(process.platform==="win32"?t=!1:t=!rf.existsSync(__filename.toUpperCase())||!rf.existsSync(__filename.toLowerCase())),t}e.isCaseSensitive=n;function o(r,i){return n()?Xr.normalize(i).indexOf(Xr.normalize(r))===0:Xr.normalize(i).toLowerCase().indexOf(Xr.normalize(r).toLowerCase())===0}e.isParent=o})(af||(hr.FileSystem=af={}));function FO(e,t,n,o){return n?(Xr.isAbsolute(n)||(n=Xr.join(e,n)),hu(t,n,n,o).then(r=>af.isParent(n,r)?r:Promise.reject(new Error(`Failed to load ${t} from node path location.`))).then(void 0,r=>hu(t,of(o),e,o))):hu(t,of(o),e,o)}hr.resolveModulePath=FO});var lf=te((IV,sk)=>{"use strict";sk.exports=Rt()});var lk=te(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.InlineCompletionFeature=void 0;var ZO=Rt(),VO=e=>class extends e{get inlineCompletion(){return{on:t=>this.connection.onRequest(ZO.InlineCompletionRequest.type,(n,o)=>t(n,o,this.attachWorkDoneProgress(n)))}}};gu.InlineCompletionFeature=VO});var dk=te(Yt=>{"use strict";var WO=Yt&&Yt.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),ck=Yt&&Yt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&WO(t,e,n)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.ProposedFeatures=Yt.NotebookDocuments=Yt.TextDocuments=Yt.SemanticTokensBuilder=void 0;var HO=Zp();Object.defineProperty(Yt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return HO.SemanticTokensBuilder}});var JO=lk();ck(Rt(),Yt);var BO=Jp();Object.defineProperty(Yt,"TextDocuments",{enumerable:!0,get:function(){return BO.TextDocuments}});var GO=Gp();Object.defineProperty(Yt,"NotebookDocuments",{enumerable:!0,get:function(){return GO.NotebookDocuments}});ck(tf(),Yt);var uk;(function(e){e.all={__brand:"features",languages:JO.InlineCompletionFeature}})(uk||(Yt.ProposedFeatures=uk={}))});var vk=te(Ur=>{"use strict";var KO=Ur&&Ur.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),hk=Ur&&Ur.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&KO(t,e,n)};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.createConnection=Ur.Files=void 0;var pk=require("node:util"),uf=rl(),YO=tf(),La=ak(),Po=lf();hk(lf(),Ur);hk(dk(),Ur);var fk;(function(e){e.uriToFilePath=La.uriToFilePath,e.resolveGlobalNodePath=La.resolveGlobalNodePath,e.resolveGlobalYarnPath=La.resolveGlobalYarnPath,e.resolve=La.resolve,e.resolveModulePath=La.resolveModulePath})(fk||(Ur.Files=fk={}));var mk;function vu(){if(mk!==void 0)try{mk.end()}catch{}}var Ai=!1,gk;function XO(){let e="--clientProcessId";function t(n){try{let o=parseInt(n);isNaN(o)||(gk=setInterval(()=>{try{process.kill(o,0)}catch{vu(),process.exit(Ai?0:1)}},3e3))}catch{}}for(let n=2;n{let t=e.processId;uf.number(t)&&gk===void 0&&setInterval(()=>{try{process.kill(t,0)}catch{process.exit(Ai?0:1)}},3e3)},get shutdownReceived(){return Ai},set shutdownReceived(e){Ai=e},exit:e=>{vu(),process.exit(e)}};function eD(e,t,n,o){let r,i,s,l;return e!==void 0&&e.__brand==="features"&&(r=e,e=t,t=n,n=o),Po.ConnectionStrategy.is(e)||Po.ConnectionOptions.is(e)?l=e:(i=e,s=t,l=n),tD(i,s,l,r)}Ur.createConnection=eD;function tD(e,t,n,o){let r=!1;if(!e&&!t&&process.argv.length>2){let u,c,d=process.argv.slice(2);for(let m=0;m{vu(),process.exit(Ai?0:1)}),u.on("close",()=>{vu(),process.exit(Ai?0:1)})}let l=u=>{let c=(0,Po.createProtocolConnection)(e,t,u,n);return r&&rD(u),c};return(0,YO.createConnection)(l,QO,o)}function rD(e){function t(o){return o.map(r=>typeof r=="string"?r:(0,pk.inspect)(r)).join(" ")}let n=new Map;console.assert=function(r,...i){if(!r)if(i.length===0)e.error("Assertion failed");else{let[s,...l]=i;e.error(`Assertion failed: ${s} ${t(l)}`)}},console.count=function(r="default"){let i=String(r),s=n.get(i)??0;s+=1,n.set(i,s),e.log(`${i}: ${i}`)},console.countReset=function(r){r===void 0?n.clear():n.delete(String(r))},console.debug=function(...r){e.log(t(r))},console.dir=function(r,i){e.log((0,pk.inspect)(r,i))},console.log=function(...r){e.log(t(r))},console.error=function(...r){e.error(t(r))},console.trace=function(...r){let i=new Error().stack.replace(/(.+\n){2}/,""),s="Trace";r.length!==0&&(s+=`: ${t(r)}`),e.log(`${s} +${i}`)},console.warn=function(...r){e.warn(t(r))}}});var _k=te((CV,yk)=>{"use strict";yk.exports=vk()});var wk=te((OV,bk)=>{var no=require("constants"),nD=process.cwd,yu=null,oD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return yu||(yu=nD.call(process)),yu};try{process.cwd()}catch{}typeof process.chdir=="function"&&(cf=process.chdir,process.chdir=function(e){yu=null,cf.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,cf));var cf;bk.exports=iD;function iD(e){no.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=o(e.chmod),e.fchmod=o(e.fchmod),e.lchmod=o(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(d,m,_){_&&process.nextTick(_)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(d,m,_,h){h&&process.nextTick(h)},e.lchownSync=function(){}),oD==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(d){function m(_,h,b){var k=Date.now(),I=0;d(_,h,function C(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-k<6e4){setTimeout(function(){e.stat(h,function(v,R){v&&v.code==="ENOENT"?d(_,h,C):b(g)})},I),I<100&&(I+=10);return}b&&b(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(m,d),m})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(d){function m(_,h,b,k,I,C){var g;if(C&&typeof C=="function"){var v=0;g=function(R,O,N){if(R&&R.code==="EAGAIN"&&v<10)return v++,d.call(e,_,h,b,k,I,g);C.apply(this,arguments)}}return d.call(e,_,h,b,k,I,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(m,d),m})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(d){return function(m,_,h,b,k){for(var I=0;;)try{return d.call(e,m,_,h,b,k)}catch(C){if(C.code==="EAGAIN"&&I<10){I++;continue}throw C}}})(e.readSync);function t(d){d.lchmod=function(m,_,h){d.open(m,no.O_WRONLY|no.O_SYMLINK,_,function(b,k){if(b){h&&h(b);return}d.fchmod(k,_,function(I){d.close(k,function(C){h&&h(I||C)})})})},d.lchmodSync=function(m,_){var h=d.openSync(m,no.O_WRONLY|no.O_SYMLINK,_),b=!0,k;try{k=d.fchmodSync(h,_),b=!1}finally{if(b)try{d.closeSync(h)}catch{}else d.closeSync(h)}return k}}function n(d){no.hasOwnProperty("O_SYMLINK")&&d.futimes?(d.lutimes=function(m,_,h,b){d.open(m,no.O_SYMLINK,function(k,I){if(k){b&&b(k);return}d.futimes(I,_,h,function(C){d.close(I,function(g){b&&b(C||g)})})})},d.lutimesSync=function(m,_,h){var b=d.openSync(m,no.O_SYMLINK),k,I=!0;try{k=d.futimesSync(b,_,h),I=!1}finally{if(I)try{d.closeSync(b)}catch{}else d.closeSync(b)}return k}):d.futimes&&(d.lutimes=function(m,_,h,b){b&&process.nextTick(b)},d.lutimesSync=function(){})}function o(d){return d&&function(m,_,h){return d.call(e,m,_,function(b){c(b)&&(b=null),h&&h.apply(this,arguments)})}}function r(d){return d&&function(m,_){try{return d.call(e,m,_)}catch(h){if(!c(h))throw h}}}function i(d){return d&&function(m,_,h,b){return d.call(e,m,_,h,function(k){c(k)&&(k=null),b&&b.apply(this,arguments)})}}function s(d){return d&&function(m,_,h){try{return d.call(e,m,_,h)}catch(b){if(!c(b))throw b}}}function l(d){return d&&function(m,_,h){typeof _=="function"&&(h=_,_=null);function b(k,I){I&&(I.uid<0&&(I.uid+=4294967296),I.gid<0&&(I.gid+=4294967296)),h&&h.apply(this,arguments)}return _?d.call(e,m,_,b):d.call(e,m,b)}}function u(d){return d&&function(m,_){var h=_?d.call(e,m,_):d.call(e,m);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function c(d){if(!d||d.code==="ENOSYS")return!0;var m=!process.getuid||process.getuid()!==0;return!!(m&&(d.code==="EINVAL"||d.code==="EPERM"))}}});var Sk=te((DV,kk)=>{var xk=require("stream").Stream;kk.exports=aD;function aD(e){return{ReadStream:t,WriteStream:n};function t(o,r){if(!(this instanceof t))return new t(o,r);xk.call(this);var i=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var s=Object.keys(r),l=0,u=s.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(d,m){if(d){i.emit("error",d),i.readable=!1;return}i.fd=m,i.emit("open",m),i._read()})}function n(o,r){if(!(this instanceof n))return new n(o,r);xk.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),s=0,l=i.length;s= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Ik=te((jV,Tk)=>{"use strict";Tk.exports=lD;var sD=Object.getPrototypeOf||function(e){return e.__proto__};function lD(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:sD(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}});var mf=te((NV,ff)=>{var It=require("fs"),uD=wk(),cD=Sk(),dD=Ik(),_u=require("util"),Zt,wu;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Zt=Symbol.for("graceful-fs.queue"),wu=Symbol.for("graceful-fs.previous")):(Zt="___graceful-fs.queue",wu="___graceful-fs.previous");function pD(){}function Ek(e,t){Object.defineProperty(e,Zt,{get:function(){return t}})}var Eo=pD;_u.debuglog?Eo=_u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var e=_u.format.apply(_u,arguments);e="GFS4: "+e.split(/\n/).join(` +GFS4: `),console.error(e)});It[Zt]||($k=global[Zt]||[],Ek(It,$k),It.close=(function(e){function t(n,o){return e.call(It,n,function(r){r||Pk(),typeof o=="function"&&o.apply(this,arguments)})}return Object.defineProperty(t,wu,{value:e}),t})(It.close),It.closeSync=(function(e){function t(n){e.apply(It,arguments),Pk()}return Object.defineProperty(t,wu,{value:e}),t})(It.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(It[Zt]),require("assert").equal(It[Zt].length,0)}));var $k;global[Zt]||Ek(global,It[Zt]);ff.exports=df(dD(It));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!It.__patched&&(ff.exports=df(It),It.__patched=!0);function df(e){uD(e),e.gracefulify=df,e.createReadStream=O,e.createWriteStream=N;var t=e.readFile;e.readFile=n;function n(E,le,z){return typeof le=="function"&&(z=le,le=null),ye(E,le,z);function ye(D,U,A,L){return t(D,U,function(B){B&&(B.code==="EMFILE"||B.code==="ENFILE")?zi([ye,[D,U,A],B,L||Date.now(),Date.now()]):typeof A=="function"&&A.apply(this,arguments)})}}var o=e.writeFile;e.writeFile=r;function r(E,le,z,ye){return typeof z=="function"&&(ye=z,z=null),D(E,le,z,ye);function D(U,A,L,B,ne){return o(U,A,L,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var i=e.appendFile;i&&(e.appendFile=s);function s(E,le,z,ye){return typeof z=="function"&&(ye=z,z=null),D(E,le,z,ye);function D(U,A,L,B,ne){return i(U,A,L,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(E,le,z,ye){return typeof z=="function"&&(ye=z,z=0),D(E,le,z,ye);function D(U,A,L,B,ne){return l(U,A,L,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var c=e.readdir;e.readdir=m;var d=/^v[0-5]\./;function m(E,le,z){typeof le=="function"&&(z=le,le=null);var ye=d.test(process.version)?function(A,L,B,ne){return c(A,D(A,L,B,ne))}:function(A,L,B,ne){return c(A,L,D(A,L,B,ne))};return ye(E,le,z);function D(U,A,L,B){return function(ne,W){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?zi([ye,[U,A,L],ne,B||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof L=="function"&&L.call(this,ne,W))}}}if(process.version.substr(0,4)==="v0.8"){var _=cD(e);C=_.ReadStream,v=_.WriteStream}var h=e.ReadStream;h&&(C.prototype=Object.create(h.prototype),C.prototype.open=g);var b=e.WriteStream;b&&(v.prototype=Object.create(b.prototype),v.prototype.open=R),Object.defineProperty(e,"ReadStream",{get:function(){return C},set:function(E){C=E},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(E){v=E},enumerable:!0,configurable:!0});var k=C;Object.defineProperty(e,"FileReadStream",{get:function(){return k},set:function(E){k=E},enumerable:!0,configurable:!0});var I=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return I},set:function(E){I=E},enumerable:!0,configurable:!0});function C(E,le){return this instanceof C?(h.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function g(){var E=this;ee(E.path,E.flags,E.mode,function(le,z){le?(E.autoClose&&E.destroy(),E.emit("error",le)):(E.fd=z,E.emit("open",z),E.read())})}function v(E,le){return this instanceof v?(b.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function R(){var E=this;ee(E.path,E.flags,E.mode,function(le,z){le?(E.destroy(),E.emit("error",le)):(E.fd=z,E.emit("open",z))})}function O(E,le){return new e.ReadStream(E,le)}function N(E,le){return new e.WriteStream(E,le)}var K=e.open;e.open=ee;function ee(E,le,z,ye){return typeof z=="function"&&(ye=z,z=null),D(E,le,z,ye);function D(U,A,L,B,ne){return K(U,A,L,function(W,pe){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zi([D,[U,A,L,B],W,ne||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}return e}function zi(e){Eo("ENQUEUE",e[0].name,e[1]),It[Zt].push(e),pf()}var bu;function Pk(){for(var e=Date.now(),t=0;t2&&(It[Zt][t][3]=e,It[Zt][t][4]=e);pf()}function pf(){if(clearTimeout(bu),bu=void 0,It[Zt].length!==0){var e=It[Zt].shift(),t=e[0],n=e[1],o=e[2],r=e[3],i=e[4];if(r===void 0)Eo("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){Eo("TIMEOUT",t.name,n);var s=n.pop();typeof s=="function"&&s.call(null,o)}else{var l=Date.now()-i,u=Math.max(i-r,1),c=Math.min(u*1.2,100);l>=c?(Eo("RETRY",t.name,n),t.apply(null,n.concat([r]))):It[Zt].push(e)}bu===void 0&&(bu=setTimeout(pf,0))}}});var Ck=te((MV,Rk)=>{function Lr(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Rk.exports=Lr;Lr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Lr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Lr.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var o=this,r=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},n);return this._options.unref&&r.unref(),!0};Lr.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Lr.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};Lr.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};Lr.prototype.start=Lr.prototype.try;Lr.prototype.errors=function(){return this._errors};Lr.prototype.attempts=function(){return this._attempts};Lr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,o=0;o=n&&(t=r,n=s)}return t}});var Ok=te(Ro=>{var fD=Ck();Ro.operation=function(e){var t=Ro.timeouts(e);return new fD(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};Ro.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],r=0;r{Dk.exports=Ok()});var Nk=te((qV,xu)=>{xu.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&xu.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&xu.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Uk=te((UV,Li)=>{var kt=global.process,Co=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Co(kt)?(Mk=require("assert"),qi=Nk(),Ak=/^win/i.test(kt.platform),Fa=require("events"),typeof Fa!="function"&&(Fa=Fa.EventEmitter),kt.__signal_exit_emitter__?Ut=kt.__signal_exit_emitter__:(Ut=kt.__signal_exit_emitter__=new Fa,Ut.count=0,Ut.emitted={}),Ut.infinite||(Ut.setMaxListeners(1/0),Ut.infinite=!0),Li.exports=function(e,t){if(!Co(global.process))return function(){};Mk.equal(typeof e,"function","a callback must be provided for exit handler"),Ui===!1&&hf();var n="exit";t&&t.alwaysLast&&(n="afterexit");var o=function(){Ut.removeListener(n,e),Ut.listeners("exit").length===0&&Ut.listeners("afterexit").length===0&&ku()};return Ut.on(n,e),o},ku=function(){!Ui||!Co(global.process)||(Ui=!1,qi.forEach(function(t){try{kt.removeListener(t,Su[t])}catch{}}),kt.emit=Tu,kt.reallyExit=gf,Ut.count-=1)},Li.exports.unload=ku,Oo=function(t,n,o){Ut.emitted[t]||(Ut.emitted[t]=!0,Ut.emit(t,n,o))},Su={},qi.forEach(function(e){Su[e]=function(){if(Co(global.process)){var n=kt.listeners(e);n.length===Ut.count&&(ku(),Oo("exit",null,e),Oo("afterexit",null,e),Ak&&e==="SIGHUP"&&(e="SIGINT"),kt.kill(kt.pid,e))}}}),Li.exports.signals=function(){return qi},Ui=!1,hf=function(){Ui||!Co(global.process)||(Ui=!0,Ut.count+=1,qi=qi.filter(function(t){try{return kt.on(t,Su[t]),!0}catch{return!1}}),kt.emit=qk,kt.reallyExit=zk)},Li.exports.load=hf,gf=kt.reallyExit,zk=function(t){Co(global.process)&&(kt.exitCode=t||0,Oo("exit",kt.exitCode,null),Oo("afterexit",kt.exitCode,null),gf.call(kt,kt.exitCode))},Tu=kt.emit,qk=function(t,n){if(t==="exit"&&Co(global.process)){n!==void 0&&(kt.exitCode=n);var o=Tu.apply(this,arguments);return Oo("exit",kt.exitCode,null),Oo("afterexit",kt.exitCode,null),o}else return Tu.apply(this,arguments)}):Li.exports=function(){return function(){}};var Mk,qi,Ak,Fa,Ut,ku,Oo,Su,Ui,hf,gf,zk,Tu,qk});var Fk=te((LV,vf)=>{"use strict";var Lk=Symbol();function mD(e,t,n){let o=t[Lk];if(o)return t.stat(e,(i,s)=>{if(i)return n(i);n(null,s.mtime,o)});let r=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,r,r,i=>{if(i)return n(i);t.stat(e,(s,l)=>{if(s)return n(s);let u=l.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,Lk,{value:u}),n(null,l.mtime,u)})})}function hD(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}vf.exports.probe=mD;vf.exports.getMtime=hD});var Jk=te((FV,Va)=>{"use strict";var gD=require("path"),bf=mf(),vD=jk(),yD=Uk(),Zk=Fk(),In={};function Za(e,t){return t.lockfilePath||`${e}.lock`}function wf(e,t,n){if(!t.realpath)return n(null,gD.resolve(e));t.fs.realpath(e,n)}function _f(e,t,n){let o=Za(e,t);t.fs.mkdir(o,r=>{if(!r)return Zk.probe(o,t.fs,(i,s,l)=>{if(i)return t.fs.rmdir(o,()=>{}),n(i);n(null,s,l)});if(r.code!=="EEXIST")return n(r);if(t.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(o,(i,s)=>{if(i)return i.code==="ENOENT"?_f(e,{...t,stale:0},n):n(i);if(!Vk(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));Wk(e,t,l=>{if(l)return n(l);_f(e,{...t,stale:0},n)})})})}function Vk(e,t){return e.mtime.getTime(){if(o&&o.code!=="ENOENT")return n(o);n()})}function Iu(e,t){let n=In[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(o,r)=>{let i=n.lastUpdate+t.stale{let c=n.lastUpdate+t.stale{throw o},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),wf(e,t,(o,r)=>{if(o)return n(o);let i=vD.operation(t.retries);i.attempt(()=>{_f(r,t,(s,l,u)=>{if(i.retry(s))return;if(s)return n(i.mainError());let c=In[r]={lockfilePath:Za(r,t),mtime:l,mtimePrecision:u,options:t,lastUpdate:Date.now()};Iu(r,t),n(null,d=>{if(c.released)return d&&d(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));Hk(r,{...t,realpath:!1},d)})})})})}function Hk(e,t,n){t={fs:bf,realpath:!0,...t},wf(e,t,(o,r)=>{if(o)return n(o);let i=In[r];if(!i)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete In[r],Wk(r,t,n)})}function bD(e,t,n){t={stale:1e4,realpath:!0,fs:bf,...t},t.stale=Math.max(t.stale||0,2e3),wf(e,t,(o,r)=>{if(o)return n(o);t.fs.stat(Za(r,t),(i,s)=>i?i.code==="ENOENT"?n(null,!1):n(i):n(null,!Vk(s,t)))})}function wD(){return In}yD(()=>{for(let e in In){let t=In[e].options;try{t.fs.rmdirSync(Za(e,t))}catch{}}});Va.exports.lock=_D;Va.exports.unlock=Hk;Va.exports.check=bD;Va.exports.getLocks=wD});var Gk=te((ZV,Bk)=>{"use strict";var xD=mf();function kD(e){let t=["mkdir","realpath","stat","rmdir","utimes"],n={...e};return t.forEach(o=>{n[o]=(...r)=>{let i=r.pop(),s;try{s=e[`${o}Sync`](...r)}catch(l){return i(l)}i(null,s)}}),n}function SD(e){return(...t)=>new Promise((n,o)=>{t.push((r,i)=>{r?o(r):n(i)}),e(...t)})}function TD(e){return(...t)=>{let n,o;if(t.push((r,i)=>{n=r,o=i}),e(...t),n)throw n;return o}}function ID(e){if(e={...e},e.fs=kD(e.fs||xD),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}Bk.exports={toPromise:SD,toSync:TD,toSyncOptions:ID}});var Yk=te((VV,oo)=>{"use strict";var Fi=Jk(),{toPromise:$u,toSync:Pu,toSyncOptions:xf}=Gk();async function Kk(e,t){let n=await $u(Fi.lock)(e,t);return $u(n)}function $D(e,t){let n=Pu(Fi.lock)(e,xf(t));return Pu(n)}function PD(e,t){return $u(Fi.unlock)(e,t)}function ED(e,t){return Pu(Fi.unlock)(e,xf(t))}function RD(e,t){return $u(Fi.check)(e,t)}function CD(e,t){return Pu(Fi.check)(e,xf(t))}oo.exports=Kk;oo.exports.lock=Kk;oo.exports.unlock=PD;oo.exports.lockSync=$D;oo.exports.unlockSync=ED;oo.exports.check=RD;oo.exports.checkSync=CD});var Gv=te((uB,E$)=>{"use strict";var Bv=Object.defineProperty,sU=Object.getOwnPropertyDescriptor,lU=Object.getOwnPropertyNames,uU=Object.prototype.hasOwnProperty,cU=(e,t)=>{for(var n in t)Bv(e,n,{get:t[n],enumerable:!0})},dU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of lU(t))!uU.call(e,r)&&r!==n&&Bv(e,r,{get:()=>t[r],enumerable:!(o=sU(t,r))||o.enumerable});return e},pU=e=>dU(Bv({},"__esModule",{value:!0}),e),$$={};cU($$,{SYMBOL_FOR_REQ_CONTEXT:()=>P$,getContext:()=>fU});E$.exports=pU($$);var P$=Symbol.for("@vercel/request-context");function fU(){return globalThis[P$]?.get?.()??{}}});var Ls=te((cB,C$)=>{"use strict";var Yv=Object.defineProperty,mU=Object.getOwnPropertyDescriptor,hU=Object.getOwnPropertyNames,gU=Object.prototype.hasOwnProperty,vU=(e,t)=>{for(var n in t)Yv(e,n,{get:t[n],enumerable:!0})},yU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of hU(t))!gU.call(e,r)&&r!==n&&Yv(e,r,{get:()=>t[r],enumerable:!(o=mU(t,r))||o.enumerable});return e},_U=e=>yU(Yv({},"__esModule",{value:!0}),e),R$={};vU(R$,{VercelOidcTokenError:()=>Kv});C$.exports=_U(R$);var Kv=class extends Error{constructor(t,n){super(t),this.name="VercelOidcTokenError",this.cause=n}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}});var N$=te((dB,j$)=>{"use strict";var bU=Object.create,Hc=Object.defineProperty,wU=Object.getOwnPropertyDescriptor,xU=Object.getOwnPropertyNames,kU=Object.getPrototypeOf,SU=Object.prototype.hasOwnProperty,TU=(e,t)=>{for(var n in t)Hc(e,n,{get:t[n],enumerable:!0})},O$=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xU(t))!SU.call(e,r)&&r!==n&&Hc(e,r,{get:()=>t[r],enumerable:!(o=wU(t,r))||o.enumerable});return e},Qv=(e,t,n)=>(n=e!=null?bU(kU(e)):{},O$(t||!e||!e.__esModule?Hc(n,"default",{value:e,enumerable:!0}):n,e)),IU=e=>O$(Hc({},"__esModule",{value:!0}),e),D$={};TU(D$,{findRootDir:()=>EU,getUserDataDir:()=>RU});j$.exports=IU(D$);var Fs=Qv(require("path")),$U=Qv(require("fs")),Xv=Qv(require("os")),PU=Ls();function EU(){try{let e=process.cwd();for(;e!==Fs.default.dirname(e);){let t=Fs.default.join(e,".vercel");if($U.default.existsSync(t))return e;e=Fs.default.dirname(e)}}catch{throw new PU.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function RU(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(Xv.default.platform()){case"darwin":return Fs.default.join(Xv.default.homedir(),"Library/Application Support");case"linux":return Fs.default.join(Xv.default.homedir(),".local/share");case"win32":return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}});var F$=te((pB,L$)=>{"use strict";var CU=Object.create,Jc=Object.defineProperty,OU=Object.getOwnPropertyDescriptor,DU=Object.getOwnPropertyNames,jU=Object.getPrototypeOf,NU=Object.prototype.hasOwnProperty,MU=(e,t)=>{for(var n in t)Jc(e,n,{get:t[n],enumerable:!0})},M$=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of DU(t))!NU.call(e,r)&&r!==n&&Jc(e,r,{get:()=>t[r],enumerable:!(o=OU(t,r))||o.enumerable});return e},A$=(e,t,n)=>(n=e!=null?CU(jU(e)):{},M$(t||!e||!e.__esModule?Jc(n,"default",{value:e,enumerable:!0}):n,e)),AU=e=>M$(Jc({},"__esModule",{value:!0}),e),z$={};MU(z$,{isValidAccessToken:()=>LU,readAuthConfig:()=>qU,writeAuthConfig:()=>UU});L$.exports=AU(z$);var Zs=A$(require("fs")),q$=A$(require("path")),zU=Vs();function U$(){let e=(0,zU.getVercelDataDir)();if(!e)throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return q$.join(e,"auth.json")}function qU(){try{let e=U$();if(!Zs.existsSync(e))return null;let t=Zs.readFileSync(e,"utf8");return t?JSON.parse(t):null}catch{return null}}function UU(e){let t=U$(),n=q$.dirname(t);Zs.existsSync(n)||Zs.mkdirSync(n,{mode:504,recursive:!0}),Zs.writeFileSync(t,JSON.stringify(e,null,2),{mode:384})}function LU(e,t=0){if(!e.token)return!1;if(typeof e.expiresAt!="number")return!0;let n=Math.floor(Date.now()/1e3),o=t/1e3;return e.expiresAt>=n+o}});var H$=te((fB,W$)=>{"use strict";var ry=Object.defineProperty,FU=Object.getOwnPropertyDescriptor,ZU=Object.getOwnPropertyNames,VU=Object.prototype.hasOwnProperty,WU=(e,t)=>{for(var n in t)ry(e,n,{get:t[n],enumerable:!0})},HU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ZU(t))!VU.call(e,r)&&r!==n&&ry(e,r,{get:()=>t[r],enumerable:!(o=FU(t,r))||o.enumerable});return e},JU=e=>HU(ry({},"__esModule",{value:!0}),e),Z$={};WU(Z$,{processTokenResponse:()=>XU,refreshTokenRequest:()=>YU});W$.exports=JU(Z$);var ey=require("os"),BU="https://vercel.com",GU="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",V$=`@vercel/oidc node-${process.version} ${(0,ey.platform)()} (${(0,ey.arch)()}) ${(0,ey.hostname)()}`,ty=null;async function KU(){if(ty)return ty;let e=`${BU}/.well-known/openid-configuration`,t=await fetch(e,{headers:{"user-agent":V$}});if(!t.ok)throw new Error("Failed to discover OAuth endpoints");let n=await t.json();if(!n||typeof n.token_endpoint!="string")throw new Error("Invalid OAuth discovery response");let o=n.token_endpoint;return ty=o,o}async function YU(e){let t=await KU();return await fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":V$},body:new URLSearchParams({client_id:GU,grant_type:"refresh_token",...e})})}async function XU(e){let t=await e.json();if(!e.ok){let n=typeof t=="object"&&t&&"error"in t?String(t.error):"Token refresh failed";return[new Error(n)]}return typeof t!="object"||t===null?[new Error("Invalid token response")]:typeof t.access_token!="string"?[new Error("Missing access_token in response")]:t.token_type!=="Bearer"?[new Error("Invalid token_type in response")]:typeof t.expires_in!="number"?[new Error("Missing expires_in in response")]:[null,t]}});var ay=te((mB,B$)=>{"use strict";var iy=Object.defineProperty,QU=Object.getOwnPropertyDescriptor,e4=Object.getOwnPropertyNames,t4=Object.prototype.hasOwnProperty,r4=(e,t)=>{for(var n in t)iy(e,n,{get:t[n],enumerable:!0})},n4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of e4(t))!t4.call(e,r)&&r!==n&&iy(e,r,{get:()=>t[r],enumerable:!(o=QU(t,r))||o.enumerable});return e},o4=e=>n4(iy({},"__esModule",{value:!0}),e),J$={};r4(J$,{AccessTokenMissingError:()=>ny,RefreshAccessTokenFailedError:()=>oy});B$.exports=o4(J$);var ny=class extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}},oy=class extends Error{constructor(t){super("Failed to refresh authentication token.",{cause:t}),this.name="RefreshAccessTokenFailedError"}}});var Vs=te((hB,Q$)=>{"use strict";var i4=Object.create,Bc=Object.defineProperty,a4=Object.getOwnPropertyDescriptor,s4=Object.getOwnPropertyNames,l4=Object.getPrototypeOf,u4=Object.prototype.hasOwnProperty,c4=(e,t)=>{for(var n in t)Bc(e,n,{get:t[n],enumerable:!0})},K$=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of s4(t))!u4.call(e,r)&&r!==n&&Bc(e,r,{get:()=>t[r],enumerable:!(o=a4(t,r))||o.enumerable});return e},Y$=(e,t,n)=>(n=e!=null?i4(l4(e)):{},K$(t||!e||!e.__esModule?Bc(n,"default",{value:e,enumerable:!0}):n,e)),d4=e=>K$(Bc({},"__esModule",{value:!0}),e),X$={};c4(X$,{assertVercelOidcTokenResponse:()=>sy,findProjectInfo:()=>h4,getTokenPayload:()=>y4,getVercelDataDir:()=>p4,getVercelOidcToken:()=>m4,getVercelToken:()=>f4,isExpired:()=>_4,loadToken:()=>v4,saveToken:()=>g4});Q$.exports=d4(X$);var Ws=Y$(require("path")),ui=Y$(require("fs")),ma=Ls(),Gc=N$(),pa=F$(),G$=H$(),fa=ay();function p4(){let e="com.vercel.cli",t=(0,Gc.getUserDataDir)();return t?Ws.join(t,e):null}async function f4(e){let t=(0,pa.readAuthConfig)();if(!t?.token)throw new fa.AccessTokenMissingError;if((0,pa.isValidAccessToken)(t,e?.expirationBufferMs))return t.token;if(!t.refreshToken)throw(0,pa.writeAuthConfig)({}),new fa.RefreshAccessTokenFailedError("No refresh token available");try{let n=await(0,G$.refreshTokenRequest)({refresh_token:t.refreshToken}),[o,r]=await(0,G$.processTokenResponse)(n);if(o||!r)throw(0,pa.writeAuthConfig)({}),new fa.RefreshAccessTokenFailedError(o);let i={token:r.access_token,expiresAt:Math.floor(Date.now()/1e3)+r.expires_in};return r.refresh_token&&(i.refreshToken=r.refresh_token),(0,pa.writeAuthConfig)(i),i.token}catch(n){throw(0,pa.writeAuthConfig)({}),n instanceof fa.AccessTokenMissingError||n instanceof fa.RefreshAccessTokenFailedError?n:new fa.RefreshAccessTokenFailedError(n)}}async function m4(e,t,n){let o=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:""}`,r=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new ma.VercelOidcTokenError(`Failed to refresh OIDC token: ${r.statusText}`);let i=await r.json();return sy(i),i}function sy(e){if(!e||typeof e!="object")throw new TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in e)||typeof e.token!="string")throw new TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function h4(){let e=(0,Gc.findRootDir)();if(!e)throw new ma.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let t=Ws.join(e,".vercel","project.json");if(!ui.existsSync(t))throw new ma.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let n=JSON.parse(ui.readFileSync(t,"utf8"));if(typeof n.projectId!="string"&&typeof n.orgId!="string")throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:n.projectId,teamId:n.orgId}}function g4(e,t){let n=(0,Gc.getUserDataDir)();if(!n)throw new ma.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let o=Ws.join(n,"com.vercel.token",`${t}.json`),r=JSON.stringify(e);ui.mkdirSync(Ws.dirname(o),{mode:504,recursive:!0}),ui.writeFileSync(o,r),ui.chmodSync(o,432)}function v4(e){let t=(0,Gc.getUserDataDir)();if(!t)throw new ma.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let n=Ws.join(t,"com.vercel.token",`${e}.json`);if(!ui.existsSync(n))return null;let o=JSON.parse(ui.readFileSync(n,"utf8"));return sy(o),o}function y4(e){let t=e.split(".");if(t.length!==3)throw new ma.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let n=t[1].replace(/-/g,"+").replace(/_/g,"/"),o=n.padEnd(n.length+(4-n.length%4)%4,"=");return JSON.parse(Buffer.from(o,"base64").toString("utf8"))}function _4(e,t=0){return e.exp*1e3{"use strict";var ly=Object.defineProperty,b4=Object.getOwnPropertyDescriptor,w4=Object.getOwnPropertyNames,x4=Object.prototype.hasOwnProperty,k4=(e,t)=>{for(var n in t)ly(e,n,{get:t[n],enumerable:!0})},S4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of w4(t))!x4.call(e,r)&&r!==n&&ly(e,r,{get:()=>t[r],enumerable:!(o=b4(t,r))||o.enumerable});return e},T4=e=>S4(ly({},"__esModule",{value:!0}),e),tP={};k4(tP,{refreshToken:()=>I4});rP.exports=T4(tP);var eP=Ls(),yo=Vs();async function I4(e){let t=e?.project,n=e?.team;if(!t&&!n){let r=(0,yo.findProjectInfo)();t=r.projectId,n=r.teamId}else if(!t||!n){let r=(0,yo.findProjectInfo)();t=t??r.projectId,n=n??r.teamId}if(!t)throw new eP.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let o=(0,yo.loadToken)(t);if(!o||(0,yo.isExpired)((0,yo.getTokenPayload)(o.token),e?.expirationBufferMs)){let r=await(0,yo.getVercelToken)({expirationBufferMs:e?.expirationBufferMs});if(o=await(0,yo.getVercelOidcToken)(r,t,n),!o)throw new eP.VercelOidcTokenError("Failed to refresh OIDC token");(0,yo.saveToken)(o,t)}process.env.VERCEL_OIDC_TOKEN=o.token}});var aP=te((vB,iP)=>{"use strict";var cy=Object.defineProperty,$4=Object.getOwnPropertyDescriptor,P4=Object.getOwnPropertyNames,E4=Object.prototype.hasOwnProperty,R4=(e,t)=>{for(var n in t)cy(e,n,{get:t[n],enumerable:!0})},C4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of P4(t))!E4.call(e,r)&&r!==n&&cy(e,r,{get:()=>t[r],enumerable:!(o=$4(t,r))||o.enumerable});return e},O4=e=>C4(cy({},"__esModule",{value:!0}),e),oP={};R4(oP,{getVercelOidcToken:()=>N4,getVercelOidcTokenSync:()=>uy});iP.exports=O4(oP);var D4=Gv(),j4=Ls();async function N4(e){let t="",n;try{t=uy()}catch(o){n=o}try{let[{getTokenPayload:o,isExpired:r},{refreshToken:i}]=await Promise.all([await Promise.resolve().then(()=>Lt(Vs())),await Promise.resolve().then(()=>Lt(nP()))]);(!t||r(o(t),e?.expirationBufferMs))&&(await i(e),t=uy())}catch(o){let r=n instanceof Error?n.message:"";throw o instanceof Error&&(r=`${r} +${o.message}`),r?new j4.VercelOidcTokenError(r):o}return t}function uy(){let e=(0,D4.getContext)().headers?.["x-vercel-oidc-token"]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw new Error("The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?");return e}});var py=te((yB,cP)=>{"use strict";var dy=Object.defineProperty,M4=Object.getOwnPropertyDescriptor,A4=Object.getOwnPropertyNames,z4=Object.prototype.hasOwnProperty,q4=(e,t)=>{for(var n in t)dy(e,n,{get:t[n],enumerable:!0})},U4=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A4(t))!z4.call(e,r)&&r!==n&&dy(e,r,{get:()=>t[r],enumerable:!(o=M4(t,r))||o.enumerable});return e},L4=e=>U4(dy({},"__esModule",{value:!0}),e),uP={};q4(uP,{AccessTokenMissingError:()=>lP.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>lP.RefreshAccessTokenFailedError,getContext:()=>F4.getContext,getVercelOidcToken:()=>sP.getVercelOidcToken,getVercelOidcTokenSync:()=>sP.getVercelOidcTokenSync,getVercelToken:()=>Z4.getVercelToken});cP.exports=L4(uP);var sP=aP(),F4=Gv(),lP=ay(),Z4=Vs()});var X6={};kn(X6,{log:()=>ot,sendStatus:()=>$n});module.exports=UR(X6);var xa=Lt(require("os"));var el=class e{constructor(t,n,o,r){this._uri=t,this._languageId=n,this._version=o,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),o=this.offsetAt(t.end);return this._content.substring(n,o)}return this._content}update(t,n){for(let o of t)if(e.isIncremental(o)){let r=Gy(o.range),i=this.offsetAt(r.start),s=this.offsetAt(r.end);this._content=this._content.substring(0,i)+o.text+this._content.substring(s,this._content.length);let l=Math.max(r.start.line,0),u=Math.max(r.end.line,0),c=this._lineOffsets,d=Jy(o.text,!1,i);if(u-l===d.length)for(let _=0,h=d.length;_t?r=s:o=s+1}let i=o-1;return t=this.ensureBeforeEOL(t,n[i]),{line:i,character:t-n[i]}}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let o=n[t.line];if(t.character<=0)return o;let r=t.line+1n&&By(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},tl;(function(e){function t(r,i,s,l){return new el(r,i,s,l)}e.create=t;function n(r,i,s){if(r instanceof el)return r.update(i,s),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function o(r,i){let s=r.getText(),l=cd(i.map(LR),(d,m)=>{let _=d.range.start.line-m.range.start.line;return _===0?d.range.start.character-m.range.start.character:_}),u=0,c=[];for(let d of l){let m=r.offsetAt(d.range.start);if(mu&&c.push(s.substring(u,m)),d.newText.length&&c.push(d.newText),u=r.offsetAt(d.range.end)}return c.push(s.substr(u)),c.join("")}e.applyEdits=o})(tl||(tl={}));function cd(e,t){if(e.length<=1)return e;let n=e.length/2|0,o=e.slice(0,n),r=e.slice(n);cd(o,t),cd(r,t);let i=0,s=0,l=0;for(;in.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function LR(e){let t=Gy(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var mt=Lt(_k());var dt=Lt(require("fs")),lS=Lt(require("os")),Do=Lt(require("path")),Vi=Lt(Yk());var Fr={baseUrl:"https://gateway.posit.ai",authUrl:"https://login.posit.cloud",apiUrl:"https://api.posit.ai",clientId:"rstudio-ide",scope:"prism"};var Eu=Lt(require("fs")),tS=Lt(require("os")),rS=Lt(require("path"));var Xk=rS.join(tS.homedir(),".posit","ai","providers.json"),OD="POSIT_AI_PROVIDERS_ENFORCED",DD="POSIT_AI_PROVIDERS_DEFAULT";function nS(e,t){if(t===void 0)return e;if(Qk(e)&&Qk(t)){let n={...e};for(let o of Object.keys(t))n[o]=nS(e[o],t[o]);return n}return t}function Qk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jD(){try{if(!Eu.existsSync(Xk))return null;let e=Eu.readFileSync(Xk,"utf-8");return JSON.parse(e)?.providers??null}catch{return null}}function eS(e){let t=process.env[e];if(!t)return null;try{return JSON.parse(t)?.providers??null}catch{return null}}function oS(){try{let e=[eS(DD),jD(),eS(OD)],t={};for(let i of e)i&&(t=nS(t,i));let n=t.positai;if(!n)return null;let o=n.positaiLogin,r=n.baseUrl||Fr.baseUrl;return{baseUrl:r,authUrl:o?.host?`https://${o.host}`:Fr.authUrl,apiUrl:r.replace("gateway","api"),clientId:o?.clientId||Fr.clientId,scope:o?.scope||Fr.scope}}catch{return null}}var Ru=Lt(require("fs")),kf=Lt(require("os")),Sf=Lt(require("path"));var iS=Sf.join(kf.homedir(),".posit","assistant","settings.json"),aS=Sf.join(kf.homedir(),".positai","settings.json");function Tf(e){try{if(!Ru.existsSync(e))return null;let t=Ru.readFileSync(e,"utf-8"),r=JSON.parse(t)?.providers?.positai;if(!r)return null;let i=r.oauth,s=r.baseUrl||Fr.baseUrl,l=i?.authHost,u=i?.apiHost;return{baseUrl:s,authUrl:l?`https://${l}`:Fr.authUrl,apiUrl:u?`https://${u}`:s.replace("gateway","api"),clientId:i?.clientId||Fr.clientId,scope:i?.scope||Fr.scope}}catch{return null}}var ND=[oS,()=>Tf(iS),()=>Tf(aS)];function MD(){for(let e of ND){let t=e();if(t)return t}return{...Fr}}var Ct=MD();var Zi=null,Pn="auth:positai:oauth",Pf=lS.homedir(),sS=Do.join(Pf,".posit","ai","auth","data.json"),AD=Do.join(Pf,".posit","assistant","store","data.json"),zD=Do.join(Pf,".positai","store","data.json");function Wa(){for(let e of[sS,AD,zD])if(dt.existsSync(e))return qD(e),e;return sS}function qD(e){If(e,cS),If(Do.dirname(e),$f)}function If(e,t){if(process.platform!=="win32")try{let n=dt.lstatSync(e);if(n.isSymbolicLink())return;(n.mode&511)!==t&&dt.chmodSync(e,t)}catch{}}function uS(e){let t=e?.oauthAuth?.tokenData?.expiresAt;if(!t)return!0;let n=300*1e3;return Date.now()>=new Date(t).getTime()-n}var Ha={retries:{retries:5,minTimeout:100,maxTimeout:1e3},stale:1e4},$f=448,cS=384;function Ef(e){let t=Do.dirname(e);dt.mkdirSync(t,{recursive:!0,mode:$f}),If(t,$f)}function io(e,t){let n=`${e}.tmp.${process.pid}`;try{dt.writeFileSync(n,JSON.stringify(t,null,2),{mode:cS}),dt.renameSync(n,e)}finally{try{dt.unlinkSync(n)}catch{}}}async function UD(e){let t=Wa();Ef(t);let n;try{dt.existsSync(t)||io(t,{}),n=await Vi.default.lock(t,Ha);let o=JSON.parse(dt.readFileSync(t,"utf-8")),r=new Date(Date.now()+e.expires_in*1e3).toISOString(),i={authenticated:!0,oauthAuth:{tokenData:{accessToken:e.access_token,refreshToken:e.refresh_token,expiresAt:r,tokenType:"Bearer",scope:e.scope},expiresAt:r,scope:e.scope}};o[Pn]=i,io(t,o),ot(`[Auth] Tokens stored successfully, expires at ${r}`)}finally{n&&await n()}}async function Rf(){let e=Wa();Ef(e);let t;try{if(!dt.existsSync(e)){io(e,{});return}t=await Vi.default.lock(e,Ha);let n=JSON.parse(dt.readFileSync(e,"utf-8"));n[Pn]={authenticated:!1},io(e,n),ot("[Auth] Cleared previous auth state")}finally{t&&await t()}}async function LD(e){let t=Wa();Ef(t);let n;try{dt.existsSync(t)||io(t,{}),n=await Vi.default.lock(t,Ha);let o=JSON.parse(dt.readFileSync(t,"utf-8"));o[Pn]={authenticated:!1,error:e},io(t,o),ot(`[Auth] Stored error state: ${e}`)}finally{n&&await n()}}function FD(e){return new Promise(t=>setTimeout(t,e))}async function ZD(e,t){Zi&&Zi.abort(),Zi=new AbortController;let n=`${Ct.authUrl}/oauth/token`,o=t*1e3;for(ot(`[Auth] Starting token polling with interval ${t}s`);!Zi.signal.aborted&&(await FD(o),!Zi.signal.aborted);){let r=new URLSearchParams({scope:Ct.scope,client_id:Ct.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e});try{let i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString(),signal:Zi.signal});if(i.ok){let s=await i.json();await UD(s),ot("[Auth] Login successful, token stored");break}if(i.status===400){let s=await i.json();if(s.error==="authorization_pending")continue;if(s.error==="slow_down"){o+=5e3,ot(`[Auth] Slowing down polling to ${o/1e3}s`);continue}ot(`[Auth] Login failed: ${s.error}`),await LD(s.error);break}}catch(i){if(i.name==="AbortError")break;throw ot(`[Auth] Polling error: ${i.message}`),i}}}async function dS(){await Rf();let e=`${Ct.authUrl}/oauth/device/authorize`,t=new URLSearchParams({scope:Ct.scope,client_id:Ct.clientId});ot(`[Auth] Requesting device code from ${e}`);let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.toString()});if(!n.ok){let r=await n.text();throw ot(`[Auth] Device auth failed: ${n.status} ${r}`),new Error(`Device authorization failed: ${n.status}`)}let o=await n.json();return ot(`[Auth] Got device code, user_code: ${o.user_code}`),ZD(o.device_code,o.interval).catch(r=>{ot(`[Auth] Polling failed: ${r.message}`)}),{userCode:o.user_code,verificationUri:o.verification_uri,verificationUriComplete:o.verification_uri_complete,deviceCode:o.device_code,interval:o.interval,expiresIn:o.expires_in}}async function VD(e){let t;try{t=await Vi.default.lock(e,Ha);let n=JSON.parse(dt.readFileSync(e,"utf-8")),o=n[Pn];if(o&&!uS(o))return ot("[Auth] Token already refreshed by another process"),!0;let r=o?.oauthAuth?.tokenData;if(!r?.refreshToken)return ot("[Auth] No refresh token available"),!1;ot("[Auth] Refreshing access token...");let i=await fetch(`${Ct.authUrl}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:r.refreshToken,client_id:Ct.clientId,scope:r.scope||Ct.scope})});if(!i.ok)return ot(`[Auth] Token refresh failed: ${i.status}`),$n("Token refresh failed","Error"),!1;let s=await i.json(),l=new Date(Date.now()+s.expires_in*1e3).toISOString(),u={...o,oauthAuth:{tokenData:{accessToken:s.access_token,refreshToken:s.refresh_token,expiresAt:l,tokenType:"Bearer",scope:r.scope||Ct.scope},expiresAt:l,scope:r.scope||Ct.scope}};return n[Pn]=u,io(e,n),ot(`[Auth] Token refreshed successfully, expires at ${l}`),!0}catch(n){return ot(`[Auth] Token refresh error: ${n.message}`),!1}finally{t&&await t()}}async function WD(e){try{let t=await fetch(`${Ct.apiUrl}/v1/users/me`,{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});return t.ok?(await t.json()).email||null:(ot(`[Auth] Failed to fetch user email: HTTP ${t.status}`),null)}catch(t){return ot(`[Auth] Error fetching user email: ${t.message}`),null}}async function HD(e){let t=Wa(),n;try{if(!dt.existsSync(t))return;n=await Vi.default.lock(t,Ha);let o=JSON.parse(dt.readFileSync(t,"utf-8")),r=o[Pn];r&&(r.userEmail=e,o[Pn]=r,io(t,o),ot(`[Auth] Cached user email: ${e}`))}catch(o){ot(`[Auth] Failed to cache user email: ${o.message}`)}finally{n&&await n()}}async function jo(){let e=Wa();if(!dt.existsSync(e))return $n("Not signed in","Error"),{status:"NotSignedIn",user:""};try{let t=dt.readFileSync(e,"utf-8"),o=JSON.parse(t)[Pn];if(!o)return $n("Not signed in","Error"),{status:"NotSignedIn",user:""};if(o.error)return $n(`Error: ${o.error}`,"Error"),{status:`Error: ${o.error}`,user:""};uS(o)&&await VD(e)&&(o=JSON.parse(dt.readFileSync(e,"utf-8"))[Pn]);let r=o?.authenticated===!0,i=o?.oauthAuth?.tokenData?.accessToken;if(!r||!i||typeof i!="string")return $n("Not signed in","Error"),{status:"NotSignedIn",user:""};$n("Signed in","Normal");let s=o?.userEmail;return s||(ot("[Auth] No cached user email, fetching from /users/me"),s=await WD(i)??void 0,s?(ot(`[Auth] Fetched user email: ${s}`),HD(s)):ot("[Auth] Could not fetch user email, using placeholder")),{status:"OK",user:s||"[Posit AI User]",accessToken:i,baseUrl:Ct.baseUrl}}catch{return $n("Not signed in","Error"),{status:"NotSignedIn",user:""}}}var Ja=class{diff(t,n,o={}){let r;typeof o=="function"?(r=o,o={}):"callback"in o&&(r=o.callback);let i=this.castInput(t,o),s=this.castInput(n,o),l=this.removeEmpty(this.tokenize(i,o)),u=this.removeEmpty(this.tokenize(s,o));return this.diffWithOptionsObj(l,u,o,r)}diffWithOptionsObj(t,n,o,r){var i;let s=g=>{if(g=this.postProcess(g,o),r){setTimeout(function(){r(g)},0);return}else return g},l=n.length,u=t.length,c=1,d=l+u;o.maxEditLength!=null&&(d=Math.min(d,o.maxEditLength));let m=(i=o.timeout)!==null&&i!==void 0?i:1/0,_=Date.now()+m,h=[{oldPos:-1,lastComponent:void 0}],b=this.extractCommon(h[0],n,t,0,o);if(h[0].oldPos+1>=u&&b+1>=l)return s(this.buildValues(h[0].lastComponent,n,t));let k=-1/0,I=1/0,C=()=>{for(let g=Math.max(k,-c);g<=Math.min(I,c);g+=2){let v,R=h[g-1],O=h[g+1];R&&(h[g-1]=void 0);let N=!1;if(O){let ee=O.oldPos-g;N=O&&0<=ee&&ee=u&&b+1>=l)return s(this.buildValues(v.lastComponent,n,t))||!0;h[g]=v,v.oldPos+1>=u&&(I=Math.min(I,g-1)),b+1>=l&&(k=Math.max(k,g+1))}c++};if(r)(function g(){setTimeout(function(){if(c>d||Date.now()>_)return r(void 0);C()||g()},0)})();else for(;c<=d&&Date.now()<=_;){let g=C();if(g)return g}}addToPath(t,n,o,r,i){let s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===o?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:n,removed:o,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:o,previousComponent:s}}}extractCommon(t,n,o,r,i){let s=n.length,l=o.length,u=t.oldPos,c=u-r,d=0;for(;c+1_.length?b:_}),d.value=this.join(m)}else d.value=this.join(n.slice(u,u+d.count));u+=d.count,d.added||(c+=d.count)}}return r}};var Cf=class extends Ja{constructor(){super(...arguments),this.tokenize=BD}equals(t,n,o){return o.ignoreWhitespace?((!o.newlineIsToken||!t.includes(` `))&&(t=t.trim()),(!o.newlineIsToken||!n.includes(` `))&&(n=n.trim())):o.ignoreNewlineAtEof&&!o.newlineIsToken&&(t.endsWith(` `)&&(t=t.slice(0,-1)),n.endsWith(` -`)&&(n=n.slice(0,-1))),super.equals(t,n,o)}},SD=new Sf;function If(e,t,n){return SD.diff(e,t,n)}function ID(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` -`));let n=[],o=e.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(let r=0;r"u"&&(l.context=4);let u=l.context;if(l.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(l.callback){let{callback:d}=l;If(n,o,Object.assign(Object.assign({},l),{callback:m=>{let _=c(m);d(_)}}))}else return c(If(n,o,l));function c(d){if(!d)return;d.push({value:"",lines:[]});function m(g){return g.map(function(v){return" "+v})}let _=[],h=0,b=0,k=[],T=1,R=1;for(let g=0;g0?m(O.lines.slice(-u)):[],h-=k.length,b-=k.length)}for(let O of C)k.push((v.added?"+":"-")+O);v.added?R+=C.length:T+=C.length}else{if(h)if(C.length<=u*2&&g1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(o=>Eu(o,t)).join(` +`)&&(n=n.slice(0,-1))),super.equals(t,n,o)}},JD=new Cf;function Of(e,t,n){return JD.diff(e,t,n)}function BD(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));let n=[],o=e.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(let r=0;r"u"&&(l.context=4);let u=l.context;if(l.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(l.callback){let{callback:d}=l;Of(n,o,Object.assign(Object.assign({},l),{callback:m=>{let _=c(m);d(_)}}))}else return c(Of(n,o,l));function c(d){if(!d)return;d.push({value:"",lines:[]});function m(g){return g.map(function(v){return" "+v})}let _=[],h=0,b=0,k=[],I=1,C=1;for(let g=0;g0?m(O.lines.slice(-u)):[],h-=k.length,b-=k.length)}for(let O of R)k.push((v.added?"+":"-")+O);v.added?C+=R.length:I+=R.length}else{if(h)if(R.length<=u*2&&g1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(o=>Cu(o,t)).join(` `)}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let o=0;o{l(u?Eu(u,s.headerOptions):void 0)}}))}else{let l=Tf(e,t,n,o,r,i,s);return l?Eu(l,s?.headerOptions):void 0}}function $f(e,t,n,o,r,i){return Kk(e,e,t,n,o,r,i)}function TD(e){let t=e.endsWith(` +`}function fS(e,t,n,o,r,i,s){if(typeof s=="function"&&(s={callback:s}),s?.callback){let{callback:l}=s;Df(e,t,n,o,r,i,Object.assign(Object.assign({},s),{callback:u=>{l(u?Cu(u,s.headerOptions):void 0)}}))}else{let l=Df(e,t,n,o,r,i,s);return l?Cu(l,s?.headerOptions):void 0}}function jf(e,t,n,o,r,i){return fS(e,e,t,n,o,r,i)}function GD(e){let t=e.endsWith(` `),n=e.split(` `).map(o=>o+` -`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var IS="vercel.ai.error",PD=Symbol.for(IS),Yk,Xk,_e=class TS extends(Xk=Error,Yk=PD,Xk){constructor({name:t,message:n,cause:o}){super(n),this[Yk]=!0,this.name=t,this.cause=o}static isInstance(t){return TS.hasMarker(t,IS)}static hasMarker(t,n){let o=Symbol.for(n);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}},$S="AI_APICallError",PS=`vercel.ai.error.${$S}`,ED=Symbol.for(PS),Qk,eS,Je=class extends(eS=_e,Qk=ED,eS){constructor({message:e,url:t,requestBodyValues:n,statusCode:o,responseHeaders:r,responseBody:i,cause:s,isRetryable:l=o!=null&&(o===408||o===409||o===429||o>=500),data:u}){super({name:$S,message:e,cause:s}),this[Qk]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=o,this.responseHeaders=r,this.responseBody=i,this.isRetryable=l,this.data=u}static isInstance(e){return _e.hasMarker(e,PS)}},ES="AI_EmptyResponseBodyError",CS=`vercel.ai.error.${ES}`,CD=Symbol.for(CS),tS,rS,RS=class extends(rS=_e,tS=CD,rS){constructor({message:e="Empty response body"}={}){super({name:ES,message:e}),this[tS]=!0}static isInstance(e){return _e.hasMarker(e,CS)}};function oo(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var OS="AI_InvalidArgumentError",DS=`vercel.ai.error.${OS}`,RD=Symbol.for(DS),nS,oS,Cu=class extends(oS=_e,nS=RD,oS){constructor({message:e,cause:t,argument:n}){super({name:OS,message:e,cause:t}),this[nS]=!0,this.argument=n}static isInstance(e){return _e.hasMarker(e,DS)}},jS="AI_InvalidPromptError",NS=`vercel.ai.error.${jS}`,OD=Symbol.for(NS),iS,aS,pn=class extends(aS=_e,iS=OD,aS){constructor({prompt:e,message:t,cause:n}){super({name:jS,message:`Invalid prompt: ${t}`,cause:n}),this[iS]=!0,this.prompt=e}static isInstance(e){return _e.hasMarker(e,NS)}},MS="AI_InvalidResponseDataError",AS=`vercel.ai.error.${MS}`,DD=Symbol.for(AS),sS,lS,Ru=class extends(lS=_e,sS=DD,lS){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:MS,message:t}),this[sS]=!0,this.data=e}static isInstance(e){return _e.hasMarker(e,AS)}},zS="AI_JSONParseError",qS=`vercel.ai.error.${zS}`,jD=Symbol.for(qS),uS,cS,Ba=class extends(cS=_e,uS=jD,cS){constructor({text:e,cause:t}){super({name:zS,message:`JSON parsing failed: Text: ${e}. -Error message: ${oo(t)}`,cause:t}),this[uS]=!0,this.text=e}static isInstance(e){return _e.hasMarker(e,qS)}},US="AI_LoadAPIKeyError",LS=`vercel.ai.error.${US}`,ND=Symbol.for(LS),dS,pS,Ga=class extends(pS=_e,dS=ND,pS){constructor({message:e}){super({name:US,message:e}),this[dS]=!0}static isInstance(e){return _e.hasMarker(e,LS)}},FS="AI_LoadSettingError",ZS=`vercel.ai.error.${FS}`,MD=Symbol.for(ZS),fS,mS,jV=class extends(mS=_e,fS=MD,mS){constructor({message:e}){super({name:FS,message:e}),this[fS]=!0}static isInstance(e){return _e.hasMarker(e,ZS)}},VS="AI_NoContentGeneratedError",WS=`vercel.ai.error.${VS}`,AD=Symbol.for(WS),hS,gS,NV=class extends(gS=_e,hS=AD,gS){constructor({message:e="No content generated."}={}){super({name:VS,message:e}),this[hS]=!0}static isInstance(e){return _e.hasMarker(e,WS)}},HS="AI_NoSuchModelError",JS=`vercel.ai.error.${HS}`,zD=Symbol.for(JS),vS,yS,MV=class extends(yS=_e,vS=zD,yS){constructor({errorName:e=HS,modelId:t,modelType:n,message:o=`No such ${n}: ${t}`}){super({name:e,message:o}),this[vS]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return _e.hasMarker(e,JS)}},BS="AI_TooManyEmbeddingValuesForCallError",GS=`vercel.ai.error.${BS}`,qD=Symbol.for(GS),_S,bS,KS=class extends(bS=_e,_S=qD,bS){constructor(e){super({name:BS,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[_S]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return _e.hasMarker(e,GS)}},YS="AI_TypeValidationError",XS=`vercel.ai.error.${YS}`,UD=Symbol.for(XS),wS,xS,Xr=class Pf extends(xS=_e,wS=UD,xS){constructor({value:t,cause:n,context:o}){let r="Type validation failed";if(o?.field&&(r+=` for ${o.field}`),o?.entityName||o?.entityId){r+=" (";let i=[];o.entityName&&i.push(o.entityName),o.entityId&&i.push(`id: "${o.entityId}"`),r+=i.join(", "),r+=")"}super({name:YS,message:`${r}: Value: ${JSON.stringify(t)}. -Error message: ${oo(n)}`,cause:n}),this[wS]=!0,this.value=t,this.context=o}static isInstance(t){return _e.hasMarker(t,XS)}static wrap({value:t,cause:n,context:o}){var r,i,s;return Pf.isInstance(n)&&n.value===t&&((r=n.context)==null?void 0:r.field)===o?.field&&((i=n.context)==null?void 0:i.entityName)===o?.entityName&&((s=n.context)==null?void 0:s.entityId)===o?.entityId?n:new Pf({value:t,cause:n,context:o})}},QS="AI_UnsupportedFunctionalityError",eI=`vercel.ai.error.${QS}`,LD=Symbol.for(eI),kS,SS,gr=class extends(SS=_e,kS=LD,SS){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:QS,message:t}),this[kS]=!0,this.functionality=e}static isInstance(e){return _e.hasMarker(e,eI)}};var a={};xn(a,{$brand:()=>Cf,$input:()=>Vh,$output:()=>Zh,NEVER:()=>Ef,TimePrecision:()=>Jh,ZodAny:()=>_T,ZodArray:()=>kT,ZodBase64:()=>tv,ZodBase64URL:()=>rv,ZodBigInt:()=>js,ZodBigIntFormat:()=>iv,ZodBoolean:()=>Ds,ZodCIDRv4:()=>Qg,ZodCIDRv6:()=>ev,ZodCUID:()=>Hg,ZodCUID2:()=>Jg,ZodCatch:()=>FT,ZodCustom:()=>Rc,ZodCustomStringFormat:()=>pT,ZodDate:()=>Pc,ZodDefault:()=>MT,ZodDiscriminatedUnion:()=>ST,ZodE164:()=>nv,ZodEmail:()=>Fg,ZodEmoji:()=>Vg,ZodEnum:()=>Cs,ZodError:()=>TN,ZodFile:()=>jT,ZodGUID:()=>xc,ZodIPv4:()=>Yg,ZodIPv6:()=>Xg,ZodISODate:()=>yc,ZodISODateTime:()=>vc,ZodISODuration:()=>bc,ZodISOTime:()=>_c,ZodIntersection:()=>IT,ZodIssueCode:()=>CM,ZodJWT:()=>ov,ZodKSUID:()=>Kg,ZodLazy:()=>BT,ZodLiteral:()=>OT,ZodMap:()=>ET,ZodNaN:()=>VT,ZodNanoID:()=>Wg,ZodNever:()=>wT,ZodNonOptional:()=>pv,ZodNull:()=>vT,ZodNullable:()=>NT,ZodNumber:()=>Os,ZodNumberFormat:()=>ea,ZodObject:()=>Ec,ZodOptional:()=>dv,ZodPipe:()=>fv,ZodPrefault:()=>zT,ZodPromise:()=>KT,ZodReadonly:()=>WT,ZodRealError:()=>Qi,ZodRecord:()=>lv,ZodSet:()=>CT,ZodString:()=>Rs,ZodStringFormat:()=>gt,ZodSuccess:()=>LT,ZodSymbol:()=>hT,ZodTemplateLiteral:()=>JT,ZodTransform:()=>uv,ZodTuple:()=>$T,ZodType:()=>Ue,ZodULID:()=>Bg,ZodURL:()=>Zg,ZodUUID:()=>Dn,ZodUndefined:()=>gT,ZodUnion:()=>sv,ZodUnknown:()=>bT,ZodVoid:()=>xT,ZodXID:()=>Gg,_ZodString:()=>Lg,_default:()=>AT,any:()=>aM,array:()=>av,base64:()=>HN,base64url:()=>JN,bigint:()=>tM,boolean:()=>mT,catch:()=>ZT,check:()=>YT,cidrv4:()=>VN,cidrv6:()=>WN,clone:()=>Er,coerce:()=>mv,config:()=>jt,core:()=>On,cuid:()=>AN,cuid2:()=>zN,custom:()=>IM,date:()=>lM,discriminatedUnion:()=>fM,e164:()=>BN,email:()=>PN,emoji:()=>NN,endsWith:()=>bs,enum:()=>RT,file:()=>_M,flattenError:()=>is,float32:()=>YN,float64:()=>XN,formatError:()=>as,function:()=>Rg,getErrorMap:()=>OM,globalRegistry:()=>mn,gt:()=>Cn,gte:()=>yr,guid:()=>EN,includes:()=>ys,instanceof:()=>TM,int:()=>Ug,int32:()=>QN,int64:()=>rM,intersection:()=>TT,ipv4:()=>FN,ipv6:()=>ZN,iso:()=>wc,json:()=>PM,jwt:()=>GN,keyof:()=>uM,ksuid:()=>LN,lazy:()=>GT,length:()=>Xi,literal:()=>DT,locales:()=>ps,looseObject:()=>pM,lowercase:()=>gs,lt:()=>En,lte:()=>Fr,map:()=>gM,maxLength:()=>Yi,maxSize:()=>Ki,mime:()=>ws,minLength:()=>ao,minSize:()=>Uo,multipleOf:()=>qo,nan:()=>xM,nanoid:()=>MN,nativeEnum:()=>yM,negative:()=>wg,never:()=>$c,nonnegative:()=>kg,nonoptional:()=>UT,nonpositive:()=>xg,normalize:()=>xs,null:()=>yT,nullable:()=>Ic,nullish:()=>bM,number:()=>fT,object:()=>cM,optional:()=>Sc,overwrite:()=>Rn,parse:()=>Mg,parseAsync:()=>Ag,partialRecord:()=>hM,pipe:()=>Tc,positive:()=>bg,prefault:()=>qT,preprocess:()=>EM,prettifyError:()=>Zf,promise:()=>SM,property:()=>Sg,readonly:()=>HT,record:()=>PT,refine:()=>XT,regex:()=>hs,regexes:()=>Mo,registry:()=>Bu,safeParse:()=>zg,safeParseAsync:()=>Es,set:()=>vM,setErrorMap:()=>RM,size:()=>ms,startsWith:()=>_s,strictObject:()=>dM,string:()=>qg,stringFormat:()=>KN,stringbool:()=>$M,success:()=>wM,superRefine:()=>QT,symbol:()=>oM,templateLiteral:()=>kM,toJSONSchema:()=>Ps,toLowerCase:()=>Ss,toUpperCase:()=>Is,transform:()=>cv,treeifyError:()=>Ff,trim:()=>ks,tuple:()=>mM,uint32:()=>eM,uint64:()=>nM,ulid:()=>qN,undefined:()=>iM,union:()=>Cc,unknown:()=>kc,uppercase:()=>vs,url:()=>jN,uuid:()=>CN,uuidv4:()=>RN,uuidv6:()=>ON,uuidv7:()=>DN,void:()=>sM,xid:()=>UN});var On={};xn(On,{$ZodAny:()=>vh,$ZodArray:()=>us,$ZodAsyncError:()=>fn,$ZodBase64:()=>sh,$ZodBase64URL:()=>lh,$ZodBigInt:()=>Wu,$ZodBigIntFormat:()=>fh,$ZodBoolean:()=>ls,$ZodCIDRv4:()=>oh,$ZodCIDRv6:()=>ih,$ZodCUID:()=>Jm,$ZodCUID2:()=>Bm,$ZodCatch:()=>Mh,$ZodCheck:()=>$t,$ZodCheckBigIntFormat:()=>km,$ZodCheckEndsWith:()=>Nm,$ZodCheckGreaterThan:()=>Lu,$ZodCheckIncludes:()=>Dm,$ZodCheckLengthEquals:()=>Em,$ZodCheckLessThan:()=>Uu,$ZodCheckLowerCase:()=>Rm,$ZodCheckMaxLength:()=>$m,$ZodCheckMaxSize:()=>Sm,$ZodCheckMimeType:()=>Am,$ZodCheckMinLength:()=>Pm,$ZodCheckMinSize:()=>Im,$ZodCheckMultipleOf:()=>wm,$ZodCheckNumberFormat:()=>xm,$ZodCheckOverwrite:()=>zm,$ZodCheckProperty:()=>Mm,$ZodCheckRegex:()=>Cm,$ZodCheckSizeEquals:()=>Tm,$ZodCheckStartsWith:()=>jm,$ZodCheckStringFormat:()=>Hi,$ZodCheckUpperCase:()=>Om,$ZodCustom:()=>Fh,$ZodCustomStringFormat:()=>dh,$ZodDate:()=>bh,$ZodDefault:()=>Oh,$ZodDiscriminatedUnion:()=>xh,$ZodE164:()=>uh,$ZodEmail:()=>Zm,$ZodEmoji:()=>Wm,$ZodEnum:()=>$h,$ZodError:()=>os,$ZodFile:()=>Eh,$ZodFunction:()=>gc,$ZodGUID:()=>Lm,$ZodIPv4:()=>rh,$ZodIPv6:()=>nh,$ZodISODate:()=>Qm,$ZodISODateTime:()=>Xm,$ZodISODuration:()=>th,$ZodISOTime:()=>eh,$ZodIntersection:()=>kh,$ZodJWT:()=>ch,$ZodKSUID:()=>Ym,$ZodLazy:()=>Lh,$ZodLiteral:()=>Ph,$ZodMap:()=>Ih,$ZodNaN:()=>Ah,$ZodNanoID:()=>Hm,$ZodNever:()=>yh,$ZodNonOptional:()=>jh,$ZodNull:()=>gh,$ZodNullable:()=>Rh,$ZodNumber:()=>Vu,$ZodNumberFormat:()=>ph,$ZodObject:()=>wh,$ZodOptional:()=>Ch,$ZodPipe:()=>ds,$ZodPrefault:()=>Dh,$ZodPromise:()=>Uh,$ZodReadonly:()=>zh,$ZodRealError:()=>Wi,$ZodRecord:()=>Sh,$ZodRegistry:()=>Bi,$ZodSet:()=>Th,$ZodString:()=>Ao,$ZodStringFormat:()=>pt,$ZodSuccess:()=>Nh,$ZodSymbol:()=>mh,$ZodTemplateLiteral:()=>qh,$ZodTransform:()=>cs,$ZodTuple:()=>zo,$ZodType:()=>Re,$ZodULID:()=>Gm,$ZodURL:()=>Vm,$ZodUUID:()=>Fm,$ZodUndefined:()=>hh,$ZodUnion:()=>Hu,$ZodUnknown:()=>Ji,$ZodVoid:()=>_h,$ZodXID:()=>Km,$brand:()=>Cf,$constructor:()=>j,$input:()=>Vh,$output:()=>Zh,Doc:()=>ss,JSONSchema:()=>uT,JSONSchemaGenerator:()=>$s,NEVER:()=>Ef,TimePrecision:()=>Jh,_any:()=>mg,_array:()=>Ts,_base64:()=>pc,_base64url:()=>fc,_bigint:()=>sg,_boolean:()=>ig,_catch:()=>_N,_cidrv4:()=>cc,_cidrv6:()=>dc,_coercedBigint:()=>lg,_coercedBoolean:()=>ag,_coercedDate:()=>yg,_coercedNumber:()=>Qh,_coercedString:()=>Hh,_cuid:()=>nc,_cuid2:()=>oc,_custom:()=>$g,_date:()=>vg,_default:()=>gN,_discriminatedUnion:()=>iN,_e164:()=>mc,_email:()=>Gu,_emoji:()=>tc,_endsWith:()=>bs,_enum:()=>cN,_file:()=>Tg,_float32:()=>tg,_float64:()=>rg,_gt:()=>Cn,_gte:()=>yr,_guid:()=>fs,_includes:()=>ys,_int:()=>eg,_int32:()=>ng,_int64:()=>ug,_intersection:()=>aN,_ipv4:()=>lc,_ipv6:()=>uc,_isoDate:()=>Gh,_isoDateTime:()=>Bh,_isoDuration:()=>Yh,_isoTime:()=>Kh,_jwt:()=>hc,_ksuid:()=>sc,_lazy:()=>kN,_length:()=>Xi,_literal:()=>pN,_lowercase:()=>gs,_lt:()=>En,_lte:()=>Fr,_map:()=>lN,_max:()=>Fr,_maxLength:()=>Yi,_maxSize:()=>Ki,_mime:()=>ws,_min:()=>yr,_minLength:()=>ao,_minSize:()=>Uo,_multipleOf:()=>qo,_nan:()=>_g,_nanoid:()=>rc,_nativeEnum:()=>dN,_negative:()=>wg,_never:()=>hg,_nonnegative:()=>kg,_nonoptional:()=>vN,_nonpositive:()=>xg,_normalize:()=>xs,_null:()=>fg,_nullable:()=>hN,_number:()=>Xh,_optional:()=>mN,_overwrite:()=>Rn,_parse:()=>Du,_parseAsync:()=>Nu,_pipe:()=>bN,_positive:()=>bg,_promise:()=>SN,_property:()=>Sg,_readonly:()=>wN,_record:()=>sN,_refine:()=>Pg,_regex:()=>hs,_safeParse:()=>Au,_safeParseAsync:()=>zu,_set:()=>uN,_size:()=>ms,_startsWith:()=>_s,_string:()=>Wh,_stringFormat:()=>Cg,_stringbool:()=>Eg,_success:()=>yN,_symbol:()=>dg,_templateLiteral:()=>xN,_toLowerCase:()=>Ss,_toUpperCase:()=>Is,_transform:()=>fN,_trim:()=>ks,_tuple:()=>Ig,_uint32:()=>og,_uint64:()=>cg,_ulid:()=>ic,_undefined:()=>pg,_union:()=>oN,_unknown:()=>Gi,_uppercase:()=>vs,_url:()=>ec,_uuid:()=>Ku,_uuidv4:()=>Yu,_uuidv6:()=>Xu,_uuidv7:()=>Qu,_void:()=>gg,_xid:()=>ac,clone:()=>Er,config:()=>jt,flattenError:()=>is,formatError:()=>as,function:()=>Rg,globalConfig:()=>Ka,globalRegistry:()=>mn,isValidBase64:()=>ah,isValidBase64URL:()=>bI,isValidJWT:()=>wI,locales:()=>ps,parse:()=>ju,parseAsync:()=>Mu,prettifyError:()=>Zf,regexes:()=>Mo,registry:()=>Bu,safeParse:()=>Vf,safeParseAsync:()=>Wf,toDotPath:()=>rI,toJSONSchema:()=>Ps,treeifyError:()=>Ff,util:()=>ce,version:()=>qm});var Ef=Object.freeze({status:"aborted"});function j(e,t,n){function o(l,u){var c;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(c=l._zod).traits??(c.traits=new Set),l._zod.traits.add(e),t(l,u);for(let d in s.prototype)d in l||Object.defineProperty(l,d,{value:s.prototype[d].bind(l)});l._zod.constr=s,l._zod.def=u}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function s(l){var u;let c=n?.Parent?new i:this;o(c,l),(u=c._zod).deferred??(u.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Cf=Symbol("zod_brand"),fn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ka={};function jt(e){return e&&Object.assign(Ka,e),Ka}var ce={};xn(ce,{BIGINT_FORMAT_RANGES:()=>Uf,Class:()=>Of,NUMBER_FORMAT_RANGES:()=>qf,aborted:()=>jo,allowsEval:()=>Mf,assert:()=>HD,assertEqual:()=>FD,assertIs:()=>VD,assertNever:()=>WD,assertNotEqual:()=>ZD,assignProp:()=>Nf,cached:()=>Qa,captureStackTrace:()=>Ou,cleanEnum:()=>ij,cleanRegex:()=>es,clone:()=>Er,createTransparentProxy:()=>XD,defineLazy:()=>Qe,esc:()=>Do,escapeRegex:()=>Pn,extend:()=>tj,finalizeIssue:()=>Cr,floatSafeRemainder:()=>jf,getElementAtPath:()=>JD,getEnumValues:()=>Xa,getLengthableOrigin:()=>ns,getParsedType:()=>YD,getSizableOrigin:()=>rs,isObject:()=>Zi,isPlainObject:()=>Vi,issue:()=>Lf,joinValues:()=>V,jsonStringifyReplacer:()=>Df,merge:()=>rj,normalizeParams:()=>ae,nullish:()=>io,numKeys:()=>KD,omit:()=>ej,optionalKeys:()=>zf,partial:()=>nj,pick:()=>QD,prefixIssues:()=>vr,primitiveTypes:()=>Af,promiseAllObject:()=>BD,propertyKeyTypes:()=>ts,randomString:()=>GD,required:()=>oj,stringifyPrimitive:()=>ue,unwrapMessage:()=>Ya});function FD(e){return e}function ZD(e){return e}function VD(e){}function WD(e){throw new Error}function HD(e){}function Xa(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function V(e,t="|"){return e.map(n=>ue(n)).join(t)}function Df(e,t){return typeof t=="bigint"?t.toString():t}function Qa(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function io(e){return e==null}function es(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function jf(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}function Qe(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw new Error("cached value already set")},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Nf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function JD(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function BD(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i{};function Zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Mf=Qa(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Vi(e){if(Zi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Zi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function KD(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var YD=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ts=new Set(["string","number","symbol"]),Af=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function ae(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function XD(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function ue(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var qf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Uf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function QD(e,t){let n={},o=e._zod.def;for(let r in t){if(!(r in o.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(n[r]=o.shape[r])}return Er(e,{...e._zod.def,shape:n,checks:[]})}function ej(e,t){let n={...e._zod.def.shape},o=e._zod.def;for(let r in t){if(!(r in o.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete n[r]}return Er(e,{...e._zod.def,shape:n,checks:[]})}function tj(e,t){if(!Vi(t))throw new Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return Nf(this,"shape",o),o},checks:[]};return Er(e,n)}function rj(e,t){return Er(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Nf(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function nj(e,t,n){let o=t._zod.def.shape,r={...o};if(n)for(let i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(let i in o)r[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Er(t,{...t._zod.def,shape:r,checks:[]})}function oj(e,t,n){let o=t._zod.def.shape,r={...o};if(n)for(let i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(let i in o)r[i]=new e({type:"nonoptional",innerType:o[i]});return Er(t,{...t._zod.def,shape:r,checks:[]})}function jo(e,t=0){for(let n=t;n{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Ya(e){return typeof e=="string"?e:e?.message}function Cr(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=Ya(e.inst?._zod.def?.error?.(e))??Ya(t?.error?.(e))??Ya(n.customError?.(e))??Ya(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function rs(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ns(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Lf(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function ij(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Of=class{constructor(...t){}};var tI=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Df,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},os=j("$ZodError",tI),Wi=j("$ZodError",tI,{Parent:Error});function is(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function as(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>r({issues:l}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)o._errors.push(n(s));else{let l=o,u=0;for(;u{var l,u;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let d=[...s,...c.path];if(d.length===0){o.errors.push(n(c));continue}let m=o,_=0;for(;_o.path.length-r.path.length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${rI(o.path)}`);return t.join(` -`)}var Du=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new fn;if(s.issues.length){let l=new(r?.Err??e)(s.issues.map(u=>Cr(u,i,jt())));throw Ou(l,r?.callee),l}return s.value},ju=Du(Wi),Nu=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let l=new(r?.Err??e)(s.issues.map(u=>Cr(u,i,jt())));throw Ou(l,r?.callee),l}return s.value},Mu=Nu(Wi),Au=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new fn;return i.issues.length?{success:!1,error:new(e??os)(i.issues.map(s=>Cr(s,r,jt())))}:{success:!0,data:i.value}},Vf=Au(Wi),zu=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Cr(s,r,jt())))}:{success:!0,data:i.value}},Wf=zu(Wi);var Mo={};xn(Mo,{_emoji:()=>nI,base64:()=>am,base64url:()=>qu,bigint:()=>fm,boolean:()=>gm,browserEmail:()=>mj,cidrv4:()=>om,cidrv6:()=>im,cuid:()=>Hf,cuid2:()=>Jf,date:()=>um,datetime:()=>dm,domain:()=>hj,duration:()=>Xf,e164:()=>lm,email:()=>em,emoji:()=>tm,extendedDuration:()=>sj,guid:()=>Qf,hostname:()=>sm,html5Email:()=>dj,integer:()=>mm,ipv4:()=>rm,ipv6:()=>nm,ksuid:()=>Kf,lowercase:()=>_m,nanoid:()=>Yf,null:()=>vm,number:()=>hm,rfc5322Email:()=>pj,string:()=>pm,time:()=>cm,ulid:()=>Bf,undefined:()=>ym,unicodeEmail:()=>fj,uppercase:()=>bm,uuid:()=>No,uuid4:()=>lj,uuid6:()=>uj,uuid7:()=>cj,xid:()=>Gf});var Hf=/^[cC][^\s-]{8,}$/,Jf=/^[0-9a-z]+$/,Bf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Gf=/^[0-9a-vA-V]{20}$/,Kf=/^[A-Za-z0-9]{27}$/,Yf=/^[a-zA-Z0-9_-]{21}$/,Xf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Qf=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,No=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,lj=No(4),uj=No(6),cj=No(7),em=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dj=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pj=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,fj=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mj=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tm(){return new RegExp(nI,"u")}var rm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,om=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,im=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,am=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qu=/^[A-Za-z0-9_-]*$/,sm=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,hj=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,lm=/^\+(?:[0-9]){6,14}[0-9]$/,oI="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",um=new RegExp(`^${oI}$`);function iI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function cm(e){return new RegExp(`^${iI(e)}$`)}function dm(e){let t=iI({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${oI}T(?:${o})$`)}var pm=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fm=/^\d+n?$/,mm=/^\d+$/,hm=/^-?\d+(?:\.\d+)?/i,gm=/true|false/i,vm=/null/i;var ym=/undefined/i;var _m=/^[^A-Z]*$/,bm=/^[^a-z]*$/;var $t=j("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sI={number:"number",bigint:"bigint",object:"date"},Uu=j("$ZodCheckLessThan",(e,t)=>{$t.init(e,t);let n=sI[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?o.value<=t.value:o.value{$t.init(e,t);let n=sI[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wm=j("$ZodCheckMultipleOf",(e,t)=>{$t.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):jf(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),xm=j("$ZodCheckNumberFormat",(e,t)=>{$t.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=qf[t.format];e._zod.onattach.push(s=>{let l=s._zod.bag;l.format=t.format,l.minimum=r,l.maximum=i,n&&(l.pattern=mm)}),e._zod.check=s=>{let l=s.value;if(n){if(!Number.isInteger(l)){s.issues.push({expected:o,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}li&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),km=j("$ZodCheckBigIntFormat",(e,t)=>{$t.init(e,t);let[n,o]=Uf[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;io&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Sm=j("$ZodCheckMaxSize",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!io(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{let r=o.value;r.size<=t.maximum||o.issues.push({origin:rs(r),code:"too_big",maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),Im=j("$ZodCheckMinSize",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!io(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:rs(r),code:"too_small",minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),Tm=j("$ZodCheckSizeEquals",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!io(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:rs(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),$m=j("$ZodCheckMaxLength",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!io(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{let r=o.value;if(r.length<=t.maximum)return;let s=ns(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pm=j("$ZodCheckMinLength",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!io(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let s=ns(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Em=j("$ZodCheckLengthEquals",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!io(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let s=ns(r),l=i>t.length;o.issues.push({origin:s,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Hi=j("$ZodCheckStringFormat",(e,t)=>{var n,o;$t.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Cm=j("$ZodCheckRegex",(e,t)=>{Hi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Rm=j("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_m),Hi.init(e,t)}),Om=j("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bm),Hi.init(e,t)}),Dm=j("$ZodCheckIncludes",(e,t)=>{$t.init(e,t);let n=Pn(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),jm=j("$ZodCheckStartsWith",(e,t)=>{$t.init(e,t);let n=new RegExp(`^${Pn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Nm=j("$ZodCheckEndsWith",(e,t)=>{$t.init(e,t);let n=new RegExp(`.*${Pn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function aI(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues))}var Mm=j("$ZodCheckProperty",(e,t)=>{$t.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>aI(r,n,t.property));aI(o,n,t.property)}}),Am=j("$ZodCheckMimeType",(e,t)=>{$t.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e})}}),zm=j("$ZodCheckOverwrite",(e,t)=>{$t.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ss=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(` +`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var FS="vercel.ai.error",YD=Symbol.for(FS),mS,hS,_e=class ZS extends(hS=Error,mS=YD,hS){constructor({name:t,message:n,cause:o}){super(n),this[mS]=!0,this.name=t,this.cause=o}static isInstance(t){return ZS.hasMarker(t,FS)}static hasMarker(t,n){let o=Symbol.for(n);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}},VS="AI_APICallError",WS=`vercel.ai.error.${VS}`,XD=Symbol.for(WS),gS,vS,Je=class extends(vS=_e,gS=XD,vS){constructor({message:e,url:t,requestBodyValues:n,statusCode:o,responseHeaders:r,responseBody:i,cause:s,isRetryable:l=o!=null&&(o===408||o===409||o===429||o>=500),data:u}){super({name:VS,message:e,cause:s}),this[gS]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=o,this.responseHeaders=r,this.responseBody=i,this.isRetryable=l,this.data=u}static isInstance(e){return _e.hasMarker(e,WS)}},HS="AI_EmptyResponseBodyError",JS=`vercel.ai.error.${HS}`,QD=Symbol.for(JS),yS,_S,BS=class extends(_S=_e,yS=QD,_S){constructor({message:e="Empty response body"}={}){super({name:HS,message:e}),this[yS]=!0}static isInstance(e){return _e.hasMarker(e,JS)}};function ao(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var GS="AI_InvalidArgumentError",KS=`vercel.ai.error.${GS}`,ej=Symbol.for(KS),bS,wS,Ou=class extends(wS=_e,bS=ej,wS){constructor({message:e,cause:t,argument:n}){super({name:GS,message:e,cause:t}),this[bS]=!0,this.argument=n}static isInstance(e){return _e.hasMarker(e,KS)}},YS="AI_InvalidPromptError",XS=`vercel.ai.error.${YS}`,tj=Symbol.for(XS),xS,kS,fn=class extends(kS=_e,xS=tj,kS){constructor({prompt:e,message:t,cause:n}){super({name:YS,message:`Invalid prompt: ${t}`,cause:n}),this[xS]=!0,this.prompt=e}static isInstance(e){return _e.hasMarker(e,XS)}},QS="AI_InvalidResponseDataError",eT=`vercel.ai.error.${QS}`,rj=Symbol.for(eT),SS,TS,Du=class extends(TS=_e,SS=rj,TS){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:QS,message:t}),this[SS]=!0,this.data=e}static isInstance(e){return _e.hasMarker(e,eT)}},tT="AI_JSONParseError",rT=`vercel.ai.error.${tT}`,nj=Symbol.for(rT),IS,$S,Ba=class extends($S=_e,IS=nj,$S){constructor({text:e,cause:t}){super({name:tT,message:`JSON parsing failed: Text: ${e}. +Error message: ${ao(t)}`,cause:t}),this[IS]=!0,this.text=e}static isInstance(e){return _e.hasMarker(e,rT)}},nT="AI_LoadAPIKeyError",oT=`vercel.ai.error.${nT}`,oj=Symbol.for(oT),PS,ES,Ga=class extends(ES=_e,PS=oj,ES){constructor({message:e}){super({name:nT,message:e}),this[PS]=!0}static isInstance(e){return _e.hasMarker(e,oT)}},iT="AI_LoadSettingError",aT=`vercel.ai.error.${iT}`,ij=Symbol.for(aT),RS,CS,dW=class extends(CS=_e,RS=ij,CS){constructor({message:e}){super({name:iT,message:e}),this[RS]=!0}static isInstance(e){return _e.hasMarker(e,aT)}},sT="AI_NoContentGeneratedError",lT=`vercel.ai.error.${sT}`,aj=Symbol.for(lT),OS,DS,pW=class extends(DS=_e,OS=aj,DS){constructor({message:e="No content generated."}={}){super({name:sT,message:e}),this[OS]=!0}static isInstance(e){return _e.hasMarker(e,lT)}},uT="AI_NoSuchModelError",cT=`vercel.ai.error.${uT}`,sj=Symbol.for(cT),jS,NS,fW=class extends(NS=_e,jS=sj,NS){constructor({errorName:e=uT,modelId:t,modelType:n,message:o=`No such ${n}: ${t}`}){super({name:e,message:o}),this[jS]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return _e.hasMarker(e,cT)}},dT="AI_TooManyEmbeddingValuesForCallError",pT=`vercel.ai.error.${dT}`,lj=Symbol.for(pT),MS,AS,fT=class extends(AS=_e,MS=lj,AS){constructor(e){super({name:dT,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[MS]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return _e.hasMarker(e,pT)}},mT="AI_TypeValidationError",hT=`vercel.ai.error.${mT}`,uj=Symbol.for(hT),zS,qS,Qr=class Nf extends(qS=_e,zS=uj,qS){constructor({value:t,cause:n,context:o}){let r="Type validation failed";if(o?.field&&(r+=` for ${o.field}`),o?.entityName||o?.entityId){r+=" (";let i=[];o.entityName&&i.push(o.entityName),o.entityId&&i.push(`id: "${o.entityId}"`),r+=i.join(", "),r+=")"}super({name:mT,message:`${r}: Value: ${JSON.stringify(t)}. +Error message: ${ao(n)}`,cause:n}),this[zS]=!0,this.value=t,this.context=o}static isInstance(t){return _e.hasMarker(t,hT)}static wrap({value:t,cause:n,context:o}){var r,i,s;return Nf.isInstance(n)&&n.value===t&&((r=n.context)==null?void 0:r.field)===o?.field&&((i=n.context)==null?void 0:i.entityName)===o?.entityName&&((s=n.context)==null?void 0:s.entityId)===o?.entityId?n:new Nf({value:t,cause:n,context:o})}},gT="AI_UnsupportedFunctionalityError",vT=`vercel.ai.error.${gT}`,cj=Symbol.for(vT),US,LS,gr=class extends(LS=_e,US=cj,LS){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:gT,message:t}),this[US]=!0,this.functionality=e}static isInstance(e){return _e.hasMarker(e,vT)}};var a={};kn(a,{$brand:()=>Af,$input:()=>Yh,$output:()=>Kh,NEVER:()=>Mf,TimePrecision:()=>eg,ZodAny:()=>MI,ZodArray:()=>UI,ZodBase64:()=>lv,ZodBase64URL:()=>uv,ZodBigInt:()=>js,ZodBigIntFormat:()=>pv,ZodBoolean:()=>Ds,ZodCIDRv4:()=>av,ZodCIDRv6:()=>sv,ZodCUID:()=>Qg,ZodCUID2:()=>ev,ZodCatch:()=>i0,ZodCustom:()=>Dc,ZodCustomStringFormat:()=>EI,ZodDate:()=>Rc,ZodDefault:()=>QI,ZodDiscriminatedUnion:()=>LI,ZodE164:()=>cv,ZodEmail:()=>Gg,ZodEmoji:()=>Yg,ZodEnum:()=>Rs,ZodError:()=>GN,ZodFile:()=>YI,ZodGUID:()=>Sc,ZodIPv4:()=>ov,ZodIPv6:()=>iv,ZodISODate:()=>bc,ZodISODateTime:()=>_c,ZodISODuration:()=>xc,ZodISOTime:()=>wc,ZodIntersection:()=>FI,ZodIssueCode:()=>QM,ZodJWT:()=>dv,ZodKSUID:()=>nv,ZodLazy:()=>d0,ZodLiteral:()=>GI,ZodMap:()=>HI,ZodNaN:()=>s0,ZodNanoID:()=>Xg,ZodNever:()=>zI,ZodNonOptional:()=>_v,ZodNull:()=>jI,ZodNullable:()=>XI,ZodNumber:()=>Os,ZodNumberFormat:()=>ra,ZodObject:()=>Cc,ZodOptional:()=>yv,ZodPipe:()=>bv,ZodPrefault:()=>t0,ZodPromise:()=>f0,ZodReadonly:()=>l0,ZodRealError:()=>ta,ZodRecord:()=>hv,ZodSet:()=>JI,ZodString:()=>Cs,ZodStringFormat:()=>gt,ZodSuccess:()=>o0,ZodSymbol:()=>OI,ZodTemplateLiteral:()=>c0,ZodTransform:()=>gv,ZodTuple:()=>VI,ZodType:()=>Ue,ZodULID:()=>tv,ZodURL:()=>Kg,ZodUUID:()=>jn,ZodUndefined:()=>DI,ZodUnion:()=>mv,ZodUnknown:()=>AI,ZodVoid:()=>qI,ZodXID:()=>rv,_ZodString:()=>Bg,_default:()=>e0,any:()=>EM,array:()=>fv,base64:()=>hM,base64url:()=>gM,bigint:()=>SM,boolean:()=>CI,catch:()=>a0,check:()=>m0,cidrv4:()=>fM,cidrv6:()=>mM,clone:()=>Er,coerce:()=>wv,config:()=>jt,core:()=>Dn,cuid:()=>aM,cuid2:()=>sM,custom:()=>BM,date:()=>CM,discriminatedUnion:()=>MM,e164:()=>vM,email:()=>YN,emoji:()=>oM,endsWith:()=>bs,enum:()=>BI,file:()=>FM,flattenError:()=>is,float32:()=>bM,float64:()=>wM,formatError:()=>as,function:()=>zg,getErrorMap:()=>tA,globalRegistry:()=>hn,gt:()=>Cn,gte:()=>yr,guid:()=>XN,includes:()=>ys,instanceof:()=>GM,int:()=>Jg,int32:()=>xM,int64:()=>TM,intersection:()=>ZI,ipv4:()=>dM,ipv6:()=>pM,iso:()=>kc,json:()=>YM,jwt:()=>yM,keyof:()=>OM,ksuid:()=>cM,lazy:()=>p0,length:()=>ea,literal:()=>KI,locales:()=>ps,looseObject:()=>NM,lowercase:()=>gs,lt:()=>Rn,lte:()=>Zr,map:()=>qM,maxLength:()=>Qi,maxSize:()=>Xi,mime:()=>ws,minLength:()=>lo,minSize:()=>Fo,multipleOf:()=>Lo,nan:()=>WM,nanoid:()=>iM,nativeEnum:()=>LM,negative:()=>Pg,never:()=>Ec,nonnegative:()=>Rg,nonoptional:()=>n0,nonpositive:()=>Eg,normalize:()=>xs,null:()=>NI,nullable:()=>$c,nullish:()=>ZM,number:()=>RI,object:()=>DM,optional:()=>Ic,overwrite:()=>On,parse:()=>Zg,parseAsync:()=>Vg,partialRecord:()=>zM,pipe:()=>Pc,positive:()=>$g,prefault:()=>r0,preprocess:()=>XM,prettifyError:()=>Kf,promise:()=>JM,property:()=>Cg,readonly:()=>u0,record:()=>WI,refine:()=>h0,regex:()=>hs,regexes:()=>zo,registry:()=>Ku,safeParse:()=>Wg,safeParseAsync:()=>Es,set:()=>UM,setErrorMap:()=>eA,size:()=>ms,startsWith:()=>_s,strictObject:()=>jM,string:()=>Hg,stringFormat:()=>_M,stringbool:()=>KM,success:()=>VM,superRefine:()=>g0,symbol:()=>$M,templateLiteral:()=>HM,toJSONSchema:()=>Ps,toLowerCase:()=>Ss,toUpperCase:()=>Ts,transform:()=>vv,treeifyError:()=>Gf,trim:()=>ks,tuple:()=>AM,uint32:()=>kM,uint64:()=>IM,ulid:()=>lM,undefined:()=>PM,union:()=>Oc,unknown:()=>Tc,uppercase:()=>vs,url:()=>nM,uuid:()=>QN,uuidv4:()=>eM,uuidv6:()=>tM,uuidv7:()=>rM,void:()=>RM,xid:()=>uM});var Dn={};kn(Dn,{$ZodAny:()=>Sh,$ZodArray:()=>us,$ZodAsyncError:()=>mn,$ZodBase64:()=>mh,$ZodBase64URL:()=>hh,$ZodBigInt:()=>Ju,$ZodBigIntFormat:()=>bh,$ZodBoolean:()=>ls,$ZodCIDRv4:()=>dh,$ZodCIDRv6:()=>ph,$ZodCUID:()=>eh,$ZodCUID2:()=>th,$ZodCatch:()=>Zh,$ZodCheck:()=>$t,$ZodCheckBigIntFormat:()=>Rm,$ZodCheckEndsWith:()=>Fm,$ZodCheckGreaterThan:()=>Zu,$ZodCheckIncludes:()=>Um,$ZodCheckLengthEquals:()=>Mm,$ZodCheckLessThan:()=>Fu,$ZodCheckLowerCase:()=>zm,$ZodCheckMaxLength:()=>jm,$ZodCheckMaxSize:()=>Cm,$ZodCheckMimeType:()=>Vm,$ZodCheckMinLength:()=>Nm,$ZodCheckMinSize:()=>Om,$ZodCheckMultipleOf:()=>Pm,$ZodCheckNumberFormat:()=>Em,$ZodCheckOverwrite:()=>Wm,$ZodCheckProperty:()=>Zm,$ZodCheckRegex:()=>Am,$ZodCheckSizeEquals:()=>Dm,$ZodCheckStartsWith:()=>Lm,$ZodCheckStringFormat:()=>Bi,$ZodCheckUpperCase:()=>qm,$ZodCustom:()=>Gh,$ZodCustomStringFormat:()=>yh,$ZodDate:()=>$h,$ZodDefault:()=>qh,$ZodDiscriminatedUnion:()=>Eh,$ZodE164:()=>gh,$ZodEmail:()=>Km,$ZodEmoji:()=>Xm,$ZodEnum:()=>jh,$ZodError:()=>os,$ZodFile:()=>Mh,$ZodFunction:()=>yc,$ZodGUID:()=>Bm,$ZodIPv4:()=>uh,$ZodIPv6:()=>ch,$ZodISODate:()=>ah,$ZodISODateTime:()=>ih,$ZodISODuration:()=>lh,$ZodISOTime:()=>sh,$ZodIntersection:()=>Rh,$ZodJWT:()=>vh,$ZodKSUID:()=>oh,$ZodLazy:()=>Bh,$ZodLiteral:()=>Nh,$ZodMap:()=>Oh,$ZodNaN:()=>Vh,$ZodNanoID:()=>Qm,$ZodNever:()=>Th,$ZodNonOptional:()=>Lh,$ZodNull:()=>kh,$ZodNullable:()=>zh,$ZodNumber:()=>Hu,$ZodNumberFormat:()=>_h,$ZodObject:()=>Ph,$ZodOptional:()=>Ah,$ZodPipe:()=>ds,$ZodPrefault:()=>Uh,$ZodPromise:()=>Jh,$ZodReadonly:()=>Wh,$ZodRealError:()=>Ji,$ZodRecord:()=>Ch,$ZodRegistry:()=>Ki,$ZodSet:()=>Dh,$ZodString:()=>qo,$ZodStringFormat:()=>pt,$ZodSuccess:()=>Fh,$ZodSymbol:()=>wh,$ZodTemplateLiteral:()=>Hh,$ZodTransform:()=>cs,$ZodTuple:()=>Uo,$ZodType:()=>Ce,$ZodULID:()=>rh,$ZodURL:()=>Ym,$ZodUUID:()=>Gm,$ZodUndefined:()=>xh,$ZodUnion:()=>Bu,$ZodUnknown:()=>Gi,$ZodVoid:()=>Ih,$ZodXID:()=>nh,$brand:()=>Af,$constructor:()=>j,$input:()=>Yh,$output:()=>Kh,Doc:()=>ss,JSONSchema:()=>II,JSONSchemaGenerator:()=>$s,NEVER:()=>Mf,TimePrecision:()=>eg,_any:()=>wg,_array:()=>Is,_base64:()=>mc,_base64url:()=>hc,_bigint:()=>mg,_boolean:()=>pg,_catch:()=>FN,_cidrv4:()=>pc,_cidrv6:()=>fc,_coercedBigint:()=>hg,_coercedBoolean:()=>fg,_coercedDate:()=>Tg,_coercedNumber:()=>ag,_coercedString:()=>Qh,_cuid:()=>ic,_cuid2:()=>ac,_custom:()=>jg,_date:()=>Sg,_default:()=>qN,_discriminatedUnion:()=>PN,_e164:()=>gc,_email:()=>Yu,_emoji:()=>nc,_endsWith:()=>bs,_enum:()=>DN,_file:()=>Dg,_float32:()=>lg,_float64:()=>ug,_gt:()=>Cn,_gte:()=>yr,_guid:()=>fs,_includes:()=>ys,_int:()=>sg,_int32:()=>cg,_int64:()=>gg,_intersection:()=>EN,_ipv4:()=>cc,_ipv6:()=>dc,_isoDate:()=>rg,_isoDateTime:()=>tg,_isoDuration:()=>og,_isoTime:()=>ng,_jwt:()=>vc,_ksuid:()=>uc,_lazy:()=>HN,_length:()=>ea,_literal:()=>NN,_lowercase:()=>gs,_lt:()=>Rn,_lte:()=>Zr,_map:()=>CN,_max:()=>Zr,_maxLength:()=>Qi,_maxSize:()=>Xi,_mime:()=>ws,_min:()=>yr,_minLength:()=>lo,_minSize:()=>Fo,_multipleOf:()=>Lo,_nan:()=>Ig,_nanoid:()=>oc,_nativeEnum:()=>jN,_negative:()=>Pg,_never:()=>xg,_nonnegative:()=>Rg,_nonoptional:()=>UN,_nonpositive:()=>Eg,_normalize:()=>xs,_null:()=>bg,_nullable:()=>zN,_number:()=>ig,_optional:()=>AN,_overwrite:()=>On,_parse:()=>Nu,_parseAsync:()=>Au,_pipe:()=>ZN,_positive:()=>$g,_promise:()=>JN,_property:()=>Cg,_readonly:()=>VN,_record:()=>RN,_refine:()=>Ng,_regex:()=>hs,_safeParse:()=>qu,_safeParseAsync:()=>Uu,_set:()=>ON,_size:()=>ms,_startsWith:()=>_s,_string:()=>Xh,_stringFormat:()=>Ag,_stringbool:()=>Mg,_success:()=>LN,_symbol:()=>yg,_templateLiteral:()=>WN,_toLowerCase:()=>Ss,_toUpperCase:()=>Ts,_transform:()=>MN,_trim:()=>ks,_tuple:()=>Og,_uint32:()=>dg,_uint64:()=>vg,_ulid:()=>sc,_undefined:()=>_g,_union:()=>$N,_unknown:()=>Yi,_uppercase:()=>vs,_url:()=>rc,_uuid:()=>Xu,_uuidv4:()=>Qu,_uuidv6:()=>ec,_uuidv7:()=>tc,_void:()=>kg,_xid:()=>lc,clone:()=>Er,config:()=>jt,flattenError:()=>is,formatError:()=>as,function:()=>zg,globalConfig:()=>Ka,globalRegistry:()=>hn,isValidBase64:()=>fh,isValidBase64URL:()=>AT,isValidJWT:()=>zT,locales:()=>ps,parse:()=>Mu,parseAsync:()=>zu,prettifyError:()=>Kf,regexes:()=>zo,registry:()=>Ku,safeParse:()=>Yf,safeParseAsync:()=>Xf,toDotPath:()=>_T,toJSONSchema:()=>Ps,treeifyError:()=>Gf,util:()=>ce,version:()=>Hm});var Mf=Object.freeze({status:"aborted"});function j(e,t,n){function o(l,u){var c;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(c=l._zod).traits??(c.traits=new Set),l._zod.traits.add(e),t(l,u);for(let d in s.prototype)d in l||Object.defineProperty(l,d,{value:s.prototype[d].bind(l)});l._zod.constr=s,l._zod.def=u}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function s(l){var u;let c=n?.Parent?new i:this;o(c,l),(u=c._zod).deferred??(u.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Af=Symbol("zod_brand"),mn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ka={};function jt(e){return e&&Object.assign(Ka,e),Ka}var ce={};kn(ce,{BIGINT_FORMAT_RANGES:()=>Jf,Class:()=>qf,NUMBER_FORMAT_RANGES:()=>Hf,aborted:()=>Mo,allowsEval:()=>Zf,assert:()=>hj,assertEqual:()=>dj,assertIs:()=>fj,assertNever:()=>mj,assertNotEqual:()=>pj,assignProp:()=>Ff,cached:()=>Qa,captureStackTrace:()=>ju,cleanEnum:()=>Pj,cleanRegex:()=>es,clone:()=>Er,createTransparentProxy:()=>wj,defineLazy:()=>Qe,esc:()=>No,escapeRegex:()=>En,extend:()=>Sj,finalizeIssue:()=>Rr,floatSafeRemainder:()=>Lf,getElementAtPath:()=>gj,getEnumValues:()=>Xa,getLengthableOrigin:()=>ns,getParsedType:()=>bj,getSizableOrigin:()=>rs,isObject:()=>Wi,isPlainObject:()=>Hi,issue:()=>Bf,joinValues:()=>V,jsonStringifyReplacer:()=>Uf,merge:()=>Tj,normalizeParams:()=>ae,nullish:()=>so,numKeys:()=>_j,omit:()=>kj,optionalKeys:()=>Wf,partial:()=>Ij,pick:()=>xj,prefixIssues:()=>vr,primitiveTypes:()=>Vf,promiseAllObject:()=>vj,propertyKeyTypes:()=>ts,randomString:()=>yj,required:()=>$j,stringifyPrimitive:()=>ue,unwrapMessage:()=>Ya});function dj(e){return e}function pj(e){return e}function fj(e){}function mj(e){throw new Error}function hj(e){}function Xa(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function V(e,t="|"){return e.map(n=>ue(n)).join(t)}function Uf(e,t){return typeof t=="bigint"?t.toString():t}function Qa(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function so(e){return e==null}function es(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Lf(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}function Qe(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw new Error("cached value already set")},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ff(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function gj(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function vj(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i{};function Wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Zf=Qa(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Hi(e){if(Wi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Wi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _j(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var bj=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ts=new Set(["string","number","symbol"]),Vf=new Set(["string","number","bigint","boolean","symbol","undefined"]);function En(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function ae(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wj(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function ue(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Wf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Hf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xj(e,t){let n={},o=e._zod.def;for(let r in t){if(!(r in o.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(n[r]=o.shape[r])}return Er(e,{...e._zod.def,shape:n,checks:[]})}function kj(e,t){let n={...e._zod.def.shape},o=e._zod.def;for(let r in t){if(!(r in o.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete n[r]}return Er(e,{...e._zod.def,shape:n,checks:[]})}function Sj(e,t){if(!Hi(t))throw new Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return Ff(this,"shape",o),o},checks:[]};return Er(e,n)}function Tj(e,t){return Er(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ff(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function Ij(e,t,n){let o=t._zod.def.shape,r={...o};if(n)for(let i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(let i in o)r[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Er(t,{...t._zod.def,shape:r,checks:[]})}function $j(e,t,n){let o=t._zod.def.shape,r={...o};if(n)for(let i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(let i in o)r[i]=new e({type:"nonoptional",innerType:o[i]});return Er(t,{...t._zod.def,shape:r,checks:[]})}function Mo(e,t=0){for(let n=t;n{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Ya(e){return typeof e=="string"?e:e?.message}function Rr(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=Ya(e.inst?._zod.def?.error?.(e))??Ya(t?.error?.(e))??Ya(n.customError?.(e))??Ya(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function rs(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ns(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Bf(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function Pj(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var qf=class{constructor(...t){}};var yT=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Uf,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},os=j("$ZodError",yT),Ji=j("$ZodError",yT,{Parent:Error});function is(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function as(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>r({issues:l}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)o._errors.push(n(s));else{let l=o,u=0;for(;u{var l,u;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let d=[...s,...c.path];if(d.length===0){o.errors.push(n(c));continue}let m=o,_=0;for(;_o.path.length-r.path.length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${_T(o.path)}`);return t.join(` +`)}var Nu=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new mn;if(s.issues.length){let l=new(r?.Err??e)(s.issues.map(u=>Rr(u,i,jt())));throw ju(l,r?.callee),l}return s.value},Mu=Nu(Ji),Au=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let l=new(r?.Err??e)(s.issues.map(u=>Rr(u,i,jt())));throw ju(l,r?.callee),l}return s.value},zu=Au(Ji),qu=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new mn;return i.issues.length?{success:!1,error:new(e??os)(i.issues.map(s=>Rr(s,r,jt())))}:{success:!0,data:i.value}},Yf=qu(Ji),Uu=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Rr(s,r,jt())))}:{success:!0,data:i.value}},Xf=Uu(Ji);var zo={};kn(zo,{_emoji:()=>bT,base64:()=>fm,base64url:()=>Lu,bigint:()=>bm,boolean:()=>km,browserEmail:()=>Aj,cidrv4:()=>dm,cidrv6:()=>pm,cuid:()=>Qf,cuid2:()=>em,date:()=>gm,datetime:()=>ym,domain:()=>zj,duration:()=>im,e164:()=>hm,email:()=>sm,emoji:()=>lm,extendedDuration:()=>Rj,guid:()=>am,hostname:()=>mm,html5Email:()=>jj,integer:()=>wm,ipv4:()=>um,ipv6:()=>cm,ksuid:()=>nm,lowercase:()=>Im,nanoid:()=>om,null:()=>Sm,number:()=>xm,rfc5322Email:()=>Nj,string:()=>_m,time:()=>vm,ulid:()=>tm,undefined:()=>Tm,unicodeEmail:()=>Mj,uppercase:()=>$m,uuid:()=>Ao,uuid4:()=>Cj,uuid6:()=>Oj,uuid7:()=>Dj,xid:()=>rm});var Qf=/^[cC][^\s-]{8,}$/,em=/^[0-9a-z]+$/,tm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rm=/^[0-9a-vA-V]{20}$/,nm=/^[A-Za-z0-9]{27}$/,om=/^[a-zA-Z0-9_-]{21}$/,im=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,am=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ao=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Cj=Ao(4),Oj=Ao(6),Dj=Ao(7),sm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jj=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Nj=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Mj=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Aj=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,bT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function lm(){return new RegExp(bT,"u")}var um=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,dm=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,pm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lu=/^[A-Za-z0-9_-]*$/,mm=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,zj=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,hm=/^\+(?:[0-9]){6,14}[0-9]$/,wT="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gm=new RegExp(`^${wT}$`);function xT(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vm(e){return new RegExp(`^${xT(e)}$`)}function ym(e){let t=xT({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${wT}T(?:${o})$`)}var _m=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},bm=/^\d+n?$/,wm=/^\d+$/,xm=/^-?\d+(?:\.\d+)?/i,km=/true|false/i,Sm=/null/i;var Tm=/undefined/i;var Im=/^[^A-Z]*$/,$m=/^[^a-z]*$/;var $t=j("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ST={number:"number",bigint:"bigint",object:"date"},Fu=j("$ZodCheckLessThan",(e,t)=>{$t.init(e,t);let n=ST[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?o.value<=t.value:o.value{$t.init(e,t);let n=ST[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pm=j("$ZodCheckMultipleOf",(e,t)=>{$t.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Lf(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Em=j("$ZodCheckNumberFormat",(e,t)=>{$t.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=Hf[t.format];e._zod.onattach.push(s=>{let l=s._zod.bag;l.format=t.format,l.minimum=r,l.maximum=i,n&&(l.pattern=wm)}),e._zod.check=s=>{let l=s.value;if(n){if(!Number.isInteger(l)){s.issues.push({expected:o,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}li&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),Rm=j("$ZodCheckBigIntFormat",(e,t)=>{$t.init(e,t);let[n,o]=Jf[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;io&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Cm=j("$ZodCheckMaxSize",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!so(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{let r=o.value;r.size<=t.maximum||o.issues.push({origin:rs(r),code:"too_big",maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),Om=j("$ZodCheckMinSize",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!so(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:rs(r),code:"too_small",minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),Dm=j("$ZodCheckSizeEquals",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!so(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:rs(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),jm=j("$ZodCheckMaxLength",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!so(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{let r=o.value;if(r.length<=t.maximum)return;let s=ns(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nm=j("$ZodCheckMinLength",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!so(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let s=ns(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mm=j("$ZodCheckLengthEquals",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!so(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let s=ns(r),l=i>t.length;o.issues.push({origin:s,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Bi=j("$ZodCheckStringFormat",(e,t)=>{var n,o;$t.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Am=j("$ZodCheckRegex",(e,t)=>{Bi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),zm=j("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Im),Bi.init(e,t)}),qm=j("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$m),Bi.init(e,t)}),Um=j("$ZodCheckIncludes",(e,t)=>{$t.init(e,t);let n=En(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Lm=j("$ZodCheckStartsWith",(e,t)=>{$t.init(e,t);let n=new RegExp(`^${En(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Fm=j("$ZodCheckEndsWith",(e,t)=>{$t.init(e,t);let n=new RegExp(`.*${En(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function kT(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues))}var Zm=j("$ZodCheckProperty",(e,t)=>{$t.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>kT(r,n,t.property));kT(o,n,t.property)}}),Vm=j("$ZodCheckMimeType",(e,t)=>{$t.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e})}}),Wm=j("$ZodCheckOverwrite",(e,t)=>{$t.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ss=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(` `).filter(s=>s),r=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(` -`))}};var qm={major:4,minor:0,patch:0};var Re=j("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qm;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(i,s,l)=>{let u=jo(i),c;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,_=d._zod.check(i);if(_ instanceof Promise&&l?.async===!1)throw new fn;if(c||_ instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await _,i.issues.length!==m&&(u||(u=jo(i,m)))});else{if(i.issues.length===m)continue;u||(u=jo(i,m))}}return c?c.then(()=>i):i};e._zod.run=(i,s)=>{let l=e._zod.parse(i,s);if(l instanceof Promise){if(s.async===!1)throw new fn;return l.then(u=>r(u,o,s))}return r(l,o,s)}}e["~standard"]={validate:r=>{try{let i=Vf(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Wf(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Ao=j("$ZodString",(e,t)=>{Re.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pm(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pt=j("$ZodStringFormat",(e,t)=>{Hi.init(e,t),Ao.init(e,t)}),Lm=j("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Qf),pt.init(e,t)}),Fm=j("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=No(o))}else t.pattern??(t.pattern=No());pt.init(e,t)}),Zm=j("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=em),pt.init(e,t)}),Vm=j("$ZodURL",(e,t)=>{pt.init(e,t),e._zod.check=n=>{try{let o=n.value,r=new URL(o),i=r.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:sm.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!o.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Wm=j("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tm()),pt.init(e,t)}),Hm=j("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Yf),pt.init(e,t)}),Jm=j("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Hf),pt.init(e,t)}),Bm=j("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Jf),pt.init(e,t)}),Gm=j("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Bf),pt.init(e,t)}),Km=j("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Gf),pt.init(e,t)}),Ym=j("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Kf),pt.init(e,t)}),Xm=j("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=dm(t)),pt.init(e,t)}),Qm=j("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=um),pt.init(e,t)}),eh=j("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=cm(t)),pt.init(e,t)}),th=j("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Xf),pt.init(e,t)}),rh=j("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rm),pt.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv4"})}),nh=j("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=nm),pt.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),oh=j("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=om),pt.init(e,t)}),ih=j("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=im),pt.init(e,t),e._zod.check=n=>{let[o,r]=n.value.split("/");try{if(!r)throw new Error;let i=Number(r);if(`${i}`!==r)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ah(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var sh=j("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=am),pt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ah(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function bI(e){if(!qu.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ah(n)}var lh=j("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qu),pt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{bI(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),uh=j("$ZodE164",(e,t)=>{t.pattern??(t.pattern=lm),pt.init(e,t)});function wI(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var ch=j("$ZodJWT",(e,t)=>{pt.init(e,t),e._zod.check=n=>{wI(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),dh=j("$ZodCustomStringFormat",(e,t)=>{pt.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Vu=j("$ZodNumber",(e,t)=>{Re.init(e,t),e._zod.pattern=e._zod.bag.pattern??hm,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),ph=j("$ZodNumber",(e,t)=>{xm.init(e,t),Vu.init(e,t)}),ls=j("$ZodBoolean",(e,t)=>{Re.init(e,t),e._zod.pattern=gm,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Wu=j("$ZodBigInt",(e,t)=>{Re.init(e,t),e._zod.pattern=fm,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),fh=j("$ZodBigInt",(e,t)=>{km.init(e,t),Wu.init(e,t)}),mh=j("$ZodSymbol",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),hh=j("$ZodUndefined",(e,t)=>{Re.init(e,t),e._zod.pattern=ym,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),gh=j("$ZodNull",(e,t)=>{Re.init(e,t),e._zod.pattern=vm,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),vh=j("$ZodAny",(e,t)=>{Re.init(e,t),e._zod.parse=n=>n}),Ji=j("$ZodUnknown",(e,t)=>{Re.init(e,t),e._zod.parse=n=>n}),yh=j("$ZodNever",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),_h=j("$ZodVoid",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),bh=j("$ZodDate",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function uI(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues)),t.value[n]=e.value}var us=j("$ZodArray",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;suI(c,n,s))):uI(u,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Fu(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues)),t.value[n]=e.value}function cI(e,t,n,o){e.issues.length?o[n]===void 0?n in o?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...vr(n,e.issues)):e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}var wh=j("$ZodObject",(e,t)=>{Re.init(e,t);let n=Qa(()=>{let m=Object.keys(t.shape);for(let h of m)if(!(t.shape[h]instanceof Re))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);let _=zf(t.shape);return{shape:t.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(_)}});Qe(e._zod,"propValues",()=>{let m=t.shape,_={};for(let h in m){let b=m[h]._zod;if(b.values){_[h]??(_[h]=new Set);for(let k of b.values)_[h].add(k)}}return _});let o=m=>{let _=new ss(["shape","payload","ctx"]),h=n.value,b=g=>{let v=Do(g);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};_.write("const input = payload.value;");let k=Object.create(null),T=0;for(let g of h.keys)k[g]=`key_${T++}`;_.write("const newResult = {}");for(let g of h.keys)if(h.optionalKeys.has(g)){let v=k[g];_.write(`const ${v} = ${b(g)};`);let C=Do(g);_.write(` +`))}};var Hm={major:4,minor:0,patch:0};var Ce=j("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hm;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(i,s,l)=>{let u=Mo(i),c;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,_=d._zod.check(i);if(_ instanceof Promise&&l?.async===!1)throw new mn;if(c||_ instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await _,i.issues.length!==m&&(u||(u=Mo(i,m)))});else{if(i.issues.length===m)continue;u||(u=Mo(i,m))}}return c?c.then(()=>i):i};e._zod.run=(i,s)=>{let l=e._zod.parse(i,s);if(l instanceof Promise){if(s.async===!1)throw new mn;return l.then(u=>r(u,o,s))}return r(l,o,s)}}e["~standard"]={validate:r=>{try{let i=Yf(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Xf(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),qo=j("$ZodString",(e,t)=>{Ce.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_m(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pt=j("$ZodStringFormat",(e,t)=>{Bi.init(e,t),qo.init(e,t)}),Bm=j("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=am),pt.init(e,t)}),Gm=j("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ao(o))}else t.pattern??(t.pattern=Ao());pt.init(e,t)}),Km=j("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=sm),pt.init(e,t)}),Ym=j("$ZodURL",(e,t)=>{pt.init(e,t),e._zod.check=n=>{try{let o=n.value,r=new URL(o),i=r.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:mm.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!o.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Xm=j("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=lm()),pt.init(e,t)}),Qm=j("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=om),pt.init(e,t)}),eh=j("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Qf),pt.init(e,t)}),th=j("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=em),pt.init(e,t)}),rh=j("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tm),pt.init(e,t)}),nh=j("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rm),pt.init(e,t)}),oh=j("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nm),pt.init(e,t)}),ih=j("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ym(t)),pt.init(e,t)}),ah=j("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=gm),pt.init(e,t)}),sh=j("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vm(t)),pt.init(e,t)}),lh=j("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=im),pt.init(e,t)}),uh=j("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=um),pt.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv4"})}),ch=j("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=cm),pt.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),dh=j("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=dm),pt.init(e,t)}),ph=j("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pm),pt.init(e,t),e._zod.check=n=>{let[o,r]=n.value.split("/");try{if(!r)throw new Error;let i=Number(r);if(`${i}`!==r)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var mh=j("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=fm),pt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{fh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function AT(e){if(!Lu.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fh(n)}var hh=j("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Lu),pt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{AT(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),gh=j("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hm),pt.init(e,t)});function zT(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var vh=j("$ZodJWT",(e,t)=>{pt.init(e,t),e._zod.check=n=>{zT(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),yh=j("$ZodCustomStringFormat",(e,t)=>{pt.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Hu=j("$ZodNumber",(e,t)=>{Ce.init(e,t),e._zod.pattern=e._zod.bag.pattern??xm,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),_h=j("$ZodNumber",(e,t)=>{Em.init(e,t),Hu.init(e,t)}),ls=j("$ZodBoolean",(e,t)=>{Ce.init(e,t),e._zod.pattern=km,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Ju=j("$ZodBigInt",(e,t)=>{Ce.init(e,t),e._zod.pattern=bm,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),bh=j("$ZodBigInt",(e,t)=>{Rm.init(e,t),Ju.init(e,t)}),wh=j("$ZodSymbol",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),xh=j("$ZodUndefined",(e,t)=>{Ce.init(e,t),e._zod.pattern=Tm,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),kh=j("$ZodNull",(e,t)=>{Ce.init(e,t),e._zod.pattern=Sm,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Sh=j("$ZodAny",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),Gi=j("$ZodUnknown",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),Th=j("$ZodNever",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Ih=j("$ZodVoid",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),$h=j("$ZodDate",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function IT(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues)),t.value[n]=e.value}var us=j("$ZodArray",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;sIT(c,n,s))):IT(u,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Vu(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues)),t.value[n]=e.value}function $T(e,t,n,o){e.issues.length?o[n]===void 0?n in o?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...vr(n,e.issues)):e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}var Ph=j("$ZodObject",(e,t)=>{Ce.init(e,t);let n=Qa(()=>{let m=Object.keys(t.shape);for(let h of m)if(!(t.shape[h]instanceof Ce))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);let _=Wf(t.shape);return{shape:t.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(_)}});Qe(e._zod,"propValues",()=>{let m=t.shape,_={};for(let h in m){let b=m[h]._zod;if(b.values){_[h]??(_[h]=new Set);for(let k of b.values)_[h].add(k)}}return _});let o=m=>{let _=new ss(["shape","payload","ctx"]),h=n.value,b=g=>{let v=No(g);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};_.write("const input = payload.value;");let k=Object.create(null),I=0;for(let g of h.keys)k[g]=`key_${I++}`;_.write("const newResult = {}");for(let g of h.keys)if(h.optionalKeys.has(g)){let v=k[g];_.write(`const ${v} = ${b(g)};`);let R=No(g);_.write(` if (${v}.issues.length) { - if (input[${C}] === undefined) { - if (${C} in input) { - newResult[${C}] = undefined; + if (input[${R}] === undefined) { + if (${R} in input) { + newResult[${R}] = undefined; } } else { payload.issues = payload.issues.concat( ${v}.issues.map((iss) => ({ ...iss, - path: iss.path ? [${C}, ...iss.path] : [${C}], + path: iss.path ? [${R}, ...iss.path] : [${R}], })) ); } } else if (${v}.value === undefined) { - if (${C} in input) newResult[${C}] = undefined; + if (${R} in input) newResult[${R}] = undefined; } else { - newResult[${C}] = ${v}.value; + newResult[${R}] = ${v}.value; } `)}else{let v=k[g];_.write(`const ${v} = ${b(g)};`),_.write(` if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({ ...iss, - path: iss.path ? [${Do(g)}, ...iss.path] : [${Do(g)}] - })));`),_.write(`newResult[${Do(g)}] = ${v}.value`)}_.write("payload.value = newResult;"),_.write("return payload;");let R=_.compile();return(g,v)=>R(m,g,v)},r,i=Zi,s=!Ka.jitless,u=s&&Mf.value,c=t.catchall,d;e._zod.parse=(m,_)=>{d??(d=n.value);let h=m.value;if(!i(h))return m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m;let b=[];if(s&&u&&_?.async===!1&&_.jitless!==!0)r||(r=o(t.shape)),m=r(m,_);else{m.value={};let v=d.shape;for(let C of d.keys){let O=v[C],N=O._zod.run({value:h[C],issues:[]},_),K=O._zod.optin==="optional"&&O._zod.optout==="optional";N instanceof Promise?b.push(N.then(ee=>K?cI(ee,m,C,h):Fu(ee,m,C))):K?cI(N,m,C,h):Fu(N,m,C)}}if(!c)return b.length?Promise.all(b).then(()=>m):m;let k=[],T=d.keySet,R=c._zod,g=R.def.type;for(let v of Object.keys(h)){if(T.has(v))continue;if(g==="never"){k.push(v);continue}let C=R.run({value:h[v],issues:[]},_);C instanceof Promise?b.push(C.then(O=>Fu(O,m,v))):Fu(C,m,v)}return k.length&&m.issues.push({code:"unrecognized_keys",keys:k,input:h,inst:e}),b.length?Promise.all(b).then(()=>m):m}});function dI(e,t,n,o){for(let r of e)if(r.issues.length===0)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(i=>Cr(i,o,jt())))}),t}var Hu=j("$ZodUnion",(e,t)=>{Re.init(e,t),Qe(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Qe(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Qe(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Qe(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>es(o.source)).join("|")})$`)}}),e._zod.parse=(n,o)=>{let r=!1,i=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)i.push(l),r=!0;else{if(l.issues.length===0)return l;i.push(l)}}return r?Promise.all(i).then(s=>dI(s,n,e,o)):dI(i,n,e,o)}}),xh=j("$ZodDiscriminatedUnion",(e,t)=>{Hu.init(e,t);let n=e._zod.parse;Qe(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[l,u]of Object.entries(s)){r[l]||(r[l]=new Set);for(let c of u)r[l].add(c)}}return r});let o=Qa(()=>{let r=t.options,i=new Map;for(let s of r){let l=s._zod.propValues[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of l){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!Zi(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let l=o.value.get(s?.[t.discriminator]);return l?l._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),r)}}),kh=j("$ZodIntersection",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,c])=>pI(n,u,c)):pI(n,i,s)}});function Um(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vi(e)&&Vi(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=Um(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o{Re.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let l=[];if(!t.rest){let c=s.length>n.length,d=s.length=s.length&&u>=o)continue;let d=c._zod.run({value:s[u],issues:[]},i);d instanceof Promise?l.push(d.then(m=>Zu(m,r,u))):Zu(d,r,u)}if(t.rest){let c=s.slice(n.length);for(let d of c){u++;let m=t.rest._zod.run({value:d,issues:[]},i);m instanceof Promise?l.push(m.then(_=>Zu(_,r,u))):Zu(m,r,u)}}return l.length?Promise.all(l).then(()=>r):r}});function Zu(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues)),t.value[n]=e.value}var Sh=j("$ZodRecord",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Vi(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;n.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let c=t.valueType._zod.run({value:r[u],issues:[]},o);c instanceof Promise?i.push(c.then(d=>{d.issues.length&&n.issues.push(...vr(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...vr(u,c.issues)),n.value[u]=c.value)}let l;for(let u in r)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(c=>Cr(c,o,jt())),input:s,path:[s],inst:e}),n.value[l.value]=l.value;continue}let u=t.valueType._zod.run({value:r[s],issues:[]},o);u instanceof Promise?i.push(u.then(c=>{c.issues.length&&n.issues.push(...vr(s,c.issues)),n.value[l.value]=c.value})):(u.issues.length&&n.issues.push(...vr(s,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Ih=j("$ZodMap",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,l]of r){let u=t.keyType._zod.run({value:s,issues:[]},o),c=t.valueType._zod.run({value:l,issues:[]},o);u instanceof Promise||c instanceof Promise?i.push(Promise.all([u,c]).then(([d,m])=>{fI(d,m,n,s,r,e,o)})):fI(u,c,n,s,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function fI(e,t,n,o,r,i,s){e.issues.length&&(ts.has(typeof o)?n.issues.push(...vr(o,e.issues)):n.issues.push({origin:"map",code:"invalid_key",input:r,inst:i,issues:e.issues.map(l=>Cr(l,s,jt()))})),t.issues.length&&(ts.has(typeof o)?n.issues.push(...vr(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(l=>Cr(l,s,jt()))})),n.value.set(e.value,t.value)}var Th=j("$ZodSet",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let l=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(u=>mI(u,n))):mI(l,n)}return i.length?Promise.all(i).then(()=>n):n}});function mI(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var $h=j("$ZodEnum",(e,t)=>{Re.init(e,t);let n=Xa(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(o=>ts.has(typeof o)).map(o=>typeof o=="string"?Pn(o):o.toString()).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;return e._zod.values.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Ph=j("$ZodLiteral",(e,t)=>{Re.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Pn(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),Eh=j("$ZodFile",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),cs=j("$ZodTransform",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new fn;return n.value=r,n}}),Ch=j("$ZodOptional",(e,t)=>{Re.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Qe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Qe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${es(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,o):n.value===void 0?n:t.innerType._zod.run(n,o)}),Rh=j("$ZodNullable",(e,t)=>{Re.init(e,t),Qe(e._zod,"optin",()=>t.innerType._zod.optin),Qe(e._zod,"optout",()=>t.innerType._zod.optout),Qe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${es(n.source)}|null)$`):void 0}),Qe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Oh=j("$ZodDefault",(e,t)=>{Re.init(e,t),e._zod.optin="optional",Qe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>hI(i,t)):hI(r,t)}});function hI(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Dh=j("$ZodPrefault",(e,t)=>{Re.init(e,t),e._zod.optin="optional",Qe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),jh=j("$ZodNonOptional",(e,t)=>{Re.init(e,t),Qe(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>gI(i,e)):gI(r,e)}});function gI(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Nh=j("$ZodSuccess",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Mh=j("$ZodCatch",(e,t)=>{Re.init(e,t),e._zod.optin="optional",Qe(e._zod,"optout",()=>t.innerType._zod.optout),Qe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Cr(s,o,jt()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Cr(i,o,jt()))},input:n.value}),n.issues=[]),n)}}),Ah=j("$ZodNaN",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),ds=j("$ZodPipe",(e,t)=>{Re.init(e,t),Qe(e._zod,"values",()=>t.in._zod.values),Qe(e._zod,"optin",()=>t.in._zod.optin),Qe(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,o)=>{let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>vI(i,t,o)):vI(r,t,o)}});function vI(e,t,n){return jo(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var zh=j("$ZodReadonly",(e,t)=>{Re.init(e,t),Qe(e._zod,"propValues",()=>t.innerType._zod.propValues),Qe(e._zod,"values",()=>t.innerType._zod.values),Qe(e._zod,"optin",()=>t.innerType._zod.optin),Qe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(yI):yI(r)}});function yI(e){return e.value=Object.freeze(e.value),e}var qh=j("$ZodTemplateLiteral",(e,t)=>{Re.init(e,t);let n=[];for(let o of t.parts)if(o instanceof Re){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||Af.has(typeof o))n.push(Pn(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),o)}),Uh=j("$ZodPromise",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),Lh=j("$ZodLazy",(e,t)=>{Re.init(e,t),Qe(e._zod,"innerType",()=>t.getter()),Qe(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Qe(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Qe(e._zod,"optin",()=>e._zod.innerType._zod.optin),Qe(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),Fh=j("$ZodCustom",(e,t)=>{$t.init(e,t),Re.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>_I(i,n,o,e));_I(r,n,o,e)}});function _I(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Lf(r))}}var ps={};xn(ps,{ar:()=>kI,az:()=>SI,be:()=>TI,ca:()=>$I,cs:()=>PI,de:()=>EI,en:()=>Ju,eo:()=>CI,es:()=>RI,fa:()=>OI,fi:()=>DI,fr:()=>jI,frCA:()=>NI,he:()=>MI,hu:()=>AI,id:()=>zI,it:()=>qI,ja:()=>UI,kh:()=>LI,ko:()=>FI,mk:()=>ZI,ms:()=>VI,nl:()=>WI,no:()=>HI,ota:()=>JI,pl:()=>GI,ps:()=>BI,pt:()=>KI,ru:()=>XI,sl:()=>QI,sv:()=>eT,ta:()=>tT,th:()=>rT,tr:()=>nT,ua:()=>oT,ur:()=>iT,vi:()=>aT,zhCN:()=>sT,zhTW:()=>lT});var gj=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return r=>{switch(r.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${ue(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${o[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${V(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function kI(){return{localeError:gj()}}var vj=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ue(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function SI(){return{localeError:vj()}}function II(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}var yj=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0456\u045E";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${ue(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let l=Number(r.maximum),u=II(l,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let l=Number(r.minimum),u=II(l,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function TI(){return{localeError:yj()}}var _j=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${ue(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${V(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function $I(){return{localeError:_j()}}var bj=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${r.expected}, obdr\u017Eeno ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ue(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${V(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function PI(){return{localeError:bj()}}var wj=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${ue(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${V(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function EI(){return{localeError:wj()}}var xj=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},kj=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${xj(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${ue(o.values[0])}`:`Invalid option: expected one of ${V(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${V(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Ju(){return{localeError:kj()}}var Sj=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Ij=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${Sj(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${ue(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${V(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${V(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function CI(){return{localeError:Ij()}}var Tj=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"arreglo";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype)return r.constructor.name}}return i},o={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${r.expected}, recibido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${ue(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Demasiado grande: se esperaba que ${r.origin??"valor"} tuviera ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${r.origin??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Demasiado peque\xF1o: se esperaba que ${r.origin} tuviera ${i}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${r.origin} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r.origin}`;default:return"Entrada inv\xE1lida"}}};function RI(){return{localeError:Tj()}}var $j=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0622\u0631\u0627\u06CC\u0647";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return r=>{switch(r.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(r.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${ue(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${V(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${V(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function OI(){return{localeError:$j()}}var Pj=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${ue(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${V(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function DI(){return{localeError:Pj()}}var Ej=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : ${r.expected} attendu, ${n(r.input)} re\xE7u`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${ue(r.values[0])} attendu`:`Option invalide : une valeur parmi ${V(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${V(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function jI(){return{localeError:Ej()}}var Cj=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${r.expected}, re\xE7u ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${ue(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${V(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function NI(){return{localeError:Cj()}}var Rj=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return r=>{switch(r.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${r.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${ue(r.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${o[i.format]??r.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${r.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${r.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${r.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function MI(){return{localeError:Rj()}}var Oj=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(r))return"t\xF6mb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${r.expected}, a kapott \xE9rt\xE9k ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ue(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function AI(){return{localeError:Oj()}}var Dj=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${ue(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function zI(){return{localeError:Dj()}}var jj=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${ue(r.values[0])}`:`Opzione non valida: atteso uno tra ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${V(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function qI(){return{localeError:jj()}}var Nj=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(r))return"\u914D\u5217";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(r.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${ue(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${V(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${V(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function UI(){return{localeError:Nj()}}var Mj=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(r))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(r===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return r=>{switch(r.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${ue(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${V(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function LI(){return{localeError:Mj()}}var Aj=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return r=>{switch(r.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(r.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${ue(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${V(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(r.origin),u=l?.unit??"\uC694\uC18C";return l?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(r.origin),u=l?.unit??"\uC694\uC18C";return l?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${V(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function FI(){return{localeError:Aj()}}var zj=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(r))return"\u043D\u0438\u0437\u0430";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return r=>{switch(r.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${ue(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function ZI(){return{localeError:zj()}}var qj=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${ue(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${V(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function VI(){return{localeError:qj()}}var Uj=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${ue(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function WI(){return{localeError:Uj()}}var Lj=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${ue(r.values[0])}`:`Ugyldig valg: forventet en av ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${V(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function HI(){return{localeError:Lj()}}var Fj=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`F\xE2sit giren: umulan ${r.expected}, al\u0131nan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${ue(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function JI(){return{localeError:Fj()}}var Zj=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0627\u0631\u06D0";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return r=>{switch(r.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(r.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${ue(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${V(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function BI(){return{localeError:Zj()}}var Vj=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return r=>{switch(r.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${ue(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function GI(){return{localeError:Vj()}}var Wj=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${ue(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${o[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function KI(){return{localeError:Wj()}}function YI(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}var Hj=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${ue(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let l=Number(r.maximum),u=YI(l,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let l=Number(r.minimum),u=YI(l,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${V(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function XI(){return{localeError:Hj()}}var Jj=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${ue(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${V(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function QI(){return{localeError:Jj()}}var Bj=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${ue(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${V(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function eT(){return{localeError:Bj()}}var Gj=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(r))return"\u0B85\u0BA3\u0BBF";if(r===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${ue(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function tT(){return{localeError:Gj()}}var Kj=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(r))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(r===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return r=>{switch(r.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${ue(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${V(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function rT(){return{localeError:Kj()}}var Yj=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Xj=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${Yj(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ue(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${V(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Ge\xE7ersiz metin: "${r.prefix}" ile ba\u015Flamal\u0131`:r.format==="ends_with"?`Ge\xE7ersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Ge\xE7ersiz metin: "${r.includes}" i\xE7ermeli`:r.format==="regex"?`Ge\xE7ersiz metin: ${r.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${V(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function nT(){return{localeError:Xj()}}var Qj=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${ue(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${V(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function oT(){return{localeError:Qj()}}var eN=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(r))return"\u0622\u0631\u06D2";if(r===null)return"\u0646\u0644";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return r=>{switch(r.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(r.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${ue(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${V(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${V(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function iT(){return{localeError:eN()}}var tN=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(r))return"m\u1EA3ng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return r=>{switch(r.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${ue(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${o[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${V(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function aT(){return{localeError:tN()}}var rN=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(r))return"\u6570\u7EC4";if(r===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${ue(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${o[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function sT(){return{localeError:rN()}}var nN=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${r.expected}\uFF0C\u4F46\u6536\u5230 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ue(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${V(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function lT(){return{localeError:nN()}}var Zh=Symbol("ZodOutput"),Vh=Symbol("ZodInput"),Bi=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){let o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};return delete o.id,{...o,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};function Bu(){return new Bi}var mn=Bu();function Wh(e,t){return new e({type:"string",...ae(t)})}function Hh(e,t){return new e({type:"string",coerce:!0,...ae(t)})}function Gu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ae(t)})}function fs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ae(t)})}function Ku(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ae(t)})}function Yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ae(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ae(t)})}function Qu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ae(t)})}function ec(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ae(t)})}function tc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ae(t)})}function rc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ae(t)})}function nc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ae(t)})}function oc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ae(t)})}function ic(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ae(t)})}function ac(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ae(t)})}function sc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ae(t)})}function lc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ae(t)})}function uc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ae(t)})}function cc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ae(t)})}function dc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ae(t)})}function pc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ae(t)})}function fc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ae(t)})}function mc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ae(t)})}function hc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ae(t)})}var Jh={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Bh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ae(t)})}function Gh(e,t){return new e({type:"string",format:"date",check:"string_format",...ae(t)})}function Kh(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ae(t)})}function Yh(e,t){return new e({type:"string",format:"duration",check:"string_format",...ae(t)})}function Xh(e,t){return new e({type:"number",checks:[],...ae(t)})}function Qh(e,t){return new e({type:"number",coerce:!0,checks:[],...ae(t)})}function eg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ae(t)})}function tg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ae(t)})}function rg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ae(t)})}function ng(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ae(t)})}function og(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ae(t)})}function ig(e,t){return new e({type:"boolean",...ae(t)})}function ag(e,t){return new e({type:"boolean",coerce:!0,...ae(t)})}function sg(e,t){return new e({type:"bigint",...ae(t)})}function lg(e,t){return new e({type:"bigint",coerce:!0,...ae(t)})}function ug(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ae(t)})}function cg(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ae(t)})}function dg(e,t){return new e({type:"symbol",...ae(t)})}function pg(e,t){return new e({type:"undefined",...ae(t)})}function fg(e,t){return new e({type:"null",...ae(t)})}function mg(e){return new e({type:"any"})}function Gi(e){return new e({type:"unknown"})}function hg(e,t){return new e({type:"never",...ae(t)})}function gg(e,t){return new e({type:"void",...ae(t)})}function vg(e,t){return new e({type:"date",...ae(t)})}function yg(e,t){return new e({type:"date",coerce:!0,...ae(t)})}function _g(e,t){return new e({type:"nan",...ae(t)})}function En(e,t){return new Uu({check:"less_than",...ae(t),value:e,inclusive:!1})}function Fr(e,t){return new Uu({check:"less_than",...ae(t),value:e,inclusive:!0})}function Cn(e,t){return new Lu({check:"greater_than",...ae(t),value:e,inclusive:!1})}function yr(e,t){return new Lu({check:"greater_than",...ae(t),value:e,inclusive:!0})}function bg(e){return Cn(0,e)}function wg(e){return En(0,e)}function xg(e){return Fr(0,e)}function kg(e){return yr(0,e)}function qo(e,t){return new wm({check:"multiple_of",...ae(t),value:e})}function Ki(e,t){return new Sm({check:"max_size",...ae(t),maximum:e})}function Uo(e,t){return new Im({check:"min_size",...ae(t),minimum:e})}function ms(e,t){return new Tm({check:"size_equals",...ae(t),size:e})}function Yi(e,t){return new $m({check:"max_length",...ae(t),maximum:e})}function ao(e,t){return new Pm({check:"min_length",...ae(t),minimum:e})}function Xi(e,t){return new Em({check:"length_equals",...ae(t),length:e})}function hs(e,t){return new Cm({check:"string_format",format:"regex",...ae(t),pattern:e})}function gs(e){return new Rm({check:"string_format",format:"lowercase",...ae(e)})}function vs(e){return new Om({check:"string_format",format:"uppercase",...ae(e)})}function ys(e,t){return new Dm({check:"string_format",format:"includes",...ae(t),includes:e})}function _s(e,t){return new jm({check:"string_format",format:"starts_with",...ae(t),prefix:e})}function bs(e,t){return new Nm({check:"string_format",format:"ends_with",...ae(t),suffix:e})}function Sg(e,t,n){return new Mm({check:"property",property:e,schema:t,...ae(n)})}function ws(e,t){return new Am({check:"mime_type",mime:e,...ae(t)})}function Rn(e){return new zm({check:"overwrite",tx:e})}function xs(e){return Rn(t=>t.normalize(e))}function ks(){return Rn(e=>e.trim())}function Ss(){return Rn(e=>e.toLowerCase())}function Is(){return Rn(e=>e.toUpperCase())}function Ts(e,t,n){return new e({type:"array",element:t,...ae(n)})}function oN(e,t,n){return new e({type:"union",options:t,...ae(n)})}function iN(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...ae(o)})}function aN(e,t,n){return new e({type:"intersection",left:t,right:n})}function Ig(e,t,n,o){let r=n instanceof Re,i=r?o:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...ae(i)})}function sN(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...ae(o)})}function lN(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...ae(o)})}function uN(e,t,n){return new e({type:"set",valueType:t,...ae(n)})}function cN(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...ae(n)})}function dN(e,t,n){return new e({type:"enum",entries:t,...ae(n)})}function pN(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ae(n)})}function Tg(e,t){return new e({type:"file",...ae(t)})}function fN(e,t){return new e({type:"transform",transform:t})}function mN(e,t){return new e({type:"optional",innerType:t})}function hN(e,t){return new e({type:"nullable",innerType:t})}function gN(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():n}})}function vN(e,t,n){return new e({type:"nonoptional",innerType:t,...ae(n)})}function yN(e,t){return new e({type:"success",innerType:t})}function _N(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function bN(e,t,n){return new e({type:"pipe",in:t,out:n})}function wN(e,t){return new e({type:"readonly",innerType:t})}function xN(e,t,n){return new e({type:"template_literal",parts:t,...ae(n)})}function kN(e,t){return new e({type:"lazy",getter:t})}function SN(e,t){return new e({type:"promise",innerType:t})}function $g(e,t,n){let o=ae(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Pg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ae(n)})}function Eg(e,t){let n=ae(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(b=>typeof b=="string"?b.toLowerCase():b),r=r.map(b=>typeof b=="string"?b.toLowerCase():b));let i=new Set(o),s=new Set(r),l=e.Pipe??ds,u=e.Boolean??ls,c=e.String??Ao,d=e.Transform??cs,m=new d({type:"transform",transform:(b,k)=>{let T=b;return n.case!=="sensitive"&&(T=T.toLowerCase()),i.has(T)?!0:s.has(T)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:k.value,inst:m}),{})},error:n.error}),_=new l({type:"pipe",in:new c({type:"string",error:n.error}),out:m,error:n.error});return new l({type:"pipe",in:_,out:new u({type:"boolean",error:n.error}),error:n.error})}function Cg(e,t,n,o={}){let r=ae(o),i={...ae(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:l=>n.test(l),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var gc=class{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let n=((...o)=>{let r=this._def.input?ju(this._def.input,o,void 0,{callee:n}):o;if(!Array.isArray(r))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=t(...r);return this._def.output?ju(this._def.output,i,void 0,{callee:n}):i});return n}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let n=(async(...o)=>{let r=this._def.input?await Mu(this._def.input,o,void 0,{callee:n}):o;if(!Array.isArray(r))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=await t(...r);return this._def.output?Mu(this._def.output,i,void 0,{callee:n}):i});return n}input(...t){let n=this.constructor;return Array.isArray(t[0])?new n({type:"function",input:new zo({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new n({type:"function",input:t[0],output:this._def.output})}output(t){let n=this.constructor;return new n({type:"function",input:this._def.input,output:t})}};function Rg(e){return new gc({type:"function",input:Array.isArray(e?.input)?Ig(zo,e?.input):e?.input??Ts(us,Gi(Ji)),output:e?.output??Gi(Ji)})}var $s=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??mn,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;let l={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,l);let u=t._zod.toJSONSchema?.();if(u)l.schema=u;else{let m={...n,schemaPath:[...n.schemaPath,t],path:n.path},_=t._zod.parent;if(_)l.ref=_,this.process(_,m),this.seen.get(_).isParent=!0;else{let h=l.schema;switch(r.type){case"string":{let b=h;b.type="string";let{minimum:k,maximum:T,format:R,patterns:g,contentEncoding:v}=t._zod.bag;if(typeof k=="number"&&(b.minLength=k),typeof T=="number"&&(b.maxLength=T),R&&(b.format=i[R]??R,b.format===""&&delete b.format),v&&(b.contentEncoding=v),g&&g.size>0){let C=[...g];C.length===1?b.pattern=C[0].source:C.length>1&&(l.schema.allOf=[...C.map(O=>({...this.target==="draft-7"?{type:"string"}:{},pattern:O.source}))])}break}case"number":{let b=h,{minimum:k,maximum:T,format:R,multipleOf:g,exclusiveMaximum:v,exclusiveMinimum:C}=t._zod.bag;typeof R=="string"&&R.includes("int")?b.type="integer":b.type="number",typeof C=="number"&&(b.exclusiveMinimum=C),typeof k=="number"&&(b.minimum=k,typeof C=="number"&&(C>=k?delete b.minimum:delete b.exclusiveMinimum)),typeof v=="number"&&(b.exclusiveMaximum=v),typeof T=="number"&&(b.maximum=T,typeof v=="number"&&(v<=T?delete b.maximum:delete b.exclusiveMaximum)),typeof g=="number"&&(b.multipleOf=g);break}case"boolean":{let b=h;b.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{h.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{h.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let b=h,{minimum:k,maximum:T}=t._zod.bag;typeof k=="number"&&(b.minItems=k),typeof T=="number"&&(b.maxItems=T),b.type="array",b.items=this.process(r.element,{...m,path:[...m.path,"items"]});break}case"object":{let b=h;b.type="object",b.properties={};let k=r.shape;for(let g in k)b.properties[g]=this.process(k[g],{...m,path:[...m.path,"properties",g]});let T=new Set(Object.keys(k)),R=new Set([...T].filter(g=>{let v=r.shape[g]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));R.size>0&&(b.required=Array.from(R)),r.catchall?._zod.def.type==="never"?b.additionalProperties=!1:r.catchall?r.catchall&&(b.additionalProperties=this.process(r.catchall,{...m,path:[...m.path,"additionalProperties"]})):this.io==="output"&&(b.additionalProperties=!1);break}case"union":{let b=h;b.anyOf=r.options.map((k,T)=>this.process(k,{...m,path:[...m.path,"anyOf",T]}));break}case"intersection":{let b=h,k=this.process(r.left,{...m,path:[...m.path,"allOf",0]}),T=this.process(r.right,{...m,path:[...m.path,"allOf",1]}),R=v=>"allOf"in v&&Object.keys(v).length===1,g=[...R(k)?k.allOf:[k],...R(T)?T.allOf:[T]];b.allOf=g;break}case"tuple":{let b=h;b.type="array";let k=r.items.map((g,v)=>this.process(g,{...m,path:[...m.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?b.prefixItems=k:b.items=k,r.rest){let g=this.process(r.rest,{...m,path:[...m.path,"items"]});this.target==="draft-2020-12"?b.items=g:b.additionalItems=g}r.rest&&(b.items=this.process(r.rest,{...m,path:[...m.path,"items"]}));let{minimum:T,maximum:R}=t._zod.bag;typeof T=="number"&&(b.minItems=T),typeof R=="number"&&(b.maxItems=R);break}case"record":{let b=h;b.type="object",b.propertyNames=this.process(r.keyType,{...m,path:[...m.path,"propertyNames"]}),b.additionalProperties=this.process(r.valueType,{...m,path:[...m.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let b=h,k=Xa(r.entries);k.every(T=>typeof T=="number")&&(b.type="number"),k.every(T=>typeof T=="string")&&(b.type="string"),b.enum=k;break}case"literal":{let b=h,k=[];for(let T of r.values)if(T===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof T=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");k.push(Number(T))}else k.push(T);if(k.length!==0)if(k.length===1){let T=k[0];b.type=T===null?"null":typeof T,b.const=T}else k.every(T=>typeof T=="number")&&(b.type="number"),k.every(T=>typeof T=="string")&&(b.type="string"),k.every(T=>typeof T=="boolean")&&(b.type="string"),k.every(T=>T===null)&&(b.type="null"),b.enum=k;break}case"file":{let b=h,k={type:"string",format:"binary",contentEncoding:"binary"},{minimum:T,maximum:R,mime:g}=t._zod.bag;T!==void 0&&(k.minLength=T),R!==void 0&&(k.maxLength=R),g?g.length===1?(k.contentMediaType=g[0],Object.assign(b,k)):b.anyOf=g.map(v=>({...k,contentMediaType:v})):Object.assign(b,k);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let b=this.process(r.innerType,m);h.anyOf=[b,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,m),l.ref=r.innerType;break}case"success":{let b=h;b.type="boolean";break}case"default":{this.process(r.innerType,m),l.ref=r.innerType,h.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,m),l.ref=r.innerType,this.io==="input"&&(h._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,m),l.ref=r.innerType;let b;try{b=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}h.default=b;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let b=h,k=t._zod.pattern;if(!k)throw new Error("Pattern not found in template literal");b.type="string",b.pattern=k.source;break}case"pipe":{let b=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(b,m),l.ref=b;break}case"readonly":{this.process(r.innerType,m),l.ref=r.innerType,h.readOnly=!0;break}case"promise":{this.process(r.innerType,m),l.ref=r.innerType;break}case"optional":{this.process(r.innerType,m),l.ref=r.innerType;break}case"lazy":{let b=t._zod.innerType;this.process(b,m),l.ref=b;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(t);return c&&Object.assign(l.schema,c),this.io==="input"&&At(t)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((o=l.schema).default??(o.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(t).schema}emit(t,n){let o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=d=>{let m=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let k=o.external.registry.get(d[0])?.id,T=o.external.uri??(g=>g);if(k)return{ref:T(k)};let R=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=R,{defId:R,ref:`${T("__shared")}#/${m}/${R}`}}if(d[1]===r)return{ref:"#"};let h=`#/${m}/`,b=d[1].schema.id??`__schema${this.counter++}`;return{defId:b,ref:h+b}},s=d=>{if(d[1].schema.$ref)return;let m=d[1],{ref:_,defId:h}=i(d);m.def={...m.schema},h&&(m.defId=h);let b=m.schema;for(let k in b)delete b[k];b.$ref=_};if(o.cycles==="throw")for(let d of this.seen.entries()){let m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/ + path: iss.path ? [${No(g)}, ...iss.path] : [${No(g)}] + })));`),_.write(`newResult[${No(g)}] = ${v}.value`)}_.write("payload.value = newResult;"),_.write("return payload;");let C=_.compile();return(g,v)=>C(m,g,v)},r,i=Wi,s=!Ka.jitless,u=s&&Zf.value,c=t.catchall,d;e._zod.parse=(m,_)=>{d??(d=n.value);let h=m.value;if(!i(h))return m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m;let b=[];if(s&&u&&_?.async===!1&&_.jitless!==!0)r||(r=o(t.shape)),m=r(m,_);else{m.value={};let v=d.shape;for(let R of d.keys){let O=v[R],N=O._zod.run({value:h[R],issues:[]},_),K=O._zod.optin==="optional"&&O._zod.optout==="optional";N instanceof Promise?b.push(N.then(ee=>K?$T(ee,m,R,h):Vu(ee,m,R))):K?$T(N,m,R,h):Vu(N,m,R)}}if(!c)return b.length?Promise.all(b).then(()=>m):m;let k=[],I=d.keySet,C=c._zod,g=C.def.type;for(let v of Object.keys(h)){if(I.has(v))continue;if(g==="never"){k.push(v);continue}let R=C.run({value:h[v],issues:[]},_);R instanceof Promise?b.push(R.then(O=>Vu(O,m,v))):Vu(R,m,v)}return k.length&&m.issues.push({code:"unrecognized_keys",keys:k,input:h,inst:e}),b.length?Promise.all(b).then(()=>m):m}});function PT(e,t,n,o){for(let r of e)if(r.issues.length===0)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(i=>Rr(i,o,jt())))}),t}var Bu=j("$ZodUnion",(e,t)=>{Ce.init(e,t),Qe(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Qe(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Qe(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Qe(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>es(o.source)).join("|")})$`)}}),e._zod.parse=(n,o)=>{let r=!1,i=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)i.push(l),r=!0;else{if(l.issues.length===0)return l;i.push(l)}}return r?Promise.all(i).then(s=>PT(s,n,e,o)):PT(i,n,e,o)}}),Eh=j("$ZodDiscriminatedUnion",(e,t)=>{Bu.init(e,t);let n=e._zod.parse;Qe(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[l,u]of Object.entries(s)){r[l]||(r[l]=new Set);for(let c of u)r[l].add(c)}}return r});let o=Qa(()=>{let r=t.options,i=new Map;for(let s of r){let l=s._zod.propValues[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of l){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!Wi(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let l=o.value.get(s?.[t.discriminator]);return l?l._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),r)}}),Rh=j("$ZodIntersection",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,c])=>ET(n,u,c)):ET(n,i,s)}});function Jm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Hi(e)&&Hi(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=Jm(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o{Ce.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let l=[];if(!t.rest){let c=s.length>n.length,d=s.length=s.length&&u>=o)continue;let d=c._zod.run({value:s[u],issues:[]},i);d instanceof Promise?l.push(d.then(m=>Wu(m,r,u))):Wu(d,r,u)}if(t.rest){let c=s.slice(n.length);for(let d of c){u++;let m=t.rest._zod.run({value:d,issues:[]},i);m instanceof Promise?l.push(m.then(_=>Wu(_,r,u))):Wu(m,r,u)}}return l.length?Promise.all(l).then(()=>r):r}});function Wu(e,t,n){e.issues.length&&t.issues.push(...vr(n,e.issues)),t.value[n]=e.value}var Ch=j("$ZodRecord",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Hi(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;n.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let c=t.valueType._zod.run({value:r[u],issues:[]},o);c instanceof Promise?i.push(c.then(d=>{d.issues.length&&n.issues.push(...vr(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...vr(u,c.issues)),n.value[u]=c.value)}let l;for(let u in r)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(c=>Rr(c,o,jt())),input:s,path:[s],inst:e}),n.value[l.value]=l.value;continue}let u=t.valueType._zod.run({value:r[s],issues:[]},o);u instanceof Promise?i.push(u.then(c=>{c.issues.length&&n.issues.push(...vr(s,c.issues)),n.value[l.value]=c.value})):(u.issues.length&&n.issues.push(...vr(s,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Oh=j("$ZodMap",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,l]of r){let u=t.keyType._zod.run({value:s,issues:[]},o),c=t.valueType._zod.run({value:l,issues:[]},o);u instanceof Promise||c instanceof Promise?i.push(Promise.all([u,c]).then(([d,m])=>{RT(d,m,n,s,r,e,o)})):RT(u,c,n,s,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function RT(e,t,n,o,r,i,s){e.issues.length&&(ts.has(typeof o)?n.issues.push(...vr(o,e.issues)):n.issues.push({origin:"map",code:"invalid_key",input:r,inst:i,issues:e.issues.map(l=>Rr(l,s,jt()))})),t.issues.length&&(ts.has(typeof o)?n.issues.push(...vr(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(l=>Rr(l,s,jt()))})),n.value.set(e.value,t.value)}var Dh=j("$ZodSet",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let l=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(u=>CT(u,n))):CT(l,n)}return i.length?Promise.all(i).then(()=>n):n}});function CT(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var jh=j("$ZodEnum",(e,t)=>{Ce.init(e,t);let n=Xa(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(o=>ts.has(typeof o)).map(o=>typeof o=="string"?En(o):o.toString()).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;return e._zod.values.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Nh=j("$ZodLiteral",(e,t)=>{Ce.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?En(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),Mh=j("$ZodFile",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),cs=j("$ZodTransform",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new mn;return n.value=r,n}}),Ah=j("$ZodOptional",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Qe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Qe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${es(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,o):n.value===void 0?n:t.innerType._zod.run(n,o)}),zh=j("$ZodNullable",(e,t)=>{Ce.init(e,t),Qe(e._zod,"optin",()=>t.innerType._zod.optin),Qe(e._zod,"optout",()=>t.innerType._zod.optout),Qe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${es(n.source)}|null)$`):void 0}),Qe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),qh=j("$ZodDefault",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",Qe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>OT(i,t)):OT(r,t)}});function OT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Uh=j("$ZodPrefault",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",Qe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),Lh=j("$ZodNonOptional",(e,t)=>{Ce.init(e,t),Qe(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>DT(i,e)):DT(r,e)}});function DT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Fh=j("$ZodSuccess",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Zh=j("$ZodCatch",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",Qe(e._zod,"optout",()=>t.innerType._zod.optout),Qe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Rr(s,o,jt()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Rr(i,o,jt()))},input:n.value}),n.issues=[]),n)}}),Vh=j("$ZodNaN",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),ds=j("$ZodPipe",(e,t)=>{Ce.init(e,t),Qe(e._zod,"values",()=>t.in._zod.values),Qe(e._zod,"optin",()=>t.in._zod.optin),Qe(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,o)=>{let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>jT(i,t,o)):jT(r,t,o)}});function jT(e,t,n){return Mo(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var Wh=j("$ZodReadonly",(e,t)=>{Ce.init(e,t),Qe(e._zod,"propValues",()=>t.innerType._zod.propValues),Qe(e._zod,"values",()=>t.innerType._zod.values),Qe(e._zod,"optin",()=>t.innerType._zod.optin),Qe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(NT):NT(r)}});function NT(e){return e.value=Object.freeze(e.value),e}var Hh=j("$ZodTemplateLiteral",(e,t)=>{Ce.init(e,t);let n=[];for(let o of t.parts)if(o instanceof Ce){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||Vf.has(typeof o))n.push(En(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),o)}),Jh=j("$ZodPromise",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),Bh=j("$ZodLazy",(e,t)=>{Ce.init(e,t),Qe(e._zod,"innerType",()=>t.getter()),Qe(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Qe(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Qe(e._zod,"optin",()=>e._zod.innerType._zod.optin),Qe(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),Gh=j("$ZodCustom",(e,t)=>{$t.init(e,t),Ce.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>MT(i,n,o,e));MT(r,n,o,e)}});function MT(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Bf(r))}}var ps={};kn(ps,{ar:()=>UT,az:()=>LT,be:()=>ZT,ca:()=>VT,cs:()=>WT,de:()=>HT,en:()=>Gu,eo:()=>JT,es:()=>BT,fa:()=>GT,fi:()=>KT,fr:()=>YT,frCA:()=>XT,he:()=>QT,hu:()=>eI,id:()=>tI,it:()=>rI,ja:()=>nI,kh:()=>oI,ko:()=>iI,mk:()=>aI,ms:()=>sI,nl:()=>lI,no:()=>uI,ota:()=>cI,pl:()=>pI,ps:()=>dI,pt:()=>fI,ru:()=>hI,sl:()=>gI,sv:()=>vI,ta:()=>yI,th:()=>_I,tr:()=>bI,ua:()=>wI,ur:()=>xI,vi:()=>kI,zhCN:()=>SI,zhTW:()=>TI});var qj=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return r=>{switch(r.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${ue(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${o[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${V(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function UT(){return{localeError:qj()}}var Uj=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ue(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function LT(){return{localeError:Uj()}}function FT(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}var Lj=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0456\u045E";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${ue(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let l=Number(r.maximum),u=FT(l,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let l=Number(r.minimum),u=FT(l,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function ZT(){return{localeError:Lj()}}var Fj=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${ue(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${V(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function VT(){return{localeError:Fj()}}var Zj=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${r.expected}, obdr\u017Eeno ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ue(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${V(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function WT(){return{localeError:Zj()}}var Vj=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${ue(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${V(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function HT(){return{localeError:Vj()}}var Wj=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Hj=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${Wj(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${ue(o.values[0])}`:`Invalid option: expected one of ${V(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${V(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Gu(){return{localeError:Hj()}}var Jj=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Bj=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${Jj(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${ue(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${V(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${V(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function JT(){return{localeError:Bj()}}var Gj=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"arreglo";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype)return r.constructor.name}}return i},o={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${r.expected}, recibido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${ue(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Demasiado grande: se esperaba que ${r.origin??"valor"} tuviera ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${r.origin??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Demasiado peque\xF1o: se esperaba que ${r.origin} tuviera ${i}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${r.origin} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r.origin}`;default:return"Entrada inv\xE1lida"}}};function BT(){return{localeError:Gj()}}var Kj=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0622\u0631\u0627\u06CC\u0647";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return r=>{switch(r.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(r.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${ue(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${V(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${V(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function GT(){return{localeError:Kj()}}var Yj=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${ue(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${V(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function KT(){return{localeError:Yj()}}var Xj=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : ${r.expected} attendu, ${n(r.input)} re\xE7u`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${ue(r.values[0])} attendu`:`Option invalide : une valeur parmi ${V(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${V(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function YT(){return{localeError:Xj()}}var Qj=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${r.expected}, re\xE7u ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${ue(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${V(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function XT(){return{localeError:Qj()}}var eN=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return r=>{switch(r.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${r.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${ue(r.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${o[i.format]??r.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${r.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${r.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${r.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function QT(){return{localeError:eN()}}var tN=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(r))return"t\xF6mb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${r.expected}, a kapott \xE9rt\xE9k ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ue(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function eI(){return{localeError:tN()}}var rN=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${ue(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function tI(){return{localeError:rN()}}var nN=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${ue(r.values[0])}`:`Opzione non valida: atteso uno tra ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${V(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function rI(){return{localeError:nN()}}var oN=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(r))return"\u914D\u5217";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(r.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${ue(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${V(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${V(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function nI(){return{localeError:oN()}}var iN=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(r))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(r===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return r=>{switch(r.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${ue(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${V(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function oI(){return{localeError:iN()}}var aN=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return r=>{switch(r.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(r.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${ue(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${V(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(r.origin),u=l?.unit??"\uC694\uC18C";return l?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(r.origin),u=l?.unit??"\uC694\uC18C";return l?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${V(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function iI(){return{localeError:aN()}}var sN=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(r))return"\u043D\u0438\u0437\u0430";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return r=>{switch(r.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${ue(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function aI(){return{localeError:sN()}}var lN=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${ue(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${V(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function sI(){return{localeError:lN()}}var uN=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${ue(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function lI(){return{localeError:uN()}}var cN=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${ue(r.values[0])}`:`Ugyldig valg: forventet en av ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${V(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function uI(){return{localeError:cN()}}var dN=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`F\xE2sit giren: umulan ${r.expected}, al\u0131nan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${ue(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function cI(){return{localeError:dN()}}var pN=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0627\u0631\u06D0";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return r=>{switch(r.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(r.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${ue(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${V(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${V(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function dI(){return{localeError:pN()}}var fN=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return r=>{switch(r.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${ue(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function pI(){return{localeError:fN()}}var mN=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${ue(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${o[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${V(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function fI(){return{localeError:mN()}}function mI(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}var hN=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${ue(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let l=Number(r.maximum),u=mI(l,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let l=Number(r.minimum),u=mI(l,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${V(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function hI(){return{localeError:hN()}}var gN=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${ue(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${V(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function gI(){return{localeError:gN()}}var vN=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${ue(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${V(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function vI(){return{localeError:vN()}}var yN=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(r))return"\u0B85\u0BA3\u0BBF";if(r===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${ue(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function yI(){return{localeError:yN()}}var _N=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(r))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(r===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return r=>{switch(r.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${ue(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${V(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function _I(){return{localeError:_N()}}var bN=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},wN=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${bN(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ue(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${V(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Ge\xE7ersiz metin: "${r.prefix}" ile ba\u015Flamal\u0131`:r.format==="ends_with"?`Ge\xE7ersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Ge\xE7ersiz metin: "${r.includes}" i\xE7ermeli`:r.format==="regex"?`Ge\xE7ersiz metin: ${r.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${V(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function bI(){return{localeError:wN()}}var xN=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${ue(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${V(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function wI(){return{localeError:xN()}}var kN=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(r))return"\u0622\u0631\u06D2";if(r===null)return"\u0646\u0644";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return r=>{switch(r.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(r.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${ue(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${V(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${V(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function xI(){return{localeError:kN()}}var SN=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(r))return"m\u1EA3ng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return r=>{switch(r.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${ue(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${o[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${V(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function kI(){return{localeError:SN()}}var TN=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(r))return"\u6570\u7EC4";if(r===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${ue(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${o[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${V(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function SI(){return{localeError:TN()}}var IN=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${r.expected}\uFF0C\u4F46\u6536\u5230 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ue(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${V(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${V(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function TI(){return{localeError:IN()}}var Kh=Symbol("ZodOutput"),Yh=Symbol("ZodInput"),Ki=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){let o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};return delete o.id,{...o,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};function Ku(){return new Ki}var hn=Ku();function Xh(e,t){return new e({type:"string",...ae(t)})}function Qh(e,t){return new e({type:"string",coerce:!0,...ae(t)})}function Yu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ae(t)})}function fs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ae(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ae(t)})}function Qu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ae(t)})}function ec(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ae(t)})}function tc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ae(t)})}function rc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ae(t)})}function nc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ae(t)})}function oc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ae(t)})}function ic(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ae(t)})}function ac(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ae(t)})}function sc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ae(t)})}function lc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ae(t)})}function uc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ae(t)})}function cc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ae(t)})}function dc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ae(t)})}function pc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ae(t)})}function fc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ae(t)})}function mc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ae(t)})}function hc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ae(t)})}function gc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ae(t)})}function vc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ae(t)})}var eg={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function tg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ae(t)})}function rg(e,t){return new e({type:"string",format:"date",check:"string_format",...ae(t)})}function ng(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ae(t)})}function og(e,t){return new e({type:"string",format:"duration",check:"string_format",...ae(t)})}function ig(e,t){return new e({type:"number",checks:[],...ae(t)})}function ag(e,t){return new e({type:"number",coerce:!0,checks:[],...ae(t)})}function sg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ae(t)})}function lg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ae(t)})}function ug(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ae(t)})}function cg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ae(t)})}function dg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ae(t)})}function pg(e,t){return new e({type:"boolean",...ae(t)})}function fg(e,t){return new e({type:"boolean",coerce:!0,...ae(t)})}function mg(e,t){return new e({type:"bigint",...ae(t)})}function hg(e,t){return new e({type:"bigint",coerce:!0,...ae(t)})}function gg(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ae(t)})}function vg(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ae(t)})}function yg(e,t){return new e({type:"symbol",...ae(t)})}function _g(e,t){return new e({type:"undefined",...ae(t)})}function bg(e,t){return new e({type:"null",...ae(t)})}function wg(e){return new e({type:"any"})}function Yi(e){return new e({type:"unknown"})}function xg(e,t){return new e({type:"never",...ae(t)})}function kg(e,t){return new e({type:"void",...ae(t)})}function Sg(e,t){return new e({type:"date",...ae(t)})}function Tg(e,t){return new e({type:"date",coerce:!0,...ae(t)})}function Ig(e,t){return new e({type:"nan",...ae(t)})}function Rn(e,t){return new Fu({check:"less_than",...ae(t),value:e,inclusive:!1})}function Zr(e,t){return new Fu({check:"less_than",...ae(t),value:e,inclusive:!0})}function Cn(e,t){return new Zu({check:"greater_than",...ae(t),value:e,inclusive:!1})}function yr(e,t){return new Zu({check:"greater_than",...ae(t),value:e,inclusive:!0})}function $g(e){return Cn(0,e)}function Pg(e){return Rn(0,e)}function Eg(e){return Zr(0,e)}function Rg(e){return yr(0,e)}function Lo(e,t){return new Pm({check:"multiple_of",...ae(t),value:e})}function Xi(e,t){return new Cm({check:"max_size",...ae(t),maximum:e})}function Fo(e,t){return new Om({check:"min_size",...ae(t),minimum:e})}function ms(e,t){return new Dm({check:"size_equals",...ae(t),size:e})}function Qi(e,t){return new jm({check:"max_length",...ae(t),maximum:e})}function lo(e,t){return new Nm({check:"min_length",...ae(t),minimum:e})}function ea(e,t){return new Mm({check:"length_equals",...ae(t),length:e})}function hs(e,t){return new Am({check:"string_format",format:"regex",...ae(t),pattern:e})}function gs(e){return new zm({check:"string_format",format:"lowercase",...ae(e)})}function vs(e){return new qm({check:"string_format",format:"uppercase",...ae(e)})}function ys(e,t){return new Um({check:"string_format",format:"includes",...ae(t),includes:e})}function _s(e,t){return new Lm({check:"string_format",format:"starts_with",...ae(t),prefix:e})}function bs(e,t){return new Fm({check:"string_format",format:"ends_with",...ae(t),suffix:e})}function Cg(e,t,n){return new Zm({check:"property",property:e,schema:t,...ae(n)})}function ws(e,t){return new Vm({check:"mime_type",mime:e,...ae(t)})}function On(e){return new Wm({check:"overwrite",tx:e})}function xs(e){return On(t=>t.normalize(e))}function ks(){return On(e=>e.trim())}function Ss(){return On(e=>e.toLowerCase())}function Ts(){return On(e=>e.toUpperCase())}function Is(e,t,n){return new e({type:"array",element:t,...ae(n)})}function $N(e,t,n){return new e({type:"union",options:t,...ae(n)})}function PN(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...ae(o)})}function EN(e,t,n){return new e({type:"intersection",left:t,right:n})}function Og(e,t,n,o){let r=n instanceof Ce,i=r?o:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...ae(i)})}function RN(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...ae(o)})}function CN(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...ae(o)})}function ON(e,t,n){return new e({type:"set",valueType:t,...ae(n)})}function DN(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...ae(n)})}function jN(e,t,n){return new e({type:"enum",entries:t,...ae(n)})}function NN(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ae(n)})}function Dg(e,t){return new e({type:"file",...ae(t)})}function MN(e,t){return new e({type:"transform",transform:t})}function AN(e,t){return new e({type:"optional",innerType:t})}function zN(e,t){return new e({type:"nullable",innerType:t})}function qN(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():n}})}function UN(e,t,n){return new e({type:"nonoptional",innerType:t,...ae(n)})}function LN(e,t){return new e({type:"success",innerType:t})}function FN(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function ZN(e,t,n){return new e({type:"pipe",in:t,out:n})}function VN(e,t){return new e({type:"readonly",innerType:t})}function WN(e,t,n){return new e({type:"template_literal",parts:t,...ae(n)})}function HN(e,t){return new e({type:"lazy",getter:t})}function JN(e,t){return new e({type:"promise",innerType:t})}function jg(e,t,n){let o=ae(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Ng(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ae(n)})}function Mg(e,t){let n=ae(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(b=>typeof b=="string"?b.toLowerCase():b),r=r.map(b=>typeof b=="string"?b.toLowerCase():b));let i=new Set(o),s=new Set(r),l=e.Pipe??ds,u=e.Boolean??ls,c=e.String??qo,d=e.Transform??cs,m=new d({type:"transform",transform:(b,k)=>{let I=b;return n.case!=="sensitive"&&(I=I.toLowerCase()),i.has(I)?!0:s.has(I)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:k.value,inst:m}),{})},error:n.error}),_=new l({type:"pipe",in:new c({type:"string",error:n.error}),out:m,error:n.error});return new l({type:"pipe",in:_,out:new u({type:"boolean",error:n.error}),error:n.error})}function Ag(e,t,n,o={}){let r=ae(o),i={...ae(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:l=>n.test(l),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var yc=class{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let n=((...o)=>{let r=this._def.input?Mu(this._def.input,o,void 0,{callee:n}):o;if(!Array.isArray(r))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=t(...r);return this._def.output?Mu(this._def.output,i,void 0,{callee:n}):i});return n}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let n=(async(...o)=>{let r=this._def.input?await zu(this._def.input,o,void 0,{callee:n}):o;if(!Array.isArray(r))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=await t(...r);return this._def.output?zu(this._def.output,i,void 0,{callee:n}):i});return n}input(...t){let n=this.constructor;return Array.isArray(t[0])?new n({type:"function",input:new Uo({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new n({type:"function",input:t[0],output:this._def.output})}output(t){let n=this.constructor;return new n({type:"function",input:this._def.input,output:t})}};function zg(e){return new yc({type:"function",input:Array.isArray(e?.input)?Og(Uo,e?.input):e?.input??Is(us,Yi(Gi)),output:e?.output??Yi(Gi)})}var $s=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??hn,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;let l={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,l);let u=t._zod.toJSONSchema?.();if(u)l.schema=u;else{let m={...n,schemaPath:[...n.schemaPath,t],path:n.path},_=t._zod.parent;if(_)l.ref=_,this.process(_,m),this.seen.get(_).isParent=!0;else{let h=l.schema;switch(r.type){case"string":{let b=h;b.type="string";let{minimum:k,maximum:I,format:C,patterns:g,contentEncoding:v}=t._zod.bag;if(typeof k=="number"&&(b.minLength=k),typeof I=="number"&&(b.maxLength=I),C&&(b.format=i[C]??C,b.format===""&&delete b.format),v&&(b.contentEncoding=v),g&&g.size>0){let R=[...g];R.length===1?b.pattern=R[0].source:R.length>1&&(l.schema.allOf=[...R.map(O=>({...this.target==="draft-7"?{type:"string"}:{},pattern:O.source}))])}break}case"number":{let b=h,{minimum:k,maximum:I,format:C,multipleOf:g,exclusiveMaximum:v,exclusiveMinimum:R}=t._zod.bag;typeof C=="string"&&C.includes("int")?b.type="integer":b.type="number",typeof R=="number"&&(b.exclusiveMinimum=R),typeof k=="number"&&(b.minimum=k,typeof R=="number"&&(R>=k?delete b.minimum:delete b.exclusiveMinimum)),typeof v=="number"&&(b.exclusiveMaximum=v),typeof I=="number"&&(b.maximum=I,typeof v=="number"&&(v<=I?delete b.maximum:delete b.exclusiveMaximum)),typeof g=="number"&&(b.multipleOf=g);break}case"boolean":{let b=h;b.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{h.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{h.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let b=h,{minimum:k,maximum:I}=t._zod.bag;typeof k=="number"&&(b.minItems=k),typeof I=="number"&&(b.maxItems=I),b.type="array",b.items=this.process(r.element,{...m,path:[...m.path,"items"]});break}case"object":{let b=h;b.type="object",b.properties={};let k=r.shape;for(let g in k)b.properties[g]=this.process(k[g],{...m,path:[...m.path,"properties",g]});let I=new Set(Object.keys(k)),C=new Set([...I].filter(g=>{let v=r.shape[g]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));C.size>0&&(b.required=Array.from(C)),r.catchall?._zod.def.type==="never"?b.additionalProperties=!1:r.catchall?r.catchall&&(b.additionalProperties=this.process(r.catchall,{...m,path:[...m.path,"additionalProperties"]})):this.io==="output"&&(b.additionalProperties=!1);break}case"union":{let b=h;b.anyOf=r.options.map((k,I)=>this.process(k,{...m,path:[...m.path,"anyOf",I]}));break}case"intersection":{let b=h,k=this.process(r.left,{...m,path:[...m.path,"allOf",0]}),I=this.process(r.right,{...m,path:[...m.path,"allOf",1]}),C=v=>"allOf"in v&&Object.keys(v).length===1,g=[...C(k)?k.allOf:[k],...C(I)?I.allOf:[I]];b.allOf=g;break}case"tuple":{let b=h;b.type="array";let k=r.items.map((g,v)=>this.process(g,{...m,path:[...m.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?b.prefixItems=k:b.items=k,r.rest){let g=this.process(r.rest,{...m,path:[...m.path,"items"]});this.target==="draft-2020-12"?b.items=g:b.additionalItems=g}r.rest&&(b.items=this.process(r.rest,{...m,path:[...m.path,"items"]}));let{minimum:I,maximum:C}=t._zod.bag;typeof I=="number"&&(b.minItems=I),typeof C=="number"&&(b.maxItems=C);break}case"record":{let b=h;b.type="object",b.propertyNames=this.process(r.keyType,{...m,path:[...m.path,"propertyNames"]}),b.additionalProperties=this.process(r.valueType,{...m,path:[...m.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let b=h,k=Xa(r.entries);k.every(I=>typeof I=="number")&&(b.type="number"),k.every(I=>typeof I=="string")&&(b.type="string"),b.enum=k;break}case"literal":{let b=h,k=[];for(let I of r.values)if(I===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof I=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");k.push(Number(I))}else k.push(I);if(k.length!==0)if(k.length===1){let I=k[0];b.type=I===null?"null":typeof I,b.const=I}else k.every(I=>typeof I=="number")&&(b.type="number"),k.every(I=>typeof I=="string")&&(b.type="string"),k.every(I=>typeof I=="boolean")&&(b.type="string"),k.every(I=>I===null)&&(b.type="null"),b.enum=k;break}case"file":{let b=h,k={type:"string",format:"binary",contentEncoding:"binary"},{minimum:I,maximum:C,mime:g}=t._zod.bag;I!==void 0&&(k.minLength=I),C!==void 0&&(k.maxLength=C),g?g.length===1?(k.contentMediaType=g[0],Object.assign(b,k)):b.anyOf=g.map(v=>({...k,contentMediaType:v})):Object.assign(b,k);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let b=this.process(r.innerType,m);h.anyOf=[b,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,m),l.ref=r.innerType;break}case"success":{let b=h;b.type="boolean";break}case"default":{this.process(r.innerType,m),l.ref=r.innerType,h.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,m),l.ref=r.innerType,this.io==="input"&&(h._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,m),l.ref=r.innerType;let b;try{b=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}h.default=b;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let b=h,k=t._zod.pattern;if(!k)throw new Error("Pattern not found in template literal");b.type="string",b.pattern=k.source;break}case"pipe":{let b=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(b,m),l.ref=b;break}case"readonly":{this.process(r.innerType,m),l.ref=r.innerType,h.readOnly=!0;break}case"promise":{this.process(r.innerType,m),l.ref=r.innerType;break}case"optional":{this.process(r.innerType,m),l.ref=r.innerType;break}case"lazy":{let b=t._zod.innerType;this.process(b,m),l.ref=b;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(t);return c&&Object.assign(l.schema,c),this.io==="input"&&At(t)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((o=l.schema).default??(o.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(t).schema}emit(t,n){let o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=d=>{let m=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let k=o.external.registry.get(d[0])?.id,I=o.external.uri??(g=>g);if(k)return{ref:I(k)};let C=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=C,{defId:C,ref:`${I("__shared")}#/${m}/${C}`}}if(d[1]===r)return{ref:"#"};let h=`#/${m}/`,b=d[1].schema.id??`__schema${this.counter++}`;return{defId:b,ref:h+b}},s=d=>{if(d[1].schema.$ref)return;let m=d[1],{ref:_,defId:h}=i(d);m.def={...m.schema},h&&(m.defId=h);let b=m.schema;for(let k in b)delete b[k];b.$ref=_};if(o.cycles==="throw")for(let d of this.seen.entries()){let m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let m=d[1];if(t===d[0]){s(d);continue}if(o.external){let h=o.external.registry.get(d[0])?.id;if(t!==d[0]&&h){s(d);continue}}if(this.metadataRegistry.get(d[0])?.id){s(d);continue}if(m.cycle){s(d);continue}if(m.count>1&&o.reused==="ref"){s(d);continue}}let l=(d,m)=>{let _=this.seen.get(d),h=_.def??_.schema,b={...h};if(_.ref===null)return;let k=_.ref;if(_.ref=null,k){l(k,m);let T=this.seen.get(k).schema;T.$ref&&m.target==="draft-7"?(h.allOf=h.allOf??[],h.allOf.push(T)):(Object.assign(h,T),Object.assign(h,b))}_.isParent||this.override({zodSchema:d,jsonSchema:h,path:_.path??[]})};for(let d of[...this.seen.entries()].reverse())l(d[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),o.external?.uri){let d=o.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=o.external.uri(d)}Object.assign(u,r.def);let c=o.external?.defs??{};for(let d of this.seen.entries()){let m=d[1];m.def&&m.defId&&(c[m.defId]=m.def)}o.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function Ps(e,t){if(e instanceof Bi){let o=new $s(t),r={};for(let l of e._idmap.entries()){let[u,c]=l;o.process(c)}let i={},s={registry:e,uri:t?.uri,defs:r};for(let l of e._idmap.entries()){let[u,c]=l;i[u]=o.emit(c,{...t,external:s})}if(Object.keys(r).length>0){let l=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:r}}return{schemas:i}}let n=new $s(t);return n.process(e),n.emit(e,t)}function At(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return At(r.element,n);case"object":{for(let i in r.shape)if(At(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(At(i,n))return!0;return!1}case"intersection":return At(r.left,n)||At(r.right,n);case"tuple":{for(let i of r.items)if(At(i,n))return!0;return!!(r.rest&&At(r.rest,n))}case"record":return At(r.keyType,n)||At(r.valueType,n);case"map":return At(r.keyType,n)||At(r.valueType,n);case"set":return At(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return At(r.innerType,n);case"lazy":return At(r.getter(),n);case"default":return At(r.innerType,n);case"prefault":return At(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return At(r.in,n)||At(r.out,n);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var uT={};var wc={};xn(wc,{ZodISODate:()=>yc,ZodISODateTime:()=>vc,ZodISODuration:()=>bc,ZodISOTime:()=>_c,date:()=>Dg,datetime:()=>Og,duration:()=>Ng,time:()=>jg});var vc=j("ZodISODateTime",(e,t)=>{Xm.init(e,t),gt.init(e,t)});function Og(e){return Bh(vc,e)}var yc=j("ZodISODate",(e,t)=>{Qm.init(e,t),gt.init(e,t)});function Dg(e){return Gh(yc,e)}var _c=j("ZodISOTime",(e,t)=>{eh.init(e,t),gt.init(e,t)});function jg(e){return Kh(_c,e)}var bc=j("ZodISODuration",(e,t)=>{th.init(e,t),gt.init(e,t)});function Ng(e){return Yh(bc,e)}var dT=(e,t)=>{os.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>as(e,n)},flatten:{value:n=>is(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},TN=j("ZodError",dT),Qi=j("ZodError",dT,{Parent:Error});var Mg=Du(Qi),Ag=Nu(Qi),zg=Au(Qi),Es=zu(Qi);var Ue=j("ZodType",(e,t)=>(Re.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Er(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>Mg(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>zg(e,n,o),e.parseAsync=async(n,o)=>Ag(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Es(e,n,o),e.spa=e.safeParseAsync,e.refine=(n,o)=>e.check(XT(n,o)),e.superRefine=n=>e.check(QT(n)),e.overwrite=n=>e.check(Rn(n)),e.optional=()=>Sc(e),e.nullable=()=>Ic(e),e.nullish=()=>Sc(Ic(e)),e.nonoptional=n=>UT(e,n),e.array=()=>av(e),e.or=n=>Cc([e,n]),e.and=n=>TT(e,n),e.transform=n=>Tc(e,cv(n)),e.default=n=>AT(e,n),e.prefault=n=>qT(e,n),e.catch=n=>ZT(e,n),e.pipe=n=>Tc(e,n),e.readonly=()=>HT(e),e.describe=n=>{let o=e.clone();return mn.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return mn.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return mn.get(e);let o=e.clone();return mn.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Lg=j("_ZodString",(e,t)=>{Ao.init(e,t),Ue.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(hs(...o)),e.includes=(...o)=>e.check(ys(...o)),e.startsWith=(...o)=>e.check(_s(...o)),e.endsWith=(...o)=>e.check(bs(...o)),e.min=(...o)=>e.check(ao(...o)),e.max=(...o)=>e.check(Yi(...o)),e.length=(...o)=>e.check(Xi(...o)),e.nonempty=(...o)=>e.check(ao(1,...o)),e.lowercase=o=>e.check(gs(o)),e.uppercase=o=>e.check(vs(o)),e.trim=()=>e.check(ks()),e.normalize=(...o)=>e.check(xs(...o)),e.toLowerCase=()=>e.check(Ss()),e.toUpperCase=()=>e.check(Is())}),Rs=j("ZodString",(e,t)=>{Ao.init(e,t),Lg.init(e,t),e.email=n=>e.check(Gu(Fg,n)),e.url=n=>e.check(ec(Zg,n)),e.jwt=n=>e.check(hc(ov,n)),e.emoji=n=>e.check(tc(Vg,n)),e.guid=n=>e.check(fs(xc,n)),e.uuid=n=>e.check(Ku(Dn,n)),e.uuidv4=n=>e.check(Yu(Dn,n)),e.uuidv6=n=>e.check(Xu(Dn,n)),e.uuidv7=n=>e.check(Qu(Dn,n)),e.nanoid=n=>e.check(rc(Wg,n)),e.guid=n=>e.check(fs(xc,n)),e.cuid=n=>e.check(nc(Hg,n)),e.cuid2=n=>e.check(oc(Jg,n)),e.ulid=n=>e.check(ic(Bg,n)),e.base64=n=>e.check(pc(tv,n)),e.base64url=n=>e.check(fc(rv,n)),e.xid=n=>e.check(ac(Gg,n)),e.ksuid=n=>e.check(sc(Kg,n)),e.ipv4=n=>e.check(lc(Yg,n)),e.ipv6=n=>e.check(uc(Xg,n)),e.cidrv4=n=>e.check(cc(Qg,n)),e.cidrv6=n=>e.check(dc(ev,n)),e.e164=n=>e.check(mc(nv,n)),e.datetime=n=>e.check(Og(n)),e.date=n=>e.check(Dg(n)),e.time=n=>e.check(jg(n)),e.duration=n=>e.check(Ng(n))});function qg(e){return Wh(Rs,e)}var gt=j("ZodStringFormat",(e,t)=>{pt.init(e,t),Lg.init(e,t)}),Fg=j("ZodEmail",(e,t)=>{Zm.init(e,t),gt.init(e,t)});function PN(e){return Gu(Fg,e)}var xc=j("ZodGUID",(e,t)=>{Lm.init(e,t),gt.init(e,t)});function EN(e){return fs(xc,e)}var Dn=j("ZodUUID",(e,t)=>{Fm.init(e,t),gt.init(e,t)});function CN(e){return Ku(Dn,e)}function RN(e){return Yu(Dn,e)}function ON(e){return Xu(Dn,e)}function DN(e){return Qu(Dn,e)}var Zg=j("ZodURL",(e,t)=>{Vm.init(e,t),gt.init(e,t)});function jN(e){return ec(Zg,e)}var Vg=j("ZodEmoji",(e,t)=>{Wm.init(e,t),gt.init(e,t)});function NN(e){return tc(Vg,e)}var Wg=j("ZodNanoID",(e,t)=>{Hm.init(e,t),gt.init(e,t)});function MN(e){return rc(Wg,e)}var Hg=j("ZodCUID",(e,t)=>{Jm.init(e,t),gt.init(e,t)});function AN(e){return nc(Hg,e)}var Jg=j("ZodCUID2",(e,t)=>{Bm.init(e,t),gt.init(e,t)});function zN(e){return oc(Jg,e)}var Bg=j("ZodULID",(e,t)=>{Gm.init(e,t),gt.init(e,t)});function qN(e){return ic(Bg,e)}var Gg=j("ZodXID",(e,t)=>{Km.init(e,t),gt.init(e,t)});function UN(e){return ac(Gg,e)}var Kg=j("ZodKSUID",(e,t)=>{Ym.init(e,t),gt.init(e,t)});function LN(e){return sc(Kg,e)}var Yg=j("ZodIPv4",(e,t)=>{rh.init(e,t),gt.init(e,t)});function FN(e){return lc(Yg,e)}var Xg=j("ZodIPv6",(e,t)=>{nh.init(e,t),gt.init(e,t)});function ZN(e){return uc(Xg,e)}var Qg=j("ZodCIDRv4",(e,t)=>{oh.init(e,t),gt.init(e,t)});function VN(e){return cc(Qg,e)}var ev=j("ZodCIDRv6",(e,t)=>{ih.init(e,t),gt.init(e,t)});function WN(e){return dc(ev,e)}var tv=j("ZodBase64",(e,t)=>{sh.init(e,t),gt.init(e,t)});function HN(e){return pc(tv,e)}var rv=j("ZodBase64URL",(e,t)=>{lh.init(e,t),gt.init(e,t)});function JN(e){return fc(rv,e)}var nv=j("ZodE164",(e,t)=>{uh.init(e,t),gt.init(e,t)});function BN(e){return mc(nv,e)}var ov=j("ZodJWT",(e,t)=>{ch.init(e,t),gt.init(e,t)});function GN(e){return hc(ov,e)}var pT=j("ZodCustomStringFormat",(e,t)=>{dh.init(e,t),gt.init(e,t)});function KN(e,t,n={}){return Cg(pT,e,t,n)}var Os=j("ZodNumber",(e,t)=>{Vu.init(e,t),Ue.init(e,t),e.gt=(o,r)=>e.check(Cn(o,r)),e.gte=(o,r)=>e.check(yr(o,r)),e.min=(o,r)=>e.check(yr(o,r)),e.lt=(o,r)=>e.check(En(o,r)),e.lte=(o,r)=>e.check(Fr(o,r)),e.max=(o,r)=>e.check(Fr(o,r)),e.int=o=>e.check(Ug(o)),e.safe=o=>e.check(Ug(o)),e.positive=o=>e.check(Cn(0,o)),e.nonnegative=o=>e.check(yr(0,o)),e.negative=o=>e.check(En(0,o)),e.nonpositive=o=>e.check(Fr(0,o)),e.multipleOf=(o,r)=>e.check(qo(o,r)),e.step=(o,r)=>e.check(qo(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function fT(e){return Xh(Os,e)}var ea=j("ZodNumberFormat",(e,t)=>{ph.init(e,t),Os.init(e,t)});function Ug(e){return eg(ea,e)}function YN(e){return tg(ea,e)}function XN(e){return rg(ea,e)}function QN(e){return ng(ea,e)}function eM(e){return og(ea,e)}var Ds=j("ZodBoolean",(e,t)=>{ls.init(e,t),Ue.init(e,t)});function mT(e){return ig(Ds,e)}var js=j("ZodBigInt",(e,t)=>{Wu.init(e,t),Ue.init(e,t),e.gte=(o,r)=>e.check(yr(o,r)),e.min=(o,r)=>e.check(yr(o,r)),e.gt=(o,r)=>e.check(Cn(o,r)),e.gte=(o,r)=>e.check(yr(o,r)),e.min=(o,r)=>e.check(yr(o,r)),e.lt=(o,r)=>e.check(En(o,r)),e.lte=(o,r)=>e.check(Fr(o,r)),e.max=(o,r)=>e.check(Fr(o,r)),e.positive=o=>e.check(Cn(BigInt(0),o)),e.negative=o=>e.check(En(BigInt(0),o)),e.nonpositive=o=>e.check(Fr(BigInt(0),o)),e.nonnegative=o=>e.check(yr(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(qo(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function tM(e){return sg(js,e)}var iv=j("ZodBigIntFormat",(e,t)=>{fh.init(e,t),js.init(e,t)});function rM(e){return ug(iv,e)}function nM(e){return cg(iv,e)}var hT=j("ZodSymbol",(e,t)=>{mh.init(e,t),Ue.init(e,t)});function oM(e){return dg(hT,e)}var gT=j("ZodUndefined",(e,t)=>{hh.init(e,t),Ue.init(e,t)});function iM(e){return pg(gT,e)}var vT=j("ZodNull",(e,t)=>{gh.init(e,t),Ue.init(e,t)});function yT(e){return fg(vT,e)}var _T=j("ZodAny",(e,t)=>{vh.init(e,t),Ue.init(e,t)});function aM(){return mg(_T)}var bT=j("ZodUnknown",(e,t)=>{Ji.init(e,t),Ue.init(e,t)});function kc(){return Gi(bT)}var wT=j("ZodNever",(e,t)=>{yh.init(e,t),Ue.init(e,t)});function $c(e){return hg(wT,e)}var xT=j("ZodVoid",(e,t)=>{_h.init(e,t),Ue.init(e,t)});function sM(e){return gg(xT,e)}var Pc=j("ZodDate",(e,t)=>{bh.init(e,t),Ue.init(e,t),e.min=(o,r)=>e.check(yr(o,r)),e.max=(o,r)=>e.check(Fr(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function lM(e){return vg(Pc,e)}var kT=j("ZodArray",(e,t)=>{us.init(e,t),Ue.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(ao(n,o)),e.nonempty=n=>e.check(ao(1,n)),e.max=(n,o)=>e.check(Yi(n,o)),e.length=(n,o)=>e.check(Xi(n,o)),e.unwrap=()=>e.element});function av(e,t){return Ts(kT,e,t)}function uM(e){let t=e._zod.def.shape;return DT(Object.keys(t))}var Ec=j("ZodObject",(e,t)=>{wh.init(e,t),Ue.init(e,t),ce.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>RT(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:kc()}),e.loose=()=>e.clone({...e._zod.def,catchall:kc()}),e.strict=()=>e.clone({...e._zod.def,catchall:$c()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ce.extend(e,n),e.merge=n=>ce.merge(e,n),e.pick=n=>ce.pick(e,n),e.omit=n=>ce.omit(e,n),e.partial=(...n)=>ce.partial(dv,e,n[0]),e.required=(...n)=>ce.required(pv,e,n[0])});function cM(e,t){let n={type:"object",get shape(){return ce.assignProp(this,"shape",{...e}),this.shape},...ce.normalizeParams(t)};return new Ec(n)}function dM(e,t){return new Ec({type:"object",get shape(){return ce.assignProp(this,"shape",{...e}),this.shape},catchall:$c(),...ce.normalizeParams(t)})}function pM(e,t){return new Ec({type:"object",get shape(){return ce.assignProp(this,"shape",{...e}),this.shape},catchall:kc(),...ce.normalizeParams(t)})}var sv=j("ZodUnion",(e,t)=>{Hu.init(e,t),Ue.init(e,t),e.options=t.options});function Cc(e,t){return new sv({type:"union",options:e,...ce.normalizeParams(t)})}var ST=j("ZodDiscriminatedUnion",(e,t)=>{sv.init(e,t),xh.init(e,t)});function fM(e,t,n){return new ST({type:"union",options:t,discriminator:e,...ce.normalizeParams(n)})}var IT=j("ZodIntersection",(e,t)=>{kh.init(e,t),Ue.init(e,t)});function TT(e,t){return new IT({type:"intersection",left:e,right:t})}var $T=j("ZodTuple",(e,t)=>{zo.init(e,t),Ue.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function mM(e,t,n){let o=t instanceof Re,r=o?n:t,i=o?t:null;return new $T({type:"tuple",items:e,rest:i,...ce.normalizeParams(r)})}var lv=j("ZodRecord",(e,t)=>{Sh.init(e,t),Ue.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function PT(e,t,n){return new lv({type:"record",keyType:e,valueType:t,...ce.normalizeParams(n)})}function hM(e,t,n){return new lv({type:"record",keyType:Cc([e,$c()]),valueType:t,...ce.normalizeParams(n)})}var ET=j("ZodMap",(e,t)=>{Ih.init(e,t),Ue.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function gM(e,t,n){return new ET({type:"map",keyType:e,valueType:t,...ce.normalizeParams(n)})}var CT=j("ZodSet",(e,t)=>{Th.init(e,t),Ue.init(e,t),e.min=(...n)=>e.check(Uo(...n)),e.nonempty=n=>e.check(Uo(1,n)),e.max=(...n)=>e.check(Ki(...n)),e.size=(...n)=>e.check(ms(...n))});function vM(e,t){return new CT({type:"set",valueType:e,...ce.normalizeParams(t)})}var Cs=j("ZodEnum",(e,t)=>{$h.init(e,t),Ue.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Cs({...t,checks:[],...ce.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Cs({...t,checks:[],...ce.normalizeParams(r),entries:i})}});function RT(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Cs({type:"enum",entries:n,...ce.normalizeParams(t)})}function yM(e,t){return new Cs({type:"enum",entries:e,...ce.normalizeParams(t)})}var OT=j("ZodLiteral",(e,t)=>{Ph.init(e,t),Ue.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function DT(e,t){return new OT({type:"literal",values:Array.isArray(e)?e:[e],...ce.normalizeParams(t)})}var jT=j("ZodFile",(e,t)=>{Eh.init(e,t),Ue.init(e,t),e.min=(n,o)=>e.check(Uo(n,o)),e.max=(n,o)=>e.check(Ki(n,o)),e.mime=(n,o)=>e.check(ws(Array.isArray(n)?n:[n],o))});function _M(e){return Tg(jT,e)}var uv=j("ZodTransform",(e,t)=>{cs.init(e,t),Ue.init(e,t),e._zod.parse=(n,o)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(ce.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(ce.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function cv(e){return new uv({type:"transform",transform:e})}var dv=j("ZodOptional",(e,t)=>{Ch.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sc(e){return new dv({type:"optional",innerType:e})}var NT=j("ZodNullable",(e,t)=>{Rh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ic(e){return new NT({type:"nullable",innerType:e})}function bM(e){return Sc(Ic(e))}var MT=j("ZodDefault",(e,t)=>{Oh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AT(e,t){return new MT({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var zT=j("ZodPrefault",(e,t)=>{Dh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qT(e,t){return new zT({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var pv=j("ZodNonOptional",(e,t)=>{jh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function UT(e,t){return new pv({type:"nonoptional",innerType:e,...ce.normalizeParams(t)})}var LT=j("ZodSuccess",(e,t)=>{Nh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function wM(e){return new LT({type:"success",innerType:e})}var FT=j("ZodCatch",(e,t)=>{Mh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ZT(e,t){return new FT({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var VT=j("ZodNaN",(e,t)=>{Ah.init(e,t),Ue.init(e,t)});function xM(e){return _g(VT,e)}var fv=j("ZodPipe",(e,t)=>{ds.init(e,t),Ue.init(e,t),e.in=t.in,e.out=t.out});function Tc(e,t){return new fv({type:"pipe",in:e,out:t})}var WT=j("ZodReadonly",(e,t)=>{zh.init(e,t),Ue.init(e,t)});function HT(e){return new WT({type:"readonly",innerType:e})}var JT=j("ZodTemplateLiteral",(e,t)=>{qh.init(e,t),Ue.init(e,t)});function kM(e,t){return new JT({type:"template_literal",parts:e,...ce.normalizeParams(t)})}var BT=j("ZodLazy",(e,t)=>{Lh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.getter()});function GT(e){return new BT({type:"lazy",getter:e})}var KT=j("ZodPromise",(e,t)=>{Uh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function SM(e){return new KT({type:"promise",innerType:e})}var Rc=j("ZodCustom",(e,t)=>{Fh.init(e,t),Ue.init(e,t)});function YT(e){let t=new $t({check:"custom"});return t._zod.check=e,t}function IM(e,t){return $g(Rc,e??(()=>!0),t)}function XT(e,t={}){return Pg(Rc,e,t)}function QT(e){let t=YT(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ce.issue(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(ce.issue(r))}},e(n.value,n)));return t}function TM(e,t={error:`Input not instance of ${e.name}`}){let n=new Rc({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...ce.normalizeParams(t)});return n._zod.bag.Class=e,n}var $M=(...e)=>Eg({Pipe:fv,Boolean:Ds,String:Rs,Transform:uv},...e);function PM(e){let t=GT(()=>Cc([qg(e),fT(),mT(),yT(),av(t),PT(qg(),t)]));return t}function EM(e,t){return Tc(cv(e),t)}var CM={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function RM(e){jt({customError:e})}function OM(){return jt().customError}var mv={};xn(mv,{bigint:()=>MM,boolean:()=>NM,date:()=>AM,number:()=>jM,string:()=>DM});function DM(e){return Hh(Rs,e)}function jM(e){return Qh(Os,e)}function NM(e){return ag(Ds,e)}function MM(e){return lg(js,e)}function AM(e){return yg(Pc,e)}jt(Ju());var be={};xn(be,{BRAND:()=>uA,DIRTY:()=>Lo,EMPTY_PATH:()=>LM,INVALID:()=>Ee,NEVER:()=>JA,OK:()=>Yt,ParseStatus:()=>Zt,Schema:()=>qe,ZodAny:()=>uo,ZodArray:()=>An,ZodBigInt:()=>Zo,ZodBoolean:()=>Vo,ZodBranded:()=>Ms,ZodCatch:()=>ti,ZodDate:()=>Wo,ZodDefault:()=>ei,ZodDiscriminatedUnion:()=>jc,ZodEffects:()=>Wr,ZodEnum:()=>Xo,ZodError:()=>_r,ZodFirstPartyTypeKind:()=>re,ZodFunction:()=>Mc,ZodIntersection:()=>Go,ZodIssueCode:()=>Q,ZodLazy:()=>Ko,ZodLiteral:()=>Yo,ZodMap:()=>aa,ZodNaN:()=>la,ZodNativeEnum:()=>Qo,ZodNever:()=>Qr,ZodNull:()=>Jo,ZodNullable:()=>vn,ZodNumber:()=>Fo,ZodObject:()=>br,ZodOptional:()=>Zr,ZodParsedType:()=>he,ZodPipeline:()=>As,ZodPromise:()=>co,ZodReadonly:()=>ri,ZodRecord:()=>Nc,ZodSchema:()=>qe,ZodSet:()=>sa,ZodString:()=>lo,ZodSymbol:()=>oa,ZodTransformer:()=>Wr,ZodTuple:()=>gn,ZodType:()=>qe,ZodUndefined:()=>Ho,ZodUnion:()=>Bo,ZodUnknown:()=>Mn,ZodVoid:()=>ia,addIssueToContext:()=>fe,any:()=>yA,array:()=>xA,bigint:()=>fA,boolean:()=>c0,coerce:()=>HA,custom:()=>s0,date:()=>mA,datetimeRegex:()=>i0,defaultErrorMap:()=>jn,discriminatedUnion:()=>TA,effect:()=>zA,enum:()=>NA,function:()=>OA,getErrorMap:()=>ta,getParsedType:()=>hn,instanceof:()=>dA,intersection:()=>$A,isAborted:()=>Oc,isAsync:()=>ra,isDirty:()=>Dc,isValid:()=>so,late:()=>cA,lazy:()=>DA,literal:()=>jA,makeIssue:()=>Ns,map:()=>CA,nan:()=>pA,nativeEnum:()=>MA,never:()=>bA,null:()=>vA,nullable:()=>UA,number:()=>u0,object:()=>kA,objectUtil:()=>hv,oboolean:()=>WA,onumber:()=>VA,optional:()=>qA,ostring:()=>ZA,pipeline:()=>FA,preprocess:()=>LA,promise:()=>AA,quotelessJson:()=>zM,record:()=>EA,set:()=>RA,setErrorMap:()=>UM,strictObject:()=>SA,string:()=>l0,symbol:()=>hA,transformer:()=>zA,tuple:()=>PA,undefined:()=>gA,union:()=>IA,unknown:()=>_A,util:()=>Ze,void:()=>wA});var Ze;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let i={};for(let s of r)i[s]=s;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(l=>typeof r[r[l]]!="number"),s={};for(let l of i)s[l]=r[l];return e.objectValues(s)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.push(s);return i},e.find=(r,i)=>{for(let s of r)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(Ze||(Ze={}));var hv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(hv||(hv={}));var he=Ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hn=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}};var Q=Ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),_r=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let l=o,u=0;for(;un.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};_r.create=e=>new _r(e);var qM=(e,t)=>{let n;switch(e.code){case Q.invalid_type:e.received===he.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ze.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ze.joinValues(e.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ze.joinValues(e.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Ze.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ze.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Q.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Q.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ze.assertNever(e)}return{message:n}},jn=qM;var e0=jn;function UM(e){e0=e}function ta(){return e0}var Ns=e=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let l="",u=o.filter(c=>!!c).slice().reverse();for(let c of u)l=c(s,{data:t,defaultError:l}).message;return{...r,path:i,message:l}},LM=[];function fe(e,t){let n=ta(),o=Ns({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===jn?void 0:jn].filter(r=>!!r)});e.common.issues.push(o)}var Zt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return Ee;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted"||s.status==="aborted")return Ee;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(o[i.value]=s.value)}return{status:t.value,value:o}}},Ee=Object.freeze({status:"aborted"}),Lo=e=>({status:"dirty",value:e}),Yt=e=>({status:"valid",value:e}),Oc=e=>e.status==="aborted",Dc=e=>e.status==="dirty",so=e=>e.status==="valid",ra=e=>typeof Promise<"u"&&e instanceof Promise;var ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ke||(ke={}));var Vr=class{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},t0=(e,t)=>{if(so(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new _r(e.common.issues);return this._error=n,this._error}}};function Ae(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(s,l)=>{let{message:u}=e;return s.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??o??l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:r}}var qe=class{get description(){return this._def.description}_getType(t){return hn(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:hn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Zt,ctx:{common:t.parent.common,data:t.data,parsedType:hn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(ra(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hn(t)},r=this._parseSync({data:t,path:o.path,parent:o});return t0(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hn(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return so(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>so(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hn(t)},r=this._parse({data:t,path:o.path,parent:o}),i=await(ra(r)?r:Promise.resolve(r));return t0(o,i)}refine(t,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{let s=t(r),l=()=>i.addIssue({code:Q.custom,...o(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(t,n){return this._refinement((o,r)=>t(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(t){return new Wr({schema:this,typeName:re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Zr.create(this,this._def)}nullable(){return vn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return An.create(this)}promise(){return co.create(this,this._def)}or(t){return Bo.create([this,t],this._def)}and(t){return Go.create(this,t,this._def)}transform(t){return new Wr({...Ae(this._def),schema:this,typeName:re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new ei({...Ae(this._def),innerType:this,defaultValue:n,typeName:re.ZodDefault})}brand(){return new Ms({typeName:re.ZodBranded,type:this,...Ae(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new ti({...Ae(this._def),innerType:this,catchValue:n,typeName:re.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return As.create(this,t)}readonly(){return ri.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},FM=/^c[^\s-]{8,}$/i,ZM=/^[0-9a-z]+$/,VM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,WM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HM=/^[a-z0-9_-]{21}$/i,JM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BM=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,GM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",gv,YM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,XM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,QM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",nA=new RegExp(`^${n0}$`);function o0(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function oA(e){return new RegExp(`^${o0(e)}$`)}function i0(e){let t=`${n0}T${o0(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function iA(e,t){return!!((t==="v4"||!t)&&YM.test(e)||(t==="v6"||!t)&&QM.test(e))}function aA(e,t){if(!JM.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function sA(e,t){return!!((t==="v4"||!t)&&XM.test(e)||(t==="v6"||!t)&&eA.test(e))}var lo=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_type,expected:he.string,received:i.parsedType}),Ee}let o=new Zt,r;for(let i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(r=this._getOrReturnCtx(t,r),fe(r,{code:Q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,l=t.data.lengtht.test(r),{validation:n,code:Q.invalid_string,...ke.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ke.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ke.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ke.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ke.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ke.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ke.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ke.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ke.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ke.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ke.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ke.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ke.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ke.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ke.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...ke.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ke.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ke.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ke.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ke.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ke.errToObj(n)})}nonempty(t){return this.min(1,ke.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew lo({checks:[],typeName:re.ZodString,coerce:e?.coerce??!1,...Ae(e)});function lA(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}var Fo=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==he.number){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_type,expected:he.number,received:i.parsedType}),Ee}let o,r=new Zt;for(let i of this._def.checks)i.kind==="int"?Ze.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?lA(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.not_finite,message:i.message}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ke.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:ke.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ke.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Ze.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.valuenew Fo({checks:[],typeName:re.ZodNumber,coerce:e?.coerce||!1,...Ae(e)});var Zo=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==he.bigint)return this._getInvalidInput(t);let o,r=new Zt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return fe(n,{code:Q.invalid_type,expected:he.bigint,received:n.parsedType}),Ee}gte(t,n){return this.setLimit("min",t,!0,ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ke.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:ke.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Zo({checks:[],typeName:re.ZodBigInt,coerce:e?.coerce??!1,...Ae(e)});var Vo=class extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.boolean,received:o.parsedType}),Ee}return Yt(t.data)}};Vo.create=e=>new Vo({typeName:re.ZodBoolean,coerce:e?.coerce||!1,...Ae(e)});var Wo=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_type,expected:he.date,received:i.parsedType}),Ee}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_date}),Ee}let o=new Zt,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(r=this._getOrReturnCtx(t,r),fe(r,{code:Q.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):Ze.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ke.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ke.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Wo({checks:[],coerce:e?.coerce||!1,typeName:re.ZodDate,...Ae(e)});var oa=class extends qe{_parse(t){if(this._getType(t)!==he.symbol){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.symbol,received:o.parsedType}),Ee}return Yt(t.data)}};oa.create=e=>new oa({typeName:re.ZodSymbol,...Ae(e)});var Ho=class extends qe{_parse(t){if(this._getType(t)!==he.undefined){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.undefined,received:o.parsedType}),Ee}return Yt(t.data)}};Ho.create=e=>new Ho({typeName:re.ZodUndefined,...Ae(e)});var Jo=class extends qe{_parse(t){if(this._getType(t)!==he.null){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.null,received:o.parsedType}),Ee}return Yt(t.data)}};Jo.create=e=>new Jo({typeName:re.ZodNull,...Ae(e)});var uo=class extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Yt(t.data)}};uo.create=e=>new uo({typeName:re.ZodAny,...Ae(e)});var Mn=class extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Yt(t.data)}};Mn.create=e=>new Mn({typeName:re.ZodUnknown,...Ae(e)});var Qr=class extends qe{_parse(t){let n=this._getOrReturnCtx(t);return fe(n,{code:Q.invalid_type,expected:he.never,received:n.parsedType}),Ee}};Qr.create=e=>new Qr({typeName:re.ZodNever,...Ae(e)});var ia=class extends qe{_parse(t){if(this._getType(t)!==he.undefined){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.void,received:o.parsedType}),Ee}return Yt(t.data)}};ia.create=e=>new ia({typeName:re.ZodVoid,...Ae(e)});var An=class e extends qe{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==he.array)return fe(n,{code:Q.invalid_type,expected:he.array,received:n.parsedType}),Ee;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,l=n.data.lengthr.maxLength.value&&(fe(n,{code:Q.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,l)=>r.type._parseAsync(new Vr(n,s,n.path,l)))).then(s=>Zt.mergeArray(o,s));let i=[...n.data].map((s,l)=>r.type._parseSync(new Vr(n,s,n.path,l)));return Zt.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:ke.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:ke.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:ke.toString(n)}})}nonempty(t){return this.min(1,t)}};An.create=(e,t)=>new An({type:e,minLength:null,maxLength:null,exactLength:null,typeName:re.ZodArray,...Ae(t)});function na(e){if(e instanceof br){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=Zr.create(na(o))}return new br({...e._def,shape:()=>t})}else return e instanceof An?new An({...e._def,type:na(e.element)}):e instanceof Zr?Zr.create(na(e.unwrap())):e instanceof vn?vn.create(na(e.unwrap())):e instanceof gn?gn.create(e.items.map(t=>na(t))):e}var br=class e extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Ze.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==he.object){let c=this._getOrReturnCtx(t);return fe(c,{code:Q.invalid_type,expected:he.object,received:c.parsedType}),Ee}let{status:o,ctx:r}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Qr&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||l.push(c);let u=[];for(let c of s){let d=i[c],m=r.data[c];u.push({key:{status:"valid",value:c},value:d._parse(new Vr(r,m,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Qr){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of l)u.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(c==="strict")l.length>0&&(fe(r,{code:Q.unrecognized_keys,keys:l}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of l){let m=r.data[d];u.push({key:{status:"valid",value:d},value:c._parse(new Vr(r,m,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of u){let m=await d.key,_=await d.value;c.push({key:m,value:_,alwaysSet:d.alwaysSet})}return c}).then(c=>Zt.mergeObjectSync(o,c)):Zt.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(t){return ke.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:ke.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:re.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of Ze.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of Ze.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return na(this)}partial(t){let n={};for(let o of Ze.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of Ze.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Zr;)i=i._def.innerType;n[o]=i}return new e({...this._def,shape:()=>n})}keyof(){return a0(Ze.objectKeys(this.shape))}};br.create=(e,t)=>new br({shape:()=>e,unknownKeys:"strip",catchall:Qr.create(),typeName:re.ZodObject,...Ae(t)});br.strictCreate=(e,t)=>new br({shape:()=>e,unknownKeys:"strict",catchall:Qr.create(),typeName:re.ZodObject,...Ae(t)});br.lazycreate=(e,t)=>new br({shape:e,unknownKeys:"strip",catchall:Qr.create(),typeName:re.ZodObject,...Ae(t)});var Bo=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;let s=i.map(l=>new _r(l.ctx.common.issues));return fe(n,{code:Q.invalid_union,unionErrors:s}),Ee}if(n.common.async)return Promise.all(o.map(async i=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let i,s=[];for(let u of o){let c={...n,common:{...n.common,issues:[]},parent:null},d=u._parseSync({data:n.data,path:n.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let l=s.map(u=>new _r(u));return fe(n,{code:Q.invalid_union,unionErrors:l}),Ee}}get options(){return this._def.options}};Bo.create=(e,t)=>new Bo({options:e,typeName:re.ZodUnion,...Ae(t)});var Nn=e=>e instanceof Ko?Nn(e.schema):e instanceof Wr?Nn(e.innerType()):e instanceof Yo?[e.value]:e instanceof Xo?e.options:e instanceof Qo?Ze.objectValues(e.enum):e instanceof ei?Nn(e._def.innerType):e instanceof Ho?[void 0]:e instanceof Jo?[null]:e instanceof Zr?[void 0,...Nn(e.unwrap())]:e instanceof vn?[null,...Nn(e.unwrap())]:e instanceof Ms||e instanceof ri?Nn(e.unwrap()):e instanceof ti?Nn(e._def.innerType):[],jc=class e extends qe{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.object)return fe(n,{code:Q.invalid_type,expected:he.object,received:n.parsedType}),Ee;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(fe(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let s=Nn(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of s){if(r.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);r.set(l,i)}}return new e({typeName:re.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Ae(o)})}};function vv(e,t){let n=hn(e),o=hn(t);if(e===t)return{valid:!0,data:e};if(n===he.object&&o===he.object){let r=Ze.objectKeys(t),i=Ze.objectKeys(e).filter(l=>r.indexOf(l)!==-1),s={...e,...t};for(let l of i){let u=vv(e[l],t[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(n===he.array&&o===he.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i{if(Oc(i)||Oc(s))return Ee;let l=vv(i.value,s.value);return l.valid?((Dc(i)||Dc(s))&&n.dirty(),{status:n.value,value:l.data}):(fe(o,{code:Q.invalid_intersection_types}),Ee)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,s])=>r(i,s)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Go.create=(e,t,n)=>new Go({left:e,right:t,typeName:re.ZodIntersection,...Ae(n)});var gn=class e extends qe{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.array)return fe(o,{code:Q.invalid_type,expected:he.array,received:o.parsedType}),Ee;if(o.data.lengththis._def.items.length&&(fe(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((s,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new Vr(o,s,o.path,l)):null}).filter(s=>!!s);return o.common.async?Promise.all(i).then(s=>Zt.mergeArray(n,s)):Zt.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};gn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gn({items:e,typeName:re.ZodTuple,rest:null,...Ae(t)})};var Nc=class e extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.object)return fe(o,{code:Q.invalid_type,expected:he.object,received:o.parsedType}),Ee;let r=[],i=this._def.keyType,s=this._def.valueType;for(let l in o.data)r.push({key:i._parse(new Vr(o,l,o.path,l)),value:s._parse(new Vr(o,o.data[l],o.path,l)),alwaysSet:l in o.data});return o.common.async?Zt.mergeObjectAsync(n,r):Zt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return n instanceof qe?new e({keyType:t,valueType:n,typeName:re.ZodRecord,...Ae(o)}):new e({keyType:lo.create(),valueType:t,typeName:re.ZodRecord,...Ae(n)})}},aa=class extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.map)return fe(o,{code:Q.invalid_type,expected:he.map,received:o.parsedType}),Ee;let r=this._def.keyType,i=this._def.valueType,s=[...o.data.entries()].map(([l,u],c)=>({key:r._parse(new Vr(o,l,o.path,[c,"key"])),value:i._parse(new Vr(o,u,o.path,[c,"value"]))}));if(o.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of s){let c=await u.key,d=await u.value;if(c.status==="aborted"||d.status==="aborted")return Ee;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(c.value,d.value)}return{status:n.value,value:l}})}else{let l=new Map;for(let u of s){let c=u.key,d=u.value;if(c.status==="aborted"||d.status==="aborted")return Ee;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(c.value,d.value)}return{status:n.value,value:l}}}};aa.create=(e,t,n)=>new aa({valueType:t,keyType:e,typeName:re.ZodMap,...Ae(n)});var sa=class e extends qe{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.set)return fe(o,{code:Q.invalid_type,expected:he.set,received:o.parsedType}),Ee;let r=this._def;r.minSize!==null&&o.data.sizer.maxSize.value&&(fe(o,{code:Q.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(u){let c=new Set;for(let d of u){if(d.status==="aborted")return Ee;d.status==="dirty"&&n.dirty(),c.add(d.value)}return{status:n.value,value:c}}let l=[...o.data.values()].map((u,c)=>i._parse(new Vr(o,u,o.path,c)));return o.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(t,n){return new e({...this._def,minSize:{value:t,message:ke.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:ke.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};sa.create=(e,t)=>new sa({valueType:e,minSize:null,maxSize:null,typeName:re.ZodSet,...Ae(t)});var Mc=class e extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.function)return fe(n,{code:Q.invalid_type,expected:he.function,received:n.parsedType}),Ee;function o(l,u){return Ns({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ta(),jn].filter(c=>!!c),issueData:{code:Q.invalid_arguments,argumentsError:u}})}function r(l,u){return Ns({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ta(),jn].filter(c=>!!c),issueData:{code:Q.invalid_return_type,returnTypeError:u}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof co){let l=this;return Yt(async function(...u){let c=new _r([]),d=await l._def.args.parseAsync(u,i).catch(h=>{throw c.addIssue(o(u,h)),c}),m=await Reflect.apply(s,this,d);return await l._def.returns._def.type.parseAsync(m,i).catch(h=>{throw c.addIssue(r(m,h)),c})})}else{let l=this;return Yt(function(...u){let c=l._def.args.safeParse(u,i);if(!c.success)throw new _r([o(u,c.error)]);let d=Reflect.apply(s,this,c.data),m=l._def.returns.safeParse(d,i);if(!m.success)throw new _r([r(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:gn.create(t).rest(Mn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||gn.create([]).rest(Mn.create()),returns:n||Mn.create(),typeName:re.ZodFunction,...Ae(o)})}},Ko=class extends qe{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ko.create=(e,t)=>new Ko({getter:e,typeName:re.ZodLazy,...Ae(t)});var Yo=class extends qe{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return fe(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yo.create=(e,t)=>new Yo({value:e,typeName:re.ZodLiteral,...Ae(t)});function a0(e,t){return new Xo({values:e,typeName:re.ZodEnum,...Ae(t)})}var Xo=class e extends qe{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return fe(n,{expected:Ze.joinValues(o),received:n.parsedType,code:Q.invalid_type}),Ee}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return fe(n,{received:n.data,code:Q.invalid_enum_value,options:o}),Ee}return Yt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...n})}};Xo.create=a0;var Qo=class extends qe{_parse(t){let n=Ze.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==he.string&&o.parsedType!==he.number){let r=Ze.objectValues(n);return fe(o,{expected:Ze.joinValues(r),received:o.parsedType,code:Q.invalid_type}),Ee}if(this._cache||(this._cache=new Set(Ze.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Ze.objectValues(n);return fe(o,{received:o.data,code:Q.invalid_enum_value,options:r}),Ee}return Yt(t.data)}get enum(){return this._def.values}};Qo.create=(e,t)=>new Qo({values:e,typeName:re.ZodNativeEnum,...Ae(t)});var co=class extends qe{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.promise&&n.common.async===!1)return fe(n,{code:Q.invalid_type,expected:he.promise,received:n.parsedType}),Ee;let o=n.parsedType===he.promise?n.data:Promise.resolve(n.data);return Yt(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};co.create=(e,t)=>new co({type:e,typeName:re.ZodPromise,...Ae(t)});var Wr=class extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:s=>{fe(o,s),s.fatal?n.abort():n.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let s=r.transform(o.data,i);if(o.common.async)return Promise.resolve(s).then(async l=>{if(n.value==="aborted")return Ee;let u=await this._def.schema._parseAsync({data:l,path:o.path,parent:o});return u.status==="aborted"?Ee:u.status==="dirty"?Lo(u.value):n.value==="dirty"?Lo(u.value):u});{if(n.value==="aborted")return Ee;let l=this._def.schema._parseSync({data:s,path:o.path,parent:o});return l.status==="aborted"?Ee:l.status==="dirty"?Lo(l.value):n.value==="dirty"?Lo(l.value):l}}if(r.type==="refinement"){let s=l=>{let u=r.refinement(l,i);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(o.common.async===!1){let l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ee:(l.status==="dirty"&&n.dirty(),s(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(l=>l.status==="aborted"?Ee:(l.status==="dirty"&&n.dirty(),s(l.value).then(()=>({status:n.value,value:l.value}))))}if(r.type==="transform")if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!so(s))return Ee;let l=r.transform(s.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>so(s)?Promise.resolve(r.transform(s.value,i)).then(l=>({status:n.value,value:l})):Ee);Ze.assertNever(r)}};Wr.create=(e,t,n)=>new Wr({schema:e,typeName:re.ZodEffects,effect:t,...Ae(n)});Wr.createWithPreprocess=(e,t,n)=>new Wr({schema:t,effect:{type:"preprocess",transform:e},typeName:re.ZodEffects,...Ae(n)});var Zr=class extends qe{_parse(t){return this._getType(t)===he.undefined?Yt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Zr.create=(e,t)=>new Zr({innerType:e,typeName:re.ZodOptional,...Ae(t)});var vn=class extends qe{_parse(t){return this._getType(t)===he.null?Yt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};vn.create=(e,t)=>new vn({innerType:e,typeName:re.ZodNullable,...Ae(t)});var ei=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return n.parsedType===he.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ei.create=(e,t)=>new ei({innerType:e,typeName:re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ae(t)});var ti=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return ra(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _r(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new _r(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};ti.create=(e,t)=>new ti({innerType:e,typeName:re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ae(t)});var la=class extends qe{_parse(t){if(this._getType(t)!==he.nan){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.nan,received:o.parsedType}),Ee}return{status:"valid",value:t.data}}};la.create=e=>new la({typeName:re.ZodNaN,...Ae(e)});var uA=Symbol("zod_brand"),Ms=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},As=class e extends qe{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?Ee:i.status==="dirty"?(n.dirty(),Lo(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?Ee:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:re.ZodPipeline})}},ri=class extends qe{_parse(t){let n=this._def.innerType._parse(t),o=r=>(so(r)&&(r.value=Object.freeze(r.value)),r);return ra(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};ri.create=(e,t)=>new ri({innerType:e,typeName:re.ZodReadonly,...Ae(t)});function r0(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function s0(e,t={},n){return e?uo.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then(s=>{if(!s){let l=r0(t,o),u=l.fatal??n??!0;r.addIssue({code:"custom",...l,fatal:u})}});if(!i){let s=r0(t,o),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}}):uo.create()}var cA={object:br.lazycreate},re;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(re||(re={}));var dA=(e,t={message:`Input not instance of ${e.name}`})=>s0(n=>n instanceof e,t),l0=lo.create,u0=Fo.create,pA=la.create,fA=Zo.create,c0=Vo.create,mA=Wo.create,hA=oa.create,gA=Ho.create,vA=Jo.create,yA=uo.create,_A=Mn.create,bA=Qr.create,wA=ia.create,xA=An.create,kA=br.create,SA=br.strictCreate,IA=Bo.create,TA=jc.create,$A=Go.create,PA=gn.create,EA=Nc.create,CA=aa.create,RA=sa.create,OA=Mc.create,DA=Ko.create,jA=Yo.create,NA=Xo.create,MA=Qo.create,AA=co.create,zA=Wr.create,qA=Zr.create,UA=vn.create,LA=Wr.createWithPreprocess,FA=As.create,ZA=()=>l0().optional(),VA=()=>u0().optional(),WA=()=>c0().optional(),HA={string:(e=>lo.create({...e,coerce:!0})),number:(e=>Fo.create({...e,coerce:!0})),boolean:(e=>Vo.create({...e,coerce:!0})),bigint:(e=>Zo.create({...e,coerce:!0})),date:(e=>Wo.create({...e,coerce:!0}))};var JA=Ee;var zs=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}},d0=10,BA=13,ni=32;function yv(e){}function m0(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=yv,onError:n=yv,onRetry:o=yv,onComment:r,maxBufferSize:i}=e,s=[],l=0,u=!0,c,d="",m=0,_,h=!1;function b(O){if(h)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(u&&(u=!1,O.charCodeAt(0)===239&&O.charCodeAt(1)===187&&O.charCodeAt(2)===191&&(O=O.slice(3))),s.length===0){let ee=T(O);ee!==""&&(s.push(ee),l=ee.length),k();return}if(O.indexOf(` -`)===-1&&O.indexOf("\r")===-1){s.push(O),l+=O.length,k();return}s.push(O);let N=s.join("");s.length=0,l=0;let K=T(N);K!==""&&(s.push(K),l=K.length),k()}function k(){i!==void 0&&(l+d.length<=i||(h=!0,s.length=0,l=0,c=void 0,d="",m=0,_=void 0,n(new zs(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function T(O){let N=0;if(O.indexOf("\r")===-1){let K=O.indexOf(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let m=d[1];if(t===d[0]){s(d);continue}if(o.external){let h=o.external.registry.get(d[0])?.id;if(t!==d[0]&&h){s(d);continue}}if(this.metadataRegistry.get(d[0])?.id){s(d);continue}if(m.cycle){s(d);continue}if(m.count>1&&o.reused==="ref"){s(d);continue}}let l=(d,m)=>{let _=this.seen.get(d),h=_.def??_.schema,b={...h};if(_.ref===null)return;let k=_.ref;if(_.ref=null,k){l(k,m);let I=this.seen.get(k).schema;I.$ref&&m.target==="draft-7"?(h.allOf=h.allOf??[],h.allOf.push(I)):(Object.assign(h,I),Object.assign(h,b))}_.isParent||this.override({zodSchema:d,jsonSchema:h,path:_.path??[]})};for(let d of[...this.seen.entries()].reverse())l(d[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),o.external?.uri){let d=o.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=o.external.uri(d)}Object.assign(u,r.def);let c=o.external?.defs??{};for(let d of this.seen.entries()){let m=d[1];m.def&&m.defId&&(c[m.defId]=m.def)}o.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function Ps(e,t){if(e instanceof Ki){let o=new $s(t),r={};for(let l of e._idmap.entries()){let[u,c]=l;o.process(c)}let i={},s={registry:e,uri:t?.uri,defs:r};for(let l of e._idmap.entries()){let[u,c]=l;i[u]=o.emit(c,{...t,external:s})}if(Object.keys(r).length>0){let l=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:r}}return{schemas:i}}let n=new $s(t);return n.process(e),n.emit(e,t)}function At(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return At(r.element,n);case"object":{for(let i in r.shape)if(At(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(At(i,n))return!0;return!1}case"intersection":return At(r.left,n)||At(r.right,n);case"tuple":{for(let i of r.items)if(At(i,n))return!0;return!!(r.rest&&At(r.rest,n))}case"record":return At(r.keyType,n)||At(r.valueType,n);case"map":return At(r.keyType,n)||At(r.valueType,n);case"set":return At(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return At(r.innerType,n);case"lazy":return At(r.getter(),n);case"default":return At(r.innerType,n);case"prefault":return At(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return At(r.in,n)||At(r.out,n);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var II={};var kc={};kn(kc,{ZodISODate:()=>bc,ZodISODateTime:()=>_c,ZodISODuration:()=>xc,ZodISOTime:()=>wc,date:()=>Ug,datetime:()=>qg,duration:()=>Fg,time:()=>Lg});var _c=j("ZodISODateTime",(e,t)=>{ih.init(e,t),gt.init(e,t)});function qg(e){return tg(_c,e)}var bc=j("ZodISODate",(e,t)=>{ah.init(e,t),gt.init(e,t)});function Ug(e){return rg(bc,e)}var wc=j("ZodISOTime",(e,t)=>{sh.init(e,t),gt.init(e,t)});function Lg(e){return ng(wc,e)}var xc=j("ZodISODuration",(e,t)=>{lh.init(e,t),gt.init(e,t)});function Fg(e){return og(xc,e)}var PI=(e,t)=>{os.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>as(e,n)},flatten:{value:n=>is(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},GN=j("ZodError",PI),ta=j("ZodError",PI,{Parent:Error});var Zg=Nu(ta),Vg=Au(ta),Wg=qu(ta),Es=Uu(ta);var Ue=j("ZodType",(e,t)=>(Ce.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Er(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>Zg(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>Wg(e,n,o),e.parseAsync=async(n,o)=>Vg(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Es(e,n,o),e.spa=e.safeParseAsync,e.refine=(n,o)=>e.check(h0(n,o)),e.superRefine=n=>e.check(g0(n)),e.overwrite=n=>e.check(On(n)),e.optional=()=>Ic(e),e.nullable=()=>$c(e),e.nullish=()=>Ic($c(e)),e.nonoptional=n=>n0(e,n),e.array=()=>fv(e),e.or=n=>Oc([e,n]),e.and=n=>ZI(e,n),e.transform=n=>Pc(e,vv(n)),e.default=n=>e0(e,n),e.prefault=n=>r0(e,n),e.catch=n=>a0(e,n),e.pipe=n=>Pc(e,n),e.readonly=()=>u0(e),e.describe=n=>{let o=e.clone();return hn.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return hn.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return hn.get(e);let o=e.clone();return hn.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Bg=j("_ZodString",(e,t)=>{qo.init(e,t),Ue.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(hs(...o)),e.includes=(...o)=>e.check(ys(...o)),e.startsWith=(...o)=>e.check(_s(...o)),e.endsWith=(...o)=>e.check(bs(...o)),e.min=(...o)=>e.check(lo(...o)),e.max=(...o)=>e.check(Qi(...o)),e.length=(...o)=>e.check(ea(...o)),e.nonempty=(...o)=>e.check(lo(1,...o)),e.lowercase=o=>e.check(gs(o)),e.uppercase=o=>e.check(vs(o)),e.trim=()=>e.check(ks()),e.normalize=(...o)=>e.check(xs(...o)),e.toLowerCase=()=>e.check(Ss()),e.toUpperCase=()=>e.check(Ts())}),Cs=j("ZodString",(e,t)=>{qo.init(e,t),Bg.init(e,t),e.email=n=>e.check(Yu(Gg,n)),e.url=n=>e.check(rc(Kg,n)),e.jwt=n=>e.check(vc(dv,n)),e.emoji=n=>e.check(nc(Yg,n)),e.guid=n=>e.check(fs(Sc,n)),e.uuid=n=>e.check(Xu(jn,n)),e.uuidv4=n=>e.check(Qu(jn,n)),e.uuidv6=n=>e.check(ec(jn,n)),e.uuidv7=n=>e.check(tc(jn,n)),e.nanoid=n=>e.check(oc(Xg,n)),e.guid=n=>e.check(fs(Sc,n)),e.cuid=n=>e.check(ic(Qg,n)),e.cuid2=n=>e.check(ac(ev,n)),e.ulid=n=>e.check(sc(tv,n)),e.base64=n=>e.check(mc(lv,n)),e.base64url=n=>e.check(hc(uv,n)),e.xid=n=>e.check(lc(rv,n)),e.ksuid=n=>e.check(uc(nv,n)),e.ipv4=n=>e.check(cc(ov,n)),e.ipv6=n=>e.check(dc(iv,n)),e.cidrv4=n=>e.check(pc(av,n)),e.cidrv6=n=>e.check(fc(sv,n)),e.e164=n=>e.check(gc(cv,n)),e.datetime=n=>e.check(qg(n)),e.date=n=>e.check(Ug(n)),e.time=n=>e.check(Lg(n)),e.duration=n=>e.check(Fg(n))});function Hg(e){return Xh(Cs,e)}var gt=j("ZodStringFormat",(e,t)=>{pt.init(e,t),Bg.init(e,t)}),Gg=j("ZodEmail",(e,t)=>{Km.init(e,t),gt.init(e,t)});function YN(e){return Yu(Gg,e)}var Sc=j("ZodGUID",(e,t)=>{Bm.init(e,t),gt.init(e,t)});function XN(e){return fs(Sc,e)}var jn=j("ZodUUID",(e,t)=>{Gm.init(e,t),gt.init(e,t)});function QN(e){return Xu(jn,e)}function eM(e){return Qu(jn,e)}function tM(e){return ec(jn,e)}function rM(e){return tc(jn,e)}var Kg=j("ZodURL",(e,t)=>{Ym.init(e,t),gt.init(e,t)});function nM(e){return rc(Kg,e)}var Yg=j("ZodEmoji",(e,t)=>{Xm.init(e,t),gt.init(e,t)});function oM(e){return nc(Yg,e)}var Xg=j("ZodNanoID",(e,t)=>{Qm.init(e,t),gt.init(e,t)});function iM(e){return oc(Xg,e)}var Qg=j("ZodCUID",(e,t)=>{eh.init(e,t),gt.init(e,t)});function aM(e){return ic(Qg,e)}var ev=j("ZodCUID2",(e,t)=>{th.init(e,t),gt.init(e,t)});function sM(e){return ac(ev,e)}var tv=j("ZodULID",(e,t)=>{rh.init(e,t),gt.init(e,t)});function lM(e){return sc(tv,e)}var rv=j("ZodXID",(e,t)=>{nh.init(e,t),gt.init(e,t)});function uM(e){return lc(rv,e)}var nv=j("ZodKSUID",(e,t)=>{oh.init(e,t),gt.init(e,t)});function cM(e){return uc(nv,e)}var ov=j("ZodIPv4",(e,t)=>{uh.init(e,t),gt.init(e,t)});function dM(e){return cc(ov,e)}var iv=j("ZodIPv6",(e,t)=>{ch.init(e,t),gt.init(e,t)});function pM(e){return dc(iv,e)}var av=j("ZodCIDRv4",(e,t)=>{dh.init(e,t),gt.init(e,t)});function fM(e){return pc(av,e)}var sv=j("ZodCIDRv6",(e,t)=>{ph.init(e,t),gt.init(e,t)});function mM(e){return fc(sv,e)}var lv=j("ZodBase64",(e,t)=>{mh.init(e,t),gt.init(e,t)});function hM(e){return mc(lv,e)}var uv=j("ZodBase64URL",(e,t)=>{hh.init(e,t),gt.init(e,t)});function gM(e){return hc(uv,e)}var cv=j("ZodE164",(e,t)=>{gh.init(e,t),gt.init(e,t)});function vM(e){return gc(cv,e)}var dv=j("ZodJWT",(e,t)=>{vh.init(e,t),gt.init(e,t)});function yM(e){return vc(dv,e)}var EI=j("ZodCustomStringFormat",(e,t)=>{yh.init(e,t),gt.init(e,t)});function _M(e,t,n={}){return Ag(EI,e,t,n)}var Os=j("ZodNumber",(e,t)=>{Hu.init(e,t),Ue.init(e,t),e.gt=(o,r)=>e.check(Cn(o,r)),e.gte=(o,r)=>e.check(yr(o,r)),e.min=(o,r)=>e.check(yr(o,r)),e.lt=(o,r)=>e.check(Rn(o,r)),e.lte=(o,r)=>e.check(Zr(o,r)),e.max=(o,r)=>e.check(Zr(o,r)),e.int=o=>e.check(Jg(o)),e.safe=o=>e.check(Jg(o)),e.positive=o=>e.check(Cn(0,o)),e.nonnegative=o=>e.check(yr(0,o)),e.negative=o=>e.check(Rn(0,o)),e.nonpositive=o=>e.check(Zr(0,o)),e.multipleOf=(o,r)=>e.check(Lo(o,r)),e.step=(o,r)=>e.check(Lo(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function RI(e){return ig(Os,e)}var ra=j("ZodNumberFormat",(e,t)=>{_h.init(e,t),Os.init(e,t)});function Jg(e){return sg(ra,e)}function bM(e){return lg(ra,e)}function wM(e){return ug(ra,e)}function xM(e){return cg(ra,e)}function kM(e){return dg(ra,e)}var Ds=j("ZodBoolean",(e,t)=>{ls.init(e,t),Ue.init(e,t)});function CI(e){return pg(Ds,e)}var js=j("ZodBigInt",(e,t)=>{Ju.init(e,t),Ue.init(e,t),e.gte=(o,r)=>e.check(yr(o,r)),e.min=(o,r)=>e.check(yr(o,r)),e.gt=(o,r)=>e.check(Cn(o,r)),e.gte=(o,r)=>e.check(yr(o,r)),e.min=(o,r)=>e.check(yr(o,r)),e.lt=(o,r)=>e.check(Rn(o,r)),e.lte=(o,r)=>e.check(Zr(o,r)),e.max=(o,r)=>e.check(Zr(o,r)),e.positive=o=>e.check(Cn(BigInt(0),o)),e.negative=o=>e.check(Rn(BigInt(0),o)),e.nonpositive=o=>e.check(Zr(BigInt(0),o)),e.nonnegative=o=>e.check(yr(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(Lo(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function SM(e){return mg(js,e)}var pv=j("ZodBigIntFormat",(e,t)=>{bh.init(e,t),js.init(e,t)});function TM(e){return gg(pv,e)}function IM(e){return vg(pv,e)}var OI=j("ZodSymbol",(e,t)=>{wh.init(e,t),Ue.init(e,t)});function $M(e){return yg(OI,e)}var DI=j("ZodUndefined",(e,t)=>{xh.init(e,t),Ue.init(e,t)});function PM(e){return _g(DI,e)}var jI=j("ZodNull",(e,t)=>{kh.init(e,t),Ue.init(e,t)});function NI(e){return bg(jI,e)}var MI=j("ZodAny",(e,t)=>{Sh.init(e,t),Ue.init(e,t)});function EM(){return wg(MI)}var AI=j("ZodUnknown",(e,t)=>{Gi.init(e,t),Ue.init(e,t)});function Tc(){return Yi(AI)}var zI=j("ZodNever",(e,t)=>{Th.init(e,t),Ue.init(e,t)});function Ec(e){return xg(zI,e)}var qI=j("ZodVoid",(e,t)=>{Ih.init(e,t),Ue.init(e,t)});function RM(e){return kg(qI,e)}var Rc=j("ZodDate",(e,t)=>{$h.init(e,t),Ue.init(e,t),e.min=(o,r)=>e.check(yr(o,r)),e.max=(o,r)=>e.check(Zr(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function CM(e){return Sg(Rc,e)}var UI=j("ZodArray",(e,t)=>{us.init(e,t),Ue.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(lo(n,o)),e.nonempty=n=>e.check(lo(1,n)),e.max=(n,o)=>e.check(Qi(n,o)),e.length=(n,o)=>e.check(ea(n,o)),e.unwrap=()=>e.element});function fv(e,t){return Is(UI,e,t)}function OM(e){let t=e._zod.def.shape;return KI(Object.keys(t))}var Cc=j("ZodObject",(e,t)=>{Ph.init(e,t),Ue.init(e,t),ce.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>BI(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Tc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Tc()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ec()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ce.extend(e,n),e.merge=n=>ce.merge(e,n),e.pick=n=>ce.pick(e,n),e.omit=n=>ce.omit(e,n),e.partial=(...n)=>ce.partial(yv,e,n[0]),e.required=(...n)=>ce.required(_v,e,n[0])});function DM(e,t){let n={type:"object",get shape(){return ce.assignProp(this,"shape",{...e}),this.shape},...ce.normalizeParams(t)};return new Cc(n)}function jM(e,t){return new Cc({type:"object",get shape(){return ce.assignProp(this,"shape",{...e}),this.shape},catchall:Ec(),...ce.normalizeParams(t)})}function NM(e,t){return new Cc({type:"object",get shape(){return ce.assignProp(this,"shape",{...e}),this.shape},catchall:Tc(),...ce.normalizeParams(t)})}var mv=j("ZodUnion",(e,t)=>{Bu.init(e,t),Ue.init(e,t),e.options=t.options});function Oc(e,t){return new mv({type:"union",options:e,...ce.normalizeParams(t)})}var LI=j("ZodDiscriminatedUnion",(e,t)=>{mv.init(e,t),Eh.init(e,t)});function MM(e,t,n){return new LI({type:"union",options:t,discriminator:e,...ce.normalizeParams(n)})}var FI=j("ZodIntersection",(e,t)=>{Rh.init(e,t),Ue.init(e,t)});function ZI(e,t){return new FI({type:"intersection",left:e,right:t})}var VI=j("ZodTuple",(e,t)=>{Uo.init(e,t),Ue.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function AM(e,t,n){let o=t instanceof Ce,r=o?n:t,i=o?t:null;return new VI({type:"tuple",items:e,rest:i,...ce.normalizeParams(r)})}var hv=j("ZodRecord",(e,t)=>{Ch.init(e,t),Ue.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function WI(e,t,n){return new hv({type:"record",keyType:e,valueType:t,...ce.normalizeParams(n)})}function zM(e,t,n){return new hv({type:"record",keyType:Oc([e,Ec()]),valueType:t,...ce.normalizeParams(n)})}var HI=j("ZodMap",(e,t)=>{Oh.init(e,t),Ue.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function qM(e,t,n){return new HI({type:"map",keyType:e,valueType:t,...ce.normalizeParams(n)})}var JI=j("ZodSet",(e,t)=>{Dh.init(e,t),Ue.init(e,t),e.min=(...n)=>e.check(Fo(...n)),e.nonempty=n=>e.check(Fo(1,n)),e.max=(...n)=>e.check(Xi(...n)),e.size=(...n)=>e.check(ms(...n))});function UM(e,t){return new JI({type:"set",valueType:e,...ce.normalizeParams(t)})}var Rs=j("ZodEnum",(e,t)=>{jh.init(e,t),Ue.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Rs({...t,checks:[],...ce.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Rs({...t,checks:[],...ce.normalizeParams(r),entries:i})}});function BI(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Rs({type:"enum",entries:n,...ce.normalizeParams(t)})}function LM(e,t){return new Rs({type:"enum",entries:e,...ce.normalizeParams(t)})}var GI=j("ZodLiteral",(e,t)=>{Nh.init(e,t),Ue.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function KI(e,t){return new GI({type:"literal",values:Array.isArray(e)?e:[e],...ce.normalizeParams(t)})}var YI=j("ZodFile",(e,t)=>{Mh.init(e,t),Ue.init(e,t),e.min=(n,o)=>e.check(Fo(n,o)),e.max=(n,o)=>e.check(Xi(n,o)),e.mime=(n,o)=>e.check(ws(Array.isArray(n)?n:[n],o))});function FM(e){return Dg(YI,e)}var gv=j("ZodTransform",(e,t)=>{cs.init(e,t),Ue.init(e,t),e._zod.parse=(n,o)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(ce.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(ce.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function vv(e){return new gv({type:"transform",transform:e})}var yv=j("ZodOptional",(e,t)=>{Ah.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ic(e){return new yv({type:"optional",innerType:e})}var XI=j("ZodNullable",(e,t)=>{zh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function $c(e){return new XI({type:"nullable",innerType:e})}function ZM(e){return Ic($c(e))}var QI=j("ZodDefault",(e,t)=>{qh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function e0(e,t){return new QI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var t0=j("ZodPrefault",(e,t)=>{Uh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function r0(e,t){return new t0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var _v=j("ZodNonOptional",(e,t)=>{Lh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function n0(e,t){return new _v({type:"nonoptional",innerType:e,...ce.normalizeParams(t)})}var o0=j("ZodSuccess",(e,t)=>{Fh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function VM(e){return new o0({type:"success",innerType:e})}var i0=j("ZodCatch",(e,t)=>{Zh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function a0(e,t){return new i0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var s0=j("ZodNaN",(e,t)=>{Vh.init(e,t),Ue.init(e,t)});function WM(e){return Ig(s0,e)}var bv=j("ZodPipe",(e,t)=>{ds.init(e,t),Ue.init(e,t),e.in=t.in,e.out=t.out});function Pc(e,t){return new bv({type:"pipe",in:e,out:t})}var l0=j("ZodReadonly",(e,t)=>{Wh.init(e,t),Ue.init(e,t)});function u0(e){return new l0({type:"readonly",innerType:e})}var c0=j("ZodTemplateLiteral",(e,t)=>{Hh.init(e,t),Ue.init(e,t)});function HM(e,t){return new c0({type:"template_literal",parts:e,...ce.normalizeParams(t)})}var d0=j("ZodLazy",(e,t)=>{Bh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.getter()});function p0(e){return new d0({type:"lazy",getter:e})}var f0=j("ZodPromise",(e,t)=>{Jh.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function JM(e){return new f0({type:"promise",innerType:e})}var Dc=j("ZodCustom",(e,t)=>{Gh.init(e,t),Ue.init(e,t)});function m0(e){let t=new $t({check:"custom"});return t._zod.check=e,t}function BM(e,t){return jg(Dc,e??(()=>!0),t)}function h0(e,t={}){return Ng(Dc,e,t)}function g0(e){let t=m0(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ce.issue(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(ce.issue(r))}},e(n.value,n)));return t}function GM(e,t={error:`Input not instance of ${e.name}`}){let n=new Dc({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...ce.normalizeParams(t)});return n._zod.bag.Class=e,n}var KM=(...e)=>Mg({Pipe:bv,Boolean:Ds,String:Cs,Transform:gv},...e);function YM(e){let t=p0(()=>Oc([Hg(e),RI(),CI(),NI(),fv(t),WI(Hg(),t)]));return t}function XM(e,t){return Pc(vv(e),t)}var QM={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function eA(e){jt({customError:e})}function tA(){return jt().customError}var wv={};kn(wv,{bigint:()=>iA,boolean:()=>oA,date:()=>aA,number:()=>nA,string:()=>rA});function rA(e){return Qh(Cs,e)}function nA(e){return ag(Os,e)}function oA(e){return fg(Ds,e)}function iA(e){return hg(js,e)}function aA(e){return Tg(Rc,e)}jt(Gu());var be={};kn(be,{BRAND:()=>OA,DIRTY:()=>Zo,EMPTY_PATH:()=>cA,INVALID:()=>Ee,NEVER:()=>g1,OK:()=>Xt,ParseStatus:()=>Vt,Schema:()=>qe,ZodAny:()=>po,ZodArray:()=>zn,ZodBigInt:()=>Wo,ZodBoolean:()=>Ho,ZodBranded:()=>Ms,ZodCatch:()=>ni,ZodDate:()=>Jo,ZodDefault:()=>ri,ZodDiscriminatedUnion:()=>Mc,ZodEffects:()=>Hr,ZodEnum:()=>ei,ZodError:()=>_r,ZodFirstPartyTypeKind:()=>re,ZodFunction:()=>zc,ZodIntersection:()=>Yo,ZodIssueCode:()=>Q,ZodLazy:()=>Xo,ZodLiteral:()=>Qo,ZodMap:()=>la,ZodNaN:()=>ca,ZodNativeEnum:()=>ti,ZodNever:()=>en,ZodNull:()=>Go,ZodNullable:()=>yn,ZodNumber:()=>Vo,ZodObject:()=>br,ZodOptional:()=>Vr,ZodParsedType:()=>he,ZodPipeline:()=>As,ZodPromise:()=>fo,ZodReadonly:()=>oi,ZodRecord:()=>Ac,ZodSchema:()=>qe,ZodSet:()=>ua,ZodString:()=>co,ZodSymbol:()=>aa,ZodTransformer:()=>Hr,ZodTuple:()=>vn,ZodType:()=>qe,ZodUndefined:()=>Bo,ZodUnion:()=>Ko,ZodUnknown:()=>An,ZodVoid:()=>sa,addIssueToContext:()=>fe,any:()=>LA,array:()=>WA,bigint:()=>MA,boolean:()=>$0,coerce:()=>h1,custom:()=>S0,date:()=>AA,datetimeRegex:()=>x0,defaultErrorMap:()=>Nn,discriminatedUnion:()=>GA,effect:()=>s1,enum:()=>o1,function:()=>t1,getErrorMap:()=>na,getParsedType:()=>gn,instanceof:()=>jA,intersection:()=>KA,isAborted:()=>jc,isAsync:()=>oa,isDirty:()=>Nc,isValid:()=>uo,late:()=>DA,lazy:()=>r1,literal:()=>n1,makeIssue:()=>Ns,map:()=>QA,nan:()=>NA,nativeEnum:()=>i1,never:()=>ZA,null:()=>UA,nullable:()=>u1,number:()=>I0,object:()=>HA,objectUtil:()=>xv,oboolean:()=>m1,onumber:()=>f1,optional:()=>l1,ostring:()=>p1,pipeline:()=>d1,preprocess:()=>c1,promise:()=>a1,quotelessJson:()=>sA,record:()=>XA,set:()=>e1,setErrorMap:()=>uA,strictObject:()=>JA,string:()=>T0,symbol:()=>zA,transformer:()=>s1,tuple:()=>YA,undefined:()=>qA,union:()=>BA,unknown:()=>FA,util:()=>Ze,void:()=>VA});var Ze;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let i={};for(let s of r)i[s]=s;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(l=>typeof r[r[l]]!="number"),s={};for(let l of i)s[l]=r[l];return e.objectValues(s)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.push(s);return i},e.find=(r,i)=>{for(let s of r)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(Ze||(Ze={}));var xv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(xv||(xv={}));var he=Ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gn=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}};var Q=Ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),sA=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),_r=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let l=o,u=0;for(;un.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};_r.create=e=>new _r(e);var lA=(e,t)=>{let n;switch(e.code){case Q.invalid_type:e.received===he.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ze.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ze.joinValues(e.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ze.joinValues(e.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Ze.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ze.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Q.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Q.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ze.assertNever(e)}return{message:n}},Nn=lA;var v0=Nn;function uA(e){v0=e}function na(){return v0}var Ns=e=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let l="",u=o.filter(c=>!!c).slice().reverse();for(let c of u)l=c(s,{data:t,defaultError:l}).message;return{...r,path:i,message:l}},cA=[];function fe(e,t){let n=na(),o=Ns({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Nn?void 0:Nn].filter(r=>!!r)});e.common.issues.push(o)}var Vt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return Ee;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted"||s.status==="aborted")return Ee;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(o[i.value]=s.value)}return{status:t.value,value:o}}},Ee=Object.freeze({status:"aborted"}),Zo=e=>({status:"dirty",value:e}),Xt=e=>({status:"valid",value:e}),jc=e=>e.status==="aborted",Nc=e=>e.status==="dirty",uo=e=>e.status==="valid",oa=e=>typeof Promise<"u"&&e instanceof Promise;var ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ke||(ke={}));var Wr=class{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},y0=(e,t)=>{if(uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new _r(e.common.issues);return this._error=n,this._error}}};function Ae(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(s,l)=>{let{message:u}=e;return s.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??o??l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:r}}var qe=class{get description(){return this._def.description}_getType(t){return gn(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:gn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Vt,ctx:{common:t.parent.common,data:t.data,parsedType:gn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(oa(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gn(t)},r=this._parseSync({data:t,path:o.path,parent:o});return y0(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gn(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return uo(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>uo(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gn(t)},r=this._parse({data:t,path:o.path,parent:o}),i=await(oa(r)?r:Promise.resolve(r));return y0(o,i)}refine(t,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{let s=t(r),l=()=>i.addIssue({code:Q.custom,...o(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(t,n){return this._refinement((o,r)=>t(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(t){return new Hr({schema:this,typeName:re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Vr.create(this,this._def)}nullable(){return yn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zn.create(this)}promise(){return fo.create(this,this._def)}or(t){return Ko.create([this,t],this._def)}and(t){return Yo.create(this,t,this._def)}transform(t){return new Hr({...Ae(this._def),schema:this,typeName:re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new ri({...Ae(this._def),innerType:this,defaultValue:n,typeName:re.ZodDefault})}brand(){return new Ms({typeName:re.ZodBranded,type:this,...Ae(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new ni({...Ae(this._def),innerType:this,catchValue:n,typeName:re.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return As.create(this,t)}readonly(){return oi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},dA=/^c[^\s-]{8,}$/i,pA=/^[0-9a-z]+$/,fA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hA=/^[a-z0-9_-]{21}$/i,gA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,yA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_A="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kv,bA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,wA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,kA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,SA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,b0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",IA=new RegExp(`^${b0}$`);function w0(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function $A(e){return new RegExp(`^${w0(e)}$`)}function x0(e){let t=`${b0}T${w0(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function PA(e,t){return!!((t==="v4"||!t)&&bA.test(e)||(t==="v6"||!t)&&xA.test(e))}function EA(e,t){if(!gA.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function RA(e,t){return!!((t==="v4"||!t)&&wA.test(e)||(t==="v6"||!t)&&kA.test(e))}var co=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_type,expected:he.string,received:i.parsedType}),Ee}let o=new Vt,r;for(let i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(r=this._getOrReturnCtx(t,r),fe(r,{code:Q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,l=t.data.lengtht.test(r),{validation:n,code:Q.invalid_string,...ke.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ke.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ke.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ke.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ke.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ke.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ke.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ke.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ke.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ke.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ke.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ke.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ke.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ke.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ke.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...ke.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ke.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ke.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ke.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ke.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ke.errToObj(n)})}nonempty(t){return this.min(1,ke.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew co({checks:[],typeName:re.ZodString,coerce:e?.coerce??!1,...Ae(e)});function CA(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}var Vo=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==he.number){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_type,expected:he.number,received:i.parsedType}),Ee}let o,r=new Vt;for(let i of this._def.checks)i.kind==="int"?Ze.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?CA(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.not_finite,message:i.message}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ke.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:ke.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ke.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Ze.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.valuenew Vo({checks:[],typeName:re.ZodNumber,coerce:e?.coerce||!1,...Ae(e)});var Wo=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==he.bigint)return this._getInvalidInput(t);let o,r=new Vt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),fe(o,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return fe(n,{code:Q.invalid_type,expected:he.bigint,received:n.parsedType}),Ee}gte(t,n){return this.setLimit("min",t,!0,ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ke.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:ke.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Wo({checks:[],typeName:re.ZodBigInt,coerce:e?.coerce??!1,...Ae(e)});var Ho=class extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.boolean,received:o.parsedType}),Ee}return Xt(t.data)}};Ho.create=e=>new Ho({typeName:re.ZodBoolean,coerce:e?.coerce||!1,...Ae(e)});var Jo=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_type,expected:he.date,received:i.parsedType}),Ee}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return fe(i,{code:Q.invalid_date}),Ee}let o=new Vt,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(r=this._getOrReturnCtx(t,r),fe(r,{code:Q.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):Ze.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ke.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ke.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Jo({checks:[],coerce:e?.coerce||!1,typeName:re.ZodDate,...Ae(e)});var aa=class extends qe{_parse(t){if(this._getType(t)!==he.symbol){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.symbol,received:o.parsedType}),Ee}return Xt(t.data)}};aa.create=e=>new aa({typeName:re.ZodSymbol,...Ae(e)});var Bo=class extends qe{_parse(t){if(this._getType(t)!==he.undefined){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.undefined,received:o.parsedType}),Ee}return Xt(t.data)}};Bo.create=e=>new Bo({typeName:re.ZodUndefined,...Ae(e)});var Go=class extends qe{_parse(t){if(this._getType(t)!==he.null){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.null,received:o.parsedType}),Ee}return Xt(t.data)}};Go.create=e=>new Go({typeName:re.ZodNull,...Ae(e)});var po=class extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Xt(t.data)}};po.create=e=>new po({typeName:re.ZodAny,...Ae(e)});var An=class extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xt(t.data)}};An.create=e=>new An({typeName:re.ZodUnknown,...Ae(e)});var en=class extends qe{_parse(t){let n=this._getOrReturnCtx(t);return fe(n,{code:Q.invalid_type,expected:he.never,received:n.parsedType}),Ee}};en.create=e=>new en({typeName:re.ZodNever,...Ae(e)});var sa=class extends qe{_parse(t){if(this._getType(t)!==he.undefined){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.void,received:o.parsedType}),Ee}return Xt(t.data)}};sa.create=e=>new sa({typeName:re.ZodVoid,...Ae(e)});var zn=class e extends qe{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==he.array)return fe(n,{code:Q.invalid_type,expected:he.array,received:n.parsedType}),Ee;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,l=n.data.lengthr.maxLength.value&&(fe(n,{code:Q.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,l)=>r.type._parseAsync(new Wr(n,s,n.path,l)))).then(s=>Vt.mergeArray(o,s));let i=[...n.data].map((s,l)=>r.type._parseSync(new Wr(n,s,n.path,l)));return Vt.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:ke.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:ke.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:ke.toString(n)}})}nonempty(t){return this.min(1,t)}};zn.create=(e,t)=>new zn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:re.ZodArray,...Ae(t)});function ia(e){if(e instanceof br){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=Vr.create(ia(o))}return new br({...e._def,shape:()=>t})}else return e instanceof zn?new zn({...e._def,type:ia(e.element)}):e instanceof Vr?Vr.create(ia(e.unwrap())):e instanceof yn?yn.create(ia(e.unwrap())):e instanceof vn?vn.create(e.items.map(t=>ia(t))):e}var br=class e extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Ze.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==he.object){let c=this._getOrReturnCtx(t);return fe(c,{code:Q.invalid_type,expected:he.object,received:c.parsedType}),Ee}let{status:o,ctx:r}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof en&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||l.push(c);let u=[];for(let c of s){let d=i[c],m=r.data[c];u.push({key:{status:"valid",value:c},value:d._parse(new Wr(r,m,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof en){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of l)u.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(c==="strict")l.length>0&&(fe(r,{code:Q.unrecognized_keys,keys:l}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of l){let m=r.data[d];u.push({key:{status:"valid",value:d},value:c._parse(new Wr(r,m,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of u){let m=await d.key,_=await d.value;c.push({key:m,value:_,alwaysSet:d.alwaysSet})}return c}).then(c=>Vt.mergeObjectSync(o,c)):Vt.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(t){return ke.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:ke.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:re.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of Ze.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of Ze.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return ia(this)}partial(t){let n={};for(let o of Ze.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of Ze.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Vr;)i=i._def.innerType;n[o]=i}return new e({...this._def,shape:()=>n})}keyof(){return k0(Ze.objectKeys(this.shape))}};br.create=(e,t)=>new br({shape:()=>e,unknownKeys:"strip",catchall:en.create(),typeName:re.ZodObject,...Ae(t)});br.strictCreate=(e,t)=>new br({shape:()=>e,unknownKeys:"strict",catchall:en.create(),typeName:re.ZodObject,...Ae(t)});br.lazycreate=(e,t)=>new br({shape:e,unknownKeys:"strip",catchall:en.create(),typeName:re.ZodObject,...Ae(t)});var Ko=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;let s=i.map(l=>new _r(l.ctx.common.issues));return fe(n,{code:Q.invalid_union,unionErrors:s}),Ee}if(n.common.async)return Promise.all(o.map(async i=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let i,s=[];for(let u of o){let c={...n,common:{...n.common,issues:[]},parent:null},d=u._parseSync({data:n.data,path:n.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let l=s.map(u=>new _r(u));return fe(n,{code:Q.invalid_union,unionErrors:l}),Ee}}get options(){return this._def.options}};Ko.create=(e,t)=>new Ko({options:e,typeName:re.ZodUnion,...Ae(t)});var Mn=e=>e instanceof Xo?Mn(e.schema):e instanceof Hr?Mn(e.innerType()):e instanceof Qo?[e.value]:e instanceof ei?e.options:e instanceof ti?Ze.objectValues(e.enum):e instanceof ri?Mn(e._def.innerType):e instanceof Bo?[void 0]:e instanceof Go?[null]:e instanceof Vr?[void 0,...Mn(e.unwrap())]:e instanceof yn?[null,...Mn(e.unwrap())]:e instanceof Ms||e instanceof oi?Mn(e.unwrap()):e instanceof ni?Mn(e._def.innerType):[],Mc=class e extends qe{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.object)return fe(n,{code:Q.invalid_type,expected:he.object,received:n.parsedType}),Ee;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(fe(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let s=Mn(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of s){if(r.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);r.set(l,i)}}return new e({typeName:re.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Ae(o)})}};function Sv(e,t){let n=gn(e),o=gn(t);if(e===t)return{valid:!0,data:e};if(n===he.object&&o===he.object){let r=Ze.objectKeys(t),i=Ze.objectKeys(e).filter(l=>r.indexOf(l)!==-1),s={...e,...t};for(let l of i){let u=Sv(e[l],t[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(n===he.array&&o===he.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i{if(jc(i)||jc(s))return Ee;let l=Sv(i.value,s.value);return l.valid?((Nc(i)||Nc(s))&&n.dirty(),{status:n.value,value:l.data}):(fe(o,{code:Q.invalid_intersection_types}),Ee)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,s])=>r(i,s)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Yo.create=(e,t,n)=>new Yo({left:e,right:t,typeName:re.ZodIntersection,...Ae(n)});var vn=class e extends qe{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.array)return fe(o,{code:Q.invalid_type,expected:he.array,received:o.parsedType}),Ee;if(o.data.lengththis._def.items.length&&(fe(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((s,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new Wr(o,s,o.path,l)):null}).filter(s=>!!s);return o.common.async?Promise.all(i).then(s=>Vt.mergeArray(n,s)):Vt.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};vn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vn({items:e,typeName:re.ZodTuple,rest:null,...Ae(t)})};var Ac=class e extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.object)return fe(o,{code:Q.invalid_type,expected:he.object,received:o.parsedType}),Ee;let r=[],i=this._def.keyType,s=this._def.valueType;for(let l in o.data)r.push({key:i._parse(new Wr(o,l,o.path,l)),value:s._parse(new Wr(o,o.data[l],o.path,l)),alwaysSet:l in o.data});return o.common.async?Vt.mergeObjectAsync(n,r):Vt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return n instanceof qe?new e({keyType:t,valueType:n,typeName:re.ZodRecord,...Ae(o)}):new e({keyType:co.create(),valueType:t,typeName:re.ZodRecord,...Ae(n)})}},la=class extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.map)return fe(o,{code:Q.invalid_type,expected:he.map,received:o.parsedType}),Ee;let r=this._def.keyType,i=this._def.valueType,s=[...o.data.entries()].map(([l,u],c)=>({key:r._parse(new Wr(o,l,o.path,[c,"key"])),value:i._parse(new Wr(o,u,o.path,[c,"value"]))}));if(o.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of s){let c=await u.key,d=await u.value;if(c.status==="aborted"||d.status==="aborted")return Ee;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(c.value,d.value)}return{status:n.value,value:l}})}else{let l=new Map;for(let u of s){let c=u.key,d=u.value;if(c.status==="aborted"||d.status==="aborted")return Ee;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(c.value,d.value)}return{status:n.value,value:l}}}};la.create=(e,t,n)=>new la({valueType:t,keyType:e,typeName:re.ZodMap,...Ae(n)});var ua=class e extends qe{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.set)return fe(o,{code:Q.invalid_type,expected:he.set,received:o.parsedType}),Ee;let r=this._def;r.minSize!==null&&o.data.sizer.maxSize.value&&(fe(o,{code:Q.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(u){let c=new Set;for(let d of u){if(d.status==="aborted")return Ee;d.status==="dirty"&&n.dirty(),c.add(d.value)}return{status:n.value,value:c}}let l=[...o.data.values()].map((u,c)=>i._parse(new Wr(o,u,o.path,c)));return o.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(t,n){return new e({...this._def,minSize:{value:t,message:ke.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:ke.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ua.create=(e,t)=>new ua({valueType:e,minSize:null,maxSize:null,typeName:re.ZodSet,...Ae(t)});var zc=class e extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.function)return fe(n,{code:Q.invalid_type,expected:he.function,received:n.parsedType}),Ee;function o(l,u){return Ns({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,na(),Nn].filter(c=>!!c),issueData:{code:Q.invalid_arguments,argumentsError:u}})}function r(l,u){return Ns({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,na(),Nn].filter(c=>!!c),issueData:{code:Q.invalid_return_type,returnTypeError:u}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof fo){let l=this;return Xt(async function(...u){let c=new _r([]),d=await l._def.args.parseAsync(u,i).catch(h=>{throw c.addIssue(o(u,h)),c}),m=await Reflect.apply(s,this,d);return await l._def.returns._def.type.parseAsync(m,i).catch(h=>{throw c.addIssue(r(m,h)),c})})}else{let l=this;return Xt(function(...u){let c=l._def.args.safeParse(u,i);if(!c.success)throw new _r([o(u,c.error)]);let d=Reflect.apply(s,this,c.data),m=l._def.returns.safeParse(d,i);if(!m.success)throw new _r([r(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:vn.create(t).rest(An.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||vn.create([]).rest(An.create()),returns:n||An.create(),typeName:re.ZodFunction,...Ae(o)})}},Xo=class extends qe{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Xo.create=(e,t)=>new Xo({getter:e,typeName:re.ZodLazy,...Ae(t)});var Qo=class extends qe{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return fe(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}};Qo.create=(e,t)=>new Qo({value:e,typeName:re.ZodLiteral,...Ae(t)});function k0(e,t){return new ei({values:e,typeName:re.ZodEnum,...Ae(t)})}var ei=class e extends qe{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return fe(n,{expected:Ze.joinValues(o),received:n.parsedType,code:Q.invalid_type}),Ee}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return fe(n,{received:n.data,code:Q.invalid_enum_value,options:o}),Ee}return Xt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...n})}};ei.create=k0;var ti=class extends qe{_parse(t){let n=Ze.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==he.string&&o.parsedType!==he.number){let r=Ze.objectValues(n);return fe(o,{expected:Ze.joinValues(r),received:o.parsedType,code:Q.invalid_type}),Ee}if(this._cache||(this._cache=new Set(Ze.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Ze.objectValues(n);return fe(o,{received:o.data,code:Q.invalid_enum_value,options:r}),Ee}return Xt(t.data)}get enum(){return this._def.values}};ti.create=(e,t)=>new ti({values:e,typeName:re.ZodNativeEnum,...Ae(t)});var fo=class extends qe{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.promise&&n.common.async===!1)return fe(n,{code:Q.invalid_type,expected:he.promise,received:n.parsedType}),Ee;let o=n.parsedType===he.promise?n.data:Promise.resolve(n.data);return Xt(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};fo.create=(e,t)=>new fo({type:e,typeName:re.ZodPromise,...Ae(t)});var Hr=class extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:s=>{fe(o,s),s.fatal?n.abort():n.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let s=r.transform(o.data,i);if(o.common.async)return Promise.resolve(s).then(async l=>{if(n.value==="aborted")return Ee;let u=await this._def.schema._parseAsync({data:l,path:o.path,parent:o});return u.status==="aborted"?Ee:u.status==="dirty"?Zo(u.value):n.value==="dirty"?Zo(u.value):u});{if(n.value==="aborted")return Ee;let l=this._def.schema._parseSync({data:s,path:o.path,parent:o});return l.status==="aborted"?Ee:l.status==="dirty"?Zo(l.value):n.value==="dirty"?Zo(l.value):l}}if(r.type==="refinement"){let s=l=>{let u=r.refinement(l,i);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(o.common.async===!1){let l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ee:(l.status==="dirty"&&n.dirty(),s(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(l=>l.status==="aborted"?Ee:(l.status==="dirty"&&n.dirty(),s(l.value).then(()=>({status:n.value,value:l.value}))))}if(r.type==="transform")if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!uo(s))return Ee;let l=r.transform(s.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>uo(s)?Promise.resolve(r.transform(s.value,i)).then(l=>({status:n.value,value:l})):Ee);Ze.assertNever(r)}};Hr.create=(e,t,n)=>new Hr({schema:e,typeName:re.ZodEffects,effect:t,...Ae(n)});Hr.createWithPreprocess=(e,t,n)=>new Hr({schema:t,effect:{type:"preprocess",transform:e},typeName:re.ZodEffects,...Ae(n)});var Vr=class extends qe{_parse(t){return this._getType(t)===he.undefined?Xt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Vr.create=(e,t)=>new Vr({innerType:e,typeName:re.ZodOptional,...Ae(t)});var yn=class extends qe{_parse(t){return this._getType(t)===he.null?Xt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};yn.create=(e,t)=>new yn({innerType:e,typeName:re.ZodNullable,...Ae(t)});var ri=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return n.parsedType===he.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ri.create=(e,t)=>new ri({innerType:e,typeName:re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ae(t)});var ni=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return oa(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _r(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new _r(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};ni.create=(e,t)=>new ni({innerType:e,typeName:re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ae(t)});var ca=class extends qe{_parse(t){if(this._getType(t)!==he.nan){let o=this._getOrReturnCtx(t);return fe(o,{code:Q.invalid_type,expected:he.nan,received:o.parsedType}),Ee}return{status:"valid",value:t.data}}};ca.create=e=>new ca({typeName:re.ZodNaN,...Ae(e)});var OA=Symbol("zod_brand"),Ms=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},As=class e extends qe{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?Ee:i.status==="dirty"?(n.dirty(),Zo(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?Ee:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:re.ZodPipeline})}},oi=class extends qe{_parse(t){let n=this._def.innerType._parse(t),o=r=>(uo(r)&&(r.value=Object.freeze(r.value)),r);return oa(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};oi.create=(e,t)=>new oi({innerType:e,typeName:re.ZodReadonly,...Ae(t)});function _0(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function S0(e,t={},n){return e?po.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then(s=>{if(!s){let l=_0(t,o),u=l.fatal??n??!0;r.addIssue({code:"custom",...l,fatal:u})}});if(!i){let s=_0(t,o),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}}):po.create()}var DA={object:br.lazycreate},re;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(re||(re={}));var jA=(e,t={message:`Input not instance of ${e.name}`})=>S0(n=>n instanceof e,t),T0=co.create,I0=Vo.create,NA=ca.create,MA=Wo.create,$0=Ho.create,AA=Jo.create,zA=aa.create,qA=Bo.create,UA=Go.create,LA=po.create,FA=An.create,ZA=en.create,VA=sa.create,WA=zn.create,HA=br.create,JA=br.strictCreate,BA=Ko.create,GA=Mc.create,KA=Yo.create,YA=vn.create,XA=Ac.create,QA=la.create,e1=ua.create,t1=zc.create,r1=Xo.create,n1=Qo.create,o1=ei.create,i1=ti.create,a1=fo.create,s1=Hr.create,l1=Vr.create,u1=yn.create,c1=Hr.createWithPreprocess,d1=As.create,p1=()=>T0().optional(),f1=()=>I0().optional(),m1=()=>$0().optional(),h1={string:(e=>co.create({...e,coerce:!0})),number:(e=>Vo.create({...e,coerce:!0})),boolean:(e=>Ho.create({...e,coerce:!0})),bigint:(e=>Wo.create({...e,coerce:!0})),date:(e=>Jo.create({...e,coerce:!0}))};var g1=Ee;var zs=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}},P0=10,v1=13,ii=32;function Tv(e){}function C0(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Tv,onError:n=Tv,onRetry:o=Tv,onComment:r,maxBufferSize:i}=e,s=[],l=0,u=!0,c,d="",m=0,_,h=!1;function b(O){if(h)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(u&&(u=!1,O.charCodeAt(0)===239&&O.charCodeAt(1)===187&&O.charCodeAt(2)===191&&(O=O.slice(3))),s.length===0){let ee=I(O);ee!==""&&(s.push(ee),l=ee.length),k();return}if(O.indexOf(` +`)===-1&&O.indexOf("\r")===-1){s.push(O),l+=O.length,k();return}s.push(O);let N=s.join("");s.length=0,l=0;let K=I(N);K!==""&&(s.push(K),l=K.length),k()}function k(){i!==void 0&&(l+d.length<=i||(h=!0,s.length=0,l=0,c=void 0,d="",m=0,_=void 0,n(new zs(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function I(O){let N=0;if(O.indexOf("\r")===-1){let K=O.indexOf(` `,N);for(;K!==-1;){if(N===K){m>0&&t({id:c,event:_,data:d}),c=void 0,d="",m=0,_=void 0,N=K+1,K=O.indexOf(` -`,N);continue}let ee=O.charCodeAt(N);if(p0(O,N,ee)){let E=O.charCodeAt(N+5)===ni?N+6:N+5,le=O.slice(E,K);if(m===0&&O.charCodeAt(K+1)===d0){t({id:c,event:_,data:le}),c=void 0,d="",_=void 0,N=K+2,K=O.indexOf(` +`,N);continue}let ee=O.charCodeAt(N);if(E0(O,N,ee)){let E=O.charCodeAt(N+5)===ii?N+6:N+5,le=O.slice(E,K);if(m===0&&O.charCodeAt(K+1)===P0){t({id:c,event:_,data:le}),c=void 0,d="",_=void 0,N=K+2,K=O.indexOf(` `,N);continue}d=m===0?le:`${d} -${le}`,m++}else f0(O,N,ee)?_=O.slice(O.charCodeAt(N+6)===ni?N+7:N+6,K)||void 0:R(O,N,K);N=K+1,K=O.indexOf(` +${le}`,m++}else R0(O,N,ee)?_=O.slice(O.charCodeAt(N+6)===ii?N+7:N+6,K)||void 0:C(O,N,K);N=K+1,K=O.indexOf(` `,N)}return O.slice(N)}for(;N20?`${O.slice(0,20)}\u2026`:O}"`,{type:"unknown-field",field:O,value:N,line:K}));break}}function v(){m>0&&t({id:c,event:_,data:d}),c=void 0,d="",m=0,_=void 0}function C(O={}){if(O.consume&&s.length>0){let N=s.join("");R(N,0,N.length)}u=!0,c=void 0,d="",m=0,_=void 0,s.length=0,l=0,h=!1}return{feed:b,reset:C}}function p0(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function f0(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Ac=class extends TransformStream{constructor({onError:t,onRetry:n,onComment:o,maxBufferSize:r}={}){let i;super({start(s){i=m0({onEvent:l=>{s.enqueue(l)},onError(l){typeof t=="function"&&t(l),(t==="terminate"||l.type==="max-buffer-size-exceeded")&&s.error(l)},onRetry:n,onComment:o,maxBufferSize:r})},transform(s){i.feed(s)}})}};function nt(...e){return e.reduce((t,n)=>({...t,...n??{}}),{})}function w0({tools:e=[],providerToolNames:t,resolveProviderToolName:n}){var o;let r={},i={};for(let s of e)if(s.type==="provider"){let l=(o=n?.(s))!=null?o:s.id in t?t[s.id]:void 0;if(l==null)continue;r[s.name]=l,i[l]=s.name}return{toProviderToolName:s=>{var l;return(l=r[s])!=null?l:s},toCustomToolName:s=>{var l;return(l=i[s])!=null?l:s}}}async function x0(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((o,r)=>{if(n?.aborted){r(h0());return}let i=setTimeout(()=>{s(),o()},e),s=()=>{clearTimeout(i),n?.removeEventListener("abort",l)},l=()=>{s(),r(h0())};n?.addEventListener("abort",l)})}function h0(){return new DOMException("Delay was aborted","AbortError")}function ua(e){return Object.fromEntries([...e.headers])}var{btoa:GA,atob:KA}=globalThis;function rn(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=KA(t);return Uint8Array.from(n,o=>o.codePointAt(0))}function yn(e){let t="";for(let n=0;nn)throw new ir({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${d}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let i=r.getReader(),s=[],l=0;try{for(;;){let{done:d,value:m}=await i.read();if(d)break;if(l+=m.length,l>n)throw new ir({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes.`});s.push(m)}}finally{try{await i.cancel()}finally{i.releaseLock()}}let u=new Uint8Array(l),c=0;for(let d of s)u.set(d,c),c+=d.length;return u}function qs(e){let t;try{t=new URL(e)}catch{throw new ir({url:e,message:`Invalid URL: ${e}`})}if(t.protocol==="data:")return;if(t.protocol!=="http:"&&t.protocol!=="https:")throw new ir({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let n=t.hostname;if(!n)throw new ir({url:e,message:"URL must have a hostname"});if(n==="localhost"||n.endsWith(".local")||n.endsWith(".localhost"))throw new ir({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith("[")&&n.endsWith("]")){let o=n.slice(1,-1);if(XA(o))throw new ir({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(T0(n)){if(wv(n))throw new ir({url:e,message:`URL with IP address ${n} is not allowed`});return}}function T0(e){let t=e.split(".");return t.length!==4?!1:t.every(n=>{let o=Number(n);return Number.isInteger(o)&&o>=0&&o<=255&&String(o)===n})}function wv(e){let t=e.split(".").map(Number),[n,o]=t;return n===0||n===10||n===127||n===169&&o===254||n===172&&o>=16&&o<=31||n===192&&o===168}function XA(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let n=t.slice(7);if(T0(n))return wv(n);let o=n.split(":");if(o.length===2){let r=parseInt(o[0],16),i=parseInt(o[1],16);if(!isNaN(r)&&!isNaN(i)){let s=r>>8&255,l=r&255,u=i>>8&255,c=i&255;return wv(`${s}.${l}.${u}.${c}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}async function Iv(e,t){var n,o;qs(e);try{let r=await fetch(e,{signal:t?.abortSignal});if(r.redirected&&qs(r.url),!r.ok)throw new ir({url:e,statusCode:r.status,statusText:r.statusText});let i=await Sv({response:r,url:e,maxBytes:(n=t?.maxBytes)!=null?n:zc}),s=(o=r.headers.get("content-type"))!=null?o:void 0;return new Blob([i],s?{type:s}:void 0)}catch(r){throw ir.isInstance(r)?r:new ir({url:e,cause:r})}}var zn=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{let r=()=>{let i=n.length,s=new Array(t);for(let l=0;l`${e}${o}${r()}`},Vt=zn();function qc(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}function po(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var QA=["fetch failed","failed to fetch"],e1=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function t1(e){if(!(e instanceof Error))return!1;let t=e.code;return!!(typeof t=="string"&&e1.includes(t))}function $0({error:e,url:t,requestBodyValues:n}){if(po(e))return e;if(e instanceof TypeError&&QA.includes(e.message.toLowerCase())){let o=e.cause;if(o!=null)return new Je({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:n,isRetryable:!0})}return t1(e)?new Je({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:n,isRetryable:!0}):e}function Uc(e=globalThis){var t,n,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(n=e.process)==null?void 0:n.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function r1(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((n,o)=>{t[o.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,o]of e)o!=null&&(t[n.toLowerCase()]=o)}return t}function nn(e,...t){let n=new Headers(r1(e)),o=n.get("user-agent")||"";return n.set("user-agent",[o,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var P0="4.0.27",n1=()=>globalThis.fetch,ii=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:o,abortSignal:r,fetch:i=n1()})=>{try{let s=await i(e,{method:"GET",headers:nn(t,`ai-sdk/provider-utils/${P0}`,Uc()),signal:r}),l=ua(s);if(!s.ok){let u;try{u=await o({response:s,url:e,requestBodyValues:{}})}catch(c){throw po(c)||Je.isInstance(c)?c:new Je({message:"Failed to process error response",cause:c,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:{}})}throw u.value}try{return await n({response:s,url:e,requestBodyValues:{}})}catch(u){throw u instanceof Error&&(po(u)||Je.isInstance(u))?u:new Je({message:"Failed to process successful response",cause:u,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:{}})}}catch(s){throw $0({error:s,url:e,requestBodyValues:{}})}};function Tv(e){return e!=null}function E0({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([o,r])=>{let i=o.toLowerCase();return i==="*"||i==="*/*"?{mediaTypePrefix:"",regexes:r}:{mediaTypePrefix:i.replace(/\*/,""),regexes:r}}).filter(({mediaTypePrefix:o})=>e.startsWith(o)).flatMap(({regexes:o})=>o).some(o=>o.test(t))}function C0({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:o}){if(typeof e=="string")return e;if(e!=null)throw new Ga({message:`${o} API key must be a string.`});if(typeof process>"u")throw new Ga({message:`${o} API key is missing. Pass it using the '${n}' parameter. Environment variables are not supported in this environment.`});if(e=process.env[t],e==null)throw new Ga({message:`${o} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!="string")throw new Ga({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function mo({settingValue:e,environmentVariableName:t}){if(typeof e=="string")return e;if(!(e!=null||typeof process>"u")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}function R0(e){var t;let[n,o=""]=e.toLowerCase().split("/");return(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[o])!=null?t:o}var o1=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i1=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function y0(e){let t=JSON.parse(e);return t===null||typeof t!="object"||o1.test(e)===!1&&i1.test(e)===!1?t:a1(t)}function a1(e){let t=[e];for(;t.length;){let n=t;t=[];for(let o of n){if(Object.prototype.hasOwnProperty.call(o,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in o){let i=o[r];i&&typeof i=="object"&&t.push(i)}}}return e}function $v(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return y0(e)}try{return y0(e)}finally{Error.stackTraceLimit=t}}function Pv(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:n}=e;if(n!=null)for(let o of Object.keys(n))n[o]=oi(n[o])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(oi):oi(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(oi)),e.allOf!=null&&(e.allOf=e.allOf.map(oi)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(oi));let{definitions:t}=e;if(t!=null)for(let n of Object.keys(t))t[n]=oi(t[n]);return e}function oi(e){return typeof e=="boolean"?e:Pv(e)}var s1=Symbol("Let zodToJsonSchema decide on which parser to use"),_0={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},l1=e=>typeof e=="string"?{..._0,name:e}:{..._0,...e};function Rr(){return{}}function u1(e,t){var n,o,r;let i={type:"array"};return(n=e.type)!=null&&n._def&&((r=(o=e.type)==null?void 0:o._def)==null?void 0:r.typeName)!==re.ZodAny&&(i.items=rt(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}function c1(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function d1(){return{type:"boolean"}}function O0(e,t){return rt(e.type._def,t)}var p1=(e,t)=>rt(e.innerType._def,t);function D0(e,t,n){let o=n??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>D0(e,t,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return f1(e)}}var f1=e=>{let t={type:"integer",format:"unix-time"};for(let n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function m1(e,t){return{...rt(e.innerType._def,t),default:e.defaultValue()}}function h1(e,t){return t.effectStrategy==="input"?rt(e.schema._def,t):Rr()}function g1(e){return{type:"string",enum:Array.from(e.values)}}var v1=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function y1(e,t){let n=[rt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),rt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),o=[];return n.forEach(r=>{if(v1(r))o.push(...r.allOf);else{let i=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:s,...l}=r;i=l}o.push(i)}}),o.length?{allOf:o}:void 0}function _1(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var _v=void 0,en={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(_v===void 0&&(_v=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_v),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function j0(e,t){let n={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"email":switch(t.emailStrategy){case"format:email":tn(n,"email",o.message,t);break;case"format:idn-email":tn(n,"idn-email",o.message,t);break;case"pattern:zod":or(n,en.email,o.message,t);break}break;case"url":tn(n,"uri",o.message,t);break;case"uuid":tn(n,"uuid",o.message,t);break;case"regex":or(n,o.regex,o.message,t);break;case"cuid":or(n,en.cuid,o.message,t);break;case"cuid2":or(n,en.cuid2,o.message,t);break;case"startsWith":or(n,RegExp(`^${bv(o.value,t)}`),o.message,t);break;case"endsWith":or(n,RegExp(`${bv(o.value,t)}$`),o.message,t);break;case"datetime":tn(n,"date-time",o.message,t);break;case"date":tn(n,"date",o.message,t);break;case"time":tn(n,"time",o.message,t);break;case"duration":tn(n,"duration",o.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"includes":{or(n,RegExp(bv(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&tn(n,"ipv4",o.message,t),o.version!=="v4"&&tn(n,"ipv6",o.message,t);break}case"base64url":or(n,en.base64url,o.message,t);break;case"jwt":or(n,en.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&or(n,en.ipv4Cidr,o.message,t),o.version!=="v4"&&or(n,en.ipv6Cidr,o.message,t);break}case"emoji":or(n,en.emoji(),o.message,t);break;case"ulid":{or(n,en.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{tn(n,"binary",o.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{or(n,en.base64,o.message,t);break}}break}case"nanoid":or(n,en.nanoid,o.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function bv(e,t){return t.patternStrategy==="escape"?w1(e):e}var b1=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function w1(e){let t="";for(let n=0;ni.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&o.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function or(e,t,n,o){var r;e.pattern||(r=e.allOf)!=null&&r.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:b0(t,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=b0(t,o)}function b0(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let o={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=o.i?e.source.toLowerCase():e.source,i="",s=!1,l=!1,u=!1;for(let c=0;c20?`${O.slice(0,20)}\u2026`:O}"`,{type:"unknown-field",field:O,value:N,line:K}));break}}function v(){m>0&&t({id:c,event:_,data:d}),c=void 0,d="",m=0,_=void 0}function R(O={}){if(O.consume&&s.length>0){let N=s.join("");C(N,0,N.length)}u=!0,c=void 0,d="",m=0,_=void 0,s.length=0,l=0,h=!1}return{feed:b,reset:R}}function E0(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function R0(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var qc=class extends TransformStream{constructor({onError:t,onRetry:n,onComment:o,maxBufferSize:r}={}){let i;super({start(s){i=C0({onEvent:l=>{s.enqueue(l)},onError(l){typeof t=="function"&&t(l),(t==="terminate"||l.type==="max-buffer-size-exceeded")&&s.error(l)},onRetry:n,onComment:o,maxBufferSize:r})},transform(s){i.feed(s)}})}};function nt(...e){return e.reduce((t,n)=>({...t,...n??{}}),{})}function z0({tools:e=[],providerToolNames:t,resolveProviderToolName:n}){var o;let r={},i={};for(let s of e)if(s.type==="provider"){let l=(o=n?.(s))!=null?o:s.id in t?t[s.id]:void 0;if(l==null)continue;r[s.name]=l,i[l]=s.name}return{toProviderToolName:s=>{var l;return(l=r[s])!=null?l:s},toCustomToolName:s=>{var l;return(l=i[s])!=null?l:s}}}async function q0(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((o,r)=>{if(n?.aborted){r(O0());return}let i=setTimeout(()=>{s(),o()},e),s=()=>{clearTimeout(i),n?.removeEventListener("abort",l)},l=()=>{s(),r(O0())};n?.addEventListener("abort",l)})}function O0(){return new DOMException("Delay was aborted","AbortError")}function da(e){return Object.fromEntries([...e.headers])}var{btoa:y1,atob:_1}=globalThis;function nn(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=_1(t);return Uint8Array.from(n,o=>o.codePointAt(0))}function _n(e){let t="";for(let n=0;nn)throw new ar({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${d}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let i=r.getReader(),s=[],l=0;try{for(;;){let{done:d,value:m}=await i.read();if(d)break;if(l+=m.length,l>n)throw new ar({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes.`});s.push(m)}}finally{try{await i.cancel()}finally{i.releaseLock()}}let u=new Uint8Array(l),c=0;for(let d of s)u.set(d,c),c+=d.length;return u}function qs(e){let t;try{t=new URL(e)}catch{throw new ar({url:e,message:`Invalid URL: ${e}`})}if(t.protocol==="data:")return;if(t.protocol!=="http:"&&t.protocol!=="https:")throw new ar({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let n=t.hostname;if(!n)throw new ar({url:e,message:"URL must have a hostname"});if(n==="localhost"||n.endsWith(".local")||n.endsWith(".localhost"))throw new ar({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith("[")&&n.endsWith("]")){let o=n.slice(1,-1);if(w1(o))throw new ar({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(Z0(n)){if(Pv(n))throw new ar({url:e,message:`URL with IP address ${n} is not allowed`});return}}function Z0(e){let t=e.split(".");return t.length!==4?!1:t.every(n=>{let o=Number(n);return Number.isInteger(o)&&o>=0&&o<=255&&String(o)===n})}function Pv(e){let t=e.split(".").map(Number),[n,o]=t;return n===0||n===10||n===127||n===169&&o===254||n===172&&o>=16&&o<=31||n===192&&o===168}function w1(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let n=t.slice(7);if(Z0(n))return Pv(n);let o=n.split(":");if(o.length===2){let r=parseInt(o[0],16),i=parseInt(o[1],16);if(!isNaN(r)&&!isNaN(i)){let s=r>>8&255,l=r&255,u=i>>8&255,c=i&255;return Pv(`${s}.${l}.${u}.${c}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}async function Ov(e,t){var n,o;qs(e);try{let r=await fetch(e,{signal:t?.abortSignal});if(r.redirected&&qs(r.url),!r.ok)throw new ar({url:e,statusCode:r.status,statusText:r.statusText});let i=await Cv({response:r,url:e,maxBytes:(n=t?.maxBytes)!=null?n:Uc}),s=(o=r.headers.get("content-type"))!=null?o:void 0;return new Blob([i],s?{type:s}:void 0)}catch(r){throw ar.isInstance(r)?r:new ar({url:e,cause:r})}}var qn=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{let r=()=>{let i=n.length,s=new Array(t);for(let l=0;l`${e}${o}${r()}`},Wt=qn();function Lc(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}function mo(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var x1=["fetch failed","failed to fetch"],k1=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function S1(e){if(!(e instanceof Error))return!1;let t=e.code;return!!(typeof t=="string"&&k1.includes(t))}function V0({error:e,url:t,requestBodyValues:n}){if(mo(e))return e;if(e instanceof TypeError&&x1.includes(e.message.toLowerCase())){let o=e.cause;if(o!=null)return new Je({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:n,isRetryable:!0})}return S1(e)?new Je({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:n,isRetryable:!0}):e}function Fc(e=globalThis){var t,n,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(n=e.process)==null?void 0:n.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function T1(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((n,o)=>{t[o.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,o]of e)o!=null&&(t[n.toLowerCase()]=o)}return t}function on(e,...t){let n=new Headers(T1(e)),o=n.get("user-agent")||"";return n.set("user-agent",[o,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var W0="4.0.27",I1=()=>globalThis.fetch,si=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:o,abortSignal:r,fetch:i=I1()})=>{try{let s=await i(e,{method:"GET",headers:on(t,`ai-sdk/provider-utils/${W0}`,Fc()),signal:r}),l=da(s);if(!s.ok){let u;try{u=await o({response:s,url:e,requestBodyValues:{}})}catch(c){throw mo(c)||Je.isInstance(c)?c:new Je({message:"Failed to process error response",cause:c,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:{}})}throw u.value}try{return await n({response:s,url:e,requestBodyValues:{}})}catch(u){throw u instanceof Error&&(mo(u)||Je.isInstance(u))?u:new Je({message:"Failed to process successful response",cause:u,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:{}})}}catch(s){throw V0({error:s,url:e,requestBodyValues:{}})}};function Dv(e){return e!=null}function H0({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([o,r])=>{let i=o.toLowerCase();return i==="*"||i==="*/*"?{mediaTypePrefix:"",regexes:r}:{mediaTypePrefix:i.replace(/\*/,""),regexes:r}}).filter(({mediaTypePrefix:o})=>e.startsWith(o)).flatMap(({regexes:o})=>o).some(o=>o.test(t))}function J0({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:o}){if(typeof e=="string")return e;if(e!=null)throw new Ga({message:`${o} API key must be a string.`});if(typeof process>"u")throw new Ga({message:`${o} API key is missing. Pass it using the '${n}' parameter. Environment variables are not supported in this environment.`});if(e=process.env[t],e==null)throw new Ga({message:`${o} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!="string")throw new Ga({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function go({settingValue:e,environmentVariableName:t}){if(typeof e=="string")return e;if(!(e!=null||typeof process>"u")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}function B0(e){var t;let[n,o=""]=e.toLowerCase().split("/");return(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[o])!=null?t:o}var $1=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,P1=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function N0(e){let t=JSON.parse(e);return t===null||typeof t!="object"||$1.test(e)===!1&&P1.test(e)===!1?t:E1(t)}function E1(e){let t=[e];for(;t.length;){let n=t;t=[];for(let o of n){if(Object.prototype.hasOwnProperty.call(o,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in o){let i=o[r];i&&typeof i=="object"&&t.push(i)}}}return e}function jv(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return N0(e)}try{return N0(e)}finally{Error.stackTraceLimit=t}}function Nv(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:n}=e;if(n!=null)for(let o of Object.keys(n))n[o]=ai(n[o])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ai):ai(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ai)),e.allOf!=null&&(e.allOf=e.allOf.map(ai)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ai));let{definitions:t}=e;if(t!=null)for(let n of Object.keys(t))t[n]=ai(t[n]);return e}function ai(e){return typeof e=="boolean"?e:Nv(e)}var R1=Symbol("Let zodToJsonSchema decide on which parser to use"),M0={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},C1=e=>typeof e=="string"?{...M0,name:e}:{...M0,...e};function Cr(){return{}}function O1(e,t){var n,o,r;let i={type:"array"};return(n=e.type)!=null&&n._def&&((r=(o=e.type)==null?void 0:o._def)==null?void 0:r.typeName)!==re.ZodAny&&(i.items=rt(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}function D1(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function j1(){return{type:"boolean"}}function G0(e,t){return rt(e.type._def,t)}var N1=(e,t)=>rt(e.innerType._def,t);function K0(e,t,n){let o=n??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>K0(e,t,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return M1(e)}}var M1=e=>{let t={type:"integer",format:"unix-time"};for(let n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function A1(e,t){return{...rt(e.innerType._def,t),default:e.defaultValue()}}function z1(e,t){return t.effectStrategy==="input"?rt(e.schema._def,t):Cr()}function q1(e){return{type:"string",enum:Array.from(e.values)}}var U1=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function L1(e,t){let n=[rt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),rt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),o=[];return n.forEach(r=>{if(U1(r))o.push(...r.allOf);else{let i=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:s,...l}=r;i=l}o.push(i)}}),o.length?{allOf:o}:void 0}function F1(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Iv=void 0,tn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Iv===void 0&&(Iv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Iv),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Y0(e,t){let n={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"email":switch(t.emailStrategy){case"format:email":rn(n,"email",o.message,t);break;case"format:idn-email":rn(n,"idn-email",o.message,t);break;case"pattern:zod":ir(n,tn.email,o.message,t);break}break;case"url":rn(n,"uri",o.message,t);break;case"uuid":rn(n,"uuid",o.message,t);break;case"regex":ir(n,o.regex,o.message,t);break;case"cuid":ir(n,tn.cuid,o.message,t);break;case"cuid2":ir(n,tn.cuid2,o.message,t);break;case"startsWith":ir(n,RegExp(`^${$v(o.value,t)}`),o.message,t);break;case"endsWith":ir(n,RegExp(`${$v(o.value,t)}$`),o.message,t);break;case"datetime":rn(n,"date-time",o.message,t);break;case"date":rn(n,"date",o.message,t);break;case"time":rn(n,"time",o.message,t);break;case"duration":rn(n,"duration",o.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"includes":{ir(n,RegExp($v(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&rn(n,"ipv4",o.message,t),o.version!=="v4"&&rn(n,"ipv6",o.message,t);break}case"base64url":ir(n,tn.base64url,o.message,t);break;case"jwt":ir(n,tn.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&ir(n,tn.ipv4Cidr,o.message,t),o.version!=="v4"&&ir(n,tn.ipv6Cidr,o.message,t);break}case"emoji":ir(n,tn.emoji(),o.message,t);break;case"ulid":{ir(n,tn.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{rn(n,"binary",o.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{ir(n,tn.base64,o.message,t);break}}break}case"nanoid":ir(n,tn.nanoid,o.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function $v(e,t){return t.patternStrategy==="escape"?V1(e):e}var Z1=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function V1(e){let t="";for(let n=0;ni.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&o.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function ir(e,t,n,o){var r;e.pattern||(r=e.allOf)!=null&&r.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:A0(t,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=A0(t,o)}function A0(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let o={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=o.i?e.source.toLowerCase():e.source,i="",s=!1,l=!1,u=!1;for(let c=0;ctypeof t[t[i]]!="number").map(i=>t[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function S1(){return{not:Rr()}}function I1(){return{type:"null"}}var xv={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function T1(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in xv&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let s=xv[i._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(o.length===n.length){let r=o.filter((i,s,l)=>l.indexOf(i)===s);return{type:r.length>1?r:r[0],enum:n.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return $1(e,t)}var $1=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,r)=>rt(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function P1(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[xv[e.innerType._def.typeName],"null"]};let n=rt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function E1(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function C1(e,t){let n={type:"object",properties:{}},o=[],r=e.shape();for(let s in r){let l=r[s];if(l===void 0||l._def===void 0)continue;let u=O1(l),c=rt(l._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});c!==void 0&&(n.properties[s]=c,u||o.push(s))}o.length&&(n.required=o);let i=R1(e,t);return i!==void 0&&(n.additionalProperties=i),n}function R1(e,t){if(e.catchall._def.typeName!=="ZodNever")return rt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function O1(e){try{return e.isOptional()}catch{return!0}}var D1=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return rt(e.innerType._def,t);let o=rt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return o?{anyOf:[{not:Rr()},o]}:Rr()},j1=(e,t)=>{if(t.pipeStrategy==="input")return rt(e.in._def,t);if(t.pipeStrategy==="output")return rt(e.out._def,t);let n=rt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=rt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function N1(e,t){return rt(e.type._def,t)}function M1(e,t){let o={type:"array",uniqueItems:!0,items:rt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(o.minItems=e.minSize.value),e.maxSize&&(o.maxItems=e.maxSize.value),o}function A1(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,o)=>rt(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:rt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,o)=>rt(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function z1(){return{not:Rr()}}function q1(){return Rr()}var U1=(e,t)=>rt(e.innerType._def,t),L1=(e,t,n)=>{switch(t){case re.ZodString:return j0(e,n);case re.ZodNumber:return E1(e);case re.ZodObject:return C1(e,n);case re.ZodBigInt:return c1(e);case re.ZodBoolean:return d1();case re.ZodDate:return D0(e,n);case re.ZodUndefined:return z1();case re.ZodNull:return I1();case re.ZodArray:return u1(e,n);case re.ZodUnion:case re.ZodDiscriminatedUnion:return T1(e,n);case re.ZodIntersection:return y1(e,n);case re.ZodTuple:return A1(e,n);case re.ZodRecord:return N0(e,n);case re.ZodLiteral:return _1(e);case re.ZodEnum:return g1(e);case re.ZodNativeEnum:return k1(e);case re.ZodNullable:return P1(e,n);case re.ZodOptional:return D1(e,n);case re.ZodMap:return x1(e,n);case re.ZodSet:return M1(e,n);case re.ZodLazy:return()=>e.getter()._def;case re.ZodPromise:return N1(e,n);case re.ZodNaN:case re.ZodNever:return S1();case re.ZodEffects:return h1(e,n);case re.ZodAny:return Rr();case re.ZodUnknown:return q1();case re.ZodDefault:return m1(e,n);case re.ZodBranded:return O0(e,n);case re.ZodReadonly:return U1(e,n);case re.ZodCatch:return p1(e,n);case re.ZodPipeline:return j1(e,n);case re.ZodFunction:case re.ZodVoid:case re.ZodSymbol:return;default:return(o=>{})(t)}},F1=(e,t)=>{let n=0;for(;n{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:F1(t.currentPath,e.path)};case"none":case"seen":return e.path.lengtht.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Rr()):t.$refStrategy==="seen"?Rr():void 0}},V1=(e,t,n)=>(e.description&&(n.description=e.description),n),W1=e=>{let t=l1(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}},H1=(e,t)=>{var n;let o=W1(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[d,m])=>{var _;return{...c,[d]:(_=rt(m._def,{...o,currentPath:[...o.basePath,o.definitionPath,d]},!0))!=null?_:Rr()}},{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,s=(n=rt(e._def,i===void 0?o:{...o,currentPath:[...o.basePath,o.definitionPath,i]},!1))!=null?n:Rr(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(s.title=l);let u=i===void 0?r?{...s,[o.definitionPath]:r}:s:{$ref:[...o.$refStrategy==="relative"?[]:o.basePath,o.definitionPath,i].join("/"),[o.definitionPath]:{...r,[i]:s}};return u.$schema="http://json-schema.org/draft-07/schema#",u},kv=Symbol.for("vercel.ai.schema");function X(e){let t;return()=>(t==null&&(t=e()),t)}function Lc(e,{validate:t}={}){return{[kv]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function J1(e){return typeof e=="object"&&e!==null&&kv in e&&e[kv]===!0&&"jsonSchema"in e&&"validate"in e}function qn(e){return e==null?Lc({properties:{},additionalProperties:!1}):J1(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Y(e):B1(e):e()}function B1(e){return Lc(()=>Pv(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new Xr({value:t,cause:n.issues})}}})}function G1(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return Lc(()=>H1(e,{$refStrategy:o?"root":"none"}),{validate:async r=>{let i=await e.safeParseAsync(r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function K1(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return Lc(()=>Pv(Ps(e,{target:"draft-7",io:"input",reused:o?"ref":"inline"})),{validate:async r=>{let i=await Es(e,r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function Y1(e){return"_zod"in e}function Y(e,t){return Y1(e)?K1(e,t):G1(e,t)}async function Pt({value:e,schema:t,context:n}){let o=await Xt({value:e,schema:t,context:n});if(!o.success)throw Xr.wrap({value:e,cause:o.error,context:n});return o.value}async function Xt({value:e,schema:t,context:n}){let o=qn(t);try{if(o.validate==null)return{success:!0,value:e,rawValue:e};let r=await o.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:Xr.wrap({value:e,cause:r.error,context:n}),rawValue:e}}catch(r){return{success:!1,error:Xr.wrap({value:e,cause:r,context:n}),rawValue:e}}}async function Ev({text:e,schema:t}){try{let n=$v(e);return t==null?n:Pt({value:n,schema:t})}catch(n){throw Ba.isInstance(n)||Xr.isInstance(n)?n:new Ba({text:e,cause:n})}}async function wr({text:e,schema:t}){try{let n=$v(e);return t==null?{success:!0,value:n,rawValue:n}:await Xt({value:n,schema:t})}catch(n){return{success:!1,error:Ba.isInstance(n)?n:new Ba({text:e,cause:n}),rawValue:void 0}}}function Cv(e){try{return $v(e),!0}catch{return!1}}function Rv({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Ac).pipeThrough(new TransformStream({async transform({data:n},o){n!=="[DONE]"&&o.enqueue(await wr({text:n,schema:t}))}}))}async function zt({provider:e,providerOptions:t,schema:n}){if(t?.[e]==null)return;let o=await Xt({value:t[e],schema:n});if(!o.success)throw new Cu({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var X1=()=>globalThis.fetch,vt=async({url:e,headers:t,body:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s})=>M0({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s}),Fc=async({url:e,headers:t,formData:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s})=>M0({url:e,headers:t,body:{content:n,values:Object.fromEntries(n.entries())},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s}),M0=async({url:e,headers:t={},body:n,successfulResponseHandler:o,failedResponseHandler:r,abortSignal:i,fetch:s=X1()})=>{try{let l=await s(e,{method:"POST",headers:nn(t,`ai-sdk/provider-utils/${P0}`,Uc()),body:n.content,signal:i}),u=ua(l);if(!l.ok){let c;try{c=await r({response:l,url:e,requestBodyValues:n.values})}catch(d){throw po(d)||Je.isInstance(d)?d:new Je({message:"Failed to process error response",cause:d,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}throw c.value}try{return await o({response:l,url:e,requestBodyValues:n.values})}catch(c){throw c instanceof Error&&(po(c)||Je.isInstance(c))?c:new Je({message:"Failed to process successful response",cause:c,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}}catch(l){throw $0({error:l,url:e,requestBodyValues:n.values})}};function A0({id:e,inputSchema:t}){return({execute:n,outputSchema:o,needsApproval:r,toModelOutput:i,onInputStart:s,onInputDelta:l,onInputAvailable:u,...c})=>({type:"provider",id:e,args:c,inputSchema:t,outputSchema:o,execute:n,needsApproval:r,toModelOutput:i,onInputStart:s,onInputDelta:l,onInputAvailable:u})}function St({id:e,inputSchema:t,outputSchema:n,supportsDeferredResults:o}){return({execute:r,needsApproval:i,toModelOutput:s,onInputStart:l,onInputDelta:u,onInputAvailable:c,...d})=>({type:"provider",id:e,args:d,inputSchema:t,outputSchema:n,execute:r,needsApproval:i,toModelOutput:s,onInputStart:l,onInputDelta:u,onInputAvailable:c,supportsDeferredResults:o})}async function ft(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Nt=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:r,requestBodyValues:i})=>{let s=await o.text(),l=ua(o);if(s.trim()==="")return{responseHeaders:l,value:new Je({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:l,responseBody:s,isRetryable:n?.(o)})};try{let u=await Ev({text:s,schema:e});return{responseHeaders:l,value:new Je({message:t(u),url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:l,responseBody:s,data:u,isRetryable:n?.(o,u)})}}catch{return{responseHeaders:l,value:new Je({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:l,responseBody:s,isRetryable:n?.(o)})}}},ho=e=>async({response:t})=>{let n=ua(t);if(t.body==null)throw new RS({});return{responseHeaders:n,value:Rv({stream:t.body,schema:e})}},at=e=>async({response:t,url:n,requestBodyValues:o})=>{let r=await t.text(),i=await wr({text:r,schema:e}),s=ua(t);if(!i.success)throw new Je({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:s,responseBody:r,url:n,requestBodyValues:o});return{responseHeaders:s,value:i.value,rawValue:i.rawValue}},z0=()=>async({response:e,url:t,requestBodyValues:n})=>{let o=ua(e);if(!e.body)throw new Je({message:"Response body is empty",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:o,responseBody:void 0});try{let r=await e.arrayBuffer();return{responseHeaders:o,value:new Uint8Array(r)}}catch(r){throw new Je({message:"Failed to read response as array buffer",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:o,responseBody:void 0,cause:r})}};function Zc(e){return e?.replace(/\/$/,"")}function Q1(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}async function*q0({execute:e,input:t,options:n}){let o=e(t,n);if(Q1(o)){let r;for await(let i of o)r=i,yield{type:"preliminary",output:i};yield{type:"final",output:r}}else yield{type:"final",output:await o}}var zv=a.object({error:a.object({message:a.string(),type:a.string().nullish(),param:a.any().nullish(),code:a.union([a.string(),a.number()]).nullish()})}),on=Nt({errorSchema:zv,errorToMessage:e=>e.error.message});function t$(e){let t=e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),n=e.startsWith("gpt-4")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-nano")&&!e.startsWith("gpt-5-chat")&&!e.startsWith("gpt-5.4-nano")||e.startsWith("o3")||e.startsWith("o4-mini"),o=e.startsWith("o1")||e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),r=e.startsWith("gpt-5.1")||e.startsWith("gpt-5.2")||e.startsWith("gpt-5.3")||e.startsWith("gpt-5.4")||e.startsWith("gpt-5.5");return{supportsFlexProcessing:t,supportsPriorityProcessing:n,isReasoningModel:o,systemMessageMode:o?"developer":"system",supportsNonReasoningParameters:r}}function U0(e){var t,n,o,r,i,s;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let l=(t=e.prompt_tokens)!=null?t:0,u=(n=e.completion_tokens)!=null?n:0,c=(r=(o=e.prompt_tokens_details)==null?void 0:o.cached_tokens)!=null?r:0,d=(s=(i=e.completion_tokens_details)==null?void 0:i.reasoning_tokens)!=null?s:0;return{inputTokens:{total:l,noCache:l-c,cacheRead:c,cacheWrite:void 0},outputTokens:{total:u,text:u-d,reasoning:d},raw:e}}function ez(e){return JSON.stringify(e===void 0?{}:e)}function tz({prompt:e,systemMessageMode:t="system"}){var n;let o=[],r=[];for(let{role:i,content:s}of e)switch(i){case"system":{switch(t){case"system":{o.push({role:"system",content:s});break}case"developer":{o.push({role:"developer",content:s});break}case"remove":{r.push({type:"other",message:"system messages are removed for this model"});break}default:{let l=t;throw new Error(`Unsupported system message mode: ${l}`)}}break}case"user":{if(s.length===1&&s[0].type==="text"){o.push({role:"user",content:s[0].text});break}o.push({role:"user",content:s.map((l,u)=>{var c,d,m;switch(l.type){case"text":return{type:"text",text:l.text};case"file":if(l.mediaType.startsWith("image/")){let _=l.mediaType==="image/*"?"image/jpeg":l.mediaType;return{type:"image_url",image_url:{url:l.data instanceof URL?l.data.toString():`data:${_};base64,${fo(l.data)}`,detail:(d=(c=l.providerOptions)==null?void 0:c.openai)==null?void 0:d.imageDetail}}}else if(l.mediaType.startsWith("audio/")){if(l.data instanceof URL)throw new gr({functionality:"audio file parts with URLs"});switch(l.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:fo(l.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:fo(l.data),format:"mp3"}};default:throw new gr({functionality:`audio content parts with media type ${l.mediaType}`})}}else if(l.mediaType==="application/pdf"){if(l.data instanceof URL)throw new gr({functionality:"PDF file parts with URLs"});return{type:"file",file:typeof l.data=="string"&&l.data.startsWith("file-")?{file_id:l.data}:{filename:(m=l.filename)!=null?m:`part-${u}.pdf`,file_data:`data:application/pdf;base64,${fo(l.data)}`}}}else throw new gr({functionality:`file part media type ${l.mediaType}`})}})});break}case"assistant":{let l="",u=[];for(let c of s)switch(c.type){case"text":{l+=c.text;break}case"tool-call":{u.push({id:c.toolCallId,type:"function",function:{name:c.toolName,arguments:ez(c.input)}});break}}o.push({role:"assistant",content:u.length>0?l||null:l,tool_calls:u.length>0?u:void 0});break}case"tool":{for(let l of s){if(l.type==="tool-approval-response")continue;let u=l.output,c;switch(u.type){case"text":case"error-text":c=u.value;break;case"execution-denied":c=(n=u.reason)!=null?n:"Tool execution denied.";break;case"content":case"json":case"error-json":c=JSON.stringify(u.value);break}o.push({role:"tool",tool_call_id:l.toolCallId,content:c})}break}default:{let l=i;throw new Error(`Unsupported role: ${l}`)}}return{messages:o,warnings:r}}function Ov({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n?new Date(n*1e3):void 0}}function L0(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var rz=X(()=>Y(a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({message:a.object({role:a.literal("assistant").nullish(),content:a.string().nullish(),tool_calls:a.array(a.object({id:a.string().nullish(),type:a.literal("function"),function:a.object({name:a.string(),arguments:a.string()})})).nullish(),annotations:a.array(a.object({type:a.literal("url_citation"),url_citation:a.object({start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()})})).nullish()}),index:a.number(),logprobs:a.object({content:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish()}).nullish(),finish_reason:a.string().nullish()})),usage:a.object({prompt_tokens:a.number().nullish(),completion_tokens:a.number().nullish(),total_tokens:a.number().nullish(),prompt_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),completion_tokens_details:a.object({reasoning_tokens:a.number().nullish(),accepted_prediction_tokens:a.number().nullish(),rejected_prediction_tokens:a.number().nullish()}).nullish()}).nullish()}))),nz=X(()=>Y(a.union([a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({delta:a.object({role:a.enum(["assistant"]).nullish(),content:a.string().nullish(),tool_calls:a.array(a.object({index:a.number(),id:a.string().nullish(),type:a.literal("function").nullish(),function:a.object({name:a.string().nullish(),arguments:a.string().nullish()})})).nullish(),annotations:a.array(a.object({type:a.literal("url_citation"),url_citation:a.object({start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()})})).nullish()}).nullish(),logprobs:a.object({content:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish()}).nullish(),finish_reason:a.string().nullish(),index:a.number()})),usage:a.object({prompt_tokens:a.number().nullish(),completion_tokens:a.number().nullish(),total_tokens:a.number().nullish(),prompt_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),completion_tokens_details:a.object({reasoning_tokens:a.number().nullish(),accepted_prediction_tokens:a.number().nullish(),rejected_prediction_tokens:a.number().nullish()}).nullish()}).nullish()}),zv]))),oz=X(()=>Y(a.object({logitBias:a.record(a.coerce.number(),a.number()).optional(),logprobs:a.union([a.boolean(),a.number()]).optional(),parallelToolCalls:a.boolean().optional(),user:a.string().optional(),reasoningEffort:a.enum(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:a.number().optional(),store:a.boolean().optional(),metadata:a.record(a.string().max(64),a.string().max(512)).optional(),prediction:a.record(a.string(),a.any()).optional(),serviceTier:a.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:a.boolean().optional(),textVerbosity:a.enum(["low","medium","high"]).optional(),promptCacheKey:a.string().optional(),promptCacheRetention:a.enum(["in_memory","24h"]).optional(),safetyIdentifier:a.string().optional(),systemMessageMode:a.enum(["system","developer","remove"]).optional(),forceReasoning:a.boolean().optional()})));function iz({tools:e,toolChoice:t}){e=e?.length?e:void 0;let n=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let o=[];for(let i of e)switch(i.type){case"function":o.push({type:"function",function:{name:i.name,description:i.description,parameters:i.inputSchema,...i.strict!=null?{strict:i.strict}:{}}});break;default:n.push({type:"unsupported",feature:`tool type: ${i.type}`});break}if(t==null)return{tools:o,toolChoice:void 0,toolWarnings:n};let r=t.type;switch(r){case"auto":case"none":case"required":return{tools:o,toolChoice:r,toolWarnings:n};case"tool":return{tools:o,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{let i=r;throw new gr({functionality:`tool choice type: ${i}`})}}}var az=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:s,stopSequences:l,responseFormat:u,seed:c,tools:d,toolChoice:m,providerOptions:_}){var h,b,k,T,R;let g=[],v=(h=await zt({provider:"openai",providerOptions:_,schema:oz}))!=null?h:{},C=t$(this.modelId),O=(b=v.forceReasoning)!=null?b:C.isReasoningModel;r!=null&&g.push({type:"unsupported",feature:"topK"});let{messages:N,warnings:K}=tz({prompt:e,systemMessageMode:(k=v.systemMessageMode)!=null?k:O?"developer":C.systemMessageMode});g.push(...K);let ee=(T=v.strictJsonSchema)!=null?T:!0,E={model:this.modelId,logit_bias:v.logitBias,logprobs:v.logprobs===!0||typeof v.logprobs=="number"?!0:void 0,top_logprobs:typeof v.logprobs=="number"?v.logprobs:typeof v.logprobs=="boolean"&&v.logprobs?0:void 0,user:v.user,parallel_tool_calls:v.parallelToolCalls,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:s,response_format:u?.type==="json"?u.schema!=null?{type:"json_schema",json_schema:{schema:u.schema,strict:ee,name:(R=u.name)!=null?R:"response",description:u.description}}:{type:"json_object"}:void 0,stop:l,seed:c,verbosity:v.textVerbosity,max_completion_tokens:v.maxCompletionTokens,store:v.store,metadata:v.metadata,prediction:v.prediction,reasoning_effort:v.reasoningEffort,service_tier:v.serviceTier,prompt_cache_key:v.promptCacheKey,prompt_cache_retention:v.promptCacheRetention,safety_identifier:v.safetyIdentifier,messages:N};O?((v.reasoningEffort!=="none"||!C.supportsNonReasoningParameters)&&(E.temperature!=null&&(E.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),E.top_p!=null&&(E.top_p=void 0,g.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),E.logprobs!=null&&(E.logprobs=void 0,g.push({type:"other",message:"logprobs is not supported for reasoning models"}))),E.frequency_penalty!=null&&(E.frequency_penalty=void 0,g.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),E.presence_penalty!=null&&(E.presence_penalty=void 0,g.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),E.logit_bias!=null&&(E.logit_bias=void 0,g.push({type:"other",message:"logitBias is not supported for reasoning models"})),E.top_logprobs!=null&&(E.top_logprobs=void 0,g.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),E.max_tokens!=null&&(E.max_completion_tokens==null&&(E.max_completion_tokens=E.max_tokens),E.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&E.temperature!=null&&(E.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),v.serviceTier==="flex"&&!C.supportsFlexProcessing&&(g.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),E.service_tier=void 0),v.serviceTier==="priority"&&!C.supportsPriorityProcessing&&(g.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),E.service_tier=void 0);let{tools:le,toolChoice:z,toolWarnings:ye}=iz({tools:d,toolChoice:m});return{args:{...E,tools:le,tool_choice:z},warnings:[...g,...ye]}}async doGenerate(e){var t,n,o,r,i,s,l;let{args:u,warnings:c}=await this.getArgs(e),{responseHeaders:d,value:m,rawValue:_}=await vt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:u,failedResponseHandler:on,successfulResponseHandler:at(rz),abortSignal:e.abortSignal,fetch:this.config.fetch}),h=m.choices[0],b=[],k=h.message.content;k!=null&&k.length>0&&b.push({type:"text",text:k});for(let v of(t=h.message.tool_calls)!=null?t:[])b.push({type:"tool-call",toolCallId:(n=v.id)!=null?n:Vt(),toolName:v.function.name,input:v.function.arguments});for(let v of(o=h.message.annotations)!=null?o:[])b.push({type:"source",sourceType:"url",id:Vt(),url:v.url_citation.url,title:v.url_citation.title});let T=(r=m.usage)==null?void 0:r.completion_tokens_details,R=(i=m.usage)==null?void 0:i.prompt_tokens_details,g={openai:{}};return T?.accepted_prediction_tokens!=null&&(g.openai.acceptedPredictionTokens=T?.accepted_prediction_tokens),T?.rejected_prediction_tokens!=null&&(g.openai.rejectedPredictionTokens=T?.rejected_prediction_tokens),((s=h.logprobs)==null?void 0:s.content)!=null&&(g.openai.logprobs=h.logprobs.content),{content:b,finishReason:{unified:L0(h.finish_reason),raw:(l=h.finish_reason)!=null?l:void 0},usage:U0(m.usage),request:{body:u},response:{...Ov(m),headers:d,body:_},warnings:c,providerMetadata:g}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:r,value:i}=await vt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:o,failedResponseHandler:on,successfulResponseHandler:ho(nz),abortSignal:e.abortSignal,fetch:this.config.fetch}),s=[],l={unified:"other",raw:void 0},u,c=!1,d=!1,m={openai:{}};return{stream:i.pipeThrough(new TransformStream({start(_){_.enqueue({type:"stream-start",warnings:n})},transform(_,h){var b,k,T,R,g,v,C,O,N,K,ee,E,le,z,ye,D,U;if(e.includeRawChunks&&h.enqueue({type:"raw",rawValue:_.rawValue}),!_.success){l={unified:"error",raw:void 0},h.enqueue({type:"error",error:_.error});return}let A=_.value;if("error"in A){l={unified:"error",raw:void 0},h.enqueue({type:"error",error:A.error});return}if(!c){let ne=Ov(A);Object.values(ne).some(Boolean)&&(c=!0,h.enqueue({type:"response-metadata",...Ov(A)}))}A.usage!=null&&(u=A.usage,((b=A.usage.completion_tokens_details)==null?void 0:b.accepted_prediction_tokens)!=null&&(m.openai.acceptedPredictionTokens=(k=A.usage.completion_tokens_details)==null?void 0:k.accepted_prediction_tokens),((T=A.usage.completion_tokens_details)==null?void 0:T.rejected_prediction_tokens)!=null&&(m.openai.rejectedPredictionTokens=(R=A.usage.completion_tokens_details)==null?void 0:R.rejected_prediction_tokens));let L=A.choices[0];if(L?.finish_reason!=null&&(l={unified:L0(L.finish_reason),raw:L.finish_reason}),((g=L?.logprobs)==null?void 0:g.content)!=null&&(m.openai.logprobs=L.logprobs.content),L?.delta==null)return;let B=L.delta;if(B.content!=null&&(d||(h.enqueue({type:"text-start",id:"0"}),d=!0),h.enqueue({type:"text-delta",id:"0",delta:B.content})),B.tool_calls!=null)for(let ne of B.tool_calls){let W=ne.index;if(s[W]==null){if(ne.type!=null&&ne.type!=="function")throw new Ru({data:ne,message:"Expected 'function' type."});if(ne.id==null)throw new Ru({data:ne,message:"Expected 'id' to be a string."});if(((v=ne.function)==null?void 0:v.name)==null)throw new Ru({data:ne,message:"Expected 'function.name' to be a string."});h.enqueue({type:"tool-input-start",id:ne.id,toolName:ne.function.name}),s[W]={id:ne.id,type:"function",function:{name:ne.function.name,arguments:(C=ne.function.arguments)!=null?C:""},hasFinished:!1};let Pe=s[W];((O=Pe.function)==null?void 0:O.name)!=null&&((N=Pe.function)==null?void 0:N.arguments)!=null&&(Pe.function.arguments.length>0&&h.enqueue({type:"tool-input-delta",id:Pe.id,delta:Pe.function.arguments}),Cv(Pe.function.arguments)&&(h.enqueue({type:"tool-input-end",id:Pe.id}),h.enqueue({type:"tool-call",toolCallId:(K=Pe.id)!=null?K:Vt(),toolName:Pe.function.name,input:Pe.function.arguments}),Pe.hasFinished=!0));continue}let pe=s[W];pe.hasFinished||(((ee=ne.function)==null?void 0:ee.arguments)!=null&&(pe.function.arguments+=(le=(E=ne.function)==null?void 0:E.arguments)!=null?le:""),h.enqueue({type:"tool-input-delta",id:pe.id,delta:(z=ne.function.arguments)!=null?z:""}),((ye=pe.function)==null?void 0:ye.name)!=null&&((D=pe.function)==null?void 0:D.arguments)!=null&&Cv(pe.function.arguments)&&(h.enqueue({type:"tool-input-end",id:pe.id}),h.enqueue({type:"tool-call",toolCallId:(U=pe.id)!=null?U:Vt(),toolName:pe.function.name,input:pe.function.arguments}),pe.hasFinished=!0))}if(B.annotations!=null)for(let ne of B.annotations)h.enqueue({type:"source",sourceType:"url",id:Vt(),url:ne.url_citation.url,title:ne.url_citation.title})},flush(_){d&&_.enqueue({type:"text-end",id:"0"}),_.enqueue({type:"finish",finishReason:l,usage:U0(u),...m!=null?{providerMetadata:m}:{}})}})),request:{body:o},response:{headers:r}}}};function F0(e){var t,n,o,r;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let i=(t=e.prompt_tokens)!=null?t:0,s=(n=e.completion_tokens)!=null?n:0;return{inputTokens:{total:(o=e.prompt_tokens)!=null?o:void 0,noCache:i,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(r=e.completion_tokens)!=null?r:void 0,text:s,reasoning:void 0},raw:e}}function sz({prompt:e,user:t="user",assistant:n="assistant"}){let o="";e[0].role==="system"&&(o+=`${e[0].content} +]`;continue}i+=r[c],r[c]==="\\"?s=!0:l&&r[c]==="]"?l=!1:!l&&r[c]==="["&&(l=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function X0(e,t){var n,o,r,i,s,l;let u={type:"object",additionalProperties:(n=rt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((o=e.keyType)==null?void 0:o._def.typeName)===re.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:c,...d}=Y0(e.keyType._def,t);return{...u,propertyNames:d}}else{if(((i=e.keyType)==null?void 0:i._def.typeName)===re.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((s=e.keyType)==null?void 0:s._def.typeName)===re.ZodBranded&&e.keyType._def.type._def.typeName===re.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:c,...d}=G0(e.keyType._def,t);return{...u,propertyNames:d}}}return u}function W1(e,t){if(t.mapStrategy==="record")return X0(e,t);let n=rt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Cr(),o=rt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Cr();return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function H1(e){let t=e.values,o=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function J1(){return{not:Cr()}}function B1(){return{type:"null"}}var Ev={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function G1(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in Ev&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let s=Ev[i._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(o.length===n.length){let r=o.filter((i,s,l)=>l.indexOf(i)===s);return{type:r.length>1?r:r[0],enum:n.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return K1(e,t)}var K1=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,r)=>rt(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function Y1(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Ev[e.innerType._def.typeName],"null"]};let n=rt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function X1(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function Q1(e,t){let n={type:"object",properties:{}},o=[],r=e.shape();for(let s in r){let l=r[s];if(l===void 0||l._def===void 0)continue;let u=tz(l),c=rt(l._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});c!==void 0&&(n.properties[s]=c,u||o.push(s))}o.length&&(n.required=o);let i=ez(e,t);return i!==void 0&&(n.additionalProperties=i),n}function ez(e,t){if(e.catchall._def.typeName!=="ZodNever")return rt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function tz(e){try{return e.isOptional()}catch{return!0}}var rz=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return rt(e.innerType._def,t);let o=rt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return o?{anyOf:[{not:Cr()},o]}:Cr()},nz=(e,t)=>{if(t.pipeStrategy==="input")return rt(e.in._def,t);if(t.pipeStrategy==="output")return rt(e.out._def,t);let n=rt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=rt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function oz(e,t){return rt(e.type._def,t)}function iz(e,t){let o={type:"array",uniqueItems:!0,items:rt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(o.minItems=e.minSize.value),e.maxSize&&(o.maxItems=e.maxSize.value),o}function az(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,o)=>rt(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:rt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,o)=>rt(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function sz(){return{not:Cr()}}function lz(){return Cr()}var uz=(e,t)=>rt(e.innerType._def,t),cz=(e,t,n)=>{switch(t){case re.ZodString:return Y0(e,n);case re.ZodNumber:return X1(e);case re.ZodObject:return Q1(e,n);case re.ZodBigInt:return D1(e);case re.ZodBoolean:return j1();case re.ZodDate:return K0(e,n);case re.ZodUndefined:return sz();case re.ZodNull:return B1();case re.ZodArray:return O1(e,n);case re.ZodUnion:case re.ZodDiscriminatedUnion:return G1(e,n);case re.ZodIntersection:return L1(e,n);case re.ZodTuple:return az(e,n);case re.ZodRecord:return X0(e,n);case re.ZodLiteral:return F1(e);case re.ZodEnum:return q1(e);case re.ZodNativeEnum:return H1(e);case re.ZodNullable:return Y1(e,n);case re.ZodOptional:return rz(e,n);case re.ZodMap:return W1(e,n);case re.ZodSet:return iz(e,n);case re.ZodLazy:return()=>e.getter()._def;case re.ZodPromise:return oz(e,n);case re.ZodNaN:case re.ZodNever:return J1();case re.ZodEffects:return z1(e,n);case re.ZodAny:return Cr();case re.ZodUnknown:return lz();case re.ZodDefault:return A1(e,n);case re.ZodBranded:return G0(e,n);case re.ZodReadonly:return uz(e,n);case re.ZodCatch:return N1(e,n);case re.ZodPipeline:return nz(e,n);case re.ZodFunction:case re.ZodVoid:case re.ZodSymbol:return;default:return(o=>{})(t)}},dz=(e,t)=>{let n=0;for(;n{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:dz(t.currentPath,e.path)};case"none":case"seen":return e.path.lengtht.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Cr()):t.$refStrategy==="seen"?Cr():void 0}},fz=(e,t,n)=>(e.description&&(n.description=e.description),n),mz=e=>{let t=C1(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}},hz=(e,t)=>{var n;let o=mz(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[d,m])=>{var _;return{...c,[d]:(_=rt(m._def,{...o,currentPath:[...o.basePath,o.definitionPath,d]},!0))!=null?_:Cr()}},{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,s=(n=rt(e._def,i===void 0?o:{...o,currentPath:[...o.basePath,o.definitionPath,i]},!1))!=null?n:Cr(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(s.title=l);let u=i===void 0?r?{...s,[o.definitionPath]:r}:s:{$ref:[...o.$refStrategy==="relative"?[]:o.basePath,o.definitionPath,i].join("/"),[o.definitionPath]:{...r,[i]:s}};return u.$schema="http://json-schema.org/draft-07/schema#",u},Rv=Symbol.for("vercel.ai.schema");function X(e){let t;return()=>(t==null&&(t=e()),t)}function Zc(e,{validate:t}={}){return{[Rv]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function gz(e){return typeof e=="object"&&e!==null&&Rv in e&&e[Rv]===!0&&"jsonSchema"in e&&"validate"in e}function Un(e){return e==null?Zc({properties:{},additionalProperties:!1}):gz(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Y(e):vz(e):e()}function vz(e){return Zc(()=>Nv(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new Qr({value:t,cause:n.issues})}}})}function yz(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return Zc(()=>hz(e,{$refStrategy:o?"root":"none"}),{validate:async r=>{let i=await e.safeParseAsync(r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function _z(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return Zc(()=>Nv(Ps(e,{target:"draft-7",io:"input",reused:o?"ref":"inline"})),{validate:async r=>{let i=await Es(e,r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function bz(e){return"_zod"in e}function Y(e,t){return bz(e)?_z(e,t):yz(e,t)}async function Pt({value:e,schema:t,context:n}){let o=await Qt({value:e,schema:t,context:n});if(!o.success)throw Qr.wrap({value:e,cause:o.error,context:n});return o.value}async function Qt({value:e,schema:t,context:n}){let o=Un(t);try{if(o.validate==null)return{success:!0,value:e,rawValue:e};let r=await o.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:Qr.wrap({value:e,cause:r.error,context:n}),rawValue:e}}catch(r){return{success:!1,error:Qr.wrap({value:e,cause:r,context:n}),rawValue:e}}}async function Mv({text:e,schema:t}){try{let n=jv(e);return t==null?n:Pt({value:n,schema:t})}catch(n){throw Ba.isInstance(n)||Qr.isInstance(n)?n:new Ba({text:e,cause:n})}}async function wr({text:e,schema:t}){try{let n=jv(e);return t==null?{success:!0,value:n,rawValue:n}:await Qt({value:n,schema:t})}catch(n){return{success:!1,error:Ba.isInstance(n)?n:new Ba({text:e,cause:n}),rawValue:void 0}}}function Av(e){try{return jv(e),!0}catch{return!1}}function zv({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new qc).pipeThrough(new TransformStream({async transform({data:n},o){n!=="[DONE]"&&o.enqueue(await wr({text:n,schema:t}))}}))}async function zt({provider:e,providerOptions:t,schema:n}){if(t?.[e]==null)return;let o=await Qt({value:t[e],schema:n});if(!o.success)throw new Ou({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var wz=()=>globalThis.fetch,vt=async({url:e,headers:t,body:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s})=>Q0({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s}),Vc=async({url:e,headers:t,formData:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s})=>Q0({url:e,headers:t,body:{content:n,values:Object.fromEntries(n.entries())},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:s}),Q0=async({url:e,headers:t={},body:n,successfulResponseHandler:o,failedResponseHandler:r,abortSignal:i,fetch:s=wz()})=>{try{let l=await s(e,{method:"POST",headers:on(t,`ai-sdk/provider-utils/${W0}`,Fc()),body:n.content,signal:i}),u=da(l);if(!l.ok){let c;try{c=await r({response:l,url:e,requestBodyValues:n.values})}catch(d){throw mo(d)||Je.isInstance(d)?d:new Je({message:"Failed to process error response",cause:d,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}throw c.value}try{return await o({response:l,url:e,requestBodyValues:n.values})}catch(c){throw c instanceof Error&&(mo(c)||Je.isInstance(c))?c:new Je({message:"Failed to process successful response",cause:c,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}}catch(l){throw V0({error:l,url:e,requestBodyValues:n.values})}};function e$({id:e,inputSchema:t}){return({execute:n,outputSchema:o,needsApproval:r,toModelOutput:i,onInputStart:s,onInputDelta:l,onInputAvailable:u,...c})=>({type:"provider",id:e,args:c,inputSchema:t,outputSchema:o,execute:n,needsApproval:r,toModelOutput:i,onInputStart:s,onInputDelta:l,onInputAvailable:u})}function St({id:e,inputSchema:t,outputSchema:n,supportsDeferredResults:o}){return({execute:r,needsApproval:i,toModelOutput:s,onInputStart:l,onInputDelta:u,onInputAvailable:c,...d})=>({type:"provider",id:e,args:d,inputSchema:t,outputSchema:n,execute:r,needsApproval:i,toModelOutput:s,onInputStart:l,onInputDelta:u,onInputAvailable:c,supportsDeferredResults:o})}async function ft(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Nt=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:r,requestBodyValues:i})=>{let s=await o.text(),l=da(o);if(s.trim()==="")return{responseHeaders:l,value:new Je({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:l,responseBody:s,isRetryable:n?.(o)})};try{let u=await Mv({text:s,schema:e});return{responseHeaders:l,value:new Je({message:t(u),url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:l,responseBody:s,data:u,isRetryable:n?.(o,u)})}}catch{return{responseHeaders:l,value:new Je({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:l,responseBody:s,isRetryable:n?.(o)})}}},vo=e=>async({response:t})=>{let n=da(t);if(t.body==null)throw new BS({});return{responseHeaders:n,value:zv({stream:t.body,schema:e})}},it=e=>async({response:t,url:n,requestBodyValues:o})=>{let r=await t.text(),i=await wr({text:r,schema:e}),s=da(t);if(!i.success)throw new Je({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:s,responseBody:r,url:n,requestBodyValues:o});return{responseHeaders:s,value:i.value,rawValue:i.rawValue}},t$=()=>async({response:e,url:t,requestBodyValues:n})=>{let o=da(e);if(!e.body)throw new Je({message:"Response body is empty",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:o,responseBody:void 0});try{let r=await e.arrayBuffer();return{responseHeaders:o,value:new Uint8Array(r)}}catch(r){throw new Je({message:"Failed to read response as array buffer",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:o,responseBody:void 0,cause:r})}};function Wc(e){return e?.replace(/\/$/,"")}function xz(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}async function*r$({execute:e,input:t,options:n}){let o=e(t,n);if(xz(o)){let r;for await(let i of o)r=i,yield{type:"preliminary",output:i};yield{type:"final",output:r}}else yield{type:"final",output:await o}}var Wv=a.object({error:a.object({message:a.string(),type:a.string().nullish(),param:a.any().nullish(),code:a.union([a.string(),a.number()]).nullish()})}),an=Nt({errorSchema:Wv,errorToMessage:e=>e.error.message});function y$(e){let t=e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),n=e.startsWith("gpt-4")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-nano")&&!e.startsWith("gpt-5-chat")&&!e.startsWith("gpt-5.4-nano")||e.startsWith("o3")||e.startsWith("o4-mini"),o=e.startsWith("o1")||e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),r=e.startsWith("gpt-5.1")||e.startsWith("gpt-5.2")||e.startsWith("gpt-5.3")||e.startsWith("gpt-5.4")||e.startsWith("gpt-5.5");return{supportsFlexProcessing:t,supportsPriorityProcessing:n,isReasoningModel:o,systemMessageMode:o?"developer":"system",supportsNonReasoningParameters:r}}function n$(e){var t,n,o,r,i,s;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let l=(t=e.prompt_tokens)!=null?t:0,u=(n=e.completion_tokens)!=null?n:0,c=(r=(o=e.prompt_tokens_details)==null?void 0:o.cached_tokens)!=null?r:0,d=(s=(i=e.completion_tokens_details)==null?void 0:i.reasoning_tokens)!=null?s:0;return{inputTokens:{total:l,noCache:l-c,cacheRead:c,cacheWrite:void 0},outputTokens:{total:u,text:u-d,reasoning:d},raw:e}}function kz(e){return JSON.stringify(e===void 0?{}:e)}function Sz({prompt:e,systemMessageMode:t="system"}){var n;let o=[],r=[];for(let{role:i,content:s}of e)switch(i){case"system":{switch(t){case"system":{o.push({role:"system",content:s});break}case"developer":{o.push({role:"developer",content:s});break}case"remove":{r.push({type:"other",message:"system messages are removed for this model"});break}default:{let l=t;throw new Error(`Unsupported system message mode: ${l}`)}}break}case"user":{if(s.length===1&&s[0].type==="text"){o.push({role:"user",content:s[0].text});break}o.push({role:"user",content:s.map((l,u)=>{var c,d,m;switch(l.type){case"text":return{type:"text",text:l.text};case"file":if(l.mediaType.startsWith("image/")){let _=l.mediaType==="image/*"?"image/jpeg":l.mediaType;return{type:"image_url",image_url:{url:l.data instanceof URL?l.data.toString():`data:${_};base64,${ho(l.data)}`,detail:(d=(c=l.providerOptions)==null?void 0:c.openai)==null?void 0:d.imageDetail}}}else if(l.mediaType.startsWith("audio/")){if(l.data instanceof URL)throw new gr({functionality:"audio file parts with URLs"});switch(l.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:ho(l.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:ho(l.data),format:"mp3"}};default:throw new gr({functionality:`audio content parts with media type ${l.mediaType}`})}}else if(l.mediaType==="application/pdf"){if(l.data instanceof URL)throw new gr({functionality:"PDF file parts with URLs"});return{type:"file",file:typeof l.data=="string"&&l.data.startsWith("file-")?{file_id:l.data}:{filename:(m=l.filename)!=null?m:`part-${u}.pdf`,file_data:`data:application/pdf;base64,${ho(l.data)}`}}}else throw new gr({functionality:`file part media type ${l.mediaType}`})}})});break}case"assistant":{let l="",u=[];for(let c of s)switch(c.type){case"text":{l+=c.text;break}case"tool-call":{u.push({id:c.toolCallId,type:"function",function:{name:c.toolName,arguments:kz(c.input)}});break}}o.push({role:"assistant",content:u.length>0?l||null:l,tool_calls:u.length>0?u:void 0});break}case"tool":{for(let l of s){if(l.type==="tool-approval-response")continue;let u=l.output,c;switch(u.type){case"text":case"error-text":c=u.value;break;case"execution-denied":c=(n=u.reason)!=null?n:"Tool execution denied.";break;case"content":case"json":case"error-json":c=JSON.stringify(u.value);break}o.push({role:"tool",tool_call_id:l.toolCallId,content:c})}break}default:{let l=i;throw new Error(`Unsupported role: ${l}`)}}return{messages:o,warnings:r}}function qv({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n?new Date(n*1e3):void 0}}function o$(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var Tz=X(()=>Y(a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({message:a.object({role:a.literal("assistant").nullish(),content:a.string().nullish(),tool_calls:a.array(a.object({id:a.string().nullish(),type:a.literal("function"),function:a.object({name:a.string(),arguments:a.string()})})).nullish(),annotations:a.array(a.object({type:a.literal("url_citation"),url_citation:a.object({start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()})})).nullish()}),index:a.number(),logprobs:a.object({content:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish()}).nullish(),finish_reason:a.string().nullish()})),usage:a.object({prompt_tokens:a.number().nullish(),completion_tokens:a.number().nullish(),total_tokens:a.number().nullish(),prompt_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),completion_tokens_details:a.object({reasoning_tokens:a.number().nullish(),accepted_prediction_tokens:a.number().nullish(),rejected_prediction_tokens:a.number().nullish()}).nullish()}).nullish()}))),Iz=X(()=>Y(a.union([a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({delta:a.object({role:a.enum(["assistant"]).nullish(),content:a.string().nullish(),tool_calls:a.array(a.object({index:a.number(),id:a.string().nullish(),type:a.literal("function").nullish(),function:a.object({name:a.string().nullish(),arguments:a.string().nullish()})})).nullish(),annotations:a.array(a.object({type:a.literal("url_citation"),url_citation:a.object({start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()})})).nullish()}).nullish(),logprobs:a.object({content:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish()}).nullish(),finish_reason:a.string().nullish(),index:a.number()})),usage:a.object({prompt_tokens:a.number().nullish(),completion_tokens:a.number().nullish(),total_tokens:a.number().nullish(),prompt_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),completion_tokens_details:a.object({reasoning_tokens:a.number().nullish(),accepted_prediction_tokens:a.number().nullish(),rejected_prediction_tokens:a.number().nullish()}).nullish()}).nullish()}),Wv]))),$z=X(()=>Y(a.object({logitBias:a.record(a.coerce.number(),a.number()).optional(),logprobs:a.union([a.boolean(),a.number()]).optional(),parallelToolCalls:a.boolean().optional(),user:a.string().optional(),reasoningEffort:a.enum(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:a.number().optional(),store:a.boolean().optional(),metadata:a.record(a.string().max(64),a.string().max(512)).optional(),prediction:a.record(a.string(),a.any()).optional(),serviceTier:a.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:a.boolean().optional(),textVerbosity:a.enum(["low","medium","high"]).optional(),promptCacheKey:a.string().optional(),promptCacheRetention:a.enum(["in_memory","24h"]).optional(),safetyIdentifier:a.string().optional(),systemMessageMode:a.enum(["system","developer","remove"]).optional(),forceReasoning:a.boolean().optional()})));function Pz({tools:e,toolChoice:t}){e=e?.length?e:void 0;let n=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let o=[];for(let i of e)switch(i.type){case"function":o.push({type:"function",function:{name:i.name,description:i.description,parameters:i.inputSchema,...i.strict!=null?{strict:i.strict}:{}}});break;default:n.push({type:"unsupported",feature:`tool type: ${i.type}`});break}if(t==null)return{tools:o,toolChoice:void 0,toolWarnings:n};let r=t.type;switch(r){case"auto":case"none":case"required":return{tools:o,toolChoice:r,toolWarnings:n};case"tool":return{tools:o,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{let i=r;throw new gr({functionality:`tool choice type: ${i}`})}}}var Ez=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:s,stopSequences:l,responseFormat:u,seed:c,tools:d,toolChoice:m,providerOptions:_}){var h,b,k,I,C;let g=[],v=(h=await zt({provider:"openai",providerOptions:_,schema:$z}))!=null?h:{},R=y$(this.modelId),O=(b=v.forceReasoning)!=null?b:R.isReasoningModel;r!=null&&g.push({type:"unsupported",feature:"topK"});let{messages:N,warnings:K}=Sz({prompt:e,systemMessageMode:(k=v.systemMessageMode)!=null?k:O?"developer":R.systemMessageMode});g.push(...K);let ee=(I=v.strictJsonSchema)!=null?I:!0,E={model:this.modelId,logit_bias:v.logitBias,logprobs:v.logprobs===!0||typeof v.logprobs=="number"?!0:void 0,top_logprobs:typeof v.logprobs=="number"?v.logprobs:typeof v.logprobs=="boolean"&&v.logprobs?0:void 0,user:v.user,parallel_tool_calls:v.parallelToolCalls,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:s,response_format:u?.type==="json"?u.schema!=null?{type:"json_schema",json_schema:{schema:u.schema,strict:ee,name:(C=u.name)!=null?C:"response",description:u.description}}:{type:"json_object"}:void 0,stop:l,seed:c,verbosity:v.textVerbosity,max_completion_tokens:v.maxCompletionTokens,store:v.store,metadata:v.metadata,prediction:v.prediction,reasoning_effort:v.reasoningEffort,service_tier:v.serviceTier,prompt_cache_key:v.promptCacheKey,prompt_cache_retention:v.promptCacheRetention,safety_identifier:v.safetyIdentifier,messages:N};O?((v.reasoningEffort!=="none"||!R.supportsNonReasoningParameters)&&(E.temperature!=null&&(E.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),E.top_p!=null&&(E.top_p=void 0,g.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),E.logprobs!=null&&(E.logprobs=void 0,g.push({type:"other",message:"logprobs is not supported for reasoning models"}))),E.frequency_penalty!=null&&(E.frequency_penalty=void 0,g.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),E.presence_penalty!=null&&(E.presence_penalty=void 0,g.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),E.logit_bias!=null&&(E.logit_bias=void 0,g.push({type:"other",message:"logitBias is not supported for reasoning models"})),E.top_logprobs!=null&&(E.top_logprobs=void 0,g.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),E.max_tokens!=null&&(E.max_completion_tokens==null&&(E.max_completion_tokens=E.max_tokens),E.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&E.temperature!=null&&(E.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),v.serviceTier==="flex"&&!R.supportsFlexProcessing&&(g.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),E.service_tier=void 0),v.serviceTier==="priority"&&!R.supportsPriorityProcessing&&(g.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),E.service_tier=void 0);let{tools:le,toolChoice:z,toolWarnings:ye}=Pz({tools:d,toolChoice:m});return{args:{...E,tools:le,tool_choice:z},warnings:[...g,...ye]}}async doGenerate(e){var t,n,o,r,i,s,l;let{args:u,warnings:c}=await this.getArgs(e),{responseHeaders:d,value:m,rawValue:_}=await vt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:u,failedResponseHandler:an,successfulResponseHandler:it(Tz),abortSignal:e.abortSignal,fetch:this.config.fetch}),h=m.choices[0],b=[],k=h.message.content;k!=null&&k.length>0&&b.push({type:"text",text:k});for(let v of(t=h.message.tool_calls)!=null?t:[])b.push({type:"tool-call",toolCallId:(n=v.id)!=null?n:Wt(),toolName:v.function.name,input:v.function.arguments});for(let v of(o=h.message.annotations)!=null?o:[])b.push({type:"source",sourceType:"url",id:Wt(),url:v.url_citation.url,title:v.url_citation.title});let I=(r=m.usage)==null?void 0:r.completion_tokens_details,C=(i=m.usage)==null?void 0:i.prompt_tokens_details,g={openai:{}};return I?.accepted_prediction_tokens!=null&&(g.openai.acceptedPredictionTokens=I?.accepted_prediction_tokens),I?.rejected_prediction_tokens!=null&&(g.openai.rejectedPredictionTokens=I?.rejected_prediction_tokens),((s=h.logprobs)==null?void 0:s.content)!=null&&(g.openai.logprobs=h.logprobs.content),{content:b,finishReason:{unified:o$(h.finish_reason),raw:(l=h.finish_reason)!=null?l:void 0},usage:n$(m.usage),request:{body:u},response:{...qv(m),headers:d,body:_},warnings:c,providerMetadata:g}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:r,value:i}=await vt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:o,failedResponseHandler:an,successfulResponseHandler:vo(Iz),abortSignal:e.abortSignal,fetch:this.config.fetch}),s=[],l={unified:"other",raw:void 0},u,c=!1,d=!1,m={openai:{}};return{stream:i.pipeThrough(new TransformStream({start(_){_.enqueue({type:"stream-start",warnings:n})},transform(_,h){var b,k,I,C,g,v,R,O,N,K,ee,E,le,z,ye,D,U;if(e.includeRawChunks&&h.enqueue({type:"raw",rawValue:_.rawValue}),!_.success){l={unified:"error",raw:void 0},h.enqueue({type:"error",error:_.error});return}let A=_.value;if("error"in A){l={unified:"error",raw:void 0},h.enqueue({type:"error",error:A.error});return}if(!c){let ne=qv(A);Object.values(ne).some(Boolean)&&(c=!0,h.enqueue({type:"response-metadata",...qv(A)}))}A.usage!=null&&(u=A.usage,((b=A.usage.completion_tokens_details)==null?void 0:b.accepted_prediction_tokens)!=null&&(m.openai.acceptedPredictionTokens=(k=A.usage.completion_tokens_details)==null?void 0:k.accepted_prediction_tokens),((I=A.usage.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null&&(m.openai.rejectedPredictionTokens=(C=A.usage.completion_tokens_details)==null?void 0:C.rejected_prediction_tokens));let L=A.choices[0];if(L?.finish_reason!=null&&(l={unified:o$(L.finish_reason),raw:L.finish_reason}),((g=L?.logprobs)==null?void 0:g.content)!=null&&(m.openai.logprobs=L.logprobs.content),L?.delta==null)return;let B=L.delta;if(B.content!=null&&(d||(h.enqueue({type:"text-start",id:"0"}),d=!0),h.enqueue({type:"text-delta",id:"0",delta:B.content})),B.tool_calls!=null)for(let ne of B.tool_calls){let W=ne.index;if(s[W]==null){if(ne.type!=null&&ne.type!=="function")throw new Du({data:ne,message:"Expected 'function' type."});if(ne.id==null)throw new Du({data:ne,message:"Expected 'id' to be a string."});if(((v=ne.function)==null?void 0:v.name)==null)throw new Du({data:ne,message:"Expected 'function.name' to be a string."});h.enqueue({type:"tool-input-start",id:ne.id,toolName:ne.function.name}),s[W]={id:ne.id,type:"function",function:{name:ne.function.name,arguments:(R=ne.function.arguments)!=null?R:""},hasFinished:!1};let Pe=s[W];((O=Pe.function)==null?void 0:O.name)!=null&&((N=Pe.function)==null?void 0:N.arguments)!=null&&(Pe.function.arguments.length>0&&h.enqueue({type:"tool-input-delta",id:Pe.id,delta:Pe.function.arguments}),Av(Pe.function.arguments)&&(h.enqueue({type:"tool-input-end",id:Pe.id}),h.enqueue({type:"tool-call",toolCallId:(K=Pe.id)!=null?K:Wt(),toolName:Pe.function.name,input:Pe.function.arguments}),Pe.hasFinished=!0));continue}let pe=s[W];pe.hasFinished||(((ee=ne.function)==null?void 0:ee.arguments)!=null&&(pe.function.arguments+=(le=(E=ne.function)==null?void 0:E.arguments)!=null?le:""),h.enqueue({type:"tool-input-delta",id:pe.id,delta:(z=ne.function.arguments)!=null?z:""}),((ye=pe.function)==null?void 0:ye.name)!=null&&((D=pe.function)==null?void 0:D.arguments)!=null&&Av(pe.function.arguments)&&(h.enqueue({type:"tool-input-end",id:pe.id}),h.enqueue({type:"tool-call",toolCallId:(U=pe.id)!=null?U:Wt(),toolName:pe.function.name,input:pe.function.arguments}),pe.hasFinished=!0))}if(B.annotations!=null)for(let ne of B.annotations)h.enqueue({type:"source",sourceType:"url",id:Wt(),url:ne.url_citation.url,title:ne.url_citation.title})},flush(_){d&&_.enqueue({type:"text-end",id:"0"}),_.enqueue({type:"finish",finishReason:l,usage:n$(u),...m!=null?{providerMetadata:m}:{}})}})),request:{body:o},response:{headers:r}}}};function i$(e){var t,n,o,r;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let i=(t=e.prompt_tokens)!=null?t:0,s=(n=e.completion_tokens)!=null?n:0;return{inputTokens:{total:(o=e.prompt_tokens)!=null?o:void 0,noCache:i,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(r=e.completion_tokens)!=null?r:void 0,text:s,reasoning:void 0},raw:e}}function Rz({prompt:e,user:t="user",assistant:n="assistant"}){let o="";e[0].role==="system"&&(o+=`${e[0].content} -`,e=e.slice(1));for(let{role:r,content:i}of e)switch(r){case"system":throw new pn({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let s=i.map(l=>{switch(l.type){case"text":return l.text}}).filter(Boolean).join("");o+=`${t}: +`,e=e.slice(1));for(let{role:r,content:i}of e)switch(r){case"system":throw new fn({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let s=i.map(l=>{switch(l.type){case"text":return l.text}}).filter(Boolean).join("");o+=`${t}: ${s} `;break}case"assistant":{let s=i.map(l=>{switch(l.type){case"text":return l.text;case"tool-call":throw new gr({functionality:"tool-call messages"})}}).join("");o+=`${n}: @@ -100,7 +100,7 @@ ${s} `;break}case"tool":throw new gr({functionality:"tool messages"});default:{let s=r;throw new Error(`Unsupported role: ${s}`)}}return o+=`${n}: `,{prompt:o,stopSequences:[` -${t}:`]}}function Z0({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function V0(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var lz=X(()=>Y(a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({text:a.string(),finish_reason:a.string(),logprobs:a.object({tokens:a.array(a.string()),token_logprobs:a.array(a.number()),top_logprobs:a.array(a.record(a.string(),a.number())).nullish()}).nullish()})),usage:a.object({prompt_tokens:a.number(),completion_tokens:a.number(),total_tokens:a.number()}).nullish()}))),uz=X(()=>Y(a.union([a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({text:a.string(),finish_reason:a.string().nullish(),index:a.number(),logprobs:a.object({tokens:a.array(a.string()),token_logprobs:a.array(a.number()),top_logprobs:a.array(a.record(a.string(),a.number())).nullish()}).nullish()})),usage:a.object({prompt_tokens:a.number(),completion_tokens:a.number(),total_tokens:a.number()}).nullish()}),zv]))),W0=X(()=>Y(a.object({echo:a.boolean().optional(),logitBias:a.record(a.string(),a.number()).optional(),suffix:a.string().optional(),user:a.string().optional(),logprobs:a.union([a.boolean(),a.number()]).optional()}))),cz=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={},this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:s,stopSequences:l,responseFormat:u,tools:c,toolChoice:d,seed:m,providerOptions:_}){let h=[],b={...await zt({provider:"openai",providerOptions:_,schema:W0}),...await zt({provider:this.providerOptionsName,providerOptions:_,schema:W0})};r!=null&&h.push({type:"unsupported",feature:"topK"}),c?.length&&h.push({type:"unsupported",feature:"tools"}),d!=null&&h.push({type:"unsupported",feature:"toolChoice"}),u!=null&&u.type!=="text"&&h.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});let{prompt:k,stopSequences:T}=sz({prompt:e}),R=[...T??[],...l??[]];return{args:{model:this.modelId,echo:b.echo,logit_bias:b.logitBias,logprobs:b?.logprobs===!0?0:b?.logprobs===!1?void 0:b?.logprobs,suffix:b.suffix,user:b.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:s,seed:m,prompt:k,stop:R.length>0?R:void 0},warnings:h}}async doGenerate(e){var t;let{args:n,warnings:o}=await this.getArgs(e),{responseHeaders:r,value:i,rawValue:s}=await vt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:n,failedResponseHandler:on,successfulResponseHandler:at(lz),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=i.choices[0],u={openai:{}};return l.logprobs!=null&&(u.openai.logprobs=l.logprobs),{content:[{type:"text",text:l.text}],usage:F0(i.usage),finishReason:{unified:V0(l.finish_reason),raw:(t=l.finish_reason)!=null?t:void 0},request:{body:n},response:{...Z0(i),headers:r,body:s},providerMetadata:u,warnings:o}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:r,value:i}=await vt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:o,failedResponseHandler:on,successfulResponseHandler:ho(uz),abortSignal:e.abortSignal,fetch:this.config.fetch}),s={unified:"other",raw:void 0},l={openai:{}},u,c=!0;return{stream:i.pipeThrough(new TransformStream({start(d){d.enqueue({type:"stream-start",warnings:n})},transform(d,m){if(e.includeRawChunks&&m.enqueue({type:"raw",rawValue:d.rawValue}),!d.success){s={unified:"error",raw:void 0},m.enqueue({type:"error",error:d.error});return}let _=d.value;if("error"in _){s={unified:"error",raw:void 0},m.enqueue({type:"error",error:_.error});return}c&&(c=!1,m.enqueue({type:"response-metadata",...Z0(_)}),m.enqueue({type:"text-start",id:"0"})),_.usage!=null&&(u=_.usage);let h=_.choices[0];h?.finish_reason!=null&&(s={unified:V0(h.finish_reason),raw:h.finish_reason}),h?.logprobs!=null&&(l.openai.logprobs=h.logprobs),h?.text!=null&&h.text.length>0&&m.enqueue({type:"text-delta",id:"0",delta:h.text})},flush(d){c||d.enqueue({type:"text-end",id:"0"}),d.enqueue({type:"finish",finishReason:s,providerMetadata:l,usage:F0(u)})}})),request:{body:o},response:{headers:r}}}},dz=X(()=>Y(a.object({dimensions:a.number().optional(),user:a.string().optional()}))),pz=X(()=>Y(a.object({data:a.array(a.object({embedding:a.array(a.number())})),usage:a.object({prompt_tokens:a.number()}).nullish()}))),fz=class{constructor(e,t){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;if(e.length>this.maxEmbeddingsPerCall)throw new KS({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let i=(r=await zt({provider:"openai",providerOptions:o,schema:dz}))!=null?r:{},{responseHeaders:s,value:l,rawValue:u}=await vt({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:nt(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:i.dimensions,user:i.user},failedResponseHandler:on,successfulResponseHandler:at(pz),abortSignal:n,fetch:this.config.fetch});return{warnings:[],embeddings:l.data.map(c=>c.embedding),usage:l.usage?{tokens:l.usage.prompt_tokens}:void 0,response:{headers:s,body:u}}}},H0=X(()=>Y(a.object({created:a.number().nullish(),data:a.array(a.object({b64_json:a.string(),revised_prompt:a.string().nullish()})),background:a.string().nullish(),output_format:a.string().nullish(),size:a.string().nullish(),quality:a.string().nullish(),usage:a.object({input_tokens:a.number().nullish(),output_tokens:a.number().nullish(),total_tokens:a.number().nullish(),input_tokens_details:a.object({image_tokens:a.number().nullish(),text_tokens:a.number().nullish()}).nullish()}).nullish()}))),mz={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10,"gpt-image-1.5":10,"gpt-image-2":10,"chatgpt-image-latest":10},hz=["chatgpt-image-","gpt-image-1-mini","gpt-image-1.5","gpt-image-1","gpt-image-2"];function gz(e){return hz.some(t=>e.startsWith(t))}var qv=a.object({quality:a.enum(["standard","hd","low","medium","high","auto"]).optional(),background:a.enum(["transparent","opaque","auto"]).optional(),outputFormat:a.enum(["png","jpeg","webp"]).optional(),outputCompression:a.number().int().min(0).max(100).optional(),user:a.string().optional()}),RJ=X(()=>Y(qv)),vz=X(()=>Y(qv.extend({style:a.enum(["vivid","natural"]).optional(),moderation:a.enum(["auto","low"]).optional()}))),yz=X(()=>Y(qv.extend({inputFidelity:a.enum(["high","low"]).optional()}))),_z=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get maxImagesPerCall(){var e;return(e=mz[this.modelId])!=null?e:1}get provider(){return this.config.provider}async doGenerate({prompt:e,files:t,mask:n,n:o,size:r,aspectRatio:i,seed:s,providerOptions:l,headers:u,abortSignal:c}){var d,m,_,h,b,k,T,R,g,v,C;let O=[];i!=null&&O.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),s!=null&&O.push({type:"unsupported",feature:"seed"});let N=(_=(m=(d=this.config._internal)==null?void 0:d.currentDate)==null?void 0:m.call(d))!=null?_:new Date;if(t!=null){let le=(h=await zt({provider:"openai",providerOptions:l,schema:yz}))!=null?h:{},{value:z,responseHeaders:ye}=await Fc({url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:nt(this.config.headers(),u),formData:k0({model:this.modelId,prompt:e,image:await Promise.all(t.map(D=>D.type==="file"?new Blob([D.data instanceof Uint8Array?new Blob([D.data],{type:D.mediaType}):new Blob([rn(D.data)],{type:D.mediaType})],{type:D.mediaType}):Iv(D.url))),mask:n!=null?await bz(n):void 0,n:o,size:r,quality:le.quality,background:le.background,output_format:le.outputFormat,output_compression:le.outputCompression,input_fidelity:le.inputFidelity,user:le.user}),failedResponseHandler:on,successfulResponseHandler:at(H0),abortSignal:c,fetch:this.config.fetch});return{images:z.data.map(D=>D.b64_json),warnings:O,usage:z.usage!=null?{inputTokens:(b=z.usage.input_tokens)!=null?b:void 0,outputTokens:(k=z.usage.output_tokens)!=null?k:void 0,totalTokens:(T=z.usage.total_tokens)!=null?T:void 0}:void 0,response:{timestamp:N,modelId:this.modelId,headers:ye},providerMetadata:{openai:{images:z.data.map((D,U)=>{var A,L,B,ne,W,pe;return{...D.revised_prompt?{revisedPrompt:D.revised_prompt}:{},created:(A=z.created)!=null?A:void 0,size:(L=z.size)!=null?L:void 0,quality:(B=z.quality)!=null?B:void 0,background:(ne=z.background)!=null?ne:void 0,outputFormat:(W=z.output_format)!=null?W:void 0,...J0((pe=z.usage)==null?void 0:pe.input_tokens_details,U,z.data.length)}})}}}}let K=(R=await zt({provider:"openai",providerOptions:l,schema:vz}))!=null?R:{},{value:ee,responseHeaders:E}=await vt({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:nt(this.config.headers(),u),body:{model:this.modelId,prompt:e,n:o,size:r,quality:K.quality,style:K.style,background:K.background,moderation:K.moderation,output_format:K.outputFormat,output_compression:K.outputCompression,user:K.user,...gz(this.modelId)?{}:{response_format:"b64_json"}},failedResponseHandler:on,successfulResponseHandler:at(H0),abortSignal:c,fetch:this.config.fetch});return{images:ee.data.map(le=>le.b64_json),warnings:O,usage:ee.usage!=null?{inputTokens:(g=ee.usage.input_tokens)!=null?g:void 0,outputTokens:(v=ee.usage.output_tokens)!=null?v:void 0,totalTokens:(C=ee.usage.total_tokens)!=null?C:void 0}:void 0,response:{timestamp:N,modelId:this.modelId,headers:E},providerMetadata:{openai:{images:ee.data.map((le,z)=>{var ye,D,U,A,L,B;return{...le.revised_prompt?{revisedPrompt:le.revised_prompt}:{},created:(ye=ee.created)!=null?ye:void 0,size:(D=ee.size)!=null?D:void 0,quality:(U=ee.quality)!=null?U:void 0,background:(A=ee.background)!=null?A:void 0,outputFormat:(L=ee.output_format)!=null?L:void 0,...J0((B=ee.usage)==null?void 0:B.input_tokens_details,z,ee.data.length)}})}}}}};function J0(e,t,n){if(e==null)return{};let o={};if(e.image_tokens!=null){let r=Math.floor(e.image_tokens/n),i=e.image_tokens-r*(n-1);o.imageTokens=t===n-1?i:r}if(e.text_tokens!=null){let r=Math.floor(e.text_tokens/n),i=e.text_tokens-r*(n-1);o.textTokens=t===n-1?i:r}return o}async function bz(e){if(!e)return;if(e.type==="url")return Iv(e.url);let t=e.data instanceof Uint8Array?e.data:rn(e.data);return new Blob([t],{type:e.mediaType})}var r$=X(()=>Y(a.object({callId:a.string(),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}))),n$=X(()=>Y(a.object({status:a.enum(["completed","failed"]),output:a.string().optional()}))),jJ=X(()=>Y(a.object({}))),wz=St({id:"openai.apply_patch",inputSchema:r$,outputSchema:n$}),xz=wz,kz=X(()=>Y(a.object({code:a.string().nullish(),containerId:a.string()}))),Sz=X(()=>Y(a.object({outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullish()}))),Iz=X(()=>Y(a.object({container:a.union([a.string(),a.object({fileIds:a.array(a.string()).optional()})]).optional()}))),Tz=St({id:"openai.code_interpreter",inputSchema:kz,outputSchema:Sz}),$z=(e={})=>Tz(e),Pz=X(()=>Y(a.object({name:a.string(),description:a.string().optional(),format:a.union([a.object({type:a.literal("grammar"),syntax:a.enum(["regex","lark"]),definition:a.string()}),a.object({type:a.literal("text")})]).optional()}))),Ez=X(()=>Y(a.string())),Cz=A0({id:"openai.custom",inputSchema:Ez}),Rz=e=>Cz(e),o$=a.object({key:a.string(),type:a.enum(["eq","ne","gt","gte","lt","lte","in","nin"]),value:a.union([a.string(),a.number(),a.boolean(),a.array(a.string())])}),i$=a.object({type:a.enum(["and","or"]),filters:a.array(a.union([o$,a.lazy(()=>i$)]))}),Oz=X(()=>Y(a.object({vectorStoreIds:a.array(a.string()),maxNumResults:a.number().optional(),ranking:a.object({ranker:a.string().optional(),scoreThreshold:a.number().optional()}).optional(),filters:a.union([o$,i$]).optional()}))),Dz=X(()=>Y(a.object({queries:a.array(a.string()),results:a.array(a.object({attributes:a.record(a.string(),a.unknown()),fileId:a.string(),filename:a.string(),score:a.number(),text:a.string()})).nullable()}))),jz=St({id:"openai.file_search",inputSchema:a.object({}),outputSchema:Dz}),Nz=X(()=>Y(a.object({background:a.enum(["auto","opaque","transparent"]).optional(),inputFidelity:a.enum(["low","high"]).optional(),inputImageMask:a.object({fileId:a.string().optional(),imageUrl:a.string().optional()}).optional(),model:a.string().optional(),moderation:a.enum(["auto"]).optional(),outputCompression:a.number().int().min(0).max(100).optional(),outputFormat:a.enum(["png","jpeg","webp"]).optional(),partialImages:a.number().int().min(0).max(3).optional(),quality:a.enum(["auto","low","medium","high"]).optional(),size:a.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict())),Mz=X(()=>Y(a.object({}))),Az=X(()=>Y(a.object({result:a.string()}))),zz=St({id:"openai.image_generation",inputSchema:Mz,outputSchema:Az}),qz=(e={})=>zz(e),a$=X(()=>Y(a.object({action:a.object({type:a.literal("exec"),command:a.array(a.string()),timeoutMs:a.number().optional(),user:a.string().optional(),workingDirectory:a.string().optional(),env:a.record(a.string(),a.string()).optional()})}))),s$=X(()=>Y(a.object({output:a.string()}))),Uz=St({id:"openai.local_shell",inputSchema:a$,outputSchema:s$}),l$=X(()=>Y(a.object({action:a.object({commands:a.array(a.string()),timeoutMs:a.number().optional(),maxOutputLength:a.number().optional()})}))),jv=X(()=>Y(a.object({output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exitCode:a.number()})])}))}))),Lz=a.array(a.discriminatedUnion("type",[a.object({type:a.literal("skillReference"),skillId:a.string(),version:a.string().optional()}),a.object({type:a.literal("inline"),name:a.string(),description:a.string(),source:a.object({type:a.literal("base64"),mediaType:a.literal("application/zip"),data:a.string()})})])).optional(),Fz=X(()=>Y(a.object({environment:a.union([a.object({type:a.literal("containerAuto"),fileIds:a.array(a.string()).optional(),memoryLimit:a.enum(["1g","4g","16g","64g"]).optional(),networkPolicy:a.discriminatedUnion("type",[a.object({type:a.literal("disabled")}),a.object({type:a.literal("allowlist"),allowedDomains:a.array(a.string()),domainSecrets:a.array(a.object({domain:a.string(),name:a.string(),value:a.string()})).optional()})]).optional(),skills:Lz}),a.object({type:a.literal("containerReference"),containerId:a.string()}),a.object({type:a.literal("local").optional(),skills:a.array(a.object({name:a.string(),description:a.string(),path:a.string()})).optional()})]).optional()}))),Zz=St({id:"openai.shell",inputSchema:l$,outputSchema:jv}),Vz=X(()=>Y(a.object({execution:a.enum(["server","client"]).optional(),description:a.string().optional(),parameters:a.record(a.string(),a.unknown()).optional()}))),Nv=X(()=>Y(a.object({arguments:a.unknown().optional(),call_id:a.string().nullish()}))),Mv=X(()=>Y(a.object({tools:a.array(a.record(a.string(),a.unknown()))}))),Wz=St({id:"openai.tool_search",inputSchema:Nv,outputSchema:Mv}),Hz=(e={})=>Wz(e),Jz=X(()=>Y(a.object({externalWebAccess:a.boolean().optional(),filters:a.object({allowedDomains:a.array(a.string()).optional()}).optional(),searchContextSize:a.enum(["low","medium","high"]).optional(),userLocation:a.object({type:a.literal("approximate"),country:a.string().optional(),city:a.string().optional(),region:a.string().optional(),timezone:a.string().optional()}).optional()}))),Bz=X(()=>Y(a.object({}))),Gz=X(()=>Y(a.object({action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().optional(),queries:a.array(a.string()).optional()}),a.object({type:a.literal("openPage"),url:a.string().nullish()}),a.object({type:a.literal("findInPage"),url:a.string().nullish(),pattern:a.string().nullish()})]).optional(),sources:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url"),url:a.string()}),a.object({type:a.literal("api"),name:a.string()})])).optional()}))),Kz=St({id:"openai.web_search",inputSchema:Bz,outputSchema:Gz}),Yz=(e={})=>Kz(e),Xz=X(()=>Y(a.object({searchContextSize:a.enum(["low","medium","high"]).optional(),userLocation:a.object({type:a.literal("approximate"),country:a.string().optional(),city:a.string().optional(),region:a.string().optional(),timezone:a.string().optional()}).optional()}))),Qz=X(()=>Y(a.object({}))),eq=X(()=>Y(a.object({action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().optional()}),a.object({type:a.literal("openPage"),url:a.string().nullish()}),a.object({type:a.literal("findInPage"),url:a.string().nullish(),pattern:a.string().nullish()})]).optional()}))),tq=St({id:"openai.web_search_preview",inputSchema:Qz,outputSchema:eq}),Av=a.lazy(()=>a.union([a.string(),a.number(),a.boolean(),a.null(),a.array(Av),a.record(a.string(),Av)])),rq=X(()=>Y(a.object({serverLabel:a.string(),allowedTools:a.union([a.array(a.string()),a.object({readOnly:a.boolean().optional(),toolNames:a.array(a.string()).optional()})]).optional(),authorization:a.string().optional(),connectorId:a.string().optional(),headers:a.record(a.string(),a.string()).optional(),requireApproval:a.union([a.enum(["always","never"]),a.object({never:a.object({toolNames:a.array(a.string()).optional()}).optional()})]).optional(),serverDescription:a.string().optional(),serverUrl:a.string().optional()}).refine(e=>e.serverUrl!=null||e.connectorId!=null,"One of serverUrl or connectorId must be provided."))),nq=X(()=>Y(a.object({}))),oq=X(()=>Y(a.object({type:a.literal("call"),serverLabel:a.string(),name:a.string(),arguments:a.string(),output:a.string().nullish(),error:a.union([a.string(),Av]).optional()}))),iq=St({id:"openai.mcp",inputSchema:nq,outputSchema:oq}),aq=e=>iq(e),sq={applyPatch:xz,customTool:Rz,codeInterpreter:$z,fileSearch:jz,imageGeneration:qz,localShell:Uz,shell:Zz,webSearchPreview:tq,webSearch:Yz,mcp:aq,toolSearch:Hz};function B0(e){var t,n,o,r;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let i=e.input_tokens,s=e.output_tokens,l=(n=(t=e.input_tokens_details)==null?void 0:t.cached_tokens)!=null?n:0,u=(r=(o=e.output_tokens_details)==null?void 0:o.reasoning_tokens)!=null?r:0;return{inputTokens:{total:i,noCache:i-l,cacheRead:l,cacheWrite:void 0},outputTokens:{total:s,text:s-u,reasoning:u},raw:e}}function lq(e){return JSON.stringify(e===void 0?{}:e)}function G0(e,t){return t?t.some(n=>e.startsWith(n)):!1}async function uq({prompt:e,toolNameMapping:t,systemMessageMode:n,providerOptionsName:o,fileIdPrefixes:r,passThroughUnsupportedFiles:i=!1,store:s,hasConversation:l=!1,hasPreviousResponseId:u=!1,hasLocalShellTool:c=!1,hasShellTool:d=!1,hasApplyPatchTool:m=!1,customProviderToolNames:_}){var h,b,k,T,R,g,v,C,O,N,K,ee,E,le,z,ye,D,U,A,L,B,ne;let W=[],pe=[],Pe=new Set;for(let{role:Ie,content:Le}of e)switch(Ie){case"system":{switch(n){case"system":{W.push({role:"system",content:Le});break}case"developer":{W.push({role:"developer",content:Le});break}case"remove":{pe.push({type:"other",message:"system messages are removed for this model"});break}default:{let oe=n;throw new Error(`Unsupported system message mode: ${oe}`)}}break}case"user":{W.push({role:"user",content:Le.map((oe,J)=>{var ge,we,se;switch(oe.type){case"text":return{type:"input_text",text:oe.text};case"file":{let me=oe.mediaType==="image/*"?"image/jpeg":oe.mediaType;if(me.startsWith("image/"))return{type:"input_image",...oe.data instanceof URL?{image_url:oe.data.toString()}:typeof oe.data=="string"&&G0(oe.data,r)?{file_id:oe.data}:{image_url:`data:${me};base64,${fo(oe.data)}`},detail:(we=(ge=oe.providerOptions)==null?void 0:ge[o])==null?void 0:we.imageDetail};if(oe.data instanceof URL)return{type:"input_file",file_url:oe.data.toString()};if(me!=="application/pdf"&&!i)throw new gr({functionality:`file part media type ${me}`});return{type:"input_file",...typeof oe.data=="string"&&G0(oe.data,r)?{file_id:oe.data}:{filename:(se=oe.filename)!=null?se:me==="application/pdf"?`part-${J}.pdf`:`part-${J}`,file_data:`data:${me};base64,${fo(oe.data)}`}}}}})});break}case"assistant":{let oe={};for(let J of Le)switch(J.type){case"text":{let ge=(h=J.providerOptions)==null?void 0:h[o],we=ge?.itemId,se=ge?.phase;if(l&&we!=null)break;if(s&&we!=null){W.push({type:"item_reference",id:we});break}W.push({role:"assistant",content:[{type:"output_text",text:J.text}],id:we,...se!=null&&{phase:se}});break}case"tool-call":{let ge=(g=(k=(b=J.providerOptions)==null?void 0:b[o])==null?void 0:k.itemId)!=null?g:(R=(T=J.providerMetadata)==null?void 0:T[o])==null?void 0:R.itemId,we=(K=(C=(v=J.providerOptions)==null?void 0:v[o])==null?void 0:C.namespace)!=null?K:(N=(O=J.providerMetadata)==null?void 0:O[o])==null?void 0:N.namespace;if(l&&ge!=null)break;let se=t.toProviderToolName(J.toolName);if(se==="tool_search"){if(s&&ge!=null){W.push({type:"item_reference",id:ge});break}let me=typeof J.input=="string"?await Ev({text:J.input,schema:Nv}):await Pt({value:J.input,schema:Nv}),F=me.call_id!=null?"client":"server";W.push({type:"tool_search_call",id:ge??J.toolCallId,execution:F,call_id:(ee=me.call_id)!=null?ee:null,status:"completed",arguments:me.arguments});break}if(J.providerExecuted){s&&ge!=null&&W.push({type:"item_reference",id:ge});break}if(s&&ge!=null){if(u)break;W.push({type:"item_reference",id:ge});break}if(c&&se==="local_shell"){let me=await Pt({value:J.input,schema:a$});W.push({type:"local_shell_call",call_id:J.toolCallId,id:ge,action:{type:"exec",command:me.action.command,timeout_ms:me.action.timeoutMs,user:me.action.user,working_directory:me.action.workingDirectory,env:me.action.env}});break}if(d&&se==="shell"){let me=await Pt({value:J.input,schema:l$});W.push({type:"shell_call",call_id:J.toolCallId,id:ge,status:"completed",action:{commands:me.action.commands,timeout_ms:me.action.timeoutMs,max_output_length:me.action.maxOutputLength}});break}if(m&&se==="apply_patch"){let me=await Pt({value:J.input,schema:r$});W.push({type:"apply_patch_call",call_id:me.callId,id:ge,status:"completed",operation:me.operation});break}if(_?.has(se)){W.push({type:"custom_tool_call",call_id:J.toolCallId,name:se,input:typeof J.input=="string"?J.input:JSON.stringify(J.input),id:ge});break}W.push({type:"function_call",call_id:J.toolCallId,name:se,arguments:lq(J.input),id:ge,...we!=null&&{namespace:we}});break}case"tool-result":{if(J.output.type==="execution-denied"||J.output.type==="json"&&typeof J.output.value=="object"&&J.output.value!=null&&"type"in J.output.value&&J.output.value.type==="execution-denied"||l)break;let ge=t.toProviderToolName(J.toolName);if(ge==="tool_search"){let we=(z=(le=(E=J.providerOptions)==null?void 0:E[o])==null?void 0:le.itemId)!=null?z:J.toolCallId;if(s)W.push({type:"item_reference",id:we});else if(J.output.type==="json"){let se=await Pt({value:J.output.value,schema:Mv});W.push({type:"tool_search_output",id:we,execution:"server",call_id:null,status:"completed",tools:se.tools})}break}if(d&&ge==="shell"){if(J.output.type==="json"){let we=await Pt({value:J.output.value,schema:jv});W.push({type:"shell_call_output",call_id:J.toolCallId,output:we.output.map(se=>({stdout:se.stdout,stderr:se.stderr,outcome:se.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:se.outcome.exitCode}}))})}break}if(s){let we=(U=(D=(ye=J.providerOptions)==null?void 0:ye[o])==null?void 0:D.itemId)!=null?U:J.toolCallId;W.push({type:"item_reference",id:we})}else pe.push({type:"other",message:`Results for OpenAI tool ${J.toolName} are not sent to the API when store is false`});break}case"reasoning":{let ge=await zt({provider:o,providerOptions:J.providerOptions,schema:cq}),we=ge?.itemId;if((l||u)&&we!=null)break;if(we!=null){let se=oe[we];if(s)se===void 0&&(W.push({type:"item_reference",id:we}),oe[we]={type:"reasoning",id:we,summary:[]});else{let me=[];J.text.length>0?me.push({type:"summary_text",text:J.text}):se!==void 0&&pe.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(J)}.`}),se===void 0?(oe[we]={type:"reasoning",id:we,encrypted_content:ge?.reasoningEncryptedContent,summary:me},W.push(oe[we])):(se.summary.push(...me),ge?.reasoningEncryptedContent!=null&&(se.encrypted_content=ge.reasoningEncryptedContent))}}else{let se=ge?.reasoningEncryptedContent;if(se!=null){let me=[];J.text.length>0&&me.push({type:"summary_text",text:J.text}),W.push({type:"reasoning",encrypted_content:se,summary:me})}else pe.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(J)}.`})}break}}break}case"tool":{for(let oe of Le){if(oe.type==="tool-approval-response"){let se=oe;if(Pe.has(se.approvalId))continue;Pe.add(se.approvalId),s&&W.push({type:"item_reference",id:se.approvalId}),W.push({type:"mcp_approval_response",approval_request_id:se.approvalId,approve:se.approved});continue}let J=oe.output;if(J.type==="execution-denied"&&((L=(A=J.providerOptions)==null?void 0:A.openai)==null?void 0:L.approvalId))continue;let ge=t.toProviderToolName(oe.toolName);if(ge==="tool_search"&&J.type==="json"){let se=await Pt({value:J.value,schema:Mv});W.push({type:"tool_search_output",execution:"client",call_id:oe.toolCallId,status:"completed",tools:se.tools});continue}if(c&&ge==="local_shell"&&J.type==="json"){let se=await Pt({value:J.value,schema:s$});W.push({type:"local_shell_call_output",call_id:oe.toolCallId,output:se.output});continue}if(d&&ge==="shell"&&J.type==="json"){let se=await Pt({value:J.value,schema:jv});W.push({type:"shell_call_output",call_id:oe.toolCallId,output:se.output.map(me=>({stdout:me.stdout,stderr:me.stderr,outcome:me.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:me.outcome.exitCode}}))});continue}if(m&&oe.toolName==="apply_patch"&&J.type==="json"){let se=await Pt({value:J.value,schema:n$});W.push({type:"apply_patch_call_output",call_id:oe.toolCallId,status:se.status,output:se.output});continue}if(_?.has(ge)){let se;switch(J.type){case"text":case"error-text":se=J.value;break;case"execution-denied":se=(B=J.reason)!=null?B:"Tool execution denied.";break;case"json":case"error-json":se=JSON.stringify(J.value);break;case"content":se=J.value.map(me=>{var F,xe,je,Me,Qt;switch(me.type){case"text":return{type:"input_text",text:me.text};case"image-data":return{type:"input_image",image_url:`data:${me.mediaType};base64,${me.data}`,detail:(xe=(F=me.providerOptions)==null?void 0:F[o])==null?void 0:xe.imageDetail};case"image-url":return{type:"input_image",image_url:me.url,detail:(Me=(je=me.providerOptions)==null?void 0:je[o])==null?void 0:Me.imageDetail};case"file-data":return{type:"input_file",filename:(Qt=me.filename)!=null?Qt:"data",file_data:`data:${me.mediaType};base64,${me.data}`};case"file-url":return{type:"input_file",file_url:me.url};default:pe.push({type:"other",message:`unsupported custom tool content part type: ${me.type}`});return}}).filter(Tv);break;default:se=""}W.push({type:"custom_tool_call_output",call_id:oe.toolCallId,output:se});continue}let we;switch(J.type){case"text":case"error-text":we=J.value;break;case"execution-denied":we=(ne=J.reason)!=null?ne:"Tool execution denied.";break;case"json":case"error-json":we=JSON.stringify(J.value);break;case"content":we=J.value.map(se=>{var me,F,xe,je,Me;switch(se.type){case"text":return{type:"input_text",text:se.text};case"image-data":return{type:"input_image",image_url:`data:${se.mediaType};base64,${se.data}`,detail:(F=(me=se.providerOptions)==null?void 0:me[o])==null?void 0:F.imageDetail};case"image-url":return{type:"input_image",image_url:se.url,detail:(je=(xe=se.providerOptions)==null?void 0:xe[o])==null?void 0:je.imageDetail};case"file-data":return{type:"input_file",filename:(Me=se.filename)!=null?Me:"data",file_data:`data:${se.mediaType};base64,${se.data}`};case"file-url":return{type:"input_file",file_url:se.url};default:{pe.push({type:"other",message:`unsupported tool content part type: ${se.type}`});return}}}).filter(Tv);break}W.push({type:"function_call_output",call_id:oe.toolCallId,output:we})}break}default:{let oe=Ie;throw new Error(`Unsupported role: ${oe}`)}}return!s&&W.some(Ie=>"type"in Ie&&Ie.type==="reasoning"&&Ie.encrypted_content==null)&&(pe.push({type:"other",message:"Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."}),W=W.filter(Ie=>!("type"in Ie)||Ie.type!=="reasoning"||Ie.encrypted_content!=null)),{input:W,warnings:pe}}var cq=a.object({itemId:a.string().nullish(),reasoningEncryptedContent:a.string().nullish()});function Dv({finishReason:e,hasFunctionCall:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"other"}}var Us=a.lazy(()=>a.union([a.string(),a.number(),a.boolean(),a.null(),a.array(Us),a.record(a.string(),Us.optional())])),dq=X(()=>Y(a.union([a.object({type:a.literal("response.output_text.delta"),item_id:a.string(),delta:a.string(),logprobs:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish()}),a.object({type:a.enum(["response.completed","response.incomplete"]),response:a.object({incomplete_details:a.object({reason:a.string()}).nullish(),usage:a.object({input_tokens:a.number(),input_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),output_tokens:a.number(),output_tokens_details:a.object({reasoning_tokens:a.number().nullish()}).nullish()}),service_tier:a.string().nullish()})}),a.object({type:a.literal("response.failed"),response:a.object({error:a.object({code:a.string().nullish(),message:a.string()}).nullish(),incomplete_details:a.object({reason:a.string()}).nullish(),usage:a.object({input_tokens:a.number(),input_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),output_tokens:a.number(),output_tokens_details:a.object({reasoning_tokens:a.number().nullish()}).nullish()}).nullish(),service_tier:a.string().nullish()})}),a.object({type:a.literal("response.created"),response:a.object({id:a.string(),created_at:a.number(),model:a.string(),service_tier:a.string().nullish()})}),a.object({type:a.literal("response.output_item.added"),output_index:a.number(),item:a.discriminatedUnion("type",[a.object({type:a.literal("message"),id:a.string(),phase:a.enum(["commentary","final_answer"]).nullish()}),a.object({type:a.literal("reasoning"),id:a.string(),encrypted_content:a.string().nullish()}),a.object({type:a.literal("function_call"),id:a.string(),call_id:a.string(),name:a.string(),arguments:a.string(),namespace:a.string().nullish()}),a.object({type:a.literal("web_search_call"),id:a.string(),status:a.string()}),a.object({type:a.literal("computer_call"),id:a.string(),status:a.string()}),a.object({type:a.literal("file_search_call"),id:a.string()}),a.object({type:a.literal("image_generation_call"),id:a.string()}),a.object({type:a.literal("code_interpreter_call"),id:a.string(),container_id:a.string(),code:a.string().nullable(),outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullable(),status:a.string()}),a.object({type:a.literal("mcp_call"),id:a.string(),status:a.string(),approval_request_id:a.string().nullish()}),a.object({type:a.literal("mcp_list_tools"),id:a.string()}),a.object({type:a.literal("mcp_approval_request"),id:a.string()}),a.object({type:a.literal("apply_patch_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed"]),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}),a.object({type:a.literal("custom_tool_call"),id:a.string(),call_id:a.string(),name:a.string(),input:a.string()}),a.object({type:a.literal("shell_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),action:a.object({commands:a.array(a.string())})}),a.object({type:a.literal("shell_call_output"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exit_code:a.number()})])}))}),a.object({type:a.literal("tool_search_call"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),arguments:a.unknown()}),a.object({type:a.literal("tool_search_output"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),tools:a.array(a.record(a.string(),Us.optional()))})])}),a.object({type:a.literal("response.output_item.done"),output_index:a.number(),item:a.discriminatedUnion("type",[a.object({type:a.literal("message"),id:a.string(),phase:a.enum(["commentary","final_answer"]).nullish()}),a.object({type:a.literal("reasoning"),id:a.string(),encrypted_content:a.string().nullish()}),a.object({type:a.literal("function_call"),id:a.string(),call_id:a.string(),name:a.string(),arguments:a.string(),status:a.literal("completed"),namespace:a.string().nullish()}),a.object({type:a.literal("custom_tool_call"),id:a.string(),call_id:a.string(),name:a.string(),input:a.string(),status:a.literal("completed")}),a.object({type:a.literal("code_interpreter_call"),id:a.string(),code:a.string().nullable(),container_id:a.string(),outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullable()}),a.object({type:a.literal("image_generation_call"),id:a.string(),result:a.string()}),a.object({type:a.literal("web_search_call"),id:a.string(),status:a.string(),action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().nullish(),queries:a.array(a.string()).nullish(),sources:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url"),url:a.string()}),a.object({type:a.literal("api"),name:a.string()})])).nullish()}),a.object({type:a.literal("open_page"),url:a.string().nullish()}),a.object({type:a.literal("find_in_page"),url:a.string().nullish(),pattern:a.string().nullish()})]).nullish()}),a.object({type:a.literal("file_search_call"),id:a.string(),queries:a.array(a.string()),results:a.array(a.object({attributes:a.record(a.string(),a.union([a.string(),a.number(),a.boolean()])),file_id:a.string(),filename:a.string(),score:a.number(),text:a.string()})).nullish()}),a.object({type:a.literal("local_shell_call"),id:a.string(),call_id:a.string(),action:a.object({type:a.literal("exec"),command:a.array(a.string()),timeout_ms:a.number().optional(),user:a.string().optional(),working_directory:a.string().optional(),env:a.record(a.string(),a.string()).optional()})}),a.object({type:a.literal("computer_call"),id:a.string(),status:a.literal("completed")}),a.object({type:a.literal("mcp_call"),id:a.string(),status:a.string(),arguments:a.string(),name:a.string(),server_label:a.string(),output:a.string().nullish(),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).nullish(),approval_request_id:a.string().nullish()}),a.object({type:a.literal("mcp_list_tools"),id:a.string(),server_label:a.string(),tools:a.array(a.object({name:a.string(),description:a.string().optional(),input_schema:a.any(),annotations:a.record(a.string(),a.unknown()).optional()})),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).optional()}),a.object({type:a.literal("mcp_approval_request"),id:a.string(),server_label:a.string(),name:a.string(),arguments:a.string(),approval_request_id:a.string().optional()}),a.object({type:a.literal("apply_patch_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed"]),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}),a.object({type:a.literal("shell_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),action:a.object({commands:a.array(a.string())})}),a.object({type:a.literal("shell_call_output"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exit_code:a.number()})])}))}),a.object({type:a.literal("tool_search_call"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),arguments:a.unknown()}),a.object({type:a.literal("tool_search_output"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),tools:a.array(a.record(a.string(),Us.optional()))})])}),a.object({type:a.literal("response.function_call_arguments.delta"),item_id:a.string(),output_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.custom_tool_call_input.delta"),item_id:a.string(),output_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.image_generation_call.partial_image"),item_id:a.string(),output_index:a.number(),partial_image_b64:a.string()}),a.object({type:a.literal("response.code_interpreter_call_code.delta"),item_id:a.string(),output_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.code_interpreter_call_code.done"),item_id:a.string(),output_index:a.number(),code:a.string()}),a.object({type:a.literal("response.output_text.annotation.added"),annotation:a.discriminatedUnion("type",[a.object({type:a.literal("url_citation"),start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()}),a.object({type:a.literal("file_citation"),file_id:a.string(),filename:a.string(),index:a.number()}),a.object({type:a.literal("container_file_citation"),container_id:a.string(),file_id:a.string(),filename:a.string(),start_index:a.number(),end_index:a.number()}),a.object({type:a.literal("file_path"),file_id:a.string(),index:a.number()})])}),a.object({type:a.literal("response.reasoning_summary_part.added"),item_id:a.string(),summary_index:a.number()}),a.object({type:a.literal("response.reasoning_summary_text.delta"),item_id:a.string(),summary_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.reasoning_summary_part.done"),item_id:a.string(),summary_index:a.number()}),a.object({type:a.literal("response.apply_patch_call_operation_diff.delta"),item_id:a.string(),output_index:a.number(),delta:a.string(),obfuscation:a.string().nullish()}),a.object({type:a.literal("response.apply_patch_call_operation_diff.done"),item_id:a.string(),output_index:a.number(),diff:a.string()}),a.object({type:a.literal("error"),sequence_number:a.number(),error:a.object({type:a.string(),code:a.string(),message:a.string(),param:a.string().nullish()})}),a.object({type:a.string()}).loose().transform(e=>({type:"unknown_chunk",message:e.type}))]))),pq=X(()=>Y(a.object({id:a.string().optional(),created_at:a.number().optional(),error:a.object({message:a.string(),type:a.string(),param:a.string().nullish(),code:a.string()}).nullish(),model:a.string().optional(),output:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("message"),role:a.literal("assistant"),id:a.string(),phase:a.enum(["commentary","final_answer"]).nullish(),content:a.array(a.object({type:a.literal("output_text"),text:a.string(),logprobs:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish(),annotations:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url_citation"),start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()}),a.object({type:a.literal("file_citation"),file_id:a.string(),filename:a.string(),index:a.number()}),a.object({type:a.literal("container_file_citation"),container_id:a.string(),file_id:a.string(),filename:a.string(),start_index:a.number(),end_index:a.number()}),a.object({type:a.literal("file_path"),file_id:a.string(),index:a.number()})]))}))}),a.object({type:a.literal("web_search_call"),id:a.string(),status:a.string(),action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().nullish(),queries:a.array(a.string()).nullish(),sources:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url"),url:a.string()}),a.object({type:a.literal("api"),name:a.string()})])).nullish()}),a.object({type:a.literal("open_page"),url:a.string().nullish()}),a.object({type:a.literal("find_in_page"),url:a.string().nullish(),pattern:a.string().nullish()})]).nullish()}),a.object({type:a.literal("file_search_call"),id:a.string(),queries:a.array(a.string()),results:a.array(a.object({attributes:a.record(a.string(),a.union([a.string(),a.number(),a.boolean()])),file_id:a.string(),filename:a.string(),score:a.number(),text:a.string()})).nullish()}),a.object({type:a.literal("code_interpreter_call"),id:a.string(),code:a.string().nullable(),container_id:a.string(),outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullable()}),a.object({type:a.literal("image_generation_call"),id:a.string(),result:a.string()}),a.object({type:a.literal("local_shell_call"),id:a.string(),call_id:a.string(),action:a.object({type:a.literal("exec"),command:a.array(a.string()),timeout_ms:a.number().optional(),user:a.string().optional(),working_directory:a.string().optional(),env:a.record(a.string(),a.string()).optional()})}),a.object({type:a.literal("function_call"),call_id:a.string(),name:a.string(),arguments:a.string(),id:a.string(),namespace:a.string().nullish()}),a.object({type:a.literal("custom_tool_call"),call_id:a.string(),name:a.string(),input:a.string(),id:a.string()}),a.object({type:a.literal("computer_call"),id:a.string(),status:a.string().optional()}),a.object({type:a.literal("reasoning"),id:a.string(),encrypted_content:a.string().nullish(),summary:a.array(a.object({type:a.literal("summary_text"),text:a.string()}))}),a.object({type:a.literal("mcp_call"),id:a.string(),status:a.string(),arguments:a.string(),name:a.string(),server_label:a.string(),output:a.string().nullish(),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).nullish(),approval_request_id:a.string().nullish()}),a.object({type:a.literal("mcp_list_tools"),id:a.string(),server_label:a.string(),tools:a.array(a.object({name:a.string(),description:a.string().optional(),input_schema:a.any(),annotations:a.record(a.string(),a.unknown()).optional()})),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).optional()}),a.object({type:a.literal("mcp_approval_request"),id:a.string(),server_label:a.string(),name:a.string(),arguments:a.string(),approval_request_id:a.string().optional()}),a.object({type:a.literal("apply_patch_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed"]),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}),a.object({type:a.literal("shell_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),action:a.object({commands:a.array(a.string())})}),a.object({type:a.literal("shell_call_output"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exit_code:a.number()})])}))}),a.object({type:a.literal("tool_search_call"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),arguments:a.unknown()}),a.object({type:a.literal("tool_search_output"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),tools:a.array(a.record(a.string(),Us.optional()))})])).optional(),service_tier:a.string().nullish(),incomplete_details:a.object({reason:a.string()}).nullish(),usage:a.object({input_tokens:a.number(),input_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),output_tokens:a.number(),output_tokens_details:a.object({reasoning_tokens:a.number().nullish()}).nullish()}).optional()}))),u$=20,fq=["o1","o1-2024-12-17","o3","o3-2025-04-16","o3-mini","o3-mini-2025-01-31","o4-mini","o4-mini-2025-04-16","gpt-5","gpt-5-2025-08-07","gpt-5-codex","gpt-5-mini","gpt-5-mini-2025-08-07","gpt-5-nano","gpt-5-nano-2025-08-07","gpt-5-pro","gpt-5-pro-2025-10-06","gpt-5.1","gpt-5.1-chat-latest","gpt-5.1-codex-mini","gpt-5.1-codex","gpt-5.1-codex-max","gpt-5.2","gpt-5.2-chat-latest","gpt-5.2-pro","gpt-5.2-codex","gpt-5.3-chat-latest","gpt-5.3-codex","gpt-5.4","gpt-5.4-2026-03-05","gpt-5.4-mini","gpt-5.4-mini-2026-03-17","gpt-5.4-nano","gpt-5.4-nano-2026-03-17","gpt-5.4-pro","gpt-5.4-pro-2026-03-05","gpt-5.5","gpt-5.5-2026-04-23"],c9=["gpt-4.1","gpt-4.1-2025-04-14","gpt-4.1-mini","gpt-4.1-mini-2025-04-14","gpt-4.1-nano","gpt-4.1-nano-2025-04-14","gpt-4o","gpt-4o-2024-05-13","gpt-4o-2024-08-06","gpt-4o-2024-11-20","gpt-4o-audio-preview","gpt-4o-audio-preview-2024-12-17","gpt-4o-search-preview","gpt-4o-search-preview-2025-03-11","gpt-4o-mini-search-preview","gpt-4o-mini-search-preview-2025-03-11","gpt-4o-mini","gpt-4o-mini-2024-07-18","gpt-3.5-turbo-0125","gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-5-chat-latest",...fq],K0=X(()=>Y(a.object({conversation:a.string().nullish(),include:a.array(a.enum(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:a.string().nullish(),logprobs:a.union([a.boolean(),a.number().min(1).max(u$)]).optional(),maxToolCalls:a.number().nullish(),metadata:a.any().nullish(),parallelToolCalls:a.boolean().nullish(),previousResponseId:a.string().nullish(),promptCacheKey:a.string().nullish(),promptCacheRetention:a.enum(["in_memory","24h"]).nullish(),reasoningEffort:a.string().nullish(),reasoningSummary:a.string().nullish(),safetyIdentifier:a.string().nullish(),serviceTier:a.enum(["auto","flex","priority","default"]).nullish(),store:a.boolean().nullish(),passThroughUnsupportedFiles:a.boolean().optional(),strictJsonSchema:a.boolean().nullish(),textVerbosity:a.enum(["low","medium","high"]).nullish(),truncation:a.enum(["auto","disabled"]).nullish(),user:a.string().nullish(),systemMessageMode:a.enum(["system","developer","remove"]).optional(),forceReasoning:a.boolean().optional(),allowedTools:a.object({toolNames:a.array(a.string()).min(1),mode:a.enum(["auto","required"]).optional()}).optional()})));async function mq({tools:e,toolChoice:t,allowedTools:n,toolNameMapping:o,customProviderToolNames:r}){var i,s,l;e=e?.length?e:void 0;let u=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:u};let c=[],d=r??new Set;for(let _ of e)switch(_.type){case"function":{let h=(i=_.providerOptions)==null?void 0:i.openai,b=h?.deferLoading;c.push({type:"function",name:_.name,description:_.description,parameters:_.inputSchema,..._.strict!=null?{strict:_.strict}:{},...b!=null?{defer_loading:b}:{}});break}case"provider":{switch(_.id){case"openai.file_search":{let h=await Pt({value:_.args,schema:Oz});c.push({type:"file_search",vector_store_ids:h.vectorStoreIds,max_num_results:h.maxNumResults,ranking_options:h.ranking?{ranker:h.ranking.ranker,score_threshold:h.ranking.scoreThreshold}:void 0,filters:h.filters});break}case"openai.local_shell":{c.push({type:"local_shell"});break}case"openai.shell":{let h=await Pt({value:_.args,schema:Fz});c.push({type:"shell",...h.environment&&{environment:hq(h.environment)}});break}case"openai.apply_patch":{c.push({type:"apply_patch"});break}case"openai.web_search_preview":{let h=await Pt({value:_.args,schema:Xz});c.push({type:"web_search_preview",search_context_size:h.searchContextSize,user_location:h.userLocation});break}case"openai.web_search":{let h=await Pt({value:_.args,schema:Jz});c.push({type:"web_search",filters:h.filters!=null?{allowed_domains:h.filters.allowedDomains}:void 0,external_web_access:h.externalWebAccess,search_context_size:h.searchContextSize,user_location:h.userLocation});break}case"openai.code_interpreter":{let h=await Pt({value:_.args,schema:Iz});c.push({type:"code_interpreter",container:h.container==null?{type:"auto",file_ids:void 0}:typeof h.container=="string"?h.container:{type:"auto",file_ids:h.container.fileIds}});break}case"openai.image_generation":{let h=await Pt({value:_.args,schema:Nz});c.push({type:"image_generation",background:h.background,input_fidelity:h.inputFidelity,input_image_mask:h.inputImageMask?{file_id:h.inputImageMask.fileId,image_url:h.inputImageMask.imageUrl}:void 0,model:h.model,moderation:h.moderation,partial_images:h.partialImages,quality:h.quality,output_compression:h.outputCompression,output_format:h.outputFormat,size:h.size});break}case"openai.mcp":{let h=await Pt({value:_.args,schema:rq}),b=R=>({tool_names:R.toolNames}),k=h.requireApproval,T=k==null?void 0:typeof k=="string"?k:k.never!=null?{never:b(k.never)}:void 0;c.push({type:"mcp",server_label:h.serverLabel,allowed_tools:Array.isArray(h.allowedTools)?h.allowedTools:h.allowedTools?{read_only:h.allowedTools.readOnly,tool_names:h.allowedTools.toolNames}:void 0,authorization:h.authorization,connector_id:h.connectorId,headers:h.headers,require_approval:T??"never",server_description:h.serverDescription,server_url:h.serverUrl});break}case"openai.custom":{let h=await Pt({value:_.args,schema:Pz});c.push({type:"custom",name:h.name,description:h.description,format:h.format}),d.add(h.name);break}case"openai.tool_search":{let h=await Pt({value:_.args,schema:Vz});c.push({type:"tool_search",...h.execution!=null?{execution:h.execution}:{},...h.description!=null?{description:h.description}:{},...h.parameters!=null?{parameters:h.parameters}:{}});break}}break}default:u.push({type:"unsupported",feature:`function tool ${_}`});break}if(n!=null)return{tools:c,toolChoice:{type:"allowed_tools",mode:(s=n.mode)!=null?s:"auto",tools:n.toolNames.map(_=>{var h;return{type:"function",name:(h=o?.toProviderToolName(_))!=null?h:_}})},toolWarnings:u};if(t==null)return{tools:c,toolChoice:void 0,toolWarnings:u};let m=t.type;switch(m){case"auto":case"none":case"required":return{tools:c,toolChoice:m,toolWarnings:u};case"tool":{let _=(l=o?.toProviderToolName(t.toolName))!=null?l:t.toolName;return{tools:c,toolChoice:_==="code_interpreter"||_==="file_search"||_==="image_generation"||_==="web_search_preview"||_==="web_search"||_==="mcp"||_==="apply_patch"?{type:_}:d.has(_)?{type:"custom",name:_}:{type:"function",name:_},toolWarnings:u}}default:{let _=m;throw new gr({functionality:`tool choice type: ${_}`})}}}function hq(e){if(e.type==="containerReference")return{type:"container_reference",container_id:e.containerId};if(e.type==="containerAuto"){let n=e;return{type:"container_auto",file_ids:n.fileIds,memory_limit:n.memoryLimit,network_policy:n.networkPolicy==null?void 0:n.networkPolicy.type==="disabled"?{type:"disabled"}:{type:"allowlist",allowed_domains:n.networkPolicy.allowedDomains,domain_secrets:n.networkPolicy.domainSecrets},skills:gq(n.skills)}}return{type:"local",skills:e.skills}}function gq(e){return e?.map(t=>t.type==="skillReference"?{type:"skill_reference",skill_id:t.skillId,version:t.version}:{type:"inline",name:t.name,description:t.description,source:{type:"base64",media_type:t.source.mediaType,data:t.source.data}})}function Y0(e){var t,n;let o={};for(let r of e)if(r.role==="assistant")for(let i of r.content){if(i.type!=="tool-call")continue;let s=(n=(t=i.providerOptions)==null?void 0:t.openai)==null?void 0:n.approvalRequestId;s!=null&&(o[s]=i.toolCallId)}return o}var vq=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({maxOutputTokens:e,temperature:t,stopSequences:n,topP:o,topK:r,presencePenalty:i,frequencyPenalty:s,seed:l,prompt:u,providerOptions:c,tools:d,toolChoice:m,responseFormat:_}){var h,b,k,T,R,g,v,C,O,N,K;let ee=[],E=t$(this.modelId);r!=null&&ee.push({type:"unsupported",feature:"topK"}),l!=null&&ee.push({type:"unsupported",feature:"seed"}),i!=null&&ee.push({type:"unsupported",feature:"presencePenalty"}),s!=null&&ee.push({type:"unsupported",feature:"frequencyPenalty"}),n!=null&&ee.push({type:"unsupported",feature:"stopSequences"});let le=this.config.provider.includes("azure")?"azure":"openai",z=await zt({provider:le,providerOptions:c,schema:K0});z==null&&le!=="openai"&&(z=await zt({provider:"openai",providerOptions:c,schema:K0}));let ye=(h=z?.forceReasoning)!=null?h:E.isReasoningModel;z?.conversation&&z?.previousResponseId&&ee.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});let D=w0({tools:d,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch","openai.tool_search":"tool_search"},resolveProviderToolName:F=>F.id==="openai.custom"?F.args.name:void 0}),U=new Set,{tools:A,toolChoice:L,toolWarnings:B}=await mq({tools:d,toolChoice:m,allowedTools:(b=z?.allowedTools)!=null?b:void 0,toolNameMapping:D,customProviderToolNames:U}),{input:ne,warnings:W}=await uq({prompt:u,toolNameMapping:D,systemMessageMode:(k=z?.systemMessageMode)!=null?k:ye?"developer":E.systemMessageMode,providerOptionsName:le,fileIdPrefixes:this.config.fileIdPrefixes,passThroughUnsupportedFiles:(T=z?.passThroughUnsupportedFiles)!=null?T:!1,store:(R=z?.store)!=null?R:!0,hasConversation:z?.conversation!=null,hasPreviousResponseId:z?.previousResponseId!=null,hasLocalShellTool:Le("openai.local_shell"),hasShellTool:Le("openai.shell"),hasApplyPatchTool:Le("openai.apply_patch"),customProviderToolNames:U.size>0?U:void 0});ee.push(...W);let pe=(g=z?.strictJsonSchema)!=null?g:!0,Pe=z?.include;function Ie(F){Pe==null?Pe=[F]:Pe.includes(F)||(Pe=[...Pe,F])}function Le(F){return d?.find(xe=>xe.type==="provider"&&xe.id===F)!=null}let oe=typeof z?.logprobs=="number"?z?.logprobs:z?.logprobs===!0?u$:void 0;oe&&Ie("message.output_text.logprobs");let J=(v=d?.find(F=>F.type==="provider"&&(F.id==="openai.web_search"||F.id==="openai.web_search_preview")))==null?void 0:v.name;J&&Ie("web_search_call.action.sources"),Le("openai.code_interpreter")&&Ie("code_interpreter_call.outputs");let ge=z?.store;ge===!1&&ye&&Ie("reasoning.encrypted_content");let we={model:this.modelId,input:ne,temperature:t,top_p:o,max_output_tokens:e,...(_?.type==="json"||z?.textVerbosity)&&{text:{..._?.type==="json"&&{format:_.schema!=null?{type:"json_schema",strict:pe,name:(C=_.name)!=null?C:"response",description:_.description,schema:_.schema}:{type:"json_object"}},...z?.textVerbosity&&{verbosity:z.textVerbosity}}},conversation:z?.conversation,max_tool_calls:z?.maxToolCalls,metadata:z?.metadata,parallel_tool_calls:z?.parallelToolCalls,previous_response_id:z?.previousResponseId,store:ge,user:z?.user,instructions:z?.instructions,service_tier:z?.serviceTier,include:Pe,prompt_cache_key:z?.promptCacheKey,prompt_cache_retention:z?.promptCacheRetention,safety_identifier:z?.safetyIdentifier,top_logprobs:oe,truncation:z?.truncation,...ye&&(z?.reasoningEffort!=null||z?.reasoningSummary!=null)&&{reasoning:{...z?.reasoningEffort!=null&&{effort:z.reasoningEffort},...z?.reasoningSummary!=null&&{summary:z.reasoningSummary}}}};ye?z?.reasoningEffort==="none"&&E.supportsNonReasoningParameters||(we.temperature!=null&&(we.temperature=void 0,ee.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),we.top_p!=null&&(we.top_p=void 0,ee.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(z?.reasoningEffort!=null&&ee.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),z?.reasoningSummary!=null&&ee.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})),z?.serviceTier==="flex"&&!E.supportsFlexProcessing&&(ee.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete we.service_tier),z?.serviceTier==="priority"&&!E.supportsPriorityProcessing&&(ee.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete we.service_tier);let se=(K=(N=(O=d?.find(F=>F.type==="provider"&&F.id==="openai.shell"))==null?void 0:O.args)==null?void 0:N.environment)==null?void 0:K.type,me=se==="containerAuto"||se==="containerReference";return{webSearchToolName:J,args:{...we,tools:A,tool_choice:L},warnings:[...ee,...B],store:ge,toolNameMapping:D,providerOptionsName:le,isShellProviderExecuted:me}}async doGenerate(e){var t,n,o,r,i,s,l,u,c,d,m,_,h,b,k,T,R,g,v,C,O,N,K,ee,E,le,z,ye;let{args:D,warnings:U,webSearchToolName:A,toolNameMapping:L,providerOptionsName:B,isShellProviderExecuted:ne}=await this.getArgs(e),W=this.config.url({path:"/responses",modelId:this.modelId}),pe=Y0(e.prompt),{responseHeaders:Pe,value:Ie,rawValue:Le}=await vt({url:W,headers:nt(this.config.headers(),e.headers),body:D,failedResponseHandler:on,successfulResponseHandler:at(pq),abortSignal:e.abortSignal,fetch:this.config.fetch});if(Ie.error)throw new Je({message:Ie.error.message,url:W,requestBodyValues:D,statusCode:400,responseHeaders:Pe,responseBody:Le,isRetryable:!1});let oe=[],J=[],ge=!1,we=[];for(let F of Ie.output)switch(F.type){case"reasoning":{F.summary.length===0&&F.summary.push({type:"summary_text",text:""});for(let xe of F.summary)oe.push({type:"reasoning",text:xe.text,providerMetadata:{[B]:{itemId:F.id,reasoningEncryptedContent:(t=F.encrypted_content)!=null?t:null}}});break}case"image_generation_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("image_generation"),result:{result:F.result}});break}case"tool_search_call":{let xe=(n=F.call_id)!=null?n:F.id,je=F.execution==="server";je&&we.push(xe),oe.push({type:"tool-call",toolCallId:xe,toolName:L.toCustomToolName("tool_search"),input:JSON.stringify({arguments:F.arguments,call_id:F.call_id}),...je?{providerExecuted:!0}:{},providerMetadata:{[B]:{itemId:F.id}}});break}case"tool_search_output":{let xe=(r=(o=F.call_id)!=null?o:we.shift())!=null?r:F.id;oe.push({type:"tool-result",toolCallId:xe,toolName:L.toCustomToolName("tool_search"),result:{tools:F.tools},providerMetadata:{[B]:{itemId:F.id}}});break}case"local_shell_call":{oe.push({type:"tool-call",toolCallId:F.call_id,toolName:L.toCustomToolName("local_shell"),input:JSON.stringify({action:F.action}),providerMetadata:{[B]:{itemId:F.id}}});break}case"shell_call":{oe.push({type:"tool-call",toolCallId:F.call_id,toolName:L.toCustomToolName("shell"),input:JSON.stringify({action:{commands:F.action.commands}}),...ne&&{providerExecuted:!0},providerMetadata:{[B]:{itemId:F.id}}});break}case"shell_call_output":{oe.push({type:"tool-result",toolCallId:F.call_id,toolName:L.toCustomToolName("shell"),result:{output:F.output.map(xe=>({stdout:xe.stdout,stderr:xe.stderr,outcome:xe.outcome.type==="exit"?{type:"exit",exitCode:xe.outcome.exit_code}:{type:"timeout"}}))}});break}case"message":{for(let xe of F.content){(s=(i=e.providerOptions)==null?void 0:i[B])!=null&&s.logprobs&&xe.logprobs&&J.push(xe.logprobs);let je={itemId:F.id,...F.phase!=null&&{phase:F.phase},...xe.annotations.length>0&&{annotations:xe.annotations}};oe.push({type:"text",text:xe.text,providerMetadata:{[B]:je}});for(let Me of xe.annotations)Me.type==="url_citation"?oe.push({type:"source",sourceType:"url",id:(c=(u=(l=this.config).generateId)==null?void 0:u.call(l))!=null?c:Vt(),url:Me.url,title:Me.title}):Me.type==="file_citation"?oe.push({type:"source",sourceType:"document",id:(_=(m=(d=this.config).generateId)==null?void 0:m.call(d))!=null?_:Vt(),mediaType:"text/plain",title:Me.filename,filename:Me.filename,providerMetadata:{[B]:{type:Me.type,fileId:Me.file_id,index:Me.index}}}):Me.type==="container_file_citation"?oe.push({type:"source",sourceType:"document",id:(k=(b=(h=this.config).generateId)==null?void 0:b.call(h))!=null?k:Vt(),mediaType:"text/plain",title:Me.filename,filename:Me.filename,providerMetadata:{[B]:{type:Me.type,fileId:Me.file_id,containerId:Me.container_id}}}):Me.type==="file_path"&&oe.push({type:"source",sourceType:"document",id:(g=(R=(T=this.config).generateId)==null?void 0:R.call(T))!=null?g:Vt(),mediaType:"application/octet-stream",title:Me.file_id,filename:Me.file_id,providerMetadata:{[B]:{type:Me.type,fileId:Me.file_id,index:Me.index}}})}break}case"function_call":{ge=!0,oe.push({type:"tool-call",toolCallId:F.call_id,toolName:F.name,input:F.arguments,providerMetadata:{[B]:{itemId:F.id,...F.namespace!=null&&{namespace:F.namespace}}}});break}case"custom_tool_call":{ge=!0;let xe=L.toCustomToolName(F.name);oe.push({type:"tool-call",toolCallId:F.call_id,toolName:xe,input:JSON.stringify(F.input),providerMetadata:{[B]:{itemId:F.id}}});break}case"web_search_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName(A??"web_search"),input:JSON.stringify({}),providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName(A??"web_search"),result:Q0(F.action)});break}case"mcp_call":{let xe=F.approval_request_id!=null&&(v=pe[F.approval_request_id])!=null?v:F.id,je=`mcp.${F.name}`;oe.push({type:"tool-call",toolCallId:xe,toolName:je,input:F.arguments,providerExecuted:!0,dynamic:!0}),oe.push({type:"tool-result",toolCallId:xe,toolName:je,result:{type:"call",serverLabel:F.server_label,name:F.name,arguments:F.arguments,...F.output!=null?{output:F.output}:{},...F.error!=null?{error:F.error}:{}},providerMetadata:{[B]:{itemId:F.id}}});break}case"mcp_list_tools":break;case"mcp_approval_request":{let xe=(C=F.approval_request_id)!=null?C:F.id,je=(K=(N=(O=this.config).generateId)==null?void 0:N.call(O))!=null?K:Vt(),Me=`mcp.${F.name}`;oe.push({type:"tool-call",toolCallId:je,toolName:Me,input:F.arguments,providerExecuted:!0,dynamic:!0}),oe.push({type:"tool-approval-request",approvalId:xe,toolCallId:je});break}case"computer_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:F.status||"completed"}});break}case"file_search_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("file_search"),result:{queries:F.queries,results:(E=(ee=F.results)==null?void 0:ee.map(xe=>({attributes:xe.attributes,fileId:xe.file_id,filename:xe.filename,score:xe.score,text:xe.text})))!=null?E:null}});break}case"code_interpreter_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("code_interpreter"),input:JSON.stringify({code:F.code,containerId:F.container_id}),providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("code_interpreter"),result:{outputs:F.outputs}});break}case"apply_patch_call":{oe.push({type:"tool-call",toolCallId:F.call_id,toolName:L.toCustomToolName("apply_patch"),input:JSON.stringify({callId:F.call_id,operation:F.operation}),providerMetadata:{[B]:{itemId:F.id}}});break}}let se={[B]:{responseId:Ie.id,...J.length>0?{logprobs:J}:{},...typeof Ie.service_tier=="string"?{serviceTier:Ie.service_tier}:{}}},me=Ie.usage;return{content:oe,finishReason:{unified:Dv({finishReason:(le=Ie.incomplete_details)==null?void 0:le.reason,hasFunctionCall:ge}),raw:(ye=(z=Ie.incomplete_details)==null?void 0:z.reason)!=null?ye:void 0},usage:B0(me),request:{body:D},response:{id:Ie.id,timestamp:new Date(Ie.created_at*1e3),modelId:Ie.model,headers:Pe,body:Le},providerMetadata:se,warnings:U}}async doStream(e){let{args:t,warnings:n,webSearchToolName:o,toolNameMapping:r,store:i,providerOptionsName:s,isShellProviderExecuted:l}=await this.getArgs(e),{responseHeaders:u,value:c}=await vt({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:on,successfulResponseHandler:ho(dq),abortSignal:e.abortSignal,fetch:this.config.fetch}),d=this,m=Y0(e.prompt),_=new Map,h={unified:"other",raw:void 0},b,k=[],T=null,R={},g=[],v,C=!1,O={},N,K=[];return{stream:c.pipeThrough(new TransformStream({start(ee){ee.enqueue({type:"stream-start",warnings:n})},transform(ee,E){var le,z,ye,D,U,A,L,B,ne,W,pe,Pe,Ie,Le,oe,J,ge,we,se,me,F,xe,je,Me,Qt,sr,Sr,lr,et,Mt,ur,sn,ln,Ht,Hr,Jr,Dr,Br;if(e.includeRawChunks&&E.enqueue({type:"raw",rawValue:ee.rawValue}),!ee.success){h={unified:"error",raw:void 0},E.enqueue({type:"error",error:ee.error});return}let x=ee.value;if(X0(x)){if(x.item.type==="function_call")R[x.output_index]={toolName:x.item.name,toolCallId:x.item.call_id},E.enqueue({type:"tool-input-start",id:x.item.call_id,toolName:x.item.name});else if(x.item.type==="custom_tool_call"){let y=r.toCustomToolName(x.item.name);R[x.output_index]={toolName:y,toolCallId:x.item.call_id},E.enqueue({type:"tool-input-start",id:x.item.call_id,toolName:y})}else if(x.item.type==="web_search_call")R[x.output_index]={toolName:r.toCustomToolName(o??"web_search"),toolCallId:x.item.id},E.enqueue({type:"tool-input-start",id:x.item.id,toolName:r.toCustomToolName(o??"web_search"),providerExecuted:!0}),E.enqueue({type:"tool-input-end",id:x.item.id}),E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName(o??"web_search"),input:JSON.stringify({}),providerExecuted:!0});else if(x.item.type==="computer_call")R[x.output_index]={toolName:r.toCustomToolName("computer_use"),toolCallId:x.item.id},E.enqueue({type:"tool-input-start",id:x.item.id,toolName:r.toCustomToolName("computer_use"),providerExecuted:!0});else if(x.item.type==="code_interpreter_call")R[x.output_index]={toolName:r.toCustomToolName("code_interpreter"),toolCallId:x.item.id,codeInterpreter:{containerId:x.item.container_id}},E.enqueue({type:"tool-input-start",id:x.item.id,toolName:r.toCustomToolName("code_interpreter"),providerExecuted:!0}),E.enqueue({type:"tool-input-delta",id:x.item.id,delta:`{"containerId":"${x.item.container_id}","code":"`});else if(x.item.type==="file_search_call")E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName("file_search"),input:"{}",providerExecuted:!0});else if(x.item.type==="image_generation_call")E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0});else if(x.item.type==="tool_search_call"){let y=x.item.id,q=r.toCustomToolName("tool_search"),G=x.item.execution==="server";R[x.output_index]={toolName:q,toolCallId:y,toolSearchExecution:(le=x.item.execution)!=null?le:"server"},G&&E.enqueue({type:"tool-input-start",id:y,toolName:q,providerExecuted:!0})}else if(x.item.type!=="tool_search_output"){if(!(x.item.type==="mcp_call"||x.item.type==="mcp_list_tools"||x.item.type==="mcp_approval_request"))if(x.item.type==="apply_patch_call"){let{call_id:y,operation:q}=x.item;if(R[x.output_index]={toolName:r.toCustomToolName("apply_patch"),toolCallId:y,applyPatch:{hasDiff:q.type==="delete_file",endEmitted:q.type==="delete_file"}},E.enqueue({type:"tool-input-start",id:y,toolName:r.toCustomToolName("apply_patch")}),q.type==="delete_file"){let G=JSON.stringify({callId:y,operation:q});E.enqueue({type:"tool-input-delta",id:y,delta:G}),E.enqueue({type:"tool-input-end",id:y})}else E.enqueue({type:"tool-input-delta",id:y,delta:`{"callId":"${ai(y)}","operation":{"type":"${ai(q.type)}","path":"${ai(q.path)}","diff":"`})}else x.item.type==="shell_call"?R[x.output_index]={toolName:r.toCustomToolName("shell"),toolCallId:x.item.call_id}:x.item.type==="shell_call_output"||(x.item.type==="message"?(g.splice(0,g.length),v=(z=x.item.phase)!=null?z:void 0,E.enqueue({type:"text-start",id:x.item.id,providerMetadata:{[s]:{itemId:x.item.id,...x.item.phase!=null&&{phase:x.item.phase}}}})):X0(x)&&x.item.type==="reasoning"&&(O[x.item.id]={encryptedContent:x.item.encrypted_content,summaryParts:{0:"active"}},E.enqueue({type:"reasoning-start",id:`${x.item.id}:0`,providerMetadata:{[s]:{itemId:x.item.id,reasoningEncryptedContent:(ye=x.item.encrypted_content)!=null?ye:null}}})))}}else if(_q(x)){if(x.item.type==="message"){let y=(D=x.item.phase)!=null?D:v;v=void 0,E.enqueue({type:"text-end",id:x.item.id,providerMetadata:{[s]:{itemId:x.item.id,...y!=null&&{phase:y},...g.length>0&&{annotations:g}}}})}else if(x.item.type==="function_call")R[x.output_index]=void 0,C=!0,E.enqueue({type:"tool-input-end",id:x.item.call_id,...x.item.namespace!=null&&{providerMetadata:{[s]:{namespace:x.item.namespace}}}}),E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:x.item.name,input:x.item.arguments,providerMetadata:{[s]:{itemId:x.item.id,...x.item.namespace!=null&&{namespace:x.item.namespace}}}});else if(x.item.type==="custom_tool_call"){R[x.output_index]=void 0,C=!0;let y=r.toCustomToolName(x.item.name);E.enqueue({type:"tool-input-end",id:x.item.call_id}),E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:y,input:JSON.stringify(x.item.input),providerMetadata:{[s]:{itemId:x.item.id}}})}else if(x.item.type==="web_search_call")R[x.output_index]=void 0,E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName(o??"web_search"),result:Q0(x.item.action)});else if(x.item.type==="computer_call")R[x.output_index]=void 0,E.enqueue({type:"tool-input-end",id:x.item.id}),E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:x.item.status||"completed"}});else if(x.item.type==="file_search_call")R[x.output_index]=void 0,E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("file_search"),result:{queries:x.item.queries,results:(A=(U=x.item.results)==null?void 0:U.map(y=>({attributes:y.attributes,fileId:y.file_id,filename:y.filename,score:y.score,text:y.text})))!=null?A:null}});else if(x.item.type==="code_interpreter_call")R[x.output_index]=void 0,E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("code_interpreter"),result:{outputs:x.item.outputs}});else if(x.item.type==="image_generation_call")E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("image_generation"),result:{result:x.item.result}});else if(x.item.type==="tool_search_call"){let y=R[x.output_index],q=x.item.execution==="server";if(y!=null){let G=q?y.toolCallId:(L=x.item.call_id)!=null?L:x.item.id;q?K.push(G):E.enqueue({type:"tool-input-start",id:G,toolName:y.toolName}),E.enqueue({type:"tool-input-end",id:G}),E.enqueue({type:"tool-call",toolCallId:G,toolName:y.toolName,input:JSON.stringify({arguments:x.item.arguments,call_id:q?null:G}),...q?{providerExecuted:!0}:{},providerMetadata:{[s]:{itemId:x.item.id}}})}R[x.output_index]=void 0}else if(x.item.type==="tool_search_output"){let y=(ne=(B=x.item.call_id)!=null?B:K.shift())!=null?ne:x.item.id;E.enqueue({type:"tool-result",toolCallId:y,toolName:r.toCustomToolName("tool_search"),result:{tools:x.item.tools},providerMetadata:{[s]:{itemId:x.item.id}}})}else if(x.item.type==="mcp_call"){R[x.output_index]=void 0;let y=(W=x.item.approval_request_id)!=null?W:void 0,q=y!=null&&(Pe=(pe=_.get(y))!=null?pe:m[y])!=null?Pe:x.item.id,G=`mcp.${x.item.name}`;E.enqueue({type:"tool-call",toolCallId:q,toolName:G,input:x.item.arguments,providerExecuted:!0,dynamic:!0}),E.enqueue({type:"tool-result",toolCallId:q,toolName:G,result:{type:"call",serverLabel:x.item.server_label,name:x.item.name,arguments:x.item.arguments,...x.item.output!=null?{output:x.item.output}:{},...x.item.error!=null?{error:x.item.error}:{}},providerMetadata:{[s]:{itemId:x.item.id}}})}else if(x.item.type==="mcp_list_tools")R[x.output_index]=void 0;else if(x.item.type==="apply_patch_call"){let y=R[x.output_index];y?.applyPatch&&!y.applyPatch.endEmitted&&x.item.operation.type!=="delete_file"&&(y.applyPatch.hasDiff||E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:ai(x.item.operation.diff)}),E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:'"}}'}),E.enqueue({type:"tool-input-end",id:y.toolCallId}),y.applyPatch.endEmitted=!0),y&&x.item.status==="completed"&&E.enqueue({type:"tool-call",toolCallId:y.toolCallId,toolName:r.toCustomToolName("apply_patch"),input:JSON.stringify({callId:x.item.call_id,operation:x.item.operation}),providerMetadata:{[s]:{itemId:x.item.id}}}),R[x.output_index]=void 0}else if(x.item.type==="mcp_approval_request"){R[x.output_index]=void 0;let y=(oe=(Le=(Ie=d.config).generateId)==null?void 0:Le.call(Ie))!=null?oe:Vt(),q=(J=x.item.approval_request_id)!=null?J:x.item.id;_.set(q,y);let G=`mcp.${x.item.name}`;E.enqueue({type:"tool-call",toolCallId:y,toolName:G,input:x.item.arguments,providerExecuted:!0,dynamic:!0}),E.enqueue({type:"tool-approval-request",approvalId:q,toolCallId:y})}else if(x.item.type==="local_shell_call")R[x.output_index]=void 0,E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:r.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:x.item.action.command,timeoutMs:x.item.action.timeout_ms,user:x.item.action.user,workingDirectory:x.item.action.working_directory,env:x.item.action.env}}),providerMetadata:{[s]:{itemId:x.item.id}}});else if(x.item.type==="shell_call")R[x.output_index]=void 0,E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:r.toCustomToolName("shell"),input:JSON.stringify({action:{commands:x.item.action.commands}}),...l&&{providerExecuted:!0},providerMetadata:{[s]:{itemId:x.item.id}}});else if(x.item.type==="shell_call_output")E.enqueue({type:"tool-result",toolCallId:x.item.call_id,toolName:r.toCustomToolName("shell"),result:{output:x.item.output.map(y=>({stdout:y.stdout,stderr:y.stderr,outcome:y.outcome.type==="exit"?{type:"exit",exitCode:y.outcome.exit_code}:{type:"timeout"}}))}});else if(x.item.type==="reasoning"){let y=O[x.item.id],q=Object.entries(y.summaryParts).filter(([G,ve])=>ve==="active"||ve==="can-conclude").map(([G])=>G);for(let G of q)E.enqueue({type:"reasoning-end",id:`${x.item.id}:${G}`,providerMetadata:{[s]:{itemId:x.item.id,reasoningEncryptedContent:(ge=x.item.encrypted_content)!=null?ge:null}}});delete O[x.item.id]}}else if(kq(x)){let y=R[x.output_index];y!=null&&E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:x.delta})}else if(Sq(x)){let y=R[x.output_index];y!=null&&E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:x.delta})}else if(Pq(x)){let y=R[x.output_index];y?.applyPatch&&(E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:ai(x.delta)}),y.applyPatch.hasDiff=!0)}else if(Eq(x)){let y=R[x.output_index];y?.applyPatch&&!y.applyPatch.endEmitted&&(y.applyPatch.hasDiff||(E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:ai(x.diff)}),y.applyPatch.hasDiff=!0),E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:'"}}'}),E.enqueue({type:"tool-input-end",id:y.toolCallId}),y.applyPatch.endEmitted=!0)}else if(Iq(x))E.enqueue({type:"tool-result",toolCallId:x.item_id,toolName:r.toCustomToolName("image_generation"),result:{result:x.partial_image_b64},preliminary:!0});else if(Tq(x)){let y=R[x.output_index];y!=null&&E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:ai(x.delta)})}else if($q(x)){let y=R[x.output_index];y!=null&&(E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:'"}'}),E.enqueue({type:"tool-input-end",id:y.toolCallId}),E.enqueue({type:"tool-call",toolCallId:y.toolCallId,toolName:r.toCustomToolName("code_interpreter"),input:JSON.stringify({code:x.code,containerId:y.codeInterpreter.containerId}),providerExecuted:!0}))}else if(xq(x))T=x.response.id,E.enqueue({type:"response-metadata",id:x.response.id,timestamp:new Date(x.response.created_at*1e3),modelId:x.response.model});else if(yq(x))E.enqueue({type:"text-delta",id:x.item_id,delta:x.delta}),(se=(we=e.providerOptions)==null?void 0:we[s])!=null&&se.logprobs&&x.logprobs&&k.push(x.logprobs);else if(x.type==="response.reasoning_summary_part.added"){if(x.summary_index>0){let y=O[x.item_id];y.summaryParts[x.summary_index]="active";for(let q of Object.keys(y.summaryParts))y.summaryParts[q]==="can-conclude"&&(E.enqueue({type:"reasoning-end",id:`${x.item_id}:${q}`,providerMetadata:{[s]:{itemId:x.item_id}}}),y.summaryParts[q]="concluded");E.enqueue({type:"reasoning-start",id:`${x.item_id}:${x.summary_index}`,providerMetadata:{[s]:{itemId:x.item_id,reasoningEncryptedContent:(F=(me=O[x.item_id])==null?void 0:me.encryptedContent)!=null?F:null}}})}}else if(x.type==="response.reasoning_summary_text.delta")E.enqueue({type:"reasoning-delta",id:`${x.item_id}:${x.summary_index}`,delta:x.delta,providerMetadata:{[s]:{itemId:x.item_id}}});else if(x.type==="response.reasoning_summary_part.done")i?(E.enqueue({type:"reasoning-end",id:`${x.item_id}:${x.summary_index}`,providerMetadata:{[s]:{itemId:x.item_id}}}),O[x.item_id].summaryParts[x.summary_index]="concluded"):O[x.item_id].summaryParts[x.summary_index]="can-conclude";else if(bq(x))h={unified:Dv({finishReason:(xe=x.response.incomplete_details)==null?void 0:xe.reason,hasFunctionCall:C}),raw:(Me=(je=x.response.incomplete_details)==null?void 0:je.reason)!=null?Me:void 0},b=x.response.usage,typeof x.response.service_tier=="string"&&(N=x.response.service_tier);else if(wq(x)){let y=(Qt=x.response.incomplete_details)==null?void 0:Qt.reason;h={unified:y?Dv({finishReason:y,hasFunctionCall:C}):"error",raw:y??"error"},b=(sr=x.response.usage)!=null?sr:void 0}else Cq(x)?(g.push(x.annotation),x.annotation.type==="url_citation"?E.enqueue({type:"source",sourceType:"url",id:(et=(lr=(Sr=d.config).generateId)==null?void 0:lr.call(Sr))!=null?et:Vt(),url:x.annotation.url,title:x.annotation.title}):x.annotation.type==="file_citation"?E.enqueue({type:"source",sourceType:"document",id:(sn=(ur=(Mt=d.config).generateId)==null?void 0:ur.call(Mt))!=null?sn:Vt(),mediaType:"text/plain",title:x.annotation.filename,filename:x.annotation.filename,providerMetadata:{[s]:{type:x.annotation.type,fileId:x.annotation.file_id,index:x.annotation.index}}}):x.annotation.type==="container_file_citation"?E.enqueue({type:"source",sourceType:"document",id:(Hr=(Ht=(ln=d.config).generateId)==null?void 0:Ht.call(ln))!=null?Hr:Vt(),mediaType:"text/plain",title:x.annotation.filename,filename:x.annotation.filename,providerMetadata:{[s]:{type:x.annotation.type,fileId:x.annotation.file_id,containerId:x.annotation.container_id}}}):x.annotation.type==="file_path"&&E.enqueue({type:"source",sourceType:"document",id:(Br=(Dr=(Jr=d.config).generateId)==null?void 0:Dr.call(Jr))!=null?Br:Vt(),mediaType:"application/octet-stream",title:x.annotation.file_id,filename:x.annotation.file_id,providerMetadata:{[s]:{type:x.annotation.type,fileId:x.annotation.file_id,index:x.annotation.index}}})):Rq(x)&&E.enqueue({type:"error",error:x})},flush(ee){let E={[s]:{responseId:T,...k.length>0?{logprobs:k}:{},...N!==void 0?{serviceTier:N}:{}}};ee.enqueue({type:"finish",finishReason:h,usage:B0(b),providerMetadata:E})}})),request:{body:t},response:{headers:u}}}};function yq(e){return e.type==="response.output_text.delta"}function _q(e){return e.type==="response.output_item.done"}function bq(e){return e.type==="response.completed"||e.type==="response.incomplete"}function wq(e){return e.type==="response.failed"}function xq(e){return e.type==="response.created"}function kq(e){return e.type==="response.function_call_arguments.delta"}function Sq(e){return e.type==="response.custom_tool_call_input.delta"}function Iq(e){return e.type==="response.image_generation_call.partial_image"}function Tq(e){return e.type==="response.code_interpreter_call_code.delta"}function $q(e){return e.type==="response.code_interpreter_call_code.done"}function Pq(e){return e.type==="response.apply_patch_call_operation_diff.delta"}function Eq(e){return e.type==="response.apply_patch_call_operation_diff.done"}function X0(e){return e.type==="response.output_item.added"}function Cq(e){return e.type==="response.output_text.annotation.added"}function Rq(e){return e.type==="error"}function Q0(e){var t;if(e==null)return{};switch(e.type){case"search":return{action:{type:"search",query:(t=e.query)!=null?t:void 0,...e.queries!=null&&{queries:e.queries}},...e.sources!=null&&{sources:e.sources}};case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}function ai(e){return JSON.stringify(e).slice(1,-1)}var Oq=X(()=>Y(a.object({instructions:a.string().nullish(),speed:a.number().min(.25).max(4).default(1).nullish()}))),Dq=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({text:e,voice:t="alloy",outputFormat:n="mp3",speed:o,instructions:r,language:i,providerOptions:s}){let l=[],u=await zt({provider:"openai",providerOptions:s,schema:Oq}),c={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:o,instructions:r};if(n&&(["mp3","opus","aac","flac","wav","pcm"].includes(n)?c.response_format=n:l.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${n}. Using mp3 instead.`})),u){let d={};for(let m in d){let _=d[m];_!==void 0&&(c[m]=_)}}return i&&l.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${i}" was ignored.`}),{requestBody:c,warnings:l}}async doGenerate(e){var t,n,o;let r=(o=(n=(t=this.config._internal)==null?void 0:t.currentDate)==null?void 0:n.call(t))!=null?o:new Date,{requestBody:i,warnings:s}=await this.getArgs(e),{value:l,responseHeaders:u,rawValue:c}=await vt({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:i,failedResponseHandler:on,successfulResponseHandler:z0(),abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:l,warnings:s,request:{body:JSON.stringify(i)},response:{timestamp:r,modelId:this.modelId,headers:u,body:c}}}},jq=X(()=>Y(a.object({text:a.string(),language:a.string().nullish(),duration:a.number().nullish(),words:a.array(a.object({word:a.string(),start:a.number(),end:a.number()})).nullish(),segments:a.array(a.object({id:a.number(),seek:a.number(),start:a.number(),end:a.number(),text:a.string(),tokens:a.array(a.number()),temperature:a.number(),avg_logprob:a.number(),compression_ratio:a.number(),no_speech_prob:a.number()})).nullish()}))),Nq=X(()=>Y(a.object({include:a.array(a.string()).optional(),language:a.string().optional(),prompt:a.string().optional(),temperature:a.number().min(0).max(1).default(0).optional(),timestampGranularities:a.array(a.enum(["word","segment"])).default(["segment"]).optional()}))),e$={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},Mq=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:e,mediaType:t,providerOptions:n}){let o=[],r=await zt({provider:"openai",providerOptions:n,schema:Nq}),i=new FormData,s=e instanceof Uint8Array?new Blob([e]):new Blob([rn(e)]);i.append("model",this.modelId);let l=R0(t);if(i.append("file",new File([s],"audio",{type:t}),`audio.${l}`),r){let u={include:r.include,language:r.language,prompt:r.prompt,response_format:["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId)?"json":"verbose_json",temperature:r.temperature,timestamp_granularities:r.timestampGranularities};for(let[c,d]of Object.entries(u))if(d!=null)if(Array.isArray(d))for(let m of d)i.append(`${c}[]`,String(m));else i.append(c,String(d))}return{formData:i,warnings:o}}async doGenerate(e){var t,n,o,r,i,s,l,u;let c=(o=(n=(t=this.config._internal)==null?void 0:t.currentDate)==null?void 0:n.call(t))!=null?o:new Date,{formData:d,warnings:m}=await this.getArgs(e),{value:_,responseHeaders:h,rawValue:b}=await Fc({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),formData:d,failedResponseHandler:on,successfulResponseHandler:at(jq),abortSignal:e.abortSignal,fetch:this.config.fetch}),k=_.language!=null&&_.language in e$?e$[_.language]:void 0;return{text:_.text,segments:(l=(s=(r=_.segments)==null?void 0:r.map(T=>({text:T.text,startSecond:T.start,endSecond:T.end})))!=null?s:(i=_.words)==null?void 0:i.map(T=>({text:T.word,startSecond:T.start,endSecond:T.end})))!=null?l:[],language:k,durationInSeconds:(u=_.duration)!=null?u:void 0,warnings:m,response:{timestamp:c,modelId:this.modelId,headers:h,body:b}}}},Aq="3.0.68";function Uv(e={}){var t,n;let o=(t=Zc(mo({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"})))!=null?t:"https://api.openai.com/v1",r=(n=e.name)!=null?n:"openai",i=()=>nn({Authorization:`Bearer ${C0({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers},`ai-sdk/openai/${Aq}`),s=k=>new az(k,{provider:`${r}.chat`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch}),l=k=>new cz(k,{provider:`${r}.completion`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch}),u=k=>new fz(k,{provider:`${r}.embedding`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch}),c=k=>new _z(k,{provider:`${r}.image`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch}),d=k=>new Mq(k,{provider:`${r}.transcription`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch}),m=k=>new Dq(k,{provider:`${r}.speech`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch}),_=k=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return h(k)},h=k=>new vq(k,{provider:`${r}.responses`,url:({path:T})=>`${o}${T}`,headers:i,fetch:e.fetch,fileIdPrefixes:["file-"]}),b=function(k){return _(k)};return b.specificationVersion="v3",b.languageModel=_,b.chat=s,b.completion=l,b.responses=h,b.embedding=u,b.embeddingModel=u,b.textEmbedding=u,b.textEmbeddingModel=u,b.image=c,b.imageModel=c,b.transcription=d,b.transcriptionModel=d,b.speech=m,b.speechModel=m,b.tools=sq,b}var w9=Uv();var jP=cr(iy(),1),NP=cr(iy(),1),w4="vercel.ai.gateway.error",ay=Symbol.for(w4),B$,G$,Wt=class kP extends(G$=Error,B$=ay,G$){constructor({message:t,statusCode:n=500,cause:o,generationId:r,isRetryable:i=n!=null&&(n===408||n===409||n===429||n>=500)}){super(r?`${t} [${r}]`:t),this[B$]=!0,this.statusCode=n,this.cause=o,this.generationId=r,this.isRetryable=i}static isInstance(t){return kP.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&ay in t&&t[ay]===!0}},SP="GatewayAuthenticationError",x4=`vercel.ai.gateway.error.${SP}`,K$=Symbol.for(x4),Y$,X$,Bc=class IP extends(X$=Wt,Y$=K$,X$){constructor({message:t="Authentication failed",statusCode:n=401,cause:o,generationId:r}={}){super({message:t,statusCode:n,cause:o,generationId:r}),this[Y$]=!0,this.name=SP,this.type="authentication_error"}static isInstance(t){return Wt.hasMarker(t)&&K$ in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:o="Authentication failed",statusCode:r=401,cause:i,generationId:s}){let l;return t?l=`AI Gateway authentication failed: Invalid API key. +${t}:`]}}function a$({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function s$(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var Cz=X(()=>Y(a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({text:a.string(),finish_reason:a.string(),logprobs:a.object({tokens:a.array(a.string()),token_logprobs:a.array(a.number()),top_logprobs:a.array(a.record(a.string(),a.number())).nullish()}).nullish()})),usage:a.object({prompt_tokens:a.number(),completion_tokens:a.number(),total_tokens:a.number()}).nullish()}))),Oz=X(()=>Y(a.union([a.object({id:a.string().nullish(),created:a.number().nullish(),model:a.string().nullish(),choices:a.array(a.object({text:a.string(),finish_reason:a.string().nullish(),index:a.number(),logprobs:a.object({tokens:a.array(a.string()),token_logprobs:a.array(a.number()),top_logprobs:a.array(a.record(a.string(),a.number())).nullish()}).nullish()})),usage:a.object({prompt_tokens:a.number(),completion_tokens:a.number(),total_tokens:a.number()}).nullish()}),Wv]))),l$=X(()=>Y(a.object({echo:a.boolean().optional(),logitBias:a.record(a.string(),a.number()).optional(),suffix:a.string().optional(),user:a.string().optional(),logprobs:a.union([a.boolean(),a.number()]).optional()}))),Dz=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={},this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:s,stopSequences:l,responseFormat:u,tools:c,toolChoice:d,seed:m,providerOptions:_}){let h=[],b={...await zt({provider:"openai",providerOptions:_,schema:l$}),...await zt({provider:this.providerOptionsName,providerOptions:_,schema:l$})};r!=null&&h.push({type:"unsupported",feature:"topK"}),c?.length&&h.push({type:"unsupported",feature:"tools"}),d!=null&&h.push({type:"unsupported",feature:"toolChoice"}),u!=null&&u.type!=="text"&&h.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});let{prompt:k,stopSequences:I}=Rz({prompt:e}),C=[...I??[],...l??[]];return{args:{model:this.modelId,echo:b.echo,logit_bias:b.logitBias,logprobs:b?.logprobs===!0?0:b?.logprobs===!1?void 0:b?.logprobs,suffix:b.suffix,user:b.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:s,seed:m,prompt:k,stop:C.length>0?C:void 0},warnings:h}}async doGenerate(e){var t;let{args:n,warnings:o}=await this.getArgs(e),{responseHeaders:r,value:i,rawValue:s}=await vt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:n,failedResponseHandler:an,successfulResponseHandler:it(Cz),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=i.choices[0],u={openai:{}};return l.logprobs!=null&&(u.openai.logprobs=l.logprobs),{content:[{type:"text",text:l.text}],usage:i$(i.usage),finishReason:{unified:s$(l.finish_reason),raw:(t=l.finish_reason)!=null?t:void 0},request:{body:n},response:{...a$(i),headers:r,body:s},providerMetadata:u,warnings:o}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:r,value:i}=await vt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:o,failedResponseHandler:an,successfulResponseHandler:vo(Oz),abortSignal:e.abortSignal,fetch:this.config.fetch}),s={unified:"other",raw:void 0},l={openai:{}},u,c=!0;return{stream:i.pipeThrough(new TransformStream({start(d){d.enqueue({type:"stream-start",warnings:n})},transform(d,m){if(e.includeRawChunks&&m.enqueue({type:"raw",rawValue:d.rawValue}),!d.success){s={unified:"error",raw:void 0},m.enqueue({type:"error",error:d.error});return}let _=d.value;if("error"in _){s={unified:"error",raw:void 0},m.enqueue({type:"error",error:_.error});return}c&&(c=!1,m.enqueue({type:"response-metadata",...a$(_)}),m.enqueue({type:"text-start",id:"0"})),_.usage!=null&&(u=_.usage);let h=_.choices[0];h?.finish_reason!=null&&(s={unified:s$(h.finish_reason),raw:h.finish_reason}),h?.logprobs!=null&&(l.openai.logprobs=h.logprobs),h?.text!=null&&h.text.length>0&&m.enqueue({type:"text-delta",id:"0",delta:h.text})},flush(d){c||d.enqueue({type:"text-end",id:"0"}),d.enqueue({type:"finish",finishReason:s,providerMetadata:l,usage:i$(u)})}})),request:{body:o},response:{headers:r}}}},jz=X(()=>Y(a.object({dimensions:a.number().optional(),user:a.string().optional()}))),Nz=X(()=>Y(a.object({data:a.array(a.object({embedding:a.array(a.number())})),usage:a.object({prompt_tokens:a.number()}).nullish()}))),Mz=class{constructor(e,t){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;if(e.length>this.maxEmbeddingsPerCall)throw new fT({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let i=(r=await zt({provider:"openai",providerOptions:o,schema:jz}))!=null?r:{},{responseHeaders:s,value:l,rawValue:u}=await vt({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:nt(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:i.dimensions,user:i.user},failedResponseHandler:an,successfulResponseHandler:it(Nz),abortSignal:n,fetch:this.config.fetch});return{warnings:[],embeddings:l.data.map(c=>c.embedding),usage:l.usage?{tokens:l.usage.prompt_tokens}:void 0,response:{headers:s,body:u}}}},u$=X(()=>Y(a.object({created:a.number().nullish(),data:a.array(a.object({b64_json:a.string(),revised_prompt:a.string().nullish()})),background:a.string().nullish(),output_format:a.string().nullish(),size:a.string().nullish(),quality:a.string().nullish(),usage:a.object({input_tokens:a.number().nullish(),output_tokens:a.number().nullish(),total_tokens:a.number().nullish(),input_tokens_details:a.object({image_tokens:a.number().nullish(),text_tokens:a.number().nullish()}).nullish()}).nullish()}))),Az={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10,"gpt-image-1.5":10,"gpt-image-2":10,"chatgpt-image-latest":10},zz=["chatgpt-image-","gpt-image-1-mini","gpt-image-1.5","gpt-image-1","gpt-image-2"];function qz(e){return zz.some(t=>e.startsWith(t))}var Hv=a.object({quality:a.enum(["standard","hd","low","medium","high","auto"]).optional(),background:a.enum(["transparent","opaque","auto"]).optional(),outputFormat:a.enum(["png","jpeg","webp"]).optional(),outputCompression:a.number().int().min(0).max(100).optional(),user:a.string().optional()}),lJ=X(()=>Y(Hv)),Uz=X(()=>Y(Hv.extend({style:a.enum(["vivid","natural"]).optional(),moderation:a.enum(["auto","low"]).optional()}))),Lz=X(()=>Y(Hv.extend({inputFidelity:a.enum(["high","low"]).optional()}))),Fz=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get maxImagesPerCall(){var e;return(e=Az[this.modelId])!=null?e:1}get provider(){return this.config.provider}async doGenerate({prompt:e,files:t,mask:n,n:o,size:r,aspectRatio:i,seed:s,providerOptions:l,headers:u,abortSignal:c}){var d,m,_,h,b,k,I,C,g,v,R;let O=[];i!=null&&O.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),s!=null&&O.push({type:"unsupported",feature:"seed"});let N=(_=(m=(d=this.config._internal)==null?void 0:d.currentDate)==null?void 0:m.call(d))!=null?_:new Date;if(t!=null){let le=(h=await zt({provider:"openai",providerOptions:l,schema:Lz}))!=null?h:{},{value:z,responseHeaders:ye}=await Vc({url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:nt(this.config.headers(),u),formData:U0({model:this.modelId,prompt:e,image:await Promise.all(t.map(D=>D.type==="file"?new Blob([D.data instanceof Uint8Array?new Blob([D.data],{type:D.mediaType}):new Blob([nn(D.data)],{type:D.mediaType})],{type:D.mediaType}):Ov(D.url))),mask:n!=null?await Zz(n):void 0,n:o,size:r,quality:le.quality,background:le.background,output_format:le.outputFormat,output_compression:le.outputCompression,input_fidelity:le.inputFidelity,user:le.user}),failedResponseHandler:an,successfulResponseHandler:it(u$),abortSignal:c,fetch:this.config.fetch});return{images:z.data.map(D=>D.b64_json),warnings:O,usage:z.usage!=null?{inputTokens:(b=z.usage.input_tokens)!=null?b:void 0,outputTokens:(k=z.usage.output_tokens)!=null?k:void 0,totalTokens:(I=z.usage.total_tokens)!=null?I:void 0}:void 0,response:{timestamp:N,modelId:this.modelId,headers:ye},providerMetadata:{openai:{images:z.data.map((D,U)=>{var A,L,B,ne,W,pe;return{...D.revised_prompt?{revisedPrompt:D.revised_prompt}:{},created:(A=z.created)!=null?A:void 0,size:(L=z.size)!=null?L:void 0,quality:(B=z.quality)!=null?B:void 0,background:(ne=z.background)!=null?ne:void 0,outputFormat:(W=z.output_format)!=null?W:void 0,...c$((pe=z.usage)==null?void 0:pe.input_tokens_details,U,z.data.length)}})}}}}let K=(C=await zt({provider:"openai",providerOptions:l,schema:Uz}))!=null?C:{},{value:ee,responseHeaders:E}=await vt({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:nt(this.config.headers(),u),body:{model:this.modelId,prompt:e,n:o,size:r,quality:K.quality,style:K.style,background:K.background,moderation:K.moderation,output_format:K.outputFormat,output_compression:K.outputCompression,user:K.user,...qz(this.modelId)?{}:{response_format:"b64_json"}},failedResponseHandler:an,successfulResponseHandler:it(u$),abortSignal:c,fetch:this.config.fetch});return{images:ee.data.map(le=>le.b64_json),warnings:O,usage:ee.usage!=null?{inputTokens:(g=ee.usage.input_tokens)!=null?g:void 0,outputTokens:(v=ee.usage.output_tokens)!=null?v:void 0,totalTokens:(R=ee.usage.total_tokens)!=null?R:void 0}:void 0,response:{timestamp:N,modelId:this.modelId,headers:E},providerMetadata:{openai:{images:ee.data.map((le,z)=>{var ye,D,U,A,L,B;return{...le.revised_prompt?{revisedPrompt:le.revised_prompt}:{},created:(ye=ee.created)!=null?ye:void 0,size:(D=ee.size)!=null?D:void 0,quality:(U=ee.quality)!=null?U:void 0,background:(A=ee.background)!=null?A:void 0,outputFormat:(L=ee.output_format)!=null?L:void 0,...c$((B=ee.usage)==null?void 0:B.input_tokens_details,z,ee.data.length)}})}}}}};function c$(e,t,n){if(e==null)return{};let o={};if(e.image_tokens!=null){let r=Math.floor(e.image_tokens/n),i=e.image_tokens-r*(n-1);o.imageTokens=t===n-1?i:r}if(e.text_tokens!=null){let r=Math.floor(e.text_tokens/n),i=e.text_tokens-r*(n-1);o.textTokens=t===n-1?i:r}return o}async function Zz(e){if(!e)return;if(e.type==="url")return Ov(e.url);let t=e.data instanceof Uint8Array?e.data:nn(e.data);return new Blob([t],{type:e.mediaType})}var _$=X(()=>Y(a.object({callId:a.string(),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}))),b$=X(()=>Y(a.object({status:a.enum(["completed","failed"]),output:a.string().optional()}))),dJ=X(()=>Y(a.object({}))),Vz=St({id:"openai.apply_patch",inputSchema:_$,outputSchema:b$}),Wz=Vz,Hz=X(()=>Y(a.object({code:a.string().nullish(),containerId:a.string()}))),Jz=X(()=>Y(a.object({outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullish()}))),Bz=X(()=>Y(a.object({container:a.union([a.string(),a.object({fileIds:a.array(a.string()).optional()})]).optional()}))),Gz=St({id:"openai.code_interpreter",inputSchema:Hz,outputSchema:Jz}),Kz=(e={})=>Gz(e),Yz=X(()=>Y(a.object({name:a.string(),description:a.string().optional(),format:a.union([a.object({type:a.literal("grammar"),syntax:a.enum(["regex","lark"]),definition:a.string()}),a.object({type:a.literal("text")})]).optional()}))),Xz=X(()=>Y(a.string())),Qz=e$({id:"openai.custom",inputSchema:Xz}),eq=e=>Qz(e),w$=a.object({key:a.string(),type:a.enum(["eq","ne","gt","gte","lt","lte","in","nin"]),value:a.union([a.string(),a.number(),a.boolean(),a.array(a.string())])}),x$=a.object({type:a.enum(["and","or"]),filters:a.array(a.union([w$,a.lazy(()=>x$)]))}),tq=X(()=>Y(a.object({vectorStoreIds:a.array(a.string()),maxNumResults:a.number().optional(),ranking:a.object({ranker:a.string().optional(),scoreThreshold:a.number().optional()}).optional(),filters:a.union([w$,x$]).optional()}))),rq=X(()=>Y(a.object({queries:a.array(a.string()),results:a.array(a.object({attributes:a.record(a.string(),a.unknown()),fileId:a.string(),filename:a.string(),score:a.number(),text:a.string()})).nullable()}))),nq=St({id:"openai.file_search",inputSchema:a.object({}),outputSchema:rq}),oq=X(()=>Y(a.object({background:a.enum(["auto","opaque","transparent"]).optional(),inputFidelity:a.enum(["low","high"]).optional(),inputImageMask:a.object({fileId:a.string().optional(),imageUrl:a.string().optional()}).optional(),model:a.string().optional(),moderation:a.enum(["auto"]).optional(),outputCompression:a.number().int().min(0).max(100).optional(),outputFormat:a.enum(["png","jpeg","webp"]).optional(),partialImages:a.number().int().min(0).max(3).optional(),quality:a.enum(["auto","low","medium","high"]).optional(),size:a.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict())),iq=X(()=>Y(a.object({}))),aq=X(()=>Y(a.object({result:a.string()}))),sq=St({id:"openai.image_generation",inputSchema:iq,outputSchema:aq}),lq=(e={})=>sq(e),k$=X(()=>Y(a.object({action:a.object({type:a.literal("exec"),command:a.array(a.string()),timeoutMs:a.number().optional(),user:a.string().optional(),workingDirectory:a.string().optional(),env:a.record(a.string(),a.string()).optional()})}))),S$=X(()=>Y(a.object({output:a.string()}))),uq=St({id:"openai.local_shell",inputSchema:k$,outputSchema:S$}),T$=X(()=>Y(a.object({action:a.object({commands:a.array(a.string()),timeoutMs:a.number().optional(),maxOutputLength:a.number().optional()})}))),Lv=X(()=>Y(a.object({output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exitCode:a.number()})])}))}))),cq=a.array(a.discriminatedUnion("type",[a.object({type:a.literal("skillReference"),skillId:a.string(),version:a.string().optional()}),a.object({type:a.literal("inline"),name:a.string(),description:a.string(),source:a.object({type:a.literal("base64"),mediaType:a.literal("application/zip"),data:a.string()})})])).optional(),dq=X(()=>Y(a.object({environment:a.union([a.object({type:a.literal("containerAuto"),fileIds:a.array(a.string()).optional(),memoryLimit:a.enum(["1g","4g","16g","64g"]).optional(),networkPolicy:a.discriminatedUnion("type",[a.object({type:a.literal("disabled")}),a.object({type:a.literal("allowlist"),allowedDomains:a.array(a.string()),domainSecrets:a.array(a.object({domain:a.string(),name:a.string(),value:a.string()})).optional()})]).optional(),skills:cq}),a.object({type:a.literal("containerReference"),containerId:a.string()}),a.object({type:a.literal("local").optional(),skills:a.array(a.object({name:a.string(),description:a.string(),path:a.string()})).optional()})]).optional()}))),pq=St({id:"openai.shell",inputSchema:T$,outputSchema:Lv}),fq=X(()=>Y(a.object({execution:a.enum(["server","client"]).optional(),description:a.string().optional(),parameters:a.record(a.string(),a.unknown()).optional()}))),Fv=X(()=>Y(a.object({arguments:a.unknown().optional(),call_id:a.string().nullish()}))),Zv=X(()=>Y(a.object({tools:a.array(a.record(a.string(),a.unknown()))}))),mq=St({id:"openai.tool_search",inputSchema:Fv,outputSchema:Zv}),hq=(e={})=>mq(e),gq=X(()=>Y(a.object({externalWebAccess:a.boolean().optional(),filters:a.object({allowedDomains:a.array(a.string()).optional()}).optional(),searchContextSize:a.enum(["low","medium","high"]).optional(),userLocation:a.object({type:a.literal("approximate"),country:a.string().optional(),city:a.string().optional(),region:a.string().optional(),timezone:a.string().optional()}).optional()}))),vq=X(()=>Y(a.object({}))),yq=X(()=>Y(a.object({action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().optional(),queries:a.array(a.string()).optional()}),a.object({type:a.literal("openPage"),url:a.string().nullish()}),a.object({type:a.literal("findInPage"),url:a.string().nullish(),pattern:a.string().nullish()})]).optional(),sources:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url"),url:a.string()}),a.object({type:a.literal("api"),name:a.string()})])).optional()}))),_q=St({id:"openai.web_search",inputSchema:vq,outputSchema:yq}),bq=(e={})=>_q(e),wq=X(()=>Y(a.object({searchContextSize:a.enum(["low","medium","high"]).optional(),userLocation:a.object({type:a.literal("approximate"),country:a.string().optional(),city:a.string().optional(),region:a.string().optional(),timezone:a.string().optional()}).optional()}))),xq=X(()=>Y(a.object({}))),kq=X(()=>Y(a.object({action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().optional()}),a.object({type:a.literal("openPage"),url:a.string().nullish()}),a.object({type:a.literal("findInPage"),url:a.string().nullish(),pattern:a.string().nullish()})]).optional()}))),Sq=St({id:"openai.web_search_preview",inputSchema:xq,outputSchema:kq}),Vv=a.lazy(()=>a.union([a.string(),a.number(),a.boolean(),a.null(),a.array(Vv),a.record(a.string(),Vv)])),Tq=X(()=>Y(a.object({serverLabel:a.string(),allowedTools:a.union([a.array(a.string()),a.object({readOnly:a.boolean().optional(),toolNames:a.array(a.string()).optional()})]).optional(),authorization:a.string().optional(),connectorId:a.string().optional(),headers:a.record(a.string(),a.string()).optional(),requireApproval:a.union([a.enum(["always","never"]),a.object({never:a.object({toolNames:a.array(a.string()).optional()}).optional()})]).optional(),serverDescription:a.string().optional(),serverUrl:a.string().optional()}).refine(e=>e.serverUrl!=null||e.connectorId!=null,"One of serverUrl or connectorId must be provided."))),Iq=X(()=>Y(a.object({}))),$q=X(()=>Y(a.object({type:a.literal("call"),serverLabel:a.string(),name:a.string(),arguments:a.string(),output:a.string().nullish(),error:a.union([a.string(),Vv]).optional()}))),Pq=St({id:"openai.mcp",inputSchema:Iq,outputSchema:$q}),Eq=e=>Pq(e),Rq={applyPatch:Wz,customTool:eq,codeInterpreter:Kz,fileSearch:nq,imageGeneration:lq,localShell:uq,shell:pq,webSearchPreview:Sq,webSearch:bq,mcp:Eq,toolSearch:hq};function d$(e){var t,n,o,r;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let i=e.input_tokens,s=e.output_tokens,l=(n=(t=e.input_tokens_details)==null?void 0:t.cached_tokens)!=null?n:0,u=(r=(o=e.output_tokens_details)==null?void 0:o.reasoning_tokens)!=null?r:0;return{inputTokens:{total:i,noCache:i-l,cacheRead:l,cacheWrite:void 0},outputTokens:{total:s,text:s-u,reasoning:u},raw:e}}function Cq(e){return JSON.stringify(e===void 0?{}:e)}function p$(e,t){return t?t.some(n=>e.startsWith(n)):!1}async function Oq({prompt:e,toolNameMapping:t,systemMessageMode:n,providerOptionsName:o,fileIdPrefixes:r,passThroughUnsupportedFiles:i=!1,store:s,hasConversation:l=!1,hasPreviousResponseId:u=!1,hasLocalShellTool:c=!1,hasShellTool:d=!1,hasApplyPatchTool:m=!1,customProviderToolNames:_}){var h,b,k,I,C,g,v,R,O,N,K,ee,E,le,z,ye,D,U,A,L,B,ne;let W=[],pe=[],Pe=new Set;for(let{role:Te,content:Le}of e)switch(Te){case"system":{switch(n){case"system":{W.push({role:"system",content:Le});break}case"developer":{W.push({role:"developer",content:Le});break}case"remove":{pe.push({type:"other",message:"system messages are removed for this model"});break}default:{let oe=n;throw new Error(`Unsupported system message mode: ${oe}`)}}break}case"user":{W.push({role:"user",content:Le.map((oe,J)=>{var ge,we,se;switch(oe.type){case"text":return{type:"input_text",text:oe.text};case"file":{let me=oe.mediaType==="image/*"?"image/jpeg":oe.mediaType;if(me.startsWith("image/"))return{type:"input_image",...oe.data instanceof URL?{image_url:oe.data.toString()}:typeof oe.data=="string"&&p$(oe.data,r)?{file_id:oe.data}:{image_url:`data:${me};base64,${ho(oe.data)}`},detail:(we=(ge=oe.providerOptions)==null?void 0:ge[o])==null?void 0:we.imageDetail};if(oe.data instanceof URL)return{type:"input_file",file_url:oe.data.toString()};if(me!=="application/pdf"&&!i)throw new gr({functionality:`file part media type ${me}`});return{type:"input_file",...typeof oe.data=="string"&&p$(oe.data,r)?{file_id:oe.data}:{filename:(se=oe.filename)!=null?se:me==="application/pdf"?`part-${J}.pdf`:`part-${J}`,file_data:`data:${me};base64,${ho(oe.data)}`}}}}})});break}case"assistant":{let oe={};for(let J of Le)switch(J.type){case"text":{let ge=(h=J.providerOptions)==null?void 0:h[o],we=ge?.itemId,se=ge?.phase;if(l&&we!=null)break;if(s&&we!=null){W.push({type:"item_reference",id:we});break}W.push({role:"assistant",content:[{type:"output_text",text:J.text}],id:we,...se!=null&&{phase:se}});break}case"tool-call":{let ge=(g=(k=(b=J.providerOptions)==null?void 0:b[o])==null?void 0:k.itemId)!=null?g:(C=(I=J.providerMetadata)==null?void 0:I[o])==null?void 0:C.itemId,we=(K=(R=(v=J.providerOptions)==null?void 0:v[o])==null?void 0:R.namespace)!=null?K:(N=(O=J.providerMetadata)==null?void 0:O[o])==null?void 0:N.namespace;if(l&&ge!=null)break;let se=t.toProviderToolName(J.toolName);if(se==="tool_search"){if(s&&ge!=null){W.push({type:"item_reference",id:ge});break}let me=typeof J.input=="string"?await Mv({text:J.input,schema:Fv}):await Pt({value:J.input,schema:Fv}),F=me.call_id!=null?"client":"server";W.push({type:"tool_search_call",id:ge??J.toolCallId,execution:F,call_id:(ee=me.call_id)!=null?ee:null,status:"completed",arguments:me.arguments});break}if(J.providerExecuted){s&&ge!=null&&W.push({type:"item_reference",id:ge});break}if(s&&ge!=null){if(u)break;W.push({type:"item_reference",id:ge});break}if(c&&se==="local_shell"){let me=await Pt({value:J.input,schema:k$});W.push({type:"local_shell_call",call_id:J.toolCallId,id:ge,action:{type:"exec",command:me.action.command,timeout_ms:me.action.timeoutMs,user:me.action.user,working_directory:me.action.workingDirectory,env:me.action.env}});break}if(d&&se==="shell"){let me=await Pt({value:J.input,schema:T$});W.push({type:"shell_call",call_id:J.toolCallId,id:ge,status:"completed",action:{commands:me.action.commands,timeout_ms:me.action.timeoutMs,max_output_length:me.action.maxOutputLength}});break}if(m&&se==="apply_patch"){let me=await Pt({value:J.input,schema:_$});W.push({type:"apply_patch_call",call_id:me.callId,id:ge,status:"completed",operation:me.operation});break}if(_?.has(se)){W.push({type:"custom_tool_call",call_id:J.toolCallId,name:se,input:typeof J.input=="string"?J.input:JSON.stringify(J.input),id:ge});break}W.push({type:"function_call",call_id:J.toolCallId,name:se,arguments:Cq(J.input),id:ge,...we!=null&&{namespace:we}});break}case"tool-result":{if(J.output.type==="execution-denied"||J.output.type==="json"&&typeof J.output.value=="object"&&J.output.value!=null&&"type"in J.output.value&&J.output.value.type==="execution-denied"||l)break;let ge=t.toProviderToolName(J.toolName);if(ge==="tool_search"){let we=(z=(le=(E=J.providerOptions)==null?void 0:E[o])==null?void 0:le.itemId)!=null?z:J.toolCallId;if(s)W.push({type:"item_reference",id:we});else if(J.output.type==="json"){let se=await Pt({value:J.output.value,schema:Zv});W.push({type:"tool_search_output",id:we,execution:"server",call_id:null,status:"completed",tools:se.tools})}break}if(d&&ge==="shell"){if(J.output.type==="json"){let we=await Pt({value:J.output.value,schema:Lv});W.push({type:"shell_call_output",call_id:J.toolCallId,output:we.output.map(se=>({stdout:se.stdout,stderr:se.stderr,outcome:se.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:se.outcome.exitCode}}))})}break}if(s){let we=(U=(D=(ye=J.providerOptions)==null?void 0:ye[o])==null?void 0:D.itemId)!=null?U:J.toolCallId;W.push({type:"item_reference",id:we})}else pe.push({type:"other",message:`Results for OpenAI tool ${J.toolName} are not sent to the API when store is false`});break}case"reasoning":{let ge=await zt({provider:o,providerOptions:J.providerOptions,schema:Dq}),we=ge?.itemId;if((l||u)&&we!=null)break;if(we!=null){let se=oe[we];if(s)se===void 0&&(W.push({type:"item_reference",id:we}),oe[we]={type:"reasoning",id:we,summary:[]});else{let me=[];J.text.length>0?me.push({type:"summary_text",text:J.text}):se!==void 0&&pe.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(J)}.`}),se===void 0?(oe[we]={type:"reasoning",id:we,encrypted_content:ge?.reasoningEncryptedContent,summary:me},W.push(oe[we])):(se.summary.push(...me),ge?.reasoningEncryptedContent!=null&&(se.encrypted_content=ge.reasoningEncryptedContent))}}else{let se=ge?.reasoningEncryptedContent;if(se!=null){let me=[];J.text.length>0&&me.push({type:"summary_text",text:J.text}),W.push({type:"reasoning",encrypted_content:se,summary:me})}else pe.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(J)}.`})}break}}break}case"tool":{for(let oe of Le){if(oe.type==="tool-approval-response"){let se=oe;if(Pe.has(se.approvalId))continue;Pe.add(se.approvalId),s&&W.push({type:"item_reference",id:se.approvalId}),W.push({type:"mcp_approval_response",approval_request_id:se.approvalId,approve:se.approved});continue}let J=oe.output;if(J.type==="execution-denied"&&((L=(A=J.providerOptions)==null?void 0:A.openai)==null?void 0:L.approvalId))continue;let ge=t.toProviderToolName(oe.toolName);if(ge==="tool_search"&&J.type==="json"){let se=await Pt({value:J.value,schema:Zv});W.push({type:"tool_search_output",execution:"client",call_id:oe.toolCallId,status:"completed",tools:se.tools});continue}if(c&&ge==="local_shell"&&J.type==="json"){let se=await Pt({value:J.value,schema:S$});W.push({type:"local_shell_call_output",call_id:oe.toolCallId,output:se.output});continue}if(d&&ge==="shell"&&J.type==="json"){let se=await Pt({value:J.value,schema:Lv});W.push({type:"shell_call_output",call_id:oe.toolCallId,output:se.output.map(me=>({stdout:me.stdout,stderr:me.stderr,outcome:me.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:me.outcome.exitCode}}))});continue}if(m&&oe.toolName==="apply_patch"&&J.type==="json"){let se=await Pt({value:J.value,schema:b$});W.push({type:"apply_patch_call_output",call_id:oe.toolCallId,status:se.status,output:se.output});continue}if(_?.has(ge)){let se;switch(J.type){case"text":case"error-text":se=J.value;break;case"execution-denied":se=(B=J.reason)!=null?B:"Tool execution denied.";break;case"json":case"error-json":se=JSON.stringify(J.value);break;case"content":se=J.value.map(me=>{var F,xe,je,Me,er;switch(me.type){case"text":return{type:"input_text",text:me.text};case"image-data":return{type:"input_image",image_url:`data:${me.mediaType};base64,${me.data}`,detail:(xe=(F=me.providerOptions)==null?void 0:F[o])==null?void 0:xe.imageDetail};case"image-url":return{type:"input_image",image_url:me.url,detail:(Me=(je=me.providerOptions)==null?void 0:je[o])==null?void 0:Me.imageDetail};case"file-data":return{type:"input_file",filename:(er=me.filename)!=null?er:"data",file_data:`data:${me.mediaType};base64,${me.data}`};case"file-url":return{type:"input_file",file_url:me.url};default:pe.push({type:"other",message:`unsupported custom tool content part type: ${me.type}`});return}}).filter(Dv);break;default:se=""}W.push({type:"custom_tool_call_output",call_id:oe.toolCallId,output:se});continue}let we;switch(J.type){case"text":case"error-text":we=J.value;break;case"execution-denied":we=(ne=J.reason)!=null?ne:"Tool execution denied.";break;case"json":case"error-json":we=JSON.stringify(J.value);break;case"content":we=J.value.map(se=>{var me,F,xe,je,Me;switch(se.type){case"text":return{type:"input_text",text:se.text};case"image-data":return{type:"input_image",image_url:`data:${se.mediaType};base64,${se.data}`,detail:(F=(me=se.providerOptions)==null?void 0:me[o])==null?void 0:F.imageDetail};case"image-url":return{type:"input_image",image_url:se.url,detail:(je=(xe=se.providerOptions)==null?void 0:xe[o])==null?void 0:je.imageDetail};case"file-data":return{type:"input_file",filename:(Me=se.filename)!=null?Me:"data",file_data:`data:${se.mediaType};base64,${se.data}`};case"file-url":return{type:"input_file",file_url:se.url};default:{pe.push({type:"other",message:`unsupported tool content part type: ${se.type}`});return}}}).filter(Dv);break}W.push({type:"function_call_output",call_id:oe.toolCallId,output:we})}break}default:{let oe=Te;throw new Error(`Unsupported role: ${oe}`)}}return!s&&W.some(Te=>"type"in Te&&Te.type==="reasoning"&&Te.encrypted_content==null)&&(pe.push({type:"other",message:"Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."}),W=W.filter(Te=>!("type"in Te)||Te.type!=="reasoning"||Te.encrypted_content!=null)),{input:W,warnings:pe}}var Dq=a.object({itemId:a.string().nullish(),reasoningEncryptedContent:a.string().nullish()});function Uv({finishReason:e,hasFunctionCall:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"other"}}var Us=a.lazy(()=>a.union([a.string(),a.number(),a.boolean(),a.null(),a.array(Us),a.record(a.string(),Us.optional())])),jq=X(()=>Y(a.union([a.object({type:a.literal("response.output_text.delta"),item_id:a.string(),delta:a.string(),logprobs:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish()}),a.object({type:a.enum(["response.completed","response.incomplete"]),response:a.object({incomplete_details:a.object({reason:a.string()}).nullish(),usage:a.object({input_tokens:a.number(),input_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),output_tokens:a.number(),output_tokens_details:a.object({reasoning_tokens:a.number().nullish()}).nullish()}),service_tier:a.string().nullish()})}),a.object({type:a.literal("response.failed"),response:a.object({error:a.object({code:a.string().nullish(),message:a.string()}).nullish(),incomplete_details:a.object({reason:a.string()}).nullish(),usage:a.object({input_tokens:a.number(),input_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),output_tokens:a.number(),output_tokens_details:a.object({reasoning_tokens:a.number().nullish()}).nullish()}).nullish(),service_tier:a.string().nullish()})}),a.object({type:a.literal("response.created"),response:a.object({id:a.string(),created_at:a.number(),model:a.string(),service_tier:a.string().nullish()})}),a.object({type:a.literal("response.output_item.added"),output_index:a.number(),item:a.discriminatedUnion("type",[a.object({type:a.literal("message"),id:a.string(),phase:a.enum(["commentary","final_answer"]).nullish()}),a.object({type:a.literal("reasoning"),id:a.string(),encrypted_content:a.string().nullish()}),a.object({type:a.literal("function_call"),id:a.string(),call_id:a.string(),name:a.string(),arguments:a.string(),namespace:a.string().nullish()}),a.object({type:a.literal("web_search_call"),id:a.string(),status:a.string()}),a.object({type:a.literal("computer_call"),id:a.string(),status:a.string()}),a.object({type:a.literal("file_search_call"),id:a.string()}),a.object({type:a.literal("image_generation_call"),id:a.string()}),a.object({type:a.literal("code_interpreter_call"),id:a.string(),container_id:a.string(),code:a.string().nullable(),outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullable(),status:a.string()}),a.object({type:a.literal("mcp_call"),id:a.string(),status:a.string(),approval_request_id:a.string().nullish()}),a.object({type:a.literal("mcp_list_tools"),id:a.string()}),a.object({type:a.literal("mcp_approval_request"),id:a.string()}),a.object({type:a.literal("apply_patch_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed"]),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}),a.object({type:a.literal("custom_tool_call"),id:a.string(),call_id:a.string(),name:a.string(),input:a.string()}),a.object({type:a.literal("shell_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),action:a.object({commands:a.array(a.string())})}),a.object({type:a.literal("shell_call_output"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exit_code:a.number()})])}))}),a.object({type:a.literal("tool_search_call"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),arguments:a.unknown()}),a.object({type:a.literal("tool_search_output"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),tools:a.array(a.record(a.string(),Us.optional()))})])}),a.object({type:a.literal("response.output_item.done"),output_index:a.number(),item:a.discriminatedUnion("type",[a.object({type:a.literal("message"),id:a.string(),phase:a.enum(["commentary","final_answer"]).nullish()}),a.object({type:a.literal("reasoning"),id:a.string(),encrypted_content:a.string().nullish()}),a.object({type:a.literal("function_call"),id:a.string(),call_id:a.string(),name:a.string(),arguments:a.string(),status:a.literal("completed"),namespace:a.string().nullish()}),a.object({type:a.literal("custom_tool_call"),id:a.string(),call_id:a.string(),name:a.string(),input:a.string(),status:a.literal("completed")}),a.object({type:a.literal("code_interpreter_call"),id:a.string(),code:a.string().nullable(),container_id:a.string(),outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullable()}),a.object({type:a.literal("image_generation_call"),id:a.string(),result:a.string()}),a.object({type:a.literal("web_search_call"),id:a.string(),status:a.string(),action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().nullish(),queries:a.array(a.string()).nullish(),sources:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url"),url:a.string()}),a.object({type:a.literal("api"),name:a.string()})])).nullish()}),a.object({type:a.literal("open_page"),url:a.string().nullish()}),a.object({type:a.literal("find_in_page"),url:a.string().nullish(),pattern:a.string().nullish()})]).nullish()}),a.object({type:a.literal("file_search_call"),id:a.string(),queries:a.array(a.string()),results:a.array(a.object({attributes:a.record(a.string(),a.union([a.string(),a.number(),a.boolean()])),file_id:a.string(),filename:a.string(),score:a.number(),text:a.string()})).nullish()}),a.object({type:a.literal("local_shell_call"),id:a.string(),call_id:a.string(),action:a.object({type:a.literal("exec"),command:a.array(a.string()),timeout_ms:a.number().optional(),user:a.string().optional(),working_directory:a.string().optional(),env:a.record(a.string(),a.string()).optional()})}),a.object({type:a.literal("computer_call"),id:a.string(),status:a.literal("completed")}),a.object({type:a.literal("mcp_call"),id:a.string(),status:a.string(),arguments:a.string(),name:a.string(),server_label:a.string(),output:a.string().nullish(),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).nullish(),approval_request_id:a.string().nullish()}),a.object({type:a.literal("mcp_list_tools"),id:a.string(),server_label:a.string(),tools:a.array(a.object({name:a.string(),description:a.string().optional(),input_schema:a.any(),annotations:a.record(a.string(),a.unknown()).optional()})),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).optional()}),a.object({type:a.literal("mcp_approval_request"),id:a.string(),server_label:a.string(),name:a.string(),arguments:a.string(),approval_request_id:a.string().optional()}),a.object({type:a.literal("apply_patch_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed"]),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}),a.object({type:a.literal("shell_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),action:a.object({commands:a.array(a.string())})}),a.object({type:a.literal("shell_call_output"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exit_code:a.number()})])}))}),a.object({type:a.literal("tool_search_call"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),arguments:a.unknown()}),a.object({type:a.literal("tool_search_output"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),tools:a.array(a.record(a.string(),Us.optional()))})])}),a.object({type:a.literal("response.function_call_arguments.delta"),item_id:a.string(),output_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.custom_tool_call_input.delta"),item_id:a.string(),output_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.image_generation_call.partial_image"),item_id:a.string(),output_index:a.number(),partial_image_b64:a.string()}),a.object({type:a.literal("response.code_interpreter_call_code.delta"),item_id:a.string(),output_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.code_interpreter_call_code.done"),item_id:a.string(),output_index:a.number(),code:a.string()}),a.object({type:a.literal("response.output_text.annotation.added"),annotation:a.discriminatedUnion("type",[a.object({type:a.literal("url_citation"),start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()}),a.object({type:a.literal("file_citation"),file_id:a.string(),filename:a.string(),index:a.number()}),a.object({type:a.literal("container_file_citation"),container_id:a.string(),file_id:a.string(),filename:a.string(),start_index:a.number(),end_index:a.number()}),a.object({type:a.literal("file_path"),file_id:a.string(),index:a.number()})])}),a.object({type:a.literal("response.reasoning_summary_part.added"),item_id:a.string(),summary_index:a.number()}),a.object({type:a.literal("response.reasoning_summary_text.delta"),item_id:a.string(),summary_index:a.number(),delta:a.string()}),a.object({type:a.literal("response.reasoning_summary_part.done"),item_id:a.string(),summary_index:a.number()}),a.object({type:a.literal("response.apply_patch_call_operation_diff.delta"),item_id:a.string(),output_index:a.number(),delta:a.string(),obfuscation:a.string().nullish()}),a.object({type:a.literal("response.apply_patch_call_operation_diff.done"),item_id:a.string(),output_index:a.number(),diff:a.string()}),a.object({type:a.literal("error"),sequence_number:a.number(),error:a.object({type:a.string(),code:a.string(),message:a.string(),param:a.string().nullish()})}),a.object({type:a.string()}).loose().transform(e=>({type:"unknown_chunk",message:e.type}))]))),Nq=X(()=>Y(a.object({id:a.string().optional(),created_at:a.number().optional(),error:a.object({message:a.string(),type:a.string(),param:a.string().nullish(),code:a.string()}).nullish(),model:a.string().optional(),output:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("message"),role:a.literal("assistant"),id:a.string(),phase:a.enum(["commentary","final_answer"]).nullish(),content:a.array(a.object({type:a.literal("output_text"),text:a.string(),logprobs:a.array(a.object({token:a.string(),logprob:a.number(),top_logprobs:a.array(a.object({token:a.string(),logprob:a.number()}))})).nullish(),annotations:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url_citation"),start_index:a.number(),end_index:a.number(),url:a.string(),title:a.string()}),a.object({type:a.literal("file_citation"),file_id:a.string(),filename:a.string(),index:a.number()}),a.object({type:a.literal("container_file_citation"),container_id:a.string(),file_id:a.string(),filename:a.string(),start_index:a.number(),end_index:a.number()}),a.object({type:a.literal("file_path"),file_id:a.string(),index:a.number()})]))}))}),a.object({type:a.literal("web_search_call"),id:a.string(),status:a.string(),action:a.discriminatedUnion("type",[a.object({type:a.literal("search"),query:a.string().nullish(),queries:a.array(a.string()).nullish(),sources:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("url"),url:a.string()}),a.object({type:a.literal("api"),name:a.string()})])).nullish()}),a.object({type:a.literal("open_page"),url:a.string().nullish()}),a.object({type:a.literal("find_in_page"),url:a.string().nullish(),pattern:a.string().nullish()})]).nullish()}),a.object({type:a.literal("file_search_call"),id:a.string(),queries:a.array(a.string()),results:a.array(a.object({attributes:a.record(a.string(),a.union([a.string(),a.number(),a.boolean()])),file_id:a.string(),filename:a.string(),score:a.number(),text:a.string()})).nullish()}),a.object({type:a.literal("code_interpreter_call"),id:a.string(),code:a.string().nullable(),container_id:a.string(),outputs:a.array(a.discriminatedUnion("type",[a.object({type:a.literal("logs"),logs:a.string()}),a.object({type:a.literal("image"),url:a.string()})])).nullable()}),a.object({type:a.literal("image_generation_call"),id:a.string(),result:a.string()}),a.object({type:a.literal("local_shell_call"),id:a.string(),call_id:a.string(),action:a.object({type:a.literal("exec"),command:a.array(a.string()),timeout_ms:a.number().optional(),user:a.string().optional(),working_directory:a.string().optional(),env:a.record(a.string(),a.string()).optional()})}),a.object({type:a.literal("function_call"),call_id:a.string(),name:a.string(),arguments:a.string(),id:a.string(),namespace:a.string().nullish()}),a.object({type:a.literal("custom_tool_call"),call_id:a.string(),name:a.string(),input:a.string(),id:a.string()}),a.object({type:a.literal("computer_call"),id:a.string(),status:a.string().optional()}),a.object({type:a.literal("reasoning"),id:a.string(),encrypted_content:a.string().nullish(),summary:a.array(a.object({type:a.literal("summary_text"),text:a.string()}))}),a.object({type:a.literal("mcp_call"),id:a.string(),status:a.string(),arguments:a.string(),name:a.string(),server_label:a.string(),output:a.string().nullish(),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).nullish(),approval_request_id:a.string().nullish()}),a.object({type:a.literal("mcp_list_tools"),id:a.string(),server_label:a.string(),tools:a.array(a.object({name:a.string(),description:a.string().optional(),input_schema:a.any(),annotations:a.record(a.string(),a.unknown()).optional()})),error:a.union([a.string(),a.object({type:a.string().optional(),code:a.union([a.number(),a.string()]).optional(),message:a.string().optional()}).loose()]).optional()}),a.object({type:a.literal("mcp_approval_request"),id:a.string(),server_label:a.string(),name:a.string(),arguments:a.string(),approval_request_id:a.string().optional()}),a.object({type:a.literal("apply_patch_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed"]),operation:a.discriminatedUnion("type",[a.object({type:a.literal("create_file"),path:a.string(),diff:a.string()}),a.object({type:a.literal("delete_file"),path:a.string()}),a.object({type:a.literal("update_file"),path:a.string(),diff:a.string()})])}),a.object({type:a.literal("shell_call"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),action:a.object({commands:a.array(a.string())})}),a.object({type:a.literal("shell_call_output"),id:a.string(),call_id:a.string(),status:a.enum(["in_progress","completed","incomplete"]),output:a.array(a.object({stdout:a.string(),stderr:a.string(),outcome:a.discriminatedUnion("type",[a.object({type:a.literal("timeout")}),a.object({type:a.literal("exit"),exit_code:a.number()})])}))}),a.object({type:a.literal("tool_search_call"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),arguments:a.unknown()}),a.object({type:a.literal("tool_search_output"),id:a.string(),execution:a.enum(["server","client"]),call_id:a.string().nullable(),status:a.enum(["in_progress","completed","incomplete"]),tools:a.array(a.record(a.string(),Us.optional()))})])).optional(),service_tier:a.string().nullish(),incomplete_details:a.object({reason:a.string()}).nullish(),usage:a.object({input_tokens:a.number(),input_tokens_details:a.object({cached_tokens:a.number().nullish()}).nullish(),output_tokens:a.number(),output_tokens_details:a.object({reasoning_tokens:a.number().nullish()}).nullish()}).optional()}))),I$=20,Mq=["o1","o1-2024-12-17","o3","o3-2025-04-16","o3-mini","o3-mini-2025-01-31","o4-mini","o4-mini-2025-04-16","gpt-5","gpt-5-2025-08-07","gpt-5-codex","gpt-5-mini","gpt-5-mini-2025-08-07","gpt-5-nano","gpt-5-nano-2025-08-07","gpt-5-pro","gpt-5-pro-2025-10-06","gpt-5.1","gpt-5.1-chat-latest","gpt-5.1-codex-mini","gpt-5.1-codex","gpt-5.1-codex-max","gpt-5.2","gpt-5.2-chat-latest","gpt-5.2-pro","gpt-5.2-codex","gpt-5.3-chat-latest","gpt-5.3-codex","gpt-5.4","gpt-5.4-2026-03-05","gpt-5.4-mini","gpt-5.4-mini-2026-03-17","gpt-5.4-nano","gpt-5.4-nano-2026-03-17","gpt-5.4-pro","gpt-5.4-pro-2026-03-05","gpt-5.5","gpt-5.5-2026-04-23"],LJ=["gpt-4.1","gpt-4.1-2025-04-14","gpt-4.1-mini","gpt-4.1-mini-2025-04-14","gpt-4.1-nano","gpt-4.1-nano-2025-04-14","gpt-4o","gpt-4o-2024-05-13","gpt-4o-2024-08-06","gpt-4o-2024-11-20","gpt-4o-audio-preview","gpt-4o-audio-preview-2024-12-17","gpt-4o-search-preview","gpt-4o-search-preview-2025-03-11","gpt-4o-mini-search-preview","gpt-4o-mini-search-preview-2025-03-11","gpt-4o-mini","gpt-4o-mini-2024-07-18","gpt-3.5-turbo-0125","gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-5-chat-latest",...Mq],f$=X(()=>Y(a.object({conversation:a.string().nullish(),include:a.array(a.enum(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:a.string().nullish(),logprobs:a.union([a.boolean(),a.number().min(1).max(I$)]).optional(),maxToolCalls:a.number().nullish(),metadata:a.any().nullish(),parallelToolCalls:a.boolean().nullish(),previousResponseId:a.string().nullish(),promptCacheKey:a.string().nullish(),promptCacheRetention:a.enum(["in_memory","24h"]).nullish(),reasoningEffort:a.string().nullish(),reasoningSummary:a.string().nullish(),safetyIdentifier:a.string().nullish(),serviceTier:a.enum(["auto","flex","priority","default"]).nullish(),store:a.boolean().nullish(),passThroughUnsupportedFiles:a.boolean().optional(),strictJsonSchema:a.boolean().nullish(),textVerbosity:a.enum(["low","medium","high"]).nullish(),truncation:a.enum(["auto","disabled"]).nullish(),user:a.string().nullish(),systemMessageMode:a.enum(["system","developer","remove"]).optional(),forceReasoning:a.boolean().optional(),allowedTools:a.object({toolNames:a.array(a.string()).min(1),mode:a.enum(["auto","required"]).optional()}).optional()})));async function Aq({tools:e,toolChoice:t,allowedTools:n,toolNameMapping:o,customProviderToolNames:r}){var i,s,l;e=e?.length?e:void 0;let u=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:u};let c=[],d=r??new Set;for(let _ of e)switch(_.type){case"function":{let h=(i=_.providerOptions)==null?void 0:i.openai,b=h?.deferLoading;c.push({type:"function",name:_.name,description:_.description,parameters:_.inputSchema,..._.strict!=null?{strict:_.strict}:{},...b!=null?{defer_loading:b}:{}});break}case"provider":{switch(_.id){case"openai.file_search":{let h=await Pt({value:_.args,schema:tq});c.push({type:"file_search",vector_store_ids:h.vectorStoreIds,max_num_results:h.maxNumResults,ranking_options:h.ranking?{ranker:h.ranking.ranker,score_threshold:h.ranking.scoreThreshold}:void 0,filters:h.filters});break}case"openai.local_shell":{c.push({type:"local_shell"});break}case"openai.shell":{let h=await Pt({value:_.args,schema:dq});c.push({type:"shell",...h.environment&&{environment:zq(h.environment)}});break}case"openai.apply_patch":{c.push({type:"apply_patch"});break}case"openai.web_search_preview":{let h=await Pt({value:_.args,schema:wq});c.push({type:"web_search_preview",search_context_size:h.searchContextSize,user_location:h.userLocation});break}case"openai.web_search":{let h=await Pt({value:_.args,schema:gq});c.push({type:"web_search",filters:h.filters!=null?{allowed_domains:h.filters.allowedDomains}:void 0,external_web_access:h.externalWebAccess,search_context_size:h.searchContextSize,user_location:h.userLocation});break}case"openai.code_interpreter":{let h=await Pt({value:_.args,schema:Bz});c.push({type:"code_interpreter",container:h.container==null?{type:"auto",file_ids:void 0}:typeof h.container=="string"?h.container:{type:"auto",file_ids:h.container.fileIds}});break}case"openai.image_generation":{let h=await Pt({value:_.args,schema:oq});c.push({type:"image_generation",background:h.background,input_fidelity:h.inputFidelity,input_image_mask:h.inputImageMask?{file_id:h.inputImageMask.fileId,image_url:h.inputImageMask.imageUrl}:void 0,model:h.model,moderation:h.moderation,partial_images:h.partialImages,quality:h.quality,output_compression:h.outputCompression,output_format:h.outputFormat,size:h.size});break}case"openai.mcp":{let h=await Pt({value:_.args,schema:Tq}),b=C=>({tool_names:C.toolNames}),k=h.requireApproval,I=k==null?void 0:typeof k=="string"?k:k.never!=null?{never:b(k.never)}:void 0;c.push({type:"mcp",server_label:h.serverLabel,allowed_tools:Array.isArray(h.allowedTools)?h.allowedTools:h.allowedTools?{read_only:h.allowedTools.readOnly,tool_names:h.allowedTools.toolNames}:void 0,authorization:h.authorization,connector_id:h.connectorId,headers:h.headers,require_approval:I??"never",server_description:h.serverDescription,server_url:h.serverUrl});break}case"openai.custom":{let h=await Pt({value:_.args,schema:Yz});c.push({type:"custom",name:h.name,description:h.description,format:h.format}),d.add(h.name);break}case"openai.tool_search":{let h=await Pt({value:_.args,schema:fq});c.push({type:"tool_search",...h.execution!=null?{execution:h.execution}:{},...h.description!=null?{description:h.description}:{},...h.parameters!=null?{parameters:h.parameters}:{}});break}}break}default:u.push({type:"unsupported",feature:`function tool ${_}`});break}if(n!=null)return{tools:c,toolChoice:{type:"allowed_tools",mode:(s=n.mode)!=null?s:"auto",tools:n.toolNames.map(_=>{var h;return{type:"function",name:(h=o?.toProviderToolName(_))!=null?h:_}})},toolWarnings:u};if(t==null)return{tools:c,toolChoice:void 0,toolWarnings:u};let m=t.type;switch(m){case"auto":case"none":case"required":return{tools:c,toolChoice:m,toolWarnings:u};case"tool":{let _=(l=o?.toProviderToolName(t.toolName))!=null?l:t.toolName;return{tools:c,toolChoice:_==="code_interpreter"||_==="file_search"||_==="image_generation"||_==="web_search_preview"||_==="web_search"||_==="mcp"||_==="apply_patch"?{type:_}:d.has(_)?{type:"custom",name:_}:{type:"function",name:_},toolWarnings:u}}default:{let _=m;throw new gr({functionality:`tool choice type: ${_}`})}}}function zq(e){if(e.type==="containerReference")return{type:"container_reference",container_id:e.containerId};if(e.type==="containerAuto"){let n=e;return{type:"container_auto",file_ids:n.fileIds,memory_limit:n.memoryLimit,network_policy:n.networkPolicy==null?void 0:n.networkPolicy.type==="disabled"?{type:"disabled"}:{type:"allowlist",allowed_domains:n.networkPolicy.allowedDomains,domain_secrets:n.networkPolicy.domainSecrets},skills:qq(n.skills)}}return{type:"local",skills:e.skills}}function qq(e){return e?.map(t=>t.type==="skillReference"?{type:"skill_reference",skill_id:t.skillId,version:t.version}:{type:"inline",name:t.name,description:t.description,source:{type:"base64",media_type:t.source.mediaType,data:t.source.data}})}function m$(e){var t,n;let o={};for(let r of e)if(r.role==="assistant")for(let i of r.content){if(i.type!=="tool-call")continue;let s=(n=(t=i.providerOptions)==null?void 0:t.openai)==null?void 0:n.approvalRequestId;s!=null&&(o[s]=i.toolCallId)}return o}var Uq=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({maxOutputTokens:e,temperature:t,stopSequences:n,topP:o,topK:r,presencePenalty:i,frequencyPenalty:s,seed:l,prompt:u,providerOptions:c,tools:d,toolChoice:m,responseFormat:_}){var h,b,k,I,C,g,v,R,O,N,K;let ee=[],E=y$(this.modelId);r!=null&&ee.push({type:"unsupported",feature:"topK"}),l!=null&&ee.push({type:"unsupported",feature:"seed"}),i!=null&&ee.push({type:"unsupported",feature:"presencePenalty"}),s!=null&&ee.push({type:"unsupported",feature:"frequencyPenalty"}),n!=null&&ee.push({type:"unsupported",feature:"stopSequences"});let le=this.config.provider.includes("azure")?"azure":"openai",z=await zt({provider:le,providerOptions:c,schema:f$});z==null&&le!=="openai"&&(z=await zt({provider:"openai",providerOptions:c,schema:f$}));let ye=(h=z?.forceReasoning)!=null?h:E.isReasoningModel;z?.conversation&&z?.previousResponseId&&ee.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});let D=z0({tools:d,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch","openai.tool_search":"tool_search"},resolveProviderToolName:F=>F.id==="openai.custom"?F.args.name:void 0}),U=new Set,{tools:A,toolChoice:L,toolWarnings:B}=await Aq({tools:d,toolChoice:m,allowedTools:(b=z?.allowedTools)!=null?b:void 0,toolNameMapping:D,customProviderToolNames:U}),{input:ne,warnings:W}=await Oq({prompt:u,toolNameMapping:D,systemMessageMode:(k=z?.systemMessageMode)!=null?k:ye?"developer":E.systemMessageMode,providerOptionsName:le,fileIdPrefixes:this.config.fileIdPrefixes,passThroughUnsupportedFiles:(I=z?.passThroughUnsupportedFiles)!=null?I:!1,store:(C=z?.store)!=null?C:!0,hasConversation:z?.conversation!=null,hasPreviousResponseId:z?.previousResponseId!=null,hasLocalShellTool:Le("openai.local_shell"),hasShellTool:Le("openai.shell"),hasApplyPatchTool:Le("openai.apply_patch"),customProviderToolNames:U.size>0?U:void 0});ee.push(...W);let pe=(g=z?.strictJsonSchema)!=null?g:!0,Pe=z?.include;function Te(F){Pe==null?Pe=[F]:Pe.includes(F)||(Pe=[...Pe,F])}function Le(F){return d?.find(xe=>xe.type==="provider"&&xe.id===F)!=null}let oe=typeof z?.logprobs=="number"?z?.logprobs:z?.logprobs===!0?I$:void 0;oe&&Te("message.output_text.logprobs");let J=(v=d?.find(F=>F.type==="provider"&&(F.id==="openai.web_search"||F.id==="openai.web_search_preview")))==null?void 0:v.name;J&&Te("web_search_call.action.sources"),Le("openai.code_interpreter")&&Te("code_interpreter_call.outputs");let ge=z?.store;ge===!1&&ye&&Te("reasoning.encrypted_content");let we={model:this.modelId,input:ne,temperature:t,top_p:o,max_output_tokens:e,...(_?.type==="json"||z?.textVerbosity)&&{text:{..._?.type==="json"&&{format:_.schema!=null?{type:"json_schema",strict:pe,name:(R=_.name)!=null?R:"response",description:_.description,schema:_.schema}:{type:"json_object"}},...z?.textVerbosity&&{verbosity:z.textVerbosity}}},conversation:z?.conversation,max_tool_calls:z?.maxToolCalls,metadata:z?.metadata,parallel_tool_calls:z?.parallelToolCalls,previous_response_id:z?.previousResponseId,store:ge,user:z?.user,instructions:z?.instructions,service_tier:z?.serviceTier,include:Pe,prompt_cache_key:z?.promptCacheKey,prompt_cache_retention:z?.promptCacheRetention,safety_identifier:z?.safetyIdentifier,top_logprobs:oe,truncation:z?.truncation,...ye&&(z?.reasoningEffort!=null||z?.reasoningSummary!=null)&&{reasoning:{...z?.reasoningEffort!=null&&{effort:z.reasoningEffort},...z?.reasoningSummary!=null&&{summary:z.reasoningSummary}}}};ye?z?.reasoningEffort==="none"&&E.supportsNonReasoningParameters||(we.temperature!=null&&(we.temperature=void 0,ee.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),we.top_p!=null&&(we.top_p=void 0,ee.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(z?.reasoningEffort!=null&&ee.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),z?.reasoningSummary!=null&&ee.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})),z?.serviceTier==="flex"&&!E.supportsFlexProcessing&&(ee.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete we.service_tier),z?.serviceTier==="priority"&&!E.supportsPriorityProcessing&&(ee.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete we.service_tier);let se=(K=(N=(O=d?.find(F=>F.type==="provider"&&F.id==="openai.shell"))==null?void 0:O.args)==null?void 0:N.environment)==null?void 0:K.type,me=se==="containerAuto"||se==="containerReference";return{webSearchToolName:J,args:{...we,tools:A,tool_choice:L},warnings:[...ee,...B],store:ge,toolNameMapping:D,providerOptionsName:le,isShellProviderExecuted:me}}async doGenerate(e){var t,n,o,r,i,s,l,u,c,d,m,_,h,b,k,I,C,g,v,R,O,N,K,ee,E,le,z,ye;let{args:D,warnings:U,webSearchToolName:A,toolNameMapping:L,providerOptionsName:B,isShellProviderExecuted:ne}=await this.getArgs(e),W=this.config.url({path:"/responses",modelId:this.modelId}),pe=m$(e.prompt),{responseHeaders:Pe,value:Te,rawValue:Le}=await vt({url:W,headers:nt(this.config.headers(),e.headers),body:D,failedResponseHandler:an,successfulResponseHandler:it(Nq),abortSignal:e.abortSignal,fetch:this.config.fetch});if(Te.error)throw new Je({message:Te.error.message,url:W,requestBodyValues:D,statusCode:400,responseHeaders:Pe,responseBody:Le,isRetryable:!1});let oe=[],J=[],ge=!1,we=[];for(let F of Te.output)switch(F.type){case"reasoning":{F.summary.length===0&&F.summary.push({type:"summary_text",text:""});for(let xe of F.summary)oe.push({type:"reasoning",text:xe.text,providerMetadata:{[B]:{itemId:F.id,reasoningEncryptedContent:(t=F.encrypted_content)!=null?t:null}}});break}case"image_generation_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("image_generation"),result:{result:F.result}});break}case"tool_search_call":{let xe=(n=F.call_id)!=null?n:F.id,je=F.execution==="server";je&&we.push(xe),oe.push({type:"tool-call",toolCallId:xe,toolName:L.toCustomToolName("tool_search"),input:JSON.stringify({arguments:F.arguments,call_id:F.call_id}),...je?{providerExecuted:!0}:{},providerMetadata:{[B]:{itemId:F.id}}});break}case"tool_search_output":{let xe=(r=(o=F.call_id)!=null?o:we.shift())!=null?r:F.id;oe.push({type:"tool-result",toolCallId:xe,toolName:L.toCustomToolName("tool_search"),result:{tools:F.tools},providerMetadata:{[B]:{itemId:F.id}}});break}case"local_shell_call":{oe.push({type:"tool-call",toolCallId:F.call_id,toolName:L.toCustomToolName("local_shell"),input:JSON.stringify({action:F.action}),providerMetadata:{[B]:{itemId:F.id}}});break}case"shell_call":{oe.push({type:"tool-call",toolCallId:F.call_id,toolName:L.toCustomToolName("shell"),input:JSON.stringify({action:{commands:F.action.commands}}),...ne&&{providerExecuted:!0},providerMetadata:{[B]:{itemId:F.id}}});break}case"shell_call_output":{oe.push({type:"tool-result",toolCallId:F.call_id,toolName:L.toCustomToolName("shell"),result:{output:F.output.map(xe=>({stdout:xe.stdout,stderr:xe.stderr,outcome:xe.outcome.type==="exit"?{type:"exit",exitCode:xe.outcome.exit_code}:{type:"timeout"}}))}});break}case"message":{for(let xe of F.content){(s=(i=e.providerOptions)==null?void 0:i[B])!=null&&s.logprobs&&xe.logprobs&&J.push(xe.logprobs);let je={itemId:F.id,...F.phase!=null&&{phase:F.phase},...xe.annotations.length>0&&{annotations:xe.annotations}};oe.push({type:"text",text:xe.text,providerMetadata:{[B]:je}});for(let Me of xe.annotations)Me.type==="url_citation"?oe.push({type:"source",sourceType:"url",id:(c=(u=(l=this.config).generateId)==null?void 0:u.call(l))!=null?c:Wt(),url:Me.url,title:Me.title}):Me.type==="file_citation"?oe.push({type:"source",sourceType:"document",id:(_=(m=(d=this.config).generateId)==null?void 0:m.call(d))!=null?_:Wt(),mediaType:"text/plain",title:Me.filename,filename:Me.filename,providerMetadata:{[B]:{type:Me.type,fileId:Me.file_id,index:Me.index}}}):Me.type==="container_file_citation"?oe.push({type:"source",sourceType:"document",id:(k=(b=(h=this.config).generateId)==null?void 0:b.call(h))!=null?k:Wt(),mediaType:"text/plain",title:Me.filename,filename:Me.filename,providerMetadata:{[B]:{type:Me.type,fileId:Me.file_id,containerId:Me.container_id}}}):Me.type==="file_path"&&oe.push({type:"source",sourceType:"document",id:(g=(C=(I=this.config).generateId)==null?void 0:C.call(I))!=null?g:Wt(),mediaType:"application/octet-stream",title:Me.file_id,filename:Me.file_id,providerMetadata:{[B]:{type:Me.type,fileId:Me.file_id,index:Me.index}}})}break}case"function_call":{ge=!0,oe.push({type:"tool-call",toolCallId:F.call_id,toolName:F.name,input:F.arguments,providerMetadata:{[B]:{itemId:F.id,...F.namespace!=null&&{namespace:F.namespace}}}});break}case"custom_tool_call":{ge=!0;let xe=L.toCustomToolName(F.name);oe.push({type:"tool-call",toolCallId:F.call_id,toolName:xe,input:JSON.stringify(F.input),providerMetadata:{[B]:{itemId:F.id}}});break}case"web_search_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName(A??"web_search"),input:JSON.stringify({}),providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName(A??"web_search"),result:g$(F.action)});break}case"mcp_call":{let xe=F.approval_request_id!=null&&(v=pe[F.approval_request_id])!=null?v:F.id,je=`mcp.${F.name}`;oe.push({type:"tool-call",toolCallId:xe,toolName:je,input:F.arguments,providerExecuted:!0,dynamic:!0}),oe.push({type:"tool-result",toolCallId:xe,toolName:je,result:{type:"call",serverLabel:F.server_label,name:F.name,arguments:F.arguments,...F.output!=null?{output:F.output}:{},...F.error!=null?{error:F.error}:{}},providerMetadata:{[B]:{itemId:F.id}}});break}case"mcp_list_tools":break;case"mcp_approval_request":{let xe=(R=F.approval_request_id)!=null?R:F.id,je=(K=(N=(O=this.config).generateId)==null?void 0:N.call(O))!=null?K:Wt(),Me=`mcp.${F.name}`;oe.push({type:"tool-call",toolCallId:je,toolName:Me,input:F.arguments,providerExecuted:!0,dynamic:!0}),oe.push({type:"tool-approval-request",approvalId:xe,toolCallId:je});break}case"computer_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:F.status||"completed"}});break}case"file_search_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("file_search"),result:{queries:F.queries,results:(E=(ee=F.results)==null?void 0:ee.map(xe=>({attributes:xe.attributes,fileId:xe.file_id,filename:xe.filename,score:xe.score,text:xe.text})))!=null?E:null}});break}case"code_interpreter_call":{oe.push({type:"tool-call",toolCallId:F.id,toolName:L.toCustomToolName("code_interpreter"),input:JSON.stringify({code:F.code,containerId:F.container_id}),providerExecuted:!0}),oe.push({type:"tool-result",toolCallId:F.id,toolName:L.toCustomToolName("code_interpreter"),result:{outputs:F.outputs}});break}case"apply_patch_call":{oe.push({type:"tool-call",toolCallId:F.call_id,toolName:L.toCustomToolName("apply_patch"),input:JSON.stringify({callId:F.call_id,operation:F.operation}),providerMetadata:{[B]:{itemId:F.id}}});break}}let se={[B]:{responseId:Te.id,...J.length>0?{logprobs:J}:{},...typeof Te.service_tier=="string"?{serviceTier:Te.service_tier}:{}}},me=Te.usage;return{content:oe,finishReason:{unified:Uv({finishReason:(le=Te.incomplete_details)==null?void 0:le.reason,hasFunctionCall:ge}),raw:(ye=(z=Te.incomplete_details)==null?void 0:z.reason)!=null?ye:void 0},usage:d$(me),request:{body:D},response:{id:Te.id,timestamp:new Date(Te.created_at*1e3),modelId:Te.model,headers:Pe,body:Le},providerMetadata:se,warnings:U}}async doStream(e){let{args:t,warnings:n,webSearchToolName:o,toolNameMapping:r,store:i,providerOptionsName:s,isShellProviderExecuted:l}=await this.getArgs(e),{responseHeaders:u,value:c}=await vt({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:an,successfulResponseHandler:vo(jq),abortSignal:e.abortSignal,fetch:this.config.fetch}),d=this,m=m$(e.prompt),_=new Map,h={unified:"other",raw:void 0},b,k=[],I=null,C={},g=[],v,R=!1,O={},N,K=[];return{stream:c.pipeThrough(new TransformStream({start(ee){ee.enqueue({type:"stream-start",warnings:n})},transform(ee,E){var le,z,ye,D,U,A,L,B,ne,W,pe,Pe,Te,Le,oe,J,ge,we,se,me,F,xe,je,Me,er,lr,Sr,ur,et,Mt,cr,ln,un,Jt,Jr,Br,Dr,Gr;if(e.includeRawChunks&&E.enqueue({type:"raw",rawValue:ee.rawValue}),!ee.success){h={unified:"error",raw:void 0},E.enqueue({type:"error",error:ee.error});return}let x=ee.value;if(h$(x)){if(x.item.type==="function_call")C[x.output_index]={toolName:x.item.name,toolCallId:x.item.call_id},E.enqueue({type:"tool-input-start",id:x.item.call_id,toolName:x.item.name});else if(x.item.type==="custom_tool_call"){let y=r.toCustomToolName(x.item.name);C[x.output_index]={toolName:y,toolCallId:x.item.call_id},E.enqueue({type:"tool-input-start",id:x.item.call_id,toolName:y})}else if(x.item.type==="web_search_call")C[x.output_index]={toolName:r.toCustomToolName(o??"web_search"),toolCallId:x.item.id},E.enqueue({type:"tool-input-start",id:x.item.id,toolName:r.toCustomToolName(o??"web_search"),providerExecuted:!0}),E.enqueue({type:"tool-input-end",id:x.item.id}),E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName(o??"web_search"),input:JSON.stringify({}),providerExecuted:!0});else if(x.item.type==="computer_call")C[x.output_index]={toolName:r.toCustomToolName("computer_use"),toolCallId:x.item.id},E.enqueue({type:"tool-input-start",id:x.item.id,toolName:r.toCustomToolName("computer_use"),providerExecuted:!0});else if(x.item.type==="code_interpreter_call")C[x.output_index]={toolName:r.toCustomToolName("code_interpreter"),toolCallId:x.item.id,codeInterpreter:{containerId:x.item.container_id}},E.enqueue({type:"tool-input-start",id:x.item.id,toolName:r.toCustomToolName("code_interpreter"),providerExecuted:!0}),E.enqueue({type:"tool-input-delta",id:x.item.id,delta:`{"containerId":"${x.item.container_id}","code":"`});else if(x.item.type==="file_search_call")E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName("file_search"),input:"{}",providerExecuted:!0});else if(x.item.type==="image_generation_call")E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0});else if(x.item.type==="tool_search_call"){let y=x.item.id,q=r.toCustomToolName("tool_search"),G=x.item.execution==="server";C[x.output_index]={toolName:q,toolCallId:y,toolSearchExecution:(le=x.item.execution)!=null?le:"server"},G&&E.enqueue({type:"tool-input-start",id:y,toolName:q,providerExecuted:!0})}else if(x.item.type!=="tool_search_output"){if(!(x.item.type==="mcp_call"||x.item.type==="mcp_list_tools"||x.item.type==="mcp_approval_request"))if(x.item.type==="apply_patch_call"){let{call_id:y,operation:q}=x.item;if(C[x.output_index]={toolName:r.toCustomToolName("apply_patch"),toolCallId:y,applyPatch:{hasDiff:q.type==="delete_file",endEmitted:q.type==="delete_file"}},E.enqueue({type:"tool-input-start",id:y,toolName:r.toCustomToolName("apply_patch")}),q.type==="delete_file"){let G=JSON.stringify({callId:y,operation:q});E.enqueue({type:"tool-input-delta",id:y,delta:G}),E.enqueue({type:"tool-input-end",id:y})}else E.enqueue({type:"tool-input-delta",id:y,delta:`{"callId":"${li(y)}","operation":{"type":"${li(q.type)}","path":"${li(q.path)}","diff":"`})}else x.item.type==="shell_call"?C[x.output_index]={toolName:r.toCustomToolName("shell"),toolCallId:x.item.call_id}:x.item.type==="shell_call_output"||(x.item.type==="message"?(g.splice(0,g.length),v=(z=x.item.phase)!=null?z:void 0,E.enqueue({type:"text-start",id:x.item.id,providerMetadata:{[s]:{itemId:x.item.id,...x.item.phase!=null&&{phase:x.item.phase}}}})):h$(x)&&x.item.type==="reasoning"&&(O[x.item.id]={encryptedContent:x.item.encrypted_content,summaryParts:{0:"active"}},E.enqueue({type:"reasoning-start",id:`${x.item.id}:0`,providerMetadata:{[s]:{itemId:x.item.id,reasoningEncryptedContent:(ye=x.item.encrypted_content)!=null?ye:null}}})))}}else if(Fq(x)){if(x.item.type==="message"){let y=(D=x.item.phase)!=null?D:v;v=void 0,E.enqueue({type:"text-end",id:x.item.id,providerMetadata:{[s]:{itemId:x.item.id,...y!=null&&{phase:y},...g.length>0&&{annotations:g}}}})}else if(x.item.type==="function_call")C[x.output_index]=void 0,R=!0,E.enqueue({type:"tool-input-end",id:x.item.call_id,...x.item.namespace!=null&&{providerMetadata:{[s]:{namespace:x.item.namespace}}}}),E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:x.item.name,input:x.item.arguments,providerMetadata:{[s]:{itemId:x.item.id,...x.item.namespace!=null&&{namespace:x.item.namespace}}}});else if(x.item.type==="custom_tool_call"){C[x.output_index]=void 0,R=!0;let y=r.toCustomToolName(x.item.name);E.enqueue({type:"tool-input-end",id:x.item.call_id}),E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:y,input:JSON.stringify(x.item.input),providerMetadata:{[s]:{itemId:x.item.id}}})}else if(x.item.type==="web_search_call")C[x.output_index]=void 0,E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName(o??"web_search"),result:g$(x.item.action)});else if(x.item.type==="computer_call")C[x.output_index]=void 0,E.enqueue({type:"tool-input-end",id:x.item.id}),E.enqueue({type:"tool-call",toolCallId:x.item.id,toolName:r.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:x.item.status||"completed"}});else if(x.item.type==="file_search_call")C[x.output_index]=void 0,E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("file_search"),result:{queries:x.item.queries,results:(A=(U=x.item.results)==null?void 0:U.map(y=>({attributes:y.attributes,fileId:y.file_id,filename:y.filename,score:y.score,text:y.text})))!=null?A:null}});else if(x.item.type==="code_interpreter_call")C[x.output_index]=void 0,E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("code_interpreter"),result:{outputs:x.item.outputs}});else if(x.item.type==="image_generation_call")E.enqueue({type:"tool-result",toolCallId:x.item.id,toolName:r.toCustomToolName("image_generation"),result:{result:x.item.result}});else if(x.item.type==="tool_search_call"){let y=C[x.output_index],q=x.item.execution==="server";if(y!=null){let G=q?y.toolCallId:(L=x.item.call_id)!=null?L:x.item.id;q?K.push(G):E.enqueue({type:"tool-input-start",id:G,toolName:y.toolName}),E.enqueue({type:"tool-input-end",id:G}),E.enqueue({type:"tool-call",toolCallId:G,toolName:y.toolName,input:JSON.stringify({arguments:x.item.arguments,call_id:q?null:G}),...q?{providerExecuted:!0}:{},providerMetadata:{[s]:{itemId:x.item.id}}})}C[x.output_index]=void 0}else if(x.item.type==="tool_search_output"){let y=(ne=(B=x.item.call_id)!=null?B:K.shift())!=null?ne:x.item.id;E.enqueue({type:"tool-result",toolCallId:y,toolName:r.toCustomToolName("tool_search"),result:{tools:x.item.tools},providerMetadata:{[s]:{itemId:x.item.id}}})}else if(x.item.type==="mcp_call"){C[x.output_index]=void 0;let y=(W=x.item.approval_request_id)!=null?W:void 0,q=y!=null&&(Pe=(pe=_.get(y))!=null?pe:m[y])!=null?Pe:x.item.id,G=`mcp.${x.item.name}`;E.enqueue({type:"tool-call",toolCallId:q,toolName:G,input:x.item.arguments,providerExecuted:!0,dynamic:!0}),E.enqueue({type:"tool-result",toolCallId:q,toolName:G,result:{type:"call",serverLabel:x.item.server_label,name:x.item.name,arguments:x.item.arguments,...x.item.output!=null?{output:x.item.output}:{},...x.item.error!=null?{error:x.item.error}:{}},providerMetadata:{[s]:{itemId:x.item.id}}})}else if(x.item.type==="mcp_list_tools")C[x.output_index]=void 0;else if(x.item.type==="apply_patch_call"){let y=C[x.output_index];y?.applyPatch&&!y.applyPatch.endEmitted&&x.item.operation.type!=="delete_file"&&(y.applyPatch.hasDiff||E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:li(x.item.operation.diff)}),E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:'"}}'}),E.enqueue({type:"tool-input-end",id:y.toolCallId}),y.applyPatch.endEmitted=!0),y&&x.item.status==="completed"&&E.enqueue({type:"tool-call",toolCallId:y.toolCallId,toolName:r.toCustomToolName("apply_patch"),input:JSON.stringify({callId:x.item.call_id,operation:x.item.operation}),providerMetadata:{[s]:{itemId:x.item.id}}}),C[x.output_index]=void 0}else if(x.item.type==="mcp_approval_request"){C[x.output_index]=void 0;let y=(oe=(Le=(Te=d.config).generateId)==null?void 0:Le.call(Te))!=null?oe:Wt(),q=(J=x.item.approval_request_id)!=null?J:x.item.id;_.set(q,y);let G=`mcp.${x.item.name}`;E.enqueue({type:"tool-call",toolCallId:y,toolName:G,input:x.item.arguments,providerExecuted:!0,dynamic:!0}),E.enqueue({type:"tool-approval-request",approvalId:q,toolCallId:y})}else if(x.item.type==="local_shell_call")C[x.output_index]=void 0,E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:r.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:x.item.action.command,timeoutMs:x.item.action.timeout_ms,user:x.item.action.user,workingDirectory:x.item.action.working_directory,env:x.item.action.env}}),providerMetadata:{[s]:{itemId:x.item.id}}});else if(x.item.type==="shell_call")C[x.output_index]=void 0,E.enqueue({type:"tool-call",toolCallId:x.item.call_id,toolName:r.toCustomToolName("shell"),input:JSON.stringify({action:{commands:x.item.action.commands}}),...l&&{providerExecuted:!0},providerMetadata:{[s]:{itemId:x.item.id}}});else if(x.item.type==="shell_call_output")E.enqueue({type:"tool-result",toolCallId:x.item.call_id,toolName:r.toCustomToolName("shell"),result:{output:x.item.output.map(y=>({stdout:y.stdout,stderr:y.stderr,outcome:y.outcome.type==="exit"?{type:"exit",exitCode:y.outcome.exit_code}:{type:"timeout"}}))}});else if(x.item.type==="reasoning"){let y=O[x.item.id],q=Object.entries(y.summaryParts).filter(([G,ve])=>ve==="active"||ve==="can-conclude").map(([G])=>G);for(let G of q)E.enqueue({type:"reasoning-end",id:`${x.item.id}:${G}`,providerMetadata:{[s]:{itemId:x.item.id,reasoningEncryptedContent:(ge=x.item.encrypted_content)!=null?ge:null}}});delete O[x.item.id]}}else if(Hq(x)){let y=C[x.output_index];y!=null&&E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:x.delta})}else if(Jq(x)){let y=C[x.output_index];y!=null&&E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:x.delta})}else if(Yq(x)){let y=C[x.output_index];y?.applyPatch&&(E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:li(x.delta)}),y.applyPatch.hasDiff=!0)}else if(Xq(x)){let y=C[x.output_index];y?.applyPatch&&!y.applyPatch.endEmitted&&(y.applyPatch.hasDiff||(E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:li(x.diff)}),y.applyPatch.hasDiff=!0),E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:'"}}'}),E.enqueue({type:"tool-input-end",id:y.toolCallId}),y.applyPatch.endEmitted=!0)}else if(Bq(x))E.enqueue({type:"tool-result",toolCallId:x.item_id,toolName:r.toCustomToolName("image_generation"),result:{result:x.partial_image_b64},preliminary:!0});else if(Gq(x)){let y=C[x.output_index];y!=null&&E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:li(x.delta)})}else if(Kq(x)){let y=C[x.output_index];y!=null&&(E.enqueue({type:"tool-input-delta",id:y.toolCallId,delta:'"}'}),E.enqueue({type:"tool-input-end",id:y.toolCallId}),E.enqueue({type:"tool-call",toolCallId:y.toolCallId,toolName:r.toCustomToolName("code_interpreter"),input:JSON.stringify({code:x.code,containerId:y.codeInterpreter.containerId}),providerExecuted:!0}))}else if(Wq(x))I=x.response.id,E.enqueue({type:"response-metadata",id:x.response.id,timestamp:new Date(x.response.created_at*1e3),modelId:x.response.model});else if(Lq(x))E.enqueue({type:"text-delta",id:x.item_id,delta:x.delta}),(se=(we=e.providerOptions)==null?void 0:we[s])!=null&&se.logprobs&&x.logprobs&&k.push(x.logprobs);else if(x.type==="response.reasoning_summary_part.added"){if(x.summary_index>0){let y=O[x.item_id];y.summaryParts[x.summary_index]="active";for(let q of Object.keys(y.summaryParts))y.summaryParts[q]==="can-conclude"&&(E.enqueue({type:"reasoning-end",id:`${x.item_id}:${q}`,providerMetadata:{[s]:{itemId:x.item_id}}}),y.summaryParts[q]="concluded");E.enqueue({type:"reasoning-start",id:`${x.item_id}:${x.summary_index}`,providerMetadata:{[s]:{itemId:x.item_id,reasoningEncryptedContent:(F=(me=O[x.item_id])==null?void 0:me.encryptedContent)!=null?F:null}}})}}else if(x.type==="response.reasoning_summary_text.delta")E.enqueue({type:"reasoning-delta",id:`${x.item_id}:${x.summary_index}`,delta:x.delta,providerMetadata:{[s]:{itemId:x.item_id}}});else if(x.type==="response.reasoning_summary_part.done")i?(E.enqueue({type:"reasoning-end",id:`${x.item_id}:${x.summary_index}`,providerMetadata:{[s]:{itemId:x.item_id}}}),O[x.item_id].summaryParts[x.summary_index]="concluded"):O[x.item_id].summaryParts[x.summary_index]="can-conclude";else if(Zq(x))h={unified:Uv({finishReason:(xe=x.response.incomplete_details)==null?void 0:xe.reason,hasFunctionCall:R}),raw:(Me=(je=x.response.incomplete_details)==null?void 0:je.reason)!=null?Me:void 0},b=x.response.usage,typeof x.response.service_tier=="string"&&(N=x.response.service_tier);else if(Vq(x)){let y=(er=x.response.incomplete_details)==null?void 0:er.reason;h={unified:y?Uv({finishReason:y,hasFunctionCall:R}):"error",raw:y??"error"},b=(lr=x.response.usage)!=null?lr:void 0}else Qq(x)?(g.push(x.annotation),x.annotation.type==="url_citation"?E.enqueue({type:"source",sourceType:"url",id:(et=(ur=(Sr=d.config).generateId)==null?void 0:ur.call(Sr))!=null?et:Wt(),url:x.annotation.url,title:x.annotation.title}):x.annotation.type==="file_citation"?E.enqueue({type:"source",sourceType:"document",id:(ln=(cr=(Mt=d.config).generateId)==null?void 0:cr.call(Mt))!=null?ln:Wt(),mediaType:"text/plain",title:x.annotation.filename,filename:x.annotation.filename,providerMetadata:{[s]:{type:x.annotation.type,fileId:x.annotation.file_id,index:x.annotation.index}}}):x.annotation.type==="container_file_citation"?E.enqueue({type:"source",sourceType:"document",id:(Jr=(Jt=(un=d.config).generateId)==null?void 0:Jt.call(un))!=null?Jr:Wt(),mediaType:"text/plain",title:x.annotation.filename,filename:x.annotation.filename,providerMetadata:{[s]:{type:x.annotation.type,fileId:x.annotation.file_id,containerId:x.annotation.container_id}}}):x.annotation.type==="file_path"&&E.enqueue({type:"source",sourceType:"document",id:(Gr=(Dr=(Br=d.config).generateId)==null?void 0:Dr.call(Br))!=null?Gr:Wt(),mediaType:"application/octet-stream",title:x.annotation.file_id,filename:x.annotation.file_id,providerMetadata:{[s]:{type:x.annotation.type,fileId:x.annotation.file_id,index:x.annotation.index}}})):eU(x)&&E.enqueue({type:"error",error:x})},flush(ee){let E={[s]:{responseId:I,...k.length>0?{logprobs:k}:{},...N!==void 0?{serviceTier:N}:{}}};ee.enqueue({type:"finish",finishReason:h,usage:d$(b),providerMetadata:E})}})),request:{body:t},response:{headers:u}}}};function Lq(e){return e.type==="response.output_text.delta"}function Fq(e){return e.type==="response.output_item.done"}function Zq(e){return e.type==="response.completed"||e.type==="response.incomplete"}function Vq(e){return e.type==="response.failed"}function Wq(e){return e.type==="response.created"}function Hq(e){return e.type==="response.function_call_arguments.delta"}function Jq(e){return e.type==="response.custom_tool_call_input.delta"}function Bq(e){return e.type==="response.image_generation_call.partial_image"}function Gq(e){return e.type==="response.code_interpreter_call_code.delta"}function Kq(e){return e.type==="response.code_interpreter_call_code.done"}function Yq(e){return e.type==="response.apply_patch_call_operation_diff.delta"}function Xq(e){return e.type==="response.apply_patch_call_operation_diff.done"}function h$(e){return e.type==="response.output_item.added"}function Qq(e){return e.type==="response.output_text.annotation.added"}function eU(e){return e.type==="error"}function g$(e){var t;if(e==null)return{};switch(e.type){case"search":return{action:{type:"search",query:(t=e.query)!=null?t:void 0,...e.queries!=null&&{queries:e.queries}},...e.sources!=null&&{sources:e.sources}};case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}function li(e){return JSON.stringify(e).slice(1,-1)}var tU=X(()=>Y(a.object({instructions:a.string().nullish(),speed:a.number().min(.25).max(4).default(1).nullish()}))),rU=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({text:e,voice:t="alloy",outputFormat:n="mp3",speed:o,instructions:r,language:i,providerOptions:s}){let l=[],u=await zt({provider:"openai",providerOptions:s,schema:tU}),c={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:o,instructions:r};if(n&&(["mp3","opus","aac","flac","wav","pcm"].includes(n)?c.response_format=n:l.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${n}. Using mp3 instead.`})),u){let d={};for(let m in d){let _=d[m];_!==void 0&&(c[m]=_)}}return i&&l.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${i}" was ignored.`}),{requestBody:c,warnings:l}}async doGenerate(e){var t,n,o;let r=(o=(n=(t=this.config._internal)==null?void 0:t.currentDate)==null?void 0:n.call(t))!=null?o:new Date,{requestBody:i,warnings:s}=await this.getArgs(e),{value:l,responseHeaders:u,rawValue:c}=await vt({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),body:i,failedResponseHandler:an,successfulResponseHandler:t$(),abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:l,warnings:s,request:{body:JSON.stringify(i)},response:{timestamp:r,modelId:this.modelId,headers:u,body:c}}}},nU=X(()=>Y(a.object({text:a.string(),language:a.string().nullish(),duration:a.number().nullish(),words:a.array(a.object({word:a.string(),start:a.number(),end:a.number()})).nullish(),segments:a.array(a.object({id:a.number(),seek:a.number(),start:a.number(),end:a.number(),text:a.string(),tokens:a.array(a.number()),temperature:a.number(),avg_logprob:a.number(),compression_ratio:a.number(),no_speech_prob:a.number()})).nullish()}))),oU=X(()=>Y(a.object({include:a.array(a.string()).optional(),language:a.string().optional(),prompt:a.string().optional(),temperature:a.number().min(0).max(1).default(0).optional(),timestampGranularities:a.array(a.enum(["word","segment"])).default(["segment"]).optional()}))),v$={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},iU=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:e,mediaType:t,providerOptions:n}){let o=[],r=await zt({provider:"openai",providerOptions:n,schema:oU}),i=new FormData,s=e instanceof Uint8Array?new Blob([e]):new Blob([nn(e)]);i.append("model",this.modelId);let l=B0(t);if(i.append("file",new File([s],"audio",{type:t}),`audio.${l}`),r){let u={include:r.include,language:r.language,prompt:r.prompt,response_format:["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId)?"json":"verbose_json",temperature:r.temperature,timestamp_granularities:r.timestampGranularities};for(let[c,d]of Object.entries(u))if(d!=null)if(Array.isArray(d))for(let m of d)i.append(`${c}[]`,String(m));else i.append(c,String(d))}return{formData:i,warnings:o}}async doGenerate(e){var t,n,o,r,i,s,l,u;let c=(o=(n=(t=this.config._internal)==null?void 0:t.currentDate)==null?void 0:n.call(t))!=null?o:new Date,{formData:d,warnings:m}=await this.getArgs(e),{value:_,responseHeaders:h,rawValue:b}=await Vc({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:nt(this.config.headers(),e.headers),formData:d,failedResponseHandler:an,successfulResponseHandler:it(nU),abortSignal:e.abortSignal,fetch:this.config.fetch}),k=_.language!=null&&_.language in v$?v$[_.language]:void 0;return{text:_.text,segments:(l=(s=(r=_.segments)==null?void 0:r.map(I=>({text:I.text,startSecond:I.start,endSecond:I.end})))!=null?s:(i=_.words)==null?void 0:i.map(I=>({text:I.word,startSecond:I.start,endSecond:I.end})))!=null?l:[],language:k,durationInSeconds:(u=_.duration)!=null?u:void 0,warnings:m,response:{timestamp:c,modelId:this.modelId,headers:h,body:b}}}},aU="3.0.68";function Jv(e={}){var t,n;let o=(t=Wc(go({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"})))!=null?t:"https://api.openai.com/v1",r=(n=e.name)!=null?n:"openai",i=()=>on({Authorization:`Bearer ${J0({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers},`ai-sdk/openai/${aU}`),s=k=>new Ez(k,{provider:`${r}.chat`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch}),l=k=>new Dz(k,{provider:`${r}.completion`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch}),u=k=>new Mz(k,{provider:`${r}.embedding`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch}),c=k=>new Fz(k,{provider:`${r}.image`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch}),d=k=>new iU(k,{provider:`${r}.transcription`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch}),m=k=>new rU(k,{provider:`${r}.speech`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch}),_=k=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return h(k)},h=k=>new Uq(k,{provider:`${r}.responses`,url:({path:I})=>`${o}${I}`,headers:i,fetch:e.fetch,fileIdPrefixes:["file-"]}),b=function(k){return _(k)};return b.specificationVersion="v3",b.languageModel=_,b.chat=s,b.completion=l,b.responses=h,b.embedding=u,b.embeddingModel=u,b.textEmbedding=u,b.textEmbeddingModel=u,b.image=c,b.imageModel=c,b.transcription=d,b.transcriptionModel=d,b.speech=m,b.speechModel=m,b.tools=Rq,b}var XJ=Jv();var YP=Lt(py(),1),XP=Lt(py(),1),V4="vercel.ai.gateway.error",fy=Symbol.for(V4),dP,pP,Ht=class UP extends(pP=Error,dP=fy,pP){constructor({message:t,statusCode:n=500,cause:o,generationId:r,isRetryable:i=n!=null&&(n===408||n===409||n===429||n>=500)}){super(r?`${t} [${r}]`:t),this[dP]=!0,this.statusCode=n,this.cause=o,this.generationId=r,this.isRetryable=i}static isInstance(t){return UP.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&fy in t&&t[fy]===!0}},LP="GatewayAuthenticationError",W4=`vercel.ai.gateway.error.${LP}`,fP=Symbol.for(W4),mP,hP,Kc=class FP extends(hP=Ht,mP=fP,hP){constructor({message:t="Authentication failed",statusCode:n=401,cause:o,generationId:r}={}){super({message:t,statusCode:n,cause:o,generationId:r}),this[mP]=!0,this.name=LP,this.type="authentication_error"}static isInstance(t){return Ht.hasMarker(t)&&fP in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:o="Authentication failed",statusCode:r=401,cause:i,generationId:s}){let l;return t?l=`AI Gateway authentication failed: Invalid API key. Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys @@ -115,9 +115,9 @@ Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable. Option 2 - OIDC token: -Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,new IP({message:l,statusCode:r,cause:i,generationId:s})}},TP="GatewayInvalidRequestError",k4=`vercel.ai.gateway.error.${TP}`,Q$=Symbol.for(k4),eP,tP,S4=class extends(tP=Wt,eP=Q$,tP){constructor({message:e="Invalid request",statusCode:t=400,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[eP]=!0,this.name=TP,this.type="invalid_request_error"}static isInstance(e){return Wt.hasMarker(e)&&Q$ in e}},$P="GatewayRateLimitError",I4=`vercel.ai.gateway.error.${$P}`,rP=Symbol.for(I4),nP,oP,T4=class extends(oP=Wt,nP=rP,oP){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[nP]=!0,this.name=$P,this.type="rate_limit_exceeded"}static isInstance(e){return Wt.hasMarker(e)&&rP in e}},PP="GatewayModelNotFoundError",$4=`vercel.ai.gateway.error.${PP}`,iP=Symbol.for($4),P4=X(()=>Y(a.object({modelId:a.string()}))),aP,sP,E4=class extends(sP=Wt,aP=iP,sP){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:o,generationId:r}={}){super({message:e,statusCode:t,cause:o,generationId:r}),this[aP]=!0,this.name=PP,this.type="model_not_found",this.modelId=n}static isInstance(e){return Wt.hasMarker(e)&&iP in e}},EP="GatewayInternalServerError",C4=`vercel.ai.gateway.error.${EP}`,lP=Symbol.for(C4),uP,cP,dP=class extends(cP=Wt,uP=lP,cP){constructor({message:e="Internal server error",statusCode:t=500,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[uP]=!0,this.name=EP,this.type="internal_server_error"}static isInstance(e){return Wt.hasMarker(e)&&lP in e}},CP="GatewayResponseError",R4=`vercel.ai.gateway.error.${CP}`,pP=Symbol.for(R4),fP,mP,O4=class extends(mP=Wt,fP=pP,mP){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:o,cause:r,generationId:i}={}){super({message:e,statusCode:t,cause:r,generationId:i}),this[fP]=!0,this.name=CP,this.type="response_error",this.response=n,this.validationError=o}static isInstance(e){return Wt.hasMarker(e)&&pP in e}};async function hP({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:o,authMethod:r}){var i;let s=await Xt({value:e,schema:D4});if(!s.success){let m=typeof e=="object"&&e!==null&&"generationId"in e?e.generationId:void 0;return new O4({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:s.error,cause:o,generationId:m})}let l=s.value,u=l.error.type,c=l.error.message,d=(i=l.generationId)!=null?i:void 0;switch(u){case"authentication_error":return Bc.createContextualError({apiKeyProvided:r==="api-key",oidcTokenProvided:r==="oidc",statusCode:t,cause:o,generationId:d});case"invalid_request_error":return new S4({message:c,statusCode:t,cause:o,generationId:d});case"rate_limit_exceeded":return new T4({message:c,statusCode:t,cause:o,generationId:d});case"model_not_found":{let m=await Xt({value:l.error.param,schema:P4});return new E4({message:c,statusCode:t,modelId:m.success?m.value.modelId:void 0,cause:o,generationId:d})}case"internal_server_error":return new dP({message:c,statusCode:t,cause:o,generationId:d});default:return new dP({message:c,statusCode:t,cause:o,generationId:d})}}var D4=X(()=>Y(a.object({error:a.object({message:a.string(),type:a.string().nullish(),param:a.unknown().nullish(),code:a.union([a.string(),a.number()]).nullish()}),generationId:a.string().nullish()})));function j4(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var RP="GatewayTimeoutError",N4=`vercel.ai.gateway.error.${RP}`,gP=Symbol.for(N4),vP,yP,_P=class OP extends(yP=Wt,vP=gP,yP){constructor({message:t="Request timed out",statusCode:n=408,cause:o,generationId:r}={}){super({message:t,statusCode:n,cause:o,generationId:r}),this[vP]=!0,this.name=RP,this.type="timeout_error"}static isInstance(t){return Wt.hasMarker(t)&&gP in t}static createTimeoutError({originalMessage:t,statusCode:n=408,cause:o,generationId:r}){let i=`Gateway request timed out: ${t} +Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,new FP({message:l,statusCode:r,cause:i,generationId:s})}},ZP="GatewayInvalidRequestError",H4=`vercel.ai.gateway.error.${ZP}`,gP=Symbol.for(H4),vP,yP,J4=class extends(yP=Ht,vP=gP,yP){constructor({message:e="Invalid request",statusCode:t=400,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[vP]=!0,this.name=ZP,this.type="invalid_request_error"}static isInstance(e){return Ht.hasMarker(e)&&gP in e}},VP="GatewayRateLimitError",B4=`vercel.ai.gateway.error.${VP}`,_P=Symbol.for(B4),bP,wP,G4=class extends(wP=Ht,bP=_P,wP){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[bP]=!0,this.name=VP,this.type="rate_limit_exceeded"}static isInstance(e){return Ht.hasMarker(e)&&_P in e}},WP="GatewayModelNotFoundError",K4=`vercel.ai.gateway.error.${WP}`,xP=Symbol.for(K4),Y4=X(()=>Y(a.object({modelId:a.string()}))),kP,SP,X4=class extends(SP=Ht,kP=xP,SP){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:o,generationId:r}={}){super({message:e,statusCode:t,cause:o,generationId:r}),this[kP]=!0,this.name=WP,this.type="model_not_found",this.modelId=n}static isInstance(e){return Ht.hasMarker(e)&&xP in e}},HP="GatewayInternalServerError",Q4=`vercel.ai.gateway.error.${HP}`,TP=Symbol.for(Q4),IP,$P,PP=class extends($P=Ht,IP=TP,$P){constructor({message:e="Internal server error",statusCode:t=500,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[IP]=!0,this.name=HP,this.type="internal_server_error"}static isInstance(e){return Ht.hasMarker(e)&&TP in e}},JP="GatewayResponseError",eL=`vercel.ai.gateway.error.${JP}`,EP=Symbol.for(eL),RP,CP,tL=class extends(CP=Ht,RP=EP,CP){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:o,cause:r,generationId:i}={}){super({message:e,statusCode:t,cause:r,generationId:i}),this[RP]=!0,this.name=JP,this.type="response_error",this.response=n,this.validationError=o}static isInstance(e){return Ht.hasMarker(e)&&EP in e}};async function OP({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:o,authMethod:r}){var i;let s=await Qt({value:e,schema:rL});if(!s.success){let m=typeof e=="object"&&e!==null&&"generationId"in e?e.generationId:void 0;return new tL({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:s.error,cause:o,generationId:m})}let l=s.value,u=l.error.type,c=l.error.message,d=(i=l.generationId)!=null?i:void 0;switch(u){case"authentication_error":return Kc.createContextualError({apiKeyProvided:r==="api-key",oidcTokenProvided:r==="oidc",statusCode:t,cause:o,generationId:d});case"invalid_request_error":return new J4({message:c,statusCode:t,cause:o,generationId:d});case"rate_limit_exceeded":return new G4({message:c,statusCode:t,cause:o,generationId:d});case"model_not_found":{let m=await Qt({value:l.error.param,schema:Y4});return new X4({message:c,statusCode:t,modelId:m.success?m.value.modelId:void 0,cause:o,generationId:d})}case"internal_server_error":return new PP({message:c,statusCode:t,cause:o,generationId:d});default:return new PP({message:c,statusCode:t,cause:o,generationId:d})}}var rL=X(()=>Y(a.object({error:a.object({message:a.string(),type:a.string().nullish(),param:a.unknown().nullish(),code:a.union([a.string(),a.number()]).nullish()}),generationId:a.string().nullish()})));function nL(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var BP="GatewayTimeoutError",oL=`vercel.ai.gateway.error.${BP}`,DP=Symbol.for(oL),jP,NP,MP=class GP extends(NP=Ht,jP=DP,NP){constructor({message:t="Request timed out",statusCode:n=408,cause:o,generationId:r}={}){super({message:t,statusCode:n,cause:o,generationId:r}),this[jP]=!0,this.name=BP,this.type="timeout_error"}static isInstance(t){return Ht.hasMarker(t)&&DP in t}static createTimeoutError({originalMessage:t,statusCode:n=408,cause:o,generationId:r}){let i=`Gateway request timed out: ${t} - This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`;return new OP({message:i,statusCode:n,cause:o,generationId:r})}};function bP(e){if(!(e instanceof Error))return!1;let t=e.code;return typeof t=="string"?["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t):!1}async function xr(e,t){var n;return Wt.isInstance(e)?e:bP(e)?_P.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):Je.isInstance(e)?e.cause&&bP(e.cause)?_P.createTimeoutError({originalMessage:e.message,cause:e}):await hP({response:j4(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await hP({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var DP="ai-gateway-auth-method";async function _n(e){let t=await Xt({value:e[DP],schema:M4});return t.success?t.value:void 0}var M4=X(()=>Y(a.union([a.literal("api-key"),a.literal("oidc")]))),A4=["embedding","image","language","reranking","video"],wP=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await ii({url:`${this.config.baseURL}/config`,headers:await ft(this.config.headers()),successfulResponseHandler:at(z4),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:t=>t}),fetch:this.config.fetch});return e}catch(e){throw await xr(e)}}async getCredits(){try{let e=new URL(this.config.baseURL),{value:t}=await ii({url:`${e.origin}/v1/credits`,headers:await ft(this.config.headers()),successfulResponseHandler:at(q4),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:n=>n}),fetch:this.config.fetch});return t}catch(e){throw await xr(e)}}},z4=X(()=>Y(a.object({models:a.array(a.object({id:a.string(),name:a.string(),description:a.string().nullish(),pricing:a.object({input:a.string(),output:a.string(),input_cache_read:a.string().nullish(),input_cache_write:a.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:o})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...o?{cacheCreationInputTokens:o}:{}})).nullish(),specification:a.object({specificationVersion:a.literal("v3"),provider:a.string(),modelId:a.string()}),modelType:a.string().nullish()})).transform(e=>e.filter(t=>t.modelType==null||A4.includes(t.modelType)))}))),q4=X(()=>Y(a.object({balance:a.string(),total_used:a.string()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),U4=class{constructor(e){this.config=e}async getSpendReport(e){try{let t=new URL(this.config.baseURL),n=new URLSearchParams;n.set("start_date",e.startDate),n.set("end_date",e.endDate),e.groupBy&&n.set("group_by",e.groupBy),e.datePart&&n.set("date_part",e.datePart),e.userId&&n.set("user_id",e.userId),e.model&&n.set("model",e.model),e.provider&&n.set("provider",e.provider),e.credentialType&&n.set("credential_type",e.credentialType),e.tags&&e.tags.length>0&&n.set("tags",e.tags.join(","));let{value:o}=await ii({url:`${t.origin}/v1/report?${n.toString()}`,headers:await ft(this.config.headers()),successfulResponseHandler:at(L4),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:r=>r}),fetch:this.config.fetch});return o}catch(t){throw await xr(t)}}},L4=X(()=>Y(a.object({results:a.array(a.object({day:a.string().optional(),hour:a.string().optional(),user:a.string().optional(),model:a.string().optional(),tag:a.string().optional(),provider:a.string().optional(),credential_type:a.enum(["byok","system"]).optional(),total_cost:a.number(),market_cost:a.number().optional(),input_tokens:a.number().optional(),output_tokens:a.number().optional(),cached_input_tokens:a.number().optional(),cache_creation_input_tokens:a.number().optional(),reasoning_tokens:a.number().optional(),request_count:a.number().optional()}).transform(({credential_type:e,total_cost:t,market_cost:n,input_tokens:o,output_tokens:r,cached_input_tokens:i,cache_creation_input_tokens:s,reasoning_tokens:l,request_count:u,...c})=>({...c,...e!==void 0?{credentialType:e}:{},totalCost:t,...n!==void 0?{marketCost:n}:{},...o!==void 0?{inputTokens:o}:{},...r!==void 0?{outputTokens:r}:{},...i!==void 0?{cachedInputTokens:i}:{},...s!==void 0?{cacheCreationInputTokens:s}:{},...l!==void 0?{reasoningTokens:l}:{},...u!==void 0?{requestCount:u}:{}})))}))),F4=class{constructor(e){this.config=e}async getGenerationInfo(e){try{let t=new URL(this.config.baseURL),{value:n}=await ii({url:`${t.origin}/v1/generation?id=${encodeURIComponent(e.id)}`,headers:await ft(this.config.headers()),successfulResponseHandler:at(Z4),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:o=>o}),fetch:this.config.fetch});return n}catch(t){throw await xr(t)}}},Z4=X(()=>Y(a.object({data:a.object({id:a.string(),total_cost:a.number(),upstream_inference_cost:a.number(),usage:a.number(),created_at:a.string(),model:a.string(),is_byok:a.boolean(),provider_name:a.string(),streamed:a.boolean(),finish_reason:a.string(),latency:a.number(),generation_time:a.number(),native_tokens_prompt:a.number(),native_tokens_completion:a.number(),native_tokens_reasoning:a.number(),native_tokens_cached:a.number(),native_tokens_cache_creation:a.number(),billable_web_search_calls:a.number()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:n,is_byok:o,provider_name:r,finish_reason:i,generation_time:s,native_tokens_prompt:l,native_tokens_completion:u,native_tokens_reasoning:c,native_tokens_cached:d,native_tokens_cache_creation:m,billable_web_search_calls:_,...h})=>({...h,totalCost:e,upstreamInferenceCost:t,createdAt:n,isByok:o,providerName:r,finishReason:i,generationTime:s,promptTokens:l,completionTokens:u,reasoningTokens:c,cachedTokens:d,cacheCreationTokens:m,billableWebSearchCalls:_}))}).transform(({data:e})=>e))),V4=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await ft(this.config.headers());try{let{responseHeaders:i,value:s,rawValue:l}=await vt({url:this.getUrl(),headers:nt(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await ft(this.config.o11yHeaders)),body:t,successfulResponseHandler:at(a.any()),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:u=>u}),...o&&{abortSignal:o},fetch:this.config.fetch});return{...s,request:{body:t},response:{headers:i,body:l},warnings:n}}catch(i){throw await xr(i,await _n(r))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await ft(this.config.headers());try{let{value:i,responseHeaders:s}=await vt({url:this.getUrl(),headers:nt(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await ft(this.config.o11yHeaders)),body:t,successfulResponseHandler:ho(a.any()),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:l=>l}),...o&&{abortSignal:o},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(l){n.length>0&&l.enqueue({type:"stream-start",warnings:n})},transform(l,u){if(l.success){let c=l.value;if(c.type==="raw"&&!e.includeRawChunks)return;c.type==="response-metadata"&&c.timestamp&&typeof c.timestamp=="string"&&(c.timestamp=new Date(c.timestamp)),u.enqueue(c)}else u.error(l.error)}})),request:{body:t},response:{headers:s}}}catch(i){throw await xr(i,await _n(r))}}isFilePart(e){return e&&typeof e=="object"&&"type"in e&&e.type==="file"}maybeEncodeFileParts(e){for(let t of e.prompt)for(let n of t.content)if(this.isFilePart(n)){let o=n;if(o.data instanceof Uint8Array){let r=Uint8Array.from(o.data),i=Buffer.from(r).toString("base64");o.data=new URL(`data:${o.mediaType||"application/octet-stream"};base64,${i}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"3","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},W4=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;let i=await ft(this.config.headers());try{let{responseHeaders:s,value:l,rawValue:u}=await vt({url:this.getUrl(),headers:nt(i,t??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders)),body:{values:e,...o?{providerOptions:o}:{}},successfulResponseHandler:at(H4),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:c=>c}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:l.embeddings,usage:(r=l.usage)!=null?r:void 0,providerMetadata:l.providerMetadata,response:{headers:s,body:u},warnings:[]}}catch(s){throw await xr(s,await _n(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"3","ai-model-id":this.modelId}}},H4=X(()=>Y(a.object({embeddings:a.array(a.array(a.number())),usage:a.object({tokens:a.number()}).nullish(),providerMetadata:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}))),J4=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:o,seed:r,files:i,mask:s,providerOptions:l,headers:u,abortSignal:c}){var d,m,_,h;let b=await ft(this.config.headers());try{let{responseHeaders:k,value:T,rawValue:R}=await vt({url:this.getUrl(),headers:nt(b,u??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...o&&{aspectRatio:o},...r&&{seed:r},...l&&{providerOptions:l},...i&&{files:i.map(g=>xP(g))},...s&&{mask:xP(s)}},successfulResponseHandler:at(Y4),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:g=>g}),...c&&{abortSignal:c},fetch:this.config.fetch});return{images:T.images,warnings:(d=T.warnings)!=null?d:[],providerMetadata:T.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:k},...T.usage!=null&&{usage:{inputTokens:(m=T.usage.inputTokens)!=null?m:void 0,outputTokens:(_=T.usage.outputTokens)!=null?_:void 0,totalTokens:(h=T.usage.totalTokens)!=null?h:void 0}}}}catch(k){throw await xr(k,await _n(b))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"3","ai-model-id":this.modelId}}};function xP(e){return e.type==="file"&&e.data instanceof Uint8Array?{...e,data:yn(e.data)}:e}var B4=a.object({images:a.array(a.unknown()).optional()}).catchall(a.unknown()),G4=a.discriminatedUnion("type",[a.object({type:a.literal("unsupported"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("compatibility"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("other"),message:a.string()})]),K4=a.object({inputTokens:a.number().nullish(),outputTokens:a.number().nullish(),totalTokens:a.number().nullish()}),Y4=a.object({images:a.array(a.string()),warnings:a.array(G4).optional(),providerMetadata:a.record(a.string(),B4).optional(),usage:K4.optional()}),X4=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,aspectRatio:n,resolution:o,duration:r,fps:i,seed:s,image:l,providerOptions:u,headers:c,abortSignal:d}){var m;let _=await ft(this.config.headers());try{let{responseHeaders:h,value:b}=await vt({url:this.getUrl(),headers:nt(_,c??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders),{accept:"text/event-stream"}),body:{prompt:e,n:t,...n&&{aspectRatio:n},...o&&{resolution:o},...r&&{duration:r},...i&&{fps:i},...s&&{seed:s},...u&&{providerOptions:u},...l&&{image:Q4(l)}},successfulResponseHandler:async({response:k,url:T,requestBodyValues:R})=>{if(k.body==null)throw new Je({message:"SSE response body is empty",url:T,requestBodyValues:R,statusCode:k.status});let v=Rv({stream:k.body,schema:nL}).getReader(),{done:C,value:O}=await v.read();if(v.releaseLock(),C||!O)throw new Je({message:"SSE stream ended without a data event",url:T,requestBodyValues:R,statusCode:k.status});if(!O.success)throw new Je({message:"Failed to parse video SSE event",cause:O.error,url:T,requestBodyValues:R,statusCode:k.status});let N=O.value;if(N.type==="error")throw new Je({message:N.message,statusCode:N.statusCode,url:T,requestBodyValues:R,responseHeaders:Object.fromEntries([...k.headers]),responseBody:JSON.stringify(N),data:{error:{message:N.message,type:N.errorType,param:N.param}}});return{value:{videos:N.videos,warnings:N.warnings,providerMetadata:N.providerMetadata},responseHeaders:Object.fromEntries([...k.headers])}},failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:k=>k}),...d&&{abortSignal:d},fetch:this.config.fetch});return{videos:b.videos,warnings:(m=b.warnings)!=null?m:[],providerMetadata:b.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:h}}}catch(h){throw await xr(h,await _n(_))}}getUrl(){return`${this.config.baseURL}/video-model`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"3","ai-model-id":this.modelId}}};function Q4(e){return e.type==="file"&&e.data instanceof Uint8Array?{...e,data:yn(e.data)}:e}var eL=a.object({videos:a.array(a.unknown()).optional()}).catchall(a.unknown()),tL=a.union([a.object({type:a.literal("url"),url:a.string(),mediaType:a.string()}),a.object({type:a.literal("base64"),data:a.string(),mediaType:a.string()})]),rL=a.discriminatedUnion("type",[a.object({type:a.literal("unsupported"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("compatibility"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("other"),message:a.string()})]),nL=a.discriminatedUnion("type",[a.object({type:a.literal("result"),videos:a.array(tL),warnings:a.array(rL).optional(),providerMetadata:a.record(a.string(),eL).optional()}),a.object({type:a.literal("error"),message:a.string(),errorType:a.string(),statusCode:a.number(),param:a.unknown().nullable()})]),oL=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async doRerank({documents:e,query:t,topN:n,headers:o,abortSignal:r,providerOptions:i}){let s=await ft(this.config.headers());try{let{responseHeaders:l,value:u,rawValue:c}=await vt({url:this.getUrl(),headers:nt(s,o??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders)),body:{documents:e,query:t,...n!=null?{topN:n}:{},...i?{providerOptions:i}:{}},successfulResponseHandler:at(iL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:d=>d}),...r&&{abortSignal:r},fetch:this.config.fetch});return{ranking:u.ranking,providerMetadata:u.providerMetadata,response:{headers:l,body:c},warnings:[]}}catch(l){throw await xr(l,await _n(s))}}getUrl(){return`${this.config.baseURL}/reranking-model`}getModelConfigHeaders(){return{"ai-reranking-model-specification-version":"3","ai-model-id":this.modelId}}},iL=X(()=>Y(a.object({ranking:a.array(a.object({index:a.number(),relevanceScore:a.number()})),providerMetadata:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}))),aL=X(()=>Y(be.object({objective:be.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:be.array(be.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:be.enum(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:be.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:be.object({include_domains:be.array(be.string()).optional().describe("List of domains to include in search results."),exclude_domains:be.array(be.string()).optional().describe("List of domains to exclude from search results."),after_date:be.string().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:be.object({max_chars_per_result:be.number().optional().describe("Maximum characters per result."),max_chars_total:be.number().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:be.object({max_age_seconds:be.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),sL=X(()=>Y(be.union([be.object({searchId:be.string(),results:be.array(be.object({url:be.string(),title:be.string(),excerpt:be.string(),publishDate:be.string().nullable().optional(),relevanceScore:be.number().optional()}))}),be.object({error:be.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:be.number().optional(),message:be.string()})]))),lL=St({id:"gateway.parallel_search",inputSchema:aL,outputSchema:sL}),uL=(e={})=>lL(e),cL=X(()=>Y(be.object({query:be.union([be.string(),be.array(be.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:be.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:be.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:be.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:be.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:be.array(be.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:be.array(be.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:be.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:be.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:be.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:be.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:be.enum(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),dL=X(()=>Y(be.union([be.object({results:be.array(be.object({title:be.string(),url:be.string(),snippet:be.string(),date:be.string().optional(),lastUpdated:be.string().optional()})),id:be.string()}),be.object({error:be.enum(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:be.number().optional(),message:be.string()})]))),pL=St({id:"gateway.perplexity_search",inputSchema:cL,outputSchema:dL}),fL=(e={})=>pL(e),mL={parallelSearch:uL,perplexitySearch:fL};async function hL(){var e;return(e=(0,jP.getContext)().headers)==null?void 0:e["x-vercel-id"]}var gL="3.0.125",vL="0.0.1";function yL(e={}){var t,n;let o=null,r=null,i=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,s=0,l=(n=Zc(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v3/ai",u=async()=>{try{let g=await _L(e);return nn({Authorization:`Bearer ${g.token}`,"ai-gateway-protocol-version":vL,[DP]:g.authMethod,...e.headers},`ai-sdk/gateway/${gL}`)}catch(g){throw Bc.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:g})}},c=()=>{let g=mo({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),v=mo({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),C=mo({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),O=mo({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{let N=await hL();return{...g&&{"ai-o11y-deployment-id":g},...v&&{"ai-o11y-environment":v},...C&&{"ai-o11y-region":C},...N&&{"ai-o11y-request-id":N},...O&&{"ai-o11y-project-id":O}}}},d=g=>new V4(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()}),m=async()=>{var g,v,C;let O=(C=(v=(g=e._internal)==null?void 0:g.currentDate)==null?void 0:v.call(g).getTime())!=null?C:Date.now();return(!o||O-s>i)&&(s=O,o=new wP({baseURL:l,headers:u,fetch:e.fetch}).getAvailableModels().then(N=>(r=N,N)).catch(async N=>{throw await xr(N,await _n(await u()))})),r?Promise.resolve(r):o},_=async()=>new wP({baseURL:l,headers:u,fetch:e.fetch}).getCredits().catch(async g=>{throw await xr(g,await _n(await u()))}),h=async g=>new U4({baseURL:l,headers:u,fetch:e.fetch}).getSpendReport(g).catch(async v=>{throw await xr(v,await _n(await u()))}),b=async g=>new F4({baseURL:l,headers:u,fetch:e.fetch}).getGenerationInfo(g).catch(async v=>{throw await xr(v,await _n(await u()))}),k=function(g){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(g)};k.specificationVersion="v3",k.getAvailableModels=m,k.getCredits=_,k.getSpendReport=h,k.getGenerationInfo=b,k.imageModel=g=>new J4(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()}),k.languageModel=d;let T=g=>new W4(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()});k.embeddingModel=T,k.textEmbeddingModel=T,k.videoModel=g=>new X4(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()});let R=g=>new oL(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()});return k.rerankingModel=R,k.reranking=R,k.chat=k.languageModel,k.embedding=k.embeddingModel,k.image=k.imageModel,k.video=k.videoModel,k.tools=mL,k}var MP=yL();async function _L(e){let t=mo({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await(0,NP.getVercelOidcToken)(),authMethod:"oidc"}}var AP=typeof globalThis=="object"?globalThis:global;var Un="1.9.0";var zP=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function bL(e){var t=new Set([e]),n=new Set,o=e.match(zP);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(u){return u===e};function i(l){return n.add(l),!1}function s(l){return t.add(l),!0}return function(u){if(t.has(u))return!0;if(n.has(u))return!1;var c=u.match(zP);if(!c)return i(u);var d={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return d.prerelease!=null||r.major!==d.major?i(u):r.major===0?r.minor===d.minor&&r.patch<=d.patch?s(u):i(u):r.minor<=d.minor?s(u):i(u)}}var qP=bL(Un);var wL=Un.split(".")[0],Hs=Symbol.for("opentelemetry.js.api."+wL),Js=AP;function fa(e,t,n,o){var r;o===void 0&&(o=!1);var i=Js[Hs]=(r=Js[Hs])!==null&&r!==void 0?r:{version:Un};if(!o&&i[e]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(s.stack||s.message),!1}if(i.version!==Un){var s=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+Un);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Un+"."),!0}function Ln(e){var t,n,o=(t=Js[Hs])===null||t===void 0?void 0:t.version;if(!(!o||!qP(o)))return(n=Js[Hs])===null||n===void 0?void 0:n[e]}function ma(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Un+".");var n=Js[Hs];n&&delete n[e]}var xL=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],s;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},kL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;oar.ALL&&(e=ar.ALL),t=t||{};function n(o,r){var i=t[o];return typeof i=="function"&&e>=r?i.bind(t):function(){}}return{error:n("error",ar.ERROR),warn:n("warn",ar.WARN),info:n("info",ar.INFO),debug:n("debug",ar.DEBUG),verbose:n("verbose",ar.VERBOSE)}}var SL=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],s;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},IL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o";d.warn("Current logger will be overwritten from "+_),m.warn("Current logger will overwrite one already registered from "+_)}return fa("diag",m,n,!0)};n.setLogger=o,n.disable=function(){ma(TL,n)},n.createComponentLogger=function(r){return new UP(r)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function FP(e){return Symbol.for(e)}var $L=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var i=new e(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=function(o){var r=new e(n._currentContext);return r._currentContext.delete(o),r}}return e})(),ZP=new $L;var PL=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],s;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},EL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},RL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o{for(var n in t)LL(e,n,{get:t[n],enumerable:!0})},pE="AI_InvalidArgumentError",fE=`vercel.ai.error.${pE}`,ZL=Symbol.for(fE),mE,bn=class extends _e{constructor({parameter:e,value:t,message:n}){super({name:pE,message:`Invalid argument for parameter ${e}: ${n}`}),this[mE]=!0,this.parameter=e,this.value=t}static isInstance(e){return _e.hasMarker(e,fE)}};mE=ZL;var VL="AI_InvalidStreamPartError",WL=`vercel.ai.error.${VL}`,HL=Symbol.for(WL),JL;JL=HL;var hE="AI_InvalidToolApprovalError",gE=`vercel.ai.error.${hE}`,BL=Symbol.for(gE),vE,GL=class extends _e{constructor({approvalId:e}){super({name:hE,message:`Tool approval response references unknown approvalId: "${e}". No matching tool-approval-request found in message history.`}),this[vE]=!0,this.approvalId=e}static isInstance(e){return _e.hasMarker(e,gE)}};vE=BL;var yE="AI_InvalidToolInputError",_E=`vercel.ai.error.${yE}`,KL=Symbol.for(_E),bE,by=class extends _e{constructor({toolInput:e,toolName:t,cause:n,message:o=`Invalid input for tool ${t}: ${oo(n)}`}){super({name:yE,message:o,cause:n}),this[bE]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return _e.hasMarker(e,_E)}};bE=KL;var wE="AI_ToolCallNotFoundForApprovalError",xE=`vercel.ai.error.${wE}`,YL=Symbol.for(xE),kE,SE=class extends _e{constructor({toolCallId:e,approvalId:t}){super({name:wE,message:`Tool call "${e}" not found for approval request "${t}".`}),this[kE]=!0,this.toolCallId=e,this.approvalId=t}static isInstance(e){return _e.hasMarker(e,xE)}};kE=YL;var IE="AI_MissingToolResultsError",TE=`vercel.ai.error.${IE}`,XL=Symbol.for(TE),$E,QP=class extends _e{constructor({toolCallIds:e}){super({name:IE,message:`Tool result${e.length>1?"s are":" is"} missing for tool call${e.length>1?"s":""} ${e.join(", ")}.`}),this[$E]=!0,this.toolCallIds=e}static isInstance(e){return _e.hasMarker(e,TE)}};$E=XL;var QL="AI_NoImageGeneratedError",eF=`vercel.ai.error.${QL}`,tF=Symbol.for(eF),rF;rF=tF;var PE="AI_NoObjectGeneratedError",EE=`vercel.ai.error.${PE}`,nF=Symbol.for(EE),CE,yo=class extends _e{constructor({message:e="No object generated.",cause:t,text:n,response:o,usage:r,finishReason:i}){super({name:PE,message:e,cause:t}),this[CE]=!0,this.text=n,this.response=o,this.usage=r,this.finishReason=i}static isInstance(e){return _e.hasMarker(e,EE)}};CE=nF;var RE="AI_NoOutputGeneratedError",OE=`vercel.ai.error.${RE}`,oF=Symbol.for(OE),DE,iF=class extends _e{constructor({message:e="No output generated.",cause:t}={}){super({name:RE,message:e,cause:t}),this[DE]=!0}static isInstance(e){return _e.hasMarker(e,OE)}};DE=oF;var aF="AI_NoSpeechGeneratedError",sF=`vercel.ai.error.${aF}`,lF=Symbol.for(sF),uF;uF=lF;var cF="AI_NoTranscriptGeneratedError",dF=`vercel.ai.error.${cF}`,pF=Symbol.for(dF),fF;fF=pF;var mF="AI_NoVideoGeneratedError",hF=`vercel.ai.error.${mF}`,gF=Symbol.for(hF),vF;vF=gF;var jE="AI_NoSuchToolError",NE=`vercel.ai.error.${jE}`,yF=Symbol.for(NE),ME,gy=class extends _e{constructor({toolName:e,availableTools:t=void 0,message:n=`Model tried to call unavailable tool '${e}'. ${t===void 0?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:jE,message:n}),this[ME]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return _e.hasMarker(e,NE)}};ME=yF;var AE="AI_ToolCallRepairError",zE=`vercel.ai.error.${AE}`,_F=Symbol.for(zE),qE,bF=class extends _e{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${oo(e)}`}){super({name:AE,message:n,cause:e}),this[qE]=!0,this.originalError=t}static isInstance(e){return _e.hasMarker(e,zE)}};qE=_F;var wF=class extends _e{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},xF="AI_UIMessageStreamError",kF=`vercel.ai.error.${xF}`,SF=Symbol.for(kF),IF;IF=SF;var TF="AI_InvalidDataContentError",$F=`vercel.ai.error.${TF}`,PF=Symbol.for($F),EF;EF=PF;var UE="AI_InvalidMessageRoleError",LE=`vercel.ai.error.${UE}`,CF=Symbol.for(LE),FE,RF=class extends _e{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:UE,message:t}),this[FE]=!0,this.role=e}static isInstance(e){return _e.hasMarker(e,LE)}};FE=CF;var OF="AI_MessageConversionError",DF=`vercel.ai.error.${OF}`,jF=Symbol.for(DF),NF;NF=jF;var ZE="AI_RetryError",VE=`vercel.ai.error.${ZE}`,MF=Symbol.for(VE),WE,eE=class extends _e{constructor({message:e,reason:t,errors:n}){super({name:ZE,message:e}),this[WE]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return _e.hasMarker(e,VE)}};WE=MF;function Ys(e){return e===void 0?[]:Array.isArray(e)?e:[e]}async function ui(e){for(let t of Ys(e.callbacks))if(t!=null)try{await t(e.event)}catch{}}function AF({warning:e,provider:t,model:n}){let o=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let r=`${o} The feature "${e.feature}" is not supported.`;return e.details&&(r+=` ${e.details}`),r}case"compatibility":{let r=`${o} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(r+=` ${e.details}`),r}case"other":return`${o} ${e.message}`;default:return`${o} ${JSON.stringify(e,null,2)}`}}var zF="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",tE=!1,HE=e=>{if(e.warnings.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}tE||(tE=!0,console.info(zF));for(let n of e.warnings)console.warn(AF({warning:n,provider:e.provider,model:e.model}))}};function qF({provider:e,modelId:t}){HE({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}function UF(e){return e.specificationVersion==="v3"?e:(qF({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get(t,n){switch(n){case"specificationVersion":return"v3";case"doGenerate":return async(...o)=>{let r=await t.doGenerate(...o);return{...r,finishReason:JE(r.finishReason),usage:BE(r.usage)}};case"doStream":return async(...o)=>{let r=await t.doStream(...o);return{...r,stream:LF(r.stream)}};default:return t[n]}}}))}function LF(e){return e.pipeThrough(new TransformStream({transform(t,n){switch(t.type){case"finish":n.enqueue({...t,finishReason:JE(t.finishReason),usage:BE(t.usage)});break;default:n.enqueue(t);break}}}))}function JE(e){return{unified:e==="unknown"?"other":e,raw:void 0}}function BE(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function rE(e){if(typeof e!="string"){if(e.specificationVersion!=="v3"&&e.specificationVersion!=="v2"){let t=e;throw new wF({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return UF(e)}return FF().languageModel(e)}function FF(){var e;return(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:MP}function GE(e){if(e!=null)return typeof e=="number"?e:e.totalMs}function ZF(e){if(!(e==null||typeof e=="number"))return e.stepMs}var VF=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}];var WF=e=>{let t=typeof e=="string"?rn(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function HF(e){return typeof e=="string"&&e.startsWith("SUQz")||typeof e!="string"&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?WF(e):e}function JF({data:e,signatures:t}){let n=HF(e),o=typeof n=="string"?rn(n.substring(0,Math.min(n.length,24))):n;for(let r of t)if(o.length>=r.bytesPrefix.length&&r.bytesPrefix.every((i,s)=>i===null||o[s]===i))return r.mediaType}var KE="6.0.197",YE=async({url:e,maxBytes:t,abortSignal:n})=>{var o;let r=e.toString();qs(r);try{let i=await fetch(r,{headers:nn({},`ai-sdk/${KE}`,Uc()),signal:n});if(i.redirected&&qs(i.url),!i.ok)throw new ir({url:r,statusCode:i.status,statusText:i.statusText});return{data:await Sv({response:i,url:r,maxBytes:t??zc}),mediaType:(o=i.headers.get("content-type"))!=null?o:void 0}}catch(i){throw ir.isInstance(i)?i:new ir({url:r,cause:i})}},BF=(e=YE)=>t=>Promise.all(t.map(async n=>n.isUrlSupportedByModel?null:e(n)));function GF(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch{return{mediaType:void 0,base64Content:void 0}}}var XE=a.union([a.string(),a.instanceof(Uint8Array),a.instanceof(ArrayBuffer),a.custom(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function wy(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if(typeof e=="string")try{e=new URL(e)}catch{}if(e instanceof URL&&e.protocol==="data:"){let{mediaType:t,base64Content:n}=GF(e.toString());if(t==null||n==null)throw new _e({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function vy(e){return typeof e=="string"?e:e instanceof ArrayBuffer?yn(new Uint8Array(e)):yn(e)}async function KF({prompt:e,supportedUrls:t,download:n=BF()}){let o=await XF(e.messages,n,t),r=new Map;for(let c of e.messages)if(c.role==="assistant"&&Array.isArray(c.content))for(let d of c.content)d.type==="tool-approval-request"&&"approvalId"in d&&"toolCallId"in d&&r.set(d.approvalId,d.toolCallId);let i=new Set;for(let c of e.messages)if(c.role==="tool"){for(let d of c.content)if(d.type==="tool-approval-response"){let m=r.get(d.approvalId);m&&i.add(m)}}let s=[...e.system!=null?typeof e.system=="string"?[{role:"system",content:e.system}]:Ys(e.system).map(c=>({role:"system",content:c.content,providerOptions:c.providerOptions})):[],...e.messages.map(c=>YF({message:c,downloadedAssets:o}))],l=[];for(let c of s){if(c.role!=="tool"){l.push(c);continue}let d=l.at(-1);d?.role==="tool"?d.content.push(...c.content):l.push(c)}let u=new Set;for(let c of l)switch(c.role){case"assistant":{for(let d of c.content)d.type==="tool-call"&&!d.providerExecuted&&u.add(d.toolCallId);break}case"tool":{for(let d of c.content)d.type==="tool-result"&&u.delete(d.toolCallId);break}case"user":case"system":for(let d of i)u.delete(d);if(u.size>0)throw new QP({toolCallIds:Array.from(u)});break}for(let c of i)u.delete(c);if(u.size>0)throw new QP({toolCallIds:Array.from(u)});return l.filter(c=>c.role!=="tool"||c.content.length>0)}function YF({message:e,downloadedAssets:t}){let n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return typeof e.content=="string"?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map(o=>QF(o,t)).filter(o=>o.type!=="text"||o.text!==""),providerOptions:e.providerOptions};case"assistant":return typeof e.content=="string"?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter(o=>o.type!=="text"||o.text!==""||o.providerOptions!=null).filter(o=>o.type!=="tool-approval-request").map(o=>{let r=o.providerOptions;switch(o.type){case"file":{let{data:i,mediaType:s}=wy(o.data);return{type:"file",data:i,filename:o.filename,mediaType:s??o.mediaType,providerOptions:r}}case"reasoning":return{type:"reasoning",text:o.text,providerOptions:r};case"text":return{type:"text",text:o.text,providerOptions:r};case"tool-call":return{type:"tool-call",toolCallId:o.toolCallId,toolName:o.toolName,input:o.input,providerExecuted:o.providerExecuted,providerOptions:r};case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:nE({output:o.output,downloadedAssets:t}),providerOptions:r}}}),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.filter(o=>o.type!=="tool-approval-response"||o.providerExecuted).map(o=>{switch(o.type){case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:nE({output:o.output,downloadedAssets:t}),providerOptions:o.providerOptions};case"tool-approval-response":return{type:"tool-approval-response",approvalId:o.approvalId,approved:o.approved,reason:o.reason}}}),providerOptions:e.providerOptions};default:{let o=n;throw new RF({role:o})}}}async function XF(e,t,n){var o;let r=[];for(let l of e){if(l.role==="user"&&Array.isArray(l.content))for(let u of l.content)(u.type==="image"||u.type==="file")&&r.push({data:u.type==="image"?u.image:u.data,mediaType:(o=u.mediaType)!=null?o:u.type==="image"?"image/*":void 0});if(l.role==="tool"||l.role==="assistant"){if(!Array.isArray(l.content))continue;for(let u of l.content)if(u.type==="tool-result"&&u.output.type==="content")for(let c of u.output.value)(c.type==="image-url"||c.type==="file-url")&&r.push({data:new URL(c.url),mediaType:c.type==="image-url"?"image/*":void 0})}}let i=r.map(l=>{let u=l.mediaType,{data:c}=wy(l.data);return{mediaType:u,data:c}}).filter(l=>l.data instanceof URL).map(l=>({url:l.data,isUrlSupportedByModel:l.mediaType!=null&&E0({url:l.data.toString(),mediaType:l.mediaType,supportedUrls:n})})),s=await t(i);return Object.fromEntries(s.map((l,u)=>l==null?null:[i[u].url.toString(),{data:l.data,mediaType:l.mediaType}]).filter(l=>l!=null))}function QF(e,t){var n;if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};let o,r=e.type;switch(r){case"image":o=e.image;break;case"file":o=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}let{data:i,mediaType:s}=wy(o),l=s??e.mediaType,u=i;if(u instanceof URL){let c=t[u.toString()];c&&(u=c.data,l??(l=c.mediaType))}switch(r){case"image":return(u instanceof Uint8Array||typeof u=="string")&&(l=(n=JF({data:u,signatures:VF}))!=null?n:l),{type:"file",mediaType:l??"image/*",filename:void 0,data:u,providerOptions:e.providerOptions};case"file":{if(l==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:l,filename:e.filename,data:u,providerOptions:e.providerOptions}}}}function nE({output:e,downloadedAssets:t}){return e.type!=="content"?e:{type:"content",value:e.value.map(n=>{var o,r;if(n.type==="image-url"){let i=t[new URL(n.url).toString()];return i?{type:"image-data",data:vy(i.data),mediaType:(o=i.mediaType)!=null?o:"image/*",providerOptions:n.providerOptions}:n}if(n.type==="file-url"){let i=t[new URL(n.url).toString()];return i?{type:"file-data",data:vy(i.data),mediaType:(r=i.mediaType)!=null?r:"application/octet-stream",providerOptions:n.providerOptions}:n}return n.type!=="media"?n:n.mediaType.startsWith("image/")?{type:"image-data",data:n.data,mediaType:n.mediaType}:{type:"file-data",data:n.data,mediaType:n.mediaType}})}}async function rd({toolCallId:e,input:t,output:n,tool:o,errorMode:r}){return r==="text"?{type:"error-text",value:oo(n)}:r==="json"?{type:"error-json",value:oE(n)}:o?.toModelOutput?await o.toModelOutput({toolCallId:e,input:t,output:n}):typeof n=="string"?{type:"text",value:n}:{type:"json",value:oE(n)}}function oE(e){return e===void 0?null:e}function iE({maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,seed:s,stopSequences:l}){if(e!=null){if(!Number.isInteger(e))throw new bn({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new bn({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new bn({parameter:"temperature",value:t,message:"temperature must be a number"});if(n!=null&&typeof n!="number")throw new bn({parameter:"topP",value:n,message:"topP must be a number"});if(o!=null&&typeof o!="number")throw new bn({parameter:"topK",value:o,message:"topK must be a number"});if(r!=null&&typeof r!="number")throw new bn({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(i!=null&&typeof i!="number")throw new bn({parameter:"frequencyPenalty",value:i,message:"frequencyPenalty must be a number"});if(s!=null&&!Number.isInteger(s))throw new bn({parameter:"seed",value:s,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,stopSequences:l,seed:s}}function e2(e){return e!=null&&Object.keys(e).length>0}async function t2({tools:e,toolChoice:t,activeTools:n}){if(!e2(e))return{tools:void 0,toolChoice:void 0};let o=n!=null?Object.entries(e).filter(([i])=>n.includes(i)):Object.entries(e),r=[];for(let[i,s]of o){let l=s.type;switch(l){case void 0:case"dynamic":case"function":r.push({type:"function",name:i,description:s.description,inputSchema:await qn(s.inputSchema).jsonSchema,...s.inputExamples!=null?{inputExamples:s.inputExamples}:{},providerOptions:s.providerOptions,...s.strict!=null?{strict:s.strict}:{}});break;case"provider":r.push({type:"provider",name:i,id:s.id,args:s.args});break;default:{let u=l;throw new Error(`Unsupported tool type: ${u}`)}}}return{tools:r,toolChoice:t==null?{type:"auto"}:typeof t=="string"?{type:t}:{type:"tool",toolName:t.toolName}}}var ci=a.lazy(()=>a.union([a.null(),a.string(),a.number(),a.boolean(),a.record(a.string(),ci.optional()),a.array(ci)])),Se=a.record(a.string(),a.record(a.string(),ci.optional())),QE=a.object({type:a.literal("text"),text:a.string(),providerOptions:Se.optional()}),r2=a.object({type:a.literal("image"),image:a.union([XE,a.instanceof(URL)]),mediaType:a.string().optional(),providerOptions:Se.optional()}),eC=a.object({type:a.literal("file"),data:a.union([XE,a.instanceof(URL)]),filename:a.string().optional(),mediaType:a.string(),providerOptions:Se.optional()}),n2=a.object({type:a.literal("reasoning"),text:a.string(),providerOptions:Se.optional()}),o2=a.object({type:a.literal("tool-call"),toolCallId:a.string(),toolName:a.string(),input:a.unknown(),providerOptions:Se.optional(),providerExecuted:a.boolean().optional()}),i2=a.discriminatedUnion("type",[a.object({type:a.literal("text"),value:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("json"),value:ci,providerOptions:Se.optional()}),a.object({type:a.literal("execution-denied"),reason:a.string().optional(),providerOptions:Se.optional()}),a.object({type:a.literal("error-text"),value:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("error-json"),value:ci,providerOptions:Se.optional()}),a.object({type:a.literal("content"),value:a.array(a.union([a.object({type:a.literal("text"),text:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("media"),data:a.string(),mediaType:a.string()}),a.object({type:a.literal("file-data"),data:a.string(),mediaType:a.string(),filename:a.string().optional(),providerOptions:Se.optional()}),a.object({type:a.literal("file-url"),url:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("file-id"),fileId:a.union([a.string(),a.record(a.string(),a.string())]),providerOptions:Se.optional()}),a.object({type:a.literal("image-data"),data:a.string(),mediaType:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("image-url"),url:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("image-file-id"),fileId:a.union([a.string(),a.record(a.string(),a.string())]),providerOptions:Se.optional()}),a.object({type:a.literal("custom"),providerOptions:Se.optional()})]))})]),tC=a.object({type:a.literal("tool-result"),toolCallId:a.string(),toolName:a.string(),output:i2,providerOptions:Se.optional()}),a2=a.object({type:a.literal("tool-approval-request"),approvalId:a.string(),toolCallId:a.string()}),s2=a.object({type:a.literal("tool-approval-response"),approvalId:a.string(),approved:a.boolean(),reason:a.string().optional()}),l2=a.object({role:a.literal("system"),content:a.string(),providerOptions:Se.optional()}),u2=a.object({role:a.literal("user"),content:a.union([a.string(),a.array(a.union([QE,r2,eC]))]),providerOptions:Se.optional()}),c2=a.object({role:a.literal("assistant"),content:a.union([a.string(),a.array(a.union([QE,eC,n2,o2,tC,a2]))]),providerOptions:Se.optional()}),d2=a.object({role:a.literal("tool"),content:a.array(a.union([tC,s2])),providerOptions:Se.optional()}),p2=a.union([l2,u2,c2,d2]);async function f2({allowSystemInMessages:e,system:t,prompt:n,messages:o}){if(n==null&&o==null)throw new pn({prompt:n,message:"prompt or messages must be defined"});if(n!=null&&o!=null)throw new pn({prompt:n,message:"prompt and messages cannot be defined at the same time"});if(typeof t!="string"&&!Ys(t).every(i=>i.role==="system"))throw new pn({prompt:n,message:"system must be a string, SystemModelMessage, or array of SystemModelMessage"});if(n!=null&&typeof n=="string")o=[{role:"user",content:n}];else if(n!=null&&Array.isArray(n))o=n;else if(o==null)throw new pn({prompt:n,message:"prompt or messages must be defined"});if(o.length===0)throw new pn({prompt:n,message:"messages must not be empty"});if(o.some(i=>i.role==="system")){if(e===!1)throw new pn({prompt:n,message:"System messages are not allowed in the prompt or messages fields. Use the system option instead."});e===void 0&&console.warn("AI SDK Warning: System messages in the prompt or messages fields can be a security risk because they may enable prompt injection attacks. Use the system option instead when possible. Set allowSystemInMessages to true to suppress this warning, or false to throw an error.")}let r=await Xt({value:o,schema:a.array(p2)});if(!r.success)throw new pn({prompt:n,message:"The messages do not match the ModelMessage[] schema.",cause:r.error});return{messages:o,system:t}}function m2(e){if(!Bc.isInstance(e))return e;let t=(process==null?void 0:process.env.NODE_ENV)==="production",n="https://ai-sdk.dev/unauthenticated-ai-gateway";return t?new _e({name:"GatewayError",message:`Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${n}`}):Object.assign(new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m + This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`;return new GP({message:i,statusCode:n,cause:o,generationId:r})}};function AP(e){if(!(e instanceof Error))return!1;let t=e.code;return typeof t=="string"?["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t):!1}async function xr(e,t){var n;return Ht.isInstance(e)?e:AP(e)?MP.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):Je.isInstance(e)?e.cause&&AP(e.cause)?MP.createTimeoutError({originalMessage:e.message,cause:e}):await OP({response:nL(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await OP({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var KP="ai-gateway-auth-method";async function bn(e){let t=await Qt({value:e[KP],schema:iL});return t.success?t.value:void 0}var iL=X(()=>Y(a.union([a.literal("api-key"),a.literal("oidc")]))),aL=["embedding","image","language","reranking","video"],zP=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await si({url:`${this.config.baseURL}/config`,headers:await ft(this.config.headers()),successfulResponseHandler:it(sL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:t=>t}),fetch:this.config.fetch});return e}catch(e){throw await xr(e)}}async getCredits(){try{let e=new URL(this.config.baseURL),{value:t}=await si({url:`${e.origin}/v1/credits`,headers:await ft(this.config.headers()),successfulResponseHandler:it(lL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:n=>n}),fetch:this.config.fetch});return t}catch(e){throw await xr(e)}}},sL=X(()=>Y(a.object({models:a.array(a.object({id:a.string(),name:a.string(),description:a.string().nullish(),pricing:a.object({input:a.string(),output:a.string(),input_cache_read:a.string().nullish(),input_cache_write:a.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:o})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...o?{cacheCreationInputTokens:o}:{}})).nullish(),specification:a.object({specificationVersion:a.literal("v3"),provider:a.string(),modelId:a.string()}),modelType:a.string().nullish()})).transform(e=>e.filter(t=>t.modelType==null||aL.includes(t.modelType)))}))),lL=X(()=>Y(a.object({balance:a.string(),total_used:a.string()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),uL=class{constructor(e){this.config=e}async getSpendReport(e){try{let t=new URL(this.config.baseURL),n=new URLSearchParams;n.set("start_date",e.startDate),n.set("end_date",e.endDate),e.groupBy&&n.set("group_by",e.groupBy),e.datePart&&n.set("date_part",e.datePart),e.userId&&n.set("user_id",e.userId),e.model&&n.set("model",e.model),e.provider&&n.set("provider",e.provider),e.credentialType&&n.set("credential_type",e.credentialType),e.tags&&e.tags.length>0&&n.set("tags",e.tags.join(","));let{value:o}=await si({url:`${t.origin}/v1/report?${n.toString()}`,headers:await ft(this.config.headers()),successfulResponseHandler:it(cL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:r=>r}),fetch:this.config.fetch});return o}catch(t){throw await xr(t)}}},cL=X(()=>Y(a.object({results:a.array(a.object({day:a.string().optional(),hour:a.string().optional(),user:a.string().optional(),model:a.string().optional(),tag:a.string().optional(),provider:a.string().optional(),credential_type:a.enum(["byok","system"]).optional(),total_cost:a.number(),market_cost:a.number().optional(),input_tokens:a.number().optional(),output_tokens:a.number().optional(),cached_input_tokens:a.number().optional(),cache_creation_input_tokens:a.number().optional(),reasoning_tokens:a.number().optional(),request_count:a.number().optional()}).transform(({credential_type:e,total_cost:t,market_cost:n,input_tokens:o,output_tokens:r,cached_input_tokens:i,cache_creation_input_tokens:s,reasoning_tokens:l,request_count:u,...c})=>({...c,...e!==void 0?{credentialType:e}:{},totalCost:t,...n!==void 0?{marketCost:n}:{},...o!==void 0?{inputTokens:o}:{},...r!==void 0?{outputTokens:r}:{},...i!==void 0?{cachedInputTokens:i}:{},...s!==void 0?{cacheCreationInputTokens:s}:{},...l!==void 0?{reasoningTokens:l}:{},...u!==void 0?{requestCount:u}:{}})))}))),dL=class{constructor(e){this.config=e}async getGenerationInfo(e){try{let t=new URL(this.config.baseURL),{value:n}=await si({url:`${t.origin}/v1/generation?id=${encodeURIComponent(e.id)}`,headers:await ft(this.config.headers()),successfulResponseHandler:it(pL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:o=>o}),fetch:this.config.fetch});return n}catch(t){throw await xr(t)}}},pL=X(()=>Y(a.object({data:a.object({id:a.string(),total_cost:a.number(),upstream_inference_cost:a.number(),usage:a.number(),created_at:a.string(),model:a.string(),is_byok:a.boolean(),provider_name:a.string(),streamed:a.boolean(),finish_reason:a.string(),latency:a.number(),generation_time:a.number(),native_tokens_prompt:a.number(),native_tokens_completion:a.number(),native_tokens_reasoning:a.number(),native_tokens_cached:a.number(),native_tokens_cache_creation:a.number(),billable_web_search_calls:a.number()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:n,is_byok:o,provider_name:r,finish_reason:i,generation_time:s,native_tokens_prompt:l,native_tokens_completion:u,native_tokens_reasoning:c,native_tokens_cached:d,native_tokens_cache_creation:m,billable_web_search_calls:_,...h})=>({...h,totalCost:e,upstreamInferenceCost:t,createdAt:n,isByok:o,providerName:r,finishReason:i,generationTime:s,promptTokens:l,completionTokens:u,reasoningTokens:c,cachedTokens:d,cacheCreationTokens:m,billableWebSearchCalls:_}))}).transform(({data:e})=>e))),fL=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await ft(this.config.headers());try{let{responseHeaders:i,value:s,rawValue:l}=await vt({url:this.getUrl(),headers:nt(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await ft(this.config.o11yHeaders)),body:t,successfulResponseHandler:it(a.any()),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:u=>u}),...o&&{abortSignal:o},fetch:this.config.fetch});return{...s,request:{body:t},response:{headers:i,body:l},warnings:n}}catch(i){throw await xr(i,await bn(r))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await ft(this.config.headers());try{let{value:i,responseHeaders:s}=await vt({url:this.getUrl(),headers:nt(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await ft(this.config.o11yHeaders)),body:t,successfulResponseHandler:vo(a.any()),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:l=>l}),...o&&{abortSignal:o},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(l){n.length>0&&l.enqueue({type:"stream-start",warnings:n})},transform(l,u){if(l.success){let c=l.value;if(c.type==="raw"&&!e.includeRawChunks)return;c.type==="response-metadata"&&c.timestamp&&typeof c.timestamp=="string"&&(c.timestamp=new Date(c.timestamp)),u.enqueue(c)}else u.error(l.error)}})),request:{body:t},response:{headers:s}}}catch(i){throw await xr(i,await bn(r))}}isFilePart(e){return e&&typeof e=="object"&&"type"in e&&e.type==="file"}maybeEncodeFileParts(e){for(let t of e.prompt)for(let n of t.content)if(this.isFilePart(n)){let o=n;if(o.data instanceof Uint8Array){let r=Uint8Array.from(o.data),i=Buffer.from(r).toString("base64");o.data=new URL(`data:${o.mediaType||"application/octet-stream"};base64,${i}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"3","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},mL=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;let i=await ft(this.config.headers());try{let{responseHeaders:s,value:l,rawValue:u}=await vt({url:this.getUrl(),headers:nt(i,t??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders)),body:{values:e,...o?{providerOptions:o}:{}},successfulResponseHandler:it(hL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:c=>c}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:l.embeddings,usage:(r=l.usage)!=null?r:void 0,providerMetadata:l.providerMetadata,response:{headers:s,body:u},warnings:[]}}catch(s){throw await xr(s,await bn(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"3","ai-model-id":this.modelId}}},hL=X(()=>Y(a.object({embeddings:a.array(a.array(a.number())),usage:a.object({tokens:a.number()}).nullish(),providerMetadata:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}))),gL=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:o,seed:r,files:i,mask:s,providerOptions:l,headers:u,abortSignal:c}){var d,m,_,h;let b=await ft(this.config.headers());try{let{responseHeaders:k,value:I,rawValue:C}=await vt({url:this.getUrl(),headers:nt(b,u??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...o&&{aspectRatio:o},...r&&{seed:r},...l&&{providerOptions:l},...i&&{files:i.map(g=>qP(g))},...s&&{mask:qP(s)}},successfulResponseHandler:it(bL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:g=>g}),...c&&{abortSignal:c},fetch:this.config.fetch});return{images:I.images,warnings:(d=I.warnings)!=null?d:[],providerMetadata:I.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:k},...I.usage!=null&&{usage:{inputTokens:(m=I.usage.inputTokens)!=null?m:void 0,outputTokens:(_=I.usage.outputTokens)!=null?_:void 0,totalTokens:(h=I.usage.totalTokens)!=null?h:void 0}}}}catch(k){throw await xr(k,await bn(b))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"3","ai-model-id":this.modelId}}};function qP(e){return e.type==="file"&&e.data instanceof Uint8Array?{...e,data:_n(e.data)}:e}var vL=a.object({images:a.array(a.unknown()).optional()}).catchall(a.unknown()),yL=a.discriminatedUnion("type",[a.object({type:a.literal("unsupported"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("compatibility"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("other"),message:a.string()})]),_L=a.object({inputTokens:a.number().nullish(),outputTokens:a.number().nullish(),totalTokens:a.number().nullish()}),bL=a.object({images:a.array(a.string()),warnings:a.array(yL).optional(),providerMetadata:a.record(a.string(),vL).optional(),usage:_L.optional()}),wL=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,aspectRatio:n,resolution:o,duration:r,fps:i,seed:s,image:l,providerOptions:u,headers:c,abortSignal:d}){var m;let _=await ft(this.config.headers());try{let{responseHeaders:h,value:b}=await vt({url:this.getUrl(),headers:nt(_,c??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders),{accept:"text/event-stream"}),body:{prompt:e,n:t,...n&&{aspectRatio:n},...o&&{resolution:o},...r&&{duration:r},...i&&{fps:i},...s&&{seed:s},...u&&{providerOptions:u},...l&&{image:xL(l)}},successfulResponseHandler:async({response:k,url:I,requestBodyValues:C})=>{if(k.body==null)throw new Je({message:"SSE response body is empty",url:I,requestBodyValues:C,statusCode:k.status});let v=zv({stream:k.body,schema:IL}).getReader(),{done:R,value:O}=await v.read();if(v.releaseLock(),R||!O)throw new Je({message:"SSE stream ended without a data event",url:I,requestBodyValues:C,statusCode:k.status});if(!O.success)throw new Je({message:"Failed to parse video SSE event",cause:O.error,url:I,requestBodyValues:C,statusCode:k.status});let N=O.value;if(N.type==="error")throw new Je({message:N.message,statusCode:N.statusCode,url:I,requestBodyValues:C,responseHeaders:Object.fromEntries([...k.headers]),responseBody:JSON.stringify(N),data:{error:{message:N.message,type:N.errorType,param:N.param}}});return{value:{videos:N.videos,warnings:N.warnings,providerMetadata:N.providerMetadata},responseHeaders:Object.fromEntries([...k.headers])}},failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:k=>k}),...d&&{abortSignal:d},fetch:this.config.fetch});return{videos:b.videos,warnings:(m=b.warnings)!=null?m:[],providerMetadata:b.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:h}}}catch(h){throw await xr(h,await bn(_))}}getUrl(){return`${this.config.baseURL}/video-model`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"3","ai-model-id":this.modelId}}};function xL(e){return e.type==="file"&&e.data instanceof Uint8Array?{...e,data:_n(e.data)}:e}var kL=a.object({videos:a.array(a.unknown()).optional()}).catchall(a.unknown()),SL=a.union([a.object({type:a.literal("url"),url:a.string(),mediaType:a.string()}),a.object({type:a.literal("base64"),data:a.string(),mediaType:a.string()})]),TL=a.discriminatedUnion("type",[a.object({type:a.literal("unsupported"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("compatibility"),feature:a.string(),details:a.string().optional()}),a.object({type:a.literal("other"),message:a.string()})]),IL=a.discriminatedUnion("type",[a.object({type:a.literal("result"),videos:a.array(SL),warnings:a.array(TL).optional(),providerMetadata:a.record(a.string(),kL).optional()}),a.object({type:a.literal("error"),message:a.string(),errorType:a.string(),statusCode:a.number(),param:a.unknown().nullable()})]),$L=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async doRerank({documents:e,query:t,topN:n,headers:o,abortSignal:r,providerOptions:i}){let s=await ft(this.config.headers());try{let{responseHeaders:l,value:u,rawValue:c}=await vt({url:this.getUrl(),headers:nt(s,o??{},this.getModelConfigHeaders(),await ft(this.config.o11yHeaders)),body:{documents:e,query:t,...n!=null?{topN:n}:{},...i?{providerOptions:i}:{}},successfulResponseHandler:it(PL),failedResponseHandler:Nt({errorSchema:a.any(),errorToMessage:d=>d}),...r&&{abortSignal:r},fetch:this.config.fetch});return{ranking:u.ranking,providerMetadata:u.providerMetadata,response:{headers:l,body:c},warnings:[]}}catch(l){throw await xr(l,await bn(s))}}getUrl(){return`${this.config.baseURL}/reranking-model`}getModelConfigHeaders(){return{"ai-reranking-model-specification-version":"3","ai-model-id":this.modelId}}},PL=X(()=>Y(a.object({ranking:a.array(a.object({index:a.number(),relevanceScore:a.number()})),providerMetadata:a.record(a.string(),a.record(a.string(),a.unknown())).optional()}))),EL=X(()=>Y(be.object({objective:be.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:be.array(be.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:be.enum(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:be.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:be.object({include_domains:be.array(be.string()).optional().describe("List of domains to include in search results."),exclude_domains:be.array(be.string()).optional().describe("List of domains to exclude from search results."),after_date:be.string().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:be.object({max_chars_per_result:be.number().optional().describe("Maximum characters per result."),max_chars_total:be.number().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:be.object({max_age_seconds:be.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),RL=X(()=>Y(be.union([be.object({searchId:be.string(),results:be.array(be.object({url:be.string(),title:be.string(),excerpt:be.string(),publishDate:be.string().nullable().optional(),relevanceScore:be.number().optional()}))}),be.object({error:be.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:be.number().optional(),message:be.string()})]))),CL=St({id:"gateway.parallel_search",inputSchema:EL,outputSchema:RL}),OL=(e={})=>CL(e),DL=X(()=>Y(be.object({query:be.union([be.string(),be.array(be.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:be.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:be.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:be.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:be.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:be.array(be.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:be.array(be.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:be.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:be.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:be.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:be.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:be.enum(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),jL=X(()=>Y(be.union([be.object({results:be.array(be.object({title:be.string(),url:be.string(),snippet:be.string(),date:be.string().optional(),lastUpdated:be.string().optional()})),id:be.string()}),be.object({error:be.enum(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:be.number().optional(),message:be.string()})]))),NL=St({id:"gateway.perplexity_search",inputSchema:DL,outputSchema:jL}),ML=(e={})=>NL(e),AL={parallelSearch:OL,perplexitySearch:ML};async function zL(){var e;return(e=(0,YP.getContext)().headers)==null?void 0:e["x-vercel-id"]}var qL="3.0.125",UL="0.0.1";function LL(e={}){var t,n;let o=null,r=null,i=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,s=0,l=(n=Wc(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v3/ai",u=async()=>{try{let g=await FL(e);return on({Authorization:`Bearer ${g.token}`,"ai-gateway-protocol-version":UL,[KP]:g.authMethod,...e.headers},`ai-sdk/gateway/${qL}`)}catch(g){throw Kc.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:g})}},c=()=>{let g=go({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),v=go({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),R=go({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),O=go({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{let N=await zL();return{...g&&{"ai-o11y-deployment-id":g},...v&&{"ai-o11y-environment":v},...R&&{"ai-o11y-region":R},...N&&{"ai-o11y-request-id":N},...O&&{"ai-o11y-project-id":O}}}},d=g=>new fL(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()}),m=async()=>{var g,v,R;let O=(R=(v=(g=e._internal)==null?void 0:g.currentDate)==null?void 0:v.call(g).getTime())!=null?R:Date.now();return(!o||O-s>i)&&(s=O,o=new zP({baseURL:l,headers:u,fetch:e.fetch}).getAvailableModels().then(N=>(r=N,N)).catch(async N=>{throw await xr(N,await bn(await u()))})),r?Promise.resolve(r):o},_=async()=>new zP({baseURL:l,headers:u,fetch:e.fetch}).getCredits().catch(async g=>{throw await xr(g,await bn(await u()))}),h=async g=>new uL({baseURL:l,headers:u,fetch:e.fetch}).getSpendReport(g).catch(async v=>{throw await xr(v,await bn(await u()))}),b=async g=>new dL({baseURL:l,headers:u,fetch:e.fetch}).getGenerationInfo(g).catch(async v=>{throw await xr(v,await bn(await u()))}),k=function(g){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(g)};k.specificationVersion="v3",k.getAvailableModels=m,k.getCredits=_,k.getSpendReport=h,k.getGenerationInfo=b,k.imageModel=g=>new gL(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()}),k.languageModel=d;let I=g=>new mL(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()});k.embeddingModel=I,k.textEmbeddingModel=I,k.videoModel=g=>new wL(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()});let C=g=>new $L(g,{provider:"gateway",baseURL:l,headers:u,fetch:e.fetch,o11yHeaders:c()});return k.rerankingModel=C,k.reranking=C,k.chat=k.languageModel,k.embedding=k.embeddingModel,k.image=k.imageModel,k.video=k.videoModel,k.tools=AL,k}var QP=LL();async function FL(e){let t=go({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await(0,XP.getVercelOidcToken)(),authMethod:"oidc"}}var eE=typeof globalThis=="object"?globalThis:global;var Ln="1.9.0";var tE=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function ZL(e){var t=new Set([e]),n=new Set,o=e.match(tE);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(u){return u===e};function i(l){return n.add(l),!1}function s(l){return t.add(l),!0}return function(u){if(t.has(u))return!0;if(n.has(u))return!1;var c=u.match(tE);if(!c)return i(u);var d={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return d.prerelease!=null||r.major!==d.major?i(u):r.major===0?r.minor===d.minor&&r.patch<=d.patch?s(u):i(u):r.minor<=d.minor?s(u):i(u)}}var rE=ZL(Ln);var VL=Ln.split(".")[0],Hs=Symbol.for("opentelemetry.js.api."+VL),Js=eE;function ha(e,t,n,o){var r;o===void 0&&(o=!1);var i=Js[Hs]=(r=Js[Hs])!==null&&r!==void 0?r:{version:Ln};if(!o&&i[e]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(s.stack||s.message),!1}if(i.version!==Ln){var s=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+Ln);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Ln+"."),!0}function Fn(e){var t,n,o=(t=Js[Hs])===null||t===void 0?void 0:t.version;if(!(!o||!rE(o)))return(n=Js[Hs])===null||n===void 0?void 0:n[e]}function ga(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Ln+".");var n=Js[Hs];n&&delete n[e]}var WL=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],s;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},HL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;osr.ALL&&(e=sr.ALL),t=t||{};function n(o,r){var i=t[o];return typeof i=="function"&&e>=r?i.bind(t):function(){}}return{error:n("error",sr.ERROR),warn:n("warn",sr.WARN),info:n("info",sr.INFO),debug:n("debug",sr.DEBUG),verbose:n("verbose",sr.VERBOSE)}}var JL=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],s;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},BL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o";d.warn("Current logger will be overwritten from "+_),m.warn("Current logger will overwrite one already registered from "+_)}return ha("diag",m,n,!0)};n.setLogger=o,n.disable=function(){ga(GL,n)},n.createComponentLogger=function(r){return new nE(r)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function iE(e){return Symbol.for(e)}var KL=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var i=new e(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=function(o){var r=new e(n._currentContext);return r._currentContext.delete(o),r}}return e})(),aE=new KL;var YL=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],s;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},XL=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){s={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},eF=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o{for(var n in t)cF(e,n,{get:t[n],enumerable:!0})},EE="AI_InvalidArgumentError",RE=`vercel.ai.error.${EE}`,pF=Symbol.for(RE),CE,wn=class extends _e{constructor({parameter:e,value:t,message:n}){super({name:EE,message:`Invalid argument for parameter ${e}: ${n}`}),this[CE]=!0,this.parameter=e,this.value=t}static isInstance(e){return _e.hasMarker(e,RE)}};CE=pF;var fF="AI_InvalidStreamPartError",mF=`vercel.ai.error.${fF}`,hF=Symbol.for(mF),gF;gF=hF;var OE="AI_InvalidToolApprovalError",DE=`vercel.ai.error.${OE}`,vF=Symbol.for(DE),jE,yF=class extends _e{constructor({approvalId:e}){super({name:OE,message:`Tool approval response references unknown approvalId: "${e}". No matching tool-approval-request found in message history.`}),this[jE]=!0,this.approvalId=e}static isInstance(e){return _e.hasMarker(e,DE)}};jE=vF;var NE="AI_InvalidToolInputError",ME=`vercel.ai.error.${NE}`,_F=Symbol.for(ME),AE,$y=class extends _e{constructor({toolInput:e,toolName:t,cause:n,message:o=`Invalid input for tool ${t}: ${ao(n)}`}){super({name:NE,message:o,cause:n}),this[AE]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return _e.hasMarker(e,ME)}};AE=_F;var zE="AI_ToolCallNotFoundForApprovalError",qE=`vercel.ai.error.${zE}`,bF=Symbol.for(qE),UE,LE=class extends _e{constructor({toolCallId:e,approvalId:t}){super({name:zE,message:`Tool call "${e}" not found for approval request "${t}".`}),this[UE]=!0,this.toolCallId=e,this.approvalId=t}static isInstance(e){return _e.hasMarker(e,qE)}};UE=bF;var FE="AI_MissingToolResultsError",ZE=`vercel.ai.error.${FE}`,wF=Symbol.for(ZE),VE,gE=class extends _e{constructor({toolCallIds:e}){super({name:FE,message:`Tool result${e.length>1?"s are":" is"} missing for tool call${e.length>1?"s":""} ${e.join(", ")}.`}),this[VE]=!0,this.toolCallIds=e}static isInstance(e){return _e.hasMarker(e,ZE)}};VE=wF;var xF="AI_NoImageGeneratedError",kF=`vercel.ai.error.${xF}`,SF=Symbol.for(kF),TF;TF=SF;var WE="AI_NoObjectGeneratedError",HE=`vercel.ai.error.${WE}`,IF=Symbol.for(HE),JE,bo=class extends _e{constructor({message:e="No object generated.",cause:t,text:n,response:o,usage:r,finishReason:i}){super({name:WE,message:e,cause:t}),this[JE]=!0,this.text=n,this.response=o,this.usage=r,this.finishReason=i}static isInstance(e){return _e.hasMarker(e,HE)}};JE=IF;var BE="AI_NoOutputGeneratedError",GE=`vercel.ai.error.${BE}`,$F=Symbol.for(GE),KE,PF=class extends _e{constructor({message:e="No output generated.",cause:t}={}){super({name:BE,message:e,cause:t}),this[KE]=!0}static isInstance(e){return _e.hasMarker(e,GE)}};KE=$F;var EF="AI_NoSpeechGeneratedError",RF=`vercel.ai.error.${EF}`,CF=Symbol.for(RF),OF;OF=CF;var DF="AI_NoTranscriptGeneratedError",jF=`vercel.ai.error.${DF}`,NF=Symbol.for(jF),MF;MF=NF;var AF="AI_NoVideoGeneratedError",zF=`vercel.ai.error.${AF}`,qF=Symbol.for(zF),UF;UF=qF;var YE="AI_NoSuchToolError",XE=`vercel.ai.error.${YE}`,LF=Symbol.for(XE),QE,ky=class extends _e{constructor({toolName:e,availableTools:t=void 0,message:n=`Model tried to call unavailable tool '${e}'. ${t===void 0?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:YE,message:n}),this[QE]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return _e.hasMarker(e,XE)}};QE=LF;var eR="AI_ToolCallRepairError",tR=`vercel.ai.error.${eR}`,FF=Symbol.for(tR),rR,ZF=class extends _e{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${ao(e)}`}){super({name:eR,message:n,cause:e}),this[rR]=!0,this.originalError=t}static isInstance(e){return _e.hasMarker(e,tR)}};rR=FF;var VF=class extends _e{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},WF="AI_UIMessageStreamError",HF=`vercel.ai.error.${WF}`,JF=Symbol.for(HF),BF;BF=JF;var GF="AI_InvalidDataContentError",KF=`vercel.ai.error.${GF}`,YF=Symbol.for(KF),XF;XF=YF;var nR="AI_InvalidMessageRoleError",oR=`vercel.ai.error.${nR}`,QF=Symbol.for(oR),iR,e2=class extends _e{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:nR,message:t}),this[iR]=!0,this.role=e}static isInstance(e){return _e.hasMarker(e,oR)}};iR=QF;var t2="AI_MessageConversionError",r2=`vercel.ai.error.${t2}`,n2=Symbol.for(r2),o2;o2=n2;var aR="AI_RetryError",sR=`vercel.ai.error.${aR}`,i2=Symbol.for(sR),lR,vE=class extends _e{constructor({message:e,reason:t,errors:n}){super({name:aR,message:e}),this[lR]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return _e.hasMarker(e,sR)}};lR=i2;function Ys(e){return e===void 0?[]:Array.isArray(e)?e:[e]}async function di(e){for(let t of Ys(e.callbacks))if(t!=null)try{await t(e.event)}catch{}}function a2({warning:e,provider:t,model:n}){let o=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let r=`${o} The feature "${e.feature}" is not supported.`;return e.details&&(r+=` ${e.details}`),r}case"compatibility":{let r=`${o} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(r+=` ${e.details}`),r}case"other":return`${o} ${e.message}`;default:return`${o} ${JSON.stringify(e,null,2)}`}}var s2="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",yE=!1,uR=e=>{if(e.warnings.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}yE||(yE=!0,console.info(s2));for(let n of e.warnings)console.warn(a2({warning:n,provider:e.provider,model:e.model}))}};function l2({provider:e,modelId:t}){uR({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}function u2(e){return e.specificationVersion==="v3"?e:(l2({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get(t,n){switch(n){case"specificationVersion":return"v3";case"doGenerate":return async(...o)=>{let r=await t.doGenerate(...o);return{...r,finishReason:cR(r.finishReason),usage:dR(r.usage)}};case"doStream":return async(...o)=>{let r=await t.doStream(...o);return{...r,stream:c2(r.stream)}};default:return t[n]}}}))}function c2(e){return e.pipeThrough(new TransformStream({transform(t,n){switch(t.type){case"finish":n.enqueue({...t,finishReason:cR(t.finishReason),usage:dR(t.usage)});break;default:n.enqueue(t);break}}}))}function cR(e){return{unified:e==="unknown"?"other":e,raw:void 0}}function dR(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function _E(e){if(typeof e!="string"){if(e.specificationVersion!=="v3"&&e.specificationVersion!=="v2"){let t=e;throw new VF({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return u2(e)}return d2().languageModel(e)}function d2(){var e;return(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:QP}function pR(e){if(e!=null)return typeof e=="number"?e:e.totalMs}function p2(e){if(!(e==null||typeof e=="number"))return e.stepMs}var f2=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}];var m2=e=>{let t=typeof e=="string"?nn(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function h2(e){return typeof e=="string"&&e.startsWith("SUQz")||typeof e!="string"&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?m2(e):e}function g2({data:e,signatures:t}){let n=h2(e),o=typeof n=="string"?nn(n.substring(0,Math.min(n.length,24))):n;for(let r of t)if(o.length>=r.bytesPrefix.length&&r.bytesPrefix.every((i,s)=>i===null||o[s]===i))return r.mediaType}var fR="6.0.197",mR=async({url:e,maxBytes:t,abortSignal:n})=>{var o;let r=e.toString();qs(r);try{let i=await fetch(r,{headers:on({},`ai-sdk/${fR}`,Fc()),signal:n});if(i.redirected&&qs(i.url),!i.ok)throw new ar({url:r,statusCode:i.status,statusText:i.statusText});return{data:await Cv({response:i,url:r,maxBytes:t??Uc}),mediaType:(o=i.headers.get("content-type"))!=null?o:void 0}}catch(i){throw ar.isInstance(i)?i:new ar({url:r,cause:i})}},v2=(e=mR)=>t=>Promise.all(t.map(async n=>n.isUrlSupportedByModel?null:e(n)));function y2(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch{return{mediaType:void 0,base64Content:void 0}}}var hR=a.union([a.string(),a.instanceof(Uint8Array),a.instanceof(ArrayBuffer),a.custom(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function Py(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if(typeof e=="string")try{e=new URL(e)}catch{}if(e instanceof URL&&e.protocol==="data:"){let{mediaType:t,base64Content:n}=y2(e.toString());if(t==null||n==null)throw new _e({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function Sy(e){return typeof e=="string"?e:e instanceof ArrayBuffer?_n(new Uint8Array(e)):_n(e)}async function _2({prompt:e,supportedUrls:t,download:n=v2()}){let o=await w2(e.messages,n,t),r=new Map;for(let c of e.messages)if(c.role==="assistant"&&Array.isArray(c.content))for(let d of c.content)d.type==="tool-approval-request"&&"approvalId"in d&&"toolCallId"in d&&r.set(d.approvalId,d.toolCallId);let i=new Set;for(let c of e.messages)if(c.role==="tool"){for(let d of c.content)if(d.type==="tool-approval-response"){let m=r.get(d.approvalId);m&&i.add(m)}}let s=[...e.system!=null?typeof e.system=="string"?[{role:"system",content:e.system}]:Ys(e.system).map(c=>({role:"system",content:c.content,providerOptions:c.providerOptions})):[],...e.messages.map(c=>b2({message:c,downloadedAssets:o}))],l=[];for(let c of s){if(c.role!=="tool"){l.push(c);continue}let d=l.at(-1);d?.role==="tool"?d.content.push(...c.content):l.push(c)}let u=new Set;for(let c of l)switch(c.role){case"assistant":{for(let d of c.content)d.type==="tool-call"&&!d.providerExecuted&&u.add(d.toolCallId);break}case"tool":{for(let d of c.content)d.type==="tool-result"&&u.delete(d.toolCallId);break}case"user":case"system":for(let d of i)u.delete(d);if(u.size>0)throw new gE({toolCallIds:Array.from(u)});break}for(let c of i)u.delete(c);if(u.size>0)throw new gE({toolCallIds:Array.from(u)});return l.filter(c=>c.role!=="tool"||c.content.length>0)}function b2({message:e,downloadedAssets:t}){let n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return typeof e.content=="string"?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map(o=>x2(o,t)).filter(o=>o.type!=="text"||o.text!==""),providerOptions:e.providerOptions};case"assistant":return typeof e.content=="string"?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter(o=>o.type!=="text"||o.text!==""||o.providerOptions!=null).filter(o=>o.type!=="tool-approval-request").map(o=>{let r=o.providerOptions;switch(o.type){case"file":{let{data:i,mediaType:s}=Py(o.data);return{type:"file",data:i,filename:o.filename,mediaType:s??o.mediaType,providerOptions:r}}case"reasoning":return{type:"reasoning",text:o.text,providerOptions:r};case"text":return{type:"text",text:o.text,providerOptions:r};case"tool-call":return{type:"tool-call",toolCallId:o.toolCallId,toolName:o.toolName,input:o.input,providerExecuted:o.providerExecuted,providerOptions:r};case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:bE({output:o.output,downloadedAssets:t}),providerOptions:r}}}),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.filter(o=>o.type!=="tool-approval-response"||o.providerExecuted).map(o=>{switch(o.type){case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:bE({output:o.output,downloadedAssets:t}),providerOptions:o.providerOptions};case"tool-approval-response":return{type:"tool-approval-response",approvalId:o.approvalId,approved:o.approved,reason:o.reason}}}),providerOptions:e.providerOptions};default:{let o=n;throw new e2({role:o})}}}async function w2(e,t,n){var o;let r=[];for(let l of e){if(l.role==="user"&&Array.isArray(l.content))for(let u of l.content)(u.type==="image"||u.type==="file")&&r.push({data:u.type==="image"?u.image:u.data,mediaType:(o=u.mediaType)!=null?o:u.type==="image"?"image/*":void 0});if(l.role==="tool"||l.role==="assistant"){if(!Array.isArray(l.content))continue;for(let u of l.content)if(u.type==="tool-result"&&u.output.type==="content")for(let c of u.output.value)(c.type==="image-url"||c.type==="file-url")&&r.push({data:new URL(c.url),mediaType:c.type==="image-url"?"image/*":void 0})}}let i=r.map(l=>{let u=l.mediaType,{data:c}=Py(l.data);return{mediaType:u,data:c}}).filter(l=>l.data instanceof URL).map(l=>({url:l.data,isUrlSupportedByModel:l.mediaType!=null&&H0({url:l.data.toString(),mediaType:l.mediaType,supportedUrls:n})})),s=await t(i);return Object.fromEntries(s.map((l,u)=>l==null?null:[i[u].url.toString(),{data:l.data,mediaType:l.mediaType}]).filter(l=>l!=null))}function x2(e,t){var n;if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};let o,r=e.type;switch(r){case"image":o=e.image;break;case"file":o=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}let{data:i,mediaType:s}=Py(o),l=s??e.mediaType,u=i;if(u instanceof URL){let c=t[u.toString()];c&&(u=c.data,l??(l=c.mediaType))}switch(r){case"image":return(u instanceof Uint8Array||typeof u=="string")&&(l=(n=g2({data:u,signatures:f2}))!=null?n:l),{type:"file",mediaType:l??"image/*",filename:void 0,data:u,providerOptions:e.providerOptions};case"file":{if(l==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:l,filename:e.filename,data:u,providerOptions:e.providerOptions}}}}function bE({output:e,downloadedAssets:t}){return e.type!=="content"?e:{type:"content",value:e.value.map(n=>{var o,r;if(n.type==="image-url"){let i=t[new URL(n.url).toString()];return i?{type:"image-data",data:Sy(i.data),mediaType:(o=i.mediaType)!=null?o:"image/*",providerOptions:n.providerOptions}:n}if(n.type==="file-url"){let i=t[new URL(n.url).toString()];return i?{type:"file-data",data:Sy(i.data),mediaType:(r=i.mediaType)!=null?r:"application/octet-stream",providerOptions:n.providerOptions}:n}return n.type!=="media"?n:n.mediaType.startsWith("image/")?{type:"image-data",data:n.data,mediaType:n.mediaType}:{type:"file-data",data:n.data,mediaType:n.mediaType}})}}async function od({toolCallId:e,input:t,output:n,tool:o,errorMode:r}){return r==="text"?{type:"error-text",value:ao(n)}:r==="json"?{type:"error-json",value:wE(n)}:o?.toModelOutput?await o.toModelOutput({toolCallId:e,input:t,output:n}):typeof n=="string"?{type:"text",value:n}:{type:"json",value:wE(n)}}function wE(e){return e===void 0?null:e}function xE({maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,seed:s,stopSequences:l}){if(e!=null){if(!Number.isInteger(e))throw new wn({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new wn({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new wn({parameter:"temperature",value:t,message:"temperature must be a number"});if(n!=null&&typeof n!="number")throw new wn({parameter:"topP",value:n,message:"topP must be a number"});if(o!=null&&typeof o!="number")throw new wn({parameter:"topK",value:o,message:"topK must be a number"});if(r!=null&&typeof r!="number")throw new wn({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(i!=null&&typeof i!="number")throw new wn({parameter:"frequencyPenalty",value:i,message:"frequencyPenalty must be a number"});if(s!=null&&!Number.isInteger(s))throw new wn({parameter:"seed",value:s,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,stopSequences:l,seed:s}}function k2(e){return e!=null&&Object.keys(e).length>0}async function S2({tools:e,toolChoice:t,activeTools:n}){if(!k2(e))return{tools:void 0,toolChoice:void 0};let o=n!=null?Object.entries(e).filter(([i])=>n.includes(i)):Object.entries(e),r=[];for(let[i,s]of o){let l=s.type;switch(l){case void 0:case"dynamic":case"function":r.push({type:"function",name:i,description:s.description,inputSchema:await Un(s.inputSchema).jsonSchema,...s.inputExamples!=null?{inputExamples:s.inputExamples}:{},providerOptions:s.providerOptions,...s.strict!=null?{strict:s.strict}:{}});break;case"provider":r.push({type:"provider",name:i,id:s.id,args:s.args});break;default:{let u=l;throw new Error(`Unsupported tool type: ${u}`)}}}return{tools:r,toolChoice:t==null?{type:"auto"}:typeof t=="string"?{type:t}:{type:"tool",toolName:t.toolName}}}var pi=a.lazy(()=>a.union([a.null(),a.string(),a.number(),a.boolean(),a.record(a.string(),pi.optional()),a.array(pi)])),Se=a.record(a.string(),a.record(a.string(),pi.optional())),gR=a.object({type:a.literal("text"),text:a.string(),providerOptions:Se.optional()}),T2=a.object({type:a.literal("image"),image:a.union([hR,a.instanceof(URL)]),mediaType:a.string().optional(),providerOptions:Se.optional()}),vR=a.object({type:a.literal("file"),data:a.union([hR,a.instanceof(URL)]),filename:a.string().optional(),mediaType:a.string(),providerOptions:Se.optional()}),I2=a.object({type:a.literal("reasoning"),text:a.string(),providerOptions:Se.optional()}),$2=a.object({type:a.literal("tool-call"),toolCallId:a.string(),toolName:a.string(),input:a.unknown(),providerOptions:Se.optional(),providerExecuted:a.boolean().optional()}),P2=a.discriminatedUnion("type",[a.object({type:a.literal("text"),value:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("json"),value:pi,providerOptions:Se.optional()}),a.object({type:a.literal("execution-denied"),reason:a.string().optional(),providerOptions:Se.optional()}),a.object({type:a.literal("error-text"),value:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("error-json"),value:pi,providerOptions:Se.optional()}),a.object({type:a.literal("content"),value:a.array(a.union([a.object({type:a.literal("text"),text:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("media"),data:a.string(),mediaType:a.string()}),a.object({type:a.literal("file-data"),data:a.string(),mediaType:a.string(),filename:a.string().optional(),providerOptions:Se.optional()}),a.object({type:a.literal("file-url"),url:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("file-id"),fileId:a.union([a.string(),a.record(a.string(),a.string())]),providerOptions:Se.optional()}),a.object({type:a.literal("image-data"),data:a.string(),mediaType:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("image-url"),url:a.string(),providerOptions:Se.optional()}),a.object({type:a.literal("image-file-id"),fileId:a.union([a.string(),a.record(a.string(),a.string())]),providerOptions:Se.optional()}),a.object({type:a.literal("custom"),providerOptions:Se.optional()})]))})]),yR=a.object({type:a.literal("tool-result"),toolCallId:a.string(),toolName:a.string(),output:P2,providerOptions:Se.optional()}),E2=a.object({type:a.literal("tool-approval-request"),approvalId:a.string(),toolCallId:a.string()}),R2=a.object({type:a.literal("tool-approval-response"),approvalId:a.string(),approved:a.boolean(),reason:a.string().optional()}),C2=a.object({role:a.literal("system"),content:a.string(),providerOptions:Se.optional()}),O2=a.object({role:a.literal("user"),content:a.union([a.string(),a.array(a.union([gR,T2,vR]))]),providerOptions:Se.optional()}),D2=a.object({role:a.literal("assistant"),content:a.union([a.string(),a.array(a.union([gR,vR,I2,$2,yR,E2]))]),providerOptions:Se.optional()}),j2=a.object({role:a.literal("tool"),content:a.array(a.union([yR,R2])),providerOptions:Se.optional()}),N2=a.union([C2,O2,D2,j2]);async function M2({allowSystemInMessages:e,system:t,prompt:n,messages:o}){if(n==null&&o==null)throw new fn({prompt:n,message:"prompt or messages must be defined"});if(n!=null&&o!=null)throw new fn({prompt:n,message:"prompt and messages cannot be defined at the same time"});if(typeof t!="string"&&!Ys(t).every(i=>i.role==="system"))throw new fn({prompt:n,message:"system must be a string, SystemModelMessage, or array of SystemModelMessage"});if(n!=null&&typeof n=="string")o=[{role:"user",content:n}];else if(n!=null&&Array.isArray(n))o=n;else if(o==null)throw new fn({prompt:n,message:"prompt or messages must be defined"});if(o.length===0)throw new fn({prompt:n,message:"messages must not be empty"});if(o.some(i=>i.role==="system")){if(e===!1)throw new fn({prompt:n,message:"System messages are not allowed in the prompt or messages fields. Use the system option instead."});e===void 0&&console.warn("AI SDK Warning: System messages in the prompt or messages fields can be a security risk because they may enable prompt injection attacks. Use the system option instead when possible. Set allowSystemInMessages to true to suppress this warning, or false to throw an error.")}let r=await Qt({value:o,schema:a.array(N2)});if(!r.success)throw new fn({prompt:n,message:"The messages do not match the ModelMessage[] schema.",cause:r.error});return{messages:o,system:t}}function A2(e){if(!Kc.isInstance(e))return e;let t=(process==null?void 0:process.env.NODE_ENV)==="production",n="https://ai-sdk.dev/unauthenticated-ai-gateway";return t?new _e({name:"GatewayError",message:`Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${n}`}):Object.assign(new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m To authenticate, set the \x1B[33mAI_GATEWAY_API_KEY\x1B[0m environment variable with your API key. @@ -125,13 +125,13 @@ Alternatively, you can use a provider module instead of the AI Gateway. Learn more: \x1B[34m${n}\x1B[0m -`),{name:"GatewayAuthenticationError"})}function yy({operationId:e,telemetry:t}){return{"operation.name":`${e}${t?.functionId!=null?` ${t.functionId}`:""}`,"resource.name":t?.functionId,"ai.operationId":e,"ai.telemetry.functionId":t?.functionId}}function h2({model:e,settings:t,telemetry:n,headers:o}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce((i,[s,l])=>{if(s==="timeout"){let u=GE(l);u!=null&&(i[`ai.settings.${s}`]=u)}else i[`ai.settings.${s}`]=l;return i},{}),...Object.entries((r=n?.metadata)!=null?r:{}).reduce((i,[s,l])=>(i[`ai.telemetry.metadata.${s}`]=l,i),{}),...Object.entries(o??{}).reduce((i,[s,l])=>(l!==void 0&&(i[`ai.request.headers.${s}`]=l),i),{})}}var g2={startSpan(){return td},startActiveSpan(e,t,n,o){if(typeof t=="function")return t(td);if(typeof n=="function")return n(td);if(typeof o=="function")return o(td)}},td={spanContext(){return v2},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this}},v2={traceId:"",spanId:"",traceFlags:0};function y2({isEnabled:e=!1,tracer:t}={}){return e?t||my.getTracer("ai"):g2}async function _y({name:e,tracer:t,attributes:n,fn:o,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:await n},async i=>{let s=ed.active();try{let l=await ed.with(s,()=>o(i));return r&&i.end(),l}catch(l){try{rC(i,l)}finally{i.end()}throw l}})}function rC(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:va.ERROR,message:t.message})):e.setStatus({code:va.ERROR})}async function li({telemetry:e,attributes:t}){if(e?.isEnabled!==!0)return{};let n={};for(let[o,r]of Object.entries(t))if(r!=null){if(typeof r=="object"&&"input"in r&&typeof r.input=="function"){if(e?.recordInputs===!1)continue;let i=await r.input();i!=null&&(n[o]=i);continue}if(typeof r=="object"&&"output"in r&&typeof r.output=="function"){if(e?.recordOutputs===!1)continue;let i=await r.output();i!=null&&(n[o]=i);continue}n[o]=r}return n}function _2(e){return JSON.stringify(e.map(t=>({...t,content:typeof t.content=="string"?t.content:t.content.map(n=>n.type==="file"?{...n,data:n.data instanceof Uint8Array?vy(n.data):n.data}:n)})))}function b2(){var e;return(e=globalThis.AI_SDK_TELEMETRY_INTEGRATIONS)!=null?e:[]}function w2(){let e=b2();return t=>{let n=Ys(t),o=[...e,...n];function r(i){let s=o.map(i).filter(Boolean);return async l=>{for(let u of s)try{await u(l)}catch{}}}return{onStart:r(i=>i.onStart),onStepStart:r(i=>i.onStepStart),onToolCallStart:r(i=>i.onToolCallStart),onToolCallFinish:r(i=>i.onToolCallFinish),onStepFinish:r(i=>i.onStepFinish),onFinish:r(i=>i.onFinish)}}}function aE(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:an(e.inputTokens.total,e.outputTokens.total),raw:e.raw,reasoningTokens:e.outputTokens.reasoning,cachedInputTokens:e.inputTokens.cacheRead}}function x2(e,t){var n,o,r,i,s,l,u,c,d,m;return{inputTokens:an(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:an((n=e.inputTokenDetails)==null?void 0:n.noCacheTokens,(o=t.inputTokenDetails)==null?void 0:o.noCacheTokens),cacheReadTokens:an((r=e.inputTokenDetails)==null?void 0:r.cacheReadTokens,(i=t.inputTokenDetails)==null?void 0:i.cacheReadTokens),cacheWriteTokens:an((s=e.inputTokenDetails)==null?void 0:s.cacheWriteTokens,(l=t.inputTokenDetails)==null?void 0:l.cacheWriteTokens)},outputTokens:an(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:an((u=e.outputTokenDetails)==null?void 0:u.textTokens,(c=t.outputTokenDetails)==null?void 0:c.textTokens),reasoningTokens:an((d=e.outputTokenDetails)==null?void 0:d.reasoningTokens,(m=t.outputTokenDetails)==null?void 0:m.reasoningTokens)},totalTokens:an(e.totalTokens,t.totalTokens),reasoningTokens:an(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:an(e.cachedInputTokens,t.cachedInputTokens)}}function an(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function nC(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let o in t)if(!(o==="__proto__"||o==="constructor"||o==="prototype")&&Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(r===void 0)continue;let i=o in e?e[o]:void 0,s=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),l=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);s&&l?n[o]=nC(i,r):n[o]=r}return n}function k2({error:e,exponentialBackoffDelay:t}){let n=Je.isInstance(e)?e.responseHeaders:Je.isInstance(e.cause)?e.cause.responseHeaders:void 0;if(!n)return t;let o,r=n["retry-after-ms"];if(r){let s=parseFloat(r);Number.isNaN(s)||(o=s)}let i=n["retry-after"];if(i&&o===void 0){let s=parseFloat(i);Number.isNaN(s)?o=Date.parse(i)-Date.now():o=s*1e3}return o!=null&&!Number.isNaN(o)&&0<=o&&(o<60*1e3||oasync r=>oC(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:o});async function oC(e,{maxRetries:t,delayInMs:n,backoffFactor:o,abortSignal:r},i=[]){try{return await e()}catch(s){if(po(s)||t===0)throw s;let l=qc(s),u=[...i,s],c=u.length;if(c>t)throw new eE({message:`Failed after ${c} attempts. Last error: ${l}`,reason:"maxRetriesExceeded",errors:u});if(s instanceof Error&&(Je.isInstance(s)&&s.isRetryable===!0||Wt.isInstance(s)&&s.isRetryable===!0)&&c<=t)return await x0(k2({error:s,exponentialBackoffDelay:n}),{abortSignal:r}),oC(e,{maxRetries:t,delayInMs:o*n,backoffFactor:o,abortSignal:r},u);throw c===1?s:new eE({message:`Failed after ${c} attempts with non-retryable error: '${l}'`,reason:"errorNotRetryable",errors:u})}}function I2({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new bn({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new bn({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}let n=e??2;return{maxRetries:n,retry:S2({maxRetries:n,abortSignal:t})}}function T2({messages:e}){let t=e.at(-1);if(t?.role!="tool")return{approvedToolApprovals:[],deniedToolApprovals:[]};let n={};for(let u of e)if(u.role==="assistant"&&typeof u.content!="string"){let c=u.content;for(let d of c)d.type==="tool-call"&&(n[d.toolCallId]=d)}let o={};for(let u of e)if(u.role==="assistant"&&typeof u.content!="string"){let c=u.content;for(let d of c)d.type==="tool-approval-request"&&(o[d.approvalId]=d)}let r={};for(let u of t.content)u.type==="tool-result"&&(r[u.toolCallId]=u);let i=[],s=[],l=t.content.filter(u=>u.type==="tool-approval-response");for(let u of l){let c=o[u.approvalId];if(c==null)throw new GL({approvalId:u.approvalId});if(r[c.toolCallId]!=null)continue;let d=n[c.toolCallId];if(d==null)throw new SE({toolCallId:c.toolCallId,approvalId:c.approvalId});let m={approvalRequest:c,approvalResponse:u,toolCall:d};u.approved?i.push(m):s.push(m)}return{approvedToolApprovals:i,deniedToolApprovals:s}}function hy(){var e,t;return(t=(e=globalThis?.performance)==null?void 0:e.now())!=null?t:Date.now()}async function $2({toolCall:e,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:i,experimental_context:s,stepNumber:l,model:u,onPreliminaryToolResult:c,onToolCallStart:d,onToolCallFinish:m}){let{toolName:_,toolCallId:h,input:b}=e,k=t?.[_];if(k?.execute==null)return;let T={stepNumber:l,model:u,toolCall:e,messages:r,abortSignal:i,functionId:o?.functionId,metadata:o?.metadata,experimental_context:s};return _y({name:"ai.toolCall",attributes:li({telemetry:o,attributes:{...yy({operationId:"ai.toolCall",telemetry:o}),"ai.toolCall.name":_,"ai.toolCall.id":h,"ai.toolCall.args":{output:()=>JSON.stringify(b)}}}),tracer:n,fn:async R=>{let g;await ui({event:T,callbacks:d});let v=hy();try{let O=q0({execute:k.execute.bind(k),input:b,options:{toolCallId:h,messages:r,abortSignal:i,experimental_context:s}});for await(let N of O)N.type==="preliminary"?c?.({...e,type:"tool-result",output:N.output,preliminary:!0}):g=N.output}catch(O){let N=hy()-v;return await ui({event:{...T,success:!1,error:O,durationMs:N},callbacks:m}),rC(R,O),{type:"tool-error",toolCallId:h,toolName:_,input:b,error:O,dynamic:k.type==="dynamic",...e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},...e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{}}}let C=hy()-v;await ui({event:{...T,success:!0,output:g,durationMs:C},callbacks:m});try{R.setAttributes(await li({telemetry:o,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(g)}}}))}catch{}return{type:"tool-result",toolCallId:h,toolName:_,input:b,output:g,dynamic:k.type==="dynamic",...e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},...e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{}}}})}function sE(e){let t=e.filter(n=>n.type==="reasoning");return t.length===0?void 0:t.map(n=>n.text).join(` -`)}function lE(e){let t=e.filter(n=>n.type==="text");if(t.length!==0)return t.map(n=>n.text).join("")}var P2=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return this.base64Data==null&&(this.base64Data=yn(this.uint8ArrayData)),this.base64Data}get uint8Array(){return this.uint8ArrayData==null&&(this.uint8ArrayData=rn(this.base64Data)),this.uint8ArrayData}};async function E2({tool:e,toolCall:t,messages:n,experimental_context:o}){return e.needsApproval==null?!1:typeof e.needsApproval=="boolean"?e.needsApproval:await e.needsApproval(t.input,{toolCallId:t.toolCallId,messages:n,experimental_context:o})}var C2={};FL(C2,{array:()=>D2,choice:()=>j2,json:()=>N2,object:()=>O2,text:()=>iC});function R2(e){let t=["ROOT"],n=-1,o=null;function r(u,c,d){switch(u){case'"':{n=c,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,o=c,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function i(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let u=0;u=0;u--)switch(t[u]){case"INSIDE_STRING":{l+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{let d=e.substring(o,e.length);"true".startsWith(d)?l+="true".slice(d.length):"false".startsWith(d)?l+="false".slice(d.length):"null".startsWith(d)&&(l+="null".slice(d.length))}}return l}async function nd(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await wr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await wr({text:R2(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var iC=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),O2=({schema:e,name:t,description:n})=>{let o=qn(e);return{name:"object",responseFormat:ft(o.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:r},i){let s=await wr({text:r});if(!s.success)throw new yo({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});let l=await Xt({value:s.value,schema:o});if(!l.success)throw new yo({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return l.value},async parsePartialOutput({text:r}){let i=await nd(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},D2=({element:e,name:t,description:n})=>{let o=qn(e);return{name:"array",responseFormat:ft(o.jsonSchema).then(r=>{let{$schema:i,...s}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:r},i){let s=await wr({text:r});if(!s.success)throw new yo({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});let l=s.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))throw new yo({message:"No object generated: response did not match schema.",cause:new Xr({value:l,cause:"response must be an object with an elements array"}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});for(let u of l.elements){let c=await Xt({value:u,schema:o});if(!c.success)throw new yo({message:"No object generated: response did not match schema.",cause:c.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason})}return l.elements},async parsePartialOutput({text:r}){let i=await nd(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let s=i.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;let l=i.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,u=[];for(let c of l){let d=await Xt({value:c,schema:o});d.success&&u.push(d.value)}return{partial:u}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:i},s){if(i!=null)for(;r({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:o},r){let i=await wr({text:o});if(!i.success)throw new yo({message:"No object generated: could not parse the response.",cause:i.error,text:o,response:r.response,usage:r.usage,finishReason:r.finishReason});let s=i.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!e.includes(s.result))throw new yo({message:"No object generated: response did not match schema.",cause:new Xr({value:s,cause:"response must be an object that contains a choice value."}),text:o,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.result},async parsePartialOutput({text:o}){let r=await nd(o);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=r.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;let s=e.filter(l=>l.startsWith(i.result));return r.state==="successful-parse"?s.includes(i.result)?{partial:i.result}:void 0:s.length===1?{partial:s[0]}:void 0}}},createElementStreamTransform(){}}),N2=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},o){let r=await wr({text:n});if(!r.success)throw new yo({message:"No object generated: could not parse the response.",cause:r.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return r.value},async parsePartialOutput({text:n}){let o=await nd(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return o.value===void 0?void 0:{partial:o.value}}},createElementStreamTransform(){}});async function M2({toolCall:e,tools:t,repairToolCall:n,system:o,messages:r}){try{if(t==null){if(e.providerExecuted&&e.dynamic)return await aC(e);throw new gy({toolName:e.toolName})}try{return await uE({toolCall:e,tools:t})}catch(i){if(n==null||!(gy.isInstance(i)||by.isInstance(i)))throw i;let s=null;try{s=await n({toolCall:e,tools:t,inputSchema:async({toolName:l})=>{let{inputSchema:u}=t[l];return await qn(u).jsonSchema},system:o,messages:r,error:i})}catch(l){throw new bF({cause:l,originalError:i})}if(s==null)throw i;return await uE({toolCall:s,tools:t})}}catch(i){let s=await wr({text:e.input}),l=s.success?s.value:e.input,u=t?.[e.toolName];return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:l,dynamic:!0,invalid:!0,error:i,title:u?.title,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,...u?.metadata!=null?{toolMetadata:u.metadata}:{}}}}async function aC(e){let t=e.input.trim()===""?{success:!0,value:{}}:await wr({text:e.input});if(t.success===!1)throw new by({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function uE({toolCall:e,tools:t}){let n=e.toolName,o=t[n];if(o==null){if(e.providerExecuted&&e.dynamic)return await aC(e);throw new gy({toolName:e.toolName,availableTools:Object.keys(t)})}let r=qn(o.inputSchema),i=e.input.trim()===""?await Xt({value:{},schema:r}):await wr({text:e.input,schema:r});if(i.success===!1)throw new by({toolName:n,toolInput:e.input,cause:i.error});return o.type==="dynamic"?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,...o.metadata!=null?{toolMetadata:o.metadata}:{},dynamic:!0,title:o.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,...o.metadata!=null?{toolMetadata:o.metadata}:{},title:o.title}}var A2=class{constructor({stepNumber:e,model:t,functionId:n,metadata:o,experimental_context:r,content:i,finishReason:s,rawFinishReason:l,usage:u,warnings:c,request:d,response:m,providerMetadata:_}){this.stepNumber=e,this.model=t,this.functionId=n,this.metadata=o,this.experimental_context=r,this.content=i,this.finishReason=s,this.rawFinishReason=l,this.usage=u,this.warnings=c,this.request=d,this.response=m,this.providerMetadata=_}get text(){return this.content.filter(e=>e.type==="text").map(e=>e.text).join("")}get reasoning(){return this.content.filter(e=>e.type==="reasoning")}get reasoningText(){return this.reasoning.length===0?void 0:this.reasoning.map(e=>e.text).join("")}get files(){return this.content.filter(e=>e.type==="file").map(e=>e.file)}get sources(){return this.content.filter(e=>e.type==="source")}get toolCalls(){return this.content.filter(e=>e.type==="tool-call")}get staticToolCalls(){return this.toolCalls.filter(e=>e.dynamic!==!0)}get dynamicToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!0)}get toolResults(){return this.content.filter(e=>e.type==="tool-result")}get staticToolResults(){return this.toolResults.filter(e=>e.dynamic!==!0)}get dynamicToolResults(){return this.toolResults.filter(e=>e.dynamic===!0)}};function z2(e){return({steps:t})=>t.length===e}async function q2({stopConditions:e,steps:t}){return(await Promise.all(e.map(n=>n({steps:t})))).some(n=>n)}async function U2({content:e,tools:t}){let n=[],o=[];for(let i of e)if(i.type!=="source"&&!((i.type==="tool-result"||i.type==="tool-error")&&!i.providerExecuted)&&!(i.type==="text"&&i.text.length===0))switch(i.type){case"text":o.push({type:"text",text:i.text,providerOptions:i.providerMetadata});break;case"reasoning":o.push({type:"reasoning",text:i.text,providerOptions:i.providerMetadata});break;case"file":o.push({type:"file",data:i.file.base64,mediaType:i.file.mediaType,providerOptions:i.providerMetadata});break;case"tool-call":o.push({type:"tool-call",toolCallId:i.toolCallId,toolName:i.toolName,input:i.invalid&&typeof i.input!="object"?{}:i.input,providerExecuted:i.providerExecuted,providerOptions:i.providerMetadata});break;case"tool-result":{let s=await rd({toolCallId:i.toolCallId,input:i.input,tool:t?.[i.toolName],output:i.output,errorMode:"none"});o.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:s,providerOptions:i.providerMetadata});break}case"tool-error":{let s=await rd({toolCallId:i.toolCallId,input:i.input,tool:t?.[i.toolName],output:i.error,errorMode:"json"});o.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:s,providerOptions:i.providerMetadata});break}case"tool-approval-request":o.push({type:"tool-approval-request",approvalId:i.approvalId,toolCallId:i.toolCall.toolCallId});break}o.length>0&&n.push({role:"assistant",content:o});let r=[];for(let i of e){if(!(i.type==="tool-result"||i.type==="tool-error")||i.providerExecuted)continue;let s=await rd({toolCallId:i.toolCallId,input:i.input,tool:t?.[i.toolName],output:i.type==="tool-result"?i.output:i.error,errorMode:i.type==="tool-error"?"text":"none"});r.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:s,...i.providerMetadata!=null?{providerOptions:i.providerMetadata}:{}})}return r.length>0&&n.push({role:"tool",content:r}),n}function L2(...e){let t=e.filter(o=>o!=null);if(t.length===0)return;if(t.length===1)return t[0];let n=new AbortController;for(let o of t){if(o.aborted)return n.abort(o.reason),n.signal;o.addEventListener("abort",()=>{n.abort(o.reason)},{once:!0})}return n.signal}var F2=zn({prefix:"aitxt",size:24});async function sC({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:i,allowSystemInMessages:s,maxRetries:l,abortSignal:u,timeout:c,headers:d,stopWhen:m=z2(1),experimental_output:_,output:h=_,experimental_telemetry:b,providerOptions:k,experimental_activeTools:T,activeTools:R=T,experimental_prepareStep:g,prepareStep:v=g,experimental_repairToolCall:C,experimental_download:O,experimental_context:N,experimental_include:K,_internal:{generateId:ee=F2}={},experimental_onStart:E,experimental_onStepStart:le,experimental_onToolCallStart:z,experimental_onToolCallFinish:ye,onStepFinish:D,onFinish:U,...A}){let L=rE(e),B=w2(),ne=Ys(m),W=GE(c),pe=ZF(c),Pe=pe!=null?new AbortController:void 0,Ie=L2(u,W!=null?AbortSignal.timeout(W):void 0,Pe?.signal),{maxRetries:Le,retry:oe}=I2({maxRetries:l,abortSignal:Ie}),J=iE(A),ge=nn(d??{},`ai/${KE}`),we=h2({model:L,telemetry:b,headers:ge,settings:{...J,maxRetries:Le}}),se={provider:L.provider,modelId:L.modelId},me=await f2({system:o,prompt:r,messages:i,allowSystemInMessages:s}),F=B(b?.integrations);await ui({event:{model:se,system:o,prompt:r,messages:i,tools:t,toolChoice:n,activeTools:R,maxOutputTokens:J.maxOutputTokens,temperature:J.temperature,topP:J.topP,topK:J.topK,presencePenalty:J.presencePenalty,frequencyPenalty:J.frequencyPenalty,stopSequences:J.stopSequences,seed:J.seed,maxRetries:Le,timeout:c,headers:d,providerOptions:k,stopWhen:m,output:h,abortSignal:u,include:K,functionId:b?.functionId,metadata:b?.metadata,experimental_context:N},callbacks:[E,F.onStart]});let xe=y2(b);try{return await _y({name:"ai.generateText",attributes:li({telemetry:b,attributes:{...yy({operationId:"ai.generateText",telemetry:b}),...we,"ai.model.provider":L.provider,"ai.model.id":L.modelId,"ai.prompt":{input:()=>JSON.stringify({system:o,prompt:r,messages:i})}}}),tracer:xe,fn:async je=>{var Me,Qt,sr,Sr,lr,et,Mt,ur,sn,ln,Ht,Hr,Jr,Dr,Br,x,y,q,G,ve;let Be=me.messages,We=[],{approvedToolApprovals:lt,deniedToolApprovals:ut}=T2({messages:Be}),ze=lt.filter(tr=>!tr.toolCall.providerExecuted);if(ut.length>0||ze.length>0){let tr=await cE({toolCalls:ze.map(P=>P.toolCall),tools:t,tracer:xe,telemetry:b,messages:Be,abortSignal:Ie,experimental_context:N,stepNumber:0,model:se,onToolCallStart:[z,F.onToolCallStart],onToolCallFinish:[ye,F.onToolCallFinish]}),rr=[];for(let P of tr){let f=await rd({toolCallId:P.toolCallId,input:P.input,tool:t?.[P.toolName],output:P.type==="tool-result"?P.output:P.error,errorMode:P.type==="tool-error"?"text":"none"});rr.push({type:"tool-result",toolCallId:P.toolCallId,toolName:P.toolName,output:f})}for(let P of ut)rr.push({type:"tool-result",toolCallId:P.toolCall.toolCallId,toolName:P.toolCall.toolName,output:{type:"execution-denied",reason:P.approvalResponse.reason,...P.toolCall.providerExecuted&&{providerOptions:{openai:{approvalId:P.approvalResponse.approvalId}}}}});We.push({role:"tool",content:rr})}let tt=iE(A),$e,ct=[],bt=[],dt=[],Fn=new Map;do{let tr=pe!=null?setTimeout(()=>Pe.abort(),pe):void 0;try{let rr=[...Be,...We],P=await v?.({model:L,steps:dt,stepNumber:dt.length,messages:rr,experimental_context:N}),f=rE((Me=P?.model)!=null?Me:L),I={provider:f.provider,modelId:f.modelId},$=await KF({prompt:{system:(Qt=P?.system)!=null?Qt:me.system,messages:(sr=P?.messages)!=null?sr:rr},supportedUrls:await f.supportedUrls,download:O});N=(Sr=P?.experimental_context)!=null?Sr:N;let w=(lr=P?.activeTools)!=null?lr:R,{toolChoice:p,tools:M}=await t2({tools:t,toolChoice:(et=P?.toolChoice)!=null?et:n,activeTools:w}),H=(Mt=P?.messages)!=null?Mt:rr,Oe=(ur=P?.system)!=null?ur:me.system,yt=nC(k,P?.providerOptions);await ui({event:{stepNumber:dt.length,model:I,system:Oe,messages:H,tools:t,toolChoice:p,activeTools:w,steps:[...dt],providerOptions:yt,timeout:c,headers:d,stopWhen:m,output:h,abortSignal:u,include:K,functionId:b?.functionId,metadata:b?.metadata,experimental_context:N},callbacks:[le,F.onStepStart]}),$e=await oe(()=>{var Ve;return _y({name:"ai.generateText.doGenerate",attributes:li({telemetry:b,attributes:{...yy({operationId:"ai.generateText.doGenerate",telemetry:b}),...we,"ai.model.provider":f.provider,"ai.model.id":f.modelId,"ai.prompt.messages":{input:()=>_2($)},"ai.prompt.tools":{input:()=>M?.map(Tr=>JSON.stringify(Tr))},"ai.prompt.toolChoice":{input:()=>p!=null?JSON.stringify(p):void 0},"gen_ai.system":f.provider,"gen_ai.request.model":f.modelId,"gen_ai.request.frequency_penalty":A.frequencyPenalty,"gen_ai.request.max_tokens":A.maxOutputTokens,"gen_ai.request.presence_penalty":A.presencePenalty,"gen_ai.request.stop_sequences":A.stopSequences,"gen_ai.request.temperature":(Ve=A.temperature)!=null?Ve:void 0,"gen_ai.request.top_k":A.topK,"gen_ai.request.top_p":A.topP}}),tracer:xe,fn:async Tr=>{var sd,Sa,Oy,Dy,jy,Ny,My,Ay;let wt=await f.doGenerate({...tt,tools:M,toolChoice:p,responseFormat:await h?.responseFormat,prompt:$,providerOptions:yt,abortSignal:Ie,headers:ge}),fi={id:(Sa=(sd=wt.response)==null?void 0:sd.id)!=null?Sa:ee(),timestamp:(Dy=(Oy=wt.response)==null?void 0:Oy.timestamp)!=null?Dy:new Date,modelId:(Ny=(jy=wt.response)==null?void 0:jy.modelId)!=null?Ny:f.modelId,headers:(My=wt.response)==null?void 0:My.headers,body:(Ay=wt.response)==null?void 0:Ay.body},vC=aE(wt.usage);return Tr.setAttributes(await li({telemetry:b,attributes:{"ai.response.finishReason":wt.finishReason.unified,"ai.response.text":{output:()=>lE(wt.content)},"ai.response.reasoning":{output:()=>sE(wt.content)},"ai.response.toolCalls":{output:()=>{let zy=dE(wt.content);return zy==null?void 0:JSON.stringify(zy)}},"ai.response.id":fi.id,"ai.response.model":fi.modelId,"ai.response.timestamp":fi.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(wt.providerMetadata),"ai.usage.inputTokens":wt.usage.inputTokens.total,"ai.usage.inputTokenDetails.noCacheTokens":wt.usage.inputTokens.noCache,"ai.usage.inputTokenDetails.cacheReadTokens":wt.usage.inputTokens.cacheRead,"ai.usage.inputTokenDetails.cacheWriteTokens":wt.usage.inputTokens.cacheWrite,"ai.usage.outputTokens":wt.usage.outputTokens.total,"ai.usage.outputTokenDetails.textTokens":wt.usage.outputTokens.text,"ai.usage.outputTokenDetails.reasoningTokens":wt.usage.outputTokens.reasoning,"ai.usage.totalTokens":vC.totalTokens,"ai.usage.reasoningTokens":wt.usage.outputTokens.reasoning,"ai.usage.cachedInputTokens":wt.usage.inputTokens.cacheRead,"gen_ai.response.finish_reasons":[wt.finishReason.unified],"gen_ai.response.id":fi.id,"gen_ai.response.model":fi.modelId,"gen_ai.usage.input_tokens":wt.usage.inputTokens.total,"gen_ai.usage.output_tokens":wt.usage.outputTokens.total}})),{...wt,response:fi}}})});let Ke=await Promise.all($e.content.filter(Ve=>Ve.type==="tool-call").map(Ve=>M2({toolCall:Ve,tools:t,repairToolCall:C,system:o,messages:rr}))),nr={};for(let Ve of Ke){if(Ve.invalid)continue;let Tr=t?.[Ve.toolName];Tr!=null&&(Tr?.onInputAvailable!=null&&await Tr.onInputAvailable({input:Ve.input,toolCallId:Ve.toolCallId,messages:rr,abortSignal:Ie,experimental_context:N}),await E2({tool:Tr,toolCall:Ve,messages:rr,experimental_context:N})&&(nr[Ve.toolCallId]={type:"tool-approval-request",approvalId:ee(),toolCall:Ve}))}let Ir=Ke.filter(Ve=>Ve.invalid&&Ve.dynamic);bt=[];for(let Ve of Ir)bt.push({type:"tool-error",toolCallId:Ve.toolCallId,toolName:Ve.toolName,input:Ve.input,error:qc(Ve.error),dynamic:!0});ct=Ke.filter(Ve=>!Ve.providerExecuted),t!=null&&bt.push(...await cE({toolCalls:ct.filter(Ve=>!Ve.invalid&&nr[Ve.toolCallId]==null),tools:t,tracer:xe,telemetry:b,messages:rr,abortSignal:Ie,experimental_context:N,stepNumber:dt.length,model:I,onToolCallStart:[z,F.onToolCallStart],onToolCallFinish:[ye,F.onToolCallFinish]}));for(let Ve of Ke){if(!Ve.providerExecuted)continue;let Tr=t?.[Ve.toolName];Tr?.type==="provider"&&Tr.supportsDeferredResults&&($e.content.some(Sa=>Sa.type==="tool-result"&&Sa.toolCallId===Ve.toolCallId)||Fn.set(Ve.toolCallId,{toolName:Ve.toolName}))}for(let Ve of $e.content)Ve.type==="tool-result"&&Fn.delete(Ve.toolCallId);let jr=V2({content:$e.content,toolCalls:Ke,toolOutputs:bt,toolApprovalRequests:Object.values(nr),tools:t});We.push(...await U2({content:jr,tools:t}));let Fe=(sn=K?.requestBody)==null||sn?(ln=$e.request)!=null?ln:{}:{...$e.request,body:void 0},Zn={...$e.response,messages:structuredClone(We),body:(Ht=K?.responseBody)==null||Ht?(Hr=$e.response)==null?void 0:Hr.body:void 0},pi=dt.length,ka=new A2({stepNumber:pi,model:I,functionId:b?.functionId,metadata:b?.metadata,experimental_context:N,content:jr,finishReason:$e.finishReason.unified,rawFinishReason:$e.finishReason.raw,usage:aE($e.usage),warnings:$e.warnings,providerMetadata:$e.providerMetadata,request:Fe,response:Zn});HE({warnings:(Jr=$e.warnings)!=null?Jr:[],provider:I.provider,model:I.modelId}),dt.push(ka),await ui({event:ka,callbacks:[D,F.onStepFinish]})}finally{tr!=null&&clearTimeout(tr)}}while((ct.length>0&&bt.length===ct.length||Fn.size>0)&&!await q2({stopConditions:ne,steps:dt}));je.setAttributes(await li({telemetry:b,attributes:{"ai.response.finishReason":$e.finishReason.unified,"ai.response.text":{output:()=>lE($e.content)},"ai.response.reasoning":{output:()=>sE($e.content)},"ai.response.toolCalls":{output:()=>{let tr=dE($e.content);return tr==null?void 0:JSON.stringify(tr)}},"ai.response.providerMetadata":JSON.stringify($e.providerMetadata)}}));let Ge=dt[dt.length-1],er=dt.reduce((tr,rr)=>x2(tr,rr.usage),{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0});je.setAttributes(await li({telemetry:b,attributes:{"ai.usage.inputTokens":er.inputTokens,"ai.usage.inputTokenDetails.noCacheTokens":(Dr=er.inputTokenDetails)==null?void 0:Dr.noCacheTokens,"ai.usage.inputTokenDetails.cacheReadTokens":(Br=er.inputTokenDetails)==null?void 0:Br.cacheReadTokens,"ai.usage.inputTokenDetails.cacheWriteTokens":(x=er.inputTokenDetails)==null?void 0:x.cacheWriteTokens,"ai.usage.outputTokens":er.outputTokens,"ai.usage.outputTokenDetails.textTokens":(y=er.outputTokenDetails)==null?void 0:y.textTokens,"ai.usage.outputTokenDetails.reasoningTokens":(q=er.outputTokenDetails)==null?void 0:q.reasoningTokens,"ai.usage.totalTokens":er.totalTokens,"ai.usage.reasoningTokens":(G=er.outputTokenDetails)==null?void 0:G.reasoningTokens,"ai.usage.cachedInputTokens":(ve=er.inputTokenDetails)==null?void 0:ve.cacheReadTokens}})),await ui({event:{stepNumber:Ge.stepNumber,model:Ge.model,functionId:Ge.functionId,metadata:Ge.metadata,experimental_context:Ge.experimental_context,finishReason:Ge.finishReason,rawFinishReason:Ge.rawFinishReason,usage:Ge.usage,content:Ge.content,text:Ge.text,reasoningText:Ge.reasoningText,reasoning:Ge.reasoning,files:Ge.files,sources:Ge.sources,toolCalls:Ge.toolCalls,staticToolCalls:Ge.staticToolCalls,dynamicToolCalls:Ge.dynamicToolCalls,toolResults:Ge.toolResults,staticToolResults:Ge.staticToolResults,dynamicToolResults:Ge.dynamicToolResults,request:Ge.request,response:Ge.response,warnings:Ge.warnings,providerMetadata:Ge.providerMetadata,steps:dt,totalUsage:er},callbacks:[U,F.onFinish]});let xa;return Ge.finishReason==="stop"&&(xa=await(h??iC()).parseCompleteOutput({text:Ge.text},{response:Ge.response,usage:Ge.usage,finishReason:Ge.finishReason})),new Z2({steps:dt,totalUsage:er,output:xa})}})}catch(je){throw m2(je)}}async function cE({toolCalls:e,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:i,experimental_context:s,stepNumber:l,model:u,onToolCallStart:c,onToolCallFinish:d}){return(await Promise.all(e.map(async _=>$2({toolCall:_,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:i,experimental_context:s,stepNumber:l,model:u,onToolCallStart:c,onToolCallFinish:d})))).filter(_=>_!=null)}var Z2=class{constructor(e){this.steps=e.steps,this._output=e.output,this.totalUsage=e.totalUsage}get finalStep(){return this.steps[this.steps.length-1]}get content(){return this.finalStep.content}get text(){return this.finalStep.text}get files(){return this.finalStep.files}get reasoningText(){return this.finalStep.reasoningText}get reasoning(){return this.finalStep.reasoning}get toolCalls(){return this.finalStep.toolCalls}get staticToolCalls(){return this.finalStep.staticToolCalls}get dynamicToolCalls(){return this.finalStep.dynamicToolCalls}get toolResults(){return this.finalStep.toolResults}get staticToolResults(){return this.finalStep.staticToolResults}get dynamicToolResults(){return this.finalStep.dynamicToolResults}get sources(){return this.finalStep.sources}get finishReason(){return this.finalStep.finishReason}get rawFinishReason(){return this.finalStep.rawFinishReason}get warnings(){return this.finalStep.warnings}get providerMetadata(){return this.finalStep.providerMetadata}get response(){return this.finalStep.response}get request(){return this.finalStep.request}get usage(){return this.finalStep.usage}get experimental_output(){return this.output}get output(){if(this._output==null)throw new iF;return this._output}};function dE(e){let t=e.filter(n=>n.type==="tool-call");if(t.length!==0)return t.map(n=>({toolCallId:n.toolCallId,toolName:n.toolName,input:n.input}))}function V2({content:e,toolCalls:t,toolOutputs:n,toolApprovalRequests:o,tools:r}){let i=[];for(let s of e)switch(s.type){case"text":case"reasoning":case"source":i.push(s);break;case"file":{i.push({type:"file",file:new P2(s),...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{}});break}case"tool-call":{i.push(t.find(l=>l.toolCallId===s.toolCallId));break}case"tool-result":{let l=t.find(u=>u.toolCallId===s.toolCallId);if(l==null){let u=r?.[s.toolName];if(!(u?.type==="provider"&&u.supportsDeferredResults))throw new Error(`Tool call ${s.toolCallId} not found.`);s.isError?i.push({type:"tool-error",toolCallId:s.toolCallId,toolName:s.toolName,input:void 0,error:s.result,providerExecuted:!0,dynamic:s.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...u?.metadata!=null?{toolMetadata:u.metadata}:{}}):i.push({type:"tool-result",toolCallId:s.toolCallId,toolName:s.toolName,input:void 0,output:s.result,providerExecuted:!0,dynamic:s.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...u?.metadata!=null?{toolMetadata:u.metadata}:{}});break}s.isError?i.push({type:"tool-error",toolCallId:s.toolCallId,toolName:s.toolName,input:l.input,error:s.result,providerExecuted:!0,dynamic:l.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...l.toolMetadata!=null?{toolMetadata:l.toolMetadata}:{}}):i.push({type:"tool-result",toolCallId:s.toolCallId,toolName:s.toolName,input:l.input,output:s.result,providerExecuted:!0,dynamic:l.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...l.toolMetadata!=null?{toolMetadata:l.toolMetadata}:{}});break}case"tool-approval-request":{let l=t.find(u=>u.toolCallId===s.toolCallId);if(l==null)throw new SE({toolCallId:s.toolCallId,approvalId:s.approvalId});i.push({type:"tool-approval-request",approvalId:s.approvalId,toolCall:l});break}}return[...i,...n,...o]}var C5=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)} +`),{name:"GatewayAuthenticationError"})}function Ty({operationId:e,telemetry:t}){return{"operation.name":`${e}${t?.functionId!=null?` ${t.functionId}`:""}`,"resource.name":t?.functionId,"ai.operationId":e,"ai.telemetry.functionId":t?.functionId}}function z2({model:e,settings:t,telemetry:n,headers:o}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce((i,[s,l])=>{if(s==="timeout"){let u=pR(l);u!=null&&(i[`ai.settings.${s}`]=u)}else i[`ai.settings.${s}`]=l;return i},{}),...Object.entries((r=n?.metadata)!=null?r:{}).reduce((i,[s,l])=>(i[`ai.telemetry.metadata.${s}`]=l,i),{}),...Object.entries(o??{}).reduce((i,[s,l])=>(l!==void 0&&(i[`ai.request.headers.${s}`]=l),i),{})}}var q2={startSpan(){return nd},startActiveSpan(e,t,n,o){if(typeof t=="function")return t(nd);if(typeof n=="function")return n(nd);if(typeof o=="function")return o(nd)}},nd={spanContext(){return U2},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this}},U2={traceId:"",spanId:"",traceFlags:0};function L2({isEnabled:e=!1,tracer:t}={}){return e?t||wy.getTracer("ai"):q2}async function Iy({name:e,tracer:t,attributes:n,fn:o,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:await n},async i=>{let s=rd.active();try{let l=await rd.with(s,()=>o(i));return r&&i.end(),l}catch(l){try{_R(i,l)}finally{i.end()}throw l}})}function _R(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:_a.ERROR,message:t.message})):e.setStatus({code:_a.ERROR})}async function ci({telemetry:e,attributes:t}){if(e?.isEnabled!==!0)return{};let n={};for(let[o,r]of Object.entries(t))if(r!=null){if(typeof r=="object"&&"input"in r&&typeof r.input=="function"){if(e?.recordInputs===!1)continue;let i=await r.input();i!=null&&(n[o]=i);continue}if(typeof r=="object"&&"output"in r&&typeof r.output=="function"){if(e?.recordOutputs===!1)continue;let i=await r.output();i!=null&&(n[o]=i);continue}n[o]=r}return n}function F2(e){return JSON.stringify(e.map(t=>({...t,content:typeof t.content=="string"?t.content:t.content.map(n=>n.type==="file"?{...n,data:n.data instanceof Uint8Array?Sy(n.data):n.data}:n)})))}function Z2(){var e;return(e=globalThis.AI_SDK_TELEMETRY_INTEGRATIONS)!=null?e:[]}function V2(){let e=Z2();return t=>{let n=Ys(t),o=[...e,...n];function r(i){let s=o.map(i).filter(Boolean);return async l=>{for(let u of s)try{await u(l)}catch{}}}return{onStart:r(i=>i.onStart),onStepStart:r(i=>i.onStepStart),onToolCallStart:r(i=>i.onToolCallStart),onToolCallFinish:r(i=>i.onToolCallFinish),onStepFinish:r(i=>i.onStepFinish),onFinish:r(i=>i.onFinish)}}}function kE(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:sn(e.inputTokens.total,e.outputTokens.total),raw:e.raw,reasoningTokens:e.outputTokens.reasoning,cachedInputTokens:e.inputTokens.cacheRead}}function W2(e,t){var n,o,r,i,s,l,u,c,d,m;return{inputTokens:sn(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:sn((n=e.inputTokenDetails)==null?void 0:n.noCacheTokens,(o=t.inputTokenDetails)==null?void 0:o.noCacheTokens),cacheReadTokens:sn((r=e.inputTokenDetails)==null?void 0:r.cacheReadTokens,(i=t.inputTokenDetails)==null?void 0:i.cacheReadTokens),cacheWriteTokens:sn((s=e.inputTokenDetails)==null?void 0:s.cacheWriteTokens,(l=t.inputTokenDetails)==null?void 0:l.cacheWriteTokens)},outputTokens:sn(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:sn((u=e.outputTokenDetails)==null?void 0:u.textTokens,(c=t.outputTokenDetails)==null?void 0:c.textTokens),reasoningTokens:sn((d=e.outputTokenDetails)==null?void 0:d.reasoningTokens,(m=t.outputTokenDetails)==null?void 0:m.reasoningTokens)},totalTokens:sn(e.totalTokens,t.totalTokens),reasoningTokens:sn(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:sn(e.cachedInputTokens,t.cachedInputTokens)}}function sn(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function bR(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let o in t)if(!(o==="__proto__"||o==="constructor"||o==="prototype")&&Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(r===void 0)continue;let i=o in e?e[o]:void 0,s=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),l=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);s&&l?n[o]=bR(i,r):n[o]=r}return n}function H2({error:e,exponentialBackoffDelay:t}){let n=Je.isInstance(e)?e.responseHeaders:Je.isInstance(e.cause)?e.cause.responseHeaders:void 0;if(!n)return t;let o,r=n["retry-after-ms"];if(r){let s=parseFloat(r);Number.isNaN(s)||(o=s)}let i=n["retry-after"];if(i&&o===void 0){let s=parseFloat(i);Number.isNaN(s)?o=Date.parse(i)-Date.now():o=s*1e3}return o!=null&&!Number.isNaN(o)&&0<=o&&(o<60*1e3||oasync r=>wR(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:o});async function wR(e,{maxRetries:t,delayInMs:n,backoffFactor:o,abortSignal:r},i=[]){try{return await e()}catch(s){if(mo(s)||t===0)throw s;let l=Lc(s),u=[...i,s],c=u.length;if(c>t)throw new vE({message:`Failed after ${c} attempts. Last error: ${l}`,reason:"maxRetriesExceeded",errors:u});if(s instanceof Error&&(Je.isInstance(s)&&s.isRetryable===!0||Ht.isInstance(s)&&s.isRetryable===!0)&&c<=t)return await q0(H2({error:s,exponentialBackoffDelay:n}),{abortSignal:r}),wR(e,{maxRetries:t,delayInMs:o*n,backoffFactor:o,abortSignal:r},u);throw c===1?s:new vE({message:`Failed after ${c} attempts with non-retryable error: '${l}'`,reason:"errorNotRetryable",errors:u})}}function B2({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new wn({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new wn({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}let n=e??2;return{maxRetries:n,retry:J2({maxRetries:n,abortSignal:t})}}function G2({messages:e}){let t=e.at(-1);if(t?.role!="tool")return{approvedToolApprovals:[],deniedToolApprovals:[]};let n={};for(let u of e)if(u.role==="assistant"&&typeof u.content!="string"){let c=u.content;for(let d of c)d.type==="tool-call"&&(n[d.toolCallId]=d)}let o={};for(let u of e)if(u.role==="assistant"&&typeof u.content!="string"){let c=u.content;for(let d of c)d.type==="tool-approval-request"&&(o[d.approvalId]=d)}let r={};for(let u of t.content)u.type==="tool-result"&&(r[u.toolCallId]=u);let i=[],s=[],l=t.content.filter(u=>u.type==="tool-approval-response");for(let u of l){let c=o[u.approvalId];if(c==null)throw new yF({approvalId:u.approvalId});if(r[c.toolCallId]!=null)continue;let d=n[c.toolCallId];if(d==null)throw new LE({toolCallId:c.toolCallId,approvalId:c.approvalId});let m={approvalRequest:c,approvalResponse:u,toolCall:d};u.approved?i.push(m):s.push(m)}return{approvedToolApprovals:i,deniedToolApprovals:s}}function xy(){var e,t;return(t=(e=globalThis?.performance)==null?void 0:e.now())!=null?t:Date.now()}async function K2({toolCall:e,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:i,experimental_context:s,stepNumber:l,model:u,onPreliminaryToolResult:c,onToolCallStart:d,onToolCallFinish:m}){let{toolName:_,toolCallId:h,input:b}=e,k=t?.[_];if(k?.execute==null)return;let I={stepNumber:l,model:u,toolCall:e,messages:r,abortSignal:i,functionId:o?.functionId,metadata:o?.metadata,experimental_context:s};return Iy({name:"ai.toolCall",attributes:ci({telemetry:o,attributes:{...Ty({operationId:"ai.toolCall",telemetry:o}),"ai.toolCall.name":_,"ai.toolCall.id":h,"ai.toolCall.args":{output:()=>JSON.stringify(b)}}}),tracer:n,fn:async C=>{let g;await di({event:I,callbacks:d});let v=xy();try{let O=r$({execute:k.execute.bind(k),input:b,options:{toolCallId:h,messages:r,abortSignal:i,experimental_context:s}});for await(let N of O)N.type==="preliminary"?c?.({...e,type:"tool-result",output:N.output,preliminary:!0}):g=N.output}catch(O){let N=xy()-v;return await di({event:{...I,success:!1,error:O,durationMs:N},callbacks:m}),_R(C,O),{type:"tool-error",toolCallId:h,toolName:_,input:b,error:O,dynamic:k.type==="dynamic",...e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},...e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{}}}let R=xy()-v;await di({event:{...I,success:!0,output:g,durationMs:R},callbacks:m});try{C.setAttributes(await ci({telemetry:o,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(g)}}}))}catch{}return{type:"tool-result",toolCallId:h,toolName:_,input:b,output:g,dynamic:k.type==="dynamic",...e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},...e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{}}}})}function SE(e){let t=e.filter(n=>n.type==="reasoning");return t.length===0?void 0:t.map(n=>n.text).join(` +`)}function TE(e){let t=e.filter(n=>n.type==="text");if(t.length!==0)return t.map(n=>n.text).join("")}var Y2=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return this.base64Data==null&&(this.base64Data=_n(this.uint8ArrayData)),this.base64Data}get uint8Array(){return this.uint8ArrayData==null&&(this.uint8ArrayData=nn(this.base64Data)),this.uint8ArrayData}};async function X2({tool:e,toolCall:t,messages:n,experimental_context:o}){return e.needsApproval==null?!1:typeof e.needsApproval=="boolean"?e.needsApproval:await e.needsApproval(t.input,{toolCallId:t.toolCallId,messages:n,experimental_context:o})}var Q2={};dF(Q2,{array:()=>r6,choice:()=>n6,json:()=>o6,object:()=>t6,text:()=>xR});function e6(e){let t=["ROOT"],n=-1,o=null;function r(u,c,d){switch(u){case'"':{n=c,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,o=c,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function i(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let u=0;u=0;u--)switch(t[u]){case"INSIDE_STRING":{l+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{let d=e.substring(o,e.length);"true".startsWith(d)?l+="true".slice(d.length):"false".startsWith(d)?l+="false".slice(d.length):"null".startsWith(d)&&(l+="null".slice(d.length))}}return l}async function id(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await wr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await wr({text:e6(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var xR=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),t6=({schema:e,name:t,description:n})=>{let o=Un(e);return{name:"object",responseFormat:ft(o.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:r},i){let s=await wr({text:r});if(!s.success)throw new bo({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});let l=await Qt({value:s.value,schema:o});if(!l.success)throw new bo({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return l.value},async parsePartialOutput({text:r}){let i=await id(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},r6=({element:e,name:t,description:n})=>{let o=Un(e);return{name:"array",responseFormat:ft(o.jsonSchema).then(r=>{let{$schema:i,...s}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:r},i){let s=await wr({text:r});if(!s.success)throw new bo({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});let l=s.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))throw new bo({message:"No object generated: response did not match schema.",cause:new Qr({value:l,cause:"response must be an object with an elements array"}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});for(let u of l.elements){let c=await Qt({value:u,schema:o});if(!c.success)throw new bo({message:"No object generated: response did not match schema.",cause:c.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason})}return l.elements},async parsePartialOutput({text:r}){let i=await id(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let s=i.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;let l=i.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,u=[];for(let c of l){let d=await Qt({value:c,schema:o});d.success&&u.push(d.value)}return{partial:u}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:i},s){if(i!=null)for(;r({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:o},r){let i=await wr({text:o});if(!i.success)throw new bo({message:"No object generated: could not parse the response.",cause:i.error,text:o,response:r.response,usage:r.usage,finishReason:r.finishReason});let s=i.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!e.includes(s.result))throw new bo({message:"No object generated: response did not match schema.",cause:new Qr({value:s,cause:"response must be an object that contains a choice value."}),text:o,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.result},async parsePartialOutput({text:o}){let r=await id(o);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=r.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;let s=e.filter(l=>l.startsWith(i.result));return r.state==="successful-parse"?s.includes(i.result)?{partial:i.result}:void 0:s.length===1?{partial:s[0]}:void 0}}},createElementStreamTransform(){}}),o6=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},o){let r=await wr({text:n});if(!r.success)throw new bo({message:"No object generated: could not parse the response.",cause:r.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return r.value},async parsePartialOutput({text:n}){let o=await id(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return o.value===void 0?void 0:{partial:o.value}}},createElementStreamTransform(){}});async function i6({toolCall:e,tools:t,repairToolCall:n,system:o,messages:r}){try{if(t==null){if(e.providerExecuted&&e.dynamic)return await kR(e);throw new ky({toolName:e.toolName})}try{return await IE({toolCall:e,tools:t})}catch(i){if(n==null||!(ky.isInstance(i)||$y.isInstance(i)))throw i;let s=null;try{s=await n({toolCall:e,tools:t,inputSchema:async({toolName:l})=>{let{inputSchema:u}=t[l];return await Un(u).jsonSchema},system:o,messages:r,error:i})}catch(l){throw new ZF({cause:l,originalError:i})}if(s==null)throw i;return await IE({toolCall:s,tools:t})}}catch(i){let s=await wr({text:e.input}),l=s.success?s.value:e.input,u=t?.[e.toolName];return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:l,dynamic:!0,invalid:!0,error:i,title:u?.title,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,...u?.metadata!=null?{toolMetadata:u.metadata}:{}}}}async function kR(e){let t=e.input.trim()===""?{success:!0,value:{}}:await wr({text:e.input});if(t.success===!1)throw new $y({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function IE({toolCall:e,tools:t}){let n=e.toolName,o=t[n];if(o==null){if(e.providerExecuted&&e.dynamic)return await kR(e);throw new ky({toolName:e.toolName,availableTools:Object.keys(t)})}let r=Un(o.inputSchema),i=e.input.trim()===""?await Qt({value:{},schema:r}):await wr({text:e.input,schema:r});if(i.success===!1)throw new $y({toolName:n,toolInput:e.input,cause:i.error});return o.type==="dynamic"?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,...o.metadata!=null?{toolMetadata:o.metadata}:{},dynamic:!0,title:o.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,...o.metadata!=null?{toolMetadata:o.metadata}:{},title:o.title}}var a6=class{constructor({stepNumber:e,model:t,functionId:n,metadata:o,experimental_context:r,content:i,finishReason:s,rawFinishReason:l,usage:u,warnings:c,request:d,response:m,providerMetadata:_}){this.stepNumber=e,this.model=t,this.functionId=n,this.metadata=o,this.experimental_context=r,this.content=i,this.finishReason=s,this.rawFinishReason=l,this.usage=u,this.warnings=c,this.request=d,this.response=m,this.providerMetadata=_}get text(){return this.content.filter(e=>e.type==="text").map(e=>e.text).join("")}get reasoning(){return this.content.filter(e=>e.type==="reasoning")}get reasoningText(){return this.reasoning.length===0?void 0:this.reasoning.map(e=>e.text).join("")}get files(){return this.content.filter(e=>e.type==="file").map(e=>e.file)}get sources(){return this.content.filter(e=>e.type==="source")}get toolCalls(){return this.content.filter(e=>e.type==="tool-call")}get staticToolCalls(){return this.toolCalls.filter(e=>e.dynamic!==!0)}get dynamicToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!0)}get toolResults(){return this.content.filter(e=>e.type==="tool-result")}get staticToolResults(){return this.toolResults.filter(e=>e.dynamic!==!0)}get dynamicToolResults(){return this.toolResults.filter(e=>e.dynamic===!0)}};function s6(e){return({steps:t})=>t.length===e}async function l6({stopConditions:e,steps:t}){return(await Promise.all(e.map(n=>n({steps:t})))).some(n=>n)}async function u6({content:e,tools:t}){let n=[],o=[];for(let i of e)if(i.type!=="source"&&!((i.type==="tool-result"||i.type==="tool-error")&&!i.providerExecuted)&&!(i.type==="text"&&i.text.length===0))switch(i.type){case"text":o.push({type:"text",text:i.text,providerOptions:i.providerMetadata});break;case"reasoning":o.push({type:"reasoning",text:i.text,providerOptions:i.providerMetadata});break;case"file":o.push({type:"file",data:i.file.base64,mediaType:i.file.mediaType,providerOptions:i.providerMetadata});break;case"tool-call":o.push({type:"tool-call",toolCallId:i.toolCallId,toolName:i.toolName,input:i.invalid&&typeof i.input!="object"?{}:i.input,providerExecuted:i.providerExecuted,providerOptions:i.providerMetadata});break;case"tool-result":{let s=await od({toolCallId:i.toolCallId,input:i.input,tool:t?.[i.toolName],output:i.output,errorMode:"none"});o.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:s,providerOptions:i.providerMetadata});break}case"tool-error":{let s=await od({toolCallId:i.toolCallId,input:i.input,tool:t?.[i.toolName],output:i.error,errorMode:"json"});o.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:s,providerOptions:i.providerMetadata});break}case"tool-approval-request":o.push({type:"tool-approval-request",approvalId:i.approvalId,toolCallId:i.toolCall.toolCallId});break}o.length>0&&n.push({role:"assistant",content:o});let r=[];for(let i of e){if(!(i.type==="tool-result"||i.type==="tool-error")||i.providerExecuted)continue;let s=await od({toolCallId:i.toolCallId,input:i.input,tool:t?.[i.toolName],output:i.type==="tool-result"?i.output:i.error,errorMode:i.type==="tool-error"?"text":"none"});r.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:s,...i.providerMetadata!=null?{providerOptions:i.providerMetadata}:{}})}return r.length>0&&n.push({role:"tool",content:r}),n}function c6(...e){let t=e.filter(o=>o!=null);if(t.length===0)return;if(t.length===1)return t[0];let n=new AbortController;for(let o of t){if(o.aborted)return n.abort(o.reason),n.signal;o.addEventListener("abort",()=>{n.abort(o.reason)},{once:!0})}return n.signal}var d6=qn({prefix:"aitxt",size:24});async function SR({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:i,allowSystemInMessages:s,maxRetries:l,abortSignal:u,timeout:c,headers:d,stopWhen:m=s6(1),experimental_output:_,output:h=_,experimental_telemetry:b,providerOptions:k,experimental_activeTools:I,activeTools:C=I,experimental_prepareStep:g,prepareStep:v=g,experimental_repairToolCall:R,experimental_download:O,experimental_context:N,experimental_include:K,_internal:{generateId:ee=d6}={},experimental_onStart:E,experimental_onStepStart:le,experimental_onToolCallStart:z,experimental_onToolCallFinish:ye,onStepFinish:D,onFinish:U,...A}){let L=_E(e),B=V2(),ne=Ys(m),W=pR(c),pe=p2(c),Pe=pe!=null?new AbortController:void 0,Te=c6(u,W!=null?AbortSignal.timeout(W):void 0,Pe?.signal),{maxRetries:Le,retry:oe}=B2({maxRetries:l,abortSignal:Te}),J=xE(A),ge=on(d??{},`ai/${fR}`),we=z2({model:L,telemetry:b,headers:ge,settings:{...J,maxRetries:Le}}),se={provider:L.provider,modelId:L.modelId},me=await M2({system:o,prompt:r,messages:i,allowSystemInMessages:s}),F=B(b?.integrations);await di({event:{model:se,system:o,prompt:r,messages:i,tools:t,toolChoice:n,activeTools:C,maxOutputTokens:J.maxOutputTokens,temperature:J.temperature,topP:J.topP,topK:J.topK,presencePenalty:J.presencePenalty,frequencyPenalty:J.frequencyPenalty,stopSequences:J.stopSequences,seed:J.seed,maxRetries:Le,timeout:c,headers:d,providerOptions:k,stopWhen:m,output:h,abortSignal:u,include:K,functionId:b?.functionId,metadata:b?.metadata,experimental_context:N},callbacks:[E,F.onStart]});let xe=L2(b);try{return await Iy({name:"ai.generateText",attributes:ci({telemetry:b,attributes:{...Ty({operationId:"ai.generateText",telemetry:b}),...we,"ai.model.provider":L.provider,"ai.model.id":L.modelId,"ai.prompt":{input:()=>JSON.stringify({system:o,prompt:r,messages:i})}}}),tracer:xe,fn:async je=>{var Me,er,lr,Sr,ur,et,Mt,cr,ln,un,Jt,Jr,Br,Dr,Gr,x,y,q,G,ve;let Be=me.messages,We=[],{approvedToolApprovals:st,deniedToolApprovals:lt}=G2({messages:Be}),ze=st.filter(rr=>!rr.toolCall.providerExecuted);if(lt.length>0||ze.length>0){let rr=await $E({toolCalls:ze.map(P=>P.toolCall),tools:t,tracer:xe,telemetry:b,messages:Be,abortSignal:Te,experimental_context:N,stepNumber:0,model:se,onToolCallStart:[z,F.onToolCallStart],onToolCallFinish:[ye,F.onToolCallFinish]}),nr=[];for(let P of rr){let f=await od({toolCallId:P.toolCallId,input:P.input,tool:t?.[P.toolName],output:P.type==="tool-result"?P.output:P.error,errorMode:P.type==="tool-error"?"text":"none"});nr.push({type:"tool-result",toolCallId:P.toolCallId,toolName:P.toolName,output:f})}for(let P of lt)nr.push({type:"tool-result",toolCallId:P.toolCall.toolCallId,toolName:P.toolCall.toolName,output:{type:"execution-denied",reason:P.approvalResponse.reason,...P.toolCall.providerExecuted&&{providerOptions:{openai:{approvalId:P.approvalResponse.approvalId}}}}});We.push({role:"tool",content:nr})}let tt=xE(A),$e,ut=[],bt=[],ct=[],Zn=new Map;do{let rr=pe!=null?setTimeout(()=>Pe.abort(),pe):void 0;try{let nr=[...Be,...We],P=await v?.({model:L,steps:ct,stepNumber:ct.length,messages:nr,experimental_context:N}),f=_E((Me=P?.model)!=null?Me:L),T={provider:f.provider,modelId:f.modelId},$=await _2({prompt:{system:(er=P?.system)!=null?er:me.system,messages:(lr=P?.messages)!=null?lr:nr},supportedUrls:await f.supportedUrls,download:O});N=(Sr=P?.experimental_context)!=null?Sr:N;let w=(ur=P?.activeTools)!=null?ur:C,{toolChoice:p,tools:M}=await S2({tools:t,toolChoice:(et=P?.toolChoice)!=null?et:n,activeTools:w}),H=(Mt=P?.messages)!=null?Mt:nr,Oe=(cr=P?.system)!=null?cr:me.system,yt=bR(k,P?.providerOptions);await di({event:{stepNumber:ct.length,model:T,system:Oe,messages:H,tools:t,toolChoice:p,activeTools:w,steps:[...ct],providerOptions:yt,timeout:c,headers:d,stopWhen:m,output:h,abortSignal:u,include:K,functionId:b?.functionId,metadata:b?.metadata,experimental_context:N},callbacks:[le,F.onStepStart]}),$e=await oe(()=>{var Ve;return Iy({name:"ai.generateText.doGenerate",attributes:ci({telemetry:b,attributes:{...Ty({operationId:"ai.generateText.doGenerate",telemetry:b}),...we,"ai.model.provider":f.provider,"ai.model.id":f.modelId,"ai.prompt.messages":{input:()=>F2($)},"ai.prompt.tools":{input:()=>M?.map(Ir=>JSON.stringify(Ir))},"ai.prompt.toolChoice":{input:()=>p!=null?JSON.stringify(p):void 0},"gen_ai.system":f.provider,"gen_ai.request.model":f.modelId,"gen_ai.request.frequency_penalty":A.frequencyPenalty,"gen_ai.request.max_tokens":A.maxOutputTokens,"gen_ai.request.presence_penalty":A.presencePenalty,"gen_ai.request.stop_sequences":A.stopSequences,"gen_ai.request.temperature":(Ve=A.temperature)!=null?Ve:void 0,"gen_ai.request.top_k":A.topK,"gen_ai.request.top_p":A.topP}}),tracer:xe,fn:async Ir=>{var ud,Ia,qy,Uy,Ly,Fy,Zy,Vy;let wt=await f.doGenerate({...tt,tools:M,toolChoice:p,responseFormat:await h?.responseFormat,prompt:$,providerOptions:yt,abortSignal:Te,headers:ge}),hi={id:(Ia=(ud=wt.response)==null?void 0:ud.id)!=null?Ia:ee(),timestamp:(Uy=(qy=wt.response)==null?void 0:qy.timestamp)!=null?Uy:new Date,modelId:(Fy=(Ly=wt.response)==null?void 0:Ly.modelId)!=null?Fy:f.modelId,headers:(Zy=wt.response)==null?void 0:Zy.headers,body:(Vy=wt.response)==null?void 0:Vy.body},jR=kE(wt.usage);return Ir.setAttributes(await ci({telemetry:b,attributes:{"ai.response.finishReason":wt.finishReason.unified,"ai.response.text":{output:()=>TE(wt.content)},"ai.response.reasoning":{output:()=>SE(wt.content)},"ai.response.toolCalls":{output:()=>{let Wy=PE(wt.content);return Wy==null?void 0:JSON.stringify(Wy)}},"ai.response.id":hi.id,"ai.response.model":hi.modelId,"ai.response.timestamp":hi.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(wt.providerMetadata),"ai.usage.inputTokens":wt.usage.inputTokens.total,"ai.usage.inputTokenDetails.noCacheTokens":wt.usage.inputTokens.noCache,"ai.usage.inputTokenDetails.cacheReadTokens":wt.usage.inputTokens.cacheRead,"ai.usage.inputTokenDetails.cacheWriteTokens":wt.usage.inputTokens.cacheWrite,"ai.usage.outputTokens":wt.usage.outputTokens.total,"ai.usage.outputTokenDetails.textTokens":wt.usage.outputTokens.text,"ai.usage.outputTokenDetails.reasoningTokens":wt.usage.outputTokens.reasoning,"ai.usage.totalTokens":jR.totalTokens,"ai.usage.reasoningTokens":wt.usage.outputTokens.reasoning,"ai.usage.cachedInputTokens":wt.usage.inputTokens.cacheRead,"gen_ai.response.finish_reasons":[wt.finishReason.unified],"gen_ai.response.id":hi.id,"gen_ai.response.model":hi.modelId,"gen_ai.usage.input_tokens":wt.usage.inputTokens.total,"gen_ai.usage.output_tokens":wt.usage.outputTokens.total}})),{...wt,response:hi}}})});let Ke=await Promise.all($e.content.filter(Ve=>Ve.type==="tool-call").map(Ve=>i6({toolCall:Ve,tools:t,repairToolCall:R,system:o,messages:nr}))),or={};for(let Ve of Ke){if(Ve.invalid)continue;let Ir=t?.[Ve.toolName];Ir!=null&&(Ir?.onInputAvailable!=null&&await Ir.onInputAvailable({input:Ve.input,toolCallId:Ve.toolCallId,messages:nr,abortSignal:Te,experimental_context:N}),await X2({tool:Ir,toolCall:Ve,messages:nr,experimental_context:N})&&(or[Ve.toolCallId]={type:"tool-approval-request",approvalId:ee(),toolCall:Ve}))}let Tr=Ke.filter(Ve=>Ve.invalid&&Ve.dynamic);bt=[];for(let Ve of Tr)bt.push({type:"tool-error",toolCallId:Ve.toolCallId,toolName:Ve.toolName,input:Ve.input,error:Lc(Ve.error),dynamic:!0});ut=Ke.filter(Ve=>!Ve.providerExecuted),t!=null&&bt.push(...await $E({toolCalls:ut.filter(Ve=>!Ve.invalid&&or[Ve.toolCallId]==null),tools:t,tracer:xe,telemetry:b,messages:nr,abortSignal:Te,experimental_context:N,stepNumber:ct.length,model:T,onToolCallStart:[z,F.onToolCallStart],onToolCallFinish:[ye,F.onToolCallFinish]}));for(let Ve of Ke){if(!Ve.providerExecuted)continue;let Ir=t?.[Ve.toolName];Ir?.type==="provider"&&Ir.supportsDeferredResults&&($e.content.some(Ia=>Ia.type==="tool-result"&&Ia.toolCallId===Ve.toolCallId)||Zn.set(Ve.toolCallId,{toolName:Ve.toolName}))}for(let Ve of $e.content)Ve.type==="tool-result"&&Zn.delete(Ve.toolCallId);let jr=f6({content:$e.content,toolCalls:Ke,toolOutputs:bt,toolApprovalRequests:Object.values(or),tools:t});We.push(...await u6({content:jr,tools:t}));let Fe=(ln=K?.requestBody)==null||ln?(un=$e.request)!=null?un:{}:{...$e.request,body:void 0},Vn={...$e.response,messages:structuredClone(We),body:(Jt=K?.responseBody)==null||Jt?(Jr=$e.response)==null?void 0:Jr.body:void 0},mi=ct.length,Ta=new a6({stepNumber:mi,model:T,functionId:b?.functionId,metadata:b?.metadata,experimental_context:N,content:jr,finishReason:$e.finishReason.unified,rawFinishReason:$e.finishReason.raw,usage:kE($e.usage),warnings:$e.warnings,providerMetadata:$e.providerMetadata,request:Fe,response:Vn});uR({warnings:(Br=$e.warnings)!=null?Br:[],provider:T.provider,model:T.modelId}),ct.push(Ta),await di({event:Ta,callbacks:[D,F.onStepFinish]})}finally{rr!=null&&clearTimeout(rr)}}while((ut.length>0&&bt.length===ut.length||Zn.size>0)&&!await l6({stopConditions:ne,steps:ct}));je.setAttributes(await ci({telemetry:b,attributes:{"ai.response.finishReason":$e.finishReason.unified,"ai.response.text":{output:()=>TE($e.content)},"ai.response.reasoning":{output:()=>SE($e.content)},"ai.response.toolCalls":{output:()=>{let rr=PE($e.content);return rr==null?void 0:JSON.stringify(rr)}},"ai.response.providerMetadata":JSON.stringify($e.providerMetadata)}}));let Ge=ct[ct.length-1],tr=ct.reduce((rr,nr)=>W2(rr,nr.usage),{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0});je.setAttributes(await ci({telemetry:b,attributes:{"ai.usage.inputTokens":tr.inputTokens,"ai.usage.inputTokenDetails.noCacheTokens":(Dr=tr.inputTokenDetails)==null?void 0:Dr.noCacheTokens,"ai.usage.inputTokenDetails.cacheReadTokens":(Gr=tr.inputTokenDetails)==null?void 0:Gr.cacheReadTokens,"ai.usage.inputTokenDetails.cacheWriteTokens":(x=tr.inputTokenDetails)==null?void 0:x.cacheWriteTokens,"ai.usage.outputTokens":tr.outputTokens,"ai.usage.outputTokenDetails.textTokens":(y=tr.outputTokenDetails)==null?void 0:y.textTokens,"ai.usage.outputTokenDetails.reasoningTokens":(q=tr.outputTokenDetails)==null?void 0:q.reasoningTokens,"ai.usage.totalTokens":tr.totalTokens,"ai.usage.reasoningTokens":(G=tr.outputTokenDetails)==null?void 0:G.reasoningTokens,"ai.usage.cachedInputTokens":(ve=tr.inputTokenDetails)==null?void 0:ve.cacheReadTokens}})),await di({event:{stepNumber:Ge.stepNumber,model:Ge.model,functionId:Ge.functionId,metadata:Ge.metadata,experimental_context:Ge.experimental_context,finishReason:Ge.finishReason,rawFinishReason:Ge.rawFinishReason,usage:Ge.usage,content:Ge.content,text:Ge.text,reasoningText:Ge.reasoningText,reasoning:Ge.reasoning,files:Ge.files,sources:Ge.sources,toolCalls:Ge.toolCalls,staticToolCalls:Ge.staticToolCalls,dynamicToolCalls:Ge.dynamicToolCalls,toolResults:Ge.toolResults,staticToolResults:Ge.staticToolResults,dynamicToolResults:Ge.dynamicToolResults,request:Ge.request,response:Ge.response,warnings:Ge.warnings,providerMetadata:Ge.providerMetadata,steps:ct,totalUsage:tr},callbacks:[U,F.onFinish]});let Sa;return Ge.finishReason==="stop"&&(Sa=await(h??xR()).parseCompleteOutput({text:Ge.text},{response:Ge.response,usage:Ge.usage,finishReason:Ge.finishReason})),new p6({steps:ct,totalUsage:tr,output:Sa})}})}catch(je){throw A2(je)}}async function $E({toolCalls:e,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:i,experimental_context:s,stepNumber:l,model:u,onToolCallStart:c,onToolCallFinish:d}){return(await Promise.all(e.map(async _=>K2({toolCall:_,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:i,experimental_context:s,stepNumber:l,model:u,onToolCallStart:c,onToolCallFinish:d})))).filter(_=>_!=null)}var p6=class{constructor(e){this.steps=e.steps,this._output=e.output,this.totalUsage=e.totalUsage}get finalStep(){return this.steps[this.steps.length-1]}get content(){return this.finalStep.content}get text(){return this.finalStep.text}get files(){return this.finalStep.files}get reasoningText(){return this.finalStep.reasoningText}get reasoning(){return this.finalStep.reasoning}get toolCalls(){return this.finalStep.toolCalls}get staticToolCalls(){return this.finalStep.staticToolCalls}get dynamicToolCalls(){return this.finalStep.dynamicToolCalls}get toolResults(){return this.finalStep.toolResults}get staticToolResults(){return this.finalStep.staticToolResults}get dynamicToolResults(){return this.finalStep.dynamicToolResults}get sources(){return this.finalStep.sources}get finishReason(){return this.finalStep.finishReason}get rawFinishReason(){return this.finalStep.rawFinishReason}get warnings(){return this.finalStep.warnings}get providerMetadata(){return this.finalStep.providerMetadata}get response(){return this.finalStep.response}get request(){return this.finalStep.request}get usage(){return this.finalStep.usage}get experimental_output(){return this.output}get output(){if(this._output==null)throw new PF;return this._output}};function PE(e){let t=e.filter(n=>n.type==="tool-call");if(t.length!==0)return t.map(n=>({toolCallId:n.toolCallId,toolName:n.toolName,input:n.input}))}function f6({content:e,toolCalls:t,toolOutputs:n,toolApprovalRequests:o,tools:r}){let i=[];for(let s of e)switch(s.type){case"text":case"reasoning":case"source":i.push(s);break;case"file":{i.push({type:"file",file:new Y2(s),...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{}});break}case"tool-call":{i.push(t.find(l=>l.toolCallId===s.toolCallId));break}case"tool-result":{let l=t.find(u=>u.toolCallId===s.toolCallId);if(l==null){let u=r?.[s.toolName];if(!(u?.type==="provider"&&u.supportsDeferredResults))throw new Error(`Tool call ${s.toolCallId} not found.`);s.isError?i.push({type:"tool-error",toolCallId:s.toolCallId,toolName:s.toolName,input:void 0,error:s.result,providerExecuted:!0,dynamic:s.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...u?.metadata!=null?{toolMetadata:u.metadata}:{}}):i.push({type:"tool-result",toolCallId:s.toolCallId,toolName:s.toolName,input:void 0,output:s.result,providerExecuted:!0,dynamic:s.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...u?.metadata!=null?{toolMetadata:u.metadata}:{}});break}s.isError?i.push({type:"tool-error",toolCallId:s.toolCallId,toolName:s.toolName,input:l.input,error:s.result,providerExecuted:!0,dynamic:l.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...l.toolMetadata!=null?{toolMetadata:l.toolMetadata}:{}}):i.push({type:"tool-result",toolCallId:s.toolCallId,toolName:s.toolName,input:l.input,output:s.result,providerExecuted:!0,dynamic:l.dynamic,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{},...l.toolMetadata!=null?{toolMetadata:l.toolMetadata}:{}});break}case"tool-approval-request":{let l=t.find(u=>u.toolCallId===s.toolCallId);if(l==null)throw new LE({toolCallId:s.toolCallId,approvalId:s.approvalId});i.push({type:"tool-approval-request",approvalId:s.approvalId,toolCall:l});break}}return[...i,...n,...o]}var s8=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)} `)},flush(e){e.enqueue(`data: [DONE] -`)}})}};var Ks=a.record(a.string(),ci.optional()),D5=X(()=>Y(a.union([a.strictObject({type:a.literal("text-start"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("text-delta"),id:a.string(),delta:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("text-end"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("error"),errorText:a.string()}),a.strictObject({type:a.literal("tool-input-start"),toolCallId:a.string(),toolName:a.string(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),title:a.string().optional()}),a.strictObject({type:a.literal("tool-input-delta"),toolCallId:a.string(),inputTextDelta:a.string()}),a.strictObject({type:a.literal("tool-input-available"),toolCallId:a.string(),toolName:a.string(),input:a.unknown(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),title:a.string().optional()}),a.strictObject({type:a.literal("tool-input-error"),toolCallId:a.string(),toolName:a.string(),input:a.unknown(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),errorText:a.string(),title:a.string().optional()}),a.strictObject({type:a.literal("tool-approval-request"),approvalId:a.string(),toolCallId:a.string()}),a.strictObject({type:a.literal("tool-output-available"),toolCallId:a.string(),output:a.unknown(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),preliminary:a.boolean().optional()}),a.strictObject({type:a.literal("tool-output-error"),toolCallId:a.string(),errorText:a.string(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional()}),a.strictObject({type:a.literal("tool-output-denied"),toolCallId:a.string()}),a.strictObject({type:a.literal("reasoning-start"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("reasoning-delta"),id:a.string(),delta:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("reasoning-end"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("source-url"),sourceId:a.string(),url:a.string(),title:a.string().optional(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("source-document"),sourceId:a.string(),mediaType:a.string(),title:a.string(),filename:a.string().optional(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("file"),url:a.string(),mediaType:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:a.string().optional(),data:a.unknown(),transient:a.boolean().optional()}),a.strictObject({type:a.literal("start-step")}),a.strictObject({type:a.literal("finish-step")}),a.strictObject({type:a.literal("start"),messageId:a.string().optional(),messageMetadata:a.unknown().optional()}),a.strictObject({type:a.literal("finish"),finishReason:a.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:a.unknown().optional()}),a.strictObject({type:a.literal("abort"),reason:a.string().optional()}),a.strictObject({type:a.literal("message-metadata"),messageMetadata:a.unknown()})])));var j5=zn({prefix:"aitxt",size:24});var kr=a.record(a.string(),ci.optional()),A5=X(()=>Y(a.array(a.object({id:a.string(),role:a.enum(["system","user","assistant"]),metadata:a.unknown().optional(),parts:a.array(a.union([a.object({type:a.literal("text"),text:a.string(),state:a.enum(["streaming","done"]).optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("reasoning"),text:a.string(),state:a.enum(["streaming","done"]).optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("source-url"),sourceId:a.string(),url:a.string(),title:a.string().optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("source-document"),sourceId:a.string(),mediaType:a.string(),title:a.string(),filename:a.string().optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("file"),mediaType:a.string(),filename:a.string().optional(),url:a.string(),providerMetadata:Se.optional()}),a.object({type:a.literal("step-start")}),a.object({type:a.string().startsWith("data-"),id:a.string().optional(),data:a.unknown()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-streaming"),input:a.unknown().optional(),providerExecuted:a.boolean().optional(),callProviderMetadata:Se.optional(),output:a.never().optional(),errorText:a.never().optional(),approval:a.never().optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-available"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.never().optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-requested"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.never().optional(),reason:a.never().optional()})}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-responded"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.boolean(),reason:a.string().optional()})}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-available"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.unknown(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),preliminary:a.boolean().optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-error"),input:a.unknown().optional(),rawInput:a.unknown().optional(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.string(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-denied"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!1),reason:a.string().optional()})}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-streaming"),providerExecuted:a.boolean().optional(),callProviderMetadata:Se.optional(),input:a.unknown().optional(),output:a.never().optional(),errorText:a.never().optional(),approval:a.never().optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-available"),providerExecuted:a.boolean().optional(),input:a.unknown(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.never().optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-requested"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.never().optional(),reason:a.never().optional()})}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-responded"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.boolean(),reason:a.string().optional()})}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-available"),providerExecuted:a.boolean().optional(),input:a.unknown(),output:a.unknown(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),preliminary:a.boolean().optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-error"),providerExecuted:a.boolean().optional(),input:a.unknown().optional(),rawInput:a.unknown().optional(),output:a.never().optional(),errorText:a.string(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-denied"),providerExecuted:a.boolean().optional(),input:a.unknown(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!1),reason:a.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var q5=zn({prefix:"aiobj",size:24});function lC(e){return({url:t,abortSignal:n})=>YE({url:t,maxBytes:e?.maxBytes,abortSignal:n})}var L5=zn({prefix:"aiobj",size:24});var F5=lC();var W2="AI_NoSuchProviderError",H2=`vercel.ai.error.${W2}`,J2=Symbol.for(H2),B2;B2=J2;var Z5=lC();function di(e){return e==="zeta"}function K2(e){return e.includes("posit.ai")||e.endsWith("/predict")?"predict":"openai"}function Y2(e){let t=e.apiKey||process.env.OPENAI_API_KEY||"",n=e.baseUrl||process.env.OPENAI_BASE_URL,o={};return e.options?.userAgent&&(o["User-Agent"]=e.options.userAgent),Uv({apiKey:t,baseURL:n,headers:o})}async function X2(e,t,n,o){let r=Y2(n),i=n.modelId,s=r.chat(i),l=e.map(c=>({role:c.role,content:c.content}));return{text:(await sC({model:s,messages:l,system:t,stopSequences:["`````\n"],temperature:.2,maxOutputTokens:n.maxOutputTokens,abortSignal:o})).text,correlationId:void 0}}async function Q2(e,t,n,o){let r=n.apiKey||process.env.BASETEN_API_KEY,i=n.accessToken;if(!i&&!r)throw new Error("No API key or access token provided for Predict API.");if(!n.baseUrl)throw new Error("No base URL provided for Predict API.");let l={Authorization:i?`Bearer ${i}`:`Api-Key ${r}`,"Content-Type":"application/json"};n.options?.userAgent&&(l["User-Agent"]=n.options.userAgent);let u=n.baseUrl;i&&(u+=n.endpointPath||"/completions/predict");let c=di(n.modelId),d;if(c){let k=[];t&&k.push(t);for(let T of e)k.push(T.content);d={prompt:k.join(` -`),max_tokens:n.maxOutputTokens,min_tokens:3}}else d={messages:[{role:"system",content:t},...e.map(k=>({role:k.role,content:k.content}))],max_tokens:n.maxOutputTokens,temperature:.2,chat_template_kwargs:{enable_thinking:!1}};let m=await fetch(u,{method:"POST",headers:l,body:JSON.stringify(d),signal:o});if(!m.ok){let k=await m.text();throw new Error(`API request failed: ${m.status} ${m.statusText} - ${k}`)}let _=m.headers.get("Eval-Correlation-Id")||void 0,h=await m.json();if(!h.choices||h.choices.length===0)throw new Error("API response did not contain any completion choices");return{text:c?h.choices[0].text??"":h.choices[0].message?.content??"",correlationId:_}}async function uC(e,t,n,o){if(!n.baseUrl)throw new Error("Configuration error, no base URL specified.");return K2(n.baseUrl)==="predict"?Q2(e,t,n,o):X2(e,t,n,o)}function wn(e){return Math.ceil(e.length/4)}async function cC(e,t){if(!t.baseUrl)return{success:!1,error:"No base URL configured"};let n={"Content-Type":"application/json"};t.accessToken?n.Authorization=`Bearer ${t.accessToken}`:t.apiKey&&(n.Authorization=`Api-Key ${t.apiKey}`),t.options?.userAgent&&(n["User-Agent"]=t.options.userAgent);let o=await fetch(`${t.baseUrl}/evaluations/completions`,{method:"POST",headers:n,body:JSON.stringify({correlation_id:e.correlationId,eval:e.feedback})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return{success:!0}}var xy=`You are a code completion assistant. You will be given a file excerpt for context and a region from that excerpt to rewrite. Predict the user's next edit by rewriting only the provided region. +`)}})}};var Ks=a.record(a.string(),pi.optional()),c8=X(()=>Y(a.union([a.strictObject({type:a.literal("text-start"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("text-delta"),id:a.string(),delta:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("text-end"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("error"),errorText:a.string()}),a.strictObject({type:a.literal("tool-input-start"),toolCallId:a.string(),toolName:a.string(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),title:a.string().optional()}),a.strictObject({type:a.literal("tool-input-delta"),toolCallId:a.string(),inputTextDelta:a.string()}),a.strictObject({type:a.literal("tool-input-available"),toolCallId:a.string(),toolName:a.string(),input:a.unknown(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),title:a.string().optional()}),a.strictObject({type:a.literal("tool-input-error"),toolCallId:a.string(),toolName:a.string(),input:a.unknown(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),errorText:a.string(),title:a.string().optional()}),a.strictObject({type:a.literal("tool-approval-request"),approvalId:a.string(),toolCallId:a.string()}),a.strictObject({type:a.literal("tool-output-available"),toolCallId:a.string(),output:a.unknown(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional(),preliminary:a.boolean().optional()}),a.strictObject({type:a.literal("tool-output-error"),toolCallId:a.string(),errorText:a.string(),providerExecuted:a.boolean().optional(),providerMetadata:Se.optional(),toolMetadata:Ks.optional(),dynamic:a.boolean().optional()}),a.strictObject({type:a.literal("tool-output-denied"),toolCallId:a.string()}),a.strictObject({type:a.literal("reasoning-start"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("reasoning-delta"),id:a.string(),delta:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("reasoning-end"),id:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("source-url"),sourceId:a.string(),url:a.string(),title:a.string().optional(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("source-document"),sourceId:a.string(),mediaType:a.string(),title:a.string(),filename:a.string().optional(),providerMetadata:Se.optional()}),a.strictObject({type:a.literal("file"),url:a.string(),mediaType:a.string(),providerMetadata:Se.optional()}),a.strictObject({type:a.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:a.string().optional(),data:a.unknown(),transient:a.boolean().optional()}),a.strictObject({type:a.literal("start-step")}),a.strictObject({type:a.literal("finish-step")}),a.strictObject({type:a.literal("start"),messageId:a.string().optional(),messageMetadata:a.unknown().optional()}),a.strictObject({type:a.literal("finish"),finishReason:a.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:a.unknown().optional()}),a.strictObject({type:a.literal("abort"),reason:a.string().optional()}),a.strictObject({type:a.literal("message-metadata"),messageMetadata:a.unknown()})])));var d8=qn({prefix:"aitxt",size:24});var kr=a.record(a.string(),pi.optional()),m8=X(()=>Y(a.array(a.object({id:a.string(),role:a.enum(["system","user","assistant"]),metadata:a.unknown().optional(),parts:a.array(a.union([a.object({type:a.literal("text"),text:a.string(),state:a.enum(["streaming","done"]).optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("reasoning"),text:a.string(),state:a.enum(["streaming","done"]).optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("source-url"),sourceId:a.string(),url:a.string(),title:a.string().optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("source-document"),sourceId:a.string(),mediaType:a.string(),title:a.string(),filename:a.string().optional(),providerMetadata:Se.optional()}),a.object({type:a.literal("file"),mediaType:a.string(),filename:a.string().optional(),url:a.string(),providerMetadata:Se.optional()}),a.object({type:a.literal("step-start")}),a.object({type:a.string().startsWith("data-"),id:a.string().optional(),data:a.unknown()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-streaming"),input:a.unknown().optional(),providerExecuted:a.boolean().optional(),callProviderMetadata:Se.optional(),output:a.never().optional(),errorText:a.never().optional(),approval:a.never().optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-available"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.never().optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-requested"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.never().optional(),reason:a.never().optional()})}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-responded"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.boolean(),reason:a.string().optional()})}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-available"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.unknown(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),preliminary:a.boolean().optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-error"),input:a.unknown().optional(),rawInput:a.unknown().optional(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.string(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.literal("dynamic-tool"),toolName:a.string(),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-denied"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!1),reason:a.string().optional()})}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-streaming"),providerExecuted:a.boolean().optional(),callProviderMetadata:Se.optional(),input:a.unknown().optional(),output:a.never().optional(),errorText:a.never().optional(),approval:a.never().optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("input-available"),providerExecuted:a.boolean().optional(),input:a.unknown(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.never().optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-requested"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.never().optional(),reason:a.never().optional()})}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("approval-responded"),input:a.unknown(),providerExecuted:a.boolean().optional(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.boolean(),reason:a.string().optional()})}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-available"),providerExecuted:a.boolean().optional(),input:a.unknown(),output:a.unknown(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),preliminary:a.boolean().optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-error"),providerExecuted:a.boolean().optional(),input:a.unknown().optional(),rawInput:a.unknown().optional(),output:a.never().optional(),errorText:a.string(),callProviderMetadata:Se.optional(),resultProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!0),reason:a.string().optional()}).optional()}),a.object({type:a.string().startsWith("tool-"),toolCallId:a.string(),toolMetadata:kr.optional(),state:a.literal("output-denied"),providerExecuted:a.boolean().optional(),input:a.unknown(),output:a.never().optional(),errorText:a.never().optional(),callProviderMetadata:Se.optional(),approval:a.object({id:a.string(),approved:a.literal(!1),reason:a.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var g8=qn({prefix:"aiobj",size:24});function TR(e){return({url:t,abortSignal:n})=>mR({url:t,maxBytes:e?.maxBytes,abortSignal:n})}var y8=qn({prefix:"aiobj",size:24});var _8=TR();var m6="AI_NoSuchProviderError",h6=`vercel.ai.error.${m6}`,g6=Symbol.for(h6),v6;v6=g6;var b8=TR();function fi(e){return e==="zeta"}function _6(e){return e.includes("posit.ai")||e.endsWith("/predict")?"predict":"openai"}function b6(e){let t=e.apiKey||process.env.OPENAI_API_KEY||"",n=e.baseUrl||process.env.OPENAI_BASE_URL,o={};return e.options?.userAgent&&(o["User-Agent"]=e.options.userAgent),Jv({apiKey:t,baseURL:n,headers:o})}async function w6(e,t,n,o){let r=b6(n),i=n.modelId,s=r.chat(i),l=e.map(c=>({role:c.role,content:c.content}));return{text:(await SR({model:s,messages:l,system:t,stopSequences:["`````\n"],temperature:.2,maxOutputTokens:n.maxOutputTokens,abortSignal:o})).text,correlationId:void 0}}async function x6(e,t,n,o){let r=n.apiKey||process.env.BASETEN_API_KEY,i=n.accessToken;if(!i&&!r)throw new Error("No API key or access token provided for Predict API.");if(!n.baseUrl)throw new Error("No base URL provided for Predict API.");let l={Authorization:i?`Bearer ${i}`:`Api-Key ${r}`,"Content-Type":"application/json"};n.options?.userAgent&&(l["User-Agent"]=n.options.userAgent);let u=n.baseUrl;i&&(u+=n.endpointPath||"/completions/predict");let c=fi(n.modelId),d;if(c){let k=[];t&&k.push(t);for(let I of e)k.push(I.content);d={prompt:k.join(` +`),max_tokens:n.maxOutputTokens,min_tokens:3}}else d={messages:[{role:"system",content:t},...e.map(k=>({role:k.role,content:k.content}))],max_tokens:n.maxOutputTokens,temperature:.2,chat_template_kwargs:{enable_thinking:!1}};let m=await fetch(u,{method:"POST",headers:l,body:JSON.stringify(d),signal:o});if(!m.ok){let k=await m.text();throw new Error(`API request failed: ${m.status} ${m.statusText} - ${k}`)}let _=m.headers.get("Eval-Correlation-Id")||void 0,h=await m.json();if(!h.choices||h.choices.length===0)throw new Error("API response did not contain any completion choices");return{text:c?h.choices[0].text??"":h.choices[0].message?.content??"",correlationId:_}}async function IR(e,t,n,o){if(!n.baseUrl)throw new Error("Configuration error, no base URL specified.");return _6(n.baseUrl)==="predict"?x6(e,t,n,o):w6(e,t,n,o)}function xn(e){return Math.ceil(e.length/4)}async function $R(e,t){if(!t.baseUrl)return{success:!1,error:"No base URL configured"};let n={"Content-Type":"application/json"};t.accessToken?n.Authorization=`Bearer ${t.accessToken}`:t.apiKey&&(n.Authorization=`Api-Key ${t.apiKey}`),t.options?.userAgent&&(n["User-Agent"]=t.options.userAgent);let o=await fetch(`${t.baseUrl}/evaluations/completions`,{method:"POST",headers:n,body:JSON.stringify({correlation_id:e.correlationId,eval:e.feedback})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return{success:!0}}var Ey=`You are a code completion assistant. You will be given a file excerpt for context and a region from that excerpt to rewrite. Predict the user's next edit by rewriting only the provided region. Output the rewritten region wrapped in a code fence using exactly 5 backticks. Remove any cursor markers. Your output replaces the region entirely, so any line you omit will be deleted. Always reproduce the full region, including lines you did not change. @@ -190,20 +190,20 @@ Guidelines: - If recent edits show a pattern, apply it consistently - If no clear next edit, return the region unchanged (minus the cursor marker) - Output only the rewritten region \u2014 no explanations -`;var ky=`You are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location. +`;var Ry=`You are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location. The excerpt to edit will be wrapped in markers <|editable_region_start|> and <|editable_region_end|>. The cursor position is marked with <|user_cursor_is_here|>. Please respond with edited code for that region. Other code is provided for context. -`;function r6(e){let t=e.split(` -`),n=t.findIndex(i=>i.startsWith("@@"));if(n===-1)return[];let o=t.slice(n+1).filter(i=>i!=="```"),r=[];for(let i of o)i.startsWith("-")?r.push({type:"removed",text:i.substring(1)}):i.startsWith("+")?r.push({type:"added",text:i.substring(1)}):i.startsWith(" ")&&r.push({type:"context",text:i.substring(1)});return r}function n6(e,t){if(e.length===0)return e;let n=[];for(let l=0;lt.type!=="added").map(t=>t.text)}function i6(e){return e.filter(t=>t.type!=="removed").map(t=>t.text)}function dC(e,t){let n=e.length,o=t.length;if(n===0&&o===0)return"made no changes";if(n===1&&o===1){let r=e[0],i=t[0];return i.startsWith(r)?"typed `"+i.substring(r.length)+"`":r.startsWith(i)?"removed `"+r.substring(i.length)+"` from the end":"changed `"+r+"` to `"+i+"`"}return n===0&&o===1?"added `"+t[0]+"`":n===1&&o===0?"removed `"+e[0]+"`":n>0&&o>0?"added "+o+" line"+(o!==1?"s":"")+" and removed "+n+" line"+(n!==1?"s":""):o>0?"added "+o+" line"+(o!==1?"s":""):"removed "+n+" line"+(n!==1?"s":"")}function Sy(e,t=1){if(e.length===0)return"";let n=[],o=null,r=null;for(let i=0;ii.startsWith("@@"));if(n===-1)return[];let o=t.slice(n+1).filter(i=>i!=="```"),r=[];for(let i of o)i.startsWith("-")?r.push({type:"removed",text:i.substring(1)}):i.startsWith("+")?r.push({type:"added",text:i.substring(1)}):i.startsWith(" ")&&r.push({type:"context",text:i.substring(1)});return r}function I6(e,t){if(e.length===0)return e;let n=[];for(let l=0;lt.type!=="added").map(t=>t.text)}function P6(e){return e.filter(t=>t.type!=="removed").map(t=>t.text)}function PR(e,t){let n=e.length,o=t.length;if(n===0&&o===0)return"made no changes";if(n===1&&o===1){let r=e[0],i=t[0];return i.startsWith(r)?"typed `"+i.substring(r.length)+"`":r.startsWith(i)?"removed `"+r.substring(i.length)+"` from the end":"changed `"+r+"` to `"+i+"`"}return n===0&&o===1?"added `"+t[0]+"`":n===1&&o===0?"removed `"+e[0]+"`":n>0&&o>0?"added "+o+" line"+(o!==1?"s":"")+" and removed "+n+" line"+(n!==1?"s":""):o>0?"added "+o+" line"+(o!==1?"s":""):"removed "+n+" line"+(n!==1?"s":"")}function Cy(e,t=1){if(e.length===0)return"";let n=[],o=null,r=null;for(let i=0;iR.type==="removed").map(R=>R.text.trimStart()),h=l.filter(R=>R.type==="added").map(R=>R.text.trimStart()),b;o!==null&&d===o&&r!==null?b=dC(r.map(R=>R.trimStart()),h):b=dC(_,h);let k=i===e.length-1,T;i===0?(T="The user's code started like this:\n\n`````\n"+d+"\n`````\n\n",k?T+="Most recently, the user "+b+":\n\n`````\n"+m+"\n`````":T+="Then, the user "+b+":\n\n`````\n"+m+"\n`````"):k?T="Most recently, the user "+b+":\n\n`````\n"+m+"\n`````":T="Then, the user "+b+":\n\n`````\n"+m+"\n`````",o=d,r=h,n.push(T)}return n.length===0?"":`## Edit History +`),_=l.filter(C=>C.type==="removed").map(C=>C.text.trimStart()),h=l.filter(C=>C.type==="added").map(C=>C.text.trimStart()),b;o!==null&&d===o&&r!==null?b=PR(r.map(C=>C.trimStart()),h):b=PR(_,h);let k=i===e.length-1,I;i===0?(I="The user's code started like this:\n\n`````\n"+d+"\n`````\n\n",k?I+="Most recently, the user "+b+":\n\n`````\n"+m+"\n`````":I+="Then, the user "+b+":\n\n`````\n"+m+"\n`````"):k?I="Most recently, the user "+b+":\n\n`````\n"+m+"\n`````":I="Then, the user "+b+":\n\n`````\n"+m+"\n`````",o=d,r=h,n.push(I)}return n.length===0?"":`## Edit History `+n.join(` -`)}function pC(e,t){let{selection:n,textDocument:o,position:r}=e;if(n)return n;let i=t.split(` -`),s=r.line,l=s;for(let g=1;g<=5;g++){let v=s-g;if(v<0||i[v].includes("```"))break;l=v}let u=s;for(let g=1;g<=5;g++){let v=s+g;if(v>=i.length||i[v].includes("```"))break;u=v}let c=Math.max(0,l-5),d=Math.min(i.length-1,u+5),m=i.slice(c,l),_=i.slice(l,u+1),h=r.line-l;if(h>=0&&h<_.length){let g=_[h],v=g.substring(0,r.character),C=g.substring(r.character);_[h]=v+"<|user_cursor_is_here|>"+C}let b=i.slice(u+1,d+1),k="```"+o.uri+` +`)}function ER(e,t){let{selection:n,textDocument:o,position:r}=e;if(n)return n;let i=t.split(` +`),s=r.line,l=s;for(let g=1;g<=5;g++){let v=s-g;if(v<0||i[v].includes("```"))break;l=v}let u=s;for(let g=1;g<=5;g++){let v=s+g;if(v>=i.length||i[v].includes("```"))break;u=v}let c=Math.max(0,l-5),d=Math.min(i.length-1,u+5),m=i.slice(c,l),_=i.slice(l,u+1),h=r.line-l;if(h>=0&&h<_.length){let g=_[h],v=g.substring(0,r.character),R=g.substring(r.character);_[h]=v+"<|user_cursor_is_here|>"+R}let b=i.slice(u+1,d+1),k="```"+o.uri+` `;m.length>0&&(k+=m.join(` `)+` `),k+=`<|editable_region_start|> @@ -212,34 +212,34 @@ Other code is provided for context. `,k+=`<|editable_region_end|> `,b.length>0&&(k+=b.join(` `)+` -`),k+="```";let T={line:l,character:0},R={line:u,character:i[u]?.length||0};return{excerpt:k,editableRegionStart:T,editableRegionEnd:R}}var fC=cr(require("os")),a6=[/\/\.aws\/credentials$/,/\/\.aws\/config$/,/\/\.netrc$/,/\/\.npmrc$/,/\/\.env(\.|$)/,/\/\.Renviron(\.|$)/,/\/\.Rprofile(\.|$)/,/\/\.ssh(\/|$)/];function Xs(e){let t=e;return t.startsWith("file://")&&(t=t.substring(7)),t=decodeURIComponent(t),a6.some(n=>n.test(t))}function Iy(e){let t=e?.name||"RStudio",n=e?.version||"0.0.0";return`${t}/${n} (${fC.platform()}) posit.posit-ai-supercomplete`}function Ty(e,t,n="",o=0,r=!0){let i=e.name;if(n)switch(t){case"r":{let c=!e.name.match(/^\[\[\d+\]\]$/)?"$":"";i=`${n}${c}${e.name}`;break}case"python":i=`${n}['${e.name}']`;break;default:i=`${n}.${e.name}`}let s=" ".repeat(o);if(!r||!e.children||e.children.length===0||o>=3)return`${s}${i}: <${e.type}>`;let l=e.children.slice(0,20).map(u=>Ty(u,t,i,o+1,!0)).join(` +`),k+="```";let I={line:l,character:0},C={line:u,character:i[u]?.length||0};return{excerpt:k,editableRegionStart:I,editableRegionEnd:C}}var RR=Lt(require("os")),E6=[/\/\.aws\/credentials$/,/\/\.aws\/config$/,/\/\.netrc$/,/\/\.npmrc$/,/\/\.env(\.|$)/,/\/\.Renviron(\.|$)/,/\/\.Rprofile(\.|$)/,/\/\.ssh(\/|$)/];function Xs(e){let t=e;return t.startsWith("file://")&&(t=t.substring(7)),t=decodeURIComponent(t),E6.some(n=>n.test(t))}function Oy(e){let t=e?.name||"RStudio",n=e?.version||"0.0.0";return`${t}/${n} (${RR.platform()}) posit.posit-ai-supercomplete`}function Dy(e,t,n="",o=0,r=!0){let i=e.name;if(n)switch(t){case"r":{let c=!e.name.match(/^\[\[\d+\]\]$/)?"$":"";i=`${n}${c}${e.name}`;break}case"python":i=`${n}['${e.name}']`;break;default:i=`${n}.${e.name}`}let s=" ".repeat(o);if(!r||!e.children||e.children.length===0||o>=3)return`${s}${i}: <${e.type}>`;let l=e.children.slice(0,20).map(u=>Dy(u,t,i,o+1,!0)).join(` `);return`${s}${i}: <${e.type}> -${l}`}function od(e,t){return e.flatMap(n=>{let o=n.variables.filter(i=>t.has(i.name)),r=n.variables.filter(i=>!t.has(i.name));return[...o,...r].slice(0,10).map(i=>Ty(i,n.languageId,"",0,t.has(i.name)))}).join(` -`)}async function $y(e,t,n){let o={Authorization:`Bearer ${t}`,"Content-Type":"application/json"};n&&(o["User-Agent"]=n);let r=await fetch(`${e}/models`,{method:"GET",headers:o});if(!r.ok)throw new Error(`Failed to fetch models: ${r.status} ${r.statusText}`);let i=await r.json();return!i.completions||i.completions.length===0?[]:i.completions.map(s=>({id:s.id,displayName:s.display_name,endpointPath:s.endpoints[0]?.path??"",protocol:s.endpoints[0]?.protocol??"",weight:s.weight}))}function Py(e){if(e.length===0)throw new Error("No completion models available");if(e.length===1)return e[0];let t=e.reduce((o,r)=>o+r.weight,0),n=Math.random()*t;for(let o of e)if(n-=o.weight,n<=0)return o;return e[e.length-1]}var Ey={id:"qwen3-8b",displayName:"Qwen3-8B",endpointPath:"/completions/qwen3-8b/predict",protocol:"qwen3-8b",weight:1};var id={MissingTag:"missing-tag",ExtraTag:"extra-tag"},mC=2e3;function hC(e={}){let t=e.log||(()=>{});function n(D){return di(D)?ky:xy}t(`System prompts loaded: zeta=${ky.length} chars, rewrite-region=${xy.length} chars`);let o=[],r=10,i=new Map,s=new Map,l=5e3,u=e.config?.enable??{"*":!0,plaintext:!1,markdown:!1,quarto:!0,scminput:!1},c=[],d=[],m=new Map;function _(D,U){let A=D.substring(D.lastIndexOf("/")+1);if(U.startsWith("*.")){let L=U.substring(1);return A.toLowerCase().endsWith(L.toLowerCase())}return A===U}function h(D){let U=D.languageId;if(U in u)return u[U];let A=D.uri;for(let L in u)if(L!=="*"&&_(A,L))return u[L];return u["*"]??!0}function b(D){o.push(D),o.length>r&&o.shift(),t(`Recorded edit for ${D.uri} (${o.length} edits in history)`)}function k(D){let U=D;U.startsWith("file://")&&(U=U.substring(7)),U=decodeURIComponent(U);for(let L of d)if(U.startsWith(L))return U.substring(L.length+1);let A=U.split("/");return A[A.length-1]}function T(D,U){if(Xs(D)||!h(U))return;let A=i.get(D)||"",L=U.getText();if(A!==L&&i.set(D,L),A.replace(/\s/g,"")!==L.replace(/\s/g,"")){let B=k(D),W=$f(B,A,L).split(` +${l}`}function ad(e,t){return e.flatMap(n=>{let o=n.variables.filter(i=>t.has(i.name)),r=n.variables.filter(i=>!t.has(i.name));return[...o,...r].slice(0,10).map(i=>Dy(i,n.languageId,"",0,t.has(i.name)))}).join(` +`)}async function jy(e,t,n){let o={Authorization:`Bearer ${t}`,"Content-Type":"application/json"};n&&(o["User-Agent"]=n);let r=await fetch(`${e}/models`,{method:"GET",headers:o});if(!r.ok)throw new Error(`Failed to fetch models: ${r.status} ${r.statusText}`);let i=await r.json();return!i.completions||i.completions.length===0?[]:i.completions.map(s=>({id:s.id,displayName:s.display_name,endpointPath:s.endpoints[0]?.path??"",protocol:s.endpoints[0]?.protocol??"",weight:s.weight}))}function Ny(e){if(e.length===0)throw new Error("No completion models available");if(e.length===1)return e[0];let t=e.reduce((o,r)=>o+r.weight,0),n=Math.random()*t;for(let o of e)if(n-=o.weight,n<=0)return o;return e[e.length-1]}var My={id:"qwen3-8b",displayName:"Qwen3-8B",endpointPath:"/completions/qwen3-8b/predict",protocol:"qwen3-8b",weight:1};var sd={MissingTag:"missing-tag",ExtraTag:"extra-tag"},CR=2e3;function OR(e={}){let t=e.log||(()=>{});function n(D){return fi(D)?Ry:Ey}t(`System prompts loaded: zeta=${Ry.length} chars, rewrite-region=${Ey.length} chars`);let o=[],r=10,i=new Map,s=new Map,l=5e3,u=e.config?.enable??{"*":!0,plaintext:!1,markdown:!1,quarto:!0,scminput:!1},c=[],d=[],m=new Map;function _(D,U){let A=D.substring(D.lastIndexOf("/")+1);if(U.startsWith("*.")){let L=U.substring(1);return A.toLowerCase().endsWith(L.toLowerCase())}return A===U}function h(D){let U=D.languageId;if(U in u)return u[U];let A=D.uri;for(let L in u)if(L!=="*"&&_(A,L))return u[L];return u["*"]??!0}function b(D){o.push(D),o.length>r&&o.shift(),t(`Recorded edit for ${D.uri} (${o.length} edits in history)`)}function k(D){let U=D;U.startsWith("file://")&&(U=U.substring(7)),U=decodeURIComponent(U);for(let L of d)if(U.startsWith(L))return U.substring(L.length+1);let A=U.split("/");return A[A.length-1]}function I(D,U){if(Xs(D)||!h(U))return;let A=i.get(D)||"",L=U.getText();if(A!==L&&i.set(D,L),A.replace(/\s/g,"")!==L.replace(/\s/g,"")){let B=k(D),W=jf(B,A,L).split(` `).slice(4,-1).filter(pe=>pe!=="\\ No newline at end of file").join(` `);b({uri:B,timestamp:Date.now(),diff:`\`\`\`${B} ${W} -\`\`\``})}}function R(D){let U=v(D),A=D;return A=A.replace(/^```[a-zA-Z0-9_./-]*\n?/,""),A=A.replace(/\n?```\s*$/,""),A=A.replace(/<\|editable_region_start\|>\n?/g,""),A=A.replace(/\n?<\|editable_region_end\|>/g,""),A=A.replace(/<\|user_cursor_is_here\|>/g,""),"`````"+U+` +\`\`\``})}}function C(D){let U=v(D),A=D;return A=A.replace(/^```[a-zA-Z0-9_./-]*\n?/,""),A=A.replace(/\n?```\s*$/,""),A=A.replace(/<\|editable_region_start\|>\n?/g,""),A=A.replace(/\n?<\|editable_region_end\|>/g,""),A=A.replace(/<\|user_cursor_is_here\|>/g,""),"`````"+U+` `+A+"\n`````"}function g(D){let U=v(D),A="<|editable_region_start|>",L="<|editable_region_end|>",B=D.indexOf(A),ne=D.indexOf(L);if(B===-1||ne===-1)throw new Error("Excerpt is missing editable region markers");let W=D.substring(B+A.length,ne);return W=W.replace(/^\n+/,"").replace(/\n+$/,""),W=W.replace(/<\|user_cursor_is_here\|>/g,""),"`````"+U+` -`+W+"\n`````"}function v(D){let U=D.match(/^```([a-zA-Z0-9_./-]+)/);return U?U[1]:"Untitled"}function C(D,U,A,L){let ne=Math.floor(.9*A.maxContextTokens)-A.maxOutputTokens-L;return t(`Using soft token limit: ${ne}`),di(A.modelId)?O(D,U,ne):N(D,U,ne)}function O(D,U,A){let L=`## Code +`+W+"\n`````"}function v(D){let U=D.match(/^```([a-zA-Z0-9_./-]+)/);return U?U[1]:"Untitled"}function R(D,U,A,L){let ne=Math.floor(.9*A.maxContextTokens)-A.maxOutputTokens-L;return t(`Using soft token limit: ${ne}`),fi(A.modelId)?O(D,U,ne):N(D,U,ne)}function O(D,U,A){let L=`## Code `;if(L+=D.excerpt,L+=` -`,wn(L)>A)throw new Error("User code too long for LLM completion model");let B=new Set(D.excerpt.match(/[a-zA-Z_][a-zA-Z0-9_]*/g)||[]),ne=`## Variables +`,xn(L)>A)throw new Error("User code too long for LLM completion model");let B=new Set(D.excerpt.match(/[a-zA-Z_][a-zA-Z0-9_]*/g)||[]),ne=`## Variables -`;ne+=od(U,B),ne+=` +`;ne+=ad(U,B),ne+=` -`;let W=ne+L;if(wn(W)>A)return L;if(o.length>0){let pe=`## Edit History +`;let W=ne+L;if(xn(W)>A)return L;if(o.length>0){let pe=`## Edit History The following are the latest edits made by the user, from earlier to later. -`,Pe="";for(let Ie=o.length-1;Ie>=0;Ie--){let Le=`${o[Ie].diff} +`,Pe="";for(let Te=o.length-1;Te>=0;Te--){let Le=`${o[Te].diff} -`;if(!(Le.length>mC)){if(wn(pe+Le+Pe+W)>A)break;Pe=Le+Pe}}W=pe+Pe+W}return W}function N(D,U,A){let L=`## File context +`;if(!(Le.length>CR)){if(xn(pe+Le+Pe+W)>A)break;Pe=Le+Pe}}W=pe+Pe+W}return W}function N(D,U,A){let L=`## File context Here is the code the user is currently editing. -`+R(D.excerpt),B=`## Region +`+C(D.excerpt),B=`## Region Rewrite the following region from the excerpt above to predict the user's next edit: @@ -247,9 +247,9 @@ Rewrite the following region from the excerpt above to predict the user's next e `+B+` -`;if(wn(ne)>A)throw new Error("User code too long for LLM completion model");let W=ne,pe="";if(o.length>0){let oe=o.filter(ge=>ge.diff.length<=mC),J=oe.length;for(;J>0;){let ge=Sy(oe.slice(-J));if(ge&&wn(ge+` +`;if(xn(ne)>A)throw new Error("User code too long for LLM completion model");let W=ne,pe="";if(o.length>0){let oe=o.filter(ge=>ge.diff.length<=CR),J=oe.length;for(;J>0;){let ge=Cy(oe.slice(-J));if(ge&&xn(ge+` -`+W)<=A)break;J--}if(J>0){let ge=Sy(oe.slice(-J));if(ge){pe=ge.replace(`## Edit History +`+W)<=A)break;J--}if(J>0){let ge=Cy(oe.slice(-J));if(ge){pe=ge.replace(`## Edit History `,`## Edit History @@ -265,11 +265,11 @@ The following edits led to the current state of the file. ## Region -`+we[1]}}}let Pe=new Set(D.excerpt.match(/[a-zA-Z_][a-zA-Z0-9_]*/g)||[]),Ie=`## Variables +`+we[1]}}}let Pe=new Set(D.excerpt.match(/[a-zA-Z_][a-zA-Z0-9_]*/g)||[]),Te=`## Variables The following variables are present in the user's computational environment: -`;Ie+=od(U,Pe),Ie+=` +`;Te+=ad(U,Pe),Te+=` `;let Le=(()=>{let oe=W.split(` @@ -277,31 +277,31 @@ The following variables are present in the user's computational environment: `);return oe[0]+` -`+Ie+`## Region +`+Te+`## Region -`+oe[1]})();return wn(Le)<=A&&(W=Le),W}function K(D,U,A,L){let B=D.substring(U,A),ne=B.split(` -`);return ne.length===1?{line:L.line,character:L.character+B.length}:{line:L.line+(ne.length-1),character:ne[ne.length-1].length}}function ee(D,U,A,L){let B=0,ne=Math.min(D.length,U.length);for(;B",L="<|editable_region_end|>",B=U.indexOf(A),ne=U.indexOf(L),W=U.lastIndexOf(A),pe=U.lastIndexOf(L);return B===-1||ne===-1?{response:"",error:id.MissingTag}:W!==B||pe!==ne?{response:"",error:id.ExtraTag}:(U=U.substring(B+A.length+1,ne-1),U=U.replace(/<\|user_cursor_is_here\|>/g,""),{response:U})}function le(D){let U=D.trim(),A=U.match(/^(`{3,})/);if(A){let L=A[1].length;U=U.replace(/^`{3,}[a-zA-Z0-9_./-]*\n?/,"");let B=new RegExp("\\n`{"+L+",}[\\s\\S]*$");U=U.replace(B,"")}return U.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function z(){for(let[D,{timer:U,document:A}]of s.entries())clearTimeout(U),T(D,A);s.clear()}async function ye(D,U,A){try{return t(`Submitting completion feedback for ${D}: ${U}`),await cC({correlationId:D,feedback:U},A)}catch(L){let B=L instanceof Error?L.message:String(L);return t(`Failed to submit feedback: ${B}`),{success:!1,error:B}}}return{setWorkspaceFolders:D=>{d=D,t(`Workspace folders: ${d.join(", ")}`)},setConfiguration:D=>{D.enable&&(u=D.enable,t(`Updated enable config: ${JSON.stringify(u)}`))},onSessionDidCreate:D=>{t(`Session created: ${D.sessionId} (${D.languageId})`),m.set(D.sessionId,{sessionId:D.sessionId,languageId:D.languageId,variables:new Map})},onSessionDidDestroy:D=>{t(`Session destroyed: ${D.sessionId}`),m.delete(D.sessionId)},onSessionDidChangeVariables:D=>{let U=m.get(D.sessionId);U||(t(`Warning: Received variable changes for unknown session: ${D.sessionId}`),U={sessionId:D.sessionId,languageId:"r",variables:new Map},m.set(D.sessionId,U)),D.reset&&(t(`Session ${D.sessionId}: environment reset, clearing all variables`),U.variables.clear());for(let A of D.variables)switch(A.action){case"create":case"modify":{let L={name:A.name,type:A.type,children:A.children};U.variables.set(L.name,L),t(`Session ${D.sessionId}: ${A.action} variable "${L.name}"`);break}case"delete":U.variables.delete(A.name),t(`Session ${D.sessionId}: delete variable "${A.name}"`);break}},resetEditHistory:()=>{o.length=0,t("Edit history reset")},onDocumentOpen:D=>{Xs(D.uri)||(i.set(D.uri,D.getText()),t(`Cached content for ${D.uri}`))},onDocumentChange:D=>{let U=D.uri,A=s.get(U);A&&clearTimeout(A.timer);let L=setTimeout(()=>{T(U,D),s.delete(U)},l);s.set(U,{timer:L,document:D})},onDocumentSave:D=>{let U=D.uri,A=s.get(U);A&&(clearTimeout(A.timer),s.delete(U)),T(U,D),t(`Document saved: ${U}`)},onDocumentClose:D=>{let U=D.uri,A=s.get(U);A&&(clearTimeout(A.timer),s.delete(U)),i.delete(U),t(`Cleaned up cache for ${U}`)},onInlineEditRequest:async D=>{if(Xs(D.textDocument.uri))return t(`Denying inline edit request for ${D.textDocument.uri}`),null;t(`Received inline edit request for ${D.textDocument.uri}`),c.length>0&&(t("Cancelling previous LLM request(s)..."),c.forEach(L=>L.abort()),c.splice(0,c.length));let U=new AbortController;c.push(U);let A;try{t("Flushing pending diffs..."),z();let L=i.get(D.textDocument.uri);if(!L)throw new Error(`Document not found: ${D.textDocument.uri}`);if(L.split(` -`)[D.position.line]?.includes("```"))return t("Cursor is on a line containing triple backticks, skipping completion."),null;let ne=pC(D,L),W;m.size>0?W=Array.from(m.values()).map(et=>({languageId:et.languageId,variables:Array.from(et.variables.values())})):D.variables&&D.variables.length>0?W=D.variables:W=[];let pe=D.llmConfig,Pe=E(ne.excerpt);if(Pe.error)throw new Error(`Error extracting editable region from input excerpt: ${Pe.error}`);let Ie=wn(Pe.response);pe.maxOutputTokens=Math.max(256,Ie*2);let Le=n(pe.modelId),oe=wn(Le),J=C(ne,W,pe,oe);t("=== LLM REQUEST ==="),t(`Config: hasApiKey=${!!pe.apiKey}, baseURL=${pe.baseUrl}`),t(`Model: ${pe.modelId}`),t(`System Prompt (${Le.length} chars): +`+oe[1]})();return xn(Le)<=A&&(W=Le),W}function K(D,U,A,L){let B=D.substring(U,A),ne=B.split(` +`);return ne.length===1?{line:L.line,character:L.character+B.length}:{line:L.line+(ne.length-1),character:ne[ne.length-1].length}}function ee(D,U,A,L){let B=0,ne=Math.min(D.length,U.length);for(;B",L="<|editable_region_end|>",B=U.indexOf(A),ne=U.indexOf(L),W=U.lastIndexOf(A),pe=U.lastIndexOf(L);return B===-1||ne===-1?{response:"",error:sd.MissingTag}:W!==B||pe!==ne?{response:"",error:sd.ExtraTag}:(U=U.substring(B+A.length+1,ne-1),U=U.replace(/<\|user_cursor_is_here\|>/g,""),{response:U})}function le(D){let U=D.trim(),A=U.match(/^(`{3,})/);if(A){let L=A[1].length;U=U.replace(/^`{3,}[a-zA-Z0-9_./-]*\n?/,"");let B=new RegExp("\\n`{"+L+",}[\\s\\S]*$");U=U.replace(B,"")}return U.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function z(){for(let[D,{timer:U,document:A}]of s.entries())clearTimeout(U),I(D,A);s.clear()}async function ye(D,U,A){try{return t(`Submitting completion feedback for ${D}: ${U}`),await $R({correlationId:D,feedback:U},A)}catch(L){let B=L instanceof Error?L.message:String(L);return t(`Failed to submit feedback: ${B}`),{success:!1,error:B}}}return{setWorkspaceFolders:D=>{d=D,t(`Workspace folders: ${d.join(", ")}`)},setConfiguration:D=>{D.enable&&(u=D.enable,t(`Updated enable config: ${JSON.stringify(u)}`))},onSessionDidCreate:D=>{t(`Session created: ${D.sessionId} (${D.languageId})`),m.set(D.sessionId,{sessionId:D.sessionId,languageId:D.languageId,variables:new Map})},onSessionDidDestroy:D=>{t(`Session destroyed: ${D.sessionId}`),m.delete(D.sessionId)},onSessionDidChangeVariables:D=>{let U=m.get(D.sessionId);U||(t(`Warning: Received variable changes for unknown session: ${D.sessionId}`),U={sessionId:D.sessionId,languageId:"r",variables:new Map},m.set(D.sessionId,U)),D.reset&&(t(`Session ${D.sessionId}: environment reset, clearing all variables`),U.variables.clear());for(let A of D.variables)switch(A.action){case"create":case"modify":{let L={name:A.name,type:A.type,children:A.children};U.variables.set(L.name,L),t(`Session ${D.sessionId}: ${A.action} variable "${L.name}"`);break}case"delete":U.variables.delete(A.name),t(`Session ${D.sessionId}: delete variable "${A.name}"`);break}},resetEditHistory:()=>{o.length=0,t("Edit history reset")},onDocumentOpen:D=>{Xs(D.uri)||(i.set(D.uri,D.getText()),t(`Cached content for ${D.uri}`))},onDocumentChange:D=>{let U=D.uri,A=s.get(U);A&&clearTimeout(A.timer);let L=setTimeout(()=>{I(U,D),s.delete(U)},l);s.set(U,{timer:L,document:D})},onDocumentSave:D=>{let U=D.uri,A=s.get(U);A&&(clearTimeout(A.timer),s.delete(U)),I(U,D),t(`Document saved: ${U}`)},onDocumentClose:D=>{let U=D.uri,A=s.get(U);A&&(clearTimeout(A.timer),s.delete(U)),i.delete(U),t(`Cleaned up cache for ${U}`)},onInlineEditRequest:async D=>{if(Xs(D.textDocument.uri))return t(`Denying inline edit request for ${D.textDocument.uri}`),null;t(`Received inline edit request for ${D.textDocument.uri}`),c.length>0&&(t("Cancelling previous LLM request(s)..."),c.forEach(L=>L.abort()),c.splice(0,c.length));let U=new AbortController;c.push(U);let A;try{t("Flushing pending diffs..."),z();let L=i.get(D.textDocument.uri);if(!L)throw new Error(`Document not found: ${D.textDocument.uri}`);if(L.split(` +`)[D.position.line]?.includes("```"))return t("Cursor is on a line containing triple backticks, skipping completion."),null;let ne=ER(D,L),W;m.size>0?W=Array.from(m.values()).map(et=>({languageId:et.languageId,variables:Array.from(et.variables.values())})):D.variables&&D.variables.length>0?W=D.variables:W=[];let pe=D.llmConfig,Pe=E(ne.excerpt);if(Pe.error)throw new Error(`Error extracting editable region from input excerpt: ${Pe.error}`);let Te=xn(Pe.response);pe.maxOutputTokens=Math.max(256,Te*2);let Le=n(pe.modelId),oe=xn(Le),J=R(ne,W,pe,oe);t("=== LLM REQUEST ==="),t(`Config: hasApiKey=${!!pe.apiKey}, baseURL=${pe.baseUrl}`),t(`Model: ${pe.modelId}`),t(`System Prompt (${Le.length} chars): ${Le}`),t(`User Query (${J.length} chars): -${J}`),t("Calling LLM...");let ge=await uC([{role:"user",content:J}],Le,pe,U.signal),we=ge.text;t(`Response (${we.length} chars): -${we}`),A=ge.correlationId,A&&t(`Correlation ID: ${A}`);let se=[],me=null;if(di(pe.modelId)){let et=E(we);et.error===id.MissingTag?t("Warning: Missing editable region tags in output, returning an empty edit set."):et.error===id.ExtraTag?t("Warning: Extra bogus editable region tags in output, returning an empty edit set."):et.response===""?t("Warning: Editable region is empty, returning an empty edit set."):me=et.response}else me=le(we).replace(//g,"");let F=L.split(` -`),xe=ne.editableRegionStart.line,je=ne.editableRegionEnd.line;if(!di(pe.modelId)){for(;xeD.position.line&&F[je]==="";)je--}let Me={line:xe,character:0},Qt={line:je,character:F[je]?.length||0},Sr=F.slice(xe,je+1).join(` -`);if(!we)t("Warning: Inline completion request resulted in empty response, returning an empty edit set."),A&&ye(A,"filtered",pe);else if(me===null||me==="")t("Warning: Could not extract completion from response, returning an empty edit set."),A&&ye(A,"filtered",pe);else{let et=ee(Sr,me,Me,Qt),Mt=et.trimmedText;Mt===""?(t("Warning: Editable region matches original text, returning an empty edit set."),A&&ye(A,"filtered",pe)):Sr.replace(/\s/g,"")===Mt.replace(/\s/g,"")?(t("Warning: Edit only changes whitespace, returning an empty edit set."),A&&ye(A,"filtered",pe)):se.push({text:Mt,range:{start:et.adjustedStart,end:et.adjustedEnd}})}c.splice(c.indexOf(U),1);let lr=A&&se.length>0?{title:"Telemetry",command:"supercomplete.submitFeedback",arguments:[A,"accepted"]}:void 0;return{edits:se.map(et=>({...et,command:lr})),editHistory:o.map(et=>({uri:et.uri,timestamp:et.timestamp,diff:et.diff})),correlationId:A}}catch(L){let B=L;return B.name==="AbortError"?t("LLM request was cancelled"):(t(`Error: A problem occurred generating completions: ${B.message}`),A&&ye(A,"filtered",D.llmConfig)),null}},submitCompletionFeedback:D=>ye(D.correlationId,D.feedback,D.llmConfig)}}var s6=1e3,l6=new mt.RequestType("textDocument/inlineEdit"),u6=new mt.RequestType("textDocument/copilotInlineEdit"),c6=new mt.RequestType("textDocument/inlineCompletion"),d6=new mt.RequestType("checkStatus"),p6=new mt.NotificationType("didChangeStatus"),f6=new mt.RequestType("signInInitiate"),m6=new mt.RequestType("signOut"),h6=new mt.RequestType("debug/diagnostics"),g6=new mt.RequestType("workspace/resetEditHistory"),v6=new mt.RequestType("supercomplete/submitCompletionFeedback"),y6=new mt.NotificationType("workspace/executeCommand"),_6=new mt.NotificationType("session/didCreate"),b6=new mt.NotificationType("session/didDestroy"),w6=new mt.NotificationType("session/didChangeVariables"),ya=null,Cy=0,x6=360*60*1e3;function ad(e){return{uri:e.uri,languageId:e.languageId,getText:()=>e.getText()}}function k6(e,t,n){let o=e.getText({start:n.range.start,end:t}),r=e.getText({start:t,end:n.range.end});return n.text.startsWith(o)&&n.text.endsWith(r)}var _a,S6=process.argv.some(e=>e==="--stdio"||e==="--node-ipc"||e.startsWith("--socket")||e.startsWith("--pipe")),st=S6?(0,mt.createConnection)(mt.ProposedFeatures.all):(0,mt.createConnection)(process.stdin,process.stdout),ot=e=>st.console.log(e);function Tn(e,t){st.sendNotification(p6,{message:e,kind:t})}var wa=new mt.TextDocuments(tl),Or=hC({log:e=>st.console.log(e)});st.onInitialize(e=>{if(e.workspaceFolders){let n=e.workspaceFolders.map(o=>{let r=o.uri;return r.startsWith("file://")&&(r=r.substring(7)),decodeURIComponent(r)});Or.setWorkspaceFolders(n)}return _a=e.clientInfo?e.clientInfo:_a={name:e.initializationOptions.editorInfo.name??"unknown",version:e.initializationOptions.editorInfo.version??"unknown"},Oo().then(n=>st.console.log(`Auth check: ${n.status}`)).catch(n=>{let o=n instanceof Error?n.message:String(n);st.console.log(`Auth check failed: ${o}`)}),{capabilities:{textDocumentSync:mt.TextDocumentSyncKind.Incremental,workspace:{workspaceFolders:{supported:!0}}}}});st.onInitialized(()=>{st.console.log("Language server initialized")});st.onDidChangeConfiguration(()=>{(async()=>{try{let e=await st.workspace.getConfiguration("posit.ai.supercomplete");Or.setConfiguration(e)}catch(e){let t=e instanceof Error?e.message:String(e);st.console.log(`Failed to get configuration: ${t}`)}})()});wa.onDidOpen(e=>{Or.onDocumentOpen(ad(e.document))});wa.onDidChangeContent(e=>{Or.onDocumentChange(ad(e.document))});wa.onDidSave(e=>{Or.onDocumentSave(ad(e.document))});wa.onDidClose(e=>{Or.onDocumentClose(ad(e.document))});st.onRequest(d6,async()=>{let e=await Oo();return{status:e.status,user:e.user||void 0}});st.onRequest(f6,async()=>{if((await Oo()).status==="OK")return{status:"AlreadySignedIn"};try{let t=await Bk();return{status:"PromptUserDeviceFlow",userCode:t.userCode,verificationUri:t.verificationUriComplete,expiresIn:t.expiresIn,interval:t.interval}}catch(t){return{status:`Error: ${t instanceof Error?t.message:String(t)}`}}});st.onRequest(m6,async()=>(await kf(),{status:"NotSignedIn"}));st.onRequest(h6,async()=>({report:await I6()}));st.onRequest(g6,()=>{Or.resetEditHistory()});st.onRequest(v6,e=>Or.submitCompletionFeedback(e));st.onRequest(l6,Ry);st.onRequest(u6,Ry);st.onRequest(c6,$6);st.onNotification(y6,e=>{(async()=>{if(e.command==="supercomplete.submitFeedback"&&e.arguments&&e.arguments.length>=2){let[t,n]=e.arguments,{status:o,llmConfig:r}=await gC();if(o.status!=="OK")return;await Or.submitCompletionFeedback({correlationId:t,feedback:n,llmConfig:r})}})()});st.onNotification(_6,e=>{Or.onSessionDidCreate(e)});st.onNotification(b6,e=>{Or.onSessionDidDestroy(e)});st.onNotification(w6,e=>{Or.onSessionDidChangeVariables(e)});wa.listen(st);st.listen();async function I6(){let e=[],t=_a?.name||"Unknown",n=_a?.version||"Unknown";e.push(`## Environment +${J}`),t("Calling LLM...");let ge=await IR([{role:"user",content:J}],Le,pe,U.signal),we=ge.text;t(`Response (${we.length} chars): +${we}`),A=ge.correlationId,A&&t(`Correlation ID: ${A}`);let se=[],me=null;if(fi(pe.modelId)){let et=E(we);et.error===sd.MissingTag?t("Warning: Missing editable region tags in output, returning an empty edit set."):et.error===sd.ExtraTag?t("Warning: Extra bogus editable region tags in output, returning an empty edit set."):et.response===""?t("Warning: Editable region is empty, returning an empty edit set."):me=et.response}else me=le(we).replace(//g,"");let F=L.split(` +`),xe=ne.editableRegionStart.line,je=ne.editableRegionEnd.line;if(!fi(pe.modelId)){for(;xeD.position.line&&F[je]==="";)je--}let Me={line:xe,character:0},er={line:je,character:F[je]?.length||0},Sr=F.slice(xe,je+1).join(` +`);if(!we)t("Warning: Inline completion request resulted in empty response, returning an empty edit set."),A&&ye(A,"filtered",pe);else if(me===null||me==="")t("Warning: Could not extract completion from response, returning an empty edit set."),A&&ye(A,"filtered",pe);else{let et=ee(Sr,me,Me,er),Mt=et.trimmedText;Mt===""?(t("Warning: Editable region matches original text, returning an empty edit set."),A&&ye(A,"filtered",pe)):Sr.replace(/\s/g,"")===Mt.replace(/\s/g,"")?(t("Warning: Edit only changes whitespace, returning an empty edit set."),A&&ye(A,"filtered",pe)):se.push({text:Mt,range:{start:et.adjustedStart,end:et.adjustedEnd}})}c.splice(c.indexOf(U),1);let ur=A&&se.length>0?{title:"Telemetry",command:"supercomplete.submitFeedback",arguments:[A,"accepted"]}:void 0;return{edits:se.map(et=>({...et,command:ur})),editHistory:o.map(et=>({uri:et.uri,timestamp:et.timestamp,diff:et.diff})),correlationId:A}}catch(L){let B=L;return B.name==="AbortError"?t("LLM request was cancelled"):(t(`Error: A problem occurred generating completions: ${B.message}`),A&&ye(A,"filtered",D.llmConfig)),null}},submitCompletionFeedback:D=>ye(D.correlationId,D.feedback,D.llmConfig)}}var R6=1e3,C6=new mt.RequestType("textDocument/inlineEdit"),O6=new mt.RequestType("textDocument/copilotInlineEdit"),D6=new mt.RequestType("textDocument/inlineCompletion"),j6=new mt.RequestType("checkStatus"),N6=new mt.NotificationType("didChangeStatus"),M6=new mt.RequestType("signInInitiate"),A6=new mt.RequestType("signOut"),z6=new mt.RequestType("debug/diagnostics"),q6=new mt.RequestType("workspace/resetEditHistory"),U6=new mt.RequestType("supercomplete/submitCompletionFeedback"),L6=new mt.NotificationType("workspace/executeCommand"),F6=new mt.NotificationType("session/didCreate"),Z6=new mt.NotificationType("session/didDestroy"),V6=new mt.NotificationType("session/didChangeVariables"),ba=null,Ay=0,W6=360*60*1e3;function ld(e){return{uri:e.uri,languageId:e.languageId,getText:()=>e.getText()}}function H6(e,t,n){let o=e.getText({start:n.range.start,end:t}),r=e.getText({start:t,end:n.range.end});return n.text.startsWith(o)&&n.text.endsWith(r)}var wa,J6=process.argv.some(e=>e==="--stdio"||e==="--node-ipc"||e.startsWith("--socket")||e.startsWith("--pipe")),at=J6?(0,mt.createConnection)(mt.ProposedFeatures.all):(0,mt.createConnection)(process.stdin,process.stdout),ot=e=>at.console.log(e);function $n(e,t){at.sendNotification(N6,{message:e,kind:t})}var ka=new mt.TextDocuments(tl),Or=OR({log:e=>at.console.log(e)});at.onInitialize(e=>{if(e.workspaceFolders){let n=e.workspaceFolders.map(o=>{let r=o.uri;return r.startsWith("file://")&&(r=r.substring(7)),decodeURIComponent(r)});Or.setWorkspaceFolders(n)}return wa=e.clientInfo?e.clientInfo:wa={name:e.initializationOptions.editorInfo.name??"unknown",version:e.initializationOptions.editorInfo.version??"unknown"},jo().then(n=>at.console.log(`Auth check: ${n.status}`)).catch(n=>{let o=n instanceof Error?n.message:String(n);at.console.log(`Auth check failed: ${o}`)}),{capabilities:{textDocumentSync:mt.TextDocumentSyncKind.Incremental,workspace:{workspaceFolders:{supported:!0}}}}});at.onInitialized(()=>{at.console.log("Language server initialized")});at.onDidChangeConfiguration(()=>{(async()=>{try{let e=await at.workspace.getConfiguration("posit.ai.supercomplete");Or.setConfiguration(e)}catch(e){let t=e instanceof Error?e.message:String(e);at.console.log(`Failed to get configuration: ${t}`)}})()});ka.onDidOpen(e=>{Or.onDocumentOpen(ld(e.document))});ka.onDidChangeContent(e=>{Or.onDocumentChange(ld(e.document))});ka.onDidSave(e=>{Or.onDocumentSave(ld(e.document))});ka.onDidClose(e=>{Or.onDocumentClose(ld(e.document))});at.onRequest(j6,async()=>{let e=await jo();return{status:e.status,user:e.user||void 0}});at.onRequest(M6,async()=>{if((await jo()).status==="OK")return{status:"AlreadySignedIn"};try{let t=await dS();return{status:"PromptUserDeviceFlow",userCode:t.userCode,verificationUri:t.verificationUriComplete,expiresIn:t.expiresIn,interval:t.interval}}catch(t){return{status:`Error: ${t instanceof Error?t.message:String(t)}`}}});at.onRequest(A6,async()=>(await Rf(),{status:"NotSignedIn"}));at.onRequest(z6,async()=>({report:await B6()}));at.onRequest(q6,()=>{Or.resetEditHistory()});at.onRequest(U6,e=>Or.submitCompletionFeedback(e));at.onRequest(C6,zy);at.onRequest(O6,zy);at.onRequest(D6,K6);at.onNotification(L6,e=>{(async()=>{if(e.command==="supercomplete.submitFeedback"&&e.arguments&&e.arguments.length>=2){let[t,n]=e.arguments,{status:o,llmConfig:r}=await DR();if(o.status!=="OK")return;await Or.submitCompletionFeedback({correlationId:t,feedback:n,llmConfig:r})}})()});at.onNotification(F6,e=>{Or.onSessionDidCreate(e)});at.onNotification(Z6,e=>{Or.onSessionDidDestroy(e)});at.onNotification(V6,e=>{Or.onSessionDidChangeVariables(e)});ka.listen(at);at.listen();async function B6(){let e=[],t=wa?.name||"Unknown",n=wa?.version||"Unknown";e.push(`## Environment - Editor: ${t} ${n} -- Operating System: ${ba.type()} ${ba.release()} (${ba.arch()})`);let o=await Oo(),r=o.status==="OK"?o.user:"Not signed in";e.push(`## Next Edit Suggestions +- Operating System: ${xa.type()} ${xa.release()} (${xa.arch()})`);let o=await jo(),r=o.status==="OK"?o.user:"Not signed in";e.push(`## Next Edit Suggestions - Version: 0.1.0 - User: ${r} - Authentication Status: ${o.status}`);let i=process.env.HTTP_PROXY||process.env.HTTPS_PROXY||"N/A";e.push(`## Network Configuration - Proxy: ${i} -- Base URL: ${Rt.baseUrl} -- Auth URL: ${Rt.authUrl} -- API URL: ${Rt.apiUrl} -`);let s=await T6();return e.push(`## Reachability +- Base URL: ${Ct.baseUrl} +- Auth URL: ${Ct.authUrl} +- API URL: ${Ct.apiUrl} +`);let s=await G6();return e.push(`## Reachability ${s}`),e.join(` -`)}async function T6(){let e=[{name:"Posit AI Gateway",url:`${Rt.baseUrl}/models`},{name:"Posit Auth",url:`${Rt.authUrl}/login`},{name:"Posit API",url:`${Rt.apiUrl}/v1/users/me`}],t=await Oo(),n=[];for(let o of e)try{let r=new AbortController,i=setTimeout(()=>r.abort(),5e3),l={Authorization:`Bearer ${t.accessToken}`,"Content-Type":"application/json"},u=await fetch(o.url,{headers:l,signal:r.signal});clearTimeout(i),n.push(`- ${o.name}: HTTP ${u.status}`)}catch(r){if(r instanceof Error&&r.name==="AbortError")n.push(`- ${o.name}: Timeout`);else{let i=r instanceof Error?r.message:"Unknown error";n.push(`- ${o.name}: Error (${i})`)}}return n.join(` -`)}async function Ry(e){if(!e.llmConfig?.accessToken&&!e.llmConfig?.apiKey){let{status:t,llmConfig:n}=await gC();if(t.status==="NotSignedIn")throw new mt.ResponseError(s6,"Not signed in");e.llmConfig=n}return await Or.onInlineEditRequest(e)}async function $6(e){let t=await Ry(e);if(!t||t.edits.length===0)return null;let n=wa.get(e.textDocument.uri);if(!n)return null;let o=t.edits[0];return k6(n,e.position,o)?{items:[{insertText:o.text,range:{start:e.position,end:e.position},command:o.command}]}:(ot("Warning: Inline completion request resulted in NES edit, dropping."),null)}async function gC(){let e=await Oo(),t={modelId:"zeta",maxContextTokens:5e3,maxOutputTokens:256,options:{userAgent:Iy(_a)}};if(e.accessToken&&e.baseUrl){t.accessToken=e.accessToken,t.baseUrl=e.baseUrl;let n=await P6(e.baseUrl,e.accessToken);t.modelId=n.id,t.endpointPath=n.endpointPath}return{status:e,llmConfig:t}}async function P6(e,t){if(!ya||Date.now()-Cy>x6){ya=null;try{let o=await $y(e,t,Iy(_a));o.length>0&&(ya=o,Cy=Date.now())}catch(o){let r=o instanceof Error?o.message:String(o);st.console.log(`Failed to fetch completion models, falling back to zeta: ${r}`)}ya||(ya=[Ey],Cy=Date.now())}let n=Py(ya);return st.console.log(`Selected completion model: ${n.id} (endpoint: ${n.endpointPath})`),n}0&&(module.exports={log,sendStatus}); +`)}async function G6(){let e=[{name:"Posit AI Gateway",url:`${Ct.baseUrl}/models`},{name:"Posit Auth",url:`${Ct.authUrl}/login`},{name:"Posit API",url:`${Ct.apiUrl}/v1/users/me`}],t=await jo(),n=[];for(let o of e)try{let r=new AbortController,i=setTimeout(()=>r.abort(),5e3),l={Authorization:`Bearer ${t.accessToken}`,"Content-Type":"application/json"},u=await fetch(o.url,{headers:l,signal:r.signal});clearTimeout(i),n.push(`- ${o.name}: HTTP ${u.status}`)}catch(r){if(r instanceof Error&&r.name==="AbortError")n.push(`- ${o.name}: Timeout`);else{let i=r instanceof Error?r.message:"Unknown error";n.push(`- ${o.name}: Error (${i})`)}}return n.join(` +`)}async function zy(e){if(!e.llmConfig?.accessToken&&!e.llmConfig?.apiKey){let{status:t,llmConfig:n}=await DR();if(t.status==="NotSignedIn")throw new mt.ResponseError(R6,"Not signed in");e.llmConfig=n}return await Or.onInlineEditRequest(e)}async function K6(e){let t=await zy(e);if(!t||t.edits.length===0)return null;let n=ka.get(e.textDocument.uri);if(!n)return null;let o=t.edits[0];return H6(n,e.position,o)?{items:[{insertText:o.text,range:{start:e.position,end:e.position},command:o.command}]}:(ot("Warning: Inline completion request resulted in NES edit, dropping."),null)}async function DR(){let e=await jo(),t={modelId:"zeta",maxContextTokens:5e3,maxOutputTokens:256,options:{userAgent:Oy(wa)}};if(e.accessToken&&e.baseUrl){t.accessToken=e.accessToken,t.baseUrl=e.baseUrl;let n=await Y6(e.baseUrl,e.accessToken);t.modelId=n.id,t.endpointPath=n.endpointPath}return{status:e,llmConfig:t}}async function Y6(e,t){if(!ba||Date.now()-Ay>W6){ba=null;try{let o=await jy(e,t,Oy(wa));o.length>0&&(ba=o,Ay=Date.now())}catch(o){let r=o instanceof Error?o.message:String(o);at.console.log(`Failed to fetch completion models, falling back to zeta: ${r}`)}ba||(ba=[My],Ay=Date.now())}let n=Ny(ba);return at.console.log(`Selected completion model: ${n.id} (endpoint: ${n.endpointPath})`),n}0&&(module.exports={log,sendStatus});