@roomstay/core 0.1.79 → 0.1.80
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
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,a,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>L,AddGiftCardSchema:()=>Ro,AdyenEventCode:()=>Bo,AdyenResultCode:()=>Lo,BaseGiftCardSchema:()=>No,CancelGiftCardTransactionSchema:()=>Yo,CompleteGiftCardTransactionSchema:()=>Vo,CreatePaymentSessionSchema:()=>$o,DATE_FORMAT:()=>$,EAddonPricingType:()=>D,EAdminCompanyUserRole:()=>f,EBookingCustomFieldFormat:()=>o,EBookingFlow:()=>i,EBookingPaymentMethod:()=>r,EBookingStatus:()=>n,ECompanyProvider:()=>p,EDistanceUnitType:()=>P,EFeeType:()=>Z,EGiftCardPaymentProvider:()=>Mo,EGiftCardPaymentStatus:()=>Go,EGiftCardPaymentType:()=>Oo,EGiftCardTransactionType:()=>Ho,EGuaranteePolicyDepositMode:()=>T,EHotelAddressRequirement:()=>h,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>m,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>v,EIntegration:()=>y,ELogCategory:()=>nr,ELogSeverity:()=>tr,ELogType:()=>ir,EMembershipProvider:()=>A,EPlanpayBookingStatus:()=>s,EPromoCodeDiscountType:()=>C,EPromoCodeStayDateRangeRepeatType:()=>N,EPromoCodeStayDateRangeType:()=>I,ERMSAuthSyncHistoryStatus:()=>b,ERMSDiscountType:()=>k,ERMSSyncStrategy:()=>z,ERoomstayEventName:()=>F,ERoomstayEventSource:()=>R,ERoomstayImageSize:()=>w,ETransactionStatus:()=>qo,EditGiftCardSchema:()=>So,GetCompanyConfigSchema:()=>Qo,GuestProfile:()=>l,HttpMethod:()=>x,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>E,InternationalAddressSchema:()=>Io,ItineraryResponse:()=>u,PCIBookingCardProcessorTypes:()=>c,Package:()=>S,PassthroughPaymentDataSchema:()=>Zo,PaymentProcessorDataSchema:()=>xo,PurchaseGiftCardSchema:()=>Fo,RedeemGiftCardSchema:()=>Uo,RefreshGiftCardTokenSchema:()=>Xo,RefundGiftCardSchema:()=>Do,RegisterGiftCardAdminSchema:()=>er,Reservation:()=>d,ReservedPackage:()=>O,TotalCalculator:()=>Pr,UpdateAdyenConfigSchema:()=>Ko,UpdateCompanyConfigSchema:()=>Jo,ValidateGiftCardSchema:()=>jo,calculateFeeAmount:()=>cr,calculateTotalForMemberBooking:()=>or,getFeeOptionValidity:()=>gr,getFilteredBookingAddonFees:()=>mr,getFilteredBookingFees:()=>fr,getFilteredBookingRateFees:()=>hr,maxString:()=>Co,nameof:()=>vr,preprocessDate:()=>zo,preprocessNumber:()=>ko,requireEmail:()=>Eo,requireFutureDate:()=>To,requirePositiveAmount:()=>Ao,requireString:()=>wo,resizeRoomstayImageUrl:()=>_r,roundMoney:()=>sr,subset:()=>yr,toMetaEventName:()=>j,transformToMetaEventData:()=>M,transformToMetaUserData:()=>G,uppercaseString:()=>br,validateFormWithZod:()=>bo}),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.Number="number",e.Text="text",e.Date="date"}(o||(o={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe",e.PayPal="PayPal"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const c=[];class u{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 d{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 l,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 l{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 p,f,h,m,g,v,y,_,P,b,k,z,w,E,A,T,C,I,N,R;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(p||(p={})),function(e){e.SuperAdmin="SuperAdmin",e.Admin="Admin",e.Limited="Limited"}(f||(f={})),function(e){e.FullAddressRequired="FullAddressRequired",e.AddressOptionalCountryRequired="AddressOptionalCountryRequired",e.AddressOptional="AddressOptional"}(h||(h={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(m||(m={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(v||(v={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC",e.AnalyticsEvents="AnalyticsEvents",e.MemberJungle="MemberJungle"}(y||(y={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(P||(P={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(b||(b={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(k||(k={})),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.ClientFacingAreaSync="clientFacingAreaSync",e.NewRateFetch="newRateFetch"}(z||(z={})),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"}(w||(w={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(E||(E={})),function(e){e.Big4="Big4",e.Gday="Gday",e.Internal="Internal",e.MemberJungle="MemberJungle",e.RAC="RAC",e.RmsTop10="RmsTop10",e.Salesforce="Salesforce",e.Top10="Top10"}(A||(A={}));class S{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 O extends S{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"}(T||(T={})),function(e){e.FlatPercent="flatPercent",e.FlatQuantity="flatQuantity",e.FlatQuantityPerStay="flatQuantityPerStay"}(C||(C={})),function(e){e.Allowed="Allowed",e.Blocked="Blocked"}(I||(I={})),function(e){e.None="None",e.Weekly="Weekly",e.MonthlyDayOfWeek="MonthlyDayOfWeek",e.MonthlyDate="MonthlyDate",e.Yearly="Yearly"}(N||(N={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(R||(R={}));const $="DD/MM/YYYY";let x,Z,F,D;function j(e){return{[F.BasketAdd]:"AddToCart",[F.BasketAddAddon]:"AddToCart",[F.ViewCheckout]:"InitiateCheckout",[F.BookingCommitted]:"Purchase"}[e]}function U(e,t,n){let i=0;const o=[],r=[];for(const t of e)i+=t.totalPrice,t.roomCode&&(o.push(t.roomCode),r.push({id:t.roomCode,quantity:1,item_price:t.totalPrice}));if(t)for(const e of t)i+=e.totalPrice,e.addonCode&&(o.push(e.addonCode),r.push({id:e.addonCode,quantity:e.quantity,item_price:e.unitPrice}));return{currency:n,value:i,content_ids:o,content_type:"hotel",contents:r,num_items:e.length+(t?.length??0)}}function M(e){if("addon"in e)return t=e.addon,{currency:e.currency,value:t.totalPrice,content_ids:t.addonCode?[t.addonCode]:[],content_type:"hotel",contents:t.addonCode?[{id:t.addonCode,quantity:t.quantity,item_price:t.unitPrice}]:[],num_items:1};var t;if("item"in e)return U([e.item],void 0,e.currency);if("items"in e){const t=e,n=U(t.items,t.addons,e.currency);return"itineraryNumber"in t&&(n.order_id=t.itineraryNumber),n}throw new Error("Invalid event data")}function G(e){return{em:e.email,ph:e.phone,fn:e.firstName,ln:e.lastName,ct:e.city,st:e.state,zp:e.postalCode,country:e.country,external_id:e.externalId}}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(x||(x={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(Z||(Z={})),function(e){e.BasketAdd="Basket/Add",e.BasketAddAddon="Basket/AddAddon",e.ViewCheckout="View/Checkout",e.BookingCommitted="Booking/Committed"}(F||(F={})),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"}(D||(D={}));const L=[D.PER_NIGHT,D.PER_PERSON_PER_NIGHT,D.PER_QUANTITY_NAME_PER_NIGHT,D.PER_ROOM_QUANTITY_PER_NIGHT,D.PER_PERSON_OCCUPANCY_PER_NIGHT,D.PER_ADULT_OCCUPANCY_PER_NIGHT,D.PER_CHILD_OCCUPANCY_PER_NIGHT,D.PER_ALL_PERSONS_PER_NIGHT];function B(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 H extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class q extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const V={};function Y(e){return e&&Object.assign(V,e),V}const Q=/^[cC][^\s-]{8,}$/,W=/^[0-9a-z]+$/,J=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,K=/^[0-9a-vA-V]{20}$/,X=/^[A-Za-z0-9]{27}$/,ee=/^[a-zA-Z0-9_-]{21}$/,te=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ne=/^([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})$/,ie=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)$/,oe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,re=/^(?:(?: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])$/,ae=/^(([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})$/,se=/^((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])$/,ce=/^(([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])$/,ue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,de=/^[A-Za-z0-9_-]*$/,le=/^(?=.{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])?)*\.?$/,pe=/^\+(?:[0-9]){6,14}[0-9]$/,fe="(?:(?:\\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])))",he=new RegExp(`^${fe}$`);function me(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 ge=/^\d+$/,ve=/^-?\d+(?:\.\d+)?/i,ye=/true|false/i,_e=/^[^A-Z]*$/,Pe=/^[^a-z]*$/;function be(e,t){return"bigint"==typeof t?t.toString():t}function ke(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ze(e){return null==e}function we(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ee=Symbol("evaluating");function Ae(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==Ee)return void 0===i&&(i=Ee,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Te(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ce(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ie(e){return JSON.stringify(e)}const Ne="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Re(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Se=ke((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Oe(e){if(!1===Re(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Re(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function $e(e){return Oe(e)?{...e}:e}const xe=new Set(["string","number","symbol"]);function Ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fe(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function De(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 je={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 Ue(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 Me(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ge(e){return"string"==typeof e?e:e?.message}function Le(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ge(e.inst?._zod.def?.error?.(e))??Ge(t?.error?.(e))??Ge(n.customError?.(e))??Ge(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Be(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function He(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const qe=B("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ve={number:"number",bigint:"bigint",object:"date"},Ye=B("$ZodCheckLessThan",((e,t)=>{qe.init(e,t);const n=Ve[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})}})),Qe=B("$ZodCheckGreaterThan",((e,t)=>{qe.init(e,t);const n=Ve[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})}})),We=B("$ZodCheckMultipleOf",((e,t)=>{qe.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=B("$ZodCheckNumberFormat",((e,t)=>{qe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=je[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=ge)})),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})}})),Ke=B("$ZodCheckMaxLength",((e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ze(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=Be(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Xe=B("$ZodCheckMinLength",((e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ze(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=Be(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),et=B("$ZodCheckLengthEquals",((e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ze(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=Be(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})}})),tt=B("$ZodCheckStringFormat",((e,t)=>{var n,i;qe.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=()=>{})})),nt=B("$ZodCheckRegex",((e,t)=>{tt.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})}})),it=B("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=_e),tt.init(e,t)})),ot=B("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=Pe),tt.init(e,t)})),rt=B("$ZodCheckIncludes",((e,t)=>{qe.init(e,t);const n=Ze(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})}})),at=B("$ZodCheckStartsWith",((e,t)=>{qe.init(e,t);const n=new RegExp(`^${Ze(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})}})),st=B("$ZodCheckEndsWith",((e,t)=>{qe.init(e,t);const n=new RegExp(`.*${Ze(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})}})),ct=B("$ZodCheckOverwrite",((e,t)=>{qe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class ut{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 dt=(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,be,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lt=B("$ZodError",dt),pt=B("$ZodError",dt,{Parent:Error}),ft=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 H;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Le(e,r,Y()))));throw Ne(t,o?.callee),t}return a.value},ht=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=>Le(e,r,Y()))));throw Ne(t,o?.callee),t}return a.value},mt=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 H;return r.issues.length?{success:!1,error:new(e??lt)(r.issues.map((e=>Le(e,o,Y()))))}:{success:!0,data:r.value}},gt=mt(pt),vt=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=>Le(e,o,Y()))))}:{success:!0,data:r.value}},yt=vt(pt),_t=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ft(e)(t,n,o)},Pt=e=>(t,n,i)=>ft(e)(t,n,i),bt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ht(e)(t,n,o)},kt=e=>async(t,n,i)=>ht(e)(t,n,i),zt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mt(e)(t,n,o)},wt=e=>(t,n,i)=>mt(e)(t,n,i),Et=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return vt(e)(t,n,o)},At=e=>async(t,n,i)=>vt(e)(t,n,i),Tt={major:4,minor:1,patch:5},Ct=B("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Tt;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=Ue(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 H;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Ue(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ue(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ue(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new H;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 H;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=gt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return yt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),It=B("$ZodString",((e,t)=>{var n;Ct.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}})),Nt=B("$ZodStringFormat",((e,t)=>{tt.init(e,t),It.init(e,t)})),Rt=B("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=ne),Nt.init(e,t)})),St=B("$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=ie(e))}else t.pattern??(t.pattern=ie());Nt.init(e,t)})),Ot=B("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=oe),Nt.init(e,t)})),$t=B("$ZodURL",((e,t)=>{Nt.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:le.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})}}})),xt=B("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Nt.init(e,t)})),Zt=B("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=ee),Nt.init(e,t)})),Ft=B("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=Q),Nt.init(e,t)})),Dt=B("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=W),Nt.init(e,t)})),jt=B("$ZodULID",((e,t)=>{t.pattern??(t.pattern=J),Nt.init(e,t)})),Ut=B("$ZodXID",((e,t)=>{t.pattern??(t.pattern=K),Nt.init(e,t)})),Mt=B("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=X),Nt.init(e,t)})),Gt=B("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=me({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(`^${fe}T(?:${i})$`)}(t)),Nt.init(e,t)})),Lt=B("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=he),Nt.init(e,t)})),Bt=B("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${me(t)}$`)),Nt.init(e,t)})),Ht=B("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=te),Nt.init(e,t)})),qt=B("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=re),Nt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Vt=B("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ae),Nt.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})}}})),Yt=B("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=se),Nt.init(e,t)})),Qt=B("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=ce),Nt.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 Wt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Jt=B("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=ue),Nt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Wt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Kt=B("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=de),Nt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!de.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Wt(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})}})),Xt=B("$ZodE164",((e,t)=>{t.pattern??(t.pattern=pe),Nt.init(e,t)})),en=B("$ZodJWT",((e,t)=>{Nt.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})}})),tn=B("$ZodNumber",((e,t)=>{Ct.init(e,t),e._zod.pattern=e._zod.bag.pattern??ve,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}})),nn=B("$ZodNumber",((e,t)=>{Je.init(e,t),tn.init(e,t)})),on=B("$ZodBoolean",((e,t)=>{Ct.init(e,t),e._zod.pattern=ye,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}})),rn=B("$ZodUnknown",((e,t)=>{Ct.init(e,t),e._zod.parse=e=>e})),an=B("$ZodNever",((e,t)=>{Ct.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),sn=B("$ZodDate",((e,t)=>{Ct.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 cn(e,t,n){e.issues.length&&t.issues.push(...Me(n,e.issues)),t.value[n]=e.value}const un=B("$ZodArray",((e,t)=>{Ct.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=>cn(t,n,e)))):cn(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function dn(e,t,n,i){e.issues.length&&t.issues.push(...Me(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function ln(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 pn(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=>dn(e,n,o,t)))):dn(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 fn=B("$ZodObject",((e,t)=>{Ct.init(e,t);const n=ke((()=>ln(t)));Ae(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=Re,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=>dn(n,t,e,s)))):dn(n,t,e,s)}return o?pn(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),hn=B("$ZodObjectJIT",((e,t)=>{fn.init(e,t);const n=e._zod.parse,i=ke((()=>ln(t)));let o;const r=Re,a=!V.jitless,s=a&&Se.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 ut(["shape","payload","ctx"]),n=i.value,o=e=>{const t=Ie(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=Ie(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?pn([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function mn(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=>!Ue(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=>Le(e,i,Y())))))}),t)}const gn=B("$ZodUnion",((e,t)=>{Ct.init(e,t),Ae(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),Ae(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),Ae(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),Ae(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=>we(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=>mn(t,o,e,r))):mn(s,o,e,r)}})),vn=B("$ZodIntersection",((e,t)=>{Ct.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])=>_n(e,t,n))):_n(e,o,r)}}));function yn(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(Oe(e)&&Oe(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=yn(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=yn(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 _n(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ue(e))return e;const i=yn(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 Pn=B("$ZodEnum",((e,t)=>{Ct.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=>xe.has(typeof e))).map((e=>"string"==typeof e?Ze(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}})),bn=B("$ZodTransform",((e,t)=>{Ct.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new q(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 H;return n.value=o,n}}));function kn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const zn=B("$ZodOptional",((e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),Ae(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${we(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=>kn(t,e.value))):kn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),wn=B("$ZodNullable",((e,t)=>{Ct.init(e,t),Ae(e._zod,"optin",(()=>t.innerType._zod.optin)),Ae(e._zod,"optout",(()=>t.innerType._zod.optout)),Ae(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${we(e.source)}|null)$`):void 0})),Ae(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)})),En=B("$ZodDefault",((e,t)=>{Ct.init(e,t),e._zod.optin="optional",Ae(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=>An(e,t))):An(i,t)}}));function An(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Tn=B("$ZodPrefault",((e,t)=>{Ct.init(e,t),e._zod.optin="optional",Ae(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))})),Cn=B("$ZodNonOptional",((e,t)=>{Ct.init(e,t),Ae(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=>In(t,e))):In(o,e)}}));function In(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 Nn=B("$ZodCatch",((e,t)=>{Ct.init(e,t),Ae(e._zod,"optin",(()=>t.innerType._zod.optin)),Ae(e._zod,"optout",(()=>t.innerType._zod.optout)),Ae(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=>Le(e,n,Y())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Le(e,n,Y())))},input:e.value}),e.issues=[]),e)}})),Rn=B("$ZodPipe",((e,t)=>{Ct.init(e,t),Ae(e._zod,"values",(()=>t.in._zod.values)),Ae(e._zod,"optin",(()=>t.in._zod.optin)),Ae(e._zod,"optout",(()=>t.out._zod.optout)),Ae(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=>Sn(e,t.in,n))):Sn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>Sn(e,t.out,n))):Sn(i,t.out,n)}}));function Sn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const On=B("$ZodReadonly",((e,t)=>{Ct.init(e,t),Ae(e._zod,"propValues",(()=>t.innerType._zod.propValues)),Ae(e._zod,"values",(()=>t.innerType._zod.values)),Ae(e._zod,"optin",(()=>t.innerType._zod.optin)),Ae(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($n):$n(i)}}));function $n(e){return e.value=Object.freeze(e.value),e}const xn=B("$ZodCustom",((e,t)=>{qe.init(e,t),Ct.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=>Zn(t,n,i,e)));Zn(o,n,i,e)}}));function Zn(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(He(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Fn{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 Dn(){return new Fn}const jn=Dn();function Un(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function Mn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function Gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function Ln(e,t){return new Ye({check:"less_than",...De(t),value:e,inclusive:!1})}function Bn(e,t){return new Ye({check:"less_than",...De(t),value:e,inclusive:!0})}function Hn(e,t){return new Qe({check:"greater_than",...De(t),value:e,inclusive:!1})}function qn(e,t){return new Qe({check:"greater_than",...De(t),value:e,inclusive:!0})}function Vn(e,t){return new We({check:"multiple_of",...De(t),value:e})}function Yn(e,t){return new Ke({check:"max_length",...De(t),maximum:e})}function Qn(e,t){return new Xe({check:"min_length",...De(t),minimum:e})}function Wn(e,t){return new et({check:"length_equals",...De(t),length:e})}function Jn(e){return new ct({check:"overwrite",tx:e})}const Kn=B("ZodISODateTime",((e,t)=>{Gt.init(e,t),Pi.init(e,t)}));const Xn=B("ZodISODate",((e,t)=>{Lt.init(e,t),Pi.init(e,t)}));const ei=B("ZodISOTime",((e,t)=>{Bt.init(e,t),Pi.init(e,t)}));const ti=B("ZodISODuration",((e,t)=>{Ht.init(e,t),Pi.init(e,t)}));const ni=(e,t)=>{lt.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,be,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,be,2)}},isEmpty:{get:()=>0===e.issues.length}})},ii=(B("ZodError",ni),B("ZodError",ni,{Parent:Error})),oi=ft(ii),ri=ht(ii),ai=mt(ii),si=vt(ii),ci=_t(ii),ui=Pt(ii),di=bt(ii),li=kt(ii),pi=zt(ii),fi=wt(ii),hi=Et(ii),mi=At(ii),gi=B("ZodType",((e,t)=>(Ct.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)=>Fe(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>oi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ai(e,t,n),e.parseAsync=async(t,n)=>ri(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>si(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ci(e,t,n),e.decode=(t,n)=>ui(e,t,n),e.encodeAsync=async(t,n)=>di(e,t,n),e.decodeAsync=async(t,n)=>li(e,t,n),e.safeEncode=(t,n)=>pi(e,t,n),e.safeDecode=(t,n)=>fi(e,t,n),e.safeEncodeAsync=async(t,n)=>hi(e,t,n),e.safeDecodeAsync=async(t,n)=>mi(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,...De(n)})}(_o,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new qe({check:"custom",...De(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(He(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(He(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Jn(t)),e.optional=()=>co(e),e.nullable=()=>lo(e),e.nullish=()=>co(lo(e)),e.nonoptional=t=>function(e,t){return new ho({type:"nonoptional",innerType:e,...De(t)})}(e,t),e.array=()=>Ki(e),e.or=t=>function(e,t){return new to({type:"union",options:e,...De(t)})}([e,t]),e.and=t=>new no({type:"intersection",left:e,right:t}),e.transform=t=>vo(e,ao(t)),e.default=t=>{return n=t,new po({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():$e(n)}});var n},e.prefault=t=>{return n=t,new fo({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():$e(n)}});var n},e.catch=t=>{return new mo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>vo(e,t),e.readonly=()=>new yo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return jn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>jn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return jn.get(e);const n=e.clone();return jn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),vi=B("_ZodString",((e,t)=>{It.init(e,t),gi.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 nt({check:"string_format",format:"regex",...De(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new rt({check:"string_format",format:"includes",...De(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new at({check:"string_format",format:"starts_with",...De(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new st({check:"string_format",format:"ends_with",...De(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Qn(...t)),e.max=(...t)=>e.check(Yn(...t)),e.length=(...t)=>e.check(Wn(...t)),e.nonempty=(...t)=>e.check(Qn(1,...t)),e.lowercase=t=>e.check(function(e){return new it({check:"string_format",format:"lowercase",...De(e)})}(t)),e.uppercase=t=>e.check(function(e){return new ot({check:"string_format",format:"uppercase",...De(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())))})),yi=B("ZodString",((e,t)=>{It.init(e,t),vi.init(e,t),e.email=t=>e.check(Un(bi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}(Ei,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}(Ui,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}(Ai,t)),e.guid=t=>e.check(Mn(zi,t)),e.uuid=t=>e.check(Gn(wi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}(wi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}(wi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}(wi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}(Ti,t)),e.guid=t=>e.check(Mn(zi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}(Ci,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}(Ii,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}(Ni,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}(Fi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}(Di,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}(Ri,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}(Si,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}(Oi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}($i,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}(xi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}(Zi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}(ji,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,...De(t)})}(Kn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}(Xn,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,...De(t)})}(ei,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}(ti,e)}(t))}));function _i(e){return function(e,t){return new e({type:"string",...De(t)})}(yi,e)}const Pi=B("ZodStringFormat",((e,t)=>{Nt.init(e,t),vi.init(e,t)})),bi=B("ZodEmail",((e,t)=>{Ot.init(e,t),Pi.init(e,t)}));function ki(e){return Un(bi,e)}const zi=B("ZodGUID",((e,t)=>{Rt.init(e,t),Pi.init(e,t)})),wi=B("ZodUUID",((e,t)=>{St.init(e,t),Pi.init(e,t)})),Ei=B("ZodURL",((e,t)=>{$t.init(e,t),Pi.init(e,t)})),Ai=B("ZodEmoji",((e,t)=>{xt.init(e,t),Pi.init(e,t)})),Ti=B("ZodNanoID",((e,t)=>{Zt.init(e,t),Pi.init(e,t)})),Ci=B("ZodCUID",((e,t)=>{Ft.init(e,t),Pi.init(e,t)})),Ii=B("ZodCUID2",((e,t)=>{Dt.init(e,t),Pi.init(e,t)})),Ni=B("ZodULID",((e,t)=>{jt.init(e,t),Pi.init(e,t)})),Ri=B("ZodXID",((e,t)=>{Ut.init(e,t),Pi.init(e,t)})),Si=B("ZodKSUID",((e,t)=>{Mt.init(e,t),Pi.init(e,t)})),Oi=B("ZodIPv4",((e,t)=>{qt.init(e,t),Pi.init(e,t)})),$i=B("ZodIPv6",((e,t)=>{Vt.init(e,t),Pi.init(e,t)})),xi=B("ZodCIDRv4",((e,t)=>{Yt.init(e,t),Pi.init(e,t)})),Zi=B("ZodCIDRv6",((e,t)=>{Qt.init(e,t),Pi.init(e,t)})),Fi=B("ZodBase64",((e,t)=>{Jt.init(e,t),Pi.init(e,t)})),Di=B("ZodBase64URL",((e,t)=>{Kt.init(e,t),Pi.init(e,t)})),ji=B("ZodE164",((e,t)=>{Xt.init(e,t),Pi.init(e,t)})),Ui=B("ZodJWT",((e,t)=>{en.init(e,t),Pi.init(e,t)})),Mi=B("ZodNumber",((e,t)=>{tn.init(e,t),gi.init(e,t),e.gt=(t,n)=>e.check(Hn(t,n)),e.gte=(t,n)=>e.check(qn(t,n)),e.min=(t,n)=>e.check(qn(t,n)),e.lt=(t,n)=>e.check(Ln(t,n)),e.lte=(t,n)=>e.check(Bn(t,n)),e.max=(t,n)=>e.check(Bn(t,n)),e.int=t=>e.check(Bi(t)),e.safe=t=>e.check(Bi(t)),e.positive=t=>e.check(Hn(0,t)),e.nonnegative=t=>e.check(qn(0,t)),e.negative=t=>e.check(Ln(0,t)),e.nonpositive=t=>e.check(Bn(0,t)),e.multipleOf=(t,n)=>e.check(Vn(t,n)),e.step=(t,n)=>e.check(Vn(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 Gi(e){return function(e,t){return new e({type:"number",checks:[],...De(t)})}(Mi,e)}const Li=B("ZodNumberFormat",((e,t)=>{nn.init(e,t),Mi.init(e,t)}));function Bi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}(Li,e)}const Hi=B("ZodBoolean",((e,t)=>{on.init(e,t),gi.init(e,t)}));const qi=B("ZodUnknown",((e,t)=>{rn.init(e,t),gi.init(e,t)}));function Vi(){return new qi({type:"unknown"})}const Yi=B("ZodNever",((e,t)=>{an.init(e,t),gi.init(e,t)}));function Qi(e){return function(e,t){return new e({type:"never",...De(t)})}(Yi,e)}const Wi=B("ZodDate",((e,t)=>{sn.init(e,t),gi.init(e,t),e.min=(t,n)=>e.check(qn(t,n)),e.max=(t,n)=>e.check(Bn(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=B("ZodArray",((e,t)=>{un.init(e,t),gi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Qn(t,n)),e.nonempty=t=>e.check(Qn(1,t)),e.max=(t,n)=>e.check(Yn(t,n)),e.length=(t,n)=>e.check(Wn(t,n)),e.unwrap=()=>e.element}));function Ki(e,t){return function(e,t,n){return new e({type:"array",element:t,...De(n)})}(Ji,e,t)}const Xi=B("ZodObject",((e,t)=>{hn.init(e,t),gi.init(e,t),Ae(e,"shape",(()=>t.shape)),e.keyof=()=>oo(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Qi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Oe(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=Ce(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Te(this,"shape",n),n},checks:[]});return Fe(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Oe(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 Te(this,"shape",n),n},checks:e._zod.def.checks};return Fe(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ce(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Te(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Fe(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Fe(e,Ce(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 Te(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=Ce(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 Te(this,"shape",i),i},checks:[]});return Fe(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=Ce(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 Te(this,"shape",o),o},checks:[]});return Fe(t,i)}(so,e,t[0]),e.required=(...t)=>function(e,t,n){const i=Ce(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 Te(this,"shape",o),o},checks:[]});return Fe(t,i)}(ho,e,t[0])}));function eo(e,t){const n={type:"object",get shape(){var t;return Te(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...De(t)};return new Xi(n)}const to=B("ZodUnion",((e,t)=>{gn.init(e,t),gi.init(e,t),e.options=t.options}));const no=B("ZodIntersection",((e,t)=>{vn.init(e,t),gi.init(e,t)})),io=B("ZodEnum",((e,t)=>{Pn.init(e,t),gi.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 io({...t,checks:[],...De(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 io({...t,checks:[],...De(i),entries:o})}}));function oo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new io({type:"enum",entries:n,...De(t)})}const ro=B("ZodTransform",((e,t)=>{bn.init(e,t),gi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new q(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(He(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(He(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function ao(e){return new ro({type:"transform",transform:e})}const so=B("ZodOptional",((e,t)=>{zn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function co(e){return new so({type:"optional",innerType:e})}const uo=B("ZodNullable",((e,t)=>{wn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function lo(e){return new uo({type:"nullable",innerType:e})}const po=B("ZodDefault",((e,t)=>{En.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),fo=B("ZodPrefault",((e,t)=>{Tn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ho=B("ZodNonOptional",((e,t)=>{Cn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),mo=B("ZodCatch",((e,t)=>{Nn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),go=B("ZodPipe",((e,t)=>{Rn.init(e,t),gi.init(e,t),e.in=t.in,e.out=t.out}));function vo(e,t){return new go({type:"pipe",in:e,out:t})}const yo=B("ZodReadonly",((e,t)=>{On.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),_o=B("ZodCustom",((e,t)=>{xn.init(e,t),gi.init(e,t)}));function Po(e,t){return vo(ao(e),t)}function bo(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 ko=e=>Po((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),zo=e=>Po((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),wo=e=>_i().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Eo=()=>ki("Invalid email address").min(1,"Required"),Ao=()=>ko(Gi("Valid amount required").positive("Positive amount required")),To=()=>zo(function(e){return function(e,t){return new e({type:"date",...De(t)})}(Wi,e)}("Valid date required").min(new Date,"Date must be in the future")),Co=e=>_i().max(e,`Maximum length is ${e} characters`),Io=eo({address1:wo(100),address2:Co(100).optional(),city:wo(50),state:Co(50).optional(),postcode:Co(20).optional(),country:wo(50)}),No=eo({amount:Ao(),message:Co(500).nullish(),giverFirstName:wo(50),giverLastName:wo(50),giverEmail:Eo(),giverPhone:wo(31),giverAddress:Io,cardHolder:wo(101),recipientFirstName:Co(50).nullish(),recipientLastName:Co(50).nullish(),recipientEmail:ki("Invalid email address").nullish(),recipientPhone:Co(31).nullish()}),Ro=No.extend({expiry:To(),notes:Co(500).nullish()}),So=eo({balance:Ao(),expiry:To(),message:Co(500).nullish(),notes:Co(500).nullish(),giverFirstName:wo(50),giverLastName:wo(50),giverEmail:Eo(),giverPhone:wo(31),cardHolder:wo(101),recipientEmail:ki("Invalid email address").nullish(),recipientPhone:Co(31).nullish()});let Oo;!function(e){e.Passthrough="Passthrough",e.PaymentProcessor="PaymentProcessor"}(Oo||(Oo={}));const $o=eo({companyId:Gi().int().positive(),amount:Ao(),currency:wo(3).default("AUD")}),xo=eo({sessionId:wo(100),resultCode:wo(50),pspReference:Co(100).optional()}),Zo=eo({cardHolder:wo(100),cardNumberToken:Co(200),cardCvcToken:Co(200),cardExpiry:Co(5)}),Fo=No.extend({companyId:Gi().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...De(t)})}(Hi,e)}().default(!0),payment:xo.optional(),passthroughPayment:Zo.optional()}),Do=eo({giftCardId:Gi().int().positive(),reason:Co(500).optional()}),jo=eo({companyId:Gi().int().positive().nullish(),code:wo(10),password:wo(10)}),Uo=jo.extend({amount:Ao(),description:wo(200)});let Mo,Go,Lo,Bo,Ho,qo;!function(e){e.Adyen="Adyen"}(Mo||(Mo={})),function(e){e.Pending="Pending",e.Authorized="Authorized",e.Captured="Captured",e.Failed="Failed",e.Refunded="Refunded"}(Go||(Go={})),function(e){e.Authorised="Authorised",e.Refused="Refused",e.Cancelled="Cancelled",e.Pending="Pending",e.Received="Received",e.Error="Error",e.IdentifyShopper="IdentifyShopper",e.ChallengeShopper="ChallengeShopper"}(Lo||(Lo={})),function(e){e.AUTHORISATION="AUTHORISATION",e.CAPTURE="CAPTURE",e.REFUND="REFUND",e.CANCELLATION="CANCELLATION",e.REFUND_FAILED="REFUND_FAILED",e.CAPTURE_FAILED="CAPTURE_FAILED"}(Bo||(Bo={})),function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(Ho||(Ho={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(qo||(qo={}));const Vo=eo({code:wo(10),token:wo(128)}),Yo=eo({companyId:Gi().int().positive(),code:wo(10),token:wo(128)}),Qo=eo({companyId:(Wo=Mi,new Wo({type:"number",coerce:!0,checks:[],...De(void 0)})).int().positive()});var Wo;const Jo=eo({giftCardPaymentType:oo([Oo.Passthrough,Oo.PaymentProcessor])}),Ko=eo({merchantAccount:wo(100),clientKey:wo(100),apiKey:Co(200).optional(),webhookHmacKey:Co(200).optional()}),Xo=eo({grant_type:_i().readonly().default("refresh_token"),client_id:Gn(wi,void 0),client_secret:_i(),refresh_token:_i(),scope:_i().optional()}),er=eo({email:ki(),firstName:_i().max(100).optional(),lastName:_i().max(100).optional(),phone:_i().max(20).optional(),scopes:Ki(_i()).optional()});let tr,nr,ir;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(tr||(tr={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(nr||(nr={})),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",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(ir||(ir={}));const or=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},rr=require("decimal.js");var ar=e.n(rr);const sr=e=>new(ar())(e).toDecimalPlaces(2).toNumber();function cr(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=sr(n);switch(e.feeType){case Z.PercentageOfBooking:if(o)return sr(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return sr(s/(1-t)*e.amount/(100+e.amount))}return sr(s*(e.amount/100));case Z.FixedChargePerRoom:case Z.FixedChargePerBooking:return e.amount;case Z.NightlyChargePerRoom:return sr(e.amount*i);default:return 0}}const ur=[Z.FixedChargePerBooking],dr=[Z.PercentageOfBooking,Z.FixedChargePerRoom,Z.NightlyChargePerRoom],lr=[Z.PercentageOfBooking];function pr(e,t){return e.filter((e=>t.includes(e.feeType)))}function fr(e){return pr(e,ur)}function hr(e){return pr(e,dr)}function mr(e){return pr(e,lr)}function gr(e){return{includeInRates:[Z.PercentageOfBooking,Z.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===Z.PercentageOfBooking,appliesToAddons:e===Z.PercentageOfBooking,includePreviousFeesInCalculation:e===Z.PercentageOfBooking}}const vr=e=>e,yr=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},_r=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Pr{}function br(e){return e.toUpperCase()}Pr.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===D.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===D.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 L.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Pr.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Pr.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))),L.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})),Pr.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Pr.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})),Pr.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+=Pr.calculateReservationAddonTotal(o,t)?.total}})),sr(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,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>B,AddGiftCardSchema:()=>So,AdyenEventCode:()=>Ho,AdyenResultCode:()=>Bo,BaseGiftCardSchema:()=>Ro,CancelGiftCardTransactionSchema:()=>Qo,CompleteGiftCardTransactionSchema:()=>Yo,CreatePaymentSessionSchema:()=>xo,DATE_FORMAT:()=>$,EAddonPricingType:()=>L,EAdminCompanyUserRole:()=>f,EBookingCustomFieldFormat:()=>o,EBookingFlow:()=>i,EBookingPaymentMethod:()=>r,EBookingStatus:()=>n,ECompanyProvider:()=>p,EDistanceUnitType:()=>P,EFeeType:()=>Z,EGiftCardPaymentProvider:()=>Go,EGiftCardPaymentStatus:()=>Lo,EGiftCardPaymentType:()=>$o,EGiftCardTransactionType:()=>qo,EGuaranteePolicyDepositMode:()=>T,EHotelAddressRequirement:()=>h,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>m,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>v,EIntegration:()=>y,ELogCategory:()=>ir,ELogSeverity:()=>nr,ELogType:()=>or,EMembershipProvider:()=>A,EPlanpayBookingStatus:()=>s,EPromoCodeDiscountType:()=>C,EPromoCodeStayDateRangeRepeatType:()=>N,EPromoCodeStayDateRangeType:()=>I,ERMSAuthSyncHistoryStatus:()=>b,ERMSDiscountType:()=>k,ERMSSyncStrategy:()=>z,ERoomstayEventName:()=>F,ERoomstayEventSource:()=>R,ERoomstayImageSize:()=>w,ETransactionStatus:()=>Vo,EditGiftCardSchema:()=>Oo,GetCompanyConfigSchema:()=>Wo,GuestProfile:()=>l,HttpMethod:()=>x,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>E,InternationalAddressSchema:()=>No,ItineraryResponse:()=>u,META_USER_DATA_KEYS:()=>D,PCIBookingCardProcessorTypes:()=>c,Package:()=>S,PassthroughPaymentDataSchema:()=>Fo,PaymentProcessorDataSchema:()=>Zo,PurchaseGiftCardSchema:()=>Do,RedeemGiftCardSchema:()=>Mo,RefreshGiftCardTokenSchema:()=>er,RefundGiftCardSchema:()=>jo,RegisterGiftCardAdminSchema:()=>tr,Reservation:()=>d,ReservedPackage:()=>O,TotalCalculator:()=>br,UpdateAdyenConfigSchema:()=>Xo,UpdateCompanyConfigSchema:()=>Ko,ValidateGiftCardSchema:()=>Uo,calculateFeeAmount:()=>ur,calculateTotalForMemberBooking:()=>rr,getFeeOptionValidity:()=>vr,getFilteredBookingAddonFees:()=>gr,getFilteredBookingFees:()=>hr,getFilteredBookingRateFees:()=>mr,maxString:()=>Io,nameof:()=>yr,preprocessDate:()=>wo,preprocessNumber:()=>zo,requireEmail:()=>Ao,requireFutureDate:()=>Co,requirePositiveAmount:()=>To,requireString:()=>Eo,resizeRoomstayImageUrl:()=>Pr,roundMoney:()=>cr,subset:()=>_r,toMetaEventName:()=>j,transformToMetaEventData:()=>M,transformToMetaUserData:()=>G,uppercaseString:()=>kr,validateFormWithZod:()=>ko}),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.Number="number",e.Text="text",e.Date="date"}(o||(o={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe",e.PayPal="PayPal"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const c=[];class u{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 d{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 l,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 l{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 p,f,h,m,g,v,y,_,P,b,k,z,w,E,A,T,C,I,N,R;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(p||(p={})),function(e){e.SuperAdmin="SuperAdmin",e.Admin="Admin",e.Limited="Limited"}(f||(f={})),function(e){e.FullAddressRequired="FullAddressRequired",e.AddressOptionalCountryRequired="AddressOptionalCountryRequired",e.AddressOptional="AddressOptional"}(h||(h={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(m||(m={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(v||(v={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC",e.AnalyticsEvents="AnalyticsEvents",e.MemberJungle="MemberJungle"}(y||(y={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(P||(P={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(b||(b={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(k||(k={})),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.ClientFacingAreaSync="clientFacingAreaSync",e.NewRateFetch="newRateFetch"}(z||(z={})),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"}(w||(w={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(E||(E={})),function(e){e.Big4="Big4",e.Gday="Gday",e.Internal="Internal",e.MemberJungle="MemberJungle",e.RAC="RAC",e.RmsTop10="RmsTop10",e.Salesforce="Salesforce",e.Top10="Top10"}(A||(A={}));class S{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 O extends S{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"}(T||(T={})),function(e){e.FlatPercent="flatPercent",e.FlatQuantity="flatQuantity",e.FlatQuantityPerStay="flatQuantityPerStay"}(C||(C={})),function(e){e.Allowed="Allowed",e.Blocked="Blocked"}(I||(I={})),function(e){e.None="None",e.Weekly="Weekly",e.MonthlyDayOfWeek="MonthlyDayOfWeek",e.MonthlyDate="MonthlyDate",e.Yearly="Yearly"}(N||(N={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(R||(R={}));const $="DD/MM/YYYY";let x,Z,F;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(x||(x={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(Z||(Z={})),function(e){e.BasketAdd="Basket/Add",e.BasketAddAddon="Basket/AddAddon",e.ViewCheckout="View/Checkout",e.BookingCommitted="Booking/Committed"}(F||(F={}));const D=["em","ph","fn","ln","ct","st","zp","country","external_id"];function j(e){return{[F.BasketAdd]:"AddToCart",[F.BasketAddAddon]:"AddToCart",[F.ViewCheckout]:"InitiateCheckout",[F.BookingCommitted]:"Purchase"}[e]}function U(e,t,n){let i=0;const o=[],r=[];for(const t of e)i+=t.totalPrice,t.roomCode&&(o.push(t.roomCode),r.push({id:t.roomCode,quantity:1,item_price:t.totalPrice}));if(t)for(const e of t)i+=e.totalPrice,e.addonCode&&(o.push(e.addonCode),r.push({id:e.addonCode,quantity:e.quantity,item_price:e.unitPrice}));return{currency:n,value:i,content_ids:o,content_type:"hotel",contents:r,num_items:e.length+(t?.length??0)}}function M(e){if("addon"in e)return t=e.addon,{currency:e.currency,value:t.totalPrice,content_ids:t.addonCode?[t.addonCode]:[],content_type:"hotel",contents:t.addonCode?[{id:t.addonCode,quantity:t.quantity,item_price:t.unitPrice}]:[],num_items:1};var t;if("item"in e)return U([e.item],void 0,e.currency);if("items"in e){const t=e,n=U(t.items,t.addons,e.currency);return"itineraryNumber"in t&&(n.order_id=t.itineraryNumber),n}throw new Error("Invalid event data")}function G(e){return{em:e.email,ph:e.phone,fn:e.firstName,ln:e.lastName,ct:e.city,st:e.state,zp:e.postalCode,country:e.country,external_id:e.externalId}}let L;!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"}(L||(L={}));const B=[L.PER_NIGHT,L.PER_PERSON_PER_NIGHT,L.PER_QUANTITY_NAME_PER_NIGHT,L.PER_ROOM_QUANTITY_PER_NIGHT,L.PER_PERSON_OCCUPANCY_PER_NIGHT,L.PER_ADULT_OCCUPANCY_PER_NIGHT,L.PER_CHILD_OCCUPANCY_PER_NIGHT,L.PER_ALL_PERSONS_PER_NIGHT];function H(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 q extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class V extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Y={};function Q(e){return e&&Object.assign(Y,e),Y}const W=/^[cC][^\s-]{8,}$/,J=/^[0-9a-z]+$/,K=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,X=/^[0-9a-vA-V]{20}$/,ee=/^[A-Za-z0-9]{27}$/,te=/^[a-zA-Z0-9_-]{21}$/,ne=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ie=/^([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})$/,oe=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)$/,re=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ae=/^(?:(?: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])$/,se=/^(([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})$/,ce=/^((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])$/,ue=/^(([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])$/,de=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,le=/^[A-Za-z0-9_-]*$/,pe=/^(?=.{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])?)*\.?$/,fe=/^\+(?:[0-9]){6,14}[0-9]$/,he="(?:(?:\\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])))",me=new RegExp(`^${he}$`);function ge(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 ve=/^\d+$/,ye=/^-?\d+(?:\.\d+)?/i,_e=/true|false/i,Pe=/^[^A-Z]*$/,be=/^[^a-z]*$/;function ke(e,t){return"bigint"==typeof t?t.toString():t}function ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function we(e){return null==e}function Ee(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ae=Symbol("evaluating");function Te(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==Ae)return void 0===i&&(i=Ae,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ce(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ie(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ne(e){return JSON.stringify(e)}const Re="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Se(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Oe=ze((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function $e(e){if(!1===Se(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Se(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function xe(e){return $e(e)?{...e}:e}const Ze=new Set(["string","number","symbol"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function De(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function je(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 Ue={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 Me(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 Ge(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Le(e){return"string"==typeof e?e:e?.message}function Be(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Le(e.inst?._zod.def?.error?.(e))??Le(t?.error?.(e))??Le(n.customError?.(e))??Le(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function He(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function qe(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ve=H("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ye={number:"number",bigint:"bigint",object:"date"},Qe=H("$ZodCheckLessThan",((e,t)=>{Ve.init(e,t);const n=Ye[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})}})),We=H("$ZodCheckGreaterThan",((e,t)=>{Ve.init(e,t);const n=Ye[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=H("$ZodCheckMultipleOf",((e,t)=>{Ve.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})}})),Ke=H("$ZodCheckNumberFormat",((e,t)=>{Ve.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ue[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=ve)})),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})}})),Xe=H("$ZodCheckMaxLength",((e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!we(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=He(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),et=H("$ZodCheckMinLength",((e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!we(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=He(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),tt=H("$ZodCheckLengthEquals",((e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!we(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=He(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})}})),nt=H("$ZodCheckStringFormat",((e,t)=>{var n,i;Ve.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=()=>{})})),it=H("$ZodCheckRegex",((e,t)=>{nt.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})}})),ot=H("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=Pe),nt.init(e,t)})),rt=H("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=be),nt.init(e,t)})),at=H("$ZodCheckIncludes",((e,t)=>{Ve.init(e,t);const n=Fe(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})}})),st=H("$ZodCheckStartsWith",((e,t)=>{Ve.init(e,t);const n=new RegExp(`^${Fe(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})}})),ct=H("$ZodCheckEndsWith",((e,t)=>{Ve.init(e,t);const n=new RegExp(`.*${Fe(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})}})),ut=H("$ZodCheckOverwrite",((e,t)=>{Ve.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class dt{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 lt=(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,ke,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},pt=H("$ZodError",lt),ft=H("$ZodError",lt,{Parent:Error}),ht=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 q;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Be(e,r,Q()))));throw Re(t,o?.callee),t}return a.value},mt=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=>Be(e,r,Q()))));throw Re(t,o?.callee),t}return a.value},gt=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 q;return r.issues.length?{success:!1,error:new(e??pt)(r.issues.map((e=>Be(e,o,Q()))))}:{success:!0,data:r.value}},vt=gt(ft),yt=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=>Be(e,o,Q()))))}:{success:!0,data:r.value}},_t=yt(ft),Pt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ht(e)(t,n,o)},bt=e=>(t,n,i)=>ht(e)(t,n,i),kt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mt(e)(t,n,o)},zt=e=>async(t,n,i)=>mt(e)(t,n,i),wt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return gt(e)(t,n,o)},Et=e=>(t,n,i)=>gt(e)(t,n,i),At=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return yt(e)(t,n,o)},Tt=e=>async(t,n,i)=>yt(e)(t,n,i),Ct={major:4,minor:1,patch:5},It=H("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ct;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=Me(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 q;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Me(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Me(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Me(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new q;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 q;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=vt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return _t(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),Nt=H("$ZodString",((e,t)=>{var n;It.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}})),Rt=H("$ZodStringFormat",((e,t)=>{nt.init(e,t),Nt.init(e,t)})),St=H("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=ie),Rt.init(e,t)})),Ot=H("$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=oe(e))}else t.pattern??(t.pattern=oe());Rt.init(e,t)})),$t=H("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=re),Rt.init(e,t)})),xt=H("$ZodURL",((e,t)=>{Rt.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:pe.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})}}})),Zt=H("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Rt.init(e,t)})),Ft=H("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=te),Rt.init(e,t)})),Dt=H("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=W),Rt.init(e,t)})),jt=H("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=J),Rt.init(e,t)})),Ut=H("$ZodULID",((e,t)=>{t.pattern??(t.pattern=K),Rt.init(e,t)})),Mt=H("$ZodXID",((e,t)=>{t.pattern??(t.pattern=X),Rt.init(e,t)})),Gt=H("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=ee),Rt.init(e,t)})),Lt=H("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ge({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(`^${he}T(?:${i})$`)}(t)),Rt.init(e,t)})),Bt=H("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=me),Rt.init(e,t)})),Ht=H("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ge(t)}$`)),Rt.init(e,t)})),qt=H("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=ne),Rt.init(e,t)})),Vt=H("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ae),Rt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Yt=H("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=se),Rt.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})}}})),Qt=H("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=ce),Rt.init(e,t)})),Wt=H("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=ue),Rt.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 Kt=H("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=de),Rt.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})}})),Xt=H("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=le),Rt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!le.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})}})),en=H("$ZodE164",((e,t)=>{t.pattern??(t.pattern=fe),Rt.init(e,t)})),tn=H("$ZodJWT",((e,t)=>{Rt.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})}})),nn=H("$ZodNumber",((e,t)=>{It.init(e,t),e._zod.pattern=e._zod.bag.pattern??ye,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}})),on=H("$ZodNumber",((e,t)=>{Ke.init(e,t),nn.init(e,t)})),rn=H("$ZodBoolean",((e,t)=>{It.init(e,t),e._zod.pattern=_e,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}})),an=H("$ZodUnknown",((e,t)=>{It.init(e,t),e._zod.parse=e=>e})),sn=H("$ZodNever",((e,t)=>{It.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),cn=H("$ZodDate",((e,t)=>{It.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 un(e,t,n){e.issues.length&&t.issues.push(...Ge(n,e.issues)),t.value[n]=e.value}const dn=H("$ZodArray",((e,t)=>{It.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=>un(t,n,e)))):un(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function ln(e,t,n,i){e.issues.length&&t.issues.push(...Ge(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pn(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 fn(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=>ln(e,n,o,t)))):ln(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 hn=H("$ZodObject",((e,t)=>{It.init(e,t);const n=ze((()=>pn(t)));Te(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=Se,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=>ln(n,t,e,s)))):ln(n,t,e,s)}return o?fn(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),mn=H("$ZodObjectJIT",((e,t)=>{hn.init(e,t);const n=e._zod.parse,i=ze((()=>pn(t)));let o;const r=Se,a=!Y.jitless,s=a&&Oe.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 dt(["shape","payload","ctx"]),n=i.value,o=e=>{const t=Ne(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=Ne(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?fn([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function gn(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=>!Me(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=>Be(e,i,Q())))))}),t)}const vn=H("$ZodUnion",((e,t)=>{It.init(e,t),Te(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),Te(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),Te(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),Te(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=>Ee(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=>gn(t,o,e,r))):gn(s,o,e,r)}})),yn=H("$ZodIntersection",((e,t)=>{It.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])=>Pn(e,t,n))):Pn(e,o,r)}}));function _n(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($e(e)&&$e(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=_n(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=_n(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 Pn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Me(e))return e;const i=_n(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 bn=H("$ZodEnum",((e,t)=>{It.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=>Ze.has(typeof e))).map((e=>"string"==typeof e?Fe(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}})),kn=H("$ZodTransform",((e,t)=>{It.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new V(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 q;return n.value=o,n}}));function zn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const wn=H("$ZodOptional",((e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Te(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),Te(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ee(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=>zn(t,e.value))):zn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),En=H("$ZodNullable",((e,t)=>{It.init(e,t),Te(e._zod,"optin",(()=>t.innerType._zod.optin)),Te(e._zod,"optout",(()=>t.innerType._zod.optout)),Te(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ee(e.source)}|null)$`):void 0})),Te(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)})),An=H("$ZodDefault",((e,t)=>{It.init(e,t),e._zod.optin="optional",Te(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=>Tn(e,t))):Tn(i,t)}}));function Tn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Cn=H("$ZodPrefault",((e,t)=>{It.init(e,t),e._zod.optin="optional",Te(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))})),In=H("$ZodNonOptional",((e,t)=>{It.init(e,t),Te(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=>Nn(t,e))):Nn(o,e)}}));function Nn(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 Rn=H("$ZodCatch",((e,t)=>{It.init(e,t),Te(e._zod,"optin",(()=>t.innerType._zod.optin)),Te(e._zod,"optout",(()=>t.innerType._zod.optout)),Te(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=>Be(e,n,Q())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Be(e,n,Q())))},input:e.value}),e.issues=[]),e)}})),Sn=H("$ZodPipe",((e,t)=>{It.init(e,t),Te(e._zod,"values",(()=>t.in._zod.values)),Te(e._zod,"optin",(()=>t.in._zod.optin)),Te(e._zod,"optout",(()=>t.out._zod.optout)),Te(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=>On(e,t.in,n))):On(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>On(e,t.out,n))):On(i,t.out,n)}}));function On(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const $n=H("$ZodReadonly",((e,t)=>{It.init(e,t),Te(e._zod,"propValues",(()=>t.innerType._zod.propValues)),Te(e._zod,"values",(()=>t.innerType._zod.values)),Te(e._zod,"optin",(()=>t.innerType._zod.optin)),Te(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(xn):xn(i)}}));function xn(e){return e.value=Object.freeze(e.value),e}const Zn=H("$ZodCustom",((e,t)=>{Ve.init(e,t),It.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=>Fn(t,n,i,e)));Fn(o,n,i,e)}}));function Fn(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(qe(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Dn{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 jn(){return new Dn}const Un=jn();function Mn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...je(t)})}function Gn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...je(t)})}function Ln(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...je(t)})}function Bn(e,t){return new Qe({check:"less_than",...je(t),value:e,inclusive:!1})}function Hn(e,t){return new Qe({check:"less_than",...je(t),value:e,inclusive:!0})}function qn(e,t){return new We({check:"greater_than",...je(t),value:e,inclusive:!1})}function Vn(e,t){return new We({check:"greater_than",...je(t),value:e,inclusive:!0})}function Yn(e,t){return new Je({check:"multiple_of",...je(t),value:e})}function Qn(e,t){return new Xe({check:"max_length",...je(t),maximum:e})}function Wn(e,t){return new et({check:"min_length",...je(t),minimum:e})}function Jn(e,t){return new tt({check:"length_equals",...je(t),length:e})}function Kn(e){return new ut({check:"overwrite",tx:e})}const Xn=H("ZodISODateTime",((e,t)=>{Lt.init(e,t),bi.init(e,t)}));const ei=H("ZodISODate",((e,t)=>{Bt.init(e,t),bi.init(e,t)}));const ti=H("ZodISOTime",((e,t)=>{Ht.init(e,t),bi.init(e,t)}));const ni=H("ZodISODuration",((e,t)=>{qt.init(e,t),bi.init(e,t)}));const ii=(e,t)=>{pt.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,ke,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ke,2)}},isEmpty:{get:()=>0===e.issues.length}})},oi=(H("ZodError",ii),H("ZodError",ii,{Parent:Error})),ri=ht(oi),ai=mt(oi),si=gt(oi),ci=yt(oi),ui=Pt(oi),di=bt(oi),li=kt(oi),pi=zt(oi),fi=wt(oi),hi=Et(oi),mi=At(oi),gi=Tt(oi),vi=H("ZodType",((e,t)=>(It.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)=>De(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ri(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>si(e,t,n),e.parseAsync=async(t,n)=>ai(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ci(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ui(e,t,n),e.decode=(t,n)=>di(e,t,n),e.encodeAsync=async(t,n)=>li(e,t,n),e.decodeAsync=async(t,n)=>pi(e,t,n),e.safeEncode=(t,n)=>fi(e,t,n),e.safeDecode=(t,n)=>hi(e,t,n),e.safeEncodeAsync=async(t,n)=>mi(e,t,n),e.safeDecodeAsync=async(t,n)=>gi(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,...je(n)})}(Po,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Ve({check:"custom",...je(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(qe(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(qe(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Kn(t)),e.optional=()=>uo(e),e.nullable=()=>po(e),e.nullish=()=>uo(po(e)),e.nonoptional=t=>function(e,t){return new mo({type:"nonoptional",innerType:e,...je(t)})}(e,t),e.array=()=>Xi(e),e.or=t=>function(e,t){return new no({type:"union",options:e,...je(t)})}([e,t]),e.and=t=>new io({type:"intersection",left:e,right:t}),e.transform=t=>yo(e,so(t)),e.default=t=>{return n=t,new fo({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():xe(n)}});var n},e.prefault=t=>{return n=t,new ho({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():xe(n)}});var n},e.catch=t=>{return new go({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>yo(e,t),e.readonly=()=>new _o({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Un.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Un.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Un.get(e);const n=e.clone();return Un.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),yi=H("_ZodString",((e,t)=>{Nt.init(e,t),vi.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 it({check:"string_format",format:"regex",...je(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new at({check:"string_format",format:"includes",...je(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new st({check:"string_format",format:"starts_with",...je(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new ct({check:"string_format",format:"ends_with",...je(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Wn(...t)),e.max=(...t)=>e.check(Qn(...t)),e.length=(...t)=>e.check(Jn(...t)),e.nonempty=(...t)=>e.check(Wn(1,...t)),e.lowercase=t=>e.check(function(e){return new ot({check:"string_format",format:"lowercase",...je(e)})}(t)),e.uppercase=t=>e.check(function(e){return new rt({check:"string_format",format:"uppercase",...je(e)})}(t)),e.trim=()=>e.check(Kn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Kn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Kn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Kn((e=>e.toUpperCase())))})),_i=H("ZodString",((e,t)=>{Nt.init(e,t),yi.init(e,t),e.email=t=>e.check(Mn(ki,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...je(t)})}(Ai,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...je(t)})}(Mi,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...je(t)})}(Ti,t)),e.guid=t=>e.check(Gn(wi,t)),e.uuid=t=>e.check(Ln(Ei,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...je(t)})}(Ei,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...je(t)})}(Ei,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...je(t)})}(Ei,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...je(t)})}(Ci,t)),e.guid=t=>e.check(Gn(wi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...je(t)})}(Ii,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...je(t)})}(Ni,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...je(t)})}(Ri,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...je(t)})}(Di,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...je(t)})}(ji,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...je(t)})}(Si,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...je(t)})}(Oi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...je(t)})}($i,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...je(t)})}(xi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...je(t)})}(Zi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...je(t)})}(Fi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...je(t)})}(Ui,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,...je(t)})}(Xn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...je(t)})}(ei,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,...je(t)})}(ti,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...je(t)})}(ni,e)}(t))}));function Pi(e){return function(e,t){return new e({type:"string",...je(t)})}(_i,e)}const bi=H("ZodStringFormat",((e,t)=>{Rt.init(e,t),yi.init(e,t)})),ki=H("ZodEmail",((e,t)=>{$t.init(e,t),bi.init(e,t)}));function zi(e){return Mn(ki,e)}const wi=H("ZodGUID",((e,t)=>{St.init(e,t),bi.init(e,t)})),Ei=H("ZodUUID",((e,t)=>{Ot.init(e,t),bi.init(e,t)})),Ai=H("ZodURL",((e,t)=>{xt.init(e,t),bi.init(e,t)})),Ti=H("ZodEmoji",((e,t)=>{Zt.init(e,t),bi.init(e,t)})),Ci=H("ZodNanoID",((e,t)=>{Ft.init(e,t),bi.init(e,t)})),Ii=H("ZodCUID",((e,t)=>{Dt.init(e,t),bi.init(e,t)})),Ni=H("ZodCUID2",((e,t)=>{jt.init(e,t),bi.init(e,t)})),Ri=H("ZodULID",((e,t)=>{Ut.init(e,t),bi.init(e,t)})),Si=H("ZodXID",((e,t)=>{Mt.init(e,t),bi.init(e,t)})),Oi=H("ZodKSUID",((e,t)=>{Gt.init(e,t),bi.init(e,t)})),$i=H("ZodIPv4",((e,t)=>{Vt.init(e,t),bi.init(e,t)})),xi=H("ZodIPv6",((e,t)=>{Yt.init(e,t),bi.init(e,t)})),Zi=H("ZodCIDRv4",((e,t)=>{Qt.init(e,t),bi.init(e,t)})),Fi=H("ZodCIDRv6",((e,t)=>{Wt.init(e,t),bi.init(e,t)})),Di=H("ZodBase64",((e,t)=>{Kt.init(e,t),bi.init(e,t)})),ji=H("ZodBase64URL",((e,t)=>{Xt.init(e,t),bi.init(e,t)})),Ui=H("ZodE164",((e,t)=>{en.init(e,t),bi.init(e,t)})),Mi=H("ZodJWT",((e,t)=>{tn.init(e,t),bi.init(e,t)})),Gi=H("ZodNumber",((e,t)=>{nn.init(e,t),vi.init(e,t),e.gt=(t,n)=>e.check(qn(t,n)),e.gte=(t,n)=>e.check(Vn(t,n)),e.min=(t,n)=>e.check(Vn(t,n)),e.lt=(t,n)=>e.check(Bn(t,n)),e.lte=(t,n)=>e.check(Hn(t,n)),e.max=(t,n)=>e.check(Hn(t,n)),e.int=t=>e.check(Hi(t)),e.safe=t=>e.check(Hi(t)),e.positive=t=>e.check(qn(0,t)),e.nonnegative=t=>e.check(Vn(0,t)),e.negative=t=>e.check(Bn(0,t)),e.nonpositive=t=>e.check(Hn(0,t)),e.multipleOf=(t,n)=>e.check(Yn(t,n)),e.step=(t,n)=>e.check(Yn(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 Li(e){return function(e,t){return new e({type:"number",checks:[],...je(t)})}(Gi,e)}const Bi=H("ZodNumberFormat",((e,t)=>{on.init(e,t),Gi.init(e,t)}));function Hi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...je(t)})}(Bi,e)}const qi=H("ZodBoolean",((e,t)=>{rn.init(e,t),vi.init(e,t)}));const Vi=H("ZodUnknown",((e,t)=>{an.init(e,t),vi.init(e,t)}));function Yi(){return new Vi({type:"unknown"})}const Qi=H("ZodNever",((e,t)=>{sn.init(e,t),vi.init(e,t)}));function Wi(e){return function(e,t){return new e({type:"never",...je(t)})}(Qi,e)}const Ji=H("ZodDate",((e,t)=>{cn.init(e,t),vi.init(e,t),e.min=(t,n)=>e.check(Vn(t,n)),e.max=(t,n)=>e.check(Hn(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 Ki=H("ZodArray",((e,t)=>{dn.init(e,t),vi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Wn(t,n)),e.nonempty=t=>e.check(Wn(1,t)),e.max=(t,n)=>e.check(Qn(t,n)),e.length=(t,n)=>e.check(Jn(t,n)),e.unwrap=()=>e.element}));function Xi(e,t){return function(e,t,n){return new e({type:"array",element:t,...je(n)})}(Ki,e,t)}const eo=H("ZodObject",((e,t)=>{mn.init(e,t),vi.init(e,t),Te(e,"shape",(()=>t.shape)),e.keyof=()=>ro(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Yi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Yi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Wi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!$e(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=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ce(this,"shape",n),n},checks:[]});return De(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!$e(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 Ce(this,"shape",n),n},checks:e._zod.def.checks};return De(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ce(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return De(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return De(e,Ie(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 Ce(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=Ie(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 Ce(this,"shape",i),i},checks:[]});return De(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=Ie(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 Ce(this,"shape",o),o},checks:[]});return De(t,i)}(co,e,t[0]),e.required=(...t)=>function(e,t,n){const i=Ie(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 Ce(this,"shape",o),o},checks:[]});return De(t,i)}(mo,e,t[0])}));function to(e,t){const n={type:"object",get shape(){var t;return Ce(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...je(t)};return new eo(n)}const no=H("ZodUnion",((e,t)=>{vn.init(e,t),vi.init(e,t),e.options=t.options}));const io=H("ZodIntersection",((e,t)=>{yn.init(e,t),vi.init(e,t)})),oo=H("ZodEnum",((e,t)=>{bn.init(e,t),vi.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 oo({...t,checks:[],...je(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 oo({...t,checks:[],...je(i),entries:o})}}));function ro(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new oo({type:"enum",entries:n,...je(t)})}const ao=H("ZodTransform",((e,t)=>{kn.init(e,t),vi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new V(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(qe(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(qe(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function so(e){return new ao({type:"transform",transform:e})}const co=H("ZodOptional",((e,t)=>{wn.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function uo(e){return new co({type:"optional",innerType:e})}const lo=H("ZodNullable",((e,t)=>{En.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function po(e){return new lo({type:"nullable",innerType:e})}const fo=H("ZodDefault",((e,t)=>{An.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),ho=H("ZodPrefault",((e,t)=>{Cn.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),mo=H("ZodNonOptional",((e,t)=>{In.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),go=H("ZodCatch",((e,t)=>{Rn.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),vo=H("ZodPipe",((e,t)=>{Sn.init(e,t),vi.init(e,t),e.in=t.in,e.out=t.out}));function yo(e,t){return new vo({type:"pipe",in:e,out:t})}const _o=H("ZodReadonly",((e,t)=>{$n.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Po=H("ZodCustom",((e,t)=>{Zn.init(e,t),vi.init(e,t)}));function bo(e,t){return yo(so(e),t)}function ko(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 zo=e=>bo((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),wo=e=>bo((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),Eo=e=>Pi().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Ao=()=>zi("Invalid email address").min(1,"Required"),To=()=>zo(Li("Valid amount required").positive("Positive amount required")),Co=()=>wo(function(e){return function(e,t){return new e({type:"date",...je(t)})}(Ji,e)}("Valid date required").min(new Date,"Date must be in the future")),Io=e=>Pi().max(e,`Maximum length is ${e} characters`),No=to({address1:Eo(100),address2:Io(100).optional(),city:Eo(50),state:Io(50).optional(),postcode:Io(20).optional(),country:Eo(50)}),Ro=to({amount:To(),message:Io(500).nullish(),giverFirstName:Eo(50),giverLastName:Eo(50),giverEmail:Ao(),giverPhone:Eo(31),giverAddress:No,cardHolder:Eo(101),recipientFirstName:Io(50).nullish(),recipientLastName:Io(50).nullish(),recipientEmail:zi("Invalid email address").nullish(),recipientPhone:Io(31).nullish()}),So=Ro.extend({expiry:Co(),notes:Io(500).nullish()}),Oo=to({balance:To(),expiry:Co(),message:Io(500).nullish(),notes:Io(500).nullish(),giverFirstName:Eo(50),giverLastName:Eo(50),giverEmail:Ao(),giverPhone:Eo(31),cardHolder:Eo(101),recipientEmail:zi("Invalid email address").nullish(),recipientPhone:Io(31).nullish()});let $o;!function(e){e.Passthrough="Passthrough",e.PaymentProcessor="PaymentProcessor"}($o||($o={}));const xo=to({companyId:Li().int().positive(),amount:To(),currency:Eo(3).default("AUD")}),Zo=to({sessionId:Eo(100),resultCode:Eo(50),pspReference:Io(100).optional()}),Fo=to({cardHolder:Eo(100),cardNumberToken:Io(200),cardCvcToken:Io(200),cardExpiry:Io(5)}),Do=Ro.extend({companyId:Li().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...je(t)})}(qi,e)}().default(!0),payment:Zo.optional(),passthroughPayment:Fo.optional()}),jo=to({giftCardId:Li().int().positive(),reason:Io(500).optional()}),Uo=to({companyId:Li().int().positive().nullish(),code:Eo(10),password:Eo(10)}),Mo=Uo.extend({amount:To(),description:Eo(200)});let Go,Lo,Bo,Ho,qo,Vo;!function(e){e.Adyen="Adyen"}(Go||(Go={})),function(e){e.Pending="Pending",e.Authorized="Authorized",e.Captured="Captured",e.Failed="Failed",e.Refunded="Refunded"}(Lo||(Lo={})),function(e){e.Authorised="Authorised",e.Refused="Refused",e.Cancelled="Cancelled",e.Pending="Pending",e.Received="Received",e.Error="Error",e.IdentifyShopper="IdentifyShopper",e.ChallengeShopper="ChallengeShopper"}(Bo||(Bo={})),function(e){e.AUTHORISATION="AUTHORISATION",e.CAPTURE="CAPTURE",e.REFUND="REFUND",e.CANCELLATION="CANCELLATION",e.REFUND_FAILED="REFUND_FAILED",e.CAPTURE_FAILED="CAPTURE_FAILED"}(Ho||(Ho={})),function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(qo||(qo={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(Vo||(Vo={}));const Yo=to({code:Eo(10),token:Eo(128)}),Qo=to({companyId:Li().int().positive(),code:Eo(10),token:Eo(128)}),Wo=to({companyId:(Jo=Gi,new Jo({type:"number",coerce:!0,checks:[],...je(void 0)})).int().positive()});var Jo;const Ko=to({giftCardPaymentType:ro([$o.Passthrough,$o.PaymentProcessor])}),Xo=to({merchantAccount:Eo(100),clientKey:Eo(100),apiKey:Io(200).optional(),webhookHmacKey:Io(200).optional()}),er=to({grant_type:Pi().readonly().default("refresh_token"),client_id:Ln(Ei,void 0),client_secret:Pi(),refresh_token:Pi(),scope:Pi().optional()}),tr=to({email:zi(),firstName:Pi().max(100).optional(),lastName:Pi().max(100).optional(),phone:Pi().max(20).optional(),scopes:Xi(Pi()).optional()});let nr,ir,or;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(nr||(nr={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(ir||(ir={})),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",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(or||(or={}));const rr=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},ar=require("decimal.js");var sr=e.n(ar);const cr=e=>new(sr())(e).toDecimalPlaces(2).toNumber();function ur(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=cr(n);switch(e.feeType){case Z.PercentageOfBooking:if(o)return cr(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return cr(s/(1-t)*e.amount/(100+e.amount))}return cr(s*(e.amount/100));case Z.FixedChargePerRoom:case Z.FixedChargePerBooking:return e.amount;case Z.NightlyChargePerRoom:return cr(e.amount*i);default:return 0}}const dr=[Z.FixedChargePerBooking],lr=[Z.PercentageOfBooking,Z.FixedChargePerRoom,Z.NightlyChargePerRoom],pr=[Z.PercentageOfBooking];function fr(e,t){return e.filter((e=>t.includes(e.feeType)))}function hr(e){return fr(e,dr)}function mr(e){return fr(e,lr)}function gr(e){return fr(e,pr)}function vr(e){return{includeInRates:[Z.PercentageOfBooking,Z.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===Z.PercentageOfBooking,appliesToAddons:e===Z.PercentageOfBooking,includePreviousFeesInCalculation:e===Z.PercentageOfBooking}}const yr=e=>e,_r=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Pr=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class br{}function kr(e){return e.toUpperCase()}br.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===L.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===L.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 B.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},br.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=br.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))),B.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})),br.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=br.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})),br.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+=br.calculateReservationAddonTotal(o,t)?.total}})),cr(n)},module.exports=t})();
|
|
@@ -38,6 +38,10 @@ export interface IMetaUserData {
|
|
|
38
38
|
country?: string;
|
|
39
39
|
external_id?: string;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Meta user data field keys
|
|
43
|
+
*/
|
|
44
|
+
export declare const META_USER_DATA_KEYS: readonly ["em", "ph", "fn", "ln", "ct", "st", "zp", "country", "external_id"];
|
|
41
45
|
/**
|
|
42
46
|
* Analytics event request payload
|
|
43
47
|
*/
|
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,a,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>L,AddGiftCardSchema:()=>Ro,AdyenEventCode:()=>Bo,AdyenResultCode:()=>Lo,BaseGiftCardSchema:()=>No,CancelGiftCardTransactionSchema:()=>Yo,CompleteGiftCardTransactionSchema:()=>Vo,CreatePaymentSessionSchema:()=>$o,DATE_FORMAT:()=>$,EAddonPricingType:()=>D,EAdminCompanyUserRole:()=>f,EBookingCustomFieldFormat:()=>n,EBookingFlow:()=>t,EBookingPaymentMethod:()=>r,EBookingStatus:()=>e,ECompanyProvider:()=>p,EDistanceUnitType:()=>P,EFeeType:()=>Z,EGiftCardPaymentProvider:()=>Mo,EGiftCardPaymentStatus:()=>Go,EGiftCardPaymentType:()=>Oo,EGiftCardTransactionType:()=>Ho,EGuaranteePolicyDepositMode:()=>T,EHotelAddressRequirement:()=>h,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>m,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>v,EIntegration:()=>y,ELogCategory:()=>nr,ELogSeverity:()=>tr,ELogType:()=>ir,EMembershipProvider:()=>A,EPlanpayBookingStatus:()=>s,EPromoCodeDiscountType:()=>C,EPromoCodeStayDateRangeRepeatType:()=>N,EPromoCodeStayDateRangeType:()=>I,ERMSAuthSyncHistoryStatus:()=>b,ERMSDiscountType:()=>k,ERMSSyncStrategy:()=>z,ERoomstayEventName:()=>F,ERoomstayEventSource:()=>R,ERoomstayImageSize:()=>w,ETransactionStatus:()=>qo,EditGiftCardSchema:()=>So,GetCompanyConfigSchema:()=>Qo,GuestProfile:()=>l,HttpMethod:()=>x,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>E,InternationalAddressSchema:()=>Io,ItineraryResponse:()=>u,PCIBookingCardProcessorTypes:()=>c,Package:()=>S,PassthroughPaymentDataSchema:()=>Zo,PaymentProcessorDataSchema:()=>xo,PurchaseGiftCardSchema:()=>Fo,RedeemGiftCardSchema:()=>Uo,RefreshGiftCardTokenSchema:()=>Xo,RefundGiftCardSchema:()=>Do,RegisterGiftCardAdminSchema:()=>er,Reservation:()=>d,ReservedPackage:()=>O,TotalCalculator:()=>Pr,UpdateAdyenConfigSchema:()=>Ko,UpdateCompanyConfigSchema:()=>Jo,ValidateGiftCardSchema:()=>jo,calculateFeeAmount:()=>cr,calculateTotalForMemberBooking:()=>or,getFeeOptionValidity:()=>gr,getFilteredBookingAddonFees:()=>mr,getFilteredBookingFees:()=>fr,getFilteredBookingRateFees:()=>hr,maxString:()=>Co,nameof:()=>vr,preprocessDate:()=>zo,preprocessNumber:()=>ko,requireEmail:()=>Eo,requireFutureDate:()=>To,requirePositiveAmount:()=>Ao,requireString:()=>wo,resizeRoomstayImageUrl:()=>_r,roundMoney:()=>sr,subset:()=>yr,toMetaEventName:()=>j,transformToMetaEventData:()=>M,transformToMetaUserData:()=>G,uppercaseString:()=>br,validateFormWithZod:()=>bo}),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.Number="number",e.Text="text",e.Date="date"}(n||(n={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe",e.PayPal="PayPal"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const c=[];class u{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 d{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 l,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 l{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 p,f,h,m,g,v,y,_,P,b,k,z,w,E,A,T,C,I,N,R;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(p||(p={})),function(e){e.SuperAdmin="SuperAdmin",e.Admin="Admin",e.Limited="Limited"}(f||(f={})),function(e){e.FullAddressRequired="FullAddressRequired",e.AddressOptionalCountryRequired="AddressOptionalCountryRequired",e.AddressOptional="AddressOptional"}(h||(h={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(m||(m={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(v||(v={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC",e.AnalyticsEvents="AnalyticsEvents",e.MemberJungle="MemberJungle"}(y||(y={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(P||(P={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(b||(b={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(k||(k={})),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.ClientFacingAreaSync="clientFacingAreaSync",e.NewRateFetch="newRateFetch"}(z||(z={})),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"}(w||(w={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(E||(E={})),function(e){e.Big4="Big4",e.Gday="Gday",e.Internal="Internal",e.MemberJungle="MemberJungle",e.RAC="RAC",e.RmsTop10="RmsTop10",e.Salesforce="Salesforce",e.Top10="Top10"}(A||(A={}));class S{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 O extends S{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"}(T||(T={})),function(e){e.FlatPercent="flatPercent",e.FlatQuantity="flatQuantity",e.FlatQuantityPerStay="flatQuantityPerStay"}(C||(C={})),function(e){e.Allowed="Allowed",e.Blocked="Blocked"}(I||(I={})),function(e){e.None="None",e.Weekly="Weekly",e.MonthlyDayOfWeek="MonthlyDayOfWeek",e.MonthlyDate="MonthlyDate",e.Yearly="Yearly"}(N||(N={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(R||(R={}));const $="DD/MM/YYYY";let x,Z,F,D;function j(e){return{[F.BasketAdd]:"AddToCart",[F.BasketAddAddon]:"AddToCart",[F.ViewCheckout]:"InitiateCheckout",[F.BookingCommitted]:"Purchase"}[e]}function U(e,t,n){let i=0;const o=[],r=[];for(const t of e)i+=t.totalPrice,t.roomCode&&(o.push(t.roomCode),r.push({id:t.roomCode,quantity:1,item_price:t.totalPrice}));if(t)for(const e of t)i+=e.totalPrice,e.addonCode&&(o.push(e.addonCode),r.push({id:e.addonCode,quantity:e.quantity,item_price:e.unitPrice}));return{currency:n,value:i,content_ids:o,content_type:"hotel",contents:r,num_items:e.length+(t?.length??0)}}function M(e){if("addon"in e)return t=e.addon,{currency:e.currency,value:t.totalPrice,content_ids:t.addonCode?[t.addonCode]:[],content_type:"hotel",contents:t.addonCode?[{id:t.addonCode,quantity:t.quantity,item_price:t.unitPrice}]:[],num_items:1};var t;if("item"in e)return U([e.item],void 0,e.currency);if("items"in e){const t=e,n=U(t.items,t.addons,e.currency);return"itineraryNumber"in t&&(n.order_id=t.itineraryNumber),n}throw new Error("Invalid event data")}function G(e){return{em:e.email,ph:e.phone,fn:e.firstName,ln:e.lastName,ct:e.city,st:e.state,zp:e.postalCode,country:e.country,external_id:e.externalId}}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(x||(x={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(Z||(Z={})),function(e){e.BasketAdd="Basket/Add",e.BasketAddAddon="Basket/AddAddon",e.ViewCheckout="View/Checkout",e.BookingCommitted="Booking/Committed"}(F||(F={})),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"}(D||(D={}));const L=[D.PER_NIGHT,D.PER_PERSON_PER_NIGHT,D.PER_QUANTITY_NAME_PER_NIGHT,D.PER_ROOM_QUANTITY_PER_NIGHT,D.PER_PERSON_OCCUPANCY_PER_NIGHT,D.PER_ADULT_OCCUPANCY_PER_NIGHT,D.PER_CHILD_OCCUPANCY_PER_NIGHT,D.PER_ALL_PERSONS_PER_NIGHT];function B(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 H extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class q extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const V={};function Y(e){return e&&Object.assign(V,e),V}const Q=/^[cC][^\s-]{8,}$/,W=/^[0-9a-z]+$/,J=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,K=/^[0-9a-vA-V]{20}$/,X=/^[A-Za-z0-9]{27}$/,ee=/^[a-zA-Z0-9_-]{21}$/,te=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ne=/^([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})$/,ie=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)$/,oe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,re=/^(?:(?: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])$/,ae=/^(([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})$/,se=/^((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])$/,ce=/^(([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])$/,ue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,de=/^[A-Za-z0-9_-]*$/,le=/^(?=.{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])?)*\.?$/,pe=/^\+(?:[0-9]){6,14}[0-9]$/,fe="(?:(?:\\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])))",he=new RegExp(`^${fe}$`);function me(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 ge=/^\d+$/,ve=/^-?\d+(?:\.\d+)?/i,ye=/true|false/i,_e=/^[^A-Z]*$/,Pe=/^[^a-z]*$/;function be(e,t){return"bigint"==typeof t?t.toString():t}function ke(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ze(e){return null==e}function we(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ee=Symbol("evaluating");function Ae(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==Ee)return void 0===i&&(i=Ee,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Te(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ce(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ie(e){return JSON.stringify(e)}const Ne="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Re(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Se=ke((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Oe(e){if(!1===Re(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Re(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function $e(e){return Oe(e)?{...e}:e}const xe=new Set(["string","number","symbol"]);function Ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fe(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function De(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 je={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 Ue(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 Me(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ge(e){return"string"==typeof e?e:e?.message}function Le(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ge(e.inst?._zod.def?.error?.(e))??Ge(t?.error?.(e))??Ge(n.customError?.(e))??Ge(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Be(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function He(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const qe=B("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ve={number:"number",bigint:"bigint",object:"date"},Ye=B("$ZodCheckLessThan",((e,t)=>{qe.init(e,t);const n=Ve[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})}})),Qe=B("$ZodCheckGreaterThan",((e,t)=>{qe.init(e,t);const n=Ve[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})}})),We=B("$ZodCheckMultipleOf",((e,t)=>{qe.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=B("$ZodCheckNumberFormat",((e,t)=>{qe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=je[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=ge)})),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})}})),Ke=B("$ZodCheckMaxLength",((e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ze(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=Be(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Xe=B("$ZodCheckMinLength",((e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ze(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=Be(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),et=B("$ZodCheckLengthEquals",((e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ze(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=Be(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})}})),tt=B("$ZodCheckStringFormat",((e,t)=>{var n,i;qe.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=()=>{})})),nt=B("$ZodCheckRegex",((e,t)=>{tt.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})}})),it=B("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=_e),tt.init(e,t)})),ot=B("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=Pe),tt.init(e,t)})),rt=B("$ZodCheckIncludes",((e,t)=>{qe.init(e,t);const n=Ze(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})}})),at=B("$ZodCheckStartsWith",((e,t)=>{qe.init(e,t);const n=new RegExp(`^${Ze(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})}})),st=B("$ZodCheckEndsWith",((e,t)=>{qe.init(e,t);const n=new RegExp(`.*${Ze(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})}})),ct=B("$ZodCheckOverwrite",((e,t)=>{qe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class ut{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 dt=(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,be,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lt=B("$ZodError",dt),pt=B("$ZodError",dt,{Parent:Error}),ft=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 H;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Le(e,r,Y()))));throw Ne(t,o?.callee),t}return a.value},ht=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=>Le(e,r,Y()))));throw Ne(t,o?.callee),t}return a.value},mt=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 H;return r.issues.length?{success:!1,error:new(e??lt)(r.issues.map((e=>Le(e,o,Y()))))}:{success:!0,data:r.value}},gt=mt(pt),vt=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=>Le(e,o,Y()))))}:{success:!0,data:r.value}},yt=vt(pt),_t=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ft(e)(t,n,o)},Pt=e=>(t,n,i)=>ft(e)(t,n,i),bt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ht(e)(t,n,o)},kt=e=>async(t,n,i)=>ht(e)(t,n,i),zt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mt(e)(t,n,o)},wt=e=>(t,n,i)=>mt(e)(t,n,i),Et=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return vt(e)(t,n,o)},At=e=>async(t,n,i)=>vt(e)(t,n,i),Tt={major:4,minor:1,patch:5},Ct=B("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Tt;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=Ue(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 H;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Ue(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ue(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ue(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new H;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 H;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=gt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return yt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),It=B("$ZodString",((e,t)=>{var n;Ct.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}})),Nt=B("$ZodStringFormat",((e,t)=>{tt.init(e,t),It.init(e,t)})),Rt=B("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=ne),Nt.init(e,t)})),St=B("$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=ie(e))}else t.pattern??(t.pattern=ie());Nt.init(e,t)})),Ot=B("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=oe),Nt.init(e,t)})),$t=B("$ZodURL",((e,t)=>{Nt.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:le.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})}}})),xt=B("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Nt.init(e,t)})),Zt=B("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=ee),Nt.init(e,t)})),Ft=B("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=Q),Nt.init(e,t)})),Dt=B("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=W),Nt.init(e,t)})),jt=B("$ZodULID",((e,t)=>{t.pattern??(t.pattern=J),Nt.init(e,t)})),Ut=B("$ZodXID",((e,t)=>{t.pattern??(t.pattern=K),Nt.init(e,t)})),Mt=B("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=X),Nt.init(e,t)})),Gt=B("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=me({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(`^${fe}T(?:${i})$`)}(t)),Nt.init(e,t)})),Lt=B("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=he),Nt.init(e,t)})),Bt=B("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${me(t)}$`)),Nt.init(e,t)})),Ht=B("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=te),Nt.init(e,t)})),qt=B("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=re),Nt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Vt=B("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ae),Nt.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})}}})),Yt=B("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=se),Nt.init(e,t)})),Qt=B("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=ce),Nt.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 Wt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Jt=B("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=ue),Nt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Wt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Kt=B("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=de),Nt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!de.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Wt(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})}})),Xt=B("$ZodE164",((e,t)=>{t.pattern??(t.pattern=pe),Nt.init(e,t)})),en=B("$ZodJWT",((e,t)=>{Nt.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})}})),tn=B("$ZodNumber",((e,t)=>{Ct.init(e,t),e._zod.pattern=e._zod.bag.pattern??ve,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}})),nn=B("$ZodNumber",((e,t)=>{Je.init(e,t),tn.init(e,t)})),on=B("$ZodBoolean",((e,t)=>{Ct.init(e,t),e._zod.pattern=ye,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}})),rn=B("$ZodUnknown",((e,t)=>{Ct.init(e,t),e._zod.parse=e=>e})),an=B("$ZodNever",((e,t)=>{Ct.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),sn=B("$ZodDate",((e,t)=>{Ct.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 cn(e,t,n){e.issues.length&&t.issues.push(...Me(n,e.issues)),t.value[n]=e.value}const un=B("$ZodArray",((e,t)=>{Ct.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=>cn(t,n,e)))):cn(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function dn(e,t,n,i){e.issues.length&&t.issues.push(...Me(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function ln(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 pn(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=>dn(e,n,o,t)))):dn(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 fn=B("$ZodObject",((e,t)=>{Ct.init(e,t);const n=ke((()=>ln(t)));Ae(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=Re,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=>dn(n,t,e,s)))):dn(n,t,e,s)}return o?pn(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),hn=B("$ZodObjectJIT",((e,t)=>{fn.init(e,t);const n=e._zod.parse,i=ke((()=>ln(t)));let o;const r=Re,a=!V.jitless,s=a&&Se.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 ut(["shape","payload","ctx"]),n=i.value,o=e=>{const t=Ie(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=Ie(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?pn([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function mn(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=>!Ue(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=>Le(e,i,Y())))))}),t)}const gn=B("$ZodUnion",((e,t)=>{Ct.init(e,t),Ae(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),Ae(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),Ae(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),Ae(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=>we(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=>mn(t,o,e,r))):mn(s,o,e,r)}})),vn=B("$ZodIntersection",((e,t)=>{Ct.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])=>_n(e,t,n))):_n(e,o,r)}}));function yn(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(Oe(e)&&Oe(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=yn(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=yn(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 _n(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ue(e))return e;const i=yn(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 Pn=B("$ZodEnum",((e,t)=>{Ct.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=>xe.has(typeof e))).map((e=>"string"==typeof e?Ze(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}})),bn=B("$ZodTransform",((e,t)=>{Ct.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new q(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 H;return n.value=o,n}}));function kn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const zn=B("$ZodOptional",((e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),Ae(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${we(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=>kn(t,e.value))):kn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),wn=B("$ZodNullable",((e,t)=>{Ct.init(e,t),Ae(e._zod,"optin",(()=>t.innerType._zod.optin)),Ae(e._zod,"optout",(()=>t.innerType._zod.optout)),Ae(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${we(e.source)}|null)$`):void 0})),Ae(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)})),En=B("$ZodDefault",((e,t)=>{Ct.init(e,t),e._zod.optin="optional",Ae(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=>An(e,t))):An(i,t)}}));function An(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Tn=B("$ZodPrefault",((e,t)=>{Ct.init(e,t),e._zod.optin="optional",Ae(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))})),Cn=B("$ZodNonOptional",((e,t)=>{Ct.init(e,t),Ae(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=>In(t,e))):In(o,e)}}));function In(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 Nn=B("$ZodCatch",((e,t)=>{Ct.init(e,t),Ae(e._zod,"optin",(()=>t.innerType._zod.optin)),Ae(e._zod,"optout",(()=>t.innerType._zod.optout)),Ae(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=>Le(e,n,Y())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Le(e,n,Y())))},input:e.value}),e.issues=[]),e)}})),Rn=B("$ZodPipe",((e,t)=>{Ct.init(e,t),Ae(e._zod,"values",(()=>t.in._zod.values)),Ae(e._zod,"optin",(()=>t.in._zod.optin)),Ae(e._zod,"optout",(()=>t.out._zod.optout)),Ae(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=>Sn(e,t.in,n))):Sn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>Sn(e,t.out,n))):Sn(i,t.out,n)}}));function Sn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const On=B("$ZodReadonly",((e,t)=>{Ct.init(e,t),Ae(e._zod,"propValues",(()=>t.innerType._zod.propValues)),Ae(e._zod,"values",(()=>t.innerType._zod.values)),Ae(e._zod,"optin",(()=>t.innerType._zod.optin)),Ae(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($n):$n(i)}}));function $n(e){return e.value=Object.freeze(e.value),e}const xn=B("$ZodCustom",((e,t)=>{qe.init(e,t),Ct.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=>Zn(t,n,i,e)));Zn(o,n,i,e)}}));function Zn(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(He(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Fn{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 Dn(){return new Fn}const jn=Dn();function Un(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function Mn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function Gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function Ln(e,t){return new Ye({check:"less_than",...De(t),value:e,inclusive:!1})}function Bn(e,t){return new Ye({check:"less_than",...De(t),value:e,inclusive:!0})}function Hn(e,t){return new Qe({check:"greater_than",...De(t),value:e,inclusive:!1})}function qn(e,t){return new Qe({check:"greater_than",...De(t),value:e,inclusive:!0})}function Vn(e,t){return new We({check:"multiple_of",...De(t),value:e})}function Yn(e,t){return new Ke({check:"max_length",...De(t),maximum:e})}function Qn(e,t){return new Xe({check:"min_length",...De(t),minimum:e})}function Wn(e,t){return new et({check:"length_equals",...De(t),length:e})}function Jn(e){return new ct({check:"overwrite",tx:e})}const Kn=B("ZodISODateTime",((e,t)=>{Gt.init(e,t),Pi.init(e,t)}));const Xn=B("ZodISODate",((e,t)=>{Lt.init(e,t),Pi.init(e,t)}));const ei=B("ZodISOTime",((e,t)=>{Bt.init(e,t),Pi.init(e,t)}));const ti=B("ZodISODuration",((e,t)=>{Ht.init(e,t),Pi.init(e,t)}));const ni=(e,t)=>{lt.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,be,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,be,2)}},isEmpty:{get:()=>0===e.issues.length}})},ii=(B("ZodError",ni),B("ZodError",ni,{Parent:Error})),oi=ft(ii),ri=ht(ii),ai=mt(ii),si=vt(ii),ci=_t(ii),ui=Pt(ii),di=bt(ii),li=kt(ii),pi=zt(ii),fi=wt(ii),hi=Et(ii),mi=At(ii),gi=B("ZodType",((e,t)=>(Ct.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)=>Fe(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>oi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ai(e,t,n),e.parseAsync=async(t,n)=>ri(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>si(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ci(e,t,n),e.decode=(t,n)=>ui(e,t,n),e.encodeAsync=async(t,n)=>di(e,t,n),e.decodeAsync=async(t,n)=>li(e,t,n),e.safeEncode=(t,n)=>pi(e,t,n),e.safeDecode=(t,n)=>fi(e,t,n),e.safeEncodeAsync=async(t,n)=>hi(e,t,n),e.safeDecodeAsync=async(t,n)=>mi(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,...De(n)})}(_o,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new qe({check:"custom",...De(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(He(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(He(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Jn(t)),e.optional=()=>co(e),e.nullable=()=>lo(e),e.nullish=()=>co(lo(e)),e.nonoptional=t=>function(e,t){return new ho({type:"nonoptional",innerType:e,...De(t)})}(e,t),e.array=()=>Ki(e),e.or=t=>function(e,t){return new to({type:"union",options:e,...De(t)})}([e,t]),e.and=t=>new no({type:"intersection",left:e,right:t}),e.transform=t=>vo(e,ao(t)),e.default=t=>{return n=t,new po({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():$e(n)}});var n},e.prefault=t=>{return n=t,new fo({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():$e(n)}});var n},e.catch=t=>{return new mo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>vo(e,t),e.readonly=()=>new yo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return jn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>jn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return jn.get(e);const n=e.clone();return jn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),vi=B("_ZodString",((e,t)=>{It.init(e,t),gi.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 nt({check:"string_format",format:"regex",...De(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new rt({check:"string_format",format:"includes",...De(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new at({check:"string_format",format:"starts_with",...De(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new st({check:"string_format",format:"ends_with",...De(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Qn(...t)),e.max=(...t)=>e.check(Yn(...t)),e.length=(...t)=>e.check(Wn(...t)),e.nonempty=(...t)=>e.check(Qn(1,...t)),e.lowercase=t=>e.check(function(e){return new it({check:"string_format",format:"lowercase",...De(e)})}(t)),e.uppercase=t=>e.check(function(e){return new ot({check:"string_format",format:"uppercase",...De(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())))})),yi=B("ZodString",((e,t)=>{It.init(e,t),vi.init(e,t),e.email=t=>e.check(Un(bi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}(Ei,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}(Ui,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}(Ai,t)),e.guid=t=>e.check(Mn(zi,t)),e.uuid=t=>e.check(Gn(wi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}(wi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}(wi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}(wi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}(Ti,t)),e.guid=t=>e.check(Mn(zi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}(Ci,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}(Ii,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}(Ni,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}(Fi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}(Di,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}(Ri,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}(Si,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}(Oi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}($i,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}(xi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}(Zi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}(ji,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,...De(t)})}(Kn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}(Xn,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,...De(t)})}(ei,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}(ti,e)}(t))}));function _i(e){return function(e,t){return new e({type:"string",...De(t)})}(yi,e)}const Pi=B("ZodStringFormat",((e,t)=>{Nt.init(e,t),vi.init(e,t)})),bi=B("ZodEmail",((e,t)=>{Ot.init(e,t),Pi.init(e,t)}));function ki(e){return Un(bi,e)}const zi=B("ZodGUID",((e,t)=>{Rt.init(e,t),Pi.init(e,t)})),wi=B("ZodUUID",((e,t)=>{St.init(e,t),Pi.init(e,t)})),Ei=B("ZodURL",((e,t)=>{$t.init(e,t),Pi.init(e,t)})),Ai=B("ZodEmoji",((e,t)=>{xt.init(e,t),Pi.init(e,t)})),Ti=B("ZodNanoID",((e,t)=>{Zt.init(e,t),Pi.init(e,t)})),Ci=B("ZodCUID",((e,t)=>{Ft.init(e,t),Pi.init(e,t)})),Ii=B("ZodCUID2",((e,t)=>{Dt.init(e,t),Pi.init(e,t)})),Ni=B("ZodULID",((e,t)=>{jt.init(e,t),Pi.init(e,t)})),Ri=B("ZodXID",((e,t)=>{Ut.init(e,t),Pi.init(e,t)})),Si=B("ZodKSUID",((e,t)=>{Mt.init(e,t),Pi.init(e,t)})),Oi=B("ZodIPv4",((e,t)=>{qt.init(e,t),Pi.init(e,t)})),$i=B("ZodIPv6",((e,t)=>{Vt.init(e,t),Pi.init(e,t)})),xi=B("ZodCIDRv4",((e,t)=>{Yt.init(e,t),Pi.init(e,t)})),Zi=B("ZodCIDRv6",((e,t)=>{Qt.init(e,t),Pi.init(e,t)})),Fi=B("ZodBase64",((e,t)=>{Jt.init(e,t),Pi.init(e,t)})),Di=B("ZodBase64URL",((e,t)=>{Kt.init(e,t),Pi.init(e,t)})),ji=B("ZodE164",((e,t)=>{Xt.init(e,t),Pi.init(e,t)})),Ui=B("ZodJWT",((e,t)=>{en.init(e,t),Pi.init(e,t)})),Mi=B("ZodNumber",((e,t)=>{tn.init(e,t),gi.init(e,t),e.gt=(t,n)=>e.check(Hn(t,n)),e.gte=(t,n)=>e.check(qn(t,n)),e.min=(t,n)=>e.check(qn(t,n)),e.lt=(t,n)=>e.check(Ln(t,n)),e.lte=(t,n)=>e.check(Bn(t,n)),e.max=(t,n)=>e.check(Bn(t,n)),e.int=t=>e.check(Bi(t)),e.safe=t=>e.check(Bi(t)),e.positive=t=>e.check(Hn(0,t)),e.nonnegative=t=>e.check(qn(0,t)),e.negative=t=>e.check(Ln(0,t)),e.nonpositive=t=>e.check(Bn(0,t)),e.multipleOf=(t,n)=>e.check(Vn(t,n)),e.step=(t,n)=>e.check(Vn(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 Gi(e){return function(e,t){return new e({type:"number",checks:[],...De(t)})}(Mi,e)}const Li=B("ZodNumberFormat",((e,t)=>{nn.init(e,t),Mi.init(e,t)}));function Bi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}(Li,e)}const Hi=B("ZodBoolean",((e,t)=>{on.init(e,t),gi.init(e,t)}));const qi=B("ZodUnknown",((e,t)=>{rn.init(e,t),gi.init(e,t)}));function Vi(){return new qi({type:"unknown"})}const Yi=B("ZodNever",((e,t)=>{an.init(e,t),gi.init(e,t)}));function Qi(e){return function(e,t){return new e({type:"never",...De(t)})}(Yi,e)}const Wi=B("ZodDate",((e,t)=>{sn.init(e,t),gi.init(e,t),e.min=(t,n)=>e.check(qn(t,n)),e.max=(t,n)=>e.check(Bn(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=B("ZodArray",((e,t)=>{un.init(e,t),gi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Qn(t,n)),e.nonempty=t=>e.check(Qn(1,t)),e.max=(t,n)=>e.check(Yn(t,n)),e.length=(t,n)=>e.check(Wn(t,n)),e.unwrap=()=>e.element}));function Ki(e,t){return function(e,t,n){return new e({type:"array",element:t,...De(n)})}(Ji,e,t)}const Xi=B("ZodObject",((e,t)=>{hn.init(e,t),gi.init(e,t),Ae(e,"shape",(()=>t.shape)),e.keyof=()=>oo(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Qi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Oe(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=Ce(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Te(this,"shape",n),n},checks:[]});return Fe(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Oe(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 Te(this,"shape",n),n},checks:e._zod.def.checks};return Fe(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ce(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Te(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Fe(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Fe(e,Ce(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 Te(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=Ce(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 Te(this,"shape",i),i},checks:[]});return Fe(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=Ce(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 Te(this,"shape",o),o},checks:[]});return Fe(t,i)}(so,e,t[0]),e.required=(...t)=>function(e,t,n){const i=Ce(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 Te(this,"shape",o),o},checks:[]});return Fe(t,i)}(ho,e,t[0])}));function eo(e,t){const n={type:"object",get shape(){var t;return Te(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...De(t)};return new Xi(n)}const to=B("ZodUnion",((e,t)=>{gn.init(e,t),gi.init(e,t),e.options=t.options}));const no=B("ZodIntersection",((e,t)=>{vn.init(e,t),gi.init(e,t)})),io=B("ZodEnum",((e,t)=>{Pn.init(e,t),gi.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 io({...t,checks:[],...De(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 io({...t,checks:[],...De(i),entries:o})}}));function oo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new io({type:"enum",entries:n,...De(t)})}const ro=B("ZodTransform",((e,t)=>{bn.init(e,t),gi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new q(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(He(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(He(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function ao(e){return new ro({type:"transform",transform:e})}const so=B("ZodOptional",((e,t)=>{zn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function co(e){return new so({type:"optional",innerType:e})}const uo=B("ZodNullable",((e,t)=>{wn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function lo(e){return new uo({type:"nullable",innerType:e})}const po=B("ZodDefault",((e,t)=>{En.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),fo=B("ZodPrefault",((e,t)=>{Tn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ho=B("ZodNonOptional",((e,t)=>{Cn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),mo=B("ZodCatch",((e,t)=>{Nn.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),go=B("ZodPipe",((e,t)=>{Rn.init(e,t),gi.init(e,t),e.in=t.in,e.out=t.out}));function vo(e,t){return new go({type:"pipe",in:e,out:t})}const yo=B("ZodReadonly",((e,t)=>{On.init(e,t),gi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),_o=B("ZodCustom",((e,t)=>{xn.init(e,t),gi.init(e,t)}));function Po(e,t){return vo(ao(e),t)}function bo(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 ko=e=>Po((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),zo=e=>Po((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),wo=e=>_i().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Eo=()=>ki("Invalid email address").min(1,"Required"),Ao=()=>ko(Gi("Valid amount required").positive("Positive amount required")),To=()=>zo(function(e){return function(e,t){return new e({type:"date",...De(t)})}(Wi,e)}("Valid date required").min(new Date,"Date must be in the future")),Co=e=>_i().max(e,`Maximum length is ${e} characters`),Io=eo({address1:wo(100),address2:Co(100).optional(),city:wo(50),state:Co(50).optional(),postcode:Co(20).optional(),country:wo(50)}),No=eo({amount:Ao(),message:Co(500).nullish(),giverFirstName:wo(50),giverLastName:wo(50),giverEmail:Eo(),giverPhone:wo(31),giverAddress:Io,cardHolder:wo(101),recipientFirstName:Co(50).nullish(),recipientLastName:Co(50).nullish(),recipientEmail:ki("Invalid email address").nullish(),recipientPhone:Co(31).nullish()}),Ro=No.extend({expiry:To(),notes:Co(500).nullish()}),So=eo({balance:Ao(),expiry:To(),message:Co(500).nullish(),notes:Co(500).nullish(),giverFirstName:wo(50),giverLastName:wo(50),giverEmail:Eo(),giverPhone:wo(31),cardHolder:wo(101),recipientEmail:ki("Invalid email address").nullish(),recipientPhone:Co(31).nullish()});let Oo;!function(e){e.Passthrough="Passthrough",e.PaymentProcessor="PaymentProcessor"}(Oo||(Oo={}));const $o=eo({companyId:Gi().int().positive(),amount:Ao(),currency:wo(3).default("AUD")}),xo=eo({sessionId:wo(100),resultCode:wo(50),pspReference:Co(100).optional()}),Zo=eo({cardHolder:wo(100),cardNumberToken:Co(200),cardCvcToken:Co(200),cardExpiry:Co(5)}),Fo=No.extend({companyId:Gi().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...De(t)})}(Hi,e)}().default(!0),payment:xo.optional(),passthroughPayment:Zo.optional()}),Do=eo({giftCardId:Gi().int().positive(),reason:Co(500).optional()}),jo=eo({companyId:Gi().int().positive().nullish(),code:wo(10),password:wo(10)}),Uo=jo.extend({amount:Ao(),description:wo(200)});let Mo,Go,Lo,Bo,Ho,qo;!function(e){e.Adyen="Adyen"}(Mo||(Mo={})),function(e){e.Pending="Pending",e.Authorized="Authorized",e.Captured="Captured",e.Failed="Failed",e.Refunded="Refunded"}(Go||(Go={})),function(e){e.Authorised="Authorised",e.Refused="Refused",e.Cancelled="Cancelled",e.Pending="Pending",e.Received="Received",e.Error="Error",e.IdentifyShopper="IdentifyShopper",e.ChallengeShopper="ChallengeShopper"}(Lo||(Lo={})),function(e){e.AUTHORISATION="AUTHORISATION",e.CAPTURE="CAPTURE",e.REFUND="REFUND",e.CANCELLATION="CANCELLATION",e.REFUND_FAILED="REFUND_FAILED",e.CAPTURE_FAILED="CAPTURE_FAILED"}(Bo||(Bo={})),function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(Ho||(Ho={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(qo||(qo={}));const Vo=eo({code:wo(10),token:wo(128)}),Yo=eo({companyId:Gi().int().positive(),code:wo(10),token:wo(128)}),Qo=eo({companyId:(Wo=Mi,new Wo({type:"number",coerce:!0,checks:[],...De(void 0)})).int().positive()});var Wo;const Jo=eo({giftCardPaymentType:oo([Oo.Passthrough,Oo.PaymentProcessor])}),Ko=eo({merchantAccount:wo(100),clientKey:wo(100),apiKey:Co(200).optional(),webhookHmacKey:Co(200).optional()}),Xo=eo({grant_type:_i().readonly().default("refresh_token"),client_id:Gn(wi,void 0),client_secret:_i(),refresh_token:_i(),scope:_i().optional()}),er=eo({email:ki(),firstName:_i().max(100).optional(),lastName:_i().max(100).optional(),phone:_i().max(20).optional(),scopes:Ki(_i()).optional()});let tr,nr,ir;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(tr||(tr={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(nr||(nr={})),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",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(ir||(ir={}));const or=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 rr=i(60),ar=i.n(rr);const sr=e=>new(ar())(e).toDecimalPlaces(2).toNumber();function cr(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=sr(n);switch(e.feeType){case Z.PercentageOfBooking:if(o)return sr(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return sr(s/(1-t)*e.amount/(100+e.amount))}return sr(s*(e.amount/100));case Z.FixedChargePerRoom:case Z.FixedChargePerBooking:return e.amount;case Z.NightlyChargePerRoom:return sr(e.amount*i);default:return 0}}const ur=[Z.FixedChargePerBooking],dr=[Z.PercentageOfBooking,Z.FixedChargePerRoom,Z.NightlyChargePerRoom],lr=[Z.PercentageOfBooking];function pr(e,t){return e.filter((e=>t.includes(e.feeType)))}function fr(e){return pr(e,ur)}function hr(e){return pr(e,dr)}function mr(e){return pr(e,lr)}function gr(e){return{includeInRates:[Z.PercentageOfBooking,Z.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===Z.PercentageOfBooking,appliesToAddons:e===Z.PercentageOfBooking,includePreviousFeesInCalculation:e===Z.PercentageOfBooking}}const vr=e=>e,yr=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},_r=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Pr{}function br(e){return e.toUpperCase()}Pr.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===D.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===D.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 L.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Pr.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Pr.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))),L.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})),Pr.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Pr.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})),Pr.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+=Pr.calculateReservationAddonTotal(o,t)?.total}})),sr(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,a,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>B,AddGiftCardSchema:()=>So,AdyenEventCode:()=>Ho,AdyenResultCode:()=>Bo,BaseGiftCardSchema:()=>Ro,CancelGiftCardTransactionSchema:()=>Qo,CompleteGiftCardTransactionSchema:()=>Yo,CreatePaymentSessionSchema:()=>xo,DATE_FORMAT:()=>$,EAddonPricingType:()=>L,EAdminCompanyUserRole:()=>f,EBookingCustomFieldFormat:()=>n,EBookingFlow:()=>t,EBookingPaymentMethod:()=>r,EBookingStatus:()=>e,ECompanyProvider:()=>p,EDistanceUnitType:()=>P,EFeeType:()=>Z,EGiftCardPaymentProvider:()=>Go,EGiftCardPaymentStatus:()=>Lo,EGiftCardPaymentType:()=>$o,EGiftCardTransactionType:()=>qo,EGuaranteePolicyDepositMode:()=>T,EHotelAddressRequirement:()=>h,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>m,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>v,EIntegration:()=>y,ELogCategory:()=>ir,ELogSeverity:()=>nr,ELogType:()=>or,EMembershipProvider:()=>A,EPlanpayBookingStatus:()=>s,EPromoCodeDiscountType:()=>C,EPromoCodeStayDateRangeRepeatType:()=>N,EPromoCodeStayDateRangeType:()=>I,ERMSAuthSyncHistoryStatus:()=>b,ERMSDiscountType:()=>k,ERMSSyncStrategy:()=>z,ERoomstayEventName:()=>F,ERoomstayEventSource:()=>R,ERoomstayImageSize:()=>w,ETransactionStatus:()=>Vo,EditGiftCardSchema:()=>Oo,GetCompanyConfigSchema:()=>Wo,GuestProfile:()=>l,HttpMethod:()=>x,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>E,InternationalAddressSchema:()=>No,ItineraryResponse:()=>u,META_USER_DATA_KEYS:()=>D,PCIBookingCardProcessorTypes:()=>c,Package:()=>S,PassthroughPaymentDataSchema:()=>Fo,PaymentProcessorDataSchema:()=>Zo,PurchaseGiftCardSchema:()=>Do,RedeemGiftCardSchema:()=>Mo,RefreshGiftCardTokenSchema:()=>er,RefundGiftCardSchema:()=>jo,RegisterGiftCardAdminSchema:()=>tr,Reservation:()=>d,ReservedPackage:()=>O,TotalCalculator:()=>br,UpdateAdyenConfigSchema:()=>Xo,UpdateCompanyConfigSchema:()=>Ko,ValidateGiftCardSchema:()=>Uo,calculateFeeAmount:()=>ur,calculateTotalForMemberBooking:()=>rr,getFeeOptionValidity:()=>vr,getFilteredBookingAddonFees:()=>gr,getFilteredBookingFees:()=>hr,getFilteredBookingRateFees:()=>mr,maxString:()=>Io,nameof:()=>yr,preprocessDate:()=>wo,preprocessNumber:()=>zo,requireEmail:()=>Ao,requireFutureDate:()=>Co,requirePositiveAmount:()=>To,requireString:()=>Eo,resizeRoomstayImageUrl:()=>Pr,roundMoney:()=>cr,subset:()=>_r,toMetaEventName:()=>j,transformToMetaEventData:()=>M,transformToMetaUserData:()=>G,uppercaseString:()=>kr,validateFormWithZod:()=>ko}),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.Number="number",e.Text="text",e.Date="date"}(n||(n={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe",e.PayPal="PayPal"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const c=[];class u{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 d{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 l,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 l{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 p,f,h,m,g,v,y,_,P,b,k,z,w,E,A,T,C,I,N,R;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(p||(p={})),function(e){e.SuperAdmin="SuperAdmin",e.Admin="Admin",e.Limited="Limited"}(f||(f={})),function(e){e.FullAddressRequired="FullAddressRequired",e.AddressOptionalCountryRequired="AddressOptionalCountryRequired",e.AddressOptional="AddressOptional"}(h||(h={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(m||(m={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(v||(v={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC",e.AnalyticsEvents="AnalyticsEvents",e.MemberJungle="MemberJungle"}(y||(y={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(P||(P={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(b||(b={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(k||(k={})),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.ClientFacingAreaSync="clientFacingAreaSync",e.NewRateFetch="newRateFetch"}(z||(z={})),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"}(w||(w={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(E||(E={})),function(e){e.Big4="Big4",e.Gday="Gday",e.Internal="Internal",e.MemberJungle="MemberJungle",e.RAC="RAC",e.RmsTop10="RmsTop10",e.Salesforce="Salesforce",e.Top10="Top10"}(A||(A={}));class S{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 O extends S{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"}(T||(T={})),function(e){e.FlatPercent="flatPercent",e.FlatQuantity="flatQuantity",e.FlatQuantityPerStay="flatQuantityPerStay"}(C||(C={})),function(e){e.Allowed="Allowed",e.Blocked="Blocked"}(I||(I={})),function(e){e.None="None",e.Weekly="Weekly",e.MonthlyDayOfWeek="MonthlyDayOfWeek",e.MonthlyDate="MonthlyDate",e.Yearly="Yearly"}(N||(N={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(R||(R={}));const $="DD/MM/YYYY";let x,Z,F;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(x||(x={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(Z||(Z={})),function(e){e.BasketAdd="Basket/Add",e.BasketAddAddon="Basket/AddAddon",e.ViewCheckout="View/Checkout",e.BookingCommitted="Booking/Committed"}(F||(F={}));const D=["em","ph","fn","ln","ct","st","zp","country","external_id"];function j(e){return{[F.BasketAdd]:"AddToCart",[F.BasketAddAddon]:"AddToCart",[F.ViewCheckout]:"InitiateCheckout",[F.BookingCommitted]:"Purchase"}[e]}function U(e,t,n){let i=0;const o=[],r=[];for(const t of e)i+=t.totalPrice,t.roomCode&&(o.push(t.roomCode),r.push({id:t.roomCode,quantity:1,item_price:t.totalPrice}));if(t)for(const e of t)i+=e.totalPrice,e.addonCode&&(o.push(e.addonCode),r.push({id:e.addonCode,quantity:e.quantity,item_price:e.unitPrice}));return{currency:n,value:i,content_ids:o,content_type:"hotel",contents:r,num_items:e.length+(t?.length??0)}}function M(e){if("addon"in e)return t=e.addon,{currency:e.currency,value:t.totalPrice,content_ids:t.addonCode?[t.addonCode]:[],content_type:"hotel",contents:t.addonCode?[{id:t.addonCode,quantity:t.quantity,item_price:t.unitPrice}]:[],num_items:1};var t;if("item"in e)return U([e.item],void 0,e.currency);if("items"in e){const t=e,n=U(t.items,t.addons,e.currency);return"itineraryNumber"in t&&(n.order_id=t.itineraryNumber),n}throw new Error("Invalid event data")}function G(e){return{em:e.email,ph:e.phone,fn:e.firstName,ln:e.lastName,ct:e.city,st:e.state,zp:e.postalCode,country:e.country,external_id:e.externalId}}let L;!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"}(L||(L={}));const B=[L.PER_NIGHT,L.PER_PERSON_PER_NIGHT,L.PER_QUANTITY_NAME_PER_NIGHT,L.PER_ROOM_QUANTITY_PER_NIGHT,L.PER_PERSON_OCCUPANCY_PER_NIGHT,L.PER_ADULT_OCCUPANCY_PER_NIGHT,L.PER_CHILD_OCCUPANCY_PER_NIGHT,L.PER_ALL_PERSONS_PER_NIGHT];function H(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 q extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class V extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Y={};function Q(e){return e&&Object.assign(Y,e),Y}const W=/^[cC][^\s-]{8,}$/,J=/^[0-9a-z]+$/,K=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,X=/^[0-9a-vA-V]{20}$/,ee=/^[A-Za-z0-9]{27}$/,te=/^[a-zA-Z0-9_-]{21}$/,ne=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ie=/^([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})$/,oe=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)$/,re=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ae=/^(?:(?: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])$/,se=/^(([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})$/,ce=/^((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])$/,ue=/^(([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])$/,de=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,le=/^[A-Za-z0-9_-]*$/,pe=/^(?=.{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])?)*\.?$/,fe=/^\+(?:[0-9]){6,14}[0-9]$/,he="(?:(?:\\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])))",me=new RegExp(`^${he}$`);function ge(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 ve=/^\d+$/,ye=/^-?\d+(?:\.\d+)?/i,_e=/true|false/i,Pe=/^[^A-Z]*$/,be=/^[^a-z]*$/;function ke(e,t){return"bigint"==typeof t?t.toString():t}function ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function we(e){return null==e}function Ee(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ae=Symbol("evaluating");function Te(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==Ae)return void 0===i&&(i=Ae,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ce(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ie(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ne(e){return JSON.stringify(e)}const Re="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Se(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Oe=ze((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function $e(e){if(!1===Se(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Se(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function xe(e){return $e(e)?{...e}:e}const Ze=new Set(["string","number","symbol"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function De(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function je(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 Ue={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 Me(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 Ge(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Le(e){return"string"==typeof e?e:e?.message}function Be(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Le(e.inst?._zod.def?.error?.(e))??Le(t?.error?.(e))??Le(n.customError?.(e))??Le(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function He(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function qe(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ve=H("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ye={number:"number",bigint:"bigint",object:"date"},Qe=H("$ZodCheckLessThan",((e,t)=>{Ve.init(e,t);const n=Ye[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})}})),We=H("$ZodCheckGreaterThan",((e,t)=>{Ve.init(e,t);const n=Ye[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=H("$ZodCheckMultipleOf",((e,t)=>{Ve.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})}})),Ke=H("$ZodCheckNumberFormat",((e,t)=>{Ve.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ue[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=ve)})),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})}})),Xe=H("$ZodCheckMaxLength",((e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!we(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=He(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),et=H("$ZodCheckMinLength",((e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!we(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=He(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),tt=H("$ZodCheckLengthEquals",((e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!we(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=He(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})}})),nt=H("$ZodCheckStringFormat",((e,t)=>{var n,i;Ve.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=()=>{})})),it=H("$ZodCheckRegex",((e,t)=>{nt.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})}})),ot=H("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=Pe),nt.init(e,t)})),rt=H("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=be),nt.init(e,t)})),at=H("$ZodCheckIncludes",((e,t)=>{Ve.init(e,t);const n=Fe(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})}})),st=H("$ZodCheckStartsWith",((e,t)=>{Ve.init(e,t);const n=new RegExp(`^${Fe(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})}})),ct=H("$ZodCheckEndsWith",((e,t)=>{Ve.init(e,t);const n=new RegExp(`.*${Fe(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})}})),ut=H("$ZodCheckOverwrite",((e,t)=>{Ve.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class dt{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 lt=(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,ke,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},pt=H("$ZodError",lt),ft=H("$ZodError",lt,{Parent:Error}),ht=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 q;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Be(e,r,Q()))));throw Re(t,o?.callee),t}return a.value},mt=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=>Be(e,r,Q()))));throw Re(t,o?.callee),t}return a.value},gt=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 q;return r.issues.length?{success:!1,error:new(e??pt)(r.issues.map((e=>Be(e,o,Q()))))}:{success:!0,data:r.value}},vt=gt(ft),yt=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=>Be(e,o,Q()))))}:{success:!0,data:r.value}},_t=yt(ft),Pt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ht(e)(t,n,o)},bt=e=>(t,n,i)=>ht(e)(t,n,i),kt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mt(e)(t,n,o)},zt=e=>async(t,n,i)=>mt(e)(t,n,i),wt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return gt(e)(t,n,o)},Et=e=>(t,n,i)=>gt(e)(t,n,i),At=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return yt(e)(t,n,o)},Tt=e=>async(t,n,i)=>yt(e)(t,n,i),Ct={major:4,minor:1,patch:5},It=H("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ct;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=Me(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 q;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Me(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Me(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Me(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new q;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 q;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=vt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return _t(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),Nt=H("$ZodString",((e,t)=>{var n;It.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}})),Rt=H("$ZodStringFormat",((e,t)=>{nt.init(e,t),Nt.init(e,t)})),St=H("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=ie),Rt.init(e,t)})),Ot=H("$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=oe(e))}else t.pattern??(t.pattern=oe());Rt.init(e,t)})),$t=H("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=re),Rt.init(e,t)})),xt=H("$ZodURL",((e,t)=>{Rt.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:pe.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})}}})),Zt=H("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Rt.init(e,t)})),Ft=H("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=te),Rt.init(e,t)})),Dt=H("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=W),Rt.init(e,t)})),jt=H("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=J),Rt.init(e,t)})),Ut=H("$ZodULID",((e,t)=>{t.pattern??(t.pattern=K),Rt.init(e,t)})),Mt=H("$ZodXID",((e,t)=>{t.pattern??(t.pattern=X),Rt.init(e,t)})),Gt=H("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=ee),Rt.init(e,t)})),Lt=H("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ge({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(`^${he}T(?:${i})$`)}(t)),Rt.init(e,t)})),Bt=H("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=me),Rt.init(e,t)})),Ht=H("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ge(t)}$`)),Rt.init(e,t)})),qt=H("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=ne),Rt.init(e,t)})),Vt=H("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ae),Rt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Yt=H("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=se),Rt.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})}}})),Qt=H("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=ce),Rt.init(e,t)})),Wt=H("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=ue),Rt.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 Kt=H("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=de),Rt.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})}})),Xt=H("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=le),Rt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!le.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})}})),en=H("$ZodE164",((e,t)=>{t.pattern??(t.pattern=fe),Rt.init(e,t)})),tn=H("$ZodJWT",((e,t)=>{Rt.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})}})),nn=H("$ZodNumber",((e,t)=>{It.init(e,t),e._zod.pattern=e._zod.bag.pattern??ye,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}})),on=H("$ZodNumber",((e,t)=>{Ke.init(e,t),nn.init(e,t)})),rn=H("$ZodBoolean",((e,t)=>{It.init(e,t),e._zod.pattern=_e,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}})),an=H("$ZodUnknown",((e,t)=>{It.init(e,t),e._zod.parse=e=>e})),sn=H("$ZodNever",((e,t)=>{It.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),cn=H("$ZodDate",((e,t)=>{It.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 un(e,t,n){e.issues.length&&t.issues.push(...Ge(n,e.issues)),t.value[n]=e.value}const dn=H("$ZodArray",((e,t)=>{It.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=>un(t,n,e)))):un(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function ln(e,t,n,i){e.issues.length&&t.issues.push(...Ge(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pn(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 fn(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=>ln(e,n,o,t)))):ln(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 hn=H("$ZodObject",((e,t)=>{It.init(e,t);const n=ze((()=>pn(t)));Te(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=Se,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=>ln(n,t,e,s)))):ln(n,t,e,s)}return o?fn(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),mn=H("$ZodObjectJIT",((e,t)=>{hn.init(e,t);const n=e._zod.parse,i=ze((()=>pn(t)));let o;const r=Se,a=!Y.jitless,s=a&&Oe.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 dt(["shape","payload","ctx"]),n=i.value,o=e=>{const t=Ne(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=Ne(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?fn([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function gn(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=>!Me(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=>Be(e,i,Q())))))}),t)}const vn=H("$ZodUnion",((e,t)=>{It.init(e,t),Te(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),Te(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),Te(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),Te(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=>Ee(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=>gn(t,o,e,r))):gn(s,o,e,r)}})),yn=H("$ZodIntersection",((e,t)=>{It.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])=>Pn(e,t,n))):Pn(e,o,r)}}));function _n(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($e(e)&&$e(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=_n(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=_n(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 Pn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Me(e))return e;const i=_n(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 bn=H("$ZodEnum",((e,t)=>{It.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=>Ze.has(typeof e))).map((e=>"string"==typeof e?Fe(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}})),kn=H("$ZodTransform",((e,t)=>{It.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new V(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 q;return n.value=o,n}}));function zn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const wn=H("$ZodOptional",((e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Te(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),Te(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ee(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=>zn(t,e.value))):zn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),En=H("$ZodNullable",((e,t)=>{It.init(e,t),Te(e._zod,"optin",(()=>t.innerType._zod.optin)),Te(e._zod,"optout",(()=>t.innerType._zod.optout)),Te(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ee(e.source)}|null)$`):void 0})),Te(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)})),An=H("$ZodDefault",((e,t)=>{It.init(e,t),e._zod.optin="optional",Te(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=>Tn(e,t))):Tn(i,t)}}));function Tn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Cn=H("$ZodPrefault",((e,t)=>{It.init(e,t),e._zod.optin="optional",Te(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))})),In=H("$ZodNonOptional",((e,t)=>{It.init(e,t),Te(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=>Nn(t,e))):Nn(o,e)}}));function Nn(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 Rn=H("$ZodCatch",((e,t)=>{It.init(e,t),Te(e._zod,"optin",(()=>t.innerType._zod.optin)),Te(e._zod,"optout",(()=>t.innerType._zod.optout)),Te(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=>Be(e,n,Q())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Be(e,n,Q())))},input:e.value}),e.issues=[]),e)}})),Sn=H("$ZodPipe",((e,t)=>{It.init(e,t),Te(e._zod,"values",(()=>t.in._zod.values)),Te(e._zod,"optin",(()=>t.in._zod.optin)),Te(e._zod,"optout",(()=>t.out._zod.optout)),Te(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=>On(e,t.in,n))):On(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>On(e,t.out,n))):On(i,t.out,n)}}));function On(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const $n=H("$ZodReadonly",((e,t)=>{It.init(e,t),Te(e._zod,"propValues",(()=>t.innerType._zod.propValues)),Te(e._zod,"values",(()=>t.innerType._zod.values)),Te(e._zod,"optin",(()=>t.innerType._zod.optin)),Te(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(xn):xn(i)}}));function xn(e){return e.value=Object.freeze(e.value),e}const Zn=H("$ZodCustom",((e,t)=>{Ve.init(e,t),It.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=>Fn(t,n,i,e)));Fn(o,n,i,e)}}));function Fn(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(qe(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Dn{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 jn(){return new Dn}const Un=jn();function Mn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...je(t)})}function Gn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...je(t)})}function Ln(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...je(t)})}function Bn(e,t){return new Qe({check:"less_than",...je(t),value:e,inclusive:!1})}function Hn(e,t){return new Qe({check:"less_than",...je(t),value:e,inclusive:!0})}function qn(e,t){return new We({check:"greater_than",...je(t),value:e,inclusive:!1})}function Vn(e,t){return new We({check:"greater_than",...je(t),value:e,inclusive:!0})}function Yn(e,t){return new Je({check:"multiple_of",...je(t),value:e})}function Qn(e,t){return new Xe({check:"max_length",...je(t),maximum:e})}function Wn(e,t){return new et({check:"min_length",...je(t),minimum:e})}function Jn(e,t){return new tt({check:"length_equals",...je(t),length:e})}function Kn(e){return new ut({check:"overwrite",tx:e})}const Xn=H("ZodISODateTime",((e,t)=>{Lt.init(e,t),bi.init(e,t)}));const ei=H("ZodISODate",((e,t)=>{Bt.init(e,t),bi.init(e,t)}));const ti=H("ZodISOTime",((e,t)=>{Ht.init(e,t),bi.init(e,t)}));const ni=H("ZodISODuration",((e,t)=>{qt.init(e,t),bi.init(e,t)}));const ii=(e,t)=>{pt.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,ke,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ke,2)}},isEmpty:{get:()=>0===e.issues.length}})},oi=(H("ZodError",ii),H("ZodError",ii,{Parent:Error})),ri=ht(oi),ai=mt(oi),si=gt(oi),ci=yt(oi),ui=Pt(oi),di=bt(oi),li=kt(oi),pi=zt(oi),fi=wt(oi),hi=Et(oi),mi=At(oi),gi=Tt(oi),vi=H("ZodType",((e,t)=>(It.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)=>De(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ri(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>si(e,t,n),e.parseAsync=async(t,n)=>ai(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ci(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ui(e,t,n),e.decode=(t,n)=>di(e,t,n),e.encodeAsync=async(t,n)=>li(e,t,n),e.decodeAsync=async(t,n)=>pi(e,t,n),e.safeEncode=(t,n)=>fi(e,t,n),e.safeDecode=(t,n)=>hi(e,t,n),e.safeEncodeAsync=async(t,n)=>mi(e,t,n),e.safeDecodeAsync=async(t,n)=>gi(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,...je(n)})}(Po,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Ve({check:"custom",...je(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(qe(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(qe(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Kn(t)),e.optional=()=>uo(e),e.nullable=()=>po(e),e.nullish=()=>uo(po(e)),e.nonoptional=t=>function(e,t){return new mo({type:"nonoptional",innerType:e,...je(t)})}(e,t),e.array=()=>Xi(e),e.or=t=>function(e,t){return new no({type:"union",options:e,...je(t)})}([e,t]),e.and=t=>new io({type:"intersection",left:e,right:t}),e.transform=t=>yo(e,so(t)),e.default=t=>{return n=t,new fo({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():xe(n)}});var n},e.prefault=t=>{return n=t,new ho({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():xe(n)}});var n},e.catch=t=>{return new go({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>yo(e,t),e.readonly=()=>new _o({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Un.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Un.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Un.get(e);const n=e.clone();return Un.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),yi=H("_ZodString",((e,t)=>{Nt.init(e,t),vi.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 it({check:"string_format",format:"regex",...je(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new at({check:"string_format",format:"includes",...je(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new st({check:"string_format",format:"starts_with",...je(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new ct({check:"string_format",format:"ends_with",...je(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Wn(...t)),e.max=(...t)=>e.check(Qn(...t)),e.length=(...t)=>e.check(Jn(...t)),e.nonempty=(...t)=>e.check(Wn(1,...t)),e.lowercase=t=>e.check(function(e){return new ot({check:"string_format",format:"lowercase",...je(e)})}(t)),e.uppercase=t=>e.check(function(e){return new rt({check:"string_format",format:"uppercase",...je(e)})}(t)),e.trim=()=>e.check(Kn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Kn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Kn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Kn((e=>e.toUpperCase())))})),_i=H("ZodString",((e,t)=>{Nt.init(e,t),yi.init(e,t),e.email=t=>e.check(Mn(ki,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...je(t)})}(Ai,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...je(t)})}(Mi,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...je(t)})}(Ti,t)),e.guid=t=>e.check(Gn(wi,t)),e.uuid=t=>e.check(Ln(Ei,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...je(t)})}(Ei,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...je(t)})}(Ei,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...je(t)})}(Ei,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...je(t)})}(Ci,t)),e.guid=t=>e.check(Gn(wi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...je(t)})}(Ii,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...je(t)})}(Ni,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...je(t)})}(Ri,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...je(t)})}(Di,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...je(t)})}(ji,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...je(t)})}(Si,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...je(t)})}(Oi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...je(t)})}($i,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...je(t)})}(xi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...je(t)})}(Zi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...je(t)})}(Fi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...je(t)})}(Ui,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,...je(t)})}(Xn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...je(t)})}(ei,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,...je(t)})}(ti,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...je(t)})}(ni,e)}(t))}));function Pi(e){return function(e,t){return new e({type:"string",...je(t)})}(_i,e)}const bi=H("ZodStringFormat",((e,t)=>{Rt.init(e,t),yi.init(e,t)})),ki=H("ZodEmail",((e,t)=>{$t.init(e,t),bi.init(e,t)}));function zi(e){return Mn(ki,e)}const wi=H("ZodGUID",((e,t)=>{St.init(e,t),bi.init(e,t)})),Ei=H("ZodUUID",((e,t)=>{Ot.init(e,t),bi.init(e,t)})),Ai=H("ZodURL",((e,t)=>{xt.init(e,t),bi.init(e,t)})),Ti=H("ZodEmoji",((e,t)=>{Zt.init(e,t),bi.init(e,t)})),Ci=H("ZodNanoID",((e,t)=>{Ft.init(e,t),bi.init(e,t)})),Ii=H("ZodCUID",((e,t)=>{Dt.init(e,t),bi.init(e,t)})),Ni=H("ZodCUID2",((e,t)=>{jt.init(e,t),bi.init(e,t)})),Ri=H("ZodULID",((e,t)=>{Ut.init(e,t),bi.init(e,t)})),Si=H("ZodXID",((e,t)=>{Mt.init(e,t),bi.init(e,t)})),Oi=H("ZodKSUID",((e,t)=>{Gt.init(e,t),bi.init(e,t)})),$i=H("ZodIPv4",((e,t)=>{Vt.init(e,t),bi.init(e,t)})),xi=H("ZodIPv6",((e,t)=>{Yt.init(e,t),bi.init(e,t)})),Zi=H("ZodCIDRv4",((e,t)=>{Qt.init(e,t),bi.init(e,t)})),Fi=H("ZodCIDRv6",((e,t)=>{Wt.init(e,t),bi.init(e,t)})),Di=H("ZodBase64",((e,t)=>{Kt.init(e,t),bi.init(e,t)})),ji=H("ZodBase64URL",((e,t)=>{Xt.init(e,t),bi.init(e,t)})),Ui=H("ZodE164",((e,t)=>{en.init(e,t),bi.init(e,t)})),Mi=H("ZodJWT",((e,t)=>{tn.init(e,t),bi.init(e,t)})),Gi=H("ZodNumber",((e,t)=>{nn.init(e,t),vi.init(e,t),e.gt=(t,n)=>e.check(qn(t,n)),e.gte=(t,n)=>e.check(Vn(t,n)),e.min=(t,n)=>e.check(Vn(t,n)),e.lt=(t,n)=>e.check(Bn(t,n)),e.lte=(t,n)=>e.check(Hn(t,n)),e.max=(t,n)=>e.check(Hn(t,n)),e.int=t=>e.check(Hi(t)),e.safe=t=>e.check(Hi(t)),e.positive=t=>e.check(qn(0,t)),e.nonnegative=t=>e.check(Vn(0,t)),e.negative=t=>e.check(Bn(0,t)),e.nonpositive=t=>e.check(Hn(0,t)),e.multipleOf=(t,n)=>e.check(Yn(t,n)),e.step=(t,n)=>e.check(Yn(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 Li(e){return function(e,t){return new e({type:"number",checks:[],...je(t)})}(Gi,e)}const Bi=H("ZodNumberFormat",((e,t)=>{on.init(e,t),Gi.init(e,t)}));function Hi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...je(t)})}(Bi,e)}const qi=H("ZodBoolean",((e,t)=>{rn.init(e,t),vi.init(e,t)}));const Vi=H("ZodUnknown",((e,t)=>{an.init(e,t),vi.init(e,t)}));function Yi(){return new Vi({type:"unknown"})}const Qi=H("ZodNever",((e,t)=>{sn.init(e,t),vi.init(e,t)}));function Wi(e){return function(e,t){return new e({type:"never",...je(t)})}(Qi,e)}const Ji=H("ZodDate",((e,t)=>{cn.init(e,t),vi.init(e,t),e.min=(t,n)=>e.check(Vn(t,n)),e.max=(t,n)=>e.check(Hn(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 Ki=H("ZodArray",((e,t)=>{dn.init(e,t),vi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Wn(t,n)),e.nonempty=t=>e.check(Wn(1,t)),e.max=(t,n)=>e.check(Qn(t,n)),e.length=(t,n)=>e.check(Jn(t,n)),e.unwrap=()=>e.element}));function Xi(e,t){return function(e,t,n){return new e({type:"array",element:t,...je(n)})}(Ki,e,t)}const eo=H("ZodObject",((e,t)=>{mn.init(e,t),vi.init(e,t),Te(e,"shape",(()=>t.shape)),e.keyof=()=>ro(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Yi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Yi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Wi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!$e(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=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ce(this,"shape",n),n},checks:[]});return De(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!$e(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 Ce(this,"shape",n),n},checks:e._zod.def.checks};return De(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ce(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return De(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return De(e,Ie(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 Ce(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=Ie(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 Ce(this,"shape",i),i},checks:[]});return De(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=Ie(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 Ce(this,"shape",o),o},checks:[]});return De(t,i)}(co,e,t[0]),e.required=(...t)=>function(e,t,n){const i=Ie(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 Ce(this,"shape",o),o},checks:[]});return De(t,i)}(mo,e,t[0])}));function to(e,t){const n={type:"object",get shape(){var t;return Ce(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...je(t)};return new eo(n)}const no=H("ZodUnion",((e,t)=>{vn.init(e,t),vi.init(e,t),e.options=t.options}));const io=H("ZodIntersection",((e,t)=>{yn.init(e,t),vi.init(e,t)})),oo=H("ZodEnum",((e,t)=>{bn.init(e,t),vi.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 oo({...t,checks:[],...je(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 oo({...t,checks:[],...je(i),entries:o})}}));function ro(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new oo({type:"enum",entries:n,...je(t)})}const ao=H("ZodTransform",((e,t)=>{kn.init(e,t),vi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new V(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(qe(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(qe(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function so(e){return new ao({type:"transform",transform:e})}const co=H("ZodOptional",((e,t)=>{wn.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function uo(e){return new co({type:"optional",innerType:e})}const lo=H("ZodNullable",((e,t)=>{En.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function po(e){return new lo({type:"nullable",innerType:e})}const fo=H("ZodDefault",((e,t)=>{An.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),ho=H("ZodPrefault",((e,t)=>{Cn.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),mo=H("ZodNonOptional",((e,t)=>{In.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),go=H("ZodCatch",((e,t)=>{Rn.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),vo=H("ZodPipe",((e,t)=>{Sn.init(e,t),vi.init(e,t),e.in=t.in,e.out=t.out}));function yo(e,t){return new vo({type:"pipe",in:e,out:t})}const _o=H("ZodReadonly",((e,t)=>{$n.init(e,t),vi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Po=H("ZodCustom",((e,t)=>{Zn.init(e,t),vi.init(e,t)}));function bo(e,t){return yo(so(e),t)}function ko(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 zo=e=>bo((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),wo=e=>bo((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),Eo=e=>Pi().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Ao=()=>zi("Invalid email address").min(1,"Required"),To=()=>zo(Li("Valid amount required").positive("Positive amount required")),Co=()=>wo(function(e){return function(e,t){return new e({type:"date",...je(t)})}(Ji,e)}("Valid date required").min(new Date,"Date must be in the future")),Io=e=>Pi().max(e,`Maximum length is ${e} characters`),No=to({address1:Eo(100),address2:Io(100).optional(),city:Eo(50),state:Io(50).optional(),postcode:Io(20).optional(),country:Eo(50)}),Ro=to({amount:To(),message:Io(500).nullish(),giverFirstName:Eo(50),giverLastName:Eo(50),giverEmail:Ao(),giverPhone:Eo(31),giverAddress:No,cardHolder:Eo(101),recipientFirstName:Io(50).nullish(),recipientLastName:Io(50).nullish(),recipientEmail:zi("Invalid email address").nullish(),recipientPhone:Io(31).nullish()}),So=Ro.extend({expiry:Co(),notes:Io(500).nullish()}),Oo=to({balance:To(),expiry:Co(),message:Io(500).nullish(),notes:Io(500).nullish(),giverFirstName:Eo(50),giverLastName:Eo(50),giverEmail:Ao(),giverPhone:Eo(31),cardHolder:Eo(101),recipientEmail:zi("Invalid email address").nullish(),recipientPhone:Io(31).nullish()});let $o;!function(e){e.Passthrough="Passthrough",e.PaymentProcessor="PaymentProcessor"}($o||($o={}));const xo=to({companyId:Li().int().positive(),amount:To(),currency:Eo(3).default("AUD")}),Zo=to({sessionId:Eo(100),resultCode:Eo(50),pspReference:Io(100).optional()}),Fo=to({cardHolder:Eo(100),cardNumberToken:Io(200),cardCvcToken:Io(200),cardExpiry:Io(5)}),Do=Ro.extend({companyId:Li().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...je(t)})}(qi,e)}().default(!0),payment:Zo.optional(),passthroughPayment:Fo.optional()}),jo=to({giftCardId:Li().int().positive(),reason:Io(500).optional()}),Uo=to({companyId:Li().int().positive().nullish(),code:Eo(10),password:Eo(10)}),Mo=Uo.extend({amount:To(),description:Eo(200)});let Go,Lo,Bo,Ho,qo,Vo;!function(e){e.Adyen="Adyen"}(Go||(Go={})),function(e){e.Pending="Pending",e.Authorized="Authorized",e.Captured="Captured",e.Failed="Failed",e.Refunded="Refunded"}(Lo||(Lo={})),function(e){e.Authorised="Authorised",e.Refused="Refused",e.Cancelled="Cancelled",e.Pending="Pending",e.Received="Received",e.Error="Error",e.IdentifyShopper="IdentifyShopper",e.ChallengeShopper="ChallengeShopper"}(Bo||(Bo={})),function(e){e.AUTHORISATION="AUTHORISATION",e.CAPTURE="CAPTURE",e.REFUND="REFUND",e.CANCELLATION="CANCELLATION",e.REFUND_FAILED="REFUND_FAILED",e.CAPTURE_FAILED="CAPTURE_FAILED"}(Ho||(Ho={})),function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(qo||(qo={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(Vo||(Vo={}));const Yo=to({code:Eo(10),token:Eo(128)}),Qo=to({companyId:Li().int().positive(),code:Eo(10),token:Eo(128)}),Wo=to({companyId:(Jo=Gi,new Jo({type:"number",coerce:!0,checks:[],...je(void 0)})).int().positive()});var Jo;const Ko=to({giftCardPaymentType:ro([$o.Passthrough,$o.PaymentProcessor])}),Xo=to({merchantAccount:Eo(100),clientKey:Eo(100),apiKey:Io(200).optional(),webhookHmacKey:Io(200).optional()}),er=to({grant_type:Pi().readonly().default("refresh_token"),client_id:Ln(Ei,void 0),client_secret:Pi(),refresh_token:Pi(),scope:Pi().optional()}),tr=to({email:zi(),firstName:Pi().max(100).optional(),lastName:Pi().max(100).optional(),phone:Pi().max(20).optional(),scopes:Xi(Pi()).optional()});let nr,ir,or;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(nr||(nr={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(ir||(ir={})),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",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(or||(or={}));const rr=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 ar=i(60),sr=i.n(ar);const cr=e=>new(sr())(e).toDecimalPlaces(2).toNumber();function ur(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=cr(n);switch(e.feeType){case Z.PercentageOfBooking:if(o)return cr(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return cr(s/(1-t)*e.amount/(100+e.amount))}return cr(s*(e.amount/100));case Z.FixedChargePerRoom:case Z.FixedChargePerBooking:return e.amount;case Z.NightlyChargePerRoom:return cr(e.amount*i);default:return 0}}const dr=[Z.FixedChargePerBooking],lr=[Z.PercentageOfBooking,Z.FixedChargePerRoom,Z.NightlyChargePerRoom],pr=[Z.PercentageOfBooking];function fr(e,t){return e.filter((e=>t.includes(e.feeType)))}function hr(e){return fr(e,dr)}function mr(e){return fr(e,lr)}function gr(e){return fr(e,pr)}function vr(e){return{includeInRates:[Z.PercentageOfBooking,Z.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===Z.PercentageOfBooking,appliesToAddons:e===Z.PercentageOfBooking,includePreviousFeesInCalculation:e===Z.PercentageOfBooking}}const yr=e=>e,_r=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Pr=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class br{}function kr(e){return e.toUpperCase()}br.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===L.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===L.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 B.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},br.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=br.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))),B.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})),br.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=br.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})),br.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+=br.calculateReservationAddonTotal(o,t)?.total}})),cr(n)}})(),o})()));
|