@roomstay/core 0.1.72 → 0.1.73
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/node.js +1 -1
- package/dist/types/Addons/Addon.types.d.ts +2 -0
- package/dist/types/Api/Reservations.type.d.ts +2 -0
- package/dist/types/Availability/Availability.types.d.ts +4 -0
- package/dist/types/Package/Package.types.d.ts +2 -0
- package/dist/types/PromoCode/EPromoCodeDiscountType.enum.d.ts +5 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/utils/TotalCalculator.d.ts +1 -1
- package/dist/web.js +1 -1
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n,i,o,r,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>R,AddGiftCardSchema:()=>_o,BaseGiftCardSchema:()=>vo,CancelGiftCardTransactionSchema:()=>To,CompleteGiftCardTransactionSchema:()=>Eo,DATE_FORMAT:()=>N,EAddonPricingType:()=>C,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>A,EGiftCardTransactionType:()=>ko,EGuaranteePolicyDepositMode:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Co,ELogSeverity:()=>Ao,ELogType:()=>Ro,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>w,ERoomstayImageSize:()=>z,ETransactionStatus:()=>wo,EditGiftCardSchema:()=>yo,GuestProfile:()=>d,HttpMethod:()=>E,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>go,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>Po,RedeemGiftCardSchema:()=>bo,RefreshGiftCardTokenSchema:()=>Io,RegisterGiftCardAdminSchema:()=>No,Reservation:()=>u,ReservedPackage:()=>I,TotalCalculator:()=>Yo,ValidateGiftCardSchema:()=>zo,calculateFeeAmount:()=>Zo,calculateTotalForMemberBooking:()=>$o,getFeeOptionValidity:()=>Bo,getFilteredBookingAddonFees:()=>Lo,getFilteredBookingFees:()=>Mo,getFilteredBookingRateFees:()=>Go,maxString:()=>mo,nameof:()=>Ho,preprocessDate:()=>uo,preprocessNumber:()=>co,requireEmail:()=>po,requireFutureDate:()=>ho,requirePositiveAmount:()=>fo,requireString:()=>lo,resizeRoomstayImageUrl:()=>qo,roundMoney:()=>xo,subset:()=>Vo,uppercaseString:()=>Qo,validateFormWithZod:()=>ao}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class I extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.hideQuantity=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(E||(E={}));const N="DD/MM/YYYY";let A,C;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(A||(A={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(C||(C={}));const R=[C.PER_NIGHT,C.PER_PERSON_PER_NIGHT,C.PER_QUANTITY_NAME_PER_NIGHT,C.PER_ROOM_QUANTITY_PER_NIGHT,C.PER_PERSON_OCCUPANCY_PER_NIGHT,C.PER_ADULT_OCCUPANCY_PER_NIGHT,C.PER_CHILD_OCCUPANCY_PER_NIGHT,C.PER_ALL_PERSONS_PER_NIGHT];function $(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class S extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const x={};function Z(e){return e&&Object.assign(x,e),x}const F=/^[cC][^\s-]{8,}$/,D=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U=/^[0-9a-vA-V]{20}$/,M=/^[A-Za-z0-9]{27}$/,G=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,V=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,q=/^(?:(?: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])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,J=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K=/^[A-Za-z0-9_-]*$/,X=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ee=/^\+(?:[0-9]){6,14}[0-9]$/,te="(?:(?:\\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])))",ne=new RegExp(`^${te}$`);function ie(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const oe=/^\d+$/,re=/^-?\d+(?:\.\d+)?/i,se=/true|false/i,ae=/^[^A-Z]*$/,ce=/^[^a-z]*$/;function ue(e,t){return"bigint"==typeof t?t.toString():t}function de(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function le(e){return null==e}function pe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const fe=Symbol("evaluating");function he(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==fe)return void 0===i&&(i=fe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ge(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ve(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ye(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Pe=de((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ze(e){if(!1===ye(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==ye(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function be(e){return ze(e)?{...e}:e}const ke=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Te(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Ie={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ae(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ce(e){return"string"==typeof e?e:e?.message}function Re(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ce(e.inst?._zod.def?.error?.(e))??Ce(t?.error?.(e))??Ce(n.customError?.(e))??Ce(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Se(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Oe=$("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),xe={number:"number",bigint:"bigint",object:"date"},Ze=$("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=$("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),De=$("$ZodCheckMultipleOf",((e,t)=>{Oe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),je=$("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ie[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=oe)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Ue=$("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=$e(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Me=$("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=$e(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ge=$("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=$e(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Le=$("$ZodCheckStringFormat",((e,t)=>{var n,i;Oe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Be=$("$ZodCheckRegex",((e,t)=>{Le.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),He=$("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ae),Le.init(e,t)})),Ve=$("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ce),Le.init(e,t)})),qe=$("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),Ye=$("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Qe=$("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=$("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Je{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ke=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ue,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xe=$("$ZodError",Ke),et=$("$ZodError",Ke,{Parent:Error}),tt=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new S;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Re(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},nt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Re(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},it=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new S;return r.issues.length?{success:!1,error:new(e??Xe)(r.issues.map((e=>Re(e,o,Z()))))}:{success:!0,data:r.value}},ot=it(et),rt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Re(e,o,Z()))))}:{success:!0,data:r.value}},st=rt(et),at=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ct=e=>(t,n,i)=>tt(e)(t,n,i),ut=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},dt=e=>async(t,n,i)=>nt(e)(t,n,i),lt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return it(e)(t,n,o)},pt=e=>(t,n,i)=>it(e)(t,n,i),ft=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rt(e)(t,n,o)},ht=e=>async(t,n,i)=>rt(e)(t,n,i),mt={major:4,minor:1,patch:5},gt=$("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new S;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=ot(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return st(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),vt=$("$ZodString",((e,t)=>{var n;gt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),_t=$("$ZodStringFormat",((e,t)=>{Le.init(e,t),vt.init(e,t)})),yt=$("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=B),_t.init(e,t)})),Pt=$("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());_t.init(e,t)})),zt=$("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=V),_t.init(e,t)})),bt=$("$ZodURL",((e,t)=>{_t.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),kt=$("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t.init(e,t)})),wt=$("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=G),_t.init(e,t)})),Et=$("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),_t.init(e,t)})),Tt=$("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=D),_t.init(e,t)})),It=$("$ZodULID",((e,t)=>{t.pattern??(t.pattern=j),_t.init(e,t)})),Nt=$("$ZodXID",((e,t)=>{t.pattern??(t.pattern=U),_t.init(e,t)})),At=$("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=M),_t.init(e,t)})),Ct=$("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ie({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${te}T(?:${i})$`)}(t)),_t.init(e,t)})),Rt=$("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ne),_t.init(e,t)})),$t=$("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ie(t)}$`)),_t.init(e,t)})),St=$("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),_t.init(e,t)})),Ot=$("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=q),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),xt=$("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Zt=$("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Q),_t.init(e,t)})),Ft=$("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),_t.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Dt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const jt=$("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=J),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Dt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ut=$("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=K),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!K.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Dt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Mt=$("$ZodE164",((e,t)=>{t.pattern??(t.pattern=ee),_t.init(e,t)})),Gt=$("$ZodJWT",((e,t)=>{_t.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Lt=$("$ZodNumber",((e,t)=>{gt.init(e,t),e._zod.pattern=e._zod.bag.pattern??re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Bt=$("$ZodNumber",((e,t)=>{je.init(e,t),Lt.init(e,t)})),Ht=$("$ZodBoolean",((e,t)=>{gt.init(e,t),e._zod.pattern=se,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Vt=$("$ZodUnknown",((e,t)=>{gt.init(e,t),e._zod.parse=e=>e})),qt=$("$ZodNever",((e,t)=>{gt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=$("$ZodDate",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Qt(e,t,n){e.issues.length&&t.issues.push(...Ae(n,e.issues)),t.value[n]=e.value}const Wt=$("$ZodArray",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Qt(t,n,e)))):Qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Jt(e,t,n,i){e.issues.length&&t.issues.push(...Ae(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Kt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Xt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Jt(e,n,o,t)))):Jt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const en=$("$ZodObject",((e,t)=>{gt.init(e,t);const n=de((()=>Kt(t)));he(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=ye,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Jt(n,t,e,a)))):Jt(n,t,e,a)}return o?Xt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),tn=$("$ZodObjectJIT",((e,t)=>{en.init(e,t);const n=e._zod.parse,i=de((()=>Kt(t)));let o;const r=ye,s=!x.jitless,a=s&&Pe.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Je(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ve(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ve(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Xt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function nn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Re(e,i,Z())))))}),t)}const on=$("$ZodUnion",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),he(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),he(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),he(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>pe(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>nn(t,o,e,r))):nn(a,o,e,r)}})),rn=$("$ZodIntersection",((e,t)=>{gt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>an(e,t,n))):an(e,o,r)}}));function sn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ze(e)&&ze(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=sn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=sn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function an(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=sn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const cn=$("$ZodEnum",((e,t)=>{gt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>ke.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),un=$("$ZodTransform",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new S;return n.value=o,n}}));function dn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ln=$("$ZodOptional",((e,t)=>{gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>dn(t,e.value))):dn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),pn=$("$ZodNullable",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)}|null)$`):void 0})),he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),fn=$("$ZodDefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>hn(e,t))):hn(i,t)}}));function hn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const mn=$("$ZodPrefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),gn=$("$ZodNonOptional",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>vn(t,e))):vn(o,e)}}));function vn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _n=$("$ZodCatch",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),yn=$("$ZodPipe",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>t.in._zod.values)),he(e._zod,"optin",(()=>t.in._zod.optin)),he(e._zod,"optout",(()=>t.out._zod.optout)),he(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.in,n))):Pn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.out,n))):Pn(i,t.out,n)}}));function Pn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zn=$("$ZodReadonly",((e,t)=>{gt.init(e,t),he(e._zod,"propValues",(()=>t.innerType._zod.propValues)),he(e._zod,"values",(()=>t.innerType._zod.values)),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(bn):bn(i)}}));function bn(e){return e.value=Object.freeze(e.value),e}const kn=$("$ZodCustom",((e,t)=>{Oe.init(e,t),gt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Se(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class En{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Tn(){return new En}const In=Tn();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function An(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function Cn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function Rn(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!1})}function $n(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!1})}function On(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!0})}function xn(e,t){return new De({check:"multiple_of",...Te(t),value:e})}function Zn(e,t){return new Ue({check:"max_length",...Te(t),maximum:e})}function Fn(e,t){return new Me({check:"min_length",...Te(t),minimum:e})}function Dn(e,t){return new Ge({check:"length_equals",...Te(t),length:e})}function jn(e){return new We({check:"overwrite",tx:e})}const Un=$("ZodISODateTime",((e,t)=>{Ct.init(e,t),ci.init(e,t)}));const Mn=$("ZodISODate",((e,t)=>{Rt.init(e,t),ci.init(e,t)}));const Gn=$("ZodISOTime",((e,t)=>{$t.init(e,t),ci.init(e,t)}));const Ln=$("ZodISODuration",((e,t)=>{St.init(e,t),ci.init(e,t)}));const Bn=(e,t)=>{Xe.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ue,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ue,2)}},isEmpty:{get:()=>0===e.issues.length}})},Hn=($("ZodError",Bn),$("ZodError",Bn,{Parent:Error})),Vn=tt(Hn),qn=nt(Hn),Yn=it(Hn),Qn=rt(Hn),Wn=at(Hn),Jn=ct(Hn),Kn=ut(Hn),Xn=dt(Hn),ei=lt(Hn),ti=pt(Hn),ni=ft(Hn),ii=ht(Hn),oi=$("ZodType",((e,t)=>(gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Ee(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Vn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>qn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Jn(e,t,n),e.encodeAsync=async(t,n)=>Kn(e,t,n),e.decodeAsync=async(t,n)=>Xn(e,t,n),e.safeEncode=(t,n)=>ei(e,t,n),e.safeDecode=(t,n)=>ti(e,t,n),e.safeEncodeAsync=async(t,n)=>ni(e,t,n),e.safeDecodeAsync=async(t,n)=>ii(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}(ro,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Oe({check:"custom",...Te(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Se(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Se(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(jn(t)),e.optional=()=>Qi(e),e.nullable=()=>Ji(e),e.nullish=()=>Qi(Ji(e)),e.nonoptional=t=>function(e,t){return new eo({type:"nonoptional",innerType:e,...Te(t)})}(e,t),e.array=()=>Ui(e),e.or=t=>function(e,t){return new Li({type:"union",options:e,...Te(t)})}([e,t]),e.and=t=>new Bi({type:"intersection",left:e,right:t}),e.transform=t=>io(e,qi(t)),e.default=t=>{return n=t,new Ki({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.prefault=t=>{return n=t,new Xi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.catch=t=>{return new to({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>io(e,t),e.readonly=()=>new oo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return In.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>In.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return In.get(e);const n=e.clone();return In.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ri=$("_ZodString",((e,t)=>{vt.init(e,t),oi.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Be({check:"string_format",format:"regex",...Te(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"includes",...Te(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Te(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Qe({check:"string_format",format:"ends_with",...Te(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Fn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Dn(...t)),e.nonempty=(...t)=>e.check(Fn(1,...t)),e.lowercase=t=>e.check(function(e){return new He({check:"string_format",format:"lowercase",...Te(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ve({check:"string_format",format:"uppercase",...Te(e)})}(t)),e.trim=()=>e.check(jn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return jn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(jn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(jn((e=>e.toUpperCase())))})),si=$("ZodString",((e,t)=>{vt.init(e,t),ri.init(e,t),e.email=t=>e.check(Nn(ui,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}(fi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}(hi,t)),e.guid=t=>e.check(An(li,t)),e.uuid=t=>e.check(Cn(pi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}(pi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}(pi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}(pi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}(mi,t)),e.guid=t=>e.check(An(li,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}(gi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}(vi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}(_i,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}(Ei,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}(Ti,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}(yi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}(Pi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}(zi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}(bi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}(ki,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}(Ii,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}(Un,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}(Mn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}(Gn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}(Ln,e)}(t))}));function ai(e){return function(e,t){return new e({type:"string",...Te(t)})}(si,e)}const ci=$("ZodStringFormat",((e,t)=>{_t.init(e,t),ri.init(e,t)})),ui=$("ZodEmail",((e,t)=>{zt.init(e,t),ci.init(e,t)}));function di(e){return Nn(ui,e)}const li=$("ZodGUID",((e,t)=>{yt.init(e,t),ci.init(e,t)})),pi=$("ZodUUID",((e,t)=>{Pt.init(e,t),ci.init(e,t)})),fi=$("ZodURL",((e,t)=>{bt.init(e,t),ci.init(e,t)})),hi=$("ZodEmoji",((e,t)=>{kt.init(e,t),ci.init(e,t)})),mi=$("ZodNanoID",((e,t)=>{wt.init(e,t),ci.init(e,t)})),gi=$("ZodCUID",((e,t)=>{Et.init(e,t),ci.init(e,t)})),vi=$("ZodCUID2",((e,t)=>{Tt.init(e,t),ci.init(e,t)})),_i=$("ZodULID",((e,t)=>{It.init(e,t),ci.init(e,t)})),yi=$("ZodXID",((e,t)=>{Nt.init(e,t),ci.init(e,t)})),Pi=$("ZodKSUID",((e,t)=>{At.init(e,t),ci.init(e,t)})),zi=$("ZodIPv4",((e,t)=>{Ot.init(e,t),ci.init(e,t)})),bi=$("ZodIPv6",((e,t)=>{xt.init(e,t),ci.init(e,t)})),ki=$("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ci.init(e,t)})),wi=$("ZodCIDRv6",((e,t)=>{Ft.init(e,t),ci.init(e,t)})),Ei=$("ZodBase64",((e,t)=>{jt.init(e,t),ci.init(e,t)})),Ti=$("ZodBase64URL",((e,t)=>{Ut.init(e,t),ci.init(e,t)})),Ii=$("ZodE164",((e,t)=>{Mt.init(e,t),ci.init(e,t)})),Ni=$("ZodJWT",((e,t)=>{Gt.init(e,t),ci.init(e,t)})),Ai=$("ZodNumber",((e,t)=>{Lt.init(e,t),oi.init(e,t),e.gt=(t,n)=>e.check(Sn(t,n)),e.gte=(t,n)=>e.check(On(t,n)),e.min=(t,n)=>e.check(On(t,n)),e.lt=(t,n)=>e.check(Rn(t,n)),e.lte=(t,n)=>e.check($n(t,n)),e.max=(t,n)=>e.check($n(t,n)),e.int=t=>e.check($i(t)),e.safe=t=>e.check($i(t)),e.positive=t=>e.check(Sn(0,t)),e.nonnegative=t=>e.check(On(0,t)),e.negative=t=>e.check(Rn(0,t)),e.nonpositive=t=>e.check($n(0,t)),e.multipleOf=(t,n)=>e.check(xn(t,n)),e.step=(t,n)=>e.check(xn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ci(e){return function(e,t){return new e({type:"number",checks:[],...Te(t)})}(Ai,e)}const Ri=$("ZodNumberFormat",((e,t)=>{Bt.init(e,t),Ai.init(e,t)}));function $i(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Te(t)})}(Ri,e)}const Si=$("ZodBoolean",((e,t)=>{Ht.init(e,t),oi.init(e,t)}));const Oi=$("ZodUnknown",((e,t)=>{Vt.init(e,t),oi.init(e,t)}));function xi(){return new Oi({type:"unknown"})}const Zi=$("ZodNever",((e,t)=>{qt.init(e,t),oi.init(e,t)}));function Fi(e){return function(e,t){return new e({type:"never",...Te(t)})}(Zi,e)}const Di=$("ZodDate",((e,t)=>{Yt.init(e,t),oi.init(e,t),e.min=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check($n(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const ji=$("ZodArray",((e,t)=>{Wt.init(e,t),oi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Fn(t,n)),e.nonempty=t=>e.check(Fn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Dn(t,n)),e.unwrap=()=>e.element}));function Ui(e,t){return function(e,t,n){return new e({type:"array",element:t,...Te(n)})}(ji,e,t)}const Mi=$("ZodObject",((e,t)=>{tn.init(e,t),oi.init(e,t),he(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hi({type:"enum",entries:n,...Te(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xi()}),e.loose=()=>e.clone({...e._zod.def,catchall:xi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:[]});return Ee(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:e._zod.def.checks};return Ee(e,n)}(e,t),e.merge=t=>function(e,t){const n=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return me(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Ee(e,ge(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return me(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=ge(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return me(this,"shape",i),i},checks:[]});return Ee(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(eo,e,t[0])}));function Gi(e,t){const n={type:"object",get shape(){var t;return me(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Te(t)};return new Mi(n)}const Li=$("ZodUnion",((e,t)=>{on.init(e,t),oi.init(e,t),e.options=t.options}));const Bi=$("ZodIntersection",((e,t)=>{rn.init(e,t),oi.init(e,t)})),Hi=$("ZodEnum",((e,t)=>{cn.init(e,t),oi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Hi({...t,checks:[],...Te(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hi({...t,checks:[],...Te(i),entries:o})}}));const Vi=$("ZodTransform",((e,t)=>{un.init(e,t),oi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Se(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Se(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function qi(e){return new Vi({type:"transform",transform:e})}const Yi=$("ZodOptional",((e,t)=>{ln.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Yi({type:"optional",innerType:e})}const Wi=$("ZodNullable",((e,t)=>{pn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ji(e){return new Wi({type:"nullable",innerType:e})}const Ki=$("ZodDefault",((e,t)=>{fn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Xi=$("ZodPrefault",((e,t)=>{mn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=$("ZodNonOptional",((e,t)=>{gn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),to=$("ZodCatch",((e,t)=>{_n.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),no=$("ZodPipe",((e,t)=>{yn.init(e,t),oi.init(e,t),e.in=t.in,e.out=t.out}));function io(e,t){return new no({type:"pipe",in:e,out:t})}const oo=$("ZodReadonly",((e,t)=>{zn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ro=$("ZodCustom",((e,t)=>{kn.init(e,t),oi.init(e,t)}));function so(e,t){return io(qi(e),t)}function ao(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const co=e=>so((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),uo=e=>so((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),lo=e=>ai().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),po=()=>di("Invalid email address").min(1,"Required"),fo=()=>co(Ci("Valid amount required").positive("Positive amount required")),ho=()=>uo(function(e){return function(e,t){return new e({type:"date",...Te(t)})}(Di,e)}("Valid date required").min(new Date,"Date must be in the future")),mo=e=>ai().max(e,`Maximum length is ${e} characters`),go=Gi({address1:lo(100),address2:mo(100).optional(),city:lo(50),state:mo(50).optional(),postcode:mo(20).optional(),country:lo(50)}),vo=Gi({amount:fo(),message:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),giverAddress:go,cardHolder:lo(101),recipientFirstName:mo(50).nullish(),recipientLastName:mo(50).nullish(),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),_o=vo.extend({expiry:ho(),notes:mo(500).nullish()}),yo=Gi({balance:fo(),expiry:ho(),message:mo(500).nullish(),notes:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),cardHolder:lo(101),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),Po=vo.extend({companyId:Ci().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Te(t)})}(Si,e)}().default(!0),payment:Gi({cardHolder:lo(30),cardNumberToken:lo(50),cardExpiry:lo(5),cardCvcToken:lo(50)}).optional()}),zo=Gi({companyId:Ci().int().positive().nullish(),code:lo(10),password:lo(10)}),bo=zo.extend({amount:fo(),description:lo(200)});let ko,wo;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(ko||(ko={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(wo||(wo={}));const Eo=Gi({code:lo(10),token:lo(128)}),To=Gi({companyId:Ci().int().positive(),code:lo(10),token:lo(128)}),Io=Gi({grant_type:ai().readonly().default("refresh_token"),client_id:Cn(pi,undefined),client_secret:ai(),refresh_token:ai(),scope:ai().optional()});const No=Gi({email:di(),firstName:ai().max(100).optional(),lastName:ai().max(100).optional(),phone:ai().max(20).optional(),scopes:Ui(ai()).optional()});let Ao,Co,Ro;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(Ao||(Ao={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Co||(Co={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(Ro||(Ro={}));const $o=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},So=require("decimal.js");var Oo=e.n(So);const xo=e=>new(Oo())(e).toDecimalPlaces(2).toNumber();function Zo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=xo(n);switch(e.feeType){case A.PercentageOfBooking:if(o)return xo(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return xo(a/(1-t)*e.amount/(100+e.amount))}return xo(a*(e.amount/100));case A.FixedChargePerRoom:case A.FixedChargePerBooking:return e.amount;case A.NightlyChargePerRoom:return xo(e.amount*i);default:return 0}}const Fo=[A.FixedChargePerBooking],Do=[A.PercentageOfBooking,A.FixedChargePerRoom,A.NightlyChargePerRoom],jo=[A.PercentageOfBooking];function Uo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Mo(e){return Uo(e,Fo)}function Go(e){return Uo(e,Do)}function Lo(e){return Uo(e,jo)}function Bo(e){return{includeInRates:[A.PercentageOfBooking,A.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===A.PercentageOfBooking,appliesToAddons:e===A.PercentageOfBooking,includePreviousFeesInCalculation:e===A.PercentageOfBooking}}const Ho=e=>e,Vo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},qo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Yo{}function Qo(e){return e.toUpperCase()}Yo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===C.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===C.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return R.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Yo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Yo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),R.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Yo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Yo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Yo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Yo.calculateReservationAddonTotal(o,t)?.total}})),xo(n)},module.exports=t})();
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n,i,o,r,a;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>S,AddGiftCardSchema:()=>_o,BaseGiftCardSchema:()=>yo,CancelGiftCardTransactionSchema:()=>Io,CompleteGiftCardTransactionSchema:()=>To,DATE_FORMAT:()=>A,EAddonPricingType:()=>R,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>C,EGiftCardTransactionType:()=>wo,EGuaranteePolicyDepositMode:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Ro,ELogSeverity:()=>Co,ELogType:()=>So,EPlanpayBookingStatus:()=>a,EPromoCodeDiscountType:()=>w,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>y,ERMSSyncStrategy:()=>_,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,ETransactionStatus:()=>Eo,EditGiftCardSchema:()=>Po,GuestProfile:()=>d,HttpMethod:()=>T,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>vo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>s,Package:()=>I,PurchaseGiftCardSchema:()=>zo,RedeemGiftCardSchema:()=>ko,RefreshGiftCardTokenSchema:()=>No,RegisterGiftCardAdminSchema:()=>Ao,Reservation:()=>u,ReservedPackage:()=>N,TotalCalculator:()=>Yo,ValidateGiftCardSchema:()=>bo,calculateFeeAmount:()=>Fo,calculateTotalForMemberBooking:()=>$o,getFeeOptionValidity:()=>Ho,getFilteredBookingAddonFees:()=>Bo,getFilteredBookingFees:()=>Go,getFilteredBookingRateFees:()=>Lo,maxString:()=>go,nameof:()=>Vo,preprocessDate:()=>lo,preprocessNumber:()=>uo,requireEmail:()=>fo,requireFutureDate:()=>mo,requirePositiveAmount:()=>ho,requireString:()=>po,resizeRoomstayImageUrl:()=>qo,roundMoney:()=>Zo,subset:()=>Qo,uppercaseString:()=>Wo,validateFormWithZod:()=>co}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(a||(a={}));const s=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,y,_,P,z,b,k,w,E,T;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(y||(y={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(_||(_={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class I{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class N extends I{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.hideQuantity=!1,this.order=void 0,this.discount=void 0,this.total=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.FlatPercent="flatPercent",e.FlatQuantity="flatQuantity",e.FlatQuantityPerStay="flatQuantityPerStay"}(w||(w={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(T||(T={}));const A="DD/MM/YYYY";let C,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(C||(C={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(R||(R={}));const S=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function $(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in a.prototype)e in n||Object.defineProperty(n,e,{value:a.prototype[e].bind(n)});n._zod.constr=a,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function a(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}Object.freeze({status:"aborted"}),Symbol("zod_brand");class O extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Z={};function F(e){return e&&Object.assign(Z,e),Z}const D=/^[cC][^\s-]{8,}$/,j=/^[0-9a-z]+$/,U=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,M=/^[0-9a-vA-V]{20}$/,G=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,B=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,V=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Q=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,q=/^(?:(?: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])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,W=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,J=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,K=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X=/^[A-Za-z0-9_-]*$/,ee=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,te=/^\+(?:[0-9]){6,14}[0-9]$/,ne="(?:(?:\\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])))",ie=new RegExp(`^${ne}$`);function oe(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const re=/^\d+$/,ae=/^-?\d+(?:\.\d+)?/i,se=/true|false/i,ce=/^[^A-Z]*$/,ue=/^[^a-z]*$/;function de(e,t){return"bigint"==typeof t?t.toString():t}function le(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function pe(e){return null==e}function fe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const he=Symbol("evaluating");function me(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==he)return void 0===i&&(i=he,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ve(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ye(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ze=le((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function be(e){if(!1===Pe(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Pe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ke(e){return be(e)?{...e}:e}const we=new Set(["string","number","symbol"]);function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Te(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ie(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Ne={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ae(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ce(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Re(e){return"string"==typeof e?e:e?.message}function Se(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Oe(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const xe=$("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ze={number:"number",bigint:"bigint",object:"date"},Fe=$("$ZodCheckLessThan",((e,t)=>{xe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),De=$("$ZodCheckGreaterThan",((e,t)=>{xe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),je=$("$ZodCheckMultipleOf",((e,t)=>{xe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),Ue=$("$ZodCheckNumberFormat",((e,t)=>{xe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ne[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=re)})),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>r&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:r,inst:e})}})),Me=$("$ZodCheckMaxLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!pe(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=$e(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ge=$("$ZodCheckMinLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!pe(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=$e(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=$("$ZodCheckLengthEquals",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!pe(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=$e(i),a=o>t.length;n.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Be=$("$ZodCheckStringFormat",((e,t)=>{var n,i;xe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),He=$("$ZodCheckRegex",((e,t)=>{Be.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),Ve=$("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ce),Be.init(e,t)})),Qe=$("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ue),Be.init(e,t)})),qe=$("$ZodCheckIncludes",((e,t)=>{xe.init(e,t);const n=Ee(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),Ye=$("$ZodCheckStartsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`^${Ee(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),We=$("$ZodCheckEndsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`.*${Ee(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),Je=$("$ZodCheckOverwrite",((e,t)=>{xe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Ke{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Xe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,de,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},et=$("$ZodError",Xe),tt=$("$ZodError",Xe,{Parent:Error}),nt=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new O;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Se(e,r,F()))));throw _e(t,o?.callee),t}return a.value},it=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Se(e,r,F()))));throw _e(t,o?.callee),t}return a.value},ot=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new O;return r.issues.length?{success:!1,error:new(e??et)(r.issues.map((e=>Se(e,o,F()))))}:{success:!0,data:r.value}},rt=ot(tt),at=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Se(e,o,F()))))}:{success:!0,data:r.value}},st=at(tt),ct=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},ut=e=>(t,n,i)=>nt(e)(t,n,i),dt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return it(e)(t,n,o)},lt=e=>async(t,n,i)=>it(e)(t,n,i),pt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>(t,n,i)=>ot(e)(t,n,i),ht=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return at(e)(t,n,o)},mt=e=>async(t,n,i)=>at(e)(t,n,i),gt={major:4,minor:1,patch:5},vt=$("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ae(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=r._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new O;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Ae(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ae(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ae(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new O;return a.then((t=>e._zod.parse(t,r)))}return e._zod.parse(a,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const a=e._zod.parse(o,r);if(a instanceof Promise){if(!1===r.async)throw new O;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=rt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return st(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),yt=$("$ZodString",((e,t)=>{var n;vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),_t=$("$ZodStringFormat",((e,t)=>{Be.init(e,t),yt.init(e,t)})),Pt=$("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),_t.init(e,t)})),zt=$("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=V(e))}else t.pattern??(t.pattern=V());_t.init(e,t)})),bt=$("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=Q),_t.init(e,t)})),kt=$("$ZodURL",((e,t)=>{_t.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ee.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),wt=$("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t.init(e,t)})),Et=$("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),_t.init(e,t)})),Tt=$("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=D),_t.init(e,t)})),It=$("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=j),_t.init(e,t)})),Nt=$("$ZodULID",((e,t)=>{t.pattern??(t.pattern=U),_t.init(e,t)})),At=$("$ZodXID",((e,t)=>{t.pattern??(t.pattern=M),_t.init(e,t)})),Ct=$("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=G),_t.init(e,t)})),Rt=$("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=oe({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${ne}T(?:${i})$`)}(t)),_t.init(e,t)})),St=$("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ie),_t.init(e,t)})),$t=$("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${oe(t)}$`)),_t.init(e,t)})),Ot=$("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=B),_t.init(e,t)})),xt=$("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=q),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Zt=$("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Ft=$("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=W),_t.init(e,t)})),Dt=$("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=J),_t.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function jt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ut=$("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=K),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{jt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Mt=$("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=X),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!X.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return jt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Gt=$("$ZodE164",((e,t)=>{t.pattern??(t.pattern=te),_t.init(e,t)})),Lt=$("$ZodJWT",((e,t)=>{_t.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Bt=$("$ZodNumber",((e,t)=>{vt.init(e,t),e._zod.pattern=e._zod.bag.pattern??ae,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Ht=$("$ZodNumber",((e,t)=>{Ue.init(e,t),Bt.init(e,t)})),Vt=$("$ZodBoolean",((e,t)=>{vt.init(e,t),e._zod.pattern=se,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Qt=$("$ZodUnknown",((e,t)=>{vt.init(e,t),e._zod.parse=e=>e})),qt=$("$ZodNever",((e,t)=>{vt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=$("$ZodDate",((e,t)=>{vt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Wt(e,t,n){e.issues.length&&t.issues.push(...Ce(n,e.issues)),t.value[n]=e.value}const Jt=$("$ZodArray",((e,t)=>{vt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const a=o[e],s=t.element._zod.run({value:a,issues:[]},i);s instanceof Promise?r.push(s.then((t=>Wt(t,n,e)))):Wt(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Kt(e,t,n,i){e.issues.length&&t.issues.push(...Ce(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Xt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function en(e,t,n,i,o,r){const a=[],s=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(s.has(o))continue;if("never"===u){a.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Kt(e,n,o,t)))):Kt(r,n,o,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const tn=$("$ZodObject",((e,t)=>{vt.init(e,t);const n=le((()=>Xt(t)));me(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=Pe,o=t.catchall;let r;e._zod.parse=(t,a)=>{r??(r=n.value);const s=t.value;if(!i(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:s[e],issues:[]},a);n instanceof Promise?c.push(n.then((n=>Kt(n,t,e,s)))):Kt(n,t,e,s)}return o?en(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),nn=$("$ZodObjectJIT",((e,t)=>{tn.init(e,t);const n=e._zod.parse,i=le((()=>Xt(t)));let o;const r=Pe,a=!Z.jitless,s=a&&ze.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?a&&s&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Ke(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ye(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let a=0;for(const e of n.keys)r[e]="key_"+a++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ye(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),d=o(d,l),c?en([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function on(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ae(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Se(e,i,F())))))}),t)}const rn=$("$ZodUnion",((e,t)=>{vt.init(e,t),me(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),me(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),me(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),me(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>fe(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let a=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then((t=>on(t,o,e,r))):on(s,o,e,r)}})),an=$("$ZodIntersection",((e,t)=>{vt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>cn(e,t,n))):cn(e,o,r)}}));function sn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(be(e)&&be(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=sn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=sn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function cn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ae(e))return e;const i=sn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const un=$("$ZodEnum",((e,t)=>{vt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>we.has(typeof e))).map((e=>"string"==typeof e?Ee(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),dn=$("$ZodTransform",((e,t)=>{vt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new O;return n.value=o,n}}));function ln(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const pn=$("$ZodOptional",((e,t)=>{vt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",me(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),me(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${fe(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>ln(t,e.value))):ln(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),fn=$("$ZodNullable",((e,t)=>{vt.init(e,t),me(e._zod,"optin",(()=>t.innerType._zod.optin)),me(e._zod,"optout",(()=>t.innerType._zod.optout)),me(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${fe(e.source)}|null)$`):void 0})),me(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),hn=$("$ZodDefault",((e,t)=>{vt.init(e,t),e._zod.optin="optional",me(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>mn(e,t))):mn(i,t)}}));function mn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const gn=$("$ZodPrefault",((e,t)=>{vt.init(e,t),e._zod.optin="optional",me(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),vn=$("$ZodNonOptional",((e,t)=>{vt.init(e,t),me(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>yn(t,e))):yn(o,e)}}));function yn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _n=$("$ZodCatch",((e,t)=>{vt.init(e,t),me(e._zod,"optin",(()=>t.innerType._zod.optin)),me(e._zod,"optout",(()=>t.innerType._zod.optout)),me(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Se(e,n,F())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Se(e,n,F())))},input:e.value}),e.issues=[]),e)}})),Pn=$("$ZodPipe",((e,t)=>{vt.init(e,t),me(e._zod,"values",(()=>t.in._zod.values)),me(e._zod,"optin",(()=>t.in._zod.optin)),me(e._zod,"optout",(()=>t.out._zod.optout)),me(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>zn(e,t.in,n))):zn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>zn(e,t.out,n))):zn(i,t.out,n)}}));function zn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const bn=$("$ZodReadonly",((e,t)=>{vt.init(e,t),me(e._zod,"propValues",(()=>t.innerType._zod.propValues)),me(e._zod,"values",(()=>t.innerType._zod.values)),me(e._zod,"optin",(()=>t.innerType._zod.optin)),me(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(kn):kn(i)}}));function kn(e){return e.value=Object.freeze(e.value),e}const wn=$("$ZodCustom",((e,t)=>{xe.init(e,t),vt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>En(t,n,i,e)));En(o,n,i,e)}}));function En(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Oe(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Tn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function In(){return new Tn}const Nn=In();function An(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(t)})}function Cn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(t)})}function Rn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(t)})}function Sn(e,t){return new Fe({check:"less_than",...Ie(t),value:e,inclusive:!1})}function $n(e,t){return new Fe({check:"less_than",...Ie(t),value:e,inclusive:!0})}function On(e,t){return new De({check:"greater_than",...Ie(t),value:e,inclusive:!1})}function xn(e,t){return new De({check:"greater_than",...Ie(t),value:e,inclusive:!0})}function Zn(e,t){return new je({check:"multiple_of",...Ie(t),value:e})}function Fn(e,t){return new Me({check:"max_length",...Ie(t),maximum:e})}function Dn(e,t){return new Ge({check:"min_length",...Ie(t),minimum:e})}function jn(e,t){return new Le({check:"length_equals",...Ie(t),length:e})}function Un(e){return new Je({check:"overwrite",tx:e})}const Mn=$("ZodISODateTime",((e,t)=>{Rt.init(e,t),ui.init(e,t)}));const Gn=$("ZodISODate",((e,t)=>{St.init(e,t),ui.init(e,t)}));const Ln=$("ZodISOTime",((e,t)=>{$t.init(e,t),ui.init(e,t)}));const Bn=$("ZodISODuration",((e,t)=>{Ot.init(e,t),ui.init(e,t)}));const Hn=(e,t)=>{et.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}},isEmpty:{get:()=>0===e.issues.length}})},Vn=($("ZodError",Hn),$("ZodError",Hn,{Parent:Error})),Qn=nt(Vn),qn=it(Vn),Yn=ot(Vn),Wn=at(Vn),Jn=ct(Vn),Kn=ut(Vn),Xn=dt(Vn),ei=lt(Vn),ti=pt(Vn),ni=ft(Vn),ii=ht(Vn),oi=mt(Vn),ri=$("ZodType",((e,t)=>(vt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Te(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Qn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>qn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Jn(e,t,n),e.decode=(t,n)=>Kn(e,t,n),e.encodeAsync=async(t,n)=>Xn(e,t,n),e.decodeAsync=async(t,n)=>ei(e,t,n),e.safeEncode=(t,n)=>ti(e,t,n),e.safeDecode=(t,n)=>ni(e,t,n),e.safeEncodeAsync=async(t,n)=>ii(e,t,n),e.safeDecodeAsync=async(t,n)=>oi(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ie(n)})}(ao,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new xe({check:"custom",...Ie(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Oe(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Oe(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Un(t)),e.optional=()=>Wi(e),e.nullable=()=>Ki(e),e.nullish=()=>Wi(Ki(e)),e.nonoptional=t=>function(e,t){return new to({type:"nonoptional",innerType:e,...Ie(t)})}(e,t),e.array=()=>Mi(e),e.or=t=>function(e,t){return new Bi({type:"union",options:e,...Ie(t)})}([e,t]),e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>oo(e,qi(t)),e.default=t=>{return n=t,new Xi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ke(n)}});var n},e.prefault=t=>{return n=t,new eo({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ke(n)}});var n},e.catch=t=>{return new no({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>oo(e,t),e.readonly=()=>new ro({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Nn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Nn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Nn.get(e);const n=e.clone();return Nn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ai=$("_ZodString",((e,t)=>{yt.init(e,t),ri.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"regex",...Ie(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"includes",...Ie(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Ie(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new We({check:"string_format",format:"ends_with",...Ie(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Dn(...t)),e.max=(...t)=>e.check(Fn(...t)),e.length=(...t)=>e.check(jn(...t)),e.nonempty=(...t)=>e.check(Dn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ve({check:"string_format",format:"lowercase",...Ie(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Qe({check:"string_format",format:"uppercase",...Ie(e)})}(t)),e.trim=()=>e.check(Un((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Un((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Un((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Un((e=>e.toUpperCase())))})),si=$("ZodString",((e,t)=>{yt.init(e,t),ai.init(e,t),e.email=t=>e.check(An(di,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(t)})}(hi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(t)})}(Ai,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(t)})}(mi,t)),e.guid=t=>e.check(Cn(pi,t)),e.uuid=t=>e.check(Rn(fi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(t)})}(fi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(t)})}(fi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(t)})}(fi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(t)})}(gi,t)),e.guid=t=>e.check(Cn(pi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(t)})}(vi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(t)})}(yi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(t)})}(_i,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(t)})}(Ti,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(t)})}(Ii,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(t)})}(Pi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(t)})}(zi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(t)})}(bi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(t)})}(ki,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(t)})}(wi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(t)})}(Ei,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(t)})}(Ni,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(t)})}(Mn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ie(t)})}(Gn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ie(t)})}(Bn,e)}(t))}));function ci(e){return function(e,t){return new e({type:"string",...Ie(t)})}(si,e)}const ui=$("ZodStringFormat",((e,t)=>{_t.init(e,t),ai.init(e,t)})),di=$("ZodEmail",((e,t)=>{bt.init(e,t),ui.init(e,t)}));function li(e){return An(di,e)}const pi=$("ZodGUID",((e,t)=>{Pt.init(e,t),ui.init(e,t)})),fi=$("ZodUUID",((e,t)=>{zt.init(e,t),ui.init(e,t)})),hi=$("ZodURL",((e,t)=>{kt.init(e,t),ui.init(e,t)})),mi=$("ZodEmoji",((e,t)=>{wt.init(e,t),ui.init(e,t)})),gi=$("ZodNanoID",((e,t)=>{Et.init(e,t),ui.init(e,t)})),vi=$("ZodCUID",((e,t)=>{Tt.init(e,t),ui.init(e,t)})),yi=$("ZodCUID2",((e,t)=>{It.init(e,t),ui.init(e,t)})),_i=$("ZodULID",((e,t)=>{Nt.init(e,t),ui.init(e,t)})),Pi=$("ZodXID",((e,t)=>{At.init(e,t),ui.init(e,t)})),zi=$("ZodKSUID",((e,t)=>{Ct.init(e,t),ui.init(e,t)})),bi=$("ZodIPv4",((e,t)=>{xt.init(e,t),ui.init(e,t)})),ki=$("ZodIPv6",((e,t)=>{Zt.init(e,t),ui.init(e,t)})),wi=$("ZodCIDRv4",((e,t)=>{Ft.init(e,t),ui.init(e,t)})),Ei=$("ZodCIDRv6",((e,t)=>{Dt.init(e,t),ui.init(e,t)})),Ti=$("ZodBase64",((e,t)=>{Ut.init(e,t),ui.init(e,t)})),Ii=$("ZodBase64URL",((e,t)=>{Mt.init(e,t),ui.init(e,t)})),Ni=$("ZodE164",((e,t)=>{Gt.init(e,t),ui.init(e,t)})),Ai=$("ZodJWT",((e,t)=>{Lt.init(e,t),ui.init(e,t)})),Ci=$("ZodNumber",((e,t)=>{Bt.init(e,t),ri.init(e,t),e.gt=(t,n)=>e.check(On(t,n)),e.gte=(t,n)=>e.check(xn(t,n)),e.min=(t,n)=>e.check(xn(t,n)),e.lt=(t,n)=>e.check(Sn(t,n)),e.lte=(t,n)=>e.check($n(t,n)),e.max=(t,n)=>e.check($n(t,n)),e.int=t=>e.check($i(t)),e.safe=t=>e.check($i(t)),e.positive=t=>e.check(On(0,t)),e.nonnegative=t=>e.check(xn(0,t)),e.negative=t=>e.check(Sn(0,t)),e.nonpositive=t=>e.check($n(0,t)),e.multipleOf=(t,n)=>e.check(Zn(t,n)),e.step=(t,n)=>e.check(Zn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ri(e){return function(e,t){return new e({type:"number",checks:[],...Ie(t)})}(Ci,e)}const Si=$("ZodNumberFormat",((e,t)=>{Ht.init(e,t),Ci.init(e,t)}));function $i(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ie(t)})}(Si,e)}const Oi=$("ZodBoolean",((e,t)=>{Vt.init(e,t),ri.init(e,t)}));const xi=$("ZodUnknown",((e,t)=>{Qt.init(e,t),ri.init(e,t)}));function Zi(){return new xi({type:"unknown"})}const Fi=$("ZodNever",((e,t)=>{qt.init(e,t),ri.init(e,t)}));function Di(e){return function(e,t){return new e({type:"never",...Ie(t)})}(Fi,e)}const ji=$("ZodDate",((e,t)=>{Yt.init(e,t),ri.init(e,t),e.min=(t,n)=>e.check(xn(t,n)),e.max=(t,n)=>e.check($n(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const Ui=$("ZodArray",((e,t)=>{Jt.init(e,t),ri.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Dn(t,n)),e.nonempty=t=>e.check(Dn(1,t)),e.max=(t,n)=>e.check(Fn(t,n)),e.length=(t,n)=>e.check(jn(t,n)),e.unwrap=()=>e.element}));function Mi(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ie(n)})}(Ui,e,t)}const Gi=$("ZodObject",((e,t)=>{nn.init(e,t),ri.init(e,t),me(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Vi({type:"enum",entries:n,...Ie(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Di()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!be(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ve(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return ge(this,"shape",n),n},checks:[]});return Te(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!be(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return ge(this,"shape",n),n},checks:e._zod.def.checks};return Te(e,n)}(e,t),e.merge=t=>function(e,t){const n=ve(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ge(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Te(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Te(e,ve(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return ge(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=ve(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return ge(this,"shape",i),i},checks:[]});return Te(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=ve(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return ge(this,"shape",o),o},checks:[]});return Te(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=ve(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return ge(this,"shape",o),o},checks:[]});return Te(t,i)}(to,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return ge(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ie(t)};return new Gi(n)}const Bi=$("ZodUnion",((e,t)=>{rn.init(e,t),ri.init(e,t),e.options=t.options}));const Hi=$("ZodIntersection",((e,t)=>{an.init(e,t),ri.init(e,t)})),Vi=$("ZodEnum",((e,t)=>{un.init(e,t),ri.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Vi({...t,checks:[],...Ie(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Vi({...t,checks:[],...Ie(i),entries:o})}}));const Qi=$("ZodTransform",((e,t)=>{dn.init(e,t),ri.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Oe(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Oe(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function qi(e){return new Qi({type:"transform",transform:e})}const Yi=$("ZodOptional",((e,t)=>{pn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Wi(e){return new Yi({type:"optional",innerType:e})}const Ji=$("ZodNullable",((e,t)=>{fn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ki(e){return new Ji({type:"nullable",innerType:e})}const Xi=$("ZodDefault",((e,t)=>{hn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),eo=$("ZodPrefault",((e,t)=>{gn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType})),to=$("ZodNonOptional",((e,t)=>{vn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType})),no=$("ZodCatch",((e,t)=>{_n.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),io=$("ZodPipe",((e,t)=>{Pn.init(e,t),ri.init(e,t),e.in=t.in,e.out=t.out}));function oo(e,t){return new io({type:"pipe",in:e,out:t})}const ro=$("ZodReadonly",((e,t)=>{bn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ao=$("ZodCustom",((e,t)=>{wn.init(e,t),ri.init(e,t)}));function so(e,t){return oo(qi(e),t)}function co(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const uo=e=>so((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),lo=e=>so((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),po=e=>ci().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),fo=()=>li("Invalid email address").min(1,"Required"),ho=()=>uo(Ri("Valid amount required").positive("Positive amount required")),mo=()=>lo(function(e){return function(e,t){return new e({type:"date",...Ie(t)})}(ji,e)}("Valid date required").min(new Date,"Date must be in the future")),go=e=>ci().max(e,`Maximum length is ${e} characters`),vo=Li({address1:po(100),address2:go(100).optional(),city:po(50),state:go(50).optional(),postcode:go(20).optional(),country:po(50)}),yo=Li({amount:ho(),message:go(500).nullish(),giverFirstName:po(50),giverLastName:po(50),giverEmail:fo(),giverPhone:po(31),giverAddress:vo,cardHolder:po(101),recipientFirstName:go(50).nullish(),recipientLastName:go(50).nullish(),recipientEmail:li("Invalid email address").nullish(),recipientPhone:go(31).nullish()}),_o=yo.extend({expiry:mo(),notes:go(500).nullish()}),Po=Li({balance:ho(),expiry:mo(),message:go(500).nullish(),notes:go(500).nullish(),giverFirstName:po(50),giverLastName:po(50),giverEmail:fo(),giverPhone:po(31),cardHolder:po(101),recipientEmail:li("Invalid email address").nullish(),recipientPhone:go(31).nullish()}),zo=yo.extend({companyId:Ri().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ie(t)})}(Oi,e)}().default(!0),payment:Li({cardHolder:po(30),cardNumberToken:po(50),cardExpiry:po(5),cardCvcToken:po(50)}).optional()}),bo=Li({companyId:Ri().int().positive().nullish(),code:po(10),password:po(10)}),ko=bo.extend({amount:ho(),description:po(200)});let wo,Eo;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(wo||(wo={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(Eo||(Eo={}));const To=Li({code:po(10),token:po(128)}),Io=Li({companyId:Ri().int().positive(),code:po(10),token:po(128)}),No=Li({grant_type:ci().readonly().default("refresh_token"),client_id:Rn(fi,undefined),client_secret:ci(),refresh_token:ci(),scope:ci().optional()});const Ao=Li({email:li(),firstName:ci().max(100).optional(),lastName:ci().max(100).optional(),phone:ci().max(20).optional(),scopes:Mi(ci()).optional()});let Co,Ro,So;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(Co||(Co={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Ro||(Ro={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(So||(So={}));const $o=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},Oo=require("decimal.js");var xo=e.n(Oo);const Zo=e=>new(xo())(e).toDecimalPlaces(2).toNumber();function Fo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=Zo(n);switch(e.feeType){case C.PercentageOfBooking:if(o)return Zo(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return Zo(s/(1-t)*e.amount/(100+e.amount))}return Zo(s*(e.amount/100));case C.FixedChargePerRoom:case C.FixedChargePerBooking:return e.amount;case C.NightlyChargePerRoom:return Zo(e.amount*i);default:return 0}}const Do=[C.FixedChargePerBooking],jo=[C.PercentageOfBooking,C.FixedChargePerRoom,C.NightlyChargePerRoom],Uo=[C.PercentageOfBooking];function Mo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Go(e){return Mo(e,Do)}function Lo(e){return Mo(e,jo)}function Bo(e){return Mo(e,Uo)}function Ho(e){return{includeInRates:[C.PercentageOfBooking,C.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===C.PercentageOfBooking,appliesToAddons:e===C.PercentageOfBooking,includePreviousFeesInCalculation:e===C.PercentageOfBooking}}const Vo=e=>e,Qo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},qo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Yo{}function Wo(e){return e.toUpperCase()}Yo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return S.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Yo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Yo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),S.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Yo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Yo.calculateBaseAddonTotal(n,t);let o,r=n.discount||0;o=void 0!==n.total&&null!==n.total?n.total:i.addonTotal-r;let a=n.fees||0;n.itemisedFees?.length&&(a=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const s=n.itemisedFees?.length?o:o+a;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+a,total:e.total+o+a,displayPrice:e.displayPrice+s}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Yo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Yo.calculateReservationAddonTotal(o,t)?.total}})),Zo(n)},module.exports=t})();
|
|
@@ -22,6 +22,7 @@ export type IAddonPriceDetails = {
|
|
|
22
22
|
adultFees?: IAddonPriceDetailsFee[];
|
|
23
23
|
childFees?: IAddonPriceDetailsFee[];
|
|
24
24
|
fees?: IAddonPriceDetailsFee[];
|
|
25
|
+
discount?: number;
|
|
25
26
|
pricingType: EAddonPricingType;
|
|
26
27
|
};
|
|
27
28
|
export type IAddonPriceDetailsFee = {
|
|
@@ -49,5 +50,6 @@ export type BasketAddonDTO = {
|
|
|
49
50
|
fees?: SimpleItemisedFee[];
|
|
50
51
|
adultFees?: SimpleItemisedFee[];
|
|
51
52
|
childFees?: SimpleItemisedFee[];
|
|
53
|
+
discount?: number;
|
|
52
54
|
nights?: number;
|
|
53
55
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Warning } from '../index.js';
|
|
2
2
|
import { IItemisedBookingFeeResponse } from '../Booking/Itinerary.types';
|
|
3
3
|
import { EGuaranteePolicyDepositMode } from '../Policies/EGuaranteePolicy.enum';
|
|
4
|
+
import { EPromoCodeDiscountType } from '../PromoCode/EPromoCodeDiscountType.enum';
|
|
4
5
|
export type IAvailability = {
|
|
5
6
|
roomTypes: {
|
|
6
7
|
[roomTypeCode: string]: IRoomType;
|
|
@@ -76,6 +77,9 @@ export type IRatePlan = {
|
|
|
76
77
|
export type IPromoCodeDetails = {
|
|
77
78
|
code: string;
|
|
78
79
|
oneTimeUseOnly: boolean;
|
|
80
|
+
discountType: EPromoCodeDiscountType;
|
|
81
|
+
discountAmount: number;
|
|
82
|
+
applyToAddons: boolean;
|
|
79
83
|
};
|
|
80
84
|
export type IRoomNight = {
|
|
81
85
|
available: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class TotalCalculator {
|
|
|
15
15
|
* - `indChildPrice`: Price calculated based on child quantities.
|
|
16
16
|
* - `addonTotal`: Sum of the above prices, optionally multiplied by nights.
|
|
17
17
|
*/
|
|
18
|
-
static calculateBaseAddonTotal: (addon: BasketAddonDTO | ReservationAddonDTO
|
|
18
|
+
static calculateBaseAddonTotal: (addon: Partial<BasketAddonDTO> | Partial<ReservationAddonDTO>, dismissAddonNightCount: boolean) => {
|
|
19
19
|
indPrice: number;
|
|
20
20
|
indAdultPrice: number;
|
|
21
21
|
indChildPrice: number;
|
package/dist/web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>R,AddGiftCardSchema:()=>_o,BaseGiftCardSchema:()=>vo,CancelGiftCardTransactionSchema:()=>To,CompleteGiftCardTransactionSchema:()=>Eo,DATE_FORMAT:()=>N,EAddonPricingType:()=>C,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>A,EGiftCardTransactionType:()=>ko,EGuaranteePolicyDepositMode:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Co,ELogSeverity:()=>Ao,ELogType:()=>Ro,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>w,ERoomstayImageSize:()=>z,ETransactionStatus:()=>wo,EditGiftCardSchema:()=>yo,GuestProfile:()=>d,HttpMethod:()=>E,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>go,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>Po,RedeemGiftCardSchema:()=>bo,RefreshGiftCardTokenSchema:()=>Io,RegisterGiftCardAdminSchema:()=>No,Reservation:()=>u,ReservedPackage:()=>I,TotalCalculator:()=>qo,ValidateGiftCardSchema:()=>zo,calculateFeeAmount:()=>Zo,calculateTotalForMemberBooking:()=>$o,getFeeOptionValidity:()=>Bo,getFilteredBookingAddonFees:()=>Lo,getFilteredBookingFees:()=>Mo,getFilteredBookingRateFees:()=>Go,maxString:()=>mo,nameof:()=>Ho,preprocessDate:()=>uo,preprocessNumber:()=>co,requireEmail:()=>po,requireFutureDate:()=>ho,requirePositiveAmount:()=>fo,requireString:()=>lo,resizeRoomstayImageUrl:()=>Yo,roundMoney:()=>Oo,subset:()=>Vo,uppercaseString:()=>Qo,validateFormWithZod:()=>ao}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class I extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.hideQuantity=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(E||(E={}));const N="DD/MM/YYYY";let A,C;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(A||(A={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(C||(C={}));const R=[C.PER_NIGHT,C.PER_PERSON_PER_NIGHT,C.PER_QUANTITY_NAME_PER_NIGHT,C.PER_ROOM_QUANTITY_PER_NIGHT,C.PER_PERSON_OCCUPANCY_PER_NIGHT,C.PER_ADULT_OCCUPANCY_PER_NIGHT,C.PER_CHILD_OCCUPANCY_PER_NIGHT,C.PER_ALL_PERSONS_PER_NIGHT];function $(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class S extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const O={};function Z(e){return e&&Object.assign(O,e),O}const F=/^[cC][^\s-]{8,}$/,D=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U=/^[0-9a-vA-V]{20}$/,M=/^[A-Za-z0-9]{27}$/,G=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,V=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Y=/^(?:(?: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])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,J=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K=/^[A-Za-z0-9_-]*$/,X=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ee=/^\+(?:[0-9]){6,14}[0-9]$/,te="(?:(?:\\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])))",ne=new RegExp(`^${te}$`);function ie(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const oe=/^\d+$/,re=/^-?\d+(?:\.\d+)?/i,se=/true|false/i,ae=/^[^A-Z]*$/,ce=/^[^a-z]*$/;function ue(e,t){return"bigint"==typeof t?t.toString():t}function de(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function le(e){return null==e}function pe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const fe=Symbol("evaluating");function he(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==fe)return void 0===i&&(i=fe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ge(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ve(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ye(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Pe=de((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ze(e){if(!1===ye(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==ye(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function be(e){return ze(e)?{...e}:e}const ke=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Te(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Ie={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ae(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ce(e){return"string"==typeof e?e:e?.message}function Re(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ce(e.inst?._zod.def?.error?.(e))??Ce(t?.error?.(e))??Ce(n.customError?.(e))??Ce(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Se(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const xe=$("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Oe={number:"number",bigint:"bigint",object:"date"},Ze=$("$ZodCheckLessThan",((e,t)=>{xe.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=$("$ZodCheckGreaterThan",((e,t)=>{xe.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),De=$("$ZodCheckMultipleOf",((e,t)=>{xe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),je=$("$ZodCheckNumberFormat",((e,t)=>{xe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ie[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=oe)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Ue=$("$ZodCheckMaxLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=$e(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Me=$("$ZodCheckMinLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=$e(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ge=$("$ZodCheckLengthEquals",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=$e(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Le=$("$ZodCheckStringFormat",((e,t)=>{var n,i;xe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Be=$("$ZodCheckRegex",((e,t)=>{Le.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),He=$("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ae),Le.init(e,t)})),Ve=$("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ce),Le.init(e,t)})),Ye=$("$ZodCheckIncludes",((e,t)=>{xe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),qe=$("$ZodCheckStartsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Qe=$("$ZodCheckEndsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=$("$ZodCheckOverwrite",((e,t)=>{xe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Je{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ke=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ue,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xe=$("$ZodError",Ke),et=$("$ZodError",Ke,{Parent:Error}),tt=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new S;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Re(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},nt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Re(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},it=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new S;return r.issues.length?{success:!1,error:new(e??Xe)(r.issues.map((e=>Re(e,o,Z()))))}:{success:!0,data:r.value}},ot=it(et),rt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Re(e,o,Z()))))}:{success:!0,data:r.value}},st=rt(et),at=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ct=e=>(t,n,i)=>tt(e)(t,n,i),ut=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},dt=e=>async(t,n,i)=>nt(e)(t,n,i),lt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return it(e)(t,n,o)},pt=e=>(t,n,i)=>it(e)(t,n,i),ft=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rt(e)(t,n,o)},ht=e=>async(t,n,i)=>rt(e)(t,n,i),mt={major:4,minor:1,patch:5},gt=$("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new S;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=ot(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return st(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),vt=$("$ZodString",((e,t)=>{var n;gt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),_t=$("$ZodStringFormat",((e,t)=>{Le.init(e,t),vt.init(e,t)})),yt=$("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=B),_t.init(e,t)})),Pt=$("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());_t.init(e,t)})),zt=$("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=V),_t.init(e,t)})),bt=$("$ZodURL",((e,t)=>{_t.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),kt=$("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t.init(e,t)})),wt=$("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=G),_t.init(e,t)})),Et=$("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),_t.init(e,t)})),Tt=$("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=D),_t.init(e,t)})),It=$("$ZodULID",((e,t)=>{t.pattern??(t.pattern=j),_t.init(e,t)})),Nt=$("$ZodXID",((e,t)=>{t.pattern??(t.pattern=U),_t.init(e,t)})),At=$("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=M),_t.init(e,t)})),Ct=$("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ie({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${te}T(?:${i})$`)}(t)),_t.init(e,t)})),Rt=$("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ne),_t.init(e,t)})),$t=$("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ie(t)}$`)),_t.init(e,t)})),St=$("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),_t.init(e,t)})),xt=$("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=Y),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Ot=$("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Zt=$("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Q),_t.init(e,t)})),Ft=$("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),_t.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Dt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const jt=$("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=J),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Dt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ut=$("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=K),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!K.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Dt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Mt=$("$ZodE164",((e,t)=>{t.pattern??(t.pattern=ee),_t.init(e,t)})),Gt=$("$ZodJWT",((e,t)=>{_t.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Lt=$("$ZodNumber",((e,t)=>{gt.init(e,t),e._zod.pattern=e._zod.bag.pattern??re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Bt=$("$ZodNumber",((e,t)=>{je.init(e,t),Lt.init(e,t)})),Ht=$("$ZodBoolean",((e,t)=>{gt.init(e,t),e._zod.pattern=se,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Vt=$("$ZodUnknown",((e,t)=>{gt.init(e,t),e._zod.parse=e=>e})),Yt=$("$ZodNever",((e,t)=>{gt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=$("$ZodDate",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Qt(e,t,n){e.issues.length&&t.issues.push(...Ae(n,e.issues)),t.value[n]=e.value}const Wt=$("$ZodArray",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Qt(t,n,e)))):Qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Jt(e,t,n,i){e.issues.length&&t.issues.push(...Ae(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Kt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Xt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Jt(e,n,o,t)))):Jt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const en=$("$ZodObject",((e,t)=>{gt.init(e,t);const n=de((()=>Kt(t)));he(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=ye,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Jt(n,t,e,a)))):Jt(n,t,e,a)}return o?Xt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),tn=$("$ZodObjectJIT",((e,t)=>{en.init(e,t);const n=e._zod.parse,i=de((()=>Kt(t)));let o;const r=ye,s=!O.jitless,a=s&&Pe.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Je(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ve(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ve(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Xt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function nn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Re(e,i,Z())))))}),t)}const on=$("$ZodUnion",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),he(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),he(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),he(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>pe(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>nn(t,o,e,r))):nn(a,o,e,r)}})),rn=$("$ZodIntersection",((e,t)=>{gt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>an(e,t,n))):an(e,o,r)}}));function sn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ze(e)&&ze(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=sn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=sn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function an(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=sn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const cn=$("$ZodEnum",((e,t)=>{gt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>ke.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),un=$("$ZodTransform",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new S;return n.value=o,n}}));function dn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ln=$("$ZodOptional",((e,t)=>{gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>dn(t,e.value))):dn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),pn=$("$ZodNullable",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)}|null)$`):void 0})),he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),fn=$("$ZodDefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>hn(e,t))):hn(i,t)}}));function hn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const mn=$("$ZodPrefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),gn=$("$ZodNonOptional",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>vn(t,e))):vn(o,e)}}));function vn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _n=$("$ZodCatch",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),yn=$("$ZodPipe",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>t.in._zod.values)),he(e._zod,"optin",(()=>t.in._zod.optin)),he(e._zod,"optout",(()=>t.out._zod.optout)),he(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.in,n))):Pn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.out,n))):Pn(i,t.out,n)}}));function Pn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zn=$("$ZodReadonly",((e,t)=>{gt.init(e,t),he(e._zod,"propValues",(()=>t.innerType._zod.propValues)),he(e._zod,"values",(()=>t.innerType._zod.values)),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(bn):bn(i)}}));function bn(e){return e.value=Object.freeze(e.value),e}const kn=$("$ZodCustom",((e,t)=>{xe.init(e,t),gt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Se(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class En{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Tn(){return new En}const In=Tn();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function An(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function Cn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function Rn(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!1})}function $n(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!1})}function xn(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!0})}function On(e,t){return new De({check:"multiple_of",...Te(t),value:e})}function Zn(e,t){return new Ue({check:"max_length",...Te(t),maximum:e})}function Fn(e,t){return new Me({check:"min_length",...Te(t),minimum:e})}function Dn(e,t){return new Ge({check:"length_equals",...Te(t),length:e})}function jn(e){return new We({check:"overwrite",tx:e})}const Un=$("ZodISODateTime",((e,t)=>{Ct.init(e,t),ci.init(e,t)}));const Mn=$("ZodISODate",((e,t)=>{Rt.init(e,t),ci.init(e,t)}));const Gn=$("ZodISOTime",((e,t)=>{$t.init(e,t),ci.init(e,t)}));const Ln=$("ZodISODuration",((e,t)=>{St.init(e,t),ci.init(e,t)}));const Bn=(e,t)=>{Xe.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ue,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ue,2)}},isEmpty:{get:()=>0===e.issues.length}})},Hn=($("ZodError",Bn),$("ZodError",Bn,{Parent:Error})),Vn=tt(Hn),Yn=nt(Hn),qn=it(Hn),Qn=rt(Hn),Wn=at(Hn),Jn=ct(Hn),Kn=ut(Hn),Xn=dt(Hn),ei=lt(Hn),ti=pt(Hn),ni=ft(Hn),ii=ht(Hn),oi=$("ZodType",((e,t)=>(gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Ee(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Vn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Yn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Jn(e,t,n),e.encodeAsync=async(t,n)=>Kn(e,t,n),e.decodeAsync=async(t,n)=>Xn(e,t,n),e.safeEncode=(t,n)=>ei(e,t,n),e.safeDecode=(t,n)=>ti(e,t,n),e.safeEncodeAsync=async(t,n)=>ni(e,t,n),e.safeDecodeAsync=async(t,n)=>ii(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}(ro,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new xe({check:"custom",...Te(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Se(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Se(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(jn(t)),e.optional=()=>Qi(e),e.nullable=()=>Ji(e),e.nullish=()=>Qi(Ji(e)),e.nonoptional=t=>function(e,t){return new eo({type:"nonoptional",innerType:e,...Te(t)})}(e,t),e.array=()=>Ui(e),e.or=t=>function(e,t){return new Li({type:"union",options:e,...Te(t)})}([e,t]),e.and=t=>new Bi({type:"intersection",left:e,right:t}),e.transform=t=>io(e,Yi(t)),e.default=t=>{return n=t,new Ki({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.prefault=t=>{return n=t,new Xi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.catch=t=>{return new to({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>io(e,t),e.readonly=()=>new oo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return In.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>In.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return In.get(e);const n=e.clone();return In.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ri=$("_ZodString",((e,t)=>{vt.init(e,t),oi.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Be({check:"string_format",format:"regex",...Te(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"includes",...Te(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Te(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Qe({check:"string_format",format:"ends_with",...Te(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Fn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Dn(...t)),e.nonempty=(...t)=>e.check(Fn(1,...t)),e.lowercase=t=>e.check(function(e){return new He({check:"string_format",format:"lowercase",...Te(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ve({check:"string_format",format:"uppercase",...Te(e)})}(t)),e.trim=()=>e.check(jn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return jn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(jn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(jn((e=>e.toUpperCase())))})),si=$("ZodString",((e,t)=>{vt.init(e,t),ri.init(e,t),e.email=t=>e.check(Nn(ui,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}(fi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}(hi,t)),e.guid=t=>e.check(An(li,t)),e.uuid=t=>e.check(Cn(pi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}(pi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}(pi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}(pi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}(mi,t)),e.guid=t=>e.check(An(li,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}(gi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}(vi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}(_i,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}(Ei,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}(Ti,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}(yi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}(Pi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}(zi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}(bi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}(ki,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}(Ii,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}(Un,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}(Mn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}(Gn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}(Ln,e)}(t))}));function ai(e){return function(e,t){return new e({type:"string",...Te(t)})}(si,e)}const ci=$("ZodStringFormat",((e,t)=>{_t.init(e,t),ri.init(e,t)})),ui=$("ZodEmail",((e,t)=>{zt.init(e,t),ci.init(e,t)}));function di(e){return Nn(ui,e)}const li=$("ZodGUID",((e,t)=>{yt.init(e,t),ci.init(e,t)})),pi=$("ZodUUID",((e,t)=>{Pt.init(e,t),ci.init(e,t)})),fi=$("ZodURL",((e,t)=>{bt.init(e,t),ci.init(e,t)})),hi=$("ZodEmoji",((e,t)=>{kt.init(e,t),ci.init(e,t)})),mi=$("ZodNanoID",((e,t)=>{wt.init(e,t),ci.init(e,t)})),gi=$("ZodCUID",((e,t)=>{Et.init(e,t),ci.init(e,t)})),vi=$("ZodCUID2",((e,t)=>{Tt.init(e,t),ci.init(e,t)})),_i=$("ZodULID",((e,t)=>{It.init(e,t),ci.init(e,t)})),yi=$("ZodXID",((e,t)=>{Nt.init(e,t),ci.init(e,t)})),Pi=$("ZodKSUID",((e,t)=>{At.init(e,t),ci.init(e,t)})),zi=$("ZodIPv4",((e,t)=>{xt.init(e,t),ci.init(e,t)})),bi=$("ZodIPv6",((e,t)=>{Ot.init(e,t),ci.init(e,t)})),ki=$("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ci.init(e,t)})),wi=$("ZodCIDRv6",((e,t)=>{Ft.init(e,t),ci.init(e,t)})),Ei=$("ZodBase64",((e,t)=>{jt.init(e,t),ci.init(e,t)})),Ti=$("ZodBase64URL",((e,t)=>{Ut.init(e,t),ci.init(e,t)})),Ii=$("ZodE164",((e,t)=>{Mt.init(e,t),ci.init(e,t)})),Ni=$("ZodJWT",((e,t)=>{Gt.init(e,t),ci.init(e,t)})),Ai=$("ZodNumber",((e,t)=>{Lt.init(e,t),oi.init(e,t),e.gt=(t,n)=>e.check(Sn(t,n)),e.gte=(t,n)=>e.check(xn(t,n)),e.min=(t,n)=>e.check(xn(t,n)),e.lt=(t,n)=>e.check(Rn(t,n)),e.lte=(t,n)=>e.check($n(t,n)),e.max=(t,n)=>e.check($n(t,n)),e.int=t=>e.check($i(t)),e.safe=t=>e.check($i(t)),e.positive=t=>e.check(Sn(0,t)),e.nonnegative=t=>e.check(xn(0,t)),e.negative=t=>e.check(Rn(0,t)),e.nonpositive=t=>e.check($n(0,t)),e.multipleOf=(t,n)=>e.check(On(t,n)),e.step=(t,n)=>e.check(On(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ci(e){return function(e,t){return new e({type:"number",checks:[],...Te(t)})}(Ai,e)}const Ri=$("ZodNumberFormat",((e,t)=>{Bt.init(e,t),Ai.init(e,t)}));function $i(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Te(t)})}(Ri,e)}const Si=$("ZodBoolean",((e,t)=>{Ht.init(e,t),oi.init(e,t)}));const xi=$("ZodUnknown",((e,t)=>{Vt.init(e,t),oi.init(e,t)}));function Oi(){return new xi({type:"unknown"})}const Zi=$("ZodNever",((e,t)=>{Yt.init(e,t),oi.init(e,t)}));function Fi(e){return function(e,t){return new e({type:"never",...Te(t)})}(Zi,e)}const Di=$("ZodDate",((e,t)=>{qt.init(e,t),oi.init(e,t),e.min=(t,n)=>e.check(xn(t,n)),e.max=(t,n)=>e.check($n(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const ji=$("ZodArray",((e,t)=>{Wt.init(e,t),oi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Fn(t,n)),e.nonempty=t=>e.check(Fn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Dn(t,n)),e.unwrap=()=>e.element}));function Ui(e,t){return function(e,t,n){return new e({type:"array",element:t,...Te(n)})}(ji,e,t)}const Mi=$("ZodObject",((e,t)=>{tn.init(e,t),oi.init(e,t),he(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hi({type:"enum",entries:n,...Te(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Oi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Oi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:[]});return Ee(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:e._zod.def.checks};return Ee(e,n)}(e,t),e.merge=t=>function(e,t){const n=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return me(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Ee(e,ge(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return me(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=ge(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return me(this,"shape",i),i},checks:[]});return Ee(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(eo,e,t[0])}));function Gi(e,t){const n={type:"object",get shape(){var t;return me(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Te(t)};return new Mi(n)}const Li=$("ZodUnion",((e,t)=>{on.init(e,t),oi.init(e,t),e.options=t.options}));const Bi=$("ZodIntersection",((e,t)=>{rn.init(e,t),oi.init(e,t)})),Hi=$("ZodEnum",((e,t)=>{cn.init(e,t),oi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Hi({...t,checks:[],...Te(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hi({...t,checks:[],...Te(i),entries:o})}}));const Vi=$("ZodTransform",((e,t)=>{un.init(e,t),oi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Se(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Se(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Yi(e){return new Vi({type:"transform",transform:e})}const qi=$("ZodOptional",((e,t)=>{ln.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new qi({type:"optional",innerType:e})}const Wi=$("ZodNullable",((e,t)=>{pn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ji(e){return new Wi({type:"nullable",innerType:e})}const Ki=$("ZodDefault",((e,t)=>{fn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Xi=$("ZodPrefault",((e,t)=>{mn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=$("ZodNonOptional",((e,t)=>{gn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),to=$("ZodCatch",((e,t)=>{_n.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),no=$("ZodPipe",((e,t)=>{yn.init(e,t),oi.init(e,t),e.in=t.in,e.out=t.out}));function io(e,t){return new no({type:"pipe",in:e,out:t})}const oo=$("ZodReadonly",((e,t)=>{zn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ro=$("ZodCustom",((e,t)=>{kn.init(e,t),oi.init(e,t)}));function so(e,t){return io(Yi(e),t)}function ao(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const co=e=>so((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),uo=e=>so((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),lo=e=>ai().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),po=()=>di("Invalid email address").min(1,"Required"),fo=()=>co(Ci("Valid amount required").positive("Positive amount required")),ho=()=>uo(function(e){return function(e,t){return new e({type:"date",...Te(t)})}(Di,e)}("Valid date required").min(new Date,"Date must be in the future")),mo=e=>ai().max(e,`Maximum length is ${e} characters`),go=Gi({address1:lo(100),address2:mo(100).optional(),city:lo(50),state:mo(50).optional(),postcode:mo(20).optional(),country:lo(50)}),vo=Gi({amount:fo(),message:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),giverAddress:go,cardHolder:lo(101),recipientFirstName:mo(50).nullish(),recipientLastName:mo(50).nullish(),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),_o=vo.extend({expiry:ho(),notes:mo(500).nullish()}),yo=Gi({balance:fo(),expiry:ho(),message:mo(500).nullish(),notes:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),cardHolder:lo(101),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),Po=vo.extend({companyId:Ci().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Te(t)})}(Si,e)}().default(!0),payment:Gi({cardHolder:lo(30),cardNumberToken:lo(50),cardExpiry:lo(5),cardCvcToken:lo(50)}).optional()}),zo=Gi({companyId:Ci().int().positive().nullish(),code:lo(10),password:lo(10)}),bo=zo.extend({amount:fo(),description:lo(200)});let ko,wo;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(ko||(ko={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(wo||(wo={}));const Eo=Gi({code:lo(10),token:lo(128)}),To=Gi({companyId:Ci().int().positive(),code:lo(10),token:lo(128)}),Io=Gi({grant_type:ai().readonly().default("refresh_token"),client_id:Cn(pi,undefined),client_secret:ai(),refresh_token:ai(),scope:ai().optional()});const No=Gi({email:di(),firstName:ai().max(100).optional(),lastName:ai().max(100).optional(),phone:ai().max(20).optional(),scopes:Ui(ai()).optional()});let Ao,Co,Ro;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(Ao||(Ao={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Co||(Co={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(Ro||(Ro={}));const $o=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t};var So=i(60),xo=i.n(So);const Oo=e=>new(xo())(e).toDecimalPlaces(2).toNumber();function Zo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Oo(n);switch(e.feeType){case A.PercentageOfBooking:if(o)return Oo(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Oo(a/(1-t)*e.amount/(100+e.amount))}return Oo(a*(e.amount/100));case A.FixedChargePerRoom:case A.FixedChargePerBooking:return e.amount;case A.NightlyChargePerRoom:return Oo(e.amount*i);default:return 0}}const Fo=[A.FixedChargePerBooking],Do=[A.PercentageOfBooking,A.FixedChargePerRoom,A.NightlyChargePerRoom],jo=[A.PercentageOfBooking];function Uo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Mo(e){return Uo(e,Fo)}function Go(e){return Uo(e,Do)}function Lo(e){return Uo(e,jo)}function Bo(e){return{includeInRates:[A.PercentageOfBooking,A.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===A.PercentageOfBooking,appliesToAddons:e===A.PercentageOfBooking,includePreviousFeesInCalculation:e===A.PercentageOfBooking}}const Ho=e=>e,Vo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Yo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class qo{}function Qo(e){return e.toUpperCase()}qo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===C.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===C.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return R.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},qo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=qo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),R.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),qo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=qo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),qo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=qo.calculateReservationAddonTotal(o,t)?.total}})),Oo(n)}})(),o})()));
|
|
1
|
+
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>S,AddGiftCardSchema:()=>_o,BaseGiftCardSchema:()=>yo,CancelGiftCardTransactionSchema:()=>Io,CompleteGiftCardTransactionSchema:()=>To,DATE_FORMAT:()=>A,EAddonPricingType:()=>R,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>C,EGiftCardTransactionType:()=>wo,EGuaranteePolicyDepositMode:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Ro,ELogSeverity:()=>Co,ELogType:()=>So,EPlanpayBookingStatus:()=>s,EPromoCodeDiscountType:()=>w,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>y,ERMSSyncStrategy:()=>_,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,ETransactionStatus:()=>Eo,EditGiftCardSchema:()=>Po,GuestProfile:()=>d,HttpMethod:()=>T,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>vo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>I,PurchaseGiftCardSchema:()=>zo,RedeemGiftCardSchema:()=>ko,RefreshGiftCardTokenSchema:()=>No,RegisterGiftCardAdminSchema:()=>Ao,Reservation:()=>u,ReservedPackage:()=>N,TotalCalculator:()=>qo,ValidateGiftCardSchema:()=>bo,calculateFeeAmount:()=>Fo,calculateTotalForMemberBooking:()=>$o,getFeeOptionValidity:()=>Ho,getFilteredBookingAddonFees:()=>Bo,getFilteredBookingFees:()=>Go,getFilteredBookingRateFees:()=>Lo,maxString:()=>go,nameof:()=>Vo,preprocessDate:()=>lo,preprocessNumber:()=>uo,requireEmail:()=>fo,requireFutureDate:()=>mo,requirePositiveAmount:()=>ho,requireString:()=>po,resizeRoomstayImageUrl:()=>Yo,roundMoney:()=>Zo,subset:()=>Qo,uppercaseString:()=>Wo,validateFormWithZod:()=>co}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,y,_,P,z,b,k,w,E,T;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(y||(y={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(_||(_={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class I{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class N extends I{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.hideQuantity=!1,this.order=void 0,this.discount=void 0,this.total=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.FlatPercent="flatPercent",e.FlatQuantity="flatQuantity",e.FlatQuantityPerStay="flatQuantityPerStay"}(w||(w={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(T||(T={}));const A="DD/MM/YYYY";let C,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(C||(C={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(R||(R={}));const S=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function $(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class x extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Z={};function F(e){return e&&Object.assign(Z,e),Z}const D=/^[cC][^\s-]{8,}$/,j=/^[0-9a-z]+$/,U=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,M=/^[0-9a-vA-V]{20}$/,G=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,B=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,V=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Q=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Y=/^(?:(?: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])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,W=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,J=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,K=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X=/^[A-Za-z0-9_-]*$/,ee=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,te=/^\+(?:[0-9]){6,14}[0-9]$/,ne="(?:(?:\\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])))",ie=new RegExp(`^${ne}$`);function oe(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const re=/^\d+$/,se=/^-?\d+(?:\.\d+)?/i,ae=/true|false/i,ce=/^[^A-Z]*$/,ue=/^[^a-z]*$/;function de(e,t){return"bigint"==typeof t?t.toString():t}function le(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function pe(e){return null==e}function fe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const he=Symbol("evaluating");function me(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==he)return void 0===i&&(i=he,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ve(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ye(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ze=le((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function be(e){if(!1===Pe(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Pe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ke(e){return be(e)?{...e}:e}const we=new Set(["string","number","symbol"]);function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Te(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ie(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Ne={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ae(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ce(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Re(e){return"string"==typeof e?e:e?.message}function Se(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function xe(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Oe=$("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ze={number:"number",bigint:"bigint",object:"date"},Fe=$("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),De=$("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),je=$("$ZodCheckMultipleOf",((e,t)=>{Oe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),Ue=$("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ne[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=re)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Me=$("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!pe(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=$e(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ge=$("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!pe(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=$e(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=$("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!pe(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=$e(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Be=$("$ZodCheckStringFormat",((e,t)=>{var n,i;Oe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),He=$("$ZodCheckRegex",((e,t)=>{Be.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),Ve=$("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ce),Be.init(e,t)})),Qe=$("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ue),Be.init(e,t)})),Ye=$("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=Ee(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),qe=$("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${Ee(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),We=$("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${Ee(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),Je=$("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Ke{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Xe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,de,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},et=$("$ZodError",Xe),tt=$("$ZodError",Xe,{Parent:Error}),nt=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new x;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Se(e,r,F()))));throw _e(t,o?.callee),t}return s.value},it=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Se(e,r,F()))));throw _e(t,o?.callee),t}return s.value},ot=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new x;return r.issues.length?{success:!1,error:new(e??et)(r.issues.map((e=>Se(e,o,F()))))}:{success:!0,data:r.value}},rt=ot(tt),st=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Se(e,o,F()))))}:{success:!0,data:r.value}},at=st(tt),ct=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},ut=e=>(t,n,i)=>nt(e)(t,n,i),dt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return it(e)(t,n,o)},lt=e=>async(t,n,i)=>it(e)(t,n,i),pt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>(t,n,i)=>ot(e)(t,n,i),ht=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return st(e)(t,n,o)},mt=e=>async(t,n,i)=>st(e)(t,n,i),gt={major:4,minor:1,patch:5},vt=$("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ae(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new x;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ae(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ae(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ae(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new x;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new x;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=rt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return at(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),yt=$("$ZodString",((e,t)=>{var n;vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),_t=$("$ZodStringFormat",((e,t)=>{Be.init(e,t),yt.init(e,t)})),Pt=$("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),_t.init(e,t)})),zt=$("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=V(e))}else t.pattern??(t.pattern=V());_t.init(e,t)})),bt=$("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=Q),_t.init(e,t)})),kt=$("$ZodURL",((e,t)=>{_t.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ee.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),wt=$("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t.init(e,t)})),Et=$("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),_t.init(e,t)})),Tt=$("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=D),_t.init(e,t)})),It=$("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=j),_t.init(e,t)})),Nt=$("$ZodULID",((e,t)=>{t.pattern??(t.pattern=U),_t.init(e,t)})),At=$("$ZodXID",((e,t)=>{t.pattern??(t.pattern=M),_t.init(e,t)})),Ct=$("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=G),_t.init(e,t)})),Rt=$("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=oe({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${ne}T(?:${i})$`)}(t)),_t.init(e,t)})),St=$("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ie),_t.init(e,t)})),$t=$("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${oe(t)}$`)),_t.init(e,t)})),xt=$("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=B),_t.init(e,t)})),Ot=$("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=Y),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Zt=$("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Ft=$("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=W),_t.init(e,t)})),Dt=$("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=J),_t.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function jt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ut=$("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=K),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{jt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Mt=$("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=X),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!X.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return jt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Gt=$("$ZodE164",((e,t)=>{t.pattern??(t.pattern=te),_t.init(e,t)})),Lt=$("$ZodJWT",((e,t)=>{_t.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Bt=$("$ZodNumber",((e,t)=>{vt.init(e,t),e._zod.pattern=e._zod.bag.pattern??se,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Ht=$("$ZodNumber",((e,t)=>{Ue.init(e,t),Bt.init(e,t)})),Vt=$("$ZodBoolean",((e,t)=>{vt.init(e,t),e._zod.pattern=ae,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Qt=$("$ZodUnknown",((e,t)=>{vt.init(e,t),e._zod.parse=e=>e})),Yt=$("$ZodNever",((e,t)=>{vt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=$("$ZodDate",((e,t)=>{vt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Wt(e,t,n){e.issues.length&&t.issues.push(...Ce(n,e.issues)),t.value[n]=e.value}const Jt=$("$ZodArray",((e,t)=>{vt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Wt(t,n,e)))):Wt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Kt(e,t,n,i){e.issues.length&&t.issues.push(...Ce(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Xt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function en(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Kt(e,n,o,t)))):Kt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const tn=$("$ZodObject",((e,t)=>{vt.init(e,t);const n=le((()=>Xt(t)));me(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=Pe,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Kt(n,t,e,a)))):Kt(n,t,e,a)}return o?en(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),nn=$("$ZodObjectJIT",((e,t)=>{tn.init(e,t);const n=e._zod.parse,i=le((()=>Xt(t)));let o;const r=Pe,s=!Z.jitless,a=s&&ze.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Ke(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ye(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ye(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?en([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function on(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ae(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Se(e,i,F())))))}),t)}const rn=$("$ZodUnion",((e,t)=>{vt.init(e,t),me(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),me(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),me(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),me(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>fe(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>on(t,o,e,r))):on(a,o,e,r)}})),sn=$("$ZodIntersection",((e,t)=>{vt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>cn(e,t,n))):cn(e,o,r)}}));function an(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(be(e)&&be(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=an(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=an(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function cn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ae(e))return e;const i=an(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const un=$("$ZodEnum",((e,t)=>{vt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>we.has(typeof e))).map((e=>"string"==typeof e?Ee(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),dn=$("$ZodTransform",((e,t)=>{vt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new x;return n.value=o,n}}));function ln(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const pn=$("$ZodOptional",((e,t)=>{vt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",me(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),me(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${fe(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>ln(t,e.value))):ln(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),fn=$("$ZodNullable",((e,t)=>{vt.init(e,t),me(e._zod,"optin",(()=>t.innerType._zod.optin)),me(e._zod,"optout",(()=>t.innerType._zod.optout)),me(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${fe(e.source)}|null)$`):void 0})),me(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),hn=$("$ZodDefault",((e,t)=>{vt.init(e,t),e._zod.optin="optional",me(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>mn(e,t))):mn(i,t)}}));function mn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const gn=$("$ZodPrefault",((e,t)=>{vt.init(e,t),e._zod.optin="optional",me(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),vn=$("$ZodNonOptional",((e,t)=>{vt.init(e,t),me(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>yn(t,e))):yn(o,e)}}));function yn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _n=$("$ZodCatch",((e,t)=>{vt.init(e,t),me(e._zod,"optin",(()=>t.innerType._zod.optin)),me(e._zod,"optout",(()=>t.innerType._zod.optout)),me(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Se(e,n,F())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Se(e,n,F())))},input:e.value}),e.issues=[]),e)}})),Pn=$("$ZodPipe",((e,t)=>{vt.init(e,t),me(e._zod,"values",(()=>t.in._zod.values)),me(e._zod,"optin",(()=>t.in._zod.optin)),me(e._zod,"optout",(()=>t.out._zod.optout)),me(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>zn(e,t.in,n))):zn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>zn(e,t.out,n))):zn(i,t.out,n)}}));function zn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const bn=$("$ZodReadonly",((e,t)=>{vt.init(e,t),me(e._zod,"propValues",(()=>t.innerType._zod.propValues)),me(e._zod,"values",(()=>t.innerType._zod.values)),me(e._zod,"optin",(()=>t.innerType._zod.optin)),me(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(kn):kn(i)}}));function kn(e){return e.value=Object.freeze(e.value),e}const wn=$("$ZodCustom",((e,t)=>{Oe.init(e,t),vt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>En(t,n,i,e)));En(o,n,i,e)}}));function En(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(xe(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Tn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function In(){return new Tn}const Nn=In();function An(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(t)})}function Cn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(t)})}function Rn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(t)})}function Sn(e,t){return new Fe({check:"less_than",...Ie(t),value:e,inclusive:!1})}function $n(e,t){return new Fe({check:"less_than",...Ie(t),value:e,inclusive:!0})}function xn(e,t){return new De({check:"greater_than",...Ie(t),value:e,inclusive:!1})}function On(e,t){return new De({check:"greater_than",...Ie(t),value:e,inclusive:!0})}function Zn(e,t){return new je({check:"multiple_of",...Ie(t),value:e})}function Fn(e,t){return new Me({check:"max_length",...Ie(t),maximum:e})}function Dn(e,t){return new Ge({check:"min_length",...Ie(t),minimum:e})}function jn(e,t){return new Le({check:"length_equals",...Ie(t),length:e})}function Un(e){return new Je({check:"overwrite",tx:e})}const Mn=$("ZodISODateTime",((e,t)=>{Rt.init(e,t),ui.init(e,t)}));const Gn=$("ZodISODate",((e,t)=>{St.init(e,t),ui.init(e,t)}));const Ln=$("ZodISOTime",((e,t)=>{$t.init(e,t),ui.init(e,t)}));const Bn=$("ZodISODuration",((e,t)=>{xt.init(e,t),ui.init(e,t)}));const Hn=(e,t)=>{et.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}},isEmpty:{get:()=>0===e.issues.length}})},Vn=($("ZodError",Hn),$("ZodError",Hn,{Parent:Error})),Qn=nt(Vn),Yn=it(Vn),qn=ot(Vn),Wn=st(Vn),Jn=ct(Vn),Kn=ut(Vn),Xn=dt(Vn),ei=lt(Vn),ti=pt(Vn),ni=ft(Vn),ii=ht(Vn),oi=mt(Vn),ri=$("ZodType",((e,t)=>(vt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Te(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Qn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Yn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Jn(e,t,n),e.decode=(t,n)=>Kn(e,t,n),e.encodeAsync=async(t,n)=>Xn(e,t,n),e.decodeAsync=async(t,n)=>ei(e,t,n),e.safeEncode=(t,n)=>ti(e,t,n),e.safeDecode=(t,n)=>ni(e,t,n),e.safeEncodeAsync=async(t,n)=>ii(e,t,n),e.safeDecodeAsync=async(t,n)=>oi(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ie(n)})}(so,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Oe({check:"custom",...Ie(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(xe(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(xe(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Un(t)),e.optional=()=>Wi(e),e.nullable=()=>Ki(e),e.nullish=()=>Wi(Ki(e)),e.nonoptional=t=>function(e,t){return new to({type:"nonoptional",innerType:e,...Ie(t)})}(e,t),e.array=()=>Mi(e),e.or=t=>function(e,t){return new Bi({type:"union",options:e,...Ie(t)})}([e,t]),e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>oo(e,Yi(t)),e.default=t=>{return n=t,new Xi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ke(n)}});var n},e.prefault=t=>{return n=t,new eo({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ke(n)}});var n},e.catch=t=>{return new no({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>oo(e,t),e.readonly=()=>new ro({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Nn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Nn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Nn.get(e);const n=e.clone();return Nn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),si=$("_ZodString",((e,t)=>{yt.init(e,t),ri.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"regex",...Ie(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"includes",...Ie(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Ie(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new We({check:"string_format",format:"ends_with",...Ie(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Dn(...t)),e.max=(...t)=>e.check(Fn(...t)),e.length=(...t)=>e.check(jn(...t)),e.nonempty=(...t)=>e.check(Dn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ve({check:"string_format",format:"lowercase",...Ie(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Qe({check:"string_format",format:"uppercase",...Ie(e)})}(t)),e.trim=()=>e.check(Un((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Un((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Un((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Un((e=>e.toUpperCase())))})),ai=$("ZodString",((e,t)=>{yt.init(e,t),si.init(e,t),e.email=t=>e.check(An(di,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(t)})}(hi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(t)})}(Ai,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(t)})}(mi,t)),e.guid=t=>e.check(Cn(pi,t)),e.uuid=t=>e.check(Rn(fi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(t)})}(fi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(t)})}(fi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(t)})}(fi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(t)})}(gi,t)),e.guid=t=>e.check(Cn(pi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(t)})}(vi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(t)})}(yi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(t)})}(_i,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(t)})}(Ti,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(t)})}(Ii,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(t)})}(Pi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(t)})}(zi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(t)})}(bi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(t)})}(ki,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(t)})}(wi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(t)})}(Ei,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(t)})}(Ni,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(t)})}(Mn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ie(t)})}(Gn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ie(t)})}(Bn,e)}(t))}));function ci(e){return function(e,t){return new e({type:"string",...Ie(t)})}(ai,e)}const ui=$("ZodStringFormat",((e,t)=>{_t.init(e,t),si.init(e,t)})),di=$("ZodEmail",((e,t)=>{bt.init(e,t),ui.init(e,t)}));function li(e){return An(di,e)}const pi=$("ZodGUID",((e,t)=>{Pt.init(e,t),ui.init(e,t)})),fi=$("ZodUUID",((e,t)=>{zt.init(e,t),ui.init(e,t)})),hi=$("ZodURL",((e,t)=>{kt.init(e,t),ui.init(e,t)})),mi=$("ZodEmoji",((e,t)=>{wt.init(e,t),ui.init(e,t)})),gi=$("ZodNanoID",((e,t)=>{Et.init(e,t),ui.init(e,t)})),vi=$("ZodCUID",((e,t)=>{Tt.init(e,t),ui.init(e,t)})),yi=$("ZodCUID2",((e,t)=>{It.init(e,t),ui.init(e,t)})),_i=$("ZodULID",((e,t)=>{Nt.init(e,t),ui.init(e,t)})),Pi=$("ZodXID",((e,t)=>{At.init(e,t),ui.init(e,t)})),zi=$("ZodKSUID",((e,t)=>{Ct.init(e,t),ui.init(e,t)})),bi=$("ZodIPv4",((e,t)=>{Ot.init(e,t),ui.init(e,t)})),ki=$("ZodIPv6",((e,t)=>{Zt.init(e,t),ui.init(e,t)})),wi=$("ZodCIDRv4",((e,t)=>{Ft.init(e,t),ui.init(e,t)})),Ei=$("ZodCIDRv6",((e,t)=>{Dt.init(e,t),ui.init(e,t)})),Ti=$("ZodBase64",((e,t)=>{Ut.init(e,t),ui.init(e,t)})),Ii=$("ZodBase64URL",((e,t)=>{Mt.init(e,t),ui.init(e,t)})),Ni=$("ZodE164",((e,t)=>{Gt.init(e,t),ui.init(e,t)})),Ai=$("ZodJWT",((e,t)=>{Lt.init(e,t),ui.init(e,t)})),Ci=$("ZodNumber",((e,t)=>{Bt.init(e,t),ri.init(e,t),e.gt=(t,n)=>e.check(xn(t,n)),e.gte=(t,n)=>e.check(On(t,n)),e.min=(t,n)=>e.check(On(t,n)),e.lt=(t,n)=>e.check(Sn(t,n)),e.lte=(t,n)=>e.check($n(t,n)),e.max=(t,n)=>e.check($n(t,n)),e.int=t=>e.check($i(t)),e.safe=t=>e.check($i(t)),e.positive=t=>e.check(xn(0,t)),e.nonnegative=t=>e.check(On(0,t)),e.negative=t=>e.check(Sn(0,t)),e.nonpositive=t=>e.check($n(0,t)),e.multipleOf=(t,n)=>e.check(Zn(t,n)),e.step=(t,n)=>e.check(Zn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ri(e){return function(e,t){return new e({type:"number",checks:[],...Ie(t)})}(Ci,e)}const Si=$("ZodNumberFormat",((e,t)=>{Ht.init(e,t),Ci.init(e,t)}));function $i(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ie(t)})}(Si,e)}const xi=$("ZodBoolean",((e,t)=>{Vt.init(e,t),ri.init(e,t)}));const Oi=$("ZodUnknown",((e,t)=>{Qt.init(e,t),ri.init(e,t)}));function Zi(){return new Oi({type:"unknown"})}const Fi=$("ZodNever",((e,t)=>{Yt.init(e,t),ri.init(e,t)}));function Di(e){return function(e,t){return new e({type:"never",...Ie(t)})}(Fi,e)}const ji=$("ZodDate",((e,t)=>{qt.init(e,t),ri.init(e,t),e.min=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check($n(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const Ui=$("ZodArray",((e,t)=>{Jt.init(e,t),ri.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Dn(t,n)),e.nonempty=t=>e.check(Dn(1,t)),e.max=(t,n)=>e.check(Fn(t,n)),e.length=(t,n)=>e.check(jn(t,n)),e.unwrap=()=>e.element}));function Mi(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ie(n)})}(Ui,e,t)}const Gi=$("ZodObject",((e,t)=>{nn.init(e,t),ri.init(e,t),me(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Vi({type:"enum",entries:n,...Ie(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Di()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!be(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ve(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return ge(this,"shape",n),n},checks:[]});return Te(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!be(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return ge(this,"shape",n),n},checks:e._zod.def.checks};return Te(e,n)}(e,t),e.merge=t=>function(e,t){const n=ve(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ge(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Te(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Te(e,ve(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return ge(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=ve(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return ge(this,"shape",i),i},checks:[]});return Te(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=ve(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return ge(this,"shape",o),o},checks:[]});return Te(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=ve(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return ge(this,"shape",o),o},checks:[]});return Te(t,i)}(to,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return ge(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ie(t)};return new Gi(n)}const Bi=$("ZodUnion",((e,t)=>{rn.init(e,t),ri.init(e,t),e.options=t.options}));const Hi=$("ZodIntersection",((e,t)=>{sn.init(e,t),ri.init(e,t)})),Vi=$("ZodEnum",((e,t)=>{un.init(e,t),ri.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Vi({...t,checks:[],...Ie(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Vi({...t,checks:[],...Ie(i),entries:o})}}));const Qi=$("ZodTransform",((e,t)=>{dn.init(e,t),ri.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(xe(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(xe(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Yi(e){return new Qi({type:"transform",transform:e})}const qi=$("ZodOptional",((e,t)=>{pn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Wi(e){return new qi({type:"optional",innerType:e})}const Ji=$("ZodNullable",((e,t)=>{fn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ki(e){return new Ji({type:"nullable",innerType:e})}const Xi=$("ZodDefault",((e,t)=>{hn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),eo=$("ZodPrefault",((e,t)=>{gn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType})),to=$("ZodNonOptional",((e,t)=>{vn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType})),no=$("ZodCatch",((e,t)=>{_n.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),io=$("ZodPipe",((e,t)=>{Pn.init(e,t),ri.init(e,t),e.in=t.in,e.out=t.out}));function oo(e,t){return new io({type:"pipe",in:e,out:t})}const ro=$("ZodReadonly",((e,t)=>{bn.init(e,t),ri.init(e,t),e.unwrap=()=>e._zod.def.innerType})),so=$("ZodCustom",((e,t)=>{wn.init(e,t),ri.init(e,t)}));function ao(e,t){return oo(Yi(e),t)}function co(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const uo=e=>ao((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),lo=e=>ao((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),po=e=>ci().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),fo=()=>li("Invalid email address").min(1,"Required"),ho=()=>uo(Ri("Valid amount required").positive("Positive amount required")),mo=()=>lo(function(e){return function(e,t){return new e({type:"date",...Ie(t)})}(ji,e)}("Valid date required").min(new Date,"Date must be in the future")),go=e=>ci().max(e,`Maximum length is ${e} characters`),vo=Li({address1:po(100),address2:go(100).optional(),city:po(50),state:go(50).optional(),postcode:go(20).optional(),country:po(50)}),yo=Li({amount:ho(),message:go(500).nullish(),giverFirstName:po(50),giverLastName:po(50),giverEmail:fo(),giverPhone:po(31),giverAddress:vo,cardHolder:po(101),recipientFirstName:go(50).nullish(),recipientLastName:go(50).nullish(),recipientEmail:li("Invalid email address").nullish(),recipientPhone:go(31).nullish()}),_o=yo.extend({expiry:mo(),notes:go(500).nullish()}),Po=Li({balance:ho(),expiry:mo(),message:go(500).nullish(),notes:go(500).nullish(),giverFirstName:po(50),giverLastName:po(50),giverEmail:fo(),giverPhone:po(31),cardHolder:po(101),recipientEmail:li("Invalid email address").nullish(),recipientPhone:go(31).nullish()}),zo=yo.extend({companyId:Ri().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ie(t)})}(xi,e)}().default(!0),payment:Li({cardHolder:po(30),cardNumberToken:po(50),cardExpiry:po(5),cardCvcToken:po(50)}).optional()}),bo=Li({companyId:Ri().int().positive().nullish(),code:po(10),password:po(10)}),ko=bo.extend({amount:ho(),description:po(200)});let wo,Eo;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(wo||(wo={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(Eo||(Eo={}));const To=Li({code:po(10),token:po(128)}),Io=Li({companyId:Ri().int().positive(),code:po(10),token:po(128)}),No=Li({grant_type:ci().readonly().default("refresh_token"),client_id:Rn(fi,undefined),client_secret:ci(),refresh_token:ci(),scope:ci().optional()});const Ao=Li({email:li(),firstName:ci().max(100).optional(),lastName:ci().max(100).optional(),phone:ci().max(20).optional(),scopes:Mi(ci()).optional()});let Co,Ro,So;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(Co||(Co={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Ro||(Ro={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(So||(So={}));const $o=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t};var xo=i(60),Oo=i.n(xo);const Zo=e=>new(Oo())(e).toDecimalPlaces(2).toNumber();function Fo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Zo(n);switch(e.feeType){case C.PercentageOfBooking:if(o)return Zo(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Zo(a/(1-t)*e.amount/(100+e.amount))}return Zo(a*(e.amount/100));case C.FixedChargePerRoom:case C.FixedChargePerBooking:return e.amount;case C.NightlyChargePerRoom:return Zo(e.amount*i);default:return 0}}const Do=[C.FixedChargePerBooking],jo=[C.PercentageOfBooking,C.FixedChargePerRoom,C.NightlyChargePerRoom],Uo=[C.PercentageOfBooking];function Mo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Go(e){return Mo(e,Do)}function Lo(e){return Mo(e,jo)}function Bo(e){return Mo(e,Uo)}function Ho(e){return{includeInRates:[C.PercentageOfBooking,C.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===C.PercentageOfBooking,appliesToAddons:e===C.PercentageOfBooking,includePreviousFeesInCalculation:e===C.PercentageOfBooking}}const Vo=e=>e,Qo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Yo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class qo{}function Wo(e){return e.toUpperCase()}qo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return S.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},qo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=qo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),S.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),qo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=qo.calculateBaseAddonTotal(n,t);let o,r=n.discount||0;o=void 0!==n.total&&null!==n.total?n.total:i.addonTotal-r;let s=n.fees||0;n.itemisedFees?.length&&(s=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const a=n.itemisedFees?.length?o:o+s;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+s,total:e.total+o+s,displayPrice:e.displayPrice+a}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),qo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=qo.calculateReservationAddonTotal(o,t)?.total}})),Zo(n)}})(),o})()));
|