@microsoft/agents-copilotstudio-client 0.6.16-gc874f0c9d8 → 0.6.21-g3c2261b2fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +58 -0
- package/dist/src/agentType.d.ts +2 -2
- package/dist/src/agentType.js +2 -2
- package/dist/src/agentType.js.map +1 -1
- package/dist/src/browser.mjs +8 -8
- package/dist/src/browser.mjs.map +3 -3
- package/dist/src/connectionSettings.d.ts +25 -6
- package/dist/src/connectionSettings.js +35 -11
- package/dist/src/connectionSettings.js.map +1 -1
- package/dist/src/powerPlatformCloud.d.ts +17 -17
- package/dist/src/powerPlatformCloud.js +17 -17
- package/dist/src/powerPlatformCloud.js.map +1 -1
- package/dist/src/powerPlatformEnvironment.js +12 -35
- package/dist/src/powerPlatformEnvironment.js.map +1 -1
- package/package.json +5 -3
- package/src/agentType.ts +2 -2
- package/src/connectionSettings.ts +57 -15
- package/src/powerPlatformCloud.ts +17 -17
- package/src/powerPlatformEnvironment.ts +9 -38
package/dist/src/browser.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var Ja=Object.create;var In=Object.defineProperty;var Ka=Object.getOwnPropertyDescriptor;var Ga=Object.getOwnPropertyNames;var Ya=Object.getPrototypeOf,Xa=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qa=(t,e)=>{for(var r in e)In(t,r,{get:e[r],enumerable:!0})},ec=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ga(e))!Xa.call(t,o)&&o!==r&&In(t,o,{get:()=>e[o],enumerable:!(n=Ka(e,o))||n.enumerable});return t};var vr=(t,e,r)=>(r=t!=null?Ja(Ya(t)):{},ec(e||!t||!t.__esModule?In(r,"default",{value:t,enumerable:!0}):r,t));var Wi=w((Ny,Hi)=>{var lt=1e3,ft=lt*60,pt=ft*60,Ze=pt*24,hu=Ze*7,yu=Ze*365.25;Hi.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return gu(t);if(r==="number"&&isFinite(t))return e.long?bu(t):vu(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function gu(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*yu;case"weeks":case"week":case"w":return r*hu;case"days":case"day":case"d":return r*Ze;case"hours":case"hour":case"hrs":case"hr":case"h":return r*pt;case"minutes":case"minute":case"mins":case"min":case"m":return r*ft;case"seconds":case"second":case"secs":case"sec":case"s":return r*lt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function vu(t){var e=Math.abs(t);return e>=Ze?Math.round(t/Ze)+"d":e>=pt?Math.round(t/pt)+"h":e>=ft?Math.round(t/ft)+"m":e>=lt?Math.round(t/lt)+"s":t+"ms"}function bu(t){var e=Math.abs(t);return e>=Ze?Dr(t,e,Ze,"day"):e>=pt?Dr(t,e,pt,"hour"):e>=ft?Dr(t,e,ft,"minute"):e>=lt?Dr(t,e,lt,"second"):t+" ms"}function Dr(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Ki=w((Dy,Ji)=>{function _u(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=o,r.enabled=a,r.humanize=Wi(),r.destroy=u,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let m=0;for(let b=0;b<d.length;b++)m=(m<<5)-m+d.charCodeAt(b),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=e;function r(d){let m,b=null,C,h;function v(..._){if(!v.enabled)return;let x=v,P=Number(new Date),N=P-(m||P);x.diff=N,x.prev=m,x.curr=P,m=P,_[0]=r.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let z=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(te,ye)=>{if(te==="%%")return"%";z++;let ke=r.formatters[ye];if(typeof ke=="function"){let gr=_[z];te=ke.call(x,gr),_.splice(z,1),z--}return te}),r.formatArgs.call(x,_),(x.log||r.log).apply(x,_)}return v.namespace=d,v.useColors=r.useColors(),v.color=r.selectColor(d),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(C!==r.namespaces&&(C=r.namespaces,h=r.enabled(d)),h),set:_=>{b=_}}),typeof r.init=="function"&&r.init(v),v}function n(d,m){let b=r(this.namespace+(typeof m=="undefined"?":":m)+d);return b.log=this.log,b}function o(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let m=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let b of m)b[0]==="-"?r.skips.push(b.slice(1)):r.names.push(b)}function i(d,m){let b=0,C=0,h=-1,v=0;for(;b<d.length;)if(C<m.length&&(m[C]===d[b]||m[C]==="*"))m[C]==="*"?(h=C,v=b,C++):(b++,C++);else if(h!==-1)C=h+1,v++,b=v;else return!1;for(;C<m.length&&m[C]==="*";)C++;return C===m.length}function s(){let d=[...r.names,...r.skips.map(m=>"-"+m)].join(",");return r.enable(""),d}function a(d){for(let m of r.skips)if(i(d,m))return!1;for(let m of r.names)if(i(d,m))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ji.exports=_u});var Gi=w((G,Lr)=>{G.formatArgs=wu;G.save=Cu;G.load=Tu;G.useColors=xu;G.storage=Su();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function xu(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function wu(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Lr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}G.log=console.debug||console.log||(()=>{});function Cu(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}function Tu(){let t;try{t=G.storage.getItem("debug")||G.storage.getItem("DEBUG")}catch{}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function Su(){try{return localStorage}catch{}}Lr.exports=Ki()(G);var{formatters:Iu}=Lr.exports;Iu.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Fr=w(Ue=>{"use strict";var Au=Ue&&Ue.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Logger=void 0;Ue.debug=Ru;var Ou=Au(Gi()),Eu=["info","warn","error","debug"],Mr=class{constructor(e=""){this.loggers={},this.initializeLoggers(e)}initializeLoggers(e){for(let r of Eu){let n=(0,Ou.default)(`${e}:${r}`);n.color=this.getPlatformColor(r),this.loggers[r]=n}}getPlatformColor(e){return{node:{info:"2",warn:"3",error:"1",debug:"4"},browser:{info:"#33CC99",warn:"#CCCC33",error:"#CC3366",debug:"#0066FF"}}[typeof window!="undefined"?"browser":"node"][e]}info(e,...r){this.loggers.info(e,...r)}warn(e,...r){this.loggers.warn(e,...r)}error(e,...r){this.loggers.error(e,...r)}debug(e,...r){this.loggers.debug(e,...r)}};Ue.Logger=Mr;function Ru(t){return new Mr(t)}});var tr=w(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getParsedType=Z.ZodParsedType=Z.objectUtil=Z.util=void 0;var Yn;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(let s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Yn||(Z.util=Yn={}));var es;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(es||(Z.objectUtil=es={}));Z.ZodParsedType=Yn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Zu=t=>{switch(typeof t){case"undefined":return Z.ZodParsedType.undefined;case"string":return Z.ZodParsedType.string;case"number":return Number.isNaN(t)?Z.ZodParsedType.nan:Z.ZodParsedType.number;case"boolean":return Z.ZodParsedType.boolean;case"function":return Z.ZodParsedType.function;case"bigint":return Z.ZodParsedType.bigint;case"symbol":return Z.ZodParsedType.symbol;case"object":return Array.isArray(t)?Z.ZodParsedType.array:t===null?Z.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.ZodParsedType.promise:typeof Map!="undefined"&&t instanceof Map?Z.ZodParsedType.map:typeof Set!="undefined"&&t instanceof Set?Z.ZodParsedType.set:typeof Date!="undefined"&&t instanceof Date?Z.ZodParsedType.date:Z.ZodParsedType.object;default:return Z.ZodParsedType.unknown}};Z.getParsedType=Zu});var Br=w(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.ZodError=Te.quotelessJson=Te.ZodIssueCode=void 0;var ts=tr();Te.ZodIssueCode=ts.util.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"]);var Uu=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");Te.quotelessJson=Uu;var rr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ts.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Te.ZodError=rr;rr.create=t=>new rr(t)});var Qn=w(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var $=Br(),De=tr(),Nu=(t,e)=>{let r;switch(t.code){case $.ZodIssueCode.invalid_type:t.received===De.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case $.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,De.util.jsonStringifyReplacer)}`;break;case $.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.util.joinValues(t.keys,", ")}`;break;case $.ZodIssueCode.invalid_union:r="Invalid input";break;case $.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.util.joinValues(t.options)}`;break;case $.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${De.util.joinValues(t.options)}, received '${t.received}'`;break;case $.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case $.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case $.ZodIssueCode.invalid_date:r="Invalid date";break;case $.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:De.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case $.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case $.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case $.ZodIssueCode.custom:r="Invalid input";break;case $.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case $.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case $.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,De.util.assertNever(t)}return{message:r}};Xn.default=Nu});var Hr=w(Se=>{"use strict";var Du=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.defaultErrorMap=void 0;Se.setErrorMap=Lu;Se.getErrorMap=Mu;var rs=Du(Qn());Se.defaultErrorMap=rs.default;var ns=rs.default;function Lu(t){ns=t}function Mu(){return ns}});var to=w(j=>{"use strict";var Fu=j&&j.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(j,"__esModule",{value:!0});j.isAsync=j.isValid=j.isDirty=j.isAborted=j.OK=j.DIRTY=j.INVALID=j.ParseStatus=j.EMPTY_PATH=j.makeIssue=void 0;j.addIssueToContext=Vu;var zu=Hr(),os=Fu(Qn()),qu=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};j.makeIssue=qu;j.EMPTY_PATH=[];function Vu(t,e){let r=(0,zu.getErrorMap)(),n=(0,j.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===os.default?void 0:os.default].filter(o=>!!o)});t.common.issues.push(n)}var eo=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return j.INVALID;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return j.INVALID;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}};j.ParseStatus=eo;j.INVALID=Object.freeze({status:"aborted"});var $u=t=>({status:"dirty",value:t});j.DIRTY=$u;var Bu=t=>({status:"valid",value:t});j.OK=Bu;var Hu=t=>t.status==="aborted";j.isAborted=Hu;var Wu=t=>t.status==="dirty";j.isDirty=Wu;var Ju=t=>t.status==="valid";j.isValid=Ju;var Ku=t=>typeof Promise!="undefined"&&t instanceof Promise;j.isAsync=Ku});var ss=w(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0})});var cs=w(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.errorUtil=void 0;var as;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(as||(Wr.errorUtil=as={}))});var _s=w(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.discriminatedUnion=l.date=l.boolean=l.bigint=l.array=l.any=l.coerce=l.ZodFirstPartyTypeKind=l.late=l.ZodSchema=l.Schema=l.ZodReadonly=l.ZodPipeline=l.ZodBranded=l.BRAND=l.ZodNaN=l.ZodCatch=l.ZodDefault=l.ZodNullable=l.ZodOptional=l.ZodTransformer=l.ZodEffects=l.ZodPromise=l.ZodNativeEnum=l.ZodEnum=l.ZodLiteral=l.ZodLazy=l.ZodFunction=l.ZodSet=l.ZodMap=l.ZodRecord=l.ZodTuple=l.ZodIntersection=l.ZodDiscriminatedUnion=l.ZodUnion=l.ZodObject=l.ZodArray=l.ZodVoid=l.ZodNever=l.ZodUnknown=l.ZodAny=l.ZodNull=l.ZodUndefined=l.ZodSymbol=l.ZodDate=l.ZodBoolean=l.ZodBigInt=l.ZodNumber=l.ZodString=l.ZodType=void 0;l.NEVER=l.void=l.unknown=l.union=l.undefined=l.tuple=l.transformer=l.symbol=l.string=l.strictObject=l.set=l.record=l.promise=l.preprocess=l.pipeline=l.ostring=l.optional=l.onumber=l.oboolean=l.object=l.number=l.nullable=l.null=l.never=l.nativeEnum=l.nan=l.map=l.literal=l.lazy=l.intersection=l.instanceof=l.function=l.enum=l.effect=void 0;l.datetimeRegex=ps;l.custom=hs;var y=Br(),Jr=Hr(),T=cs(),f=to(),g=tr(),ne=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}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}},us=(t,e)=>{if((0,f.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new y.ZodError(t.common.issues);return this._error=r,this._error}}};function O(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{var u,d;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c!=null?c:a.defaultError}:typeof a.data=="undefined"?{message:(u=c!=null?c:n)!=null?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(d=c!=null?c:r)!=null?d:a.defaultError}},description:o}}var E=class{get description(){return this._def.description}_getType(e){return(0,g.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,g.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,g.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,f.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!=null?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)},o=this._parseSync({data:e,path:n.path,parent:n});return us(n,o)}"~validate"(e){var n,o;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return(0,f.isValid)(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>(0,f.isValid)(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await((0,f.isAsync)(o)?o:Promise.resolve(o));return us(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=e(o),a=()=>i.addIssue({code:y.ZodIssueCode.custom,...n(o)});return typeof Promise!="undefined"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new ee({schema:this,typeName:I.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:r=>this["~validate"](r)}}optional(){return re.create(this,this._def)}nullable(){return pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return be.create(this)}promise(){return Oe.create(this,this._def)}or(e){return $e.create([this,e],this._def)}and(e){return Be.create(this,e,this._def)}transform(e){return new ee({...O(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ge({...O(this._def),innerType:this,defaultValue:r,typeName:I.ZodDefault})}brand(){return new nr({typeName:I.ZodBranded,type:this,...O(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ye({...O(this._def),innerType:this,catchValue:r,typeName:I.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return or.create(this,e)}readonly(){return Xe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l.ZodType=E;l.Schema=E;l.ZodSchema=E;var Gu=/^c[^\s-]{8,}$/i,Yu=/^[0-9a-z]+$/,Xu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qu=/^[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,ed=/^[a-z0-9_-]{21}$/i,td=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rd=/^[-+]?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)?)??$/,nd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,od="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ro,id=/^(?:(?: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])$/,sd=/^(?:(?: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])$/,ad=/^(([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]))$/,cd=/^(([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])$/,ud=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dd=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ls="((\\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])))",ld=new RegExp(`^${ls}$`);function fs(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function fd(t){return new RegExp(`^${fs(t)}$`)}function ps(t){let e=`${ls}T${fs(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function pd(t,e){return!!((e==="v4"||!e)&&id.test(t)||(e==="v6"||!e)&&ad.test(t))}function md(t,e){if(!td.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function hd(t,e){return!!((e==="v4"||!e)&&sd.test(t)||(e==="v6"||!e)&&cd.test(t))}var Ie=class t extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.string,received:i.parsedType}),f.INVALID}let n=new f.ParseStatus,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")nd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"email",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ro||(ro=new RegExp(od,"u")),ro.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"emoji",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Qu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"uuid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ed.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"nanoid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Gu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cuid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Yu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cuid2",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Xu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"ulid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"url",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"regex",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?ps(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ld.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?fd(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?rd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"duration",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?pd(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"ip",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?md(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"jwt",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?hd(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cidr",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ud.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"base64",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?dd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"base64url",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):g.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:y.ZodIssueCode.invalid_string,...T.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.errorUtil.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!=null?r:!1,local:(n=e==null?void 0:e.local)!=null?n:!1,...T.errorUtil.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...T.errorUtil.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...T.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...T.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...T.errorUtil.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...T.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...T.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...T.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...T.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...T.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,T.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l.ZodString=Ie;Ie.create=t=>{var e;return new Ie({checks:[],typeName:I.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...O(t)})};function yd(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}var Le=class t extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.number,received:i.parsedType}),f.INVALID}let n,o=new f.ParseStatus;for(let i of this._def.checks)i.kind==="int"?g.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?yd(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_finite,message:i.message}),o.dirty()):g.util.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,T.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,T.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,T.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,T.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:T.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:T.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:T.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&g.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};l.ZodNumber=Le;Le.create=t=>new Le({checks:[],typeName:I.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...O(t)});var Me=class t extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.ZodParsedType.bigint)return this._getInvalidInput(e);let n,o=new f.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):g.util.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.bigint,received:r.parsedType}),f.INVALID}gte(e,r){return this.setLimit("min",e,!0,T.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,T.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,T.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,T.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:T.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:T.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l.ZodBigInt=Me;Me.create=t=>{var e;return new Me({checks:[],typeName:I.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...O(t)})};var Fe=class extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.boolean,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodBoolean=Fe;Fe.create=t=>new Fe({typeName:I.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...O(t)});var ze=class t extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.date,received:i.parsedType}),f.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_date}),f.INVALID}let n=new f.ParseStatus,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):g.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:T.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:T.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};l.ZodDate=ze;ze.create=t=>new ze({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:I.ZodDate,...O(t)});var ht=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.symbol,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodSymbol=ht;ht.create=t=>new ht({typeName:I.ZodSymbol,...O(t)});var qe=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.undefined,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodUndefined=qe;qe.create=t=>new qe({typeName:I.ZodUndefined,...O(t)});var Ve=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.null,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodNull=Ve;Ve.create=t=>new Ve({typeName:I.ZodNull,...O(t)});var Ae=class extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,f.OK)(e.data)}};l.ZodAny=Ae;Ae.create=t=>new Ae({typeName:I.ZodAny,...O(t)});var ve=class extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,f.OK)(e.data)}};l.ZodUnknown=ve;ve.create=t=>new ve({typeName:I.ZodUnknown,...O(t)});var ce=class extends E{_parse(e){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.never,received:r.parsedType}),f.INVALID}};l.ZodNever=ce;ce.create=t=>new ce({typeName:I.ZodNever,...O(t)});var yt=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.void,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodVoid=yt;yt.create=t=>new yt({typeName:I.ZodVoid,...O(t)});var be=class t extends E{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==g.ZodParsedType.array)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.array,received:r.parsedType}),f.INVALID;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&((0,f.addIssueToContext)(r,{code:s?y.ZodIssueCode.too_big:y.ZodIssueCode.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new ne(r,s,r.path,a)))).then(s=>f.ParseStatus.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new ne(r,s,r.path,a)));return f.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:T.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:T.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:T.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};l.ZodArray=be;be.create=(t,e)=>new be({type:t,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...O(e)});function mt(t){if(t instanceof Y){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=re.create(mt(n))}return new Y({...t._def,shape:()=>e})}else return t instanceof be?new be({...t._def,type:mt(t.element)}):t instanceof re?re.create(mt(t.unwrap())):t instanceof pe?pe.create(mt(t.unwrap())):t instanceof fe?fe.create(t.items.map(e=>mt(e))):t}var Y=class t extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=g.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==g.ZodParsedType.object){let u=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(u,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.object,received:u.parsedType}),f.INVALID}let{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ce&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let d=i[u],m=o.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new ne(o,m,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof ce){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&((0,f.addIssueToContext)(o,{code:y.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of a){let m=o.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new ne(o,m,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let m=await d.key,b=await d.value;u.push({key:m,value:b,alwaysSet:d.alwaysSet})}return u}).then(u=>f.ParseStatus.mergeObjectSync(n,u)):f.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return T.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,a,c;let o=(a=(s=(i=this._def).errorMap)==null?void 0:s.call(i,r,n).message)!=null?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=T.errorUtil.errToObj(e).message)!=null?c:o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:I.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of g.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of g.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return mt(this)}partial(e){let r={};for(let n of g.util.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of g.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof re;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return ms(g.util.objectKeys(this.shape))}};l.ZodObject=Y;Y.create=(t,e)=>new Y({shape:()=>t,unknownKeys:"strip",catchall:ce.create(),typeName:I.ZodObject,...O(e)});Y.strictCreate=(t,e)=>new Y({shape:()=>t,unknownKeys:"strict",catchall:ce.create(),typeName:I.ZodObject,...O(e)});Y.lazycreate=(t,e)=>new Y({shape:t,unknownKeys:"strip",catchall:ce.create(),typeName:I.ZodObject,...O(e)});var $e=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new y.ZodError(a.ctx.common.issues));return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_union,unionErrors:s}),f.INVALID}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new y.ZodError(c));return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_union,unionErrors:a}),f.INVALID}}get options(){return this._def.options}};l.ZodUnion=$e;$e.create=(t,e)=>new $e({options:t,typeName:I.ZodUnion,...O(e)});var ge=t=>t instanceof He?ge(t.schema):t instanceof ee?ge(t.innerType()):t instanceof We?[t.value]:t instanceof Je?t.options:t instanceof Ke?g.util.objectValues(t.enum):t instanceof Ge?ge(t._def.innerType):t instanceof qe?[void 0]:t instanceof Ve?[null]:t instanceof re?[void 0,...ge(t.unwrap())]:t instanceof pe?[null,...ge(t.unwrap())]:t instanceof nr||t instanceof Xe?ge(t.unwrap()):t instanceof Ye?ge(t._def.innerType):[],Kr=class t extends E{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.ZodParsedType.object)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.object,received:r.parsedType}),f.INVALID;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),f.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let i of r){let s=ge(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new t({typeName:I.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...O(n)})}};l.ZodDiscriminatedUnion=Kr;function no(t,e){let r=(0,g.getParsedType)(t),n=(0,g.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===g.ZodParsedType.object&&n===g.ZodParsedType.object){let o=g.util.objectKeys(e),i=g.util.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(let a of i){let c=no(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===g.ZodParsedType.array&&n===g.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let s=t[i],a=e[i],c=no(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===g.ZodParsedType.date&&n===g.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Be=class extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(i,s)=>{if((0,f.isAborted)(i)||(0,f.isAborted)(s))return f.INVALID;let a=no(i.value,s.value);return a.valid?(((0,f.isDirty)(i)||(0,f.isDirty)(s))&&r.dirty(),{status:r.value,value:a.data}):((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_intersection_types}),f.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};l.ZodIntersection=Be;Be.create=(t,e,r)=>new Be({left:t,right:e,typeName:I.ZodIntersection,...O(r)});var fe=class t extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.array)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.array,received:n.parsedType}),f.INVALID;if(n.data.length<this._def.items.length)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ne(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>f.ParseStatus.mergeArray(r,s)):f.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};l.ZodTuple=fe;fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:t,typeName:I.ZodTuple,rest:null,...O(e)})};var Gr=class t extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.object)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.object,received:n.parsedType}),f.INVALID;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new ne(n,a,n.path,a)),value:s._parse(new ne(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?f.ParseStatus.mergeObjectAsync(r,o):f.ParseStatus.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof E?new t({keyType:e,valueType:r,typeName:I.ZodRecord,...O(n)}):new t({keyType:Ie.create(),valueType:e,typeName:I.ZodRecord,...O(r)})}};l.ZodRecord=Gr;var gt=class extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.map)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.map,received:n.parsedType}),f.INVALID;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ne(n,a,n.path,[u,"key"])),value:i._parse(new ne(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return f.INVALID;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return f.INVALID;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}};l.ZodMap=gt;gt.create=(t,e,r)=>new gt({valueType:e,keyType:t,typeName:I.ZodMap,...O(r)});var vt=class t extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.set)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.set,received:n.parsedType}),f.INVALID;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let d of c){if(d.status==="aborted")return f.INVALID;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new ne(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:T.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:T.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};l.ZodSet=vt;vt.create=(t,e)=>new vt({valueType:t,minSize:null,maxSize:null,typeName:I.ZodSet,...O(e)});var Yr=class t extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.ZodParsedType.function)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.function,received:r.parsedType}),f.INVALID;function n(a,c){return(0,f.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Jr.getErrorMap)(),Jr.defaultErrorMap].filter(u=>!!u),issueData:{code:y.ZodIssueCode.invalid_arguments,argumentsError:c}})}function o(a,c){return(0,f.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Jr.getErrorMap)(),Jr.defaultErrorMap].filter(u=>!!u),issueData:{code:y.ZodIssueCode.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Oe){let a=this;return(0,f.OK)(async function(...c){let u=new y.ZodError([]),d=await a._def.args.parseAsync(c,i).catch(C=>{throw u.addIssue(n(c,C)),u}),m=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(m,i).catch(C=>{throw u.addIssue(o(m,C)),u})})}else{let a=this;return(0,f.OK)(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new y.ZodError([n(c,u.error)]);let d=Reflect.apply(s,this,u.data),m=a._def.returns.safeParse(d,i);if(!m.success)throw new y.ZodError([o(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:fe.create(e).rest(ve.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||fe.create([]).rest(ve.create()),returns:r||ve.create(),typeName:I.ZodFunction,...O(n)})}};l.ZodFunction=Yr;var He=class extends E{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};l.ZodLazy=He;He.create=(t,e)=>new He({getter:t,typeName:I.ZodLazy,...O(e)});var We=class extends E{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{received:r.data,code:y.ZodIssueCode.invalid_literal,expected:this._def.value}),f.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};l.ZodLiteral=We;We.create=(t,e)=>new We({value:t,typeName:I.ZodLiteral,...O(e)});function ms(t,e){return new Je({values:t,typeName:I.ZodEnum,...O(e)})}var Je=class t extends E{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,f.addIssueToContext)(r,{expected:g.util.joinValues(n),received:r.parsedType,code:y.ZodIssueCode.invalid_type}),f.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,f.addIssueToContext)(r,{received:r.data,code:y.ZodIssueCode.invalid_enum_value,options:n}),f.INVALID}return(0,f.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};l.ZodEnum=Je;Je.create=ms;var Ke=class extends E{_parse(e){let r=g.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==g.ZodParsedType.string&&n.parsedType!==g.ZodParsedType.number){let o=g.util.objectValues(r);return(0,f.addIssueToContext)(n,{expected:g.util.joinValues(o),received:n.parsedType,code:y.ZodIssueCode.invalid_type}),f.INVALID}if(this._cache||(this._cache=new Set(g.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=g.util.objectValues(r);return(0,f.addIssueToContext)(n,{received:n.data,code:y.ZodIssueCode.invalid_enum_value,options:o}),f.INVALID}return(0,f.OK)(e.data)}get enum(){return this._def.values}};l.ZodNativeEnum=Ke;Ke.create=(t,e)=>new Ke({values:t,typeName:I.ZodNativeEnum,...O(e)});var Oe=class extends E{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.ZodParsedType.promise&&r.common.async===!1)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.promise,received:r.parsedType}),f.INVALID;let n=r.parsedType===g.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,f.OK)(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};l.ZodPromise=Oe;Oe.create=(t,e)=>new Oe({type:t,typeName:I.ZodPromise,...O(e)});var ee=class extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{(0,f.addIssueToContext)(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return f.INVALID;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?f.INVALID:c.status==="dirty"||r.value==="dirty"?(0,f.DIRTY)(c.value):c});{if(r.value==="aborted")return f.INVALID;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?f.INVALID:a.status==="dirty"||r.value==="dirty"?(0,f.DIRTY)(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?f.INVALID:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?f.INVALID:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,f.isValid)(s))return f.INVALID;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>(0,f.isValid)(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):f.INVALID);g.util.assertNever(o)}};l.ZodEffects=ee;l.ZodTransformer=ee;ee.create=(t,e,r)=>new ee({schema:t,typeName:I.ZodEffects,effect:e,...O(r)});ee.createWithPreprocess=(t,e,r)=>new ee({schema:e,effect:{type:"preprocess",transform:t},typeName:I.ZodEffects,...O(r)});var re=class extends E{_parse(e){return this._getType(e)===g.ZodParsedType.undefined?(0,f.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};l.ZodOptional=re;re.create=(t,e)=>new re({innerType:t,typeName:I.ZodOptional,...O(e)});var pe=class extends E{_parse(e){return this._getType(e)===g.ZodParsedType.null?(0,f.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};l.ZodNullable=pe;pe.create=(t,e)=>new pe({innerType:t,typeName:I.ZodNullable,...O(e)});var Ge=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===g.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};l.ZodDefault=Ge;Ge.create=(t,e)=>new Ge({innerType:t,typeName:I.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var Ye=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,f.isAsync)(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new y.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new y.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};l.ZodCatch=Ye;Ye.create=(t,e)=>new Ye({innerType:t,typeName:I.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var bt=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.nan,received:n.parsedType}),f.INVALID}return{status:"valid",value:e.data}}};l.ZodNaN=bt;bt.create=t=>new bt({typeName:I.ZodNaN,...O(t)});l.BRAND=Symbol("zod_brand");var nr=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};l.ZodBranded=nr;var or=class t extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?f.INVALID:i.status==="dirty"?(r.dirty(),(0,f.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?f.INVALID:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:I.ZodPipeline})}};l.ZodPipeline=or;var Xe=class extends E{_parse(e){let r=this._def.innerType._parse(e),n=o=>((0,f.isValid)(o)&&(o.value=Object.freeze(o.value)),o);return(0,f.isAsync)(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};l.ZodReadonly=Xe;Xe.create=(t,e)=>new Xe({innerType:t,typeName:I.ZodReadonly,...O(e)});function ds(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function hs(t,e={},r){return t?Ae.create().superRefine((n,o)=>{var s,a;let i=t(n);if(i instanceof Promise)return i.then(c=>{var u,d;if(!c){let m=ds(e,n),b=(d=(u=m.fatal)!=null?u:r)!=null?d:!0;o.addIssue({code:"custom",...m,fatal:b})}});if(!i){let c=ds(e,n),u=(a=(s=c.fatal)!=null?s:r)!=null?a:!0;o.addIssue({code:"custom",...c,fatal:u})}}):Ae.create()}l.late={object:Y.lazycreate};var I;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(I||(l.ZodFirstPartyTypeKind=I={}));var gd=(t,e={message:`Input not instance of ${t.name}`})=>hs(r=>r instanceof t,e);l.instanceof=gd;var ys=Ie.create;l.string=ys;var gs=Le.create;l.number=gs;var vd=bt.create;l.nan=vd;var bd=Me.create;l.bigint=bd;var vs=Fe.create;l.boolean=vs;var _d=ze.create;l.date=_d;var xd=ht.create;l.symbol=xd;var wd=qe.create;l.undefined=wd;var Cd=Ve.create;l.null=Cd;var Td=Ae.create;l.any=Td;var Sd=ve.create;l.unknown=Sd;var Id=ce.create;l.never=Id;var Ad=yt.create;l.void=Ad;var Od=be.create;l.array=Od;var Ed=Y.create;l.object=Ed;var Rd=Y.strictCreate;l.strictObject=Rd;var Pd=$e.create;l.union=Pd;var kd=Kr.create;l.discriminatedUnion=kd;var jd=Be.create;l.intersection=jd;var Zd=fe.create;l.tuple=Zd;var Ud=Gr.create;l.record=Ud;var Nd=gt.create;l.map=Nd;var Dd=vt.create;l.set=Dd;var Ld=Yr.create;l.function=Ld;var Md=He.create;l.lazy=Md;var Fd=We.create;l.literal=Fd;var zd=Je.create;l.enum=zd;var qd=Ke.create;l.nativeEnum=qd;var Vd=Oe.create;l.promise=Vd;var bs=ee.create;l.effect=bs;l.transformer=bs;var $d=re.create;l.optional=$d;var Bd=pe.create;l.nullable=Bd;var Hd=ee.createWithPreprocess;l.preprocess=Hd;var Wd=or.create;l.pipeline=Wd;var Jd=()=>ys().optional();l.ostring=Jd;var Kd=()=>gs().optional();l.onumber=Kd;var Gd=()=>vs().optional();l.oboolean=Gd;l.coerce={string:t=>Ie.create({...t,coerce:!0}),number:t=>Le.create({...t,coerce:!0}),boolean:t=>Fe.create({...t,coerce:!0}),bigint:t=>Me.create({...t,coerce:!0}),date:t=>ze.create({...t,coerce:!0})};l.NEVER=f.INVALID});var oo=w(oe=>{"use strict";var Yd=oe&&oe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_t=oe&&oe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yd(e,t,r)};Object.defineProperty(oe,"__esModule",{value:!0});_t(Hr(),oe);_t(to(),oe);_t(ss(),oe);_t(tr(),oe);_t(_s(),oe);_t(Br(),oe)});var U=w(X=>{"use strict";var xs=X&&X.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Xd=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qd=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&xs(e,t,r);return Xd(e,t),e},el=X&&X.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xs(e,t,r)};Object.defineProperty(X,"__esModule",{value:!0});X.z=void 0;var ws=Qd(oo());X.z=ws;el(oo(),X);X.default=ws});var io=w(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.actionTypesZodSchema=xt.ActionTypes=void 0;var tl=U(),Cs;(function(t){t.OpenUrl="openUrl",t.ImBack="imBack",t.PostBack="postBack",t.PlayAudio="playAudio",t.PlayVideo="playVideo",t.ShowImage="showImage",t.DownloadFile="downloadFile",t.Signin="signin",t.Call="call",t.MessageBack="messageBack",t.OpenApp="openApp"})(Cs||(xt.ActionTypes=Cs={}));xt.actionTypesZodSchema=tl.z.enum(["openUrl","imBack","postBack","playAudio","showImage","downloadFile","signin","call","messageBack","openApp"])});var so=w(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.semanticActionStateTypesZodSchema=wt.SemanticActionStateTypes=void 0;var rl=U(),Ts;(function(t){t.Start="start",t.Continue="continue",t.Done="done"})(Ts||(wt.SemanticActionStateTypes=Ts={}));wt.semanticActionStateTypesZodSchema=rl.z.enum(["start","continue","done"])});var ao=w(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.attachmentLayoutTypesZodSchema=Ct.AttachmentLayoutTypes=void 0;var nl=U(),Ss;(function(t){t.List="list",t.Carousel="carousel"})(Ss||(Ct.AttachmentLayoutTypes=Ss={}));Ct.attachmentLayoutTypesZodSchema=nl.z.enum(["list","carousel"])});var co=w(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.Channels=void 0;var Is;(function(t){t.Alexa="alexa",t.Console="console",t.Directline="directline",t.DirectlineSpeech="directlinespeech",t.Email="email",t.Emulator="emulator",t.Facebook="facebook",t.Groupme="groupme",t.Line="line",t.Msteams="msteams",t.Omni="omnichannel",t.Outlook="outlook",t.Skype="skype",t.Slack="slack",t.Sms="sms",t.Telegram="telegram",t.Telephony="telephony",t.Test="test",t.Webchat="webchat"})(Is||(Xr.Channels=Is={}))});var uo=w(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.endOfConversationCodesZodSchema=Tt.EndOfConversationCodes=void 0;var ol=U(),As;(function(t){t.Unknown="unknown",t.CompletedSuccessfully="completedSuccessfully",t.UserCancelled="userCancelled",t.AgentTimedOut="agentTimedOut",t.AgentIssuedInvalidMessage="agentIssuedInvalidMessage",t.ChannelFailed="channelFailed"})(As||(Tt.EndOfConversationCodes=As={}));Tt.endOfConversationCodesZodSchema=ol.z.enum(["unknown","completedSuccessfully","userCancelled","agentTimedOut","agentIssuedInvalidMessage","channelFailed"])});var Qr=w(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.roleTypeZodSchema=St.RoleTypes=void 0;var il=U(),Os;(function(t){t.User="user",t.Agent="bot",t.Skill="skill"})(Os||(St.RoleTypes=Os={}));St.roleTypeZodSchema=il.z.enum(["user","bot","skill"])});var Es=w(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.addAIToActivity=void 0;var sl=(t,e,r)=>{var n;let o={type:"https://schema.org/Message","@type":"Message","@context":"https://schema.org","@id":"",additionalType:["AIGeneratedContent"],citation:e,usageInfo:r};(n=t.entities)!==null&&n!==void 0||(t.entities=[]),t.entities.push(o)};en.addAIToActivity=sl});var Rs=w(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.adaptiveCardInvokeActionZodSchema=void 0;var Qe=U();tn.adaptiveCardInvokeActionZodSchema=Qe.z.object({type:Qe.z.string().min(1),id:Qe.z.string().optional(),verb:Qe.z.string().min(1),data:Qe.z.record(Qe.z.string().min(1),Qe.z.any())})});var Ps=w(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var ks=w(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.default="00000000-0000-0000-0000-000000000000"});var js=w(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var ir=w(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});var al=js();function cl(t){return typeof t=="string"&&al.default.test(t)}mo.default=cl});var sr=w(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});var ul=ir();function dl(t){if(!(0,ul.default)(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}ho.default=dl});var _e=w(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.unsafeStringify=void 0;var ll=ir(),q=[];for(let t=0;t<256;++t)q.push((t+256).toString(16).slice(1));function Zs(t,e=0){return(q[t[e+0]]+q[t[e+1]]+q[t[e+2]]+q[t[e+3]]+"-"+q[t[e+4]]+q[t[e+5]]+"-"+q[t[e+6]]+q[t[e+7]]+"-"+q[t[e+8]]+q[t[e+9]]+"-"+q[t[e+10]]+q[t[e+11]]+q[t[e+12]]+q[t[e+13]]+q[t[e+14]]+q[t[e+15]]).toLowerCase()}ar.unsafeStringify=Zs;function fl(t,e=0){let r=Zs(t,e);if(!(0,ll.default)(r))throw TypeError("Stringified UUID is invalid");return r}ar.default=fl});var rn=w(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});var yo,pl=new Uint8Array(16);function ml(){if(!yo){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yo=crypto.getRandomValues.bind(crypto)}return yo(pl)}go.default=ml});var vo=w(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.updateV1State=void 0;var Us=rn(),hl=_e(),cr={};function yl(t,e,r){var i,s,a,c;let n,o=(i=t==null?void 0:t._v6)!=null?i:!1;if(t){let u=Object.keys(t);u.length===1&&u[0]==="_v6"&&(t=void 0)}if(t)n=Ns((c=(a=t.random)!=null?a:(s=t.rng)==null?void 0:s.call(t))!=null?c:(0,Us.default)(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let u=Date.now(),d=(0,Us.default)();Ds(cr,u,d),n=Ns(d,cr.msecs,cr.nsecs,o?void 0:cr.clockseq,o?void 0:cr.node,e,r)}return e!=null?e:(0,hl.unsafeStringify)(n)}function Ds(t,e,r){var n,o;return(n=t.msecs)!=null||(t.msecs=-1/0),(o=t.nsecs)!=null||(t.nsecs=0),e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e<t.msecs&&(t.node=void 0),t.node||(t.node=r.slice(10,16),t.node[0]|=1,t.clockseq=(r[8]<<8|r[9])&16383),t.msecs=e,t}ur.updateV1State=Ds;function Ns(t,e,r,n,o,i,s=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!i)i=new Uint8Array(16),s=0;else if(s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);e!=null||(e=Date.now()),r!=null||(r=0),n!=null||(n=(t[8]<<8|t[9])&16383),o!=null||(o=t.slice(10,16)),e+=122192928e5;let a=((e&268435455)*1e4+r)%4294967296;i[s++]=a>>>24&255,i[s++]=a>>>16&255,i[s++]=a>>>8&255,i[s++]=a&255;let c=e/4294967296*1e4&268435455;i[s++]=c>>>8&255,i[s++]=c&255,i[s++]=c>>>24&15|16,i[s++]=c>>>16&255,i[s++]=n>>>8|128,i[s++]=n&255;for(let u=0;u<6;++u)i[s++]=o[u];return i}ur.default=yl});var _o=w(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});var gl=sr(),vl=_e();function bl(t){let e=typeof t=="string"?(0,gl.default)(t):t,r=_l(e);return typeof t=="string"?(0,vl.unsafeStringify)(r):r}bo.default=bl;function _l(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}});var Ms=w(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});function xl(t){let e=Tl(t),r=Cl(e,t.length*8);return wl(r)}function wl(t){let e=new Uint8Array(t.length*4);for(let r=0;r<t.length*4;r++)e[r]=t[r>>2]>>>r%4*8&255;return e}function Ls(t){return(t+64>>>9<<4)+14+1}function Cl(t,e){let r=new Uint32Array(Ls(e)).fill(0);r.set(t),r[e>>5]|=128<<e%32,r[r.length-1]=e,t=r;let n=1732584193,o=-271733879,i=-1732584194,s=271733878;for(let a=0;a<t.length;a+=16){let c=n,u=o,d=i,m=s;n=B(n,o,i,s,t[a],7,-680876936),s=B(s,n,o,i,t[a+1],12,-389564586),i=B(i,s,n,o,t[a+2],17,606105819),o=B(o,i,s,n,t[a+3],22,-1044525330),n=B(n,o,i,s,t[a+4],7,-176418897),s=B(s,n,o,i,t[a+5],12,1200080426),i=B(i,s,n,o,t[a+6],17,-1473231341),o=B(o,i,s,n,t[a+7],22,-45705983),n=B(n,o,i,s,t[a+8],7,1770035416),s=B(s,n,o,i,t[a+9],12,-1958414417),i=B(i,s,n,o,t[a+10],17,-42063),o=B(o,i,s,n,t[a+11],22,-1990404162),n=B(n,o,i,s,t[a+12],7,1804603682),s=B(s,n,o,i,t[a+13],12,-40341101),i=B(i,s,n,o,t[a+14],17,-1502002290),o=B(o,i,s,n,t[a+15],22,1236535329),n=H(n,o,i,s,t[a+1],5,-165796510),s=H(s,n,o,i,t[a+6],9,-1069501632),i=H(i,s,n,o,t[a+11],14,643717713),o=H(o,i,s,n,t[a],20,-373897302),n=H(n,o,i,s,t[a+5],5,-701558691),s=H(s,n,o,i,t[a+10],9,38016083),i=H(i,s,n,o,t[a+15],14,-660478335),o=H(o,i,s,n,t[a+4],20,-405537848),n=H(n,o,i,s,t[a+9],5,568446438),s=H(s,n,o,i,t[a+14],9,-1019803690),i=H(i,s,n,o,t[a+3],14,-187363961),o=H(o,i,s,n,t[a+8],20,1163531501),n=H(n,o,i,s,t[a+13],5,-1444681467),s=H(s,n,o,i,t[a+2],9,-51403784),i=H(i,s,n,o,t[a+7],14,1735328473),o=H(o,i,s,n,t[a+12],20,-1926607734),n=W(n,o,i,s,t[a+5],4,-378558),s=W(s,n,o,i,t[a+8],11,-2022574463),i=W(i,s,n,o,t[a+11],16,1839030562),o=W(o,i,s,n,t[a+14],23,-35309556),n=W(n,o,i,s,t[a+1],4,-1530992060),s=W(s,n,o,i,t[a+4],11,1272893353),i=W(i,s,n,o,t[a+7],16,-155497632),o=W(o,i,s,n,t[a+10],23,-1094730640),n=W(n,o,i,s,t[a+13],4,681279174),s=W(s,n,o,i,t[a],11,-358537222),i=W(i,s,n,o,t[a+3],16,-722521979),o=W(o,i,s,n,t[a+6],23,76029189),n=W(n,o,i,s,t[a+9],4,-640364487),s=W(s,n,o,i,t[a+12],11,-421815835),i=W(i,s,n,o,t[a+15],16,530742520),o=W(o,i,s,n,t[a+2],23,-995338651),n=J(n,o,i,s,t[a],6,-198630844),s=J(s,n,o,i,t[a+7],10,1126891415),i=J(i,s,n,o,t[a+14],15,-1416354905),o=J(o,i,s,n,t[a+5],21,-57434055),n=J(n,o,i,s,t[a+12],6,1700485571),s=J(s,n,o,i,t[a+3],10,-1894986606),i=J(i,s,n,o,t[a+10],15,-1051523),o=J(o,i,s,n,t[a+1],21,-2054922799),n=J(n,o,i,s,t[a+8],6,1873313359),s=J(s,n,o,i,t[a+15],10,-30611744),i=J(i,s,n,o,t[a+6],15,-1560198380),o=J(o,i,s,n,t[a+13],21,1309151649),n=J(n,o,i,s,t[a+4],6,-145523070),s=J(s,n,o,i,t[a+11],10,-1120210379),i=J(i,s,n,o,t[a+2],15,718787259),o=J(o,i,s,n,t[a+9],21,-343485551),n=Ee(n,c),o=Ee(o,u),i=Ee(i,d),s=Ee(s,m)}return Uint32Array.of(n,o,i,s)}function Tl(t){if(t.length===0)return new Uint32Array;let e=new Uint32Array(Ls(t.length*8)).fill(0);for(let r=0;r<t.length;r++)e[r>>2]|=(t[r]&255)<<r%4*8;return e}function Ee(t,e){let r=(t&65535)+(e&65535);return(t>>16)+(e>>16)+(r>>16)<<16|r&65535}function Sl(t,e){return t<<e|t>>>32-e}function nn(t,e,r,n,o,i){return Ee(Sl(Ee(Ee(e,t),Ee(n,i)),o),r)}function B(t,e,r,n,o,i,s){return nn(e&r|~e&n,t,e,o,i,s)}function H(t,e,r,n,o,i,s){return nn(e&n|r&~n,t,e,o,i,s)}function W(t,e,r,n,o,i,s){return nn(e^r^n,t,e,o,i,s)}function J(t,e,r,n,o,i,s){return nn(r^(e|~n),t,e,o,i,s)}xo.default=xl});var dr=w(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.URL=xe.DNS=xe.stringToBytes=void 0;var Fs=sr(),Il=_e();function zs(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r);return e}xe.stringToBytes=zs;xe.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";xe.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Al(t,e,r,n,o,i){let s=typeof r=="string"?zs(r):r,a=typeof n=="string"?(0,Fs.default)(n):n;if(typeof n=="string"&&(n=(0,Fs.default)(n)),(n==null?void 0:n.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+s.length);if(c.set(a),c.set(s,a.length),c=e(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,o){i=i||0;for(let u=0;u<16;++u)o[i+u]=c[u];return o}return(0,Il.unsafeStringify)(c)}xe.default=Al});var Vs=w(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.URL=et.DNS=void 0;var Ol=Ms(),wo=dr(),qs=dr();Object.defineProperty(et,"DNS",{enumerable:!0,get:function(){return qs.DNS}});Object.defineProperty(et,"URL",{enumerable:!0,get:function(){return qs.URL}});function Co(t,e,r,n){return(0,wo.default)(48,Ol.default,t,e,r,n)}Co.DNS=wo.DNS;Co.URL=wo.URL;et.default=Co});var $s=w(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});var El=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);To.default={randomUUID:El}});var Hs=w(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});var Bs=$s(),Rl=rn(),Pl=_e();function kl(t,e,r){var o,i,s;if(Bs.default.randomUUID&&!e&&!t)return Bs.default.randomUUID();t=t||{};let n=(s=(i=t.random)!=null?i:(o=t.rng)==null?void 0:o.call(t))!=null?s:(0,Rl.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[r+a]=n[a];return e}return(0,Pl.unsafeStringify)(n)}So.default=kl});var Ws=w(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});function jl(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function Io(t,e){return t<<e|t>>>32-e}function Zl(t){let e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(t.length+1);n.set(t),n[t.length]=128,t=n;let o=t.length/4+2,i=Math.ceil(o/16),s=new Array(i);for(let a=0;a<i;++a){let c=new Uint32Array(16);for(let u=0;u<16;++u)c[u]=t[a*64+u*4]<<24|t[a*64+u*4+1]<<16|t[a*64+u*4+2]<<8|t[a*64+u*4+3];s[a]=c}s[i-1][14]=(t.length-1)*8/Math.pow(2,32),s[i-1][14]=Math.floor(s[i-1][14]),s[i-1][15]=(t.length-1)*8&4294967295;for(let a=0;a<i;++a){let c=new Uint32Array(80);for(let h=0;h<16;++h)c[h]=s[a][h];for(let h=16;h<80;++h)c[h]=Io(c[h-3]^c[h-8]^c[h-14]^c[h-16],1);let u=r[0],d=r[1],m=r[2],b=r[3],C=r[4];for(let h=0;h<80;++h){let v=Math.floor(h/20),_=Io(u,5)+jl(v,d,m,b)+C+e[v]+c[h]>>>0;C=b,b=m,m=Io(d,30)>>>0,d=u,u=_}r[0]=r[0]+u>>>0,r[1]=r[1]+d>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+C>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}Ao.default=Zl});var Ks=w(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.URL=tt.DNS=void 0;var Ul=Ws(),Oo=dr(),Js=dr();Object.defineProperty(tt,"DNS",{enumerable:!0,get:function(){return Js.DNS}});Object.defineProperty(tt,"URL",{enumerable:!0,get:function(){return Js.URL}});function Eo(t,e,r,n){return(0,Oo.default)(80,Ul.default,t,e,r,n)}Eo.DNS=Oo.DNS;Eo.URL=Oo.URL;tt.default=Eo});var Gs=w(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});var Nl=_e(),Dl=vo(),Ll=_o();function Ml(t,e,r){t!=null||(t={}),r!=null||(r=0);let n=(0,Dl.default)({...t,_v6:!0},new Uint8Array(16));if(n=(0,Ll.default)(n),e){for(let o=0;o<16;o++)e[r+o]=n[o];return e}return(0,Nl.unsafeStringify)(n)}Ro.default=Ml});var Ys=w(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});var Fl=sr(),zl=_e();function ql(t){let e=typeof t=="string"?(0,Fl.default)(t):t,r=Vl(e);return typeof t=="string"?(0,zl.unsafeStringify)(r):r}Po.default=ql;function Vl(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}});var ta=w(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.updateV7State=void 0;var Xs=rn(),$l=_e(),ko={};function Bl(t,e,r){var o,i,s;let n;if(t)n=Qs((s=(i=t.random)!=null?i:(o=t.rng)==null?void 0:o.call(t))!=null?s:(0,Xs.default)(),t.msecs,t.seq,e,r);else{let a=Date.now(),c=(0,Xs.default)();ea(ko,a,c),n=Qs(c,ko.msecs,ko.seq,e,r)}return e!=null?e:(0,$l.unsafeStringify)(n)}function ea(t,e,r){var n,o;return(n=t.msecs)!=null||(t.msecs=-1/0),(o=t.seq)!=null||(t.seq=0),e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}lr.updateV7State=ea;function Qs(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e!=null||(e=Date.now()),r!=null||(r=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9]),n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}lr.default=Bl});var ra=w(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});var Hl=ir();function Wl(t){if(!(0,Hl.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}jo.default=Wl});var na=w(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.version=k.validate=k.v7=k.v6ToV1=k.v6=k.v5=k.v4=k.v3=k.v1ToV6=k.v1=k.stringify=k.parse=k.NIL=k.MAX=void 0;var Jl=Ps();Object.defineProperty(k,"MAX",{enumerable:!0,get:function(){return Jl.default}});var Kl=ks();Object.defineProperty(k,"NIL",{enumerable:!0,get:function(){return Kl.default}});var Gl=sr();Object.defineProperty(k,"parse",{enumerable:!0,get:function(){return Gl.default}});var Yl=_e();Object.defineProperty(k,"stringify",{enumerable:!0,get:function(){return Yl.default}});var Xl=vo();Object.defineProperty(k,"v1",{enumerable:!0,get:function(){return Xl.default}});var Ql=_o();Object.defineProperty(k,"v1ToV6",{enumerable:!0,get:function(){return Ql.default}});var ef=Vs();Object.defineProperty(k,"v3",{enumerable:!0,get:function(){return ef.default}});var tf=Hs();Object.defineProperty(k,"v4",{enumerable:!0,get:function(){return tf.default}});var rf=Ks();Object.defineProperty(k,"v5",{enumerable:!0,get:function(){return rf.default}});var nf=Gs();Object.defineProperty(k,"v6",{enumerable:!0,get:function(){return nf.default}});var of=Ys();Object.defineProperty(k,"v6ToV1",{enumerable:!0,get:function(){return of.default}});var sf=ta();Object.defineProperty(k,"v7",{enumerable:!0,get:function(){return sf.default}});var af=ir();Object.defineProperty(k,"validate",{enumerable:!0,get:function(){return af.default}});var cf=ra();Object.defineProperty(k,"version",{enumerable:!0,get:function(){return cf.default}})});var Zo=w(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.entityZodSchema=void 0;var oa=U();on.entityZodSchema=oa.z.object({type:oa.z.string().min(1)}).passthrough()});var ia=w(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.semanticActionZodSchema=void 0;var fr=U(),uf=Zo(),df=so();sn.semanticActionZodSchema=fr.z.object({id:fr.z.string().min(1),state:fr.z.union([df.semanticActionStateTypesZodSchema,fr.z.string().min(1)]),entities:fr.z.record(uf.entityZodSchema)})});var sa=w(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.cardActionZodSchema=void 0;var me=U(),lf=io();an.cardActionZodSchema=me.z.object({type:me.z.union([lf.actionTypesZodSchema,me.z.string().min(1)]),title:me.z.string().min(1),image:me.z.string().min(1).optional(),text:me.z.string().min(1).optional(),displayText:me.z.string().min(1).optional(),value:me.z.any().optional(),channelData:me.z.unknown().optional(),imageAltText:me.z.string().min(1).optional()})});var aa=w(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.suggestedActionsZodSchema=void 0;var cn=U(),ff=sa();un.suggestedActionsZodSchema=cn.z.object({to:cn.z.array(cn.z.string().min(1)),actions:cn.z.array(ff.cardActionZodSchema)})});var Uo=w(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.activityEventNamesZodSchema=It.ActivityEventNames=void 0;var pf=U(),ca;(function(t){t.ContinueConversation="ContinueConversation",t.CreateConversation="CreateConversation"})(ca||(It.ActivityEventNames=ca={}));It.activityEventNamesZodSchema=pf.z.enum(["ContinueConversation","CreateConversation"])});var No=w(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.activityImportanceZodSchema=At.ActivityImportance=void 0;var mf=U(),ua;(function(t){t.Low="low",t.Normal="normal",t.High="high"})(ua||(At.ActivityImportance=ua={}));At.activityImportanceZodSchema=mf.z.enum(["low","normal","high"])});var Do=w(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.activityTypesZodSchema=Ot.ActivityTypes=void 0;var hf=U(),da;(function(t){t.Message="message",t.ContactRelationUpdate="contactRelationUpdate",t.ConversationUpdate="conversationUpdate",t.Typing="typing",t.EndOfConversation="endOfConversation",t.Event="event",t.Invoke="invoke",t.InvokeResponse="invokeResponse",t.DeleteUserData="deleteUserData",t.MessageUpdate="messageUpdate",t.MessageDelete="messageDelete",t.InstallationUpdate="installationUpdate",t.MessageReaction="messageReaction",t.Suggestion="suggestion",t.Trace="trace",t.Handoff="handoff",t.Command="command",t.CommandResult="commandResult",t.Delay="delay"})(da||(Ot.ActivityTypes=da={}));Ot.activityTypesZodSchema=hf.z.enum(["message","contactRelationUpdate","conversationUpdate","typing","endOfConversation","event","invoke","invokeResponse","deleteUserData","messageUpdate","messageDelete","installationUpdate","messageReaction","suggestion","trace","handoff","command","commandResult","delay"])});var la=w(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.attachmentZodSchema=void 0;var Et=U();dn.attachmentZodSchema=Et.z.object({contentType:Et.z.string().min(1),contentUrl:Et.z.string().min(1).optional(),content:Et.z.unknown().optional(),name:Et.z.string().min(1).optional(),thumbnailUrl:Et.z.string().min(1).optional()})});var Lo=w(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.channelAccountZodSchema=void 0;var rt=U(),yf=Qr();ln.channelAccountZodSchema=rt.z.object({id:rt.z.string().min(1).optional(),name:rt.z.string().optional(),aadObjectId:rt.z.string().min(1).optional(),role:rt.z.union([yf.roleTypeZodSchema,rt.z.string().min(1)]).optional(),properties:rt.z.unknown().optional()})});var Mo=w(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.conversationAccountZodSchema=void 0;var he=U(),gf=Qr();fn.conversationAccountZodSchema=he.z.object({isGroup:he.z.boolean().optional(),conversationType:he.z.string().min(1).optional(),tenantId:he.z.string().min(1).optional(),id:he.z.string().min(1),name:he.z.string().min(1).optional(),aadObjectId:he.z.string().min(1).optional(),role:he.z.union([gf.roleTypeZodSchema,he.z.string().min(1)]).optional(),properties:he.z.unknown().optional()})});var pa=w(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.conversationReferenceZodSchema=void 0;var pr=U(),fa=Lo(),vf=Mo();pn.conversationReferenceZodSchema=pr.z.object({activityId:pr.z.string().min(1).optional(),user:fa.channelAccountZodSchema.optional(),locale:pr.z.string().min(1).optional(),agent:fa.channelAccountZodSchema.optional().nullable(),conversation:vf.conversationAccountZodSchema,channelId:pr.z.string().min(1),serviceUrl:pr.z.string().min(1).optional()})});var Fo=w(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.deliveryModesZodSchema=Rt.DeliveryModes=void 0;var bf=U(),ma;(function(t){t.Normal="normal",t.Notification="notification",t.ExpectReplies="expectReplies",t.Ephemeral="ephemeral"})(ma||(Rt.DeliveryModes=ma={}));Rt.deliveryModesZodSchema=bf.z.enum(["normal","notification","expectReplies","ephemeral"])});var zo=w(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.inputHintsZodSchema=Pt.InputHints=void 0;var _f=U(),ha;(function(t){t.AcceptingInput="acceptingInput",t.IgnoringInput="ignoringInput",t.ExpectingInput="expectingInput"})(ha||(Pt.InputHints=ha={}));Pt.inputHintsZodSchema=_f.z.enum(["acceptingInput","ignoringInput","expectingInput"])});var qo=w(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.messageReactionTypesZodSchema=kt.MessageReactionTypes=void 0;var xf=U(),ya;(function(t){t.Like="like",t.PlusOne="plusOne"})(ya||(kt.MessageReactionTypes=ya={}));kt.messageReactionTypesZodSchema=xf.z.enum(["like","plusOne"])});var ga=w(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.messageReactionZodSchema=void 0;var Vo=U(),wf=qo();mn.messageReactionZodSchema=Vo.z.object({type:Vo.z.union([wf.messageReactionTypesZodSchema,Vo.z.string().min(1)])})});var $o=w(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.textFormatTypesZodSchema=jt.TextFormatTypes=void 0;var Cf=U(),va;(function(t){t.Markdown="markdown",t.Plain="plain",t.Xml="xml"})(va||(jt.TextFormatTypes=va={}));jt.textFormatTypesZodSchema=Cf.z.enum(["markdown","plain","xml"])});var ba=w(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.textHighlightZodSchema=void 0;var Bo=U();hn.textHighlightZodSchema=Bo.z.object({text:Bo.z.string().min(1),occurrence:Bo.z.number()})});var Ca=w(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.Activity=nt.activityZodSchema=void 0;var Tf=na(),S=U(),Sf=ia(),If=aa(),wa=Uo(),Af=No(),gn=Do(),Of=la(),Ef=ao(),yn=Lo(),_a=co(),Rf=Mo(),Pf=pa(),kf=uo(),jf=Fo(),Zf=Zo(),Uf=zo(),xa=ga(),Nf=$o(),Df=ba();nt.activityZodSchema=S.z.object({type:S.z.union([gn.activityTypesZodSchema,S.z.string().min(1)]),text:S.z.string().optional(),id:S.z.string().min(1).optional(),channelId:S.z.string().min(1).optional(),from:yn.channelAccountZodSchema.optional(),timestamp:S.z.union([S.z.date(),S.z.string().min(1).datetime().optional(),S.z.string().min(1).transform(t=>new Date(t)).optional()]),localTimestamp:S.z.string().min(1).transform(t=>new Date(t)).optional().or(S.z.date()).optional(),localTimezone:S.z.string().min(1).optional(),callerId:S.z.string().min(1).optional(),serviceUrl:S.z.string().min(1).optional(),conversation:Rf.conversationAccountZodSchema.optional(),recipient:yn.channelAccountZodSchema.optional(),textFormat:S.z.union([Nf.textFormatTypesZodSchema,S.z.string().min(1)]).optional(),attachmentLayout:S.z.union([Ef.attachmentLayoutTypesZodSchema,S.z.string().min(1)]).optional(),membersAdded:S.z.array(yn.channelAccountZodSchema).optional(),membersRemoved:S.z.array(yn.channelAccountZodSchema).optional(),reactionsAdded:S.z.array(xa.messageReactionZodSchema).optional(),reactionsRemoved:S.z.array(xa.messageReactionZodSchema).optional(),topicName:S.z.string().min(1).optional(),historyDisclosed:S.z.boolean().optional(),locale:S.z.string().min(1).optional(),speak:S.z.string().min(1).optional(),inputHint:S.z.union([Uf.inputHintsZodSchema,S.z.string().min(1)]).optional(),summary:S.z.string().min(1).optional(),suggestedActions:If.suggestedActionsZodSchema.optional(),attachments:S.z.array(Of.attachmentZodSchema).optional(),entities:S.z.array(Zf.entityZodSchema.passthrough()).optional(),channelData:S.z.any().optional(),action:S.z.string().min(1).optional(),replyToId:S.z.string().min(1).optional(),label:S.z.string().min(1).optional(),valueType:S.z.string().min(1).optional(),value:S.z.unknown().optional(),name:S.z.union([wa.activityEventNamesZodSchema,S.z.string().min(1)]).optional(),relatesTo:Pf.conversationReferenceZodSchema.optional(),code:S.z.union([kf.endOfConversationCodesZodSchema,S.z.string().min(1)]).optional(),expiration:S.z.string().min(1).datetime().optional(),importance:S.z.union([Af.activityImportanceZodSchema,S.z.string().min(1)]).optional(),deliveryMode:S.z.union([jf.deliveryModesZodSchema,S.z.string().min(1)]).optional(),listenFor:S.z.array(S.z.string().min(1)).optional(),textHighlights:S.z.array(Df.textHighlightZodSchema).optional(),semanticAction:Sf.semanticActionZodSchema.optional()});var Ho=class t{constructor(e){if(e===void 0)throw new Error("Invalid ActivityType: undefined");if(e===null)throw new Error("Invalid ActivityType: null");if(typeof e=="string"&&e.length===0)throw new Error("Invalid ActivityType: empty string");this.type=e}static fromJson(e){return this.fromObject(JSON.parse(e))}static fromObject(e){let r=nt.activityZodSchema.passthrough().parse(e),n=new t(r.type);return Object.assign(n,r),n}static getContinuationActivity(e){let r={type:gn.ActivityTypes.Event,name:wa.ActivityEventNames.ContinueConversation,id:(0,Tf.v4)(),channelId:e.channelId,locale:e.locale,serviceUrl:e.serviceUrl,conversation:e.conversation,recipient:e.agent,from:e.user,relatesTo:e};return t.fromObject(r)}getAppropriateReplyToId(){if(this.type!==gn.ActivityTypes.ConversationUpdate||this.channelId!==_a.Channels.Directline&&this.channelId!==_a.Channels.Webchat)return this.id}getConversationReference(){if(this.recipient===null||this.recipient===void 0)throw new Error("Activity Recipient undefined");if(this.conversation===null||this.conversation===void 0)throw new Error("Activity Conversation undefined");if(this.channelId===null||this.channelId===void 0)throw new Error("Activity ChannelId undefined");return{activityId:this.getAppropriateReplyToId(),user:this.from,agent:this.recipient,conversation:this.conversation,channelId:this.channelId,locale:this.locale,serviceUrl:this.serviceUrl}}applyConversationReference(e,r=!1){var n,o,i;return this.channelId=e.channelId,(n=this.locale)!==null&&n!==void 0||(this.locale=e.locale),this.serviceUrl=e.serviceUrl,this.conversation=e.conversation,r?(this.from=e.user,this.recipient=(o=e.agent)!==null&&o!==void 0?o:void 0,e.activityId&&(this.id=e.activityId)):(this.from=(i=e.agent)!==null&&i!==void 0?i:void 0,this.recipient=e.user,e.activityId&&(this.replyToId=e.activityId)),this}clone(){let e=JSON.parse(JSON.stringify(this));for(let r in e)typeof e[r]=="string"&&!isNaN(Date.parse(e[r]))&&(e[r]=new Date(e[r]));return Object.setPrototypeOf(e,t.prototype),e}getMentions(e){let r=[];if(e.entities!==void 0)for(let n=0;n<e.entities.length;n++)e.entities[n].type.toLowerCase()==="mention"&&r.push(e.entities[n]);return r}normalizeMentions(e=!1){var r,n;if(this.type===gn.ActivityTypes.Message&&(e&&(this.removeRecipientMention(),this.entities!==void 0&&(!((r=this.recipient)===null||r===void 0)&&r.id)&&(this.entities=this.entities.filter(o=>{var i;return o.type.toLowerCase()==="mention"?o.mentioned.id!==((i=this.recipient)===null||i===void 0?void 0:i.id):!0}))),this.text&&(this.text=t.removeAt(this.text)),this.entities!==void 0)){let o=this.getMentions(this);for(let i of o)i.text&&(i.text=(n=t.removeAt(i.text))===null||n===void 0?void 0:n.trim())}}static removeAt(e){if(!e)return e;let r;do{r=!1;let n=e.toLowerCase().indexOf("<at");if(n>=0){let o=e.indexOf(">",n);if(o>0){let i=e.toLowerCase().indexOf("</at>",o);if(i>0){let s=e.substring(i+5);s.length>0&&!/\s/.test(s[0])&&(s=` ${s}`),e=e.substring(0,i)+s;let a=e.substring(o+1,i),c=e.substring(0,n);c.length>0&&!/\s$/.test(c)&&(c+=" "),e=c+a+s,r=!0}}}}while(r);return e}removeMentionText(e){let n=this.getMentions(this).filter(o=>o.mentioned.id===e);return n.length>0&&this.text&&(this.text=this.text.replace(n[0].text,"").trim()),this.text||""}removeRecipientMention(){return this.recipient!=null&&this.recipient.id?this.removeMentionText(this.recipient.id):""}getReplyConversationReference(e){let r=this.getConversationReference();return r.activityId=e,r}toJsonString(){return JSON.stringify(this)}};nt.Activity=Ho});var Ta=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.CallerIdConstants=void 0;vn.CallerIdConstants={PublicAzureChannel:"urn:botframework:azure",USGovChannel:"urn:botframework:azureusgov",AgentPrefix:"urn:botframework:aadappid:"}});var Sa=w(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.activityTreatments=Zt.ActivityTreatments=void 0;var Lf=U(),Wo;(function(t){t.Targeted="targeted"})(Wo||(Zt.ActivityTreatments=Wo={}));Zt.activityTreatments=Lf.z.nativeEnum(Wo)});var Oa=w(R=>{"use strict";var Mf=R&&R.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ia=R&&R.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mf(e,t,r)};Object.defineProperty(R,"__esModule",{value:!0});R.ActivityTreatments=R.TextFormatTypes=R.MessageReactionTypes=R.InputHints=R.DeliveryModes=R.CallerIdConstants=R.ActivityTypes=R.ActivityImportance=R.ActivityEventNames=R.activityZodSchema=R.Activity=R.RoleTypes=R.EndOfConversationCodes=R.Channels=R.AttachmentLayoutTypes=R.SemanticActionStateTypes=R.ActionTypes=void 0;var Ff=io();Object.defineProperty(R,"ActionTypes",{enumerable:!0,get:function(){return Ff.ActionTypes}});var zf=so();Object.defineProperty(R,"SemanticActionStateTypes",{enumerable:!0,get:function(){return zf.SemanticActionStateTypes}});var qf=ao();Object.defineProperty(R,"AttachmentLayoutTypes",{enumerable:!0,get:function(){return qf.AttachmentLayoutTypes}});var Vf=co();Object.defineProperty(R,"Channels",{enumerable:!0,get:function(){return Vf.Channels}});var $f=uo();Object.defineProperty(R,"EndOfConversationCodes",{enumerable:!0,get:function(){return $f.EndOfConversationCodes}});var Bf=Qr();Object.defineProperty(R,"RoleTypes",{enumerable:!0,get:function(){return Bf.RoleTypes}});Ia(Es(),R);Ia(Rs(),R);var Aa=Ca();Object.defineProperty(R,"Activity",{enumerable:!0,get:function(){return Aa.Activity}});Object.defineProperty(R,"activityZodSchema",{enumerable:!0,get:function(){return Aa.activityZodSchema}});var Hf=Uo();Object.defineProperty(R,"ActivityEventNames",{enumerable:!0,get:function(){return Hf.ActivityEventNames}});var Wf=No();Object.defineProperty(R,"ActivityImportance",{enumerable:!0,get:function(){return Wf.ActivityImportance}});var Jf=Do();Object.defineProperty(R,"ActivityTypes",{enumerable:!0,get:function(){return Jf.ActivityTypes}});var Kf=Ta();Object.defineProperty(R,"CallerIdConstants",{enumerable:!0,get:function(){return Kf.CallerIdConstants}});var Gf=Fo();Object.defineProperty(R,"DeliveryModes",{enumerable:!0,get:function(){return Gf.DeliveryModes}});var Yf=zo();Object.defineProperty(R,"InputHints",{enumerable:!0,get:function(){return Yf.InputHints}});var Xf=qo();Object.defineProperty(R,"MessageReactionTypes",{enumerable:!0,get:function(){return Xf.MessageReactionTypes}});var Qf=$o();Object.defineProperty(R,"TextFormatTypes",{enumerable:!0,get:function(){return Qf.TextFormatTypes}});var ep=Sa();Object.defineProperty(R,"ActivityTreatments",{enumerable:!0,get:function(){return ep.ActivityTreatments}})});var zt=(r=>(r[r.Published=0]="Published",r[r.Prebuilt=1]="Prebuilt",r))(zt||{});var qt=(x=>(x[x.Unknown=-1]="Unknown",x[x.Exp=0]="Exp",x[x.Dev=1]="Dev",x[x.Test=2]="Test",x[x.Preprod=3]="Preprod",x[x.FirstRelease=4]="FirstRelease",x[x.Prod=5]="Prod",x[x.Gov=6]="Gov",x[x.High=7]="High",x[x.DoD=8]="DoD",x[x.Mooncake=9]="Mooncake",x[x.Ex=10]="Ex",x[x.Rx=11]="Rx",x[x.Prv=12]="Prv",x[x.Local=13]="Local",x[x.GovFR=14]="GovFR",x[x.Other=100]="Other",x))(qt||{});var ai=class{constructor(){this.appClientId="";this.tenantId="";this.environmentId="";this.useExperimentalEndpoint=!1}},yp=()=>{var r,n,o,i;let t=process.env.cloud,e=process.env.copilotAgentType;return{appClientId:(r=process.env.appClientId)!=null?r:"",tenantId:(n=process.env.tenantId)!=null?n:"",environmentId:(o=process.env.environmentId)!=null?o:"",cloud:t?qt[t]:5,customPowerPlatformCloud:process.env.customPowerPlatformCloud,agentIdentifier:process.env.agentIdentifier,copilotAgentType:e?zt[e]:0,directConnectUrl:process.env.directConnectUrl,useExperimentalEndpoint:((i=process.env.useExperimentalEndpoint)==null?void 0:i.toLocaleLowerCase())==="true"}};function Vt(t,e){return function(){return t.apply(e,arguments)}}var{toString:tc}=Object.prototype,{getPrototypeOf:On}=Object,{iterator:_r,toStringTag:ui}=Symbol,xr=(t=>e=>{let r=tc.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),se=t=>(t=t.toLowerCase(),e=>xr(e)===t),wr=t=>e=>typeof e===t,{isArray:it}=Array,$t=wr("undefined");function rc(t){return t!==null&&!$t(t)&&t.constructor!==null&&!$t(t.constructor)&&K(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var di=se("ArrayBuffer");function nc(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&di(t.buffer),e}var oc=wr("string"),K=wr("function"),li=wr("number"),Cr=t=>t!==null&&typeof t=="object",ic=t=>t===!0||t===!1,br=t=>{if(xr(t)!=="object")return!1;let e=On(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ui in t)&&!(_r in t)},sc=se("Date"),ac=se("File"),cc=se("Blob"),uc=se("FileList"),dc=t=>Cr(t)&&K(t.pipe),lc=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||K(t.append)&&((e=xr(t))==="formdata"||e==="object"&&K(t.toString)&&t.toString()==="[object FormData]"))},fc=se("URLSearchParams"),[pc,mc,hc,yc]=["ReadableStream","Request","Response","Headers"].map(se),gc=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bt(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t=="undefined")return;let n,o;if(typeof t!="object"&&(t=[t]),it(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{let i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length,a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function fi(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,o;for(;n-- >0;)if(o=r[n],e===o.toLowerCase())return o;return null}var je=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,pi=t=>!$t(t)&&t!==je;function An(){let{caseless:t}=pi(this)&&this||{},e={},r=(n,o)=>{let i=t&&fi(e,o)||o;br(e[i])&&br(n)?e[i]=An(e[i],n):br(n)?e[i]=An({},n):it(n)?e[i]=n.slice():e[i]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&Bt(arguments[n],r);return e}var vc=(t,e,r,{allOwnKeys:n}={})=>(Bt(e,(o,i)=>{r&&K(o)?t[i]=Vt(o,r):t[i]=o},{allOwnKeys:n}),t),bc=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),_c=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},xc=(t,e,r,n)=>{let o,i,s,a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&On(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},wc=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},Cc=t=>{if(!t)return null;if(it(t))return t;let e=t.length;if(!li(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Tc=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&On(Uint8Array)),Sc=(t,e)=>{let n=(t&&t[_r]).call(t),o;for(;(o=n.next())&&!o.done;){let i=o.value;e.call(t,i[0],i[1])}},Ic=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Ac=se("HTMLFormElement"),Oc=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),ci=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ec=se("RegExp"),mi=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Bt(r,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(n[i]=s||o)}),Object.defineProperties(t,n)},Rc=t=>{mi(t,(e,r)=>{if(K(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(K(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pc=(t,e)=>{let r={},n=o=>{o.forEach(i=>{r[i]=!0})};return it(t)?n(t):n(String(t).split(e)),r},kc=()=>{},jc=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Zc(t){return!!(t&&K(t.append)&&t[ui]==="FormData"&&t[_r])}var Uc=t=>{let e=new Array(10),r=(n,o)=>{if(Cr(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;let i=it(n)?[]:{};return Bt(n,(s,a)=>{let c=r(s,o+1);!$t(c)&&(i[a]=c)}),e[o]=void 0,i}}return n};return r(t,0)},Nc=se("AsyncFunction"),Dc=t=>t&&(Cr(t)||K(t))&&K(t.then)&&K(t.catch),hi=((t,e)=>t?setImmediate:e?((r,n)=>(je.addEventListener("message",({source:o,data:i})=>{o===je&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),je.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",K(je.postMessage)),Lc=typeof queueMicrotask!="undefined"?queueMicrotask.bind(je):typeof process!="undefined"&&process.nextTick||hi,Mc=t=>t!=null&&K(t[_r]),p={isArray:it,isArrayBuffer:di,isBuffer:rc,isFormData:lc,isArrayBufferView:nc,isString:oc,isNumber:li,isBoolean:ic,isObject:Cr,isPlainObject:br,isReadableStream:pc,isRequest:mc,isResponse:hc,isHeaders:yc,isUndefined:$t,isDate:sc,isFile:ac,isBlob:cc,isRegExp:Ec,isFunction:K,isStream:dc,isURLSearchParams:fc,isTypedArray:Tc,isFileList:uc,forEach:Bt,merge:An,extend:vc,trim:gc,stripBOM:bc,inherits:_c,toFlatObject:xc,kindOf:xr,kindOfTest:se,endsWith:wc,toArray:Cc,forEachEntry:Sc,matchAll:Ic,isHTMLForm:Ac,hasOwnProperty:ci,hasOwnProp:ci,reduceDescriptors:mi,freezeMethods:Rc,toObjectSet:Pc,toCamelCase:Oc,noop:kc,toFiniteNumber:jc,findKey:fi,global:je,isContextDefined:pi,isSpecCompliantForm:Zc,toJSONObject:Uc,isAsyncFn:Nc,isThenable:Dc,setImmediate:hi,asap:Lc,isIterable:Mc};function st(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}p.inherits(st,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:p.toJSONObject(this.config),code:this.code,status:this.status}}});var yi=st.prototype,gi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{gi[t]={value:t}});Object.defineProperties(st,gi);Object.defineProperty(yi,"isAxiosError",{value:!0});st.from=(t,e,r,n,o,i)=>{let s=Object.create(yi);return p.toFlatObject(t,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),st.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};var A=st;var Tr=null;function En(t){return p.isPlainObject(t)||p.isArray(t)}function bi(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function vi(t,e,r){return t?t.concat(e).map(function(o,i){return o=bi(o),!r&&i?"["+o+"]":o}).join(r?".":""):e}function Fc(t){return p.isArray(t)&&!t.some(En)}var zc=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function qc(t,e,r){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new(Tr||FormData),r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,_){return!p.isUndefined(_[v])});let n=r.metaTokens,o=r.visitor||d,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob!="undefined"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(o))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(p.isBoolean(h))return h.toString();if(!c&&p.isBlob(h))throw new A("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,v,_){let x=h;if(h&&!_&&typeof h=="object"){if(p.endsWith(v,"{}"))v=n?v:v.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&Fc(h)||(p.isFileList(h)||p.endsWith(v,"[]"))&&(x=p.toArray(h)))return v=bi(v),x.forEach(function(N,z){!(p.isUndefined(N)||N===null)&&e.append(s===!0?vi([v],z,i):s===null?v:v+"[]",u(N))}),!1}return En(h)?!0:(e.append(vi(_,v,i),u(h)),!1)}let m=[],b=Object.assign(zc,{defaultVisitor:d,convertValue:u,isVisitable:En});function C(h,v){if(!p.isUndefined(h)){if(m.indexOf(h)!==-1)throw Error("Circular reference detected in "+v.join("."));m.push(h),p.forEach(h,function(x,P){(!(p.isUndefined(x)||x===null)&&o.call(e,x,p.isString(P)?P.trim():P,v,b))===!0&&C(x,v?v.concat(P):[P])}),m.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return C(t),e}var Ce=qc;function _i(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function xi(t,e){this._pairs=[],t&&Ce(t,this,e)}var wi=xi.prototype;wi.append=function(e,r){this._pairs.push([e,r])};wi.toString=function(e){let r=e?function(n){return e.call(this,n,_i)}:_i;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var Sr=xi;function Vc(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ht(t,e,r){if(!e)return t;let n=r&&r.encode||Vc;p.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,i;if(o?i=o(e,r):i=p.isURLSearchParams(e)?e.toString():new Sr(e,r).toString(n),i){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}var Rn=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){p.forEach(this.handlers,function(n){n!==null&&e(n)})}},Pn=Rn;var Ir={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Ci=typeof URLSearchParams!="undefined"?URLSearchParams:Sr;var Ti=typeof FormData!="undefined"?FormData:null;var Si=typeof Blob!="undefined"?Blob:null;var Ii={isBrowser:!0,classes:{URLSearchParams:Ci,FormData:Ti,Blob:Si},protocols:["http","https","file","blob","url","data"]};var Zn={};Qa(Zn,{hasBrowserEnv:()=>jn,hasStandardBrowserEnv:()=>$c,hasStandardBrowserWebWorkerEnv:()=>Bc,navigator:()=>kn,origin:()=>Hc});var jn=typeof window!="undefined"&&typeof document!="undefined",kn=typeof navigator=="object"&&navigator||void 0,$c=jn&&(!kn||["ReactNative","NativeScript","NS"].indexOf(kn.product)<0),Bc=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hc=jn&&window.location.href||"http://localhost";var L={...Zn,...Ii};function Un(t,e){return Ce(t,new L.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return L.isNode&&p.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function Wc(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Jc(t){let e={},r=Object.keys(t),n,o=r.length,i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}function Kc(t){function e(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),c=i>=r.length;return s=!s&&p.isArray(o)?o.length:s,c?(p.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!p.isObject(o[s]))&&(o[s]=[]),e(r,n,o[s],i)&&p.isArray(o[s])&&(o[s]=Jc(o[s])),!a)}if(p.isFormData(t)&&p.isFunction(t.entries)){let r={};return p.forEachEntry(t,(n,o)=>{e(Wc(n),o,r,0)}),r}return null}var Ar=Kc;function Gc(t,e,r){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Nn={transitional:Ir,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=p.isObject(e);if(i&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return o?JSON.stringify(Ar(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)||p.isReadableStream(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Un(e,this.formSerializer).toString();if((a=p.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return Ce(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Gc(e)):e}],transformResponse:[function(e){let r=this.transitional||Nn.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(p.isResponse(e)||p.isReadableStream(e))return e;if(e&&p.isString(e)&&(n&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?A.from(a,A.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{Nn.headers[t]={}});var at=Nn;var Yc=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ai=t=>{let e={},r,n,o;return t&&t.split(`
|
|
2
|
-
`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||e[r]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){let n=(this[Oi]=this[Oi]={accessors:{}}).accessors,o=this.prototype;function i(s){let a=Wt(s);n[a]||(tu(o,s),n[a]=!0)}return p.isArray(e)?e.forEach(i):i(e),this}};ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(ct.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});p.freezeMethods(ct);var F=ct;function Jt(t,e){let r=this||at,n=e||r,o=F.from(n.headers),i=n.data;return p.forEach(t,function(a){i=a.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Kt(t){return!!(t&&t.__CANCEL__)}function Ei(t,e,r){A.call(this,t==null?"canceled":t,A.ERR_CANCELED,e,r),this.name="CanceledError"}p.inherits(Ei,A,{__CANCEL__:!0});var de=Ei;function Gt(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new A("Request failed with status code "+r.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ln(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ru(t,e){t=t||10;let r=new Array(t),n=new Array(t),o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){let u=Date.now(),d=n[i];s||(s=u),r[o]=c,n[o]=u;let m=i,b=0;for(;m!==o;)b+=r[m++],m=m%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s<e)return;let C=d&&u-d;return C?Math.round(b*1e3/C):void 0}}var Ri=ru;function nu(t,e){let r=0,n=1e3/e,o,i,s=(u,d=Date.now())=>{r=d,o=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{let d=Date.now(),m=d-r;m>=n?s(u,d):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},n-m)))},()=>o&&s(o)]}var Pi=nu;var ut=(t,e,r=3)=>{let n=0,o=Ri(50,250);return Pi(i=>{let s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-n,u=o(c),d=s<=a;n=s;let m={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},r)},Mn=(t,e)=>{let r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Fn=t=>(...e)=>p.asap(()=>t(...e));var ki=L.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,L.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0;var ji=L.hasStandardBrowserEnv?{write(t,e,r,n,o,i){let s=[t+"="+encodeURIComponent(e)];p.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),p.isString(n)&&s.push("path="+n),p.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function zn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Yt(t,e,r){let n=!zn(e);return t&&(n||r==!1)?qn(t,e):e}var Zi=t=>t instanceof F?{...t}:t;function ae(t,e){e=e||{};let r={};function n(u,d,m,b){return p.isPlainObject(u)&&p.isPlainObject(d)?p.merge.call({caseless:b},u,d):p.isPlainObject(d)?p.merge({},d):p.isArray(d)?d.slice():d}function o(u,d,m,b){if(p.isUndefined(d)){if(!p.isUndefined(u))return n(void 0,u,m,b)}else return n(u,d,m,b)}function i(u,d){if(!p.isUndefined(d))return n(void 0,d)}function s(u,d){if(p.isUndefined(d)){if(!p.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function a(u,d,m){if(m in e)return n(u,d);if(m in t)return n(void 0,u)}let c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,d,m)=>o(Zi(u),Zi(d),m,!0)};return p.forEach(Object.keys(Object.assign({},t,e)),function(d){let m=c[d]||o,b=m(t[d],e[d],d);p.isUndefined(b)&&m!==a||(r[d]=b)}),r}var Er=t=>{let e=ae({},t),{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;e.headers=s=F.from(s),e.url=Ht(Yt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(p.isFormData(r)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){let[u,...d]=c?c.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...d].join("; "))}}if(L.hasStandardBrowserEnv&&(n&&p.isFunction(n)&&(n=n(e)),n||n!==!1&&ki(e.url))){let u=o&&i&&ji.read(i);u&&s.set(o,u)}return e};var ou=typeof XMLHttpRequest!="undefined",Ui=ou&&function(t){return new Promise(function(r,n){let o=Er(t),i=o.data,s=F.from(o.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,d,m,b,C,h;function v(){C&&C(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function x(){if(!_)return;let N=F.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:N,config:t,request:_};Gt(function(ye){r(ye),v()},function(ye){n(ye),v()},D),_=null}"onloadend"in _?_.onloadend=x:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(x)},_.onabort=function(){_&&(n(new A("Request aborted",A.ECONNABORTED,t,_)),_=null)},_.onerror=function(){n(new A("Network Error",A.ERR_NETWORK,t,_)),_=null},_.ontimeout=function(){let z=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",D=o.transitional||Ir;o.timeoutErrorMessage&&(z=o.timeoutErrorMessage),n(new A(z,D.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,t,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&p.forEach(s.toJSON(),function(z,D){_.setRequestHeader(D,z)}),p.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),u&&([b,h]=ut(u,!0),_.addEventListener("progress",b)),c&&_.upload&&([m,C]=ut(c),_.upload.addEventListener("progress",m),_.upload.addEventListener("loadend",C)),(o.cancelToken||o.signal)&&(d=N=>{_&&(n(!N||N.type?new de(null,t,_):N),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));let P=Ln(o.url);if(P&&L.protocols.indexOf(P)===-1){n(new A("Unsupported protocol "+P+":",A.ERR_BAD_REQUEST,t));return}_.send(i||null)})};var iu=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,o,i=function(u){if(!o){o=!0,a();let d=u instanceof Error?u:this.reason;n.abort(d instanceof A?d:new de(d instanceof Error?d.message:d))}},s=e&&setTimeout(()=>{s=null,i(new A(`timeout ${e} of ms exceeded`,A.ETIMEDOUT))},e),a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));let{signal:c}=n;return c.unsubscribe=()=>p.asap(a),c}},Ni=iu;var su=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let n=0,o;for(;n<r;)o=n+e,yield t.slice(n,o),n=o},au=async function*(t,e){for await(let r of cu(t))yield*su(r,e)},cu=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},Vn=(t,e,r,n)=>{let o=au(t,e),i=0,s,a=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{let{done:u,value:d}=await o.next();if(u){a(),c.close();return}let m=d.byteLength;if(r){let b=i+=m;r(b)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),o.return()}},{highWaterMark:2})};var Pr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Li=Pr&&typeof ReadableStream=="function",uu=Pr&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Mi=(t,...e)=>{try{return!!t(...e)}catch{return!1}},du=Li&&Mi(()=>{let t=!1,e=new Request(L.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Di=64*1024,$n=Li&&Mi(()=>p.isReadableStream(new Response("").body)),Rr={stream:$n&&(t=>t.body)};Pr&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Rr[e]&&(Rr[e]=p.isFunction(t[e])?r=>r[e]():(r,n)=>{throw new A(`Response type '${e}' is not supported`,A.ERR_NOT_SUPPORT,n)})})})(new Response);var lu=async t=>{if(t==null)return 0;if(p.isBlob(t))return t.size;if(p.isSpecCompliantForm(t))return(await new Request(L.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(p.isArrayBufferView(t)||p.isArrayBuffer(t))return t.byteLength;if(p.isURLSearchParams(t)&&(t=t+""),p.isString(t))return(await uu(t)).byteLength},fu=async(t,e)=>{let r=p.toFiniteNumber(t.getContentLength());return r==null?lu(e):r},Fi=Pr&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:m="same-origin",fetchOptions:b}=Er(t);u=u?(u+"").toLowerCase():"text";let C=Ni([o,i&&i.toAbortSignal()],s),h,v=C&&C.unsubscribe&&(()=>{C.unsubscribe()}),_;try{if(c&&du&&r!=="get"&&r!=="head"&&(_=await fu(d,n))!==0){let D=new Request(e,{method:"POST",body:n,duplex:"half"}),te;if(p.isFormData(n)&&(te=D.headers.get("content-type"))&&d.setContentType(te),D.body){let[ye,ke]=Mn(_,ut(Fn(c)));n=Vn(D.body,Di,ye,ke)}}p.isString(m)||(m=m?"include":"omit");let x="credentials"in Request.prototype;h=new Request(e,{...b,signal:C,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:x?m:void 0});let P=await fetch(h,b),N=$n&&(u==="stream"||u==="response");if($n&&(a||N&&v)){let D={};["status","statusText","headers"].forEach(gr=>{D[gr]=P[gr]});let te=p.toFiniteNumber(P.headers.get("content-length")),[ye,ke]=a&&Mn(te,ut(Fn(a),!0))||[];P=new Response(Vn(P.body,Di,ye,()=>{ke&&ke(),v&&v()}),D)}u=u||"text";let z=await Rr[p.findKey(Rr,u)||"text"](P,t);return!N&&v&&v(),await new Promise((D,te)=>{Gt(D,te,{data:z,headers:F.from(P.headers),status:P.status,statusText:P.statusText,config:t,request:h})})}catch(x){throw v&&v(),x&&x.name==="TypeError"&&/Load failed|fetch/i.test(x.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,t,h),{cause:x.cause||x}):A.from(x,x&&x.code,t,h)}});var Bn={http:Tr,xhr:Ui,fetch:Fi};p.forEach(Bn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var zi=t=>`- ${t}`,pu=t=>p.isFunction(t)||t===null||t===!1,kr={getAdapter:t=>{t=p.isArray(t)?t:[t];let{length:e}=t,r,n,o={};for(let i=0;i<e;i++){r=t[i];let s;if(n=r,!pu(r)&&(n=Bn[(s=String(r)).toLowerCase()],n===void 0))throw new A(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){let i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build")),s=e?i.length>1?`since :
|
|
4
|
-
`+i.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ae(this.defaults,r);let{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Xt.assertOptions(n,{silentJSONParsing:le.transitional(le.boolean),forcedJSONParsing:le.transitional(le.boolean),clarifyTimeoutError:le.transitional(le.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Xt.assertOptions(o,{encode:le.function,serialize:le.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Xt.assertOptions(r,{baseUrl:le.spelling("baseURL"),withXsrfToken:le.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),r.headers=F.concat(s,i);let a=[],c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});let u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let d,m=0,b;if(!c){let h=[jr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,u),b=h.length,d=Promise.resolve(r);m<b;)d=d.then(h[m++],h[m++]);return d}b=a.length;let C=r;for(m=0;m<b;){let h=a[m++],v=a[m++];try{C=h(C)}catch(_){v.call(this,_);break}}try{d=jr.call(this,C)}catch(h){return Promise.reject(h)}for(m=0,b=u.length;m<b;)d=d.then(u[m++],u[m++]);return d}getUri(e){e=ae(this.defaults,e);let r=Yt(e.baseURL,e.url,e.allowAbsoluteUrls);return Ht(r,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){dt.prototype[e]=function(r,n){return this.request(ae(n||{},{method:e,url:r,data:(n||{}).data}))}});p.forEach(["post","put","patch"],function(e){function r(n){return function(i,s,a){return this.request(ae(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}dt.prototype[e]=r(),dt.prototype[e+"Form"]=r(!0)});var Qt=dt;var Wn=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});let n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i,s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,a){n.reason||(n.reason=new de(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new t(function(o){e=o}),cancel:e}}},Vi=Wn;function Jn(t){return function(r){return t.apply(null,r)}}function Kn(t){return p.isObject(t)&&t.isAxiosError===!0}var Gn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gn).forEach(([t,e])=>{Gn[e]=t});var $i=Gn;function Bi(t){let e=new Qt(t),r=Vt(Qt.prototype.request,e);return p.extend(r,Qt.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Bi(ae(t,o))},r}var M=Bi(at);M.Axios=Qt;M.CanceledError=de;M.CancelToken=Vi;M.isCancel=Kt;M.VERSION=Zr;M.toFormData=Ce;M.AxiosError=A;M.Cancel=M.CanceledError;M.all=function(e){return Promise.all(e)};M.spread=Jn;M.isAxiosError=Kn;M.mergeConfig=ae;M.AxiosHeaders=F;M.formToJSON=t=>Ar(p.isHTMLForm(t)?new FormData(t):t);M.getAdapter=kr.getAdapter;M.HttpStatusCode=$i;M.default=M;var Nr=M;var{Axios:by,AxiosError:_y,CanceledError:xy,isCancel:wy,CancelToken:Cy,VERSION:Ty,all:Sy,Cancel:Iy,isAxiosError:Ay,spread:Oy,toFormData:Ey,AxiosHeaders:Ry,HttpStatusCode:Py,formToJSON:ky,getAdapter:jy,mergeConfig:Zy}=Nr;var Xi=vr(Fr());var zr=class{constructor(e){this.API_VERSION="2022-03-01-preview";let{identifier:r,host:n}=e;this.baseURL=new URL(`/copilotstudio/prebuilt/authenticated/bots/${r}`,n),this.baseURL.searchParams.append("api-version",this.API_VERSION)}getConversationUrl(e){let r=new URL(this.baseURL.href);return r.pathname=`${r.pathname}/conversations`,e&&(r.pathname=`${r.pathname}/${e}`),r.href}};var qr=class{constructor(e){this.API_VERSION="2022-03-01-preview";let{schema:r,host:n}=e;this.baseURL=new URL(`/copilotstudio/dataverse-backed/authenticated/bots/${r}`,n),this.baseURL.searchParams.append("api-version",this.API_VERSION)}getConversationUrl(e){let r=new URL(this.baseURL.href);return r.pathname=`${r.pathname}/conversations`,e&&(r.pathname=`${r.pathname}/${e}`),r.href}};var Ne=(0,Xi.debug)("copilot-studio:power-platform");function $r(t,e){var d,m;let r=5;if((d=t.directConnectUrl)!=null&&d.trim()){if(Ne.debug(`Using direct connection: ${t.directConnectUrl}`),!er(t.directConnectUrl))throw new Error("directConnectUrl must be a valid URL");return t.directConnectUrl.toLowerCase().includes("tenants/00000000-0000-0000-0000-000000000000")?(Ne.debug(`Direct connection cannot be used, forcing default settings flow. Tenant ID is missing in the URL: ${t.directConnectUrl}`),$r({...t,directConnectUrl:""},e)):Pu(t.directConnectUrl,e).href}let n=t.cloud&&t.cloud.toString().trim()!=="",o=t.customPowerPlatformCloud!==void 0&&t.customPowerPlatformCloud.trim()!=="";if(n&&!Object.values(qt).includes(t.cloud))throw new Error("Invalid PowerPlatformCloud enum key");let i=n?t.cloud:-1;if(i===100&&o)throw new Error("customPowerPlatformCloud must be provided when PowerPlatformCloud is Other");if(!((m=t.environmentId)!=null&&m.trim()))throw new Error("EnvironmentId must be provided");if(t.agentIdentifier===void 0||t.agentIdentifier.trim()==="")throw new Error("AgentIdentifier must be provided");if(i!==-1&&(Ne.debug(`Using specified cloud setting: ${i}`),r=i),i===100)if(o&&er(t.customPowerPlatformCloud))Ne.debug(`Using custom Power Platform cloud: ${t.customPowerPlatformCloud}`),r=100;else throw new Error("customPowerPlatformCloud must be a valid URL");let s;if(t.copilotAgentType&&t.copilotAgentType.toString().trim()!=="")if(Object.values(zt).includes(t.copilotAgentType))Ne.debug(`Using specified agent type: ${t.copilotAgentType}`),s=t.copilotAgentType;else throw new Error("Invalid AgentType enum key");else Ne.debug("Using default agent type: Published"),s=0;t.customPowerPlatformCloud=o?t.customPowerPlatformCloud:"api.unknown.powerplatform.com";let a=ku(r,t.environmentId,t.customPowerPlatformCloud),u={0:()=>new qr({host:a,schema:t.agentIdentifier}),1:()=>new zr({host:a,identifier:t.agentIdentifier})}[s]().getConversationUrl(e);return Ne.debug(`Generated Copilot Studio connection URL: ${u}`),u}function Qi(t,e=-1,r="",n=""){var o,i;if(!n&&!(t!=null&&t.directConnectUrl)){if(e===100&&!r)throw new Error("cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other");if(!t&&e===-1)throw new Error("Either settings or cloud must be provided");if(t&&t.cloud&&t.cloud!==-1&&(e=t.cloud),e===100)if(r&&er(r))e=100;else if(t!=null&&t.customPowerPlatformCloud&&er(t.customPowerPlatformCloud))e=100,r=t.customPowerPlatformCloud;else throw new Error("Either CustomPowerPlatformCloud or cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other");return r!=null||(r="api.unknown.powerplatform.com"),`https://${Vr(e,r)}/.default`}else if(n||(n=(o=t==null?void 0:t.directConnectUrl)!=null?o:""),n&&er(n)){if(Yi(new URL(n))===-1){let s=(i=t==null?void 0:t.cloud)!=null?i:e;if(s===100||s===-1)throw new Error("Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.");if(s!==-1)return`https://${Vr(s,"")}/.default`;throw new Error("Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.")}return`https://${Vr(Yi(new URL(n)),"")}/.default`}else throw new Error("DirectConnectUrl must be provided when DirectConnectUrl is set")}function er(t){try{let e=t.startsWith("http")?t:`https://${t}`;return!!new URL(e)}catch{return!1}}function Pu(t,e){let r=new URL(t);return r.searchParams.has("api-version")||r.searchParams.append("api-version","2022-03-01-preview"),r.pathname.endsWith("/")&&(r.pathname=r.pathname.slice(0,-1)),r.pathname.includes("/conversations")&&(r.pathname=r.pathname.substring(0,r.pathname.indexOf("/conversations"))),r.pathname=`${r.pathname}/conversations`,e&&(r.pathname=`${r.pathname}/${e}`),r}function ku(t,e,r){if(t===100&&(!r||!r.trim()))throw new Error("cloudBaseAddress must be provided when PowerPlatformCloud is Other");r=r!=null?r:"api.unknown.powerplatform.com";let n=e.toLowerCase().replaceAll("-",""),o=ju(t),i=n.substring(0,n.length-o),s=n.substring(n.length-o);return new URL(`https://${i}.${s}.environment.${Vr(t,r)}`)}function Vr(t,e){switch(t){case 13:return"api.powerplatform.localhost";case 0:return"api.exp.powerplatform.com";case 1:return"api.dev.powerplatform.com";case 12:return"api.prv.powerplatform.com";case 2:return"api.test.powerplatform.com";case 3:return"api.preprod.powerplatform.com";case 4:case 5:return"api.powerplatform.com";case 14:return"api.gov.powerplatform.microsoft.us";case 6:return"api.gov.powerplatform.microsoft.us";case 7:return"api.high.powerplatform.microsoft.us";case 8:return"api.appsplatform.us";case 9:return"api.powerplatform.partner.microsoftonline.cn";case 10:return"api.powerplatform.eaglex.ic.gov";case 11:return"api.powerplatform.microsoft.scloud";case 100:return e;default:throw new Error(`Invalid cluster category value: ${t}`)}}function ju(t){switch(t){case 4:case 5:return 2;default:return 1}}function Yi(t){switch(t.host.toLowerCase()){case"api.powerplatform.localhost":return 13;case"api.exp.powerplatform.com":return 0;case"api.dev.powerplatform.com":return 1;case"api.prv.powerplatform.com":return 12;case"api.test.powerplatform.com":return 2;case"api.preprod.powerplatform.com":return 3;case"api.powerplatform.com":return 5;case"api.gov.powerplatform.microsoft.us":return 14;case"api.high.powerplatform.microsoft.us":return 7;case"api.appsplatform.us":return 8;case"api.powerplatform.partner.microsoftonline.cn":return 9;default:return-1}}var mr=vr(Oa());var bn=class{constructor(e){this.activity=e}};var Pa=vr(Fr());var Ea="0.6.16-gc874f0c9d8";var _n={};var Q=(0,Pa.debug)("copilot-studio:client"),we=class we{constructor(e,r){this.conversationId="";this.settings=e,this.client=Nr.create(),this.client.defaults.headers.common.Authorization=`Bearer ${r}`,this.client.defaults.headers.common["User-Agent"]=we.getProductInfo()}async postRequestAsync(e){var m,b,C,h;let r=[];Q.debug(`>>> SEND TO ${e.url}`);let n=await this.client(e);if(this.settings.useExperimentalEndpoint&&!((m=this.settings.directConnectUrl)!=null&&m.trim())){let v=(b=n.headers)==null?void 0:b[we.islandExperimentalUrlHeaderKey];v&&(this.settings.directConnectUrl=v,Q.debug(`Island Experimental URL: ${v}`))}this.conversationId=(h=(C=n.headers)==null?void 0:C[we.conversationIdHeaderKey])!=null?h:"",this.conversationId&&Q.debug(`Conversation ID: ${this.conversationId}`);let o={...n.headers};delete o.Authorization,delete o[we.conversationIdHeaderKey],Q.debug("Headers received:",o);let s=n.data.pipeThrough(new TextDecoderStream).getReader(),a="",c=[],u=async({done:v,value:_})=>v?(Q.debug("Stream complete"),a+=_,c.push(a),c):(Q.info("Agent is typing ..."),a+=_,await u(await s.read()));return(await s.read().then(u)).forEach(v=>{v.toString().split(`
|
|
7
|
-
`).filter(
|
|
1
|
+
var Ka=Object.create;var In=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Ya=Object.getOwnPropertyNames;var Xa=Object.getPrototypeOf,Qa=Object.prototype.hasOwnProperty;var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ec=(t,e)=>{for(var r in e)In(t,r,{get:e[r],enumerable:!0})},tc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ya(e))!Qa.call(t,o)&&o!==r&&In(t,o,{get:()=>e[o],enumerable:!(n=Ga(e,o))||n.enumerable});return t};var vr=(t,e,r)=>(r=t!=null?Ka(Xa(t)):{},tc(e||!t||!t.__esModule?In(r,"default",{value:t,enumerable:!0}):r,t));var Ji=x((Dy,Wi)=>{var dt=1e3,lt=dt*60,ft=lt*60,Ze=ft*24,yu=Ze*7,gu=Ze*365.25;Wi.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return vu(t);if(r==="number"&&isFinite(t))return e.long?_u(t):bu(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function vu(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*gu;case"weeks":case"week":case"w":return r*yu;case"days":case"day":case"d":return r*Ze;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ft;case"minutes":case"minute":case"mins":case"min":case"m":return r*lt;case"seconds":case"second":case"secs":case"sec":case"s":return r*dt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function bu(t){var e=Math.abs(t);return e>=Ze?Math.round(t/Ze)+"d":e>=ft?Math.round(t/ft)+"h":e>=lt?Math.round(t/lt)+"m":e>=dt?Math.round(t/dt)+"s":t+"ms"}function _u(t){var e=Math.abs(t);return e>=Ze?Dr(t,e,Ze,"day"):e>=ft?Dr(t,e,ft,"hour"):e>=lt?Dr(t,e,lt,"minute"):e>=dt?Dr(t,e,dt,"second"):t+" ms"}function Dr(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Gi=x((Ly,Ki)=>{function xu(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=o,r.enabled=a,r.humanize=Ji(),r.destroy=u,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let m=0;for(let b=0;b<d.length;b++)m=(m<<5)-m+d.charCodeAt(b),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=e;function r(d){let m,b=null,w,h;function v(..._){if(!v.enabled)return;let S=v,R=Number(new Date),N=R-(m||R);S.diff=N,S.prev=m,S.curr=R,m=R,_[0]=r.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let z=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(te,ye)=>{if(te==="%%")return"%";z++;let je=r.formatters[ye];if(typeof je=="function"){let gr=_[z];te=je.call(S,gr),_.splice(z,1),z--}return te}),r.formatArgs.call(S,_),(S.log||r.log).apply(S,_)}return v.namespace=d,v.useColors=r.useColors(),v.color=r.selectColor(d),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(w!==r.namespaces&&(w=r.namespaces,h=r.enabled(d)),h),set:_=>{b=_}}),typeof r.init=="function"&&r.init(v),v}function n(d,m){let b=r(this.namespace+(typeof m=="undefined"?":":m)+d);return b.log=this.log,b}function o(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let m=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let b of m)b[0]==="-"?r.skips.push(b.slice(1)):r.names.push(b)}function i(d,m){let b=0,w=0,h=-1,v=0;for(;b<d.length;)if(w<m.length&&(m[w]===d[b]||m[w]==="*"))m[w]==="*"?(h=w,v=b,w++):(b++,w++);else if(h!==-1)w=h+1,v++,b=v;else return!1;for(;w<m.length&&m[w]==="*";)w++;return w===m.length}function s(){let d=[...r.names,...r.skips.map(m=>"-"+m)].join(",");return r.enable(""),d}function a(d){for(let m of r.skips)if(i(d,m))return!1;for(let m of r.names)if(i(d,m))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ki.exports=xu});var Yi=x((G,Lr)=>{G.formatArgs=Cu;G.save=Tu;G.load=Su;G.useColors=wu;G.storage=Iu();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function wu(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Cu(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Lr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}G.log=console.debug||console.log||(()=>{});function Tu(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}function Su(){let t;try{t=G.storage.getItem("debug")||G.storage.getItem("DEBUG")}catch{}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function Iu(){try{return localStorage}catch{}}Lr.exports=Gi()(G);var{formatters:Au}=Lr.exports;Au.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Fr=x(Ue=>{"use strict";var Ou=Ue&&Ue.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Logger=void 0;Ue.debug=Ru;var Eu=Ou(Yi()),Pu=["info","warn","error","debug"],Mr=class{constructor(e=""){this.loggers={},this.initializeLoggers(e)}initializeLoggers(e){for(let r of Pu){let n=(0,Eu.default)(`${e}:${r}`);n.color=this.getPlatformColor(r),this.loggers[r]=n}}getPlatformColor(e){return{node:{info:"2",warn:"3",error:"1",debug:"4"},browser:{info:"#33CC99",warn:"#CCCC33",error:"#CC3366",debug:"#0066FF"}}[typeof window!="undefined"?"browser":"node"][e]}info(e,...r){this.loggers.info(e,...r)}warn(e,...r){this.loggers.warn(e,...r)}error(e,...r){this.loggers.error(e,...r)}debug(e,...r){this.loggers.debug(e,...r)}};Ue.Logger=Mr;function Ru(t){return new Mr(t)}});var tr=x(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getParsedType=Z.ZodParsedType=Z.objectUtil=Z.util=void 0;var Qn;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(let s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Qn||(Z.util=Qn={}));var ts;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ts||(Z.objectUtil=ts={}));Z.ZodParsedType=Qn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Uu=t=>{switch(typeof t){case"undefined":return Z.ZodParsedType.undefined;case"string":return Z.ZodParsedType.string;case"number":return Number.isNaN(t)?Z.ZodParsedType.nan:Z.ZodParsedType.number;case"boolean":return Z.ZodParsedType.boolean;case"function":return Z.ZodParsedType.function;case"bigint":return Z.ZodParsedType.bigint;case"symbol":return Z.ZodParsedType.symbol;case"object":return Array.isArray(t)?Z.ZodParsedType.array:t===null?Z.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.ZodParsedType.promise:typeof Map!="undefined"&&t instanceof Map?Z.ZodParsedType.map:typeof Set!="undefined"&&t instanceof Set?Z.ZodParsedType.set:typeof Date!="undefined"&&t instanceof Date?Z.ZodParsedType.date:Z.ZodParsedType.object;default:return Z.ZodParsedType.unknown}};Z.getParsedType=Uu});var Br=x(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.ZodError=Te.quotelessJson=Te.ZodIssueCode=void 0;var rs=tr();Te.ZodIssueCode=rs.util.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"]);var Nu=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");Te.quotelessJson=Nu;var rr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rs.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Te.ZodError=rr;rr.create=t=>new rr(t)});var to=x(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});var $=Br(),Ne=tr(),Du=(t,e)=>{let r;switch(t.code){case $.ZodIssueCode.invalid_type:t.received===Ne.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case $.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ne.util.jsonStringifyReplacer)}`;break;case $.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.util.joinValues(t.keys,", ")}`;break;case $.ZodIssueCode.invalid_union:r="Invalid input";break;case $.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.util.joinValues(t.options)}`;break;case $.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.util.joinValues(t.options)}, received '${t.received}'`;break;case $.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case $.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case $.ZodIssueCode.invalid_date:r="Invalid date";break;case $.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ne.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case $.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case $.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case $.ZodIssueCode.custom:r="Invalid input";break;case $.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case $.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case $.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ne.util.assertNever(t)}return{message:r}};eo.default=Du});var Hr=x(Se=>{"use strict";var Lu=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.defaultErrorMap=void 0;Se.setErrorMap=Mu;Se.getErrorMap=Fu;var ns=Lu(to());Se.defaultErrorMap=ns.default;var os=ns.default;function Mu(t){os=t}function Fu(){return os}});var no=x(k=>{"use strict";var zu=k&&k.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(k,"__esModule",{value:!0});k.isAsync=k.isValid=k.isDirty=k.isAborted=k.OK=k.DIRTY=k.INVALID=k.ParseStatus=k.EMPTY_PATH=k.makeIssue=void 0;k.addIssueToContext=$u;var qu=Hr(),is=zu(to()),Vu=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};k.makeIssue=Vu;k.EMPTY_PATH=[];function $u(t,e){let r=(0,qu.getErrorMap)(),n=(0,k.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===is.default?void 0:is.default].filter(o=>!!o)});t.common.issues.push(n)}var ro=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return k.INVALID;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return k.INVALID;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}};k.ParseStatus=ro;k.INVALID=Object.freeze({status:"aborted"});var Bu=t=>({status:"dirty",value:t});k.DIRTY=Bu;var Hu=t=>({status:"valid",value:t});k.OK=Hu;var Wu=t=>t.status==="aborted";k.isAborted=Wu;var Ju=t=>t.status==="dirty";k.isDirty=Ju;var Ku=t=>t.status==="valid";k.isValid=Ku;var Gu=t=>typeof Promise!="undefined"&&t instanceof Promise;k.isAsync=Gu});var as=x(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0})});var us=x(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.errorUtil=void 0;var cs;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(cs||(Wr.errorUtil=cs={}))});var xs=x(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.discriminatedUnion=l.date=l.boolean=l.bigint=l.array=l.any=l.coerce=l.ZodFirstPartyTypeKind=l.late=l.ZodSchema=l.Schema=l.ZodReadonly=l.ZodPipeline=l.ZodBranded=l.BRAND=l.ZodNaN=l.ZodCatch=l.ZodDefault=l.ZodNullable=l.ZodOptional=l.ZodTransformer=l.ZodEffects=l.ZodPromise=l.ZodNativeEnum=l.ZodEnum=l.ZodLiteral=l.ZodLazy=l.ZodFunction=l.ZodSet=l.ZodMap=l.ZodRecord=l.ZodTuple=l.ZodIntersection=l.ZodDiscriminatedUnion=l.ZodUnion=l.ZodObject=l.ZodArray=l.ZodVoid=l.ZodNever=l.ZodUnknown=l.ZodAny=l.ZodNull=l.ZodUndefined=l.ZodSymbol=l.ZodDate=l.ZodBoolean=l.ZodBigInt=l.ZodNumber=l.ZodString=l.ZodType=void 0;l.NEVER=l.void=l.unknown=l.union=l.undefined=l.tuple=l.transformer=l.symbol=l.string=l.strictObject=l.set=l.record=l.promise=l.preprocess=l.pipeline=l.ostring=l.optional=l.onumber=l.oboolean=l.object=l.number=l.nullable=l.null=l.never=l.nativeEnum=l.nan=l.map=l.literal=l.lazy=l.intersection=l.instanceof=l.function=l.enum=l.effect=void 0;l.datetimeRegex=ms;l.custom=ys;var y=Br(),Jr=Hr(),C=us(),f=no(),g=tr(),ne=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}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}},ds=(t,e)=>{if((0,f.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new y.ZodError(t.common.issues);return this._error=r,this._error}}};function O(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{var u,d;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c!=null?c:a.defaultError}:typeof a.data=="undefined"?{message:(u=c!=null?c:n)!=null?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(d=c!=null?c:r)!=null?d:a.defaultError}},description:o}}var E=class{get description(){return this._def.description}_getType(e){return(0,g.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,g.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,g.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,f.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!=null?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)},o=this._parseSync({data:e,path:n.path,parent:n});return ds(n,o)}"~validate"(e){var n,o;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return(0,f.isValid)(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>(0,f.isValid)(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await((0,f.isAsync)(o)?o:Promise.resolve(o));return ds(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=e(o),a=()=>i.addIssue({code:y.ZodIssueCode.custom,...n(o)});return typeof Promise!="undefined"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new ee({schema:this,typeName:I.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:r=>this["~validate"](r)}}optional(){return re.create(this,this._def)}nullable(){return pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return be.create(this)}promise(){return Oe.create(this,this._def)}or(e){return Ve.create([this,e],this._def)}and(e){return $e.create(this,e,this._def)}transform(e){return new ee({...O(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ke({...O(this._def),innerType:this,defaultValue:r,typeName:I.ZodDefault})}brand(){return new nr({typeName:I.ZodBranded,type:this,...O(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ge({...O(this._def),innerType:this,catchValue:r,typeName:I.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return or.create(this,e)}readonly(){return Ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l.ZodType=E;l.Schema=E;l.ZodSchema=E;var Yu=/^c[^\s-]{8,}$/i,Xu=/^[0-9a-z]+$/,Qu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ed=/^[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,td=/^[a-z0-9_-]{21}$/i,rd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nd=/^[-+]?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)?)??$/,od=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,id="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",oo,sd=/^(?:(?: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])$/,ad=/^(?:(?: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])$/,cd=/^(([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]))$/,ud=/^(([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])$/,dd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ld=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fs="((\\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])))",fd=new RegExp(`^${fs}$`);function ps(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function pd(t){return new RegExp(`^${ps(t)}$`)}function ms(t){let e=`${fs}T${ps(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function md(t,e){return!!((e==="v4"||!e)&&sd.test(t)||(e==="v6"||!e)&&cd.test(t))}function hd(t,e){if(!rd.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function yd(t,e){return!!((e==="v4"||!e)&&ad.test(t)||(e==="v6"||!e)&&ud.test(t))}var Ie=class t extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.string,received:i.parsedType}),f.INVALID}let n=new f.ParseStatus,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")od.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"email",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")oo||(oo=new RegExp(id,"u")),oo.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"emoji",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ed.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"uuid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")td.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"nanoid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Yu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cuid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Xu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cuid2",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Qu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"ulid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"url",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"regex",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?ms(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?fd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?pd(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?nd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"duration",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?md(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"ip",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?hd(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"jwt",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?yd(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cidr",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?dd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"base64",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ld.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"base64url",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):g.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:y.ZodIssueCode.invalid_string,...C.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errorUtil.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!=null?r:!1,local:(n=e==null?void 0:e.local)!=null?n:!1,...C.errorUtil.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...C.errorUtil.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...C.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...C.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...C.errorUtil.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...C.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...C.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...C.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...C.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...C.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,C.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l.ZodString=Ie;Ie.create=t=>{var e;return new Ie({checks:[],typeName:I.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...O(t)})};function gd(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}var De=class t extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.number,received:i.parsedType}),f.INVALID}let n,o=new f.ParseStatus;for(let i of this._def.checks)i.kind==="int"?g.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?gd(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_finite,message:i.message}),o.dirty()):g.util.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&g.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};l.ZodNumber=De;De.create=t=>new De({checks:[],typeName:I.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...O(t)});var Le=class t extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.ZodParsedType.bigint)return this._getInvalidInput(e);let n,o=new f.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):g.util.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.bigint,received:r.parsedType}),f.INVALID}gte(e,r){return this.setLimit("min",e,!0,C.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l.ZodBigInt=Le;Le.create=t=>{var e;return new Le({checks:[],typeName:I.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...O(t)})};var Me=class extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.boolean,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodBoolean=Me;Me.create=t=>new Me({typeName:I.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...O(t)});var Fe=class t extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.date,received:i.parsedType}),f.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_date}),f.INVALID}let n=new f.ParseStatus,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):g.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};l.ZodDate=Fe;Fe.create=t=>new Fe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:I.ZodDate,...O(t)});var ht=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.symbol,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodSymbol=ht;ht.create=t=>new ht({typeName:I.ZodSymbol,...O(t)});var ze=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.undefined,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodUndefined=ze;ze.create=t=>new ze({typeName:I.ZodUndefined,...O(t)});var qe=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.null,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodNull=qe;qe.create=t=>new qe({typeName:I.ZodNull,...O(t)});var Ae=class extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,f.OK)(e.data)}};l.ZodAny=Ae;Ae.create=t=>new Ae({typeName:I.ZodAny,...O(t)});var ve=class extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,f.OK)(e.data)}};l.ZodUnknown=ve;ve.create=t=>new ve({typeName:I.ZodUnknown,...O(t)});var ce=class extends E{_parse(e){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.never,received:r.parsedType}),f.INVALID}};l.ZodNever=ce;ce.create=t=>new ce({typeName:I.ZodNever,...O(t)});var yt=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.void,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodVoid=yt;yt.create=t=>new yt({typeName:I.ZodVoid,...O(t)});var be=class t extends E{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==g.ZodParsedType.array)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.array,received:r.parsedType}),f.INVALID;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&((0,f.addIssueToContext)(r,{code:s?y.ZodIssueCode.too_big:y.ZodIssueCode.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new ne(r,s,r.path,a)))).then(s=>f.ParseStatus.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new ne(r,s,r.path,a)));return f.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:C.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:C.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:C.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};l.ZodArray=be;be.create=(t,e)=>new be({type:t,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...O(e)});function mt(t){if(t instanceof Y){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=re.create(mt(n))}return new Y({...t._def,shape:()=>e})}else return t instanceof be?new be({...t._def,type:mt(t.element)}):t instanceof re?re.create(mt(t.unwrap())):t instanceof pe?pe.create(mt(t.unwrap())):t instanceof fe?fe.create(t.items.map(e=>mt(e))):t}var Y=class t extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=g.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==g.ZodParsedType.object){let u=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(u,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.object,received:u.parsedType}),f.INVALID}let{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ce&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let d=i[u],m=o.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new ne(o,m,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof ce){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&((0,f.addIssueToContext)(o,{code:y.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of a){let m=o.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new ne(o,m,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let m=await d.key,b=await d.value;u.push({key:m,value:b,alwaysSet:d.alwaysSet})}return u}).then(u=>f.ParseStatus.mergeObjectSync(n,u)):f.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return C.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,a,c;let o=(a=(s=(i=this._def).errorMap)==null?void 0:s.call(i,r,n).message)!=null?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=C.errorUtil.errToObj(e).message)!=null?c:o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:I.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of g.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of g.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return mt(this)}partial(e){let r={};for(let n of g.util.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of g.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof re;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return hs(g.util.objectKeys(this.shape))}};l.ZodObject=Y;Y.create=(t,e)=>new Y({shape:()=>t,unknownKeys:"strip",catchall:ce.create(),typeName:I.ZodObject,...O(e)});Y.strictCreate=(t,e)=>new Y({shape:()=>t,unknownKeys:"strict",catchall:ce.create(),typeName:I.ZodObject,...O(e)});Y.lazycreate=(t,e)=>new Y({shape:t,unknownKeys:"strip",catchall:ce.create(),typeName:I.ZodObject,...O(e)});var Ve=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new y.ZodError(a.ctx.common.issues));return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_union,unionErrors:s}),f.INVALID}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new y.ZodError(c));return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_union,unionErrors:a}),f.INVALID}}get options(){return this._def.options}};l.ZodUnion=Ve;Ve.create=(t,e)=>new Ve({options:t,typeName:I.ZodUnion,...O(e)});var ge=t=>t instanceof Be?ge(t.schema):t instanceof ee?ge(t.innerType()):t instanceof He?[t.value]:t instanceof We?t.options:t instanceof Je?g.util.objectValues(t.enum):t instanceof Ke?ge(t._def.innerType):t instanceof ze?[void 0]:t instanceof qe?[null]:t instanceof re?[void 0,...ge(t.unwrap())]:t instanceof pe?[null,...ge(t.unwrap())]:t instanceof nr||t instanceof Ye?ge(t.unwrap()):t instanceof Ge?ge(t._def.innerType):[],Kr=class t extends E{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.ZodParsedType.object)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.object,received:r.parsedType}),f.INVALID;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),f.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let i of r){let s=ge(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new t({typeName:I.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...O(n)})}};l.ZodDiscriminatedUnion=Kr;function io(t,e){let r=(0,g.getParsedType)(t),n=(0,g.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===g.ZodParsedType.object&&n===g.ZodParsedType.object){let o=g.util.objectKeys(e),i=g.util.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(let a of i){let c=io(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===g.ZodParsedType.array&&n===g.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let s=t[i],a=e[i],c=io(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===g.ZodParsedType.date&&n===g.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var $e=class extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(i,s)=>{if((0,f.isAborted)(i)||(0,f.isAborted)(s))return f.INVALID;let a=io(i.value,s.value);return a.valid?(((0,f.isDirty)(i)||(0,f.isDirty)(s))&&r.dirty(),{status:r.value,value:a.data}):((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_intersection_types}),f.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};l.ZodIntersection=$e;$e.create=(t,e,r)=>new $e({left:t,right:e,typeName:I.ZodIntersection,...O(r)});var fe=class t extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.array)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.array,received:n.parsedType}),f.INVALID;if(n.data.length<this._def.items.length)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ne(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>f.ParseStatus.mergeArray(r,s)):f.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};l.ZodTuple=fe;fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:t,typeName:I.ZodTuple,rest:null,...O(e)})};var Gr=class t extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.object)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.object,received:n.parsedType}),f.INVALID;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new ne(n,a,n.path,a)),value:s._parse(new ne(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?f.ParseStatus.mergeObjectAsync(r,o):f.ParseStatus.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof E?new t({keyType:e,valueType:r,typeName:I.ZodRecord,...O(n)}):new t({keyType:Ie.create(),valueType:e,typeName:I.ZodRecord,...O(r)})}};l.ZodRecord=Gr;var gt=class extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.map)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.map,received:n.parsedType}),f.INVALID;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ne(n,a,n.path,[u,"key"])),value:i._parse(new ne(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return f.INVALID;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return f.INVALID;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}};l.ZodMap=gt;gt.create=(t,e,r)=>new gt({valueType:e,keyType:t,typeName:I.ZodMap,...O(r)});var vt=class t extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.ZodParsedType.set)return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.set,received:n.parsedType}),f.INVALID;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&((0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let d of c){if(d.status==="aborted")return f.INVALID;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new ne(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:C.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:C.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};l.ZodSet=vt;vt.create=(t,e)=>new vt({valueType:t,minSize:null,maxSize:null,typeName:I.ZodSet,...O(e)});var Yr=class t extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.ZodParsedType.function)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.function,received:r.parsedType}),f.INVALID;function n(a,c){return(0,f.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Jr.getErrorMap)(),Jr.defaultErrorMap].filter(u=>!!u),issueData:{code:y.ZodIssueCode.invalid_arguments,argumentsError:c}})}function o(a,c){return(0,f.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Jr.getErrorMap)(),Jr.defaultErrorMap].filter(u=>!!u),issueData:{code:y.ZodIssueCode.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Oe){let a=this;return(0,f.OK)(async function(...c){let u=new y.ZodError([]),d=await a._def.args.parseAsync(c,i).catch(w=>{throw u.addIssue(n(c,w)),u}),m=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(m,i).catch(w=>{throw u.addIssue(o(m,w)),u})})}else{let a=this;return(0,f.OK)(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new y.ZodError([n(c,u.error)]);let d=Reflect.apply(s,this,u.data),m=a._def.returns.safeParse(d,i);if(!m.success)throw new y.ZodError([o(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:fe.create(e).rest(ve.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||fe.create([]).rest(ve.create()),returns:r||ve.create(),typeName:I.ZodFunction,...O(n)})}};l.ZodFunction=Yr;var Be=class extends E{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};l.ZodLazy=Be;Be.create=(t,e)=>new Be({getter:t,typeName:I.ZodLazy,...O(e)});var He=class extends E{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{received:r.data,code:y.ZodIssueCode.invalid_literal,expected:this._def.value}),f.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};l.ZodLiteral=He;He.create=(t,e)=>new He({value:t,typeName:I.ZodLiteral,...O(e)});function hs(t,e){return new We({values:t,typeName:I.ZodEnum,...O(e)})}var We=class t extends E{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,f.addIssueToContext)(r,{expected:g.util.joinValues(n),received:r.parsedType,code:y.ZodIssueCode.invalid_type}),f.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,f.addIssueToContext)(r,{received:r.data,code:y.ZodIssueCode.invalid_enum_value,options:n}),f.INVALID}return(0,f.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};l.ZodEnum=We;We.create=hs;var Je=class extends E{_parse(e){let r=g.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==g.ZodParsedType.string&&n.parsedType!==g.ZodParsedType.number){let o=g.util.objectValues(r);return(0,f.addIssueToContext)(n,{expected:g.util.joinValues(o),received:n.parsedType,code:y.ZodIssueCode.invalid_type}),f.INVALID}if(this._cache||(this._cache=new Set(g.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=g.util.objectValues(r);return(0,f.addIssueToContext)(n,{received:n.data,code:y.ZodIssueCode.invalid_enum_value,options:o}),f.INVALID}return(0,f.OK)(e.data)}get enum(){return this._def.values}};l.ZodNativeEnum=Je;Je.create=(t,e)=>new Je({values:t,typeName:I.ZodNativeEnum,...O(e)});var Oe=class extends E{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.ZodParsedType.promise&&r.common.async===!1)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.promise,received:r.parsedType}),f.INVALID;let n=r.parsedType===g.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,f.OK)(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};l.ZodPromise=Oe;Oe.create=(t,e)=>new Oe({type:t,typeName:I.ZodPromise,...O(e)});var ee=class extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{(0,f.addIssueToContext)(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return f.INVALID;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?f.INVALID:c.status==="dirty"||r.value==="dirty"?(0,f.DIRTY)(c.value):c});{if(r.value==="aborted")return f.INVALID;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?f.INVALID:a.status==="dirty"||r.value==="dirty"?(0,f.DIRTY)(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?f.INVALID:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?f.INVALID:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,f.isValid)(s))return f.INVALID;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>(0,f.isValid)(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):f.INVALID);g.util.assertNever(o)}};l.ZodEffects=ee;l.ZodTransformer=ee;ee.create=(t,e,r)=>new ee({schema:t,typeName:I.ZodEffects,effect:e,...O(r)});ee.createWithPreprocess=(t,e,r)=>new ee({schema:e,effect:{type:"preprocess",transform:t},typeName:I.ZodEffects,...O(r)});var re=class extends E{_parse(e){return this._getType(e)===g.ZodParsedType.undefined?(0,f.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};l.ZodOptional=re;re.create=(t,e)=>new re({innerType:t,typeName:I.ZodOptional,...O(e)});var pe=class extends E{_parse(e){return this._getType(e)===g.ZodParsedType.null?(0,f.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};l.ZodNullable=pe;pe.create=(t,e)=>new pe({innerType:t,typeName:I.ZodNullable,...O(e)});var Ke=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===g.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};l.ZodDefault=Ke;Ke.create=(t,e)=>new Ke({innerType:t,typeName:I.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var Ge=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,f.isAsync)(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new y.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new y.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};l.ZodCatch=Ge;Ge.create=(t,e)=>new Ge({innerType:t,typeName:I.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var bt=class extends E{_parse(e){if(this._getType(e)!==g.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.nan,received:n.parsedType}),f.INVALID}return{status:"valid",value:e.data}}};l.ZodNaN=bt;bt.create=t=>new bt({typeName:I.ZodNaN,...O(t)});l.BRAND=Symbol("zod_brand");var nr=class extends E{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};l.ZodBranded=nr;var or=class t extends E{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?f.INVALID:i.status==="dirty"?(r.dirty(),(0,f.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?f.INVALID:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:I.ZodPipeline})}};l.ZodPipeline=or;var Ye=class extends E{_parse(e){let r=this._def.innerType._parse(e),n=o=>((0,f.isValid)(o)&&(o.value=Object.freeze(o.value)),o);return(0,f.isAsync)(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};l.ZodReadonly=Ye;Ye.create=(t,e)=>new Ye({innerType:t,typeName:I.ZodReadonly,...O(e)});function ls(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function ys(t,e={},r){return t?Ae.create().superRefine((n,o)=>{var s,a;let i=t(n);if(i instanceof Promise)return i.then(c=>{var u,d;if(!c){let m=ls(e,n),b=(d=(u=m.fatal)!=null?u:r)!=null?d:!0;o.addIssue({code:"custom",...m,fatal:b})}});if(!i){let c=ls(e,n),u=(a=(s=c.fatal)!=null?s:r)!=null?a:!0;o.addIssue({code:"custom",...c,fatal:u})}}):Ae.create()}l.late={object:Y.lazycreate};var I;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(I||(l.ZodFirstPartyTypeKind=I={}));var vd=(t,e={message:`Input not instance of ${t.name}`})=>ys(r=>r instanceof t,e);l.instanceof=vd;var gs=Ie.create;l.string=gs;var vs=De.create;l.number=vs;var bd=bt.create;l.nan=bd;var _d=Le.create;l.bigint=_d;var bs=Me.create;l.boolean=bs;var xd=Fe.create;l.date=xd;var wd=ht.create;l.symbol=wd;var Cd=ze.create;l.undefined=Cd;var Td=qe.create;l.null=Td;var Sd=Ae.create;l.any=Sd;var Id=ve.create;l.unknown=Id;var Ad=ce.create;l.never=Ad;var Od=yt.create;l.void=Od;var Ed=be.create;l.array=Ed;var Pd=Y.create;l.object=Pd;var Rd=Y.strictCreate;l.strictObject=Rd;var jd=Ve.create;l.union=jd;var kd=Kr.create;l.discriminatedUnion=kd;var Zd=$e.create;l.intersection=Zd;var Ud=fe.create;l.tuple=Ud;var Nd=Gr.create;l.record=Nd;var Dd=gt.create;l.map=Dd;var Ld=vt.create;l.set=Ld;var Md=Yr.create;l.function=Md;var Fd=Be.create;l.lazy=Fd;var zd=He.create;l.literal=zd;var qd=We.create;l.enum=qd;var Vd=Je.create;l.nativeEnum=Vd;var $d=Oe.create;l.promise=$d;var _s=ee.create;l.effect=_s;l.transformer=_s;var Bd=re.create;l.optional=Bd;var Hd=pe.create;l.nullable=Hd;var Wd=ee.createWithPreprocess;l.preprocess=Wd;var Jd=or.create;l.pipeline=Jd;var Kd=()=>gs().optional();l.ostring=Kd;var Gd=()=>vs().optional();l.onumber=Gd;var Yd=()=>bs().optional();l.oboolean=Yd;l.coerce={string:t=>Ie.create({...t,coerce:!0}),number:t=>De.create({...t,coerce:!0}),boolean:t=>Me.create({...t,coerce:!0}),bigint:t=>Le.create({...t,coerce:!0}),date:t=>Fe.create({...t,coerce:!0})};l.NEVER=f.INVALID});var so=x(oe=>{"use strict";var Xd=oe&&oe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_t=oe&&oe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xd(e,t,r)};Object.defineProperty(oe,"__esModule",{value:!0});_t(Hr(),oe);_t(no(),oe);_t(as(),oe);_t(tr(),oe);_t(xs(),oe);_t(Br(),oe)});var U=x(X=>{"use strict";var ws=X&&X.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Qd=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),el=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ws(e,t,r);return Qd(e,t),e},tl=X&&X.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ws(e,t,r)};Object.defineProperty(X,"__esModule",{value:!0});X.z=void 0;var Cs=el(so());X.z=Cs;tl(so(),X);X.default=Cs});var ao=x(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.actionTypesZodSchema=xt.ActionTypes=void 0;var rl=U(),Ts;(function(t){t.OpenUrl="openUrl",t.ImBack="imBack",t.PostBack="postBack",t.PlayAudio="playAudio",t.PlayVideo="playVideo",t.ShowImage="showImage",t.DownloadFile="downloadFile",t.Signin="signin",t.Call="call",t.MessageBack="messageBack",t.OpenApp="openApp"})(Ts||(xt.ActionTypes=Ts={}));xt.actionTypesZodSchema=rl.z.enum(["openUrl","imBack","postBack","playAudio","showImage","downloadFile","signin","call","messageBack","openApp"])});var co=x(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.semanticActionStateTypesZodSchema=wt.SemanticActionStateTypes=void 0;var nl=U(),Ss;(function(t){t.Start="start",t.Continue="continue",t.Done="done"})(Ss||(wt.SemanticActionStateTypes=Ss={}));wt.semanticActionStateTypesZodSchema=nl.z.enum(["start","continue","done"])});var uo=x(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.attachmentLayoutTypesZodSchema=Ct.AttachmentLayoutTypes=void 0;var ol=U(),Is;(function(t){t.List="list",t.Carousel="carousel"})(Is||(Ct.AttachmentLayoutTypes=Is={}));Ct.attachmentLayoutTypesZodSchema=ol.z.enum(["list","carousel"])});var lo=x(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.Channels=void 0;var As;(function(t){t.Alexa="alexa",t.Console="console",t.Directline="directline",t.DirectlineSpeech="directlinespeech",t.Email="email",t.Emulator="emulator",t.Facebook="facebook",t.Groupme="groupme",t.Line="line",t.Msteams="msteams",t.Omni="omnichannel",t.Outlook="outlook",t.Skype="skype",t.Slack="slack",t.Sms="sms",t.Telegram="telegram",t.Telephony="telephony",t.Test="test",t.Webchat="webchat"})(As||(Xr.Channels=As={}))});var fo=x(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.endOfConversationCodesZodSchema=Tt.EndOfConversationCodes=void 0;var il=U(),Os;(function(t){t.Unknown="unknown",t.CompletedSuccessfully="completedSuccessfully",t.UserCancelled="userCancelled",t.AgentTimedOut="agentTimedOut",t.AgentIssuedInvalidMessage="agentIssuedInvalidMessage",t.ChannelFailed="channelFailed"})(Os||(Tt.EndOfConversationCodes=Os={}));Tt.endOfConversationCodesZodSchema=il.z.enum(["unknown","completedSuccessfully","userCancelled","agentTimedOut","agentIssuedInvalidMessage","channelFailed"])});var Qr=x(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.roleTypeZodSchema=St.RoleTypes=void 0;var sl=U(),Es;(function(t){t.User="user",t.Agent="bot",t.Skill="skill"})(Es||(St.RoleTypes=Es={}));St.roleTypeZodSchema=sl.z.enum(["user","bot","skill"])});var Ps=x(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.addAIToActivity=void 0;var al=(t,e,r)=>{var n;let o={type:"https://schema.org/Message","@type":"Message","@context":"https://schema.org","@id":"",additionalType:["AIGeneratedContent"],citation:e,usageInfo:r};(n=t.entities)!==null&&n!==void 0||(t.entities=[]),t.entities.push(o)};en.addAIToActivity=al});var Rs=x(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.adaptiveCardInvokeActionZodSchema=void 0;var Xe=U();tn.adaptiveCardInvokeActionZodSchema=Xe.z.object({type:Xe.z.string().min(1),id:Xe.z.string().optional(),verb:Xe.z.string().min(1),data:Xe.z.record(Xe.z.string().min(1),Xe.z.any())})});var js=x(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var ks=x(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.default="00000000-0000-0000-0000-000000000000"});var Zs=x(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var ir=x(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});var cl=Zs();function ul(t){return typeof t=="string"&&cl.default.test(t)}yo.default=ul});var sr=x(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});var dl=ir();function ll(t){if(!(0,dl.default)(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}go.default=ll});var _e=x(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.unsafeStringify=void 0;var fl=ir(),q=[];for(let t=0;t<256;++t)q.push((t+256).toString(16).slice(1));function Us(t,e=0){return(q[t[e+0]]+q[t[e+1]]+q[t[e+2]]+q[t[e+3]]+"-"+q[t[e+4]]+q[t[e+5]]+"-"+q[t[e+6]]+q[t[e+7]]+"-"+q[t[e+8]]+q[t[e+9]]+"-"+q[t[e+10]]+q[t[e+11]]+q[t[e+12]]+q[t[e+13]]+q[t[e+14]]+q[t[e+15]]).toLowerCase()}ar.unsafeStringify=Us;function pl(t,e=0){let r=Us(t,e);if(!(0,fl.default)(r))throw TypeError("Stringified UUID is invalid");return r}ar.default=pl});var rn=x(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});var vo,ml=new Uint8Array(16);function hl(){if(!vo){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vo=crypto.getRandomValues.bind(crypto)}return vo(ml)}bo.default=hl});var _o=x(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.updateV1State=void 0;var Ns=rn(),yl=_e(),cr={};function gl(t,e,r){var i,s,a,c;let n,o=(i=t==null?void 0:t._v6)!=null?i:!1;if(t){let u=Object.keys(t);u.length===1&&u[0]==="_v6"&&(t=void 0)}if(t)n=Ds((c=(a=t.random)!=null?a:(s=t.rng)==null?void 0:s.call(t))!=null?c:(0,Ns.default)(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let u=Date.now(),d=(0,Ns.default)();Ls(cr,u,d),n=Ds(d,cr.msecs,cr.nsecs,o?void 0:cr.clockseq,o?void 0:cr.node,e,r)}return e!=null?e:(0,yl.unsafeStringify)(n)}function Ls(t,e,r){var n,o;return(n=t.msecs)!=null||(t.msecs=-1/0),(o=t.nsecs)!=null||(t.nsecs=0),e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e<t.msecs&&(t.node=void 0),t.node||(t.node=r.slice(10,16),t.node[0]|=1,t.clockseq=(r[8]<<8|r[9])&16383),t.msecs=e,t}ur.updateV1State=Ls;function Ds(t,e,r,n,o,i,s=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!i)i=new Uint8Array(16),s=0;else if(s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);e!=null||(e=Date.now()),r!=null||(r=0),n!=null||(n=(t[8]<<8|t[9])&16383),o!=null||(o=t.slice(10,16)),e+=122192928e5;let a=((e&268435455)*1e4+r)%4294967296;i[s++]=a>>>24&255,i[s++]=a>>>16&255,i[s++]=a>>>8&255,i[s++]=a&255;let c=e/4294967296*1e4&268435455;i[s++]=c>>>8&255,i[s++]=c&255,i[s++]=c>>>24&15|16,i[s++]=c>>>16&255,i[s++]=n>>>8|128,i[s++]=n&255;for(let u=0;u<6;++u)i[s++]=o[u];return i}ur.default=gl});var wo=x(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});var vl=sr(),bl=_e();function _l(t){let e=typeof t=="string"?(0,vl.default)(t):t,r=xl(e);return typeof t=="string"?(0,bl.unsafeStringify)(r):r}xo.default=_l;function xl(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}});var Fs=x(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});function wl(t){let e=Sl(t),r=Tl(e,t.length*8);return Cl(r)}function Cl(t){let e=new Uint8Array(t.length*4);for(let r=0;r<t.length*4;r++)e[r]=t[r>>2]>>>r%4*8&255;return e}function Ms(t){return(t+64>>>9<<4)+14+1}function Tl(t,e){let r=new Uint32Array(Ms(e)).fill(0);r.set(t),r[e>>5]|=128<<e%32,r[r.length-1]=e,t=r;let n=1732584193,o=-271733879,i=-1732584194,s=271733878;for(let a=0;a<t.length;a+=16){let c=n,u=o,d=i,m=s;n=B(n,o,i,s,t[a],7,-680876936),s=B(s,n,o,i,t[a+1],12,-389564586),i=B(i,s,n,o,t[a+2],17,606105819),o=B(o,i,s,n,t[a+3],22,-1044525330),n=B(n,o,i,s,t[a+4],7,-176418897),s=B(s,n,o,i,t[a+5],12,1200080426),i=B(i,s,n,o,t[a+6],17,-1473231341),o=B(o,i,s,n,t[a+7],22,-45705983),n=B(n,o,i,s,t[a+8],7,1770035416),s=B(s,n,o,i,t[a+9],12,-1958414417),i=B(i,s,n,o,t[a+10],17,-42063),o=B(o,i,s,n,t[a+11],22,-1990404162),n=B(n,o,i,s,t[a+12],7,1804603682),s=B(s,n,o,i,t[a+13],12,-40341101),i=B(i,s,n,o,t[a+14],17,-1502002290),o=B(o,i,s,n,t[a+15],22,1236535329),n=H(n,o,i,s,t[a+1],5,-165796510),s=H(s,n,o,i,t[a+6],9,-1069501632),i=H(i,s,n,o,t[a+11],14,643717713),o=H(o,i,s,n,t[a],20,-373897302),n=H(n,o,i,s,t[a+5],5,-701558691),s=H(s,n,o,i,t[a+10],9,38016083),i=H(i,s,n,o,t[a+15],14,-660478335),o=H(o,i,s,n,t[a+4],20,-405537848),n=H(n,o,i,s,t[a+9],5,568446438),s=H(s,n,o,i,t[a+14],9,-1019803690),i=H(i,s,n,o,t[a+3],14,-187363961),o=H(o,i,s,n,t[a+8],20,1163531501),n=H(n,o,i,s,t[a+13],5,-1444681467),s=H(s,n,o,i,t[a+2],9,-51403784),i=H(i,s,n,o,t[a+7],14,1735328473),o=H(o,i,s,n,t[a+12],20,-1926607734),n=W(n,o,i,s,t[a+5],4,-378558),s=W(s,n,o,i,t[a+8],11,-2022574463),i=W(i,s,n,o,t[a+11],16,1839030562),o=W(o,i,s,n,t[a+14],23,-35309556),n=W(n,o,i,s,t[a+1],4,-1530992060),s=W(s,n,o,i,t[a+4],11,1272893353),i=W(i,s,n,o,t[a+7],16,-155497632),o=W(o,i,s,n,t[a+10],23,-1094730640),n=W(n,o,i,s,t[a+13],4,681279174),s=W(s,n,o,i,t[a],11,-358537222),i=W(i,s,n,o,t[a+3],16,-722521979),o=W(o,i,s,n,t[a+6],23,76029189),n=W(n,o,i,s,t[a+9],4,-640364487),s=W(s,n,o,i,t[a+12],11,-421815835),i=W(i,s,n,o,t[a+15],16,530742520),o=W(o,i,s,n,t[a+2],23,-995338651),n=J(n,o,i,s,t[a],6,-198630844),s=J(s,n,o,i,t[a+7],10,1126891415),i=J(i,s,n,o,t[a+14],15,-1416354905),o=J(o,i,s,n,t[a+5],21,-57434055),n=J(n,o,i,s,t[a+12],6,1700485571),s=J(s,n,o,i,t[a+3],10,-1894986606),i=J(i,s,n,o,t[a+10],15,-1051523),o=J(o,i,s,n,t[a+1],21,-2054922799),n=J(n,o,i,s,t[a+8],6,1873313359),s=J(s,n,o,i,t[a+15],10,-30611744),i=J(i,s,n,o,t[a+6],15,-1560198380),o=J(o,i,s,n,t[a+13],21,1309151649),n=J(n,o,i,s,t[a+4],6,-145523070),s=J(s,n,o,i,t[a+11],10,-1120210379),i=J(i,s,n,o,t[a+2],15,718787259),o=J(o,i,s,n,t[a+9],21,-343485551),n=Ee(n,c),o=Ee(o,u),i=Ee(i,d),s=Ee(s,m)}return Uint32Array.of(n,o,i,s)}function Sl(t){if(t.length===0)return new Uint32Array;let e=new Uint32Array(Ms(t.length*8)).fill(0);for(let r=0;r<t.length;r++)e[r>>2]|=(t[r]&255)<<r%4*8;return e}function Ee(t,e){let r=(t&65535)+(e&65535);return(t>>16)+(e>>16)+(r>>16)<<16|r&65535}function Il(t,e){return t<<e|t>>>32-e}function nn(t,e,r,n,o,i){return Ee(Il(Ee(Ee(e,t),Ee(n,i)),o),r)}function B(t,e,r,n,o,i,s){return nn(e&r|~e&n,t,e,o,i,s)}function H(t,e,r,n,o,i,s){return nn(e&n|r&~n,t,e,o,i,s)}function W(t,e,r,n,o,i,s){return nn(e^r^n,t,e,o,i,s)}function J(t,e,r,n,o,i,s){return nn(r^(e|~n),t,e,o,i,s)}Co.default=wl});var dr=x(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.URL=xe.DNS=xe.stringToBytes=void 0;var zs=sr(),Al=_e();function qs(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r);return e}xe.stringToBytes=qs;xe.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";xe.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ol(t,e,r,n,o,i){let s=typeof r=="string"?qs(r):r,a=typeof n=="string"?(0,zs.default)(n):n;if(typeof n=="string"&&(n=(0,zs.default)(n)),(n==null?void 0:n.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+s.length);if(c.set(a),c.set(s,a.length),c=e(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,o){i=i||0;for(let u=0;u<16;++u)o[i+u]=c[u];return o}return(0,Al.unsafeStringify)(c)}xe.default=Ol});var $s=x(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.URL=Qe.DNS=void 0;var El=Fs(),To=dr(),Vs=dr();Object.defineProperty(Qe,"DNS",{enumerable:!0,get:function(){return Vs.DNS}});Object.defineProperty(Qe,"URL",{enumerable:!0,get:function(){return Vs.URL}});function So(t,e,r,n){return(0,To.default)(48,El.default,t,e,r,n)}So.DNS=To.DNS;So.URL=To.URL;Qe.default=So});var Bs=x(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});var Pl=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);Io.default={randomUUID:Pl}});var Ws=x(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});var Hs=Bs(),Rl=rn(),jl=_e();function kl(t,e,r){var o,i,s;if(Hs.default.randomUUID&&!e&&!t)return Hs.default.randomUUID();t=t||{};let n=(s=(i=t.random)!=null?i:(o=t.rng)==null?void 0:o.call(t))!=null?s:(0,Rl.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[r+a]=n[a];return e}return(0,jl.unsafeStringify)(n)}Ao.default=kl});var Js=x(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});function Zl(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function Oo(t,e){return t<<e|t>>>32-e}function Ul(t){let e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(t.length+1);n.set(t),n[t.length]=128,t=n;let o=t.length/4+2,i=Math.ceil(o/16),s=new Array(i);for(let a=0;a<i;++a){let c=new Uint32Array(16);for(let u=0;u<16;++u)c[u]=t[a*64+u*4]<<24|t[a*64+u*4+1]<<16|t[a*64+u*4+2]<<8|t[a*64+u*4+3];s[a]=c}s[i-1][14]=(t.length-1)*8/Math.pow(2,32),s[i-1][14]=Math.floor(s[i-1][14]),s[i-1][15]=(t.length-1)*8&4294967295;for(let a=0;a<i;++a){let c=new Uint32Array(80);for(let h=0;h<16;++h)c[h]=s[a][h];for(let h=16;h<80;++h)c[h]=Oo(c[h-3]^c[h-8]^c[h-14]^c[h-16],1);let u=r[0],d=r[1],m=r[2],b=r[3],w=r[4];for(let h=0;h<80;++h){let v=Math.floor(h/20),_=Oo(u,5)+Zl(v,d,m,b)+w+e[v]+c[h]>>>0;w=b,b=m,m=Oo(d,30)>>>0,d=u,u=_}r[0]=r[0]+u>>>0,r[1]=r[1]+d>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+w>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}Eo.default=Ul});var Gs=x(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.URL=et.DNS=void 0;var Nl=Js(),Po=dr(),Ks=dr();Object.defineProperty(et,"DNS",{enumerable:!0,get:function(){return Ks.DNS}});Object.defineProperty(et,"URL",{enumerable:!0,get:function(){return Ks.URL}});function Ro(t,e,r,n){return(0,Po.default)(80,Nl.default,t,e,r,n)}Ro.DNS=Po.DNS;Ro.URL=Po.URL;et.default=Ro});var Ys=x(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});var Dl=_e(),Ll=_o(),Ml=wo();function Fl(t,e,r){t!=null||(t={}),r!=null||(r=0);let n=(0,Ll.default)({...t,_v6:!0},new Uint8Array(16));if(n=(0,Ml.default)(n),e){for(let o=0;o<16;o++)e[r+o]=n[o];return e}return(0,Dl.unsafeStringify)(n)}jo.default=Fl});var Xs=x(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});var zl=sr(),ql=_e();function Vl(t){let e=typeof t=="string"?(0,zl.default)(t):t,r=$l(e);return typeof t=="string"?(0,ql.unsafeStringify)(r):r}ko.default=Vl;function $l(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}});var ra=x(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.updateV7State=void 0;var Qs=rn(),Bl=_e(),Zo={};function Hl(t,e,r){var o,i,s;let n;if(t)n=ea((s=(i=t.random)!=null?i:(o=t.rng)==null?void 0:o.call(t))!=null?s:(0,Qs.default)(),t.msecs,t.seq,e,r);else{let a=Date.now(),c=(0,Qs.default)();ta(Zo,a,c),n=ea(c,Zo.msecs,Zo.seq,e,r)}return e!=null?e:(0,Bl.unsafeStringify)(n)}function ta(t,e,r){var n,o;return(n=t.msecs)!=null||(t.msecs=-1/0),(o=t.seq)!=null||(t.seq=0),e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}lr.updateV7State=ta;function ea(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e!=null||(e=Date.now()),r!=null||(r=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9]),n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}lr.default=Hl});var na=x(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});var Wl=ir();function Jl(t){if(!(0,Wl.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}Uo.default=Jl});var oa=x(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.version=j.validate=j.v7=j.v6ToV1=j.v6=j.v5=j.v4=j.v3=j.v1ToV6=j.v1=j.stringify=j.parse=j.NIL=j.MAX=void 0;var Kl=js();Object.defineProperty(j,"MAX",{enumerable:!0,get:function(){return Kl.default}});var Gl=ks();Object.defineProperty(j,"NIL",{enumerable:!0,get:function(){return Gl.default}});var Yl=sr();Object.defineProperty(j,"parse",{enumerable:!0,get:function(){return Yl.default}});var Xl=_e();Object.defineProperty(j,"stringify",{enumerable:!0,get:function(){return Xl.default}});var Ql=_o();Object.defineProperty(j,"v1",{enumerable:!0,get:function(){return Ql.default}});var ef=wo();Object.defineProperty(j,"v1ToV6",{enumerable:!0,get:function(){return ef.default}});var tf=$s();Object.defineProperty(j,"v3",{enumerable:!0,get:function(){return tf.default}});var rf=Ws();Object.defineProperty(j,"v4",{enumerable:!0,get:function(){return rf.default}});var nf=Gs();Object.defineProperty(j,"v5",{enumerable:!0,get:function(){return nf.default}});var of=Ys();Object.defineProperty(j,"v6",{enumerable:!0,get:function(){return of.default}});var sf=Xs();Object.defineProperty(j,"v6ToV1",{enumerable:!0,get:function(){return sf.default}});var af=ra();Object.defineProperty(j,"v7",{enumerable:!0,get:function(){return af.default}});var cf=ir();Object.defineProperty(j,"validate",{enumerable:!0,get:function(){return cf.default}});var uf=na();Object.defineProperty(j,"version",{enumerable:!0,get:function(){return uf.default}})});var No=x(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.entityZodSchema=void 0;var ia=U();on.entityZodSchema=ia.z.object({type:ia.z.string().min(1)}).passthrough()});var sa=x(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.semanticActionZodSchema=void 0;var fr=U(),df=No(),lf=co();sn.semanticActionZodSchema=fr.z.object({id:fr.z.string().min(1),state:fr.z.union([lf.semanticActionStateTypesZodSchema,fr.z.string().min(1)]),entities:fr.z.record(df.entityZodSchema)})});var aa=x(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.cardActionZodSchema=void 0;var me=U(),ff=ao();an.cardActionZodSchema=me.z.object({type:me.z.union([ff.actionTypesZodSchema,me.z.string().min(1)]),title:me.z.string().min(1),image:me.z.string().min(1).optional(),text:me.z.string().min(1).optional(),displayText:me.z.string().min(1).optional(),value:me.z.any().optional(),channelData:me.z.unknown().optional(),imageAltText:me.z.string().min(1).optional()})});var ca=x(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.suggestedActionsZodSchema=void 0;var cn=U(),pf=aa();un.suggestedActionsZodSchema=cn.z.object({to:cn.z.array(cn.z.string().min(1)),actions:cn.z.array(pf.cardActionZodSchema)})});var Do=x(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.activityEventNamesZodSchema=It.ActivityEventNames=void 0;var mf=U(),ua;(function(t){t.ContinueConversation="ContinueConversation",t.CreateConversation="CreateConversation"})(ua||(It.ActivityEventNames=ua={}));It.activityEventNamesZodSchema=mf.z.enum(["ContinueConversation","CreateConversation"])});var Lo=x(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.activityImportanceZodSchema=At.ActivityImportance=void 0;var hf=U(),da;(function(t){t.Low="low",t.Normal="normal",t.High="high"})(da||(At.ActivityImportance=da={}));At.activityImportanceZodSchema=hf.z.enum(["low","normal","high"])});var Mo=x(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.activityTypesZodSchema=Ot.ActivityTypes=void 0;var yf=U(),la;(function(t){t.Message="message",t.ContactRelationUpdate="contactRelationUpdate",t.ConversationUpdate="conversationUpdate",t.Typing="typing",t.EndOfConversation="endOfConversation",t.Event="event",t.Invoke="invoke",t.InvokeResponse="invokeResponse",t.DeleteUserData="deleteUserData",t.MessageUpdate="messageUpdate",t.MessageDelete="messageDelete",t.InstallationUpdate="installationUpdate",t.MessageReaction="messageReaction",t.Suggestion="suggestion",t.Trace="trace",t.Handoff="handoff",t.Command="command",t.CommandResult="commandResult",t.Delay="delay"})(la||(Ot.ActivityTypes=la={}));Ot.activityTypesZodSchema=yf.z.enum(["message","contactRelationUpdate","conversationUpdate","typing","endOfConversation","event","invoke","invokeResponse","deleteUserData","messageUpdate","messageDelete","installationUpdate","messageReaction","suggestion","trace","handoff","command","commandResult","delay"])});var fa=x(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.attachmentZodSchema=void 0;var Et=U();dn.attachmentZodSchema=Et.z.object({contentType:Et.z.string().min(1),contentUrl:Et.z.string().min(1).optional(),content:Et.z.unknown().optional(),name:Et.z.string().min(1).optional(),thumbnailUrl:Et.z.string().min(1).optional()})});var Fo=x(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.channelAccountZodSchema=void 0;var tt=U(),gf=Qr();ln.channelAccountZodSchema=tt.z.object({id:tt.z.string().min(1).optional(),name:tt.z.string().optional(),aadObjectId:tt.z.string().min(1).optional(),role:tt.z.union([gf.roleTypeZodSchema,tt.z.string().min(1)]).optional(),properties:tt.z.unknown().optional()})});var zo=x(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.conversationAccountZodSchema=void 0;var he=U(),vf=Qr();fn.conversationAccountZodSchema=he.z.object({isGroup:he.z.boolean().optional(),conversationType:he.z.string().min(1).optional(),tenantId:he.z.string().min(1).optional(),id:he.z.string().min(1),name:he.z.string().min(1).optional(),aadObjectId:he.z.string().min(1).optional(),role:he.z.union([vf.roleTypeZodSchema,he.z.string().min(1)]).optional(),properties:he.z.unknown().optional()})});var ma=x(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.conversationReferenceZodSchema=void 0;var pr=U(),pa=Fo(),bf=zo();pn.conversationReferenceZodSchema=pr.z.object({activityId:pr.z.string().min(1).optional(),user:pa.channelAccountZodSchema.optional(),locale:pr.z.string().min(1).optional(),agent:pa.channelAccountZodSchema.optional().nullable(),conversation:bf.conversationAccountZodSchema,channelId:pr.z.string().min(1),serviceUrl:pr.z.string().min(1).optional()})});var qo=x(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.deliveryModesZodSchema=Pt.DeliveryModes=void 0;var _f=U(),ha;(function(t){t.Normal="normal",t.Notification="notification",t.ExpectReplies="expectReplies",t.Ephemeral="ephemeral"})(ha||(Pt.DeliveryModes=ha={}));Pt.deliveryModesZodSchema=_f.z.enum(["normal","notification","expectReplies","ephemeral"])});var Vo=x(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.inputHintsZodSchema=Rt.InputHints=void 0;var xf=U(),ya;(function(t){t.AcceptingInput="acceptingInput",t.IgnoringInput="ignoringInput",t.ExpectingInput="expectingInput"})(ya||(Rt.InputHints=ya={}));Rt.inputHintsZodSchema=xf.z.enum(["acceptingInput","ignoringInput","expectingInput"])});var $o=x(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.messageReactionTypesZodSchema=jt.MessageReactionTypes=void 0;var wf=U(),ga;(function(t){t.Like="like",t.PlusOne="plusOne"})(ga||(jt.MessageReactionTypes=ga={}));jt.messageReactionTypesZodSchema=wf.z.enum(["like","plusOne"])});var va=x(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.messageReactionZodSchema=void 0;var Bo=U(),Cf=$o();mn.messageReactionZodSchema=Bo.z.object({type:Bo.z.union([Cf.messageReactionTypesZodSchema,Bo.z.string().min(1)])})});var Ho=x(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.textFormatTypesZodSchema=kt.TextFormatTypes=void 0;var Tf=U(),ba;(function(t){t.Markdown="markdown",t.Plain="plain",t.Xml="xml"})(ba||(kt.TextFormatTypes=ba={}));kt.textFormatTypesZodSchema=Tf.z.enum(["markdown","plain","xml"])});var _a=x(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.textHighlightZodSchema=void 0;var Wo=U();hn.textHighlightZodSchema=Wo.z.object({text:Wo.z.string().min(1),occurrence:Wo.z.number()})});var Ta=x(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.Activity=rt.activityZodSchema=void 0;var Sf=oa(),T=U(),If=sa(),Af=ca(),Ca=Do(),Of=Lo(),gn=Mo(),Ef=fa(),Pf=uo(),yn=Fo(),xa=lo(),Rf=zo(),jf=ma(),kf=fo(),Zf=qo(),Uf=No(),Nf=Vo(),wa=va(),Df=Ho(),Lf=_a();rt.activityZodSchema=T.z.object({type:T.z.union([gn.activityTypesZodSchema,T.z.string().min(1)]),text:T.z.string().optional(),id:T.z.string().min(1).optional(),channelId:T.z.string().min(1).optional(),from:yn.channelAccountZodSchema.optional(),timestamp:T.z.union([T.z.date(),T.z.string().min(1).datetime().optional(),T.z.string().min(1).transform(t=>new Date(t)).optional()]),localTimestamp:T.z.string().min(1).transform(t=>new Date(t)).optional().or(T.z.date()).optional(),localTimezone:T.z.string().min(1).optional(),callerId:T.z.string().min(1).optional(),serviceUrl:T.z.string().min(1).optional(),conversation:Rf.conversationAccountZodSchema.optional(),recipient:yn.channelAccountZodSchema.optional(),textFormat:T.z.union([Df.textFormatTypesZodSchema,T.z.string().min(1)]).optional(),attachmentLayout:T.z.union([Pf.attachmentLayoutTypesZodSchema,T.z.string().min(1)]).optional(),membersAdded:T.z.array(yn.channelAccountZodSchema).optional(),membersRemoved:T.z.array(yn.channelAccountZodSchema).optional(),reactionsAdded:T.z.array(wa.messageReactionZodSchema).optional(),reactionsRemoved:T.z.array(wa.messageReactionZodSchema).optional(),topicName:T.z.string().min(1).optional(),historyDisclosed:T.z.boolean().optional(),locale:T.z.string().min(1).optional(),speak:T.z.string().min(1).optional(),inputHint:T.z.union([Nf.inputHintsZodSchema,T.z.string().min(1)]).optional(),summary:T.z.string().min(1).optional(),suggestedActions:Af.suggestedActionsZodSchema.optional(),attachments:T.z.array(Ef.attachmentZodSchema).optional(),entities:T.z.array(Uf.entityZodSchema.passthrough()).optional(),channelData:T.z.any().optional(),action:T.z.string().min(1).optional(),replyToId:T.z.string().min(1).optional(),label:T.z.string().min(1).optional(),valueType:T.z.string().min(1).optional(),value:T.z.unknown().optional(),name:T.z.union([Ca.activityEventNamesZodSchema,T.z.string().min(1)]).optional(),relatesTo:jf.conversationReferenceZodSchema.optional(),code:T.z.union([kf.endOfConversationCodesZodSchema,T.z.string().min(1)]).optional(),expiration:T.z.string().min(1).datetime().optional(),importance:T.z.union([Of.activityImportanceZodSchema,T.z.string().min(1)]).optional(),deliveryMode:T.z.union([Zf.deliveryModesZodSchema,T.z.string().min(1)]).optional(),listenFor:T.z.array(T.z.string().min(1)).optional(),textHighlights:T.z.array(Lf.textHighlightZodSchema).optional(),semanticAction:If.semanticActionZodSchema.optional()});var Jo=class t{constructor(e){if(e===void 0)throw new Error("Invalid ActivityType: undefined");if(e===null)throw new Error("Invalid ActivityType: null");if(typeof e=="string"&&e.length===0)throw new Error("Invalid ActivityType: empty string");this.type=e}static fromJson(e){return this.fromObject(JSON.parse(e))}static fromObject(e){let r=rt.activityZodSchema.passthrough().parse(e),n=new t(r.type);return Object.assign(n,r),n}static getContinuationActivity(e){let r={type:gn.ActivityTypes.Event,name:Ca.ActivityEventNames.ContinueConversation,id:(0,Sf.v4)(),channelId:e.channelId,locale:e.locale,serviceUrl:e.serviceUrl,conversation:e.conversation,recipient:e.agent,from:e.user,relatesTo:e};return t.fromObject(r)}getAppropriateReplyToId(){if(this.type!==gn.ActivityTypes.ConversationUpdate||this.channelId!==xa.Channels.Directline&&this.channelId!==xa.Channels.Webchat)return this.id}getConversationReference(){if(this.recipient===null||this.recipient===void 0)throw new Error("Activity Recipient undefined");if(this.conversation===null||this.conversation===void 0)throw new Error("Activity Conversation undefined");if(this.channelId===null||this.channelId===void 0)throw new Error("Activity ChannelId undefined");return{activityId:this.getAppropriateReplyToId(),user:this.from,agent:this.recipient,conversation:this.conversation,channelId:this.channelId,locale:this.locale,serviceUrl:this.serviceUrl}}applyConversationReference(e,r=!1){var n,o,i;return this.channelId=e.channelId,(n=this.locale)!==null&&n!==void 0||(this.locale=e.locale),this.serviceUrl=e.serviceUrl,this.conversation=e.conversation,r?(this.from=e.user,this.recipient=(o=e.agent)!==null&&o!==void 0?o:void 0,e.activityId&&(this.id=e.activityId)):(this.from=(i=e.agent)!==null&&i!==void 0?i:void 0,this.recipient=e.user,e.activityId&&(this.replyToId=e.activityId)),this}clone(){let e=JSON.parse(JSON.stringify(this));for(let r in e)typeof e[r]=="string"&&!isNaN(Date.parse(e[r]))&&(e[r]=new Date(e[r]));return Object.setPrototypeOf(e,t.prototype),e}getMentions(e){let r=[];if(e.entities!==void 0)for(let n=0;n<e.entities.length;n++)e.entities[n].type.toLowerCase()==="mention"&&r.push(e.entities[n]);return r}normalizeMentions(e=!1){var r,n;if(this.type===gn.ActivityTypes.Message&&(e&&(this.removeRecipientMention(),this.entities!==void 0&&(!((r=this.recipient)===null||r===void 0)&&r.id)&&(this.entities=this.entities.filter(o=>{var i;return o.type.toLowerCase()==="mention"?o.mentioned.id!==((i=this.recipient)===null||i===void 0?void 0:i.id):!0}))),this.text&&(this.text=t.removeAt(this.text)),this.entities!==void 0)){let o=this.getMentions(this);for(let i of o)i.text&&(i.text=(n=t.removeAt(i.text))===null||n===void 0?void 0:n.trim())}}static removeAt(e){if(!e)return e;let r;do{r=!1;let n=e.toLowerCase().indexOf("<at");if(n>=0){let o=e.indexOf(">",n);if(o>0){let i=e.toLowerCase().indexOf("</at>",o);if(i>0){let s=e.substring(i+5);s.length>0&&!/\s/.test(s[0])&&(s=` ${s}`),e=e.substring(0,i)+s;let a=e.substring(o+1,i),c=e.substring(0,n);c.length>0&&!/\s$/.test(c)&&(c+=" "),e=c+a+s,r=!0}}}}while(r);return e}removeMentionText(e){let n=this.getMentions(this).filter(o=>o.mentioned.id===e);return n.length>0&&this.text&&(this.text=this.text.replace(n[0].text,"").trim()),this.text||""}removeRecipientMention(){return this.recipient!=null&&this.recipient.id?this.removeMentionText(this.recipient.id):""}getReplyConversationReference(e){let r=this.getConversationReference();return r.activityId=e,r}toJsonString(){return JSON.stringify(this)}};rt.Activity=Jo});var Sa=x(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.CallerIdConstants=void 0;vn.CallerIdConstants={PublicAzureChannel:"urn:botframework:azure",USGovChannel:"urn:botframework:azureusgov",AgentPrefix:"urn:botframework:aadappid:"}});var Ia=x(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.activityTreatments=Zt.ActivityTreatments=void 0;var Mf=U(),Ko;(function(t){t.Targeted="targeted"})(Ko||(Zt.ActivityTreatments=Ko={}));Zt.activityTreatments=Mf.z.nativeEnum(Ko)});var Ea=x(P=>{"use strict";var Ff=P&&P.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Aa=P&&P.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ff(e,t,r)};Object.defineProperty(P,"__esModule",{value:!0});P.ActivityTreatments=P.TextFormatTypes=P.MessageReactionTypes=P.InputHints=P.DeliveryModes=P.CallerIdConstants=P.ActivityTypes=P.ActivityImportance=P.ActivityEventNames=P.activityZodSchema=P.Activity=P.RoleTypes=P.EndOfConversationCodes=P.Channels=P.AttachmentLayoutTypes=P.SemanticActionStateTypes=P.ActionTypes=void 0;var zf=ao();Object.defineProperty(P,"ActionTypes",{enumerable:!0,get:function(){return zf.ActionTypes}});var qf=co();Object.defineProperty(P,"SemanticActionStateTypes",{enumerable:!0,get:function(){return qf.SemanticActionStateTypes}});var Vf=uo();Object.defineProperty(P,"AttachmentLayoutTypes",{enumerable:!0,get:function(){return Vf.AttachmentLayoutTypes}});var $f=lo();Object.defineProperty(P,"Channels",{enumerable:!0,get:function(){return $f.Channels}});var Bf=fo();Object.defineProperty(P,"EndOfConversationCodes",{enumerable:!0,get:function(){return Bf.EndOfConversationCodes}});var Hf=Qr();Object.defineProperty(P,"RoleTypes",{enumerable:!0,get:function(){return Hf.RoleTypes}});Aa(Ps(),P);Aa(Rs(),P);var Oa=Ta();Object.defineProperty(P,"Activity",{enumerable:!0,get:function(){return Oa.Activity}});Object.defineProperty(P,"activityZodSchema",{enumerable:!0,get:function(){return Oa.activityZodSchema}});var Wf=Do();Object.defineProperty(P,"ActivityEventNames",{enumerable:!0,get:function(){return Wf.ActivityEventNames}});var Jf=Lo();Object.defineProperty(P,"ActivityImportance",{enumerable:!0,get:function(){return Jf.ActivityImportance}});var Kf=Mo();Object.defineProperty(P,"ActivityTypes",{enumerable:!0,get:function(){return Kf.ActivityTypes}});var Gf=Sa();Object.defineProperty(P,"CallerIdConstants",{enumerable:!0,get:function(){return Gf.CallerIdConstants}});var Yf=qo();Object.defineProperty(P,"DeliveryModes",{enumerable:!0,get:function(){return Yf.DeliveryModes}});var Xf=Vo();Object.defineProperty(P,"InputHints",{enumerable:!0,get:function(){return Xf.InputHints}});var Qf=$o();Object.defineProperty(P,"MessageReactionTypes",{enumerable:!0,get:function(){return Qf.MessageReactionTypes}});var ep=Ho();Object.defineProperty(P,"TextFormatTypes",{enumerable:!0,get:function(){return ep.TextFormatTypes}});var tp=Ia();Object.defineProperty(P,"ActivityTreatments",{enumerable:!0,get:function(){return tp.ActivityTreatments}})});var zt=(r=>(r.Published="Published",r.Prebuilt="Prebuilt",r))(zt||{});var qt=(S=>(S.Unknown="Unknown",S.Exp="Exp",S.Dev="Dev",S.Test="Test",S.Preprod="Preprod",S.FirstRelease="FirstRelease",S.Prod="Prod",S.Gov="Gov",S.High="High",S.DoD="DoD",S.Mooncake="Mooncake",S.Ex="Ex",S.Rx="Rx",S.Prv="Prv",S.Local="Local",S.GovFR="GovFR",S.Other="Other",S))(qt||{});var An=class{constructor(){this.appClientId="";this.tenantId="";this.environmentId="";this.agentIdentifier="";this.useExperimentalEndpoint=!1}},On=class extends An{constructor(e){var o,i;if(super(),!e)return;let r=(o=e.cloud)!=null?o:"Prod",n=(i=e.copilotAgentType)!=null?i:"Published";if(!Object.values(qt).includes(r))throw new Error(`Invalid PowerPlatformCloud: '${r}'. Supported values: ${Object.values(qt).join(", ")}`);if(!Object.values(zt).includes(n))throw new Error(`Invalid AgentType: '${n}'. Supported values: ${Object.values(zt).join(", ")}`);Object.assign(this,{...e,cloud:r,copilotAgentType:n})}},gp=()=>{var t,e,r,n,o;return new On({appClientId:(t=process.env.appClientId)!=null?t:"",tenantId:(e=process.env.tenantId)!=null?e:"",environmentId:(r=process.env.environmentId)!=null?r:"",agentIdentifier:(n=process.env.agentIdentifier)!=null?n:"",cloud:process.env.cloud,customPowerPlatformCloud:process.env.customPowerPlatformCloud,copilotAgentType:process.env.copilotAgentType,directConnectUrl:process.env.directConnectUrl,useExperimentalEndpoint:((o=process.env.useExperimentalEndpoint)==null?void 0:o.toLowerCase())==="true"})};function Vt(t,e){return function(){return t.apply(e,arguments)}}var{toString:rc}=Object.prototype,{getPrototypeOf:Pn}=Object,{iterator:_r,toStringTag:di}=Symbol,xr=(t=>e=>{let r=rc.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),se=t=>(t=t.toLowerCase(),e=>xr(e)===t),wr=t=>e=>typeof e===t,{isArray:ot}=Array,$t=wr("undefined");function nc(t){return t!==null&&!$t(t)&&t.constructor!==null&&!$t(t.constructor)&&K(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var li=se("ArrayBuffer");function oc(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&li(t.buffer),e}var ic=wr("string"),K=wr("function"),fi=wr("number"),Cr=t=>t!==null&&typeof t=="object",sc=t=>t===!0||t===!1,br=t=>{if(xr(t)!=="object")return!1;let e=Pn(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(di in t)&&!(_r in t)},ac=se("Date"),cc=se("File"),uc=se("Blob"),dc=se("FileList"),lc=t=>Cr(t)&&K(t.pipe),fc=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||K(t.append)&&((e=xr(t))==="formdata"||e==="object"&&K(t.toString)&&t.toString()==="[object FormData]"))},pc=se("URLSearchParams"),[mc,hc,yc,gc]=["ReadableStream","Request","Response","Headers"].map(se),vc=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bt(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t=="undefined")return;let n,o;if(typeof t!="object"&&(t=[t]),ot(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{let i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length,a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function pi(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,o;for(;n-- >0;)if(o=r[n],e===o.toLowerCase())return o;return null}var ke=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,mi=t=>!$t(t)&&t!==ke;function En(){let{caseless:t}=mi(this)&&this||{},e={},r=(n,o)=>{let i=t&&pi(e,o)||o;br(e[i])&&br(n)?e[i]=En(e[i],n):br(n)?e[i]=En({},n):ot(n)?e[i]=n.slice():e[i]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&Bt(arguments[n],r);return e}var bc=(t,e,r,{allOwnKeys:n}={})=>(Bt(e,(o,i)=>{r&&K(o)?t[i]=Vt(o,r):t[i]=o},{allOwnKeys:n}),t),_c=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),xc=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},wc=(t,e,r,n)=>{let o,i,s,a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&Pn(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Cc=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},Tc=t=>{if(!t)return null;if(ot(t))return t;let e=t.length;if(!fi(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Sc=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&Pn(Uint8Array)),Ic=(t,e)=>{let n=(t&&t[_r]).call(t),o;for(;(o=n.next())&&!o.done;){let i=o.value;e.call(t,i[0],i[1])}},Ac=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Oc=se("HTMLFormElement"),Ec=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),ui=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Pc=se("RegExp"),hi=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Bt(r,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(n[i]=s||o)}),Object.defineProperties(t,n)},Rc=t=>{hi(t,(e,r)=>{if(K(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(K(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},jc=(t,e)=>{let r={},n=o=>{o.forEach(i=>{r[i]=!0})};return ot(t)?n(t):n(String(t).split(e)),r},kc=()=>{},Zc=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Uc(t){return!!(t&&K(t.append)&&t[di]==="FormData"&&t[_r])}var Nc=t=>{let e=new Array(10),r=(n,o)=>{if(Cr(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;let i=ot(n)?[]:{};return Bt(n,(s,a)=>{let c=r(s,o+1);!$t(c)&&(i[a]=c)}),e[o]=void 0,i}}return n};return r(t,0)},Dc=se("AsyncFunction"),Lc=t=>t&&(Cr(t)||K(t))&&K(t.then)&&K(t.catch),yi=((t,e)=>t?setImmediate:e?((r,n)=>(ke.addEventListener("message",({source:o,data:i})=>{o===ke&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ke.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",K(ke.postMessage)),Mc=typeof queueMicrotask!="undefined"?queueMicrotask.bind(ke):typeof process!="undefined"&&process.nextTick||yi,Fc=t=>t!=null&&K(t[_r]),p={isArray:ot,isArrayBuffer:li,isBuffer:nc,isFormData:fc,isArrayBufferView:oc,isString:ic,isNumber:fi,isBoolean:sc,isObject:Cr,isPlainObject:br,isReadableStream:mc,isRequest:hc,isResponse:yc,isHeaders:gc,isUndefined:$t,isDate:ac,isFile:cc,isBlob:uc,isRegExp:Pc,isFunction:K,isStream:lc,isURLSearchParams:pc,isTypedArray:Sc,isFileList:dc,forEach:Bt,merge:En,extend:bc,trim:vc,stripBOM:_c,inherits:xc,toFlatObject:wc,kindOf:xr,kindOfTest:se,endsWith:Cc,toArray:Tc,forEachEntry:Ic,matchAll:Ac,isHTMLForm:Oc,hasOwnProperty:ui,hasOwnProp:ui,reduceDescriptors:hi,freezeMethods:Rc,toObjectSet:jc,toCamelCase:Ec,noop:kc,toFiniteNumber:Zc,findKey:pi,global:ke,isContextDefined:mi,isSpecCompliantForm:Uc,toJSONObject:Nc,isAsyncFn:Dc,isThenable:Lc,setImmediate:yi,asap:Mc,isIterable:Fc};function it(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}p.inherits(it,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:p.toJSONObject(this.config),code:this.code,status:this.status}}});var gi=it.prototype,vi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{vi[t]={value:t}});Object.defineProperties(it,vi);Object.defineProperty(gi,"isAxiosError",{value:!0});it.from=(t,e,r,n,o,i)=>{let s=Object.create(gi);return p.toFlatObject(t,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),it.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};var A=it;var Tr=null;function Rn(t){return p.isPlainObject(t)||p.isArray(t)}function _i(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function bi(t,e,r){return t?t.concat(e).map(function(o,i){return o=_i(o),!r&&i?"["+o+"]":o}).join(r?".":""):e}function zc(t){return p.isArray(t)&&!t.some(Rn)}var qc=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function Vc(t,e,r){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new(Tr||FormData),r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,_){return!p.isUndefined(_[v])});let n=r.metaTokens,o=r.visitor||d,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob!="undefined"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(o))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(p.isBoolean(h))return h.toString();if(!c&&p.isBlob(h))throw new A("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,v,_){let S=h;if(h&&!_&&typeof h=="object"){if(p.endsWith(v,"{}"))v=n?v:v.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&zc(h)||(p.isFileList(h)||p.endsWith(v,"[]"))&&(S=p.toArray(h)))return v=_i(v),S.forEach(function(N,z){!(p.isUndefined(N)||N===null)&&e.append(s===!0?bi([v],z,i):s===null?v:v+"[]",u(N))}),!1}return Rn(h)?!0:(e.append(bi(_,v,i),u(h)),!1)}let m=[],b=Object.assign(qc,{defaultVisitor:d,convertValue:u,isVisitable:Rn});function w(h,v){if(!p.isUndefined(h)){if(m.indexOf(h)!==-1)throw Error("Circular reference detected in "+v.join("."));m.push(h),p.forEach(h,function(S,R){(!(p.isUndefined(S)||S===null)&&o.call(e,S,p.isString(R)?R.trim():R,v,b))===!0&&w(S,v?v.concat(R):[R])}),m.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return w(t),e}var Ce=Vc;function xi(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function wi(t,e){this._pairs=[],t&&Ce(t,this,e)}var Ci=wi.prototype;Ci.append=function(e,r){this._pairs.push([e,r])};Ci.toString=function(e){let r=e?function(n){return e.call(this,n,xi)}:xi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var Sr=wi;function $c(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ht(t,e,r){if(!e)return t;let n=r&&r.encode||$c;p.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,i;if(o?i=o(e,r):i=p.isURLSearchParams(e)?e.toString():new Sr(e,r).toString(n),i){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}var jn=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){p.forEach(this.handlers,function(n){n!==null&&e(n)})}},kn=jn;var Ir={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Ti=typeof URLSearchParams!="undefined"?URLSearchParams:Sr;var Si=typeof FormData!="undefined"?FormData:null;var Ii=typeof Blob!="undefined"?Blob:null;var Ai={isBrowser:!0,classes:{URLSearchParams:Ti,FormData:Si,Blob:Ii},protocols:["http","https","file","blob","url","data"]};var Nn={};ec(Nn,{hasBrowserEnv:()=>Un,hasStandardBrowserEnv:()=>Bc,hasStandardBrowserWebWorkerEnv:()=>Hc,navigator:()=>Zn,origin:()=>Wc});var Un=typeof window!="undefined"&&typeof document!="undefined",Zn=typeof navigator=="object"&&navigator||void 0,Bc=Un&&(!Zn||["ReactNative","NativeScript","NS"].indexOf(Zn.product)<0),Hc=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wc=Un&&window.location.href||"http://localhost";var L={...Nn,...Ai};function Dn(t,e){return Ce(t,new L.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return L.isNode&&p.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function Jc(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Kc(t){let e={},r=Object.keys(t),n,o=r.length,i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}function Gc(t){function e(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),c=i>=r.length;return s=!s&&p.isArray(o)?o.length:s,c?(p.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!p.isObject(o[s]))&&(o[s]=[]),e(r,n,o[s],i)&&p.isArray(o[s])&&(o[s]=Kc(o[s])),!a)}if(p.isFormData(t)&&p.isFunction(t.entries)){let r={};return p.forEachEntry(t,(n,o)=>{e(Jc(n),o,r,0)}),r}return null}var Ar=Gc;function Yc(t,e,r){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Ln={transitional:Ir,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=p.isObject(e);if(i&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return o?JSON.stringify(Ar(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)||p.isReadableStream(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Dn(e,this.formSerializer).toString();if((a=p.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return Ce(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Yc(e)):e}],transformResponse:[function(e){let r=this.transitional||Ln.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(p.isResponse(e)||p.isReadableStream(e))return e;if(e&&p.isString(e)&&(n&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?A.from(a,A.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{Ln.headers[t]={}});var st=Ln;var Xc=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oi=t=>{let e={},r,n,o;return t&&t.split(`
|
|
2
|
+
`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||e[r]&&Xc[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var Ei=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function Or(t){return t===!1||t==null?t:p.isArray(t)?t.map(Or):String(t)}function Qc(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}var eu=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Mn(t,e,r,n,o){if(p.isFunction(n))return n.call(this,e,r);if(o&&(e=r),!!p.isString(e)){if(p.isString(n))return e.indexOf(n)!==-1;if(p.isRegExp(n))return n.test(e)}}function tu(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function ru(t,e){let r=p.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(o,i,s){return this[n].call(this,e,o,i,s)},configurable:!0})})}var at=class{constructor(e){e&&this.set(e)}set(e,r,n){let o=this;function i(a,c,u){let d=Wt(c);if(!d)throw new Error("header name must be a non-empty string");let m=p.findKey(o,d);(!m||o[m]===void 0||u===!0||u===void 0&&o[m]!==!1)&&(o[m||c]=Or(a))}let s=(a,c)=>p.forEach(a,(u,d)=>i(u,d,c));if(p.isPlainObject(e)||e instanceof this.constructor)s(e,r);else if(p.isString(e)&&(e=e.trim())&&!eu(e))s(Oi(e),r);else if(p.isObject(e)&&p.isIterable(e)){let a={},c,u;for(let d of e){if(!p.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[u=d[0]]=(c=a[u])?p.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}s(a,r)}else e!=null&&i(r,e,n);return this}get(e,r){if(e=Wt(e),e){let n=p.findKey(this,e);if(n){let o=this[n];if(!r)return o;if(r===!0)return Qc(o);if(p.isFunction(r))return r.call(this,o,n);if(p.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Wt(e),e){let n=p.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Mn(this,this[n],n,r)))}return!1}delete(e,r){let n=this,o=!1;function i(s){if(s=Wt(s),s){let a=p.findKey(n,s);a&&(!r||Mn(n,n[a],a,r))&&(delete n[a],o=!0)}}return p.isArray(e)?e.forEach(i):i(e),o}clear(e){let r=Object.keys(this),n=r.length,o=!1;for(;n--;){let i=r[n];(!e||Mn(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let r=this,n={};return p.forEach(this,(o,i)=>{let s=p.findKey(n,i);if(s){r[s]=Or(o),delete r[i];return}let a=e?tu(i):String(i).trim();a!==i&&delete r[i],r[a]=Or(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return p.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=e&&p.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){let n=(this[Ei]=this[Ei]={accessors:{}}).accessors,o=this.prototype;function i(s){let a=Wt(s);n[a]||(ru(o,s),n[a]=!0)}return p.isArray(e)?e.forEach(i):i(e),this}};at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(at.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});p.freezeMethods(at);var F=at;function Jt(t,e){let r=this||st,n=e||r,o=F.from(n.headers),i=n.data;return p.forEach(t,function(a){i=a.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Kt(t){return!!(t&&t.__CANCEL__)}function Pi(t,e,r){A.call(this,t==null?"canceled":t,A.ERR_CANCELED,e,r),this.name="CanceledError"}p.inherits(Pi,A,{__CANCEL__:!0});var de=Pi;function Gt(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new A("Request failed with status code "+r.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Fn(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function nu(t,e){t=t||10;let r=new Array(t),n=new Array(t),o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){let u=Date.now(),d=n[i];s||(s=u),r[o]=c,n[o]=u;let m=i,b=0;for(;m!==o;)b+=r[m++],m=m%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s<e)return;let w=d&&u-d;return w?Math.round(b*1e3/w):void 0}}var Ri=nu;function ou(t,e){let r=0,n=1e3/e,o,i,s=(u,d=Date.now())=>{r=d,o=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{let d=Date.now(),m=d-r;m>=n?s(u,d):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},n-m)))},()=>o&&s(o)]}var ji=ou;var ct=(t,e,r=3)=>{let n=0,o=Ri(50,250);return ji(i=>{let s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-n,u=o(c),d=s<=a;n=s;let m={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},r)},zn=(t,e)=>{let r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},qn=t=>(...e)=>p.asap(()=>t(...e));var ki=L.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,L.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0;var Zi=L.hasStandardBrowserEnv?{write(t,e,r,n,o,i){let s=[t+"="+encodeURIComponent(e)];p.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),p.isString(n)&&s.push("path="+n),p.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Vn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function $n(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Yt(t,e,r){let n=!Vn(e);return t&&(n||r==!1)?$n(t,e):e}var Ui=t=>t instanceof F?{...t}:t;function ae(t,e){e=e||{};let r={};function n(u,d,m,b){return p.isPlainObject(u)&&p.isPlainObject(d)?p.merge.call({caseless:b},u,d):p.isPlainObject(d)?p.merge({},d):p.isArray(d)?d.slice():d}function o(u,d,m,b){if(p.isUndefined(d)){if(!p.isUndefined(u))return n(void 0,u,m,b)}else return n(u,d,m,b)}function i(u,d){if(!p.isUndefined(d))return n(void 0,d)}function s(u,d){if(p.isUndefined(d)){if(!p.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function a(u,d,m){if(m in e)return n(u,d);if(m in t)return n(void 0,u)}let c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,d,m)=>o(Ui(u),Ui(d),m,!0)};return p.forEach(Object.keys(Object.assign({},t,e)),function(d){let m=c[d]||o,b=m(t[d],e[d],d);p.isUndefined(b)&&m!==a||(r[d]=b)}),r}var Er=t=>{let e=ae({},t),{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;e.headers=s=F.from(s),e.url=Ht(Yt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(p.isFormData(r)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){let[u,...d]=c?c.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...d].join("; "))}}if(L.hasStandardBrowserEnv&&(n&&p.isFunction(n)&&(n=n(e)),n||n!==!1&&ki(e.url))){let u=o&&i&&Zi.read(i);u&&s.set(o,u)}return e};var iu=typeof XMLHttpRequest!="undefined",Ni=iu&&function(t){return new Promise(function(r,n){let o=Er(t),i=o.data,s=F.from(o.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,d,m,b,w,h;function v(){w&&w(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function S(){if(!_)return;let N=F.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:N,config:t,request:_};Gt(function(ye){r(ye),v()},function(ye){n(ye),v()},D),_=null}"onloadend"in _?_.onloadend=S:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(S)},_.onabort=function(){_&&(n(new A("Request aborted",A.ECONNABORTED,t,_)),_=null)},_.onerror=function(){n(new A("Network Error",A.ERR_NETWORK,t,_)),_=null},_.ontimeout=function(){let z=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",D=o.transitional||Ir;o.timeoutErrorMessage&&(z=o.timeoutErrorMessage),n(new A(z,D.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,t,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&p.forEach(s.toJSON(),function(z,D){_.setRequestHeader(D,z)}),p.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),u&&([b,h]=ct(u,!0),_.addEventListener("progress",b)),c&&_.upload&&([m,w]=ct(c),_.upload.addEventListener("progress",m),_.upload.addEventListener("loadend",w)),(o.cancelToken||o.signal)&&(d=N=>{_&&(n(!N||N.type?new de(null,t,_):N),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));let R=Fn(o.url);if(R&&L.protocols.indexOf(R)===-1){n(new A("Unsupported protocol "+R+":",A.ERR_BAD_REQUEST,t));return}_.send(i||null)})};var su=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,o,i=function(u){if(!o){o=!0,a();let d=u instanceof Error?u:this.reason;n.abort(d instanceof A?d:new de(d instanceof Error?d.message:d))}},s=e&&setTimeout(()=>{s=null,i(new A(`timeout ${e} of ms exceeded`,A.ETIMEDOUT))},e),a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));let{signal:c}=n;return c.unsubscribe=()=>p.asap(a),c}},Di=su;var au=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let n=0,o;for(;n<r;)o=n+e,yield t.slice(n,o),n=o},cu=async function*(t,e){for await(let r of uu(t))yield*au(r,e)},uu=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},Bn=(t,e,r,n)=>{let o=cu(t,e),i=0,s,a=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{let{done:u,value:d}=await o.next();if(u){a(),c.close();return}let m=d.byteLength;if(r){let b=i+=m;r(b)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),o.return()}},{highWaterMark:2})};var Rr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Mi=Rr&&typeof ReadableStream=="function",du=Rr&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Fi=(t,...e)=>{try{return!!t(...e)}catch{return!1}},lu=Mi&&Fi(()=>{let t=!1,e=new Request(L.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Li=64*1024,Hn=Mi&&Fi(()=>p.isReadableStream(new Response("").body)),Pr={stream:Hn&&(t=>t.body)};Rr&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Pr[e]&&(Pr[e]=p.isFunction(t[e])?r=>r[e]():(r,n)=>{throw new A(`Response type '${e}' is not supported`,A.ERR_NOT_SUPPORT,n)})})})(new Response);var fu=async t=>{if(t==null)return 0;if(p.isBlob(t))return t.size;if(p.isSpecCompliantForm(t))return(await new Request(L.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(p.isArrayBufferView(t)||p.isArrayBuffer(t))return t.byteLength;if(p.isURLSearchParams(t)&&(t=t+""),p.isString(t))return(await du(t)).byteLength},pu=async(t,e)=>{let r=p.toFiniteNumber(t.getContentLength());return r==null?fu(e):r},zi=Rr&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:m="same-origin",fetchOptions:b}=Er(t);u=u?(u+"").toLowerCase():"text";let w=Di([o,i&&i.toAbortSignal()],s),h,v=w&&w.unsubscribe&&(()=>{w.unsubscribe()}),_;try{if(c&&lu&&r!=="get"&&r!=="head"&&(_=await pu(d,n))!==0){let D=new Request(e,{method:"POST",body:n,duplex:"half"}),te;if(p.isFormData(n)&&(te=D.headers.get("content-type"))&&d.setContentType(te),D.body){let[ye,je]=zn(_,ct(qn(c)));n=Bn(D.body,Li,ye,je)}}p.isString(m)||(m=m?"include":"omit");let S="credentials"in Request.prototype;h=new Request(e,{...b,signal:w,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:S?m:void 0});let R=await fetch(h,b),N=Hn&&(u==="stream"||u==="response");if(Hn&&(a||N&&v)){let D={};["status","statusText","headers"].forEach(gr=>{D[gr]=R[gr]});let te=p.toFiniteNumber(R.headers.get("content-length")),[ye,je]=a&&zn(te,ct(qn(a),!0))||[];R=new Response(Bn(R.body,Li,ye,()=>{je&&je(),v&&v()}),D)}u=u||"text";let z=await Pr[p.findKey(Pr,u)||"text"](R,t);return!N&&v&&v(),await new Promise((D,te)=>{Gt(D,te,{data:z,headers:F.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:h})})}catch(S){throw v&&v(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,t,h),{cause:S.cause||S}):A.from(S,S&&S.code,t,h)}});var Wn={http:Tr,xhr:Ni,fetch:zi};p.forEach(Wn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var qi=t=>`- ${t}`,mu=t=>p.isFunction(t)||t===null||t===!1,jr={getAdapter:t=>{t=p.isArray(t)?t:[t];let{length:e}=t,r,n,o={};for(let i=0;i<e;i++){r=t[i];let s;if(n=r,!mu(r)&&(n=Wn[(s=String(r)).toLowerCase()],n===void 0))throw new A(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){let i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build")),s=e?i.length>1?`since :
|
|
4
|
+
`+i.map(qi).join(`
|
|
5
|
+
`):" "+qi(i[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Wn};function Jn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new de(null,t)}function kr(t){return Jn(t),t.headers=F.from(t.headers),t.data=Jt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jr.getAdapter(t.adapter||st.adapter)(t).then(function(n){return Jn(t),n.data=Jt.call(t,t.transformResponse,n),n.headers=F.from(n.headers),n},function(n){return Kt(n)||(Jn(t),n&&n.response&&(n.response.data=Jt.call(t,t.transformResponse,n.response),n.response.headers=F.from(n.response.headers))),Promise.reject(n)})}var Zr="1.10.0";var Ur={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ur[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var Vi={};Ur.transitional=function(e,r,n){function o(i,s){return"[Axios v"+Zr+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(e===!1)throw new A(o(s," has been removed"+(r?" in "+r:"")),A.ERR_DEPRECATED);return r&&!Vi[s]&&(Vi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,s,a):!0}};Ur.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function hu(t,e,r){if(typeof t!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),o=n.length;for(;o-- >0;){let i=n[o],s=e[i];if(s){let a=t[i],c=a===void 0||s(a,i,t);if(c!==!0)throw new A("option "+i+" must be "+c,A.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new A("Unknown option "+i,A.ERR_BAD_OPTION)}}var Xt={assertOptions:hu,validators:Ur};var le=Xt.validators,ut=class{constructor(e){this.defaults=e||{},this.interceptors={request:new kn,response:new kn}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ae(this.defaults,r);let{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Xt.assertOptions(n,{silentJSONParsing:le.transitional(le.boolean),forcedJSONParsing:le.transitional(le.boolean),clarifyTimeoutError:le.transitional(le.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Xt.assertOptions(o,{encode:le.function,serialize:le.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Xt.assertOptions(r,{baseUrl:le.spelling("baseURL"),withXsrfToken:le.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),r.headers=F.concat(s,i);let a=[],c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});let u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let d,m=0,b;if(!c){let h=[kr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,u),b=h.length,d=Promise.resolve(r);m<b;)d=d.then(h[m++],h[m++]);return d}b=a.length;let w=r;for(m=0;m<b;){let h=a[m++],v=a[m++];try{w=h(w)}catch(_){v.call(this,_);break}}try{d=kr.call(this,w)}catch(h){return Promise.reject(h)}for(m=0,b=u.length;m<b;)d=d.then(u[m++],u[m++]);return d}getUri(e){e=ae(this.defaults,e);let r=Yt(e.baseURL,e.url,e.allowAbsoluteUrls);return Ht(r,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){ut.prototype[e]=function(r,n){return this.request(ae(n||{},{method:e,url:r,data:(n||{}).data}))}});p.forEach(["post","put","patch"],function(e){function r(n){return function(i,s,a){return this.request(ae(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[e]=r(),ut.prototype[e+"Form"]=r(!0)});var Qt=ut;var Kn=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});let n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i,s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,a){n.reason||(n.reason=new de(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new t(function(o){e=o}),cancel:e}}},$i=Kn;function Gn(t){return function(r){return t.apply(null,r)}}function Yn(t){return p.isObject(t)&&t.isAxiosError===!0}var Xn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xn).forEach(([t,e])=>{Xn[e]=t});var Bi=Xn;function Hi(t){let e=new Qt(t),r=Vt(Qt.prototype.request,e);return p.extend(r,Qt.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Hi(ae(t,o))},r}var M=Hi(st);M.Axios=Qt;M.CanceledError=de;M.CancelToken=$i;M.isCancel=Kt;M.VERSION=Zr;M.toFormData=Ce;M.AxiosError=A;M.Cancel=M.CanceledError;M.all=function(e){return Promise.all(e)};M.spread=Gn;M.isAxiosError=Yn;M.mergeConfig=ae;M.AxiosHeaders=F;M.formToJSON=t=>Ar(p.isHTMLForm(t)?new FormData(t):t);M.getAdapter=jr.getAdapter;M.HttpStatusCode=Bi;M.default=M;var Nr=M;var{Axios:_y,AxiosError:xy,CanceledError:wy,isCancel:Cy,CancelToken:Ty,VERSION:Sy,all:Iy,Cancel:Ay,isAxiosError:Oy,spread:Ey,toFormData:Py,AxiosHeaders:Ry,HttpStatusCode:jy,formToJSON:ky,getAdapter:Zy,mergeConfig:Uy}=Nr;var Qi=vr(Fr());var zr=class{constructor(e){this.API_VERSION="2022-03-01-preview";let{identifier:r,host:n}=e;this.baseURL=new URL(`/copilotstudio/prebuilt/authenticated/bots/${r}`,n),this.baseURL.searchParams.append("api-version",this.API_VERSION)}getConversationUrl(e){let r=new URL(this.baseURL.href);return r.pathname=`${r.pathname}/conversations`,e&&(r.pathname=`${r.pathname}/${e}`),r.href}};var qr=class{constructor(e){this.API_VERSION="2022-03-01-preview";let{schema:r,host:n}=e;this.baseURL=new URL(`/copilotstudio/dataverse-backed/authenticated/bots/${r}`,n),this.baseURL.searchParams.append("api-version",this.API_VERSION)}getConversationUrl(e){let r=new URL(this.baseURL.href);return r.pathname=`${r.pathname}/conversations`,e&&(r.pathname=`${r.pathname}/${e}`),r.href}};var pt=(0,Qi.debug)("copilot-studio:power-platform");function $r(t,e){var a,c,u,d,m,b;if((a=t.directConnectUrl)!=null&&a.trim()){if(pt.debug(`Using direct connection: ${t.directConnectUrl}`),!er(t.directConnectUrl))throw new Error("directConnectUrl must be a valid URL");return t.directConnectUrl.toLowerCase().includes("tenants/00000000-0000-0000-0000-000000000000")?(pt.debug(`Direct connection cannot be used, forcing default settings flow. Tenant ID is missing in the URL: ${t.directConnectUrl}`),$r({...t,directConnectUrl:""},e)):ju(t.directConnectUrl,e).href}let r=(c=t.cloud)!=null?c:"Prod",n=(u=t.copilotAgentType)!=null?u:"Published";if(pt.debug(`Using cloud setting: ${r}`),pt.debug(`Using agent type: ${n}`),!((d=t.environmentId)!=null&&d.trim()))throw new Error("EnvironmentId must be provided");if(!((m=t.agentIdentifier)!=null&&m.trim()))throw new Error("AgentIdentifier must be provided");if(r==="Other")if((b=t.customPowerPlatformCloud)!=null&&b.trim())if(er(t.customPowerPlatformCloud))pt.debug(`Using custom Power Platform cloud: ${t.customPowerPlatformCloud}`);else throw new Error("customPowerPlatformCloud must be a valid URL");else throw new Error("customPowerPlatformCloud must be provided when PowerPlatformCloud is Other");let o=ku(r,t.environmentId,t.customPowerPlatformCloud),s={Published:()=>new qr({host:o,schema:t.agentIdentifier}),Prebuilt:()=>new zr({host:o,identifier:t.agentIdentifier})}[n]().getConversationUrl(e);return pt.debug(`Generated Copilot Studio connection URL: ${s}`),s}function es(t,e="Unknown",r="",n=""){var o,i;if(!n&&!(t!=null&&t.directConnectUrl)){if(e==="Other"&&!r)throw new Error("cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other");if(!t&&e==="Unknown")throw new Error("Either settings or cloud must be provided");if(t&&t.cloud&&t.cloud!=="Unknown"&&(e=t.cloud),e==="Other")if(r&&er(r))e="Other";else if(t!=null&&t.customPowerPlatformCloud&&er(t.customPowerPlatformCloud))e="Other",r=t.customPowerPlatformCloud;else throw new Error("Either CustomPowerPlatformCloud or cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other");return r!=null||(r="api.unknown.powerplatform.com"),`https://${Vr(e,r)}/.default`}else if(n||(n=(o=t==null?void 0:t.directConnectUrl)!=null?o:""),n&&er(n)){if(Xi(new URL(n))==="Unknown"){let s=(i=t==null?void 0:t.cloud)!=null?i:e;if(s==="Other"||s==="Unknown")throw new Error("Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.");if(s!=="Unknown")return`https://${Vr(s,"")}/.default`;throw new Error("Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.")}return`https://${Vr(Xi(new URL(n)),"")}/.default`}else throw new Error("DirectConnectUrl must be provided when DirectConnectUrl is set")}function er(t){try{let e=t.startsWith("http")?t:`https://${t}`;return!!new URL(e)}catch{return!1}}function ju(t,e){let r=new URL(t);return r.searchParams.has("api-version")||r.searchParams.append("api-version","2022-03-01-preview"),r.pathname.endsWith("/")&&(r.pathname=r.pathname.slice(0,-1)),r.pathname.includes("/conversations")&&(r.pathname=r.pathname.substring(0,r.pathname.indexOf("/conversations"))),r.pathname=`${r.pathname}/conversations`,e&&(r.pathname=`${r.pathname}/${e}`),r}function ku(t,e,r){if(t==="Other"&&(!r||!r.trim()))throw new Error("cloudBaseAddress must be provided when PowerPlatformCloud is Other");r=r!=null?r:"api.unknown.powerplatform.com";let n=e.toLowerCase().replaceAll("-",""),o=Zu(t),i=n.substring(0,n.length-o),s=n.substring(n.length-o);return new URL(`https://${i}.${s}.environment.${Vr(t,r)}`)}function Vr(t,e){switch(t){case"Local":return"api.powerplatform.localhost";case"Exp":return"api.exp.powerplatform.com";case"Dev":return"api.dev.powerplatform.com";case"Prv":return"api.prv.powerplatform.com";case"Test":return"api.test.powerplatform.com";case"Preprod":return"api.preprod.powerplatform.com";case"FirstRelease":case"Prod":return"api.powerplatform.com";case"GovFR":return"api.gov.powerplatform.microsoft.us";case"Gov":return"api.gov.powerplatform.microsoft.us";case"High":return"api.high.powerplatform.microsoft.us";case"DoD":return"api.appsplatform.us";case"Mooncake":return"api.powerplatform.partner.microsoftonline.cn";case"Ex":return"api.powerplatform.eaglex.ic.gov";case"Rx":return"api.powerplatform.microsoft.scloud";case"Other":return e;default:throw new Error(`Invalid cluster category value: ${t}`)}}function Zu(t){switch(t){case"FirstRelease":case"Prod":return 2;default:return 1}}function Xi(t){switch(t.host.toLowerCase()){case"api.powerplatform.localhost":return"Local";case"api.exp.powerplatform.com":return"Exp";case"api.dev.powerplatform.com":return"Dev";case"api.prv.powerplatform.com":return"Prv";case"api.test.powerplatform.com":return"Test";case"api.preprod.powerplatform.com":return"Preprod";case"api.powerplatform.com":return"Prod";case"api.gov.powerplatform.microsoft.us":return"GovFR";case"api.high.powerplatform.microsoft.us":return"High";case"api.appsplatform.us":return"DoD";case"api.powerplatform.partner.microsoftonline.cn":return"Mooncake";default:return"Unknown"}}var mr=vr(Ea());var bn=class{constructor(e){this.activity=e}};var ja=vr(Fr());var Pa="0.6.21-g3c2261b2fc";var _n={};var Q=(0,ja.debug)("copilot-studio:client"),we=class we{constructor(e,r){this.conversationId="";this.settings=e,this.client=Nr.create(),this.client.defaults.headers.common.Authorization=`Bearer ${r}`,this.client.defaults.headers.common["User-Agent"]=we.getProductInfo()}async postRequestAsync(e){var m,b,w,h;let r=[];Q.debug(`>>> SEND TO ${e.url}`);let n=await this.client(e);if(this.settings.useExperimentalEndpoint&&!((m=this.settings.directConnectUrl)!=null&&m.trim())){let v=(b=n.headers)==null?void 0:b[we.islandExperimentalUrlHeaderKey];v&&(this.settings.directConnectUrl=v,Q.debug(`Island Experimental URL: ${v}`))}this.conversationId=(h=(w=n.headers)==null?void 0:w[we.conversationIdHeaderKey])!=null?h:"",this.conversationId&&Q.debug(`Conversation ID: ${this.conversationId}`);let o={...n.headers};delete o.Authorization,delete o[we.conversationIdHeaderKey],Q.debug("Headers received:",o);let s=n.data.pipeThrough(new TextDecoderStream).getReader(),a="",c=[],u=async({done:v,value:_})=>v?(Q.debug("Stream complete"),a+=_,c.push(a),c):(Q.info("Agent is typing ..."),a+=_,await u(await s.read()));return(await s.read().then(u)).forEach(v=>{v.toString().split(`
|
|
7
|
+
`).filter(R=>R.substring(0,4)==="data"&&R!=="data: end\r").forEach(R=>{var N,z;try{let D=mr.Activity.fromJson(R.substring(5,R.length));D.type===mr.ActivityTypes.Message?(r.push(D),this.conversationId.trim()||(this.conversationId=(z=(N=D.conversation)==null?void 0:N.id)!=null?z:"",Q.debug(`Conversation ID: ${this.conversationId}`))):Q.debug(`Activity type: ${D.type}`)}catch(D){throw Q.error("Error: ",D),D}})}),r}static getProductInfo(){let e=`CopilotStudioClient.agents-sdk-js/${Pa}`,r;return typeof window!="undefined"&&window.navigator?r=`${e} ${navigator.userAgent}`:r=`${e} nodejs/${process.version} ${_n.platform()}-${_n.arch()}/${_n.release()}`,Q.debug(`User-Agent: ${r}`),r}async startConversationAsync(e=!0){var a;let o={method:"post",url:$r(this.settings),headers:{Accept:"text/event-stream","Content-Type":"application/json"},data:{emitStartConversationEvent:e},responseType:"stream",adapter:"fetch"};Q.info("Starting conversation ...");let i=await this.postRequestAsync(o),s=i[0];return Q.info(`Conversation '${(a=s.conversation)==null?void 0:a.id}' started. Received ${i.length} activities.`,i),s}async askQuestionAsync(e,r=this.conversationId){var m,b;let o={type:"message",text:e,conversation:{id:r}},i=mr.Activity.fromObject(o),s=(b=(m=i.conversation)==null?void 0:m.id)!=null?b:r,a=$r(this.settings,s),c=new bn(i),u={method:"post",url:a,headers:{Accept:"text/event-stream","Content-Type":"application/json"},data:c,responseType:"stream",adapter:"fetch"};Q.info(`Asking question: ${e} ...`);let d=await this.postRequestAsync(u);return Q.info(`Received ${d.length} activities.`,d),d}};we.conversationIdHeaderKey="x-ms-conversationid",we.islandExperimentalUrlHeaderKey="x-ms-d2e-experimental",we.scopeFromSettings=es;var Ra=we;var V=[];for(let t=0;t<256;++t)V.push((t+256).toString(16).slice(1));function ka(t,e=0){return(V[t[e+0]]+V[t[e+1]]+V[t[e+2]]+V[t[e+3]]+"-"+V[t[e+4]]+V[t[e+5]]+"-"+V[t[e+6]]+V[t[e+7]]+"-"+V[t[e+8]]+V[t[e+9]]+"-"+V[t[e+10]]+V[t[e+11]]+V[t[e+12]]+V[t[e+13]]+V[t[e+14]]+V[t[e+15]]).toLowerCase()}var Go,np=new Uint8Array(16);function Yo(){if(!Go){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Go=crypto.getRandomValues.bind(crypto)}return Go(np)}var op=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xo={randomUUID:op};function ip(t,e,r){var o,i,s;if(Xo.randomUUID&&!e&&!t)return Xo.randomUUID();t=t||{};let n=(s=(i=t.random)!=null?i:(o=t.rng)==null?void 0:o.call(t))!=null?s:Yo();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[r+a]=n[a];return e}return ka(n)}var Qo=ip;var ei=function(t,e){return ei=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},ei(t,e)};function Pe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ei(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function hr(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ut(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function Nt(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function ie(t){return typeof t=="function"}function xn(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var wn=xn(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
8
8
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
9
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function yr(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Dt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=hr(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(v){e={error:v}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}else s.remove(this);var d=this.initialTeardown;if(ie(d))try{d()}catch(v){i=v instanceof wn?v.errors:[v]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var b=hr(m),C=b.next();!C.done;C=b.next()){var h=C.value;try{ja(h)}catch(v){i=i!=null?i:[],v instanceof wn?i=Nt(Nt([],Ut(i)),Ut(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{C&&!C.done&&(o=b.return)&&o.call(b)}finally{if(n)throw n.error}}}if(i)throw new wn(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)ja(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&yr(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&yr(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();var Qo=Dt.EMPTY;function Cn(t){return t instanceof Dt||t&&"closed"in t&&ie(t.remove)&&ie(t.add)&&ie(t.unsubscribe)}function ja(t){ie(t)?t():t.unsubscribe()}var ue={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Lt={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Lt.delegate;return o!=null&&o.setTimeout?o.setTimeout.apply(o,Nt([t,e],Ut(r))):setTimeout.apply(void 0,Nt([t,e],Ut(r)))},clearTimeout:function(t){var e=Lt.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Za(t){Lt.setTimeout(function(){var e=ue.onUnhandledError;if(e)e(t);else throw t})}function ei(){}var Ua=function(){return ti("C",void 0,void 0)}();function Na(t){return ti("E",void 0,t)}function Da(t){return ti("N",t,void 0)}function ti(t,e,r){return{kind:t,value:e,error:r}}var ot=null;function Mt(t){if(ue.useDeprecatedSynchronousErrorHandling){var e=!ot;if(e&&(ot={errorThrown:!1,error:null}),t(),e){var r=ot,n=r.errorThrown,o=r.error;if(ot=null,n)throw o}}else t()}function La(t){ue.useDeprecatedSynchronousErrorHandling&&ot&&(ot.errorThrown=!0,ot.error=t)}var oi=function(t){Re(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Cn(r)&&r.add(n)):n.destination=cp,n}return e.create=function(r,n,o){return new Sn(r,n,o)},e.prototype.next=function(r){this.isStopped?ni(Da(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?ni(Na(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?ni(Ua,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Dt);var ip=Function.prototype.bind;function ri(t,e){return ip.call(t,e)}var sp=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){Tn(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){Tn(n)}else Tn(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){Tn(r)}},t}(),Sn=function(t){Re(e,t);function e(r,n,o){var i=t.call(this)||this,s;if(ie(r)||!r)s={next:r!=null?r:void 0,error:n!=null?n:void 0,complete:o!=null?o:void 0};else{var a;i&&ue.useDeprecatedNextContext?(a=Object.create(r),a.unsubscribe=function(){return i.unsubscribe()},s={next:r.next&&ri(r.next,a),error:r.error&&ri(r.error,a),complete:r.complete&&ri(r.complete,a)}):s=r}return i.destination=new sp(s),i}return e}(oi);function Tn(t){ue.useDeprecatedSynchronousErrorHandling?La(t):Za(t)}function ap(t){throw t}function ni(t,e){var r=ue.onStoppedNotification;r&&Lt.setTimeout(function(){return r(t,e)})}var cp={closed:!0,next:ei,error:ap,complete:ei};var Ma=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Fa(t){return t}function za(t){return t.length===0?Fa:t.length===1?t[0]:function(r){return t.reduce(function(n,o){return o(n)},r)}}var Ft=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var o=this,i=dp(e)?e:new Sn(e,r,n);return Mt(function(){var s=o,a=s.operator,c=s.source;i.add(a?a.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=qa(r),new r(function(o,i){var s=new Sn({next:function(a){try{e(a)}catch(c){i(c),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Ma]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return za(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=qa(e),new e(function(n,o){var i;r.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},t.create=function(e){return new t(e)},t}();function qa(t){var e;return(e=t!=null?t:ue.Promise)!==null&&e!==void 0?e:Promise}function up(t){return t&&ie(t.next)&&ie(t.error)&&ie(t.complete)}function dp(t){return t&&t instanceof oi||up(t)&&Cn(t)}var Va=xn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var ii=function(t){Re(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new $a(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Va},e.prototype.next=function(r){var n=this;Mt(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=hr(n.currentObservers),a=s.next();!a.done;a=s.next()){var c=a.value;c.next(r)}}catch(u){o={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(r){var n=this;Mt(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},e.prototype.complete=function(){var r=this;Mt(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?Qo:(this.currentObservers=null,a.push(r),new Dt(function(){n.currentObservers=null,yr(a,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?r.error(i):s&&r.complete()},e.prototype.asObservable=function(){var r=new Ft;return r.source=this,r},e.create=function(r,n){return new $a(r,n)},e}(Ft);var $a=function(t){Re(e,t);function e(r,n){var o=t.call(this)||this;return o.destination=r,o.source=n,o}return e.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},e.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Qo},e}(ii);var si=function(t){Re(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(ii);var Wa=vr(Fr()),Pe=(0,Wa.debug)("copilot-studio:webchat"),Ba=class{static createConnection(e,r){Pe.info("--> Creating connection between Copilot Studio and WebChat ...");let n=0,o,i,s=new si(0),a=Ha(async d=>{if(o=d,s.value<2){s.next(2);return}Pe.debug("--> Connection established."),u();let m=await e.startConversationAsync();i=m.conversation,n=0,c(m)}),c=d=>{let m={...d,timestamp:new Date().toISOString(),channelData:{...d.channelData,"webchat:sequence-id":n++}};Pe.debug(`Notify '${m.type}' activity to WebChat:`,m),o==null||o.next(m)},u=()=>{if(!(r!=null&&r.showTyping))return;let d=i?{id:i.id,name:i.name}:{id:"agent",name:"Agent"};c({type:"typing",from:d})};return{connectionStatus$:s,activity$:a,postActivity(d){var m;if(Pe.info("--> Preparing to send activity to Copilot Studio ..."),!((m=d.text)!=null&&m.trim()))throw new Error("Activity text cannot be empty.");if(!o)throw new Error("Activity subscriber is not initialized.");return Ha(async b=>{try{let C=Yo();Pe.info("--> Sending activity to Copilot Studio ..."),c({...d,id:C}),u();let h=await e.askQuestionAsync(d.text);for(let v of h)c(v);b.next(C),b.complete(),Pe.info("--> Activity received correctly from Copilot Studio.")}catch(C){Pe.error("Error sending Activity to Copilot Studio:",C),b.error(C)}})},end(){Pe.info("--> Ending connection between Copilot Studio and WebChat ..."),s.complete(),o&&(o.complete(),o=void 0)}}}};function Ha(t){return new Ft(e=>{Promise.resolve(t(e)).catch(r=>e.error(r))})}export{zt as AgentType,ai as ConnectionSettings,Ra as CopilotStudioClient,Ba as CopilotStudioWebChat,bn as ExecuteTurnRequest,qt as PowerPlatformCloud,$r as getCopilotStudioConnectionUrl,Qi as getTokenAudience,yp as loadCopilotStudioConnectionSettingsFromEnv};
|
|
9
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function yr(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Dt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=hr(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(v){e={error:v}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}else s.remove(this);var d=this.initialTeardown;if(ie(d))try{d()}catch(v){i=v instanceof wn?v.errors:[v]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var b=hr(m),w=b.next();!w.done;w=b.next()){var h=w.value;try{Za(h)}catch(v){i=i!=null?i:[],v instanceof wn?i=Nt(Nt([],Ut(i)),Ut(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(n)throw n.error}}}if(i)throw new wn(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Za(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&yr(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&yr(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();var ti=Dt.EMPTY;function Cn(t){return t instanceof Dt||t&&"closed"in t&&ie(t.remove)&&ie(t.add)&&ie(t.unsubscribe)}function Za(t){ie(t)?t():t.unsubscribe()}var ue={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Lt={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Lt.delegate;return o!=null&&o.setTimeout?o.setTimeout.apply(o,Nt([t,e],Ut(r))):setTimeout.apply(void 0,Nt([t,e],Ut(r)))},clearTimeout:function(t){var e=Lt.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ua(t){Lt.setTimeout(function(){var e=ue.onUnhandledError;if(e)e(t);else throw t})}function ri(){}var Na=function(){return ni("C",void 0,void 0)}();function Da(t){return ni("E",void 0,t)}function La(t){return ni("N",t,void 0)}function ni(t,e,r){return{kind:t,value:e,error:r}}var nt=null;function Mt(t){if(ue.useDeprecatedSynchronousErrorHandling){var e=!nt;if(e&&(nt={errorThrown:!1,error:null}),t(),e){var r=nt,n=r.errorThrown,o=r.error;if(nt=null,n)throw o}}else t()}function Ma(t){ue.useDeprecatedSynchronousErrorHandling&&nt&&(nt.errorThrown=!0,nt.error=t)}var si=function(t){Pe(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Cn(r)&&r.add(n)):n.destination=up,n}return e.create=function(r,n,o){return new Sn(r,n,o)},e.prototype.next=function(r){this.isStopped?ii(La(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?ii(Da(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?ii(Na,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Dt);var sp=Function.prototype.bind;function oi(t,e){return sp.call(t,e)}var ap=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){Tn(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){Tn(n)}else Tn(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){Tn(r)}},t}(),Sn=function(t){Pe(e,t);function e(r,n,o){var i=t.call(this)||this,s;if(ie(r)||!r)s={next:r!=null?r:void 0,error:n!=null?n:void 0,complete:o!=null?o:void 0};else{var a;i&&ue.useDeprecatedNextContext?(a=Object.create(r),a.unsubscribe=function(){return i.unsubscribe()},s={next:r.next&&oi(r.next,a),error:r.error&&oi(r.error,a),complete:r.complete&&oi(r.complete,a)}):s=r}return i.destination=new ap(s),i}return e}(si);function Tn(t){ue.useDeprecatedSynchronousErrorHandling?Ma(t):Ua(t)}function cp(t){throw t}function ii(t,e){var r=ue.onStoppedNotification;r&&Lt.setTimeout(function(){return r(t,e)})}var up={closed:!0,next:ri,error:cp,complete:ri};var Fa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function za(t){return t}function qa(t){return t.length===0?za:t.length===1?t[0]:function(r){return t.reduce(function(n,o){return o(n)},r)}}var Ft=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var o=this,i=lp(e)?e:new Sn(e,r,n);return Mt(function(){var s=o,a=s.operator,c=s.source;i.add(a?a.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Va(r),new r(function(o,i){var s=new Sn({next:function(a){try{e(a)}catch(c){i(c),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Fa]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qa(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Va(e),new e(function(n,o){var i;r.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},t.create=function(e){return new t(e)},t}();function Va(t){var e;return(e=t!=null?t:ue.Promise)!==null&&e!==void 0?e:Promise}function dp(t){return t&&ie(t.next)&&ie(t.error)&&ie(t.complete)}function lp(t){return t&&t instanceof si||dp(t)&&Cn(t)}var $a=xn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var ai=function(t){Pe(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Ba(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new $a},e.prototype.next=function(r){var n=this;Mt(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=hr(n.currentObservers),a=s.next();!a.done;a=s.next()){var c=a.value;c.next(r)}}catch(u){o={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(r){var n=this;Mt(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},e.prototype.complete=function(){var r=this;Mt(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?ti:(this.currentObservers=null,a.push(r),new Dt(function(){n.currentObservers=null,yr(a,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?r.error(i):s&&r.complete()},e.prototype.asObservable=function(){var r=new Ft;return r.source=this,r},e.create=function(r,n){return new Ba(r,n)},e}(Ft);var Ba=function(t){Pe(e,t);function e(r,n){var o=t.call(this)||this;return o.destination=r,o.source=n,o}return e.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},e.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:ti},e}(ai);var ci=function(t){Pe(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(ai);var Ja=vr(Fr()),Re=(0,Ja.debug)("copilot-studio:webchat"),Ha=class{static createConnection(e,r){Re.info("--> Creating connection between Copilot Studio and WebChat ...");let n=0,o,i,s=new ci(0),a=Wa(async d=>{if(o=d,s.value<2){s.next(2);return}Re.debug("--> Connection established."),u();let m=await e.startConversationAsync();i=m.conversation,n=0,c(m)}),c=d=>{let m={...d,timestamp:new Date().toISOString(),channelData:{...d.channelData,"webchat:sequence-id":n++}};Re.debug(`Notify '${m.type}' activity to WebChat:`,m),o==null||o.next(m)},u=()=>{if(!(r!=null&&r.showTyping))return;let d=i?{id:i.id,name:i.name}:{id:"agent",name:"Agent"};c({type:"typing",from:d})};return{connectionStatus$:s,activity$:a,postActivity(d){var m;if(Re.info("--> Preparing to send activity to Copilot Studio ..."),!((m=d.text)!=null&&m.trim()))throw new Error("Activity text cannot be empty.");if(!o)throw new Error("Activity subscriber is not initialized.");return Wa(async b=>{try{let w=Qo();Re.info("--> Sending activity to Copilot Studio ..."),c({...d,id:w}),u();let h=await e.askQuestionAsync(d.text);for(let v of h)c(v);b.next(w),b.complete(),Re.info("--> Activity received correctly from Copilot Studio.")}catch(w){Re.error("Error sending Activity to Copilot Studio:",w),b.error(w)}})},end(){Re.info("--> Ending connection between Copilot Studio and WebChat ..."),s.complete(),o&&(o.complete(),o=void 0)}}}};function Wa(t){return new Ft(e=>{Promise.resolve(t(e)).catch(r=>e.error(r))})}export{zt as AgentType,On as ConnectionSettings,Ra as CopilotStudioClient,Ha as CopilotStudioWebChat,bn as ExecuteTurnRequest,qt as PowerPlatformCloud,$r as getCopilotStudioConnectionUrl,es as getTokenAudience,gp as loadCopilotStudioConnectionSettingsFromEnv};
|
|
10
10
|
//# sourceMappingURL=browser.mjs.map
|