@roomstay/core 0.1.66-5 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node.js +1 -1
- package/dist/types/Availability/Availability.types.d.ts +1 -1
- package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +11 -0
- package/dist/types/Booking/IBookingPayment.type.d.ts +1 -7
- package/dist/types/Booking/IBookingStatus.type.d.ts +5 -0
- package/dist/types/Booking/IPrice.type.d.ts +7 -0
- package/dist/types/GiftCards/GiftCard.types.d.ts +17 -97
- package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -5
- package/dist/types/index.d.ts +2 -15
- package/dist/utils/roundMoney.d.ts +1 -11
- package/dist/web.js +1 -1
- package/package.json +1 -1
- package/dist/types/GiftCards/GiftCardLogs.enum.d.ts +0 -34
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n,i,o,r,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>To,AddGiftCardSchema:()=>vo,BaseGiftCardSchema:()=>go,DATE_FORMAT:()=>A,EAddonPricingType:()=>Eo,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>O,EGiftCardTransactionType:()=>bo,EGuaranteePolicyDepositMode:()=>k,EGuarantyPolicyPrepaymentType:()=>w,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Ao,ELogSeverity:()=>No,ELogType:()=>Io,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,EditGiftCardSchema:()=>_o,GuestProfile:()=>d,HttpMethod:()=>I,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>yo,RedeemGiftCardSchema:()=>zo,RefreshGiftCardTokenSchema:()=>ko,RegisterGiftCardAdminSchema:()=>wo,Reservation:()=>u,ReservedPackage:()=>N,RoundingType:()=>Co,TotalCalculator:()=>qo,ValidateGiftCardSchema:()=>Po,calculateFeeAmount:()=>xo,calculateTotalForMemberBooking:()=>Oo,getFeeOptionValidity:()=>Ho,getFilteredBookingAddonFees:()=>Mo,getFilteredBookingFees:()=>Uo,getFilteredBookingRateFees:()=>Lo,maxString:()=>ho,nameof:()=>Go,preprocessDate:()=>co,preprocessNumber:()=>ao,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>Vo,roundMoney:()=>So,subset:()=>Bo,uppercaseString:()=>Yo,validateFormWithZod:()=>so}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class N extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(w||(w={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={}));const A="DD/MM/YYYY";let I,O;function R(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(I||(I={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),Object.freeze({status:"aborted"}),Symbol("zod_brand");class $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class C extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const S={};function x(e){return e&&Object.assign(S,e),S}const Z=/^[cC][^\s-]{8,}$/,F=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,M=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,G=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)$/,B=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Y=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{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])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(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 ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,se=/^[^A-Z]*$/,ae=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function we(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(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 Te={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ae(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ie(e){return"string"==typeof e?e:e?.message}function Oe(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ie(e.inst?._zod.def?.error?.(e))??Ie(t?.error?.(e))??Ie(n.customError?.(e))??Ie(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Re(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function $e(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ce=R("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Se={number:"number",bigint:"bigint",object:"date"},xe=R("$ZodCheckLessThan",((e,t)=>{Ce.init(e,t);const n=Se[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})}})),Ze=R("$ZodCheckGreaterThan",((e,t)=>{Ce.init(e,t);const n=Se[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})}})),Fe=R("$ZodCheckMultipleOf",((e,t)=>{Ce.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})}})),De=R("$ZodCheckNumberFormat",((e,t)=>{Ce.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[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=ie)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),je=R("$ZodCheckMaxLength",((e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Re(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ue=R("$ZodCheckMinLength",((e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Re(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=R("$ZodCheckLengthEquals",((e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Re(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Me=R("$ZodCheckStringFormat",((e,t)=>{var n,i;Ce.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),He=R("$ZodCheckRegex",((e,t)=>{Me.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})}})),Ge=R("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=se),Me.init(e,t)})),Be=R("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ae),Me.init(e,t)})),Ve=R("$ZodCheckIncludes",((e,t)=>{Ce.init(e,t);const n=ke(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),qe=R("$ZodCheckStartsWith",((e,t)=>{Ce.init(e,t);const n=new RegExp(`^${ke(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})}})),Ye=R("$ZodCheckEndsWith",((e,t)=>{Ce.init(e,t);const n=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=R("$ZodCheckOverwrite",((e,t)=>{Ce.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Qe{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 Je=(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,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=R("$ZodError",Je),Xe=R("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new $;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,x()))));throw ve(t,o?.callee),t}return s.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,x()))));throw ve(t,o?.callee),t}return s.value},nt=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 $;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>Oe(e,o,x()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=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=>Oe(e,o,x()))))}:{success:!0,data:r.value}},rt=ot(Xe),st=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},at=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=R("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new $;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=R("$ZodString",((e,t)=>{var n;mt.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}})),vt=R("$ZodStringFormat",((e,t)=>{Me.init(e,t),gt.init(e,t)})),_t=R("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),vt.init(e,t)})),yt=R("$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=G(e))}else t.pattern??(t.pattern=G());vt.init(e,t)})),Pt=R("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=B),vt.init(e,t)})),zt=R("$ZodURL",((e,t)=>{vt.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:K.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})}}})),bt=R("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),kt=R("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),vt.init(e,t)})),wt=R("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=Z),vt.init(e,t)})),Et=R("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Tt=R("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),Nt=R("$ZodXID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),At=R("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),It=R("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({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(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),Ot=R("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Rt=R("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),$t=R("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),Ct=R("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),St=R("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),vt.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})}}})),xt=R("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Y),vt.init(e,t)})),Zt=R("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),vt.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 Ft(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=R("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ft(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),jt=R("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ft(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})}})),Ut=R("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Lt=R("$ZodJWT",((e,t)=>{vt.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})}})),Mt=R("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Ht=R("$ZodNumber",((e,t)=>{De.init(e,t),Mt.init(e,t)})),Gt=R("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,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}})),Bt=R("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=R("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=R("$ZodDate",((e,t)=>{mt.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 Yt(e,t,n){e.issues.length&&t.issues.push(...Ae(n,e.issues)),t.value[n]=e.value}const Wt=R("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Yt(t,n,e)))):Yt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Qt(e,t,n,i){e.issues.length&&t.issues.push(...Ae(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(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 Kt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Qt(e,n,o,t)))):Qt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=R("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(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=_e,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Qt(n,t,e,a)))):Qt(n,t,e,a)}return o?Kt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=R("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,s=!S.jitless,a=s&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Qe(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Oe(e,i,x())))))}),t)}const nn=R("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(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=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>tn(t,o,e,r))):tn(a,o,e,r)}})),on=R("$ZodIntersection",((e,t)=>{mt.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])=>sn(e,t,n))):sn(e,o,r)}}));function rn(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(Pe(e)&&Pe(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=rn(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=rn(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 sn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=rn(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 an=R("$ZodEnum",((e,t)=>{mt.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=>be.has(typeof e))).map((e=>"string"==typeof e?ke(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}})),cn=R("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new C(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 $;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=R("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(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=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=R("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(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)})),pn=R("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=R("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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))})),mn=R("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(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=>gn(t,e))):gn(o,e)}}));function gn(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 vn=R("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(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=>Oe(e,n,x())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Oe(e,n,x())))},input:e.value}),e.issues=[]),e)}})),_n=R("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(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=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=R("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(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(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=R("$ZodCustom",((e,t)=>{Ce.init(e,t),mt.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=>kn(t,n,i,e)));kn(o,n,i,e)}}));function kn(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($e(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class wn{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 En(){return new wn}const Tn=En();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function An(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function In(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function On(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!1})}function Rn(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!0})}function $n(e,t){return new Ze({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function Cn(e,t){return new Ze({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"multiple_of",...Ee(t),value:e})}function xn(e,t){return new je({check:"max_length",...Ee(t),maximum:e})}function Zn(e,t){return new Ue({check:"min_length",...Ee(t),minimum:e})}function Fn(e,t){return new Le({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new We({check:"overwrite",tx:e})}const jn=R("ZodISODateTime",((e,t)=>{It.init(e,t),ai.init(e,t)}));const Un=R("ZodISODate",((e,t)=>{Ot.init(e,t),ai.init(e,t)}));const Ln=R("ZodISOTime",((e,t)=>{Rt.init(e,t),ai.init(e,t)}));const Mn=R("ZodISODuration",((e,t)=>{$t.init(e,t),ai.init(e,t)}));const Hn=(e,t)=>{Ke.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,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Gn=(R("ZodError",Hn),R("ZodError",Hn,{Parent:Error})),Bn=et(Gn),Vn=tt(Gn),qn=nt(Gn),Yn=ot(Gn),Wn=st(Gn),Qn=at(Gn),Jn=ct(Gn),Kn=ut(Gn),Xn=dt(Gn),ei=lt(Gn),ti=pt(Gn),ni=ft(Gn),ii=R("ZodType",((e,t)=>(mt.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)=>we(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Bn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Yn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Qn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(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,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Ce({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push($e(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($e(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>Yi(e),e.nullable=()=>Qi(e),e.nullish=()=>Yi(Qi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>ji(e),e.or=t=>function(e,t){return new Mi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=R("_ZodString",((e,t)=>{gt.init(e,t),ii.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Zn(...t)),e.max=(...t)=>e.check(xn(...t)),e.length=(...t)=>e.check(Fn(...t)),e.nonempty=(...t)=>e.check(Zn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ge({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Be({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=R("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(Nn(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(An(di,t)),e.uuid=t=>e.check(In(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(An(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,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,...Ee(t)})}(jn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(Un,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,...Ee(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Mn,e)}(t))}));function si(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const ai=R("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=R("ZodEmail",((e,t)=>{Pt.init(e,t),ai.init(e,t)}));function ui(e){return Nn(ci,e)}const di=R("ZodGUID",((e,t)=>{_t.init(e,t),ai.init(e,t)})),li=R("ZodUUID",((e,t)=>{yt.init(e,t),ai.init(e,t)})),pi=R("ZodURL",((e,t)=>{zt.init(e,t),ai.init(e,t)})),fi=R("ZodEmoji",((e,t)=>{bt.init(e,t),ai.init(e,t)})),hi=R("ZodNanoID",((e,t)=>{kt.init(e,t),ai.init(e,t)})),mi=R("ZodCUID",((e,t)=>{wt.init(e,t),ai.init(e,t)})),gi=R("ZodCUID2",((e,t)=>{Et.init(e,t),ai.init(e,t)})),vi=R("ZodULID",((e,t)=>{Tt.init(e,t),ai.init(e,t)})),_i=R("ZodXID",((e,t)=>{Nt.init(e,t),ai.init(e,t)})),yi=R("ZodKSUID",((e,t)=>{At.init(e,t),ai.init(e,t)})),Pi=R("ZodIPv4",((e,t)=>{Ct.init(e,t),ai.init(e,t)})),zi=R("ZodIPv6",((e,t)=>{St.init(e,t),ai.init(e,t)})),bi=R("ZodCIDRv4",((e,t)=>{xt.init(e,t),ai.init(e,t)})),ki=R("ZodCIDRv6",((e,t)=>{Zt.init(e,t),ai.init(e,t)})),wi=R("ZodBase64",((e,t)=>{Dt.init(e,t),ai.init(e,t)})),Ei=R("ZodBase64URL",((e,t)=>{jt.init(e,t),ai.init(e,t)})),Ti=R("ZodE164",((e,t)=>{Ut.init(e,t),ai.init(e,t)})),Ni=R("ZodJWT",((e,t)=>{Lt.init(e,t),ai.init(e,t)})),Ai=R("ZodNumber",((e,t)=>{Mt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check($n(t,n)),e.gte=(t,n)=>e.check(Cn(t,n)),e.min=(t,n)=>e.check(Cn(t,n)),e.lt=(t,n)=>e.check(On(t,n)),e.lte=(t,n)=>e.check(Rn(t,n)),e.max=(t,n)=>e.check(Rn(t,n)),e.int=t=>e.check(Ri(t)),e.safe=t=>e.check(Ri(t)),e.positive=t=>e.check($n(0,t)),e.nonnegative=t=>e.check(Cn(0,t)),e.negative=t=>e.check(On(0,t)),e.nonpositive=t=>e.check(Rn(0,t)),e.multipleOf=(t,n)=>e.check(Sn(t,n)),e.step=(t,n)=>e.check(Sn(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 Ii(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ai,e)}const Oi=R("ZodNumberFormat",((e,t)=>{Ht.init(e,t),Ai.init(e,t)}));function Ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}(Oi,e)}const $i=R("ZodBoolean",((e,t)=>{Gt.init(e,t),ii.init(e,t)}));const Ci=R("ZodUnknown",((e,t)=>{Bt.init(e,t),ii.init(e,t)}));function Si(){return new Ci({type:"unknown"})}const xi=R("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Zi(e){return function(e,t){return new e({type:"never",...Ee(t)})}(xi,e)}const Fi=R("ZodDate",((e,t)=>{qt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(Cn(t,n)),e.max=(t,n)=>e.check(Rn(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 Di=R("ZodArray",((e,t)=>{Wt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Zn(t,n)),e.nonempty=t=>e.check(Zn(1,t)),e.max=(t,n)=>e.check(xn(t,n)),e.length=(t,n)=>e.check(Fn(t,n)),e.unwrap=()=>e.element}));function ji(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const Ui=R("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Gi({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Si()}),e.loose=()=>e.clone({...e._zod.def,catchall:Si()}),e.strict=()=>e.clone({...e._zod.def,catchall:Zi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(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=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return we(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(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 he(this,"shape",n),n},checks:e._zod.def.checks};return we(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return we(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return we(e,me(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 he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(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 he(this,"shape",i),i},checks:[]});return we(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return we(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return we(t,i)}(Xi,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new Ui(n)}const Mi=R("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Hi=R("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Gi=R("ZodEnum",((e,t)=>{an.init(e,t),ii.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 Gi({...t,checks:[],...Ee(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 Gi({...t,checks:[],...Ee(i),entries:o})}}));const Bi=R("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new C(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push($e(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($e(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Bi({type:"transform",transform:e})}const qi=R("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Yi(e){return new qi({type:"optional",innerType:e})}const Wi=R("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Wi({type:"nullable",innerType:e})}const Ji=R("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=R("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=R("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=R("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=R("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=R("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=R("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function so(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 ao=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((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),uo=e=>si().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>ao(Ii("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Fi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>si().max(e,`Maximum length is ${e} characters`),mo=Li({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Li({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=Li({balance:po(),expiry:fo(),message:ho(500).nullish(),notes:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),cardHolder:uo(101),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),yo=go.extend({companyId:Ii().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}($i,e)}().default(!0),payment:Li({cardHolder:uo(30),cardNumberToken:uo(50),cardExpiry:uo(5),cardCvcToken:uo(50)}).optional()}),Po=Li({code:uo(10),password:uo(10)}),zo=Po.extend({amount:po(),description:uo(200)});let bo;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(bo||(bo={}));const ko=Li({grant_type:si().readonly().default("refresh_token"),client_id:In(li,undefined),client_secret:si(),refresh_token:si(),scope:si().optional()});const wo=Li({email:ui(),firstName:si().max(100).optional(),lastName:si().max(100).optional(),phone:si().max(20).optional(),scopes:ji(si()).optional()});let Eo;!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"}(Eo||(Eo={}));const To=[Eo.PER_NIGHT,Eo.PER_PERSON_PER_NIGHT,Eo.PER_QUANTITY_NAME_PER_NIGHT,Eo.PER_ROOM_QUANTITY_PER_NIGHT,Eo.PER_PERSON_OCCUPANCY_PER_NIGHT,Eo.PER_ADULT_OCCUPANCY_PER_NIGHT,Eo.PER_CHILD_OCCUPANCY_PER_NIGHT,Eo.PER_ALL_PERSONS_PER_NIGHT];let No,Ao,Io;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(No||(No={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Ao||(Ao={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(Io||(Io={}));const Oo=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},Ro=require("decimal.js");var $o=e.n(Ro);const Co={UP:$o().ROUND_UP,DOWN:$o().ROUND_DOWN,CEIL:$o().ROUND_CEIL,FLOOR:$o().ROUND_FLOOR,HALF_UP:$o().ROUND_HALF_UP,HALF_DOWN:$o().ROUND_HALF_DOWN,HALF_EVEN:$o().ROUND_HALF_EVEN,HALF_CEIL:$o().ROUND_HALF_CEIL,HALF_FLOOR:$o().ROUND_HALF_FLOOR},So=(e,t)=>{const{precision:n=2,rounding:i=Co.HALF_UP}=t||{};return new($o())(e).toDecimalPlaces(n,i).toNumber()};function xo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=So(n);switch(e.feeType){case O.PercentageOfBooking:if(o)return So(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return So(a/(1-t)*e.amount/(100+e.amount))}return So(a*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return So(e.amount*i);default:return 0}}const Zo=[O.FixedChargePerBooking],Fo=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],Do=[O.PercentageOfBooking];function jo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Uo(e){return jo(e,Zo)}function Lo(e){return jo(e,Fo)}function Mo(e){return jo(e,Do)}function Ho(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const Go=e=>e,Bo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Vo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class qo{}function Yo(e){return e.toUpperCase()}qo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===Eo.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===Eo.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 To.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},qo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=qo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),To.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),qo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=qo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),qo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=qo.calculateReservationAddonTotal(o,t)?.total}})),So(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,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>$,AddGiftCardSchema:()=>vo,BaseGiftCardSchema:()=>go,DATE_FORMAT:()=>I,EAddonPricingType:()=>A,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>N,EGuaranteePolicyDepositMode:()=>b,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>w,ERoomstayImageSize:()=>z,GuestProfile:()=>d,HttpMethod:()=>k,IAuxiliaryFilterType:()=>g,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>E,PurchaseGiftCardSchema:()=>_o,RefreshGiftCardTokenSchema:()=>yo,RegisterGiftCardAdminSchema:()=>Po,Reservation:()=>u,ReservedPackage:()=>T,TotalCalculator:()=>Fo,calculateFeeAmount:()=>Eo,calculateTotalForMemberBooking:()=>zo,getFeeOptionValidity:()=>Zo,getFilteredBookingAddonFees:()=>Ro,getFilteredBookingFees:()=>$o,getFilteredBookingRateFees:()=>Oo,maxString:()=>ho,nameof:()=>xo,preprocessDate:()=>co,preprocessNumber:()=>ao,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>Co,roundMoney:()=>ko,subset:()=>So,uppercaseString:()=>Do,validateFormWithZod:()=>so}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,w,k;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={}));class E{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 T extends E{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.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(b||(b={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(k||(k={}));const I="DD/MM/YYYY";let N,A;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(N||(N={})),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"}(A||(A={}));const $=[A.PER_NIGHT,A.PER_PERSON_PER_NIGHT,A.PER_QUANTITY_NAME_PER_NIGHT,A.PER_ROOM_QUANTITY_PER_NIGHT,A.PER_PERSON_OCCUPANCY_PER_NIGHT,A.PER_ADULT_OCCUPANCY_PER_NIGHT,A.PER_CHILD_OCCUPANCY_PER_NIGHT,A.PER_ALL_PERSONS_PER_NIGHT];function O(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class R extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Z extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const x={};function S(e){return e&&Object.assign(x,e),x}const C=/^[cC][^\s-]{8,}$/,F=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,M=/^[a-zA-Z0-9_-]{21}$/,B=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,G=/^([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})$/,L=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)$/,H=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Y=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{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])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(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 ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,se=/^[^A-Z]*$/,ae=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(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 Te={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 Ie(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 Ne(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ae(e){return"string"==typeof e?e:e?.message}function $e(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Oe(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Re(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ze=O("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),xe={number:"number",bigint:"bigint",object:"date"},Se=O("$ZodCheckLessThan",((e,t)=>{Ze.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ce=O("$ZodCheckGreaterThan",((e,t)=>{Ze.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=O("$ZodCheckMultipleOf",((e,t)=>{Ze.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})}})),De=O("$ZodCheckNumberFormat",((e,t)=>{Ze.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[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=ie)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),je=O("$ZodCheckMaxLength",((e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Oe(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ue=O("$ZodCheckMinLength",((e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Oe(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Me=O("$ZodCheckLengthEquals",((e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Oe(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Be=O("$ZodCheckStringFormat",((e,t)=>{var n,i;Ze.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=()=>{})})),Ge=O("$ZodCheckRegex",((e,t)=>{Be.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),Le=O("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=se),Be.init(e,t)})),He=O("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ae),Be.init(e,t)})),Ve=O("$ZodCheckIncludes",((e,t)=>{Ze.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),qe=O("$ZodCheckStartsWith",((e,t)=>{Ze.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Ye=O("$ZodCheckEndsWith",((e,t)=>{Ze.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),Qe=O("$ZodCheckOverwrite",((e,t)=>{Ze.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class We{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 Je=(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,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=O("$ZodError",Je),Xe=O("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new R;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,S()))));throw ve(t,o?.callee),t}return s.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,S()))));throw ve(t,o?.callee),t}return s.value},nt=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 R;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>$e(e,o,S()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=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=>$e(e,o,S()))))}:{success:!0,data:r.value}},rt=ot(Xe),st=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},at=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=O("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;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=Ie(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new R;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ie(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ie(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ie(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new R;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new R;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=O("$ZodString",((e,t)=>{var n;mt.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}})),vt=O("$ZodStringFormat",((e,t)=>{Be.init(e,t),gt.init(e,t)})),_t=O("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=G),vt.init(e,t)})),yt=O("$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=L(e))}else t.pattern??(t.pattern=L());vt.init(e,t)})),Pt=O("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=H),vt.init(e,t)})),zt=O("$ZodURL",((e,t)=>{vt.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:K.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})}}})),bt=O("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),wt=O("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),kt=O("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=C),vt.init(e,t)})),Et=O("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Tt=O("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),It=O("$ZodXID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),Nt=O("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),At=O("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({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(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),$t=O("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Ot=O("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),Rt=O("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=B),vt.init(e,t)})),Zt=O("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),xt=O("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),vt.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})}}})),St=O("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Y),vt.init(e,t)})),Ct=O("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Q),vt.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 Ft(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=O("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=W),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ft(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),jt=O("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ft(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})}})),Ut=O("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Mt=O("$ZodJWT",((e,t)=>{vt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Bt=O("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,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}})),Gt=O("$ZodNumber",((e,t)=>{De.init(e,t),Bt.init(e,t)})),Lt=O("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,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}})),Ht=O("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=O("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=O("$ZodDate",((e,t)=>{mt.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 Yt(e,t,n){e.issues.length&&t.issues.push(...Ne(n,e.issues)),t.value[n]=e.value}const Qt=O("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Yt(t,n,e)))):Yt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Wt(e,t,n,i){e.issues.length&&t.issues.push(...Ne(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(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 Kt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Wt(e,n,o,t)))):Wt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=O("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(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=_e,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Wt(n,t,e,a)))):Wt(n,t,e,a)}return o?Kt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=O("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,s=!x.jitless,a=s&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new We(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(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=>!Ie(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=>$e(e,i,S())))))}),t)}const nn=O("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(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=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>tn(t,o,e,r))):tn(a,o,e,r)}})),on=O("$ZodIntersection",((e,t)=>{mt.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])=>sn(e,t,n))):sn(e,o,r)}}));function rn(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(Pe(e)&&Pe(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=rn(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=rn(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 sn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ie(e))return e;const i=rn(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 an=O("$ZodEnum",((e,t)=>{mt.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=>be.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),cn=O("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new Z(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 R;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=O("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(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=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=O("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(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)})),pn=O("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=O("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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))})),mn=O("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(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=>gn(t,e))):gn(o,e)}}));function gn(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 vn=O("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(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=>$e(e,n,S())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>$e(e,n,S())))},input:e.value}),e.issues=[]),e)}})),_n=O("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(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=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=O("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(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(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=O("$ZodCustom",((e,t)=>{Ze.init(e,t),mt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Re(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class kn{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 En(){return new kn}const Tn=En();function In(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function Nn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function An(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function $n(e,t){return new Se({check:"less_than",...Ee(t),value:e,inclusive:!1})}function On(e,t){return new Se({check:"less_than",...Ee(t),value:e,inclusive:!0})}function Rn(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function Zn(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function xn(e,t){return new Fe({check:"multiple_of",...Ee(t),value:e})}function Sn(e,t){return new je({check:"max_length",...Ee(t),maximum:e})}function Cn(e,t){return new Ue({check:"min_length",...Ee(t),minimum:e})}function Fn(e,t){return new Me({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new Qe({check:"overwrite",tx:e})}const jn=O("ZodISODateTime",((e,t)=>{At.init(e,t),ai.init(e,t)}));const Un=O("ZodISODate",((e,t)=>{$t.init(e,t),ai.init(e,t)}));const Mn=O("ZodISOTime",((e,t)=>{Ot.init(e,t),ai.init(e,t)}));const Bn=O("ZodISODuration",((e,t)=>{Rt.init(e,t),ai.init(e,t)}));const Gn=(e,t)=>{Ke.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,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Ln=(O("ZodError",Gn),O("ZodError",Gn,{Parent:Error})),Hn=et(Ln),Vn=tt(Ln),qn=nt(Ln),Yn=ot(Ln),Qn=st(Ln),Wn=at(Ln),Jn=ct(Ln),Kn=ut(Ln),Xn=dt(Ln),ei=lt(Ln),ti=pt(Ln),ni=ft(Ln),ii=O("ZodType",((e,t)=>(mt.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)=>ke(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Hn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Yn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qn(e,t,n),e.decode=(t,n)=>Wn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(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,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Ze({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Re(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(Re(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>Yi(e),e.nullable=()=>Wi(e),e.nullish=()=>Yi(Wi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>ji(e),e.or=t=>function(e,t){return new Bi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Gi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=O("_ZodString",((e,t)=>{gt.init(e,t),ii.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 Ge({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Cn(...t)),e.max=(...t)=>e.check(Sn(...t)),e.length=(...t)=>e.check(Fn(...t)),e.nonempty=(...t)=>e.check(Cn(1,...t)),e.lowercase=t=>e.check(function(e){return new Le({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new He({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=O("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(In(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ii,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(Nn(di,t)),e.uuid=t=>e.check(An(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(Nn(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,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,...Ee(t)})}(jn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(Un,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,...Ee(t)})}(Mn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Bn,e)}(t))}));function si(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const ai=O("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=O("ZodEmail",((e,t)=>{Pt.init(e,t),ai.init(e,t)}));function ui(e){return In(ci,e)}const di=O("ZodGUID",((e,t)=>{_t.init(e,t),ai.init(e,t)})),li=O("ZodUUID",((e,t)=>{yt.init(e,t),ai.init(e,t)})),pi=O("ZodURL",((e,t)=>{zt.init(e,t),ai.init(e,t)})),fi=O("ZodEmoji",((e,t)=>{bt.init(e,t),ai.init(e,t)})),hi=O("ZodNanoID",((e,t)=>{wt.init(e,t),ai.init(e,t)})),mi=O("ZodCUID",((e,t)=>{kt.init(e,t),ai.init(e,t)})),gi=O("ZodCUID2",((e,t)=>{Et.init(e,t),ai.init(e,t)})),vi=O("ZodULID",((e,t)=>{Tt.init(e,t),ai.init(e,t)})),_i=O("ZodXID",((e,t)=>{It.init(e,t),ai.init(e,t)})),yi=O("ZodKSUID",((e,t)=>{Nt.init(e,t),ai.init(e,t)})),Pi=O("ZodIPv4",((e,t)=>{Zt.init(e,t),ai.init(e,t)})),zi=O("ZodIPv6",((e,t)=>{xt.init(e,t),ai.init(e,t)})),bi=O("ZodCIDRv4",((e,t)=>{St.init(e,t),ai.init(e,t)})),wi=O("ZodCIDRv6",((e,t)=>{Ct.init(e,t),ai.init(e,t)})),ki=O("ZodBase64",((e,t)=>{Dt.init(e,t),ai.init(e,t)})),Ei=O("ZodBase64URL",((e,t)=>{jt.init(e,t),ai.init(e,t)})),Ti=O("ZodE164",((e,t)=>{Ut.init(e,t),ai.init(e,t)})),Ii=O("ZodJWT",((e,t)=>{Mt.init(e,t),ai.init(e,t)})),Ni=O("ZodNumber",((e,t)=>{Bt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check(Rn(t,n)),e.gte=(t,n)=>e.check(Zn(t,n)),e.min=(t,n)=>e.check(Zn(t,n)),e.lt=(t,n)=>e.check($n(t,n)),e.lte=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check(On(t,n)),e.int=t=>e.check(Oi(t)),e.safe=t=>e.check(Oi(t)),e.positive=t=>e.check(Rn(0,t)),e.nonnegative=t=>e.check(Zn(0,t)),e.negative=t=>e.check($n(0,t)),e.nonpositive=t=>e.check(On(0,t)),e.multipleOf=(t,n)=>e.check(xn(t,n)),e.step=(t,n)=>e.check(xn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ai(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ni,e)}const $i=O("ZodNumberFormat",((e,t)=>{Gt.init(e,t),Ni.init(e,t)}));function Oi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}($i,e)}const Ri=O("ZodBoolean",((e,t)=>{Lt.init(e,t),ii.init(e,t)}));const Zi=O("ZodUnknown",((e,t)=>{Ht.init(e,t),ii.init(e,t)}));function xi(){return new Zi({type:"unknown"})}const Si=O("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"never",...Ee(t)})}(Si,e)}const Fi=O("ZodDate",((e,t)=>{qt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(Zn(t,n)),e.max=(t,n)=>e.check(On(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 Di=O("ZodArray",((e,t)=>{Qt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Cn(t,n)),e.nonempty=t=>e.check(Cn(1,t)),e.max=(t,n)=>e.check(Sn(t,n)),e.length=(t,n)=>e.check(Fn(t,n)),e.unwrap=()=>e.element}));function ji(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const Ui=O("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Li({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xi()}),e.loose=()=>e.clone({...e._zod.def,catchall:xi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(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=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return ke(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(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 he(this,"shape",n),n},checks:e._zod.def.checks};return ke(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ke(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return ke(e,me(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 he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(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 he(this,"shape",i),i},checks:[]});return ke(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return ke(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return ke(t,i)}(Xi,e,t[0])}));function Mi(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new Ui(n)}const Bi=O("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Gi=O("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Li=O("ZodEnum",((e,t)=>{an.init(e,t),ii.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 Li({...t,checks:[],...Ee(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 Li({...t,checks:[],...Ee(i),entries:o})}}));const Hi=O("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new Z(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Re(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(Re(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Hi({type:"transform",transform:e})}const qi=O("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Yi(e){return new qi({type:"optional",innerType:e})}const Qi=O("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Wi(e){return new Qi({type:"nullable",innerType:e})}const Ji=O("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=O("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=O("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=O("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=O("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=O("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=O("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function so(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 ao=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setHours(0,0,0,0),t):e}),e),uo=e=>si().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>ao(Ai("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Fi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>si().max(e,`Maximum length is ${e} characters`),mo=Mi({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Mi({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=go.extend({companyId:Ai().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}(Ri,e)}().default(!0),payment:Mi({cardHolder:uo(30),cardNumberToken:uo(50),cardExpiry:uo(5),cardCvcToken:uo(50)}).optional()}),yo=Mi({grant_type:si().readonly().default("refresh_token"),client_id:An(li,undefined),client_secret:si(),refresh_token:si(),scope:si().optional()});const Po=Mi({email:ui(),firstName:si().max(100).optional(),lastName:si().max(100).optional(),phone:si().max(20).optional(),scopes:ji(si()).optional()}),zo=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},bo=require("decimal.js");var wo=e.n(bo);const ko=e=>new(wo())(e).toDecimalPlaces(2).toNumber();function Eo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=ko(n);switch(e.feeType){case N.PercentageOfBooking:if(o)return ko(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return ko(a/(1-t)*e.amount/(100+e.amount))}return ko(a*(e.amount/100));case N.FixedChargePerRoom:case N.FixedChargePerBooking:return e.amount;case N.NightlyChargePerRoom:return ko(e.amount*i);default:return 0}}const To=[N.FixedChargePerBooking],Io=[N.PercentageOfBooking,N.FixedChargePerRoom,N.NightlyChargePerRoom],No=[N.PercentageOfBooking];function Ao(e,t){return e.filter((e=>t.includes(e.feeType)))}function $o(e){return Ao(e,To)}function Oo(e){return Ao(e,Io)}function Ro(e){return Ao(e,No)}function Zo(e){return{includeInRates:[N.PercentageOfBooking,N.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===N.PercentageOfBooking,appliesToAddons:e===N.PercentageOfBooking,includePreviousFeesInCalculation:e===N.PercentageOfBooking}}const xo=e=>e,So=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Co=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Fo{}function Do(e){return e.toUpperCase()}Fo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===A.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===A.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 $.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Fo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Fo.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))),$.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})),Fo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Fo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Fo.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+=Fo.calculateReservationAddonTotal(o,t)?.total}})),ko(n)},module.exports=t})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EGuaranteePolicyDepositMode } from '../Policies/EGuaranteePolicy.enum';
|
|
2
2
|
import { IItemisedBookingFeeResponse } from '../Booking/Itinerary.types';
|
|
3
|
-
import { Warning } from
|
|
3
|
+
import { Warning } from '../index.js';
|
|
4
4
|
export type IAvailability = {
|
|
5
5
|
roomTypes: {
|
|
6
6
|
[roomTypeCode: string]: IRoomType;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the response body that comes down if a booking fails anywhere in the booking flow.
|
|
3
|
+
*
|
|
4
|
+
* Object will contain a public message only, with partial reservation data to be able to attempt to "resume" the booking
|
|
5
|
+
*/
|
|
6
|
+
export type IBookingCreateErrorResponse = {
|
|
7
|
+
canRetryPayment: boolean;
|
|
8
|
+
isPaymentTaken: boolean;
|
|
9
|
+
publicMessage: string;
|
|
10
|
+
roomstayId: string;
|
|
11
|
+
};
|
|
@@ -20,8 +20,7 @@ export declare enum EHotelCardProcessor {
|
|
|
20
20
|
Till = "Till",
|
|
21
21
|
RMSPay = "RMSPay",
|
|
22
22
|
Windcave = "Windcave",
|
|
23
|
-
Mastercard = "Mastercard"
|
|
24
|
-
Stripe = "Stripe"
|
|
23
|
+
Mastercard = "Mastercard"
|
|
25
24
|
}
|
|
26
25
|
export declare enum EPlanpayBookingStatus {
|
|
27
26
|
Unknown = "unknown",// incase plan.deposit.status is unavailable
|
|
@@ -87,11 +86,6 @@ export type IPaymentCheckoutDetails = {
|
|
|
87
86
|
paymentMode: 'EmbeddedPage' | 'PaymentPage';
|
|
88
87
|
baseUrl: string;
|
|
89
88
|
};
|
|
90
|
-
stripe?: {
|
|
91
|
-
clientSecret: string;
|
|
92
|
-
publishableApiKey: string;
|
|
93
|
-
successUrl: string;
|
|
94
|
-
};
|
|
95
89
|
isSplitPayment?: boolean;
|
|
96
90
|
totalAuthorizedAmount?: number;
|
|
97
91
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { ELogCategory, ELogSeverity, ELogType } from './GiftCardLogs.enum';
|
|
3
2
|
/**
|
|
4
3
|
* Schema for validating international addresses.
|
|
5
4
|
*/
|
|
@@ -11,37 +10,6 @@ export declare const InternationalAddressSchema: z.ZodObject<{
|
|
|
11
10
|
postcode: z.ZodOptional<z.ZodString>;
|
|
12
11
|
country: z.ZodString;
|
|
13
12
|
}, z.core.$strip>;
|
|
14
|
-
/**
|
|
15
|
-
* Basic details of a gift card that can be shared with customers.
|
|
16
|
-
*/
|
|
17
|
-
export type IGiftCardDTO = {
|
|
18
|
-
code: string;
|
|
19
|
-
amount: number;
|
|
20
|
-
balance: number;
|
|
21
|
-
expiry: Date;
|
|
22
|
-
giverFirstName: string;
|
|
23
|
-
giverLastName: string;
|
|
24
|
-
cardHolder: string;
|
|
25
|
-
message?: string | null;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Details of a gift card that can be shared with admins.
|
|
29
|
-
*/
|
|
30
|
-
export type IAdminGiftCardDTO = IGiftCardDTO & {
|
|
31
|
-
createdBy?: string | null;
|
|
32
|
-
giverEmail: string;
|
|
33
|
-
giverPhone: string;
|
|
34
|
-
recipientEmail: string;
|
|
35
|
-
recipientPhone?: string | null;
|
|
36
|
-
notes?: string | null;
|
|
37
|
-
deletedDate?: string | null;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Extended details of a gift card for the details view in admin.
|
|
41
|
-
*/
|
|
42
|
-
export type IAdminGiftCardDetailsDTO = IAdminGiftCardDTO & {
|
|
43
|
-
createdAt: Date;
|
|
44
|
-
};
|
|
45
13
|
/**
|
|
46
14
|
* Base schema for validating a new gift card.
|
|
47
15
|
*/
|
|
@@ -96,24 +64,6 @@ export type IAddGiftCardRequest = z.infer<typeof AddGiftCardSchema>;
|
|
|
96
64
|
export type IAddGiftCardResponse = IAdminGiftCardDTO & {
|
|
97
65
|
password: string;
|
|
98
66
|
};
|
|
99
|
-
/**
|
|
100
|
-
* Schema for validating editing an existing gift card from admin.
|
|
101
|
-
* Note: Edits the balance (not amount), as amount represents the original purchase value.
|
|
102
|
-
*/
|
|
103
|
-
export declare const EditGiftCardSchema: z.ZodObject<{
|
|
104
|
-
balance: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
|
|
105
|
-
expiry: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<Date, unknown, z.core.$ZodTypeInternals<Date, unknown>>>;
|
|
106
|
-
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
-
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
-
giverFirstName: z.ZodString;
|
|
109
|
-
giverLastName: z.ZodString;
|
|
110
|
-
giverEmail: z.ZodEmail;
|
|
111
|
-
giverPhone: z.ZodString;
|
|
112
|
-
cardHolder: z.ZodString;
|
|
113
|
-
recipientEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
114
|
-
recipientPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
-
}, z.core.$strip>;
|
|
116
|
-
export type IEditGiftCardRequest = z.infer<typeof EditGiftCardSchema>;
|
|
117
67
|
/**
|
|
118
68
|
* Schema for validating purchasing a gift card.
|
|
119
69
|
*/
|
|
@@ -150,57 +100,27 @@ export type IPurchaseGiftCardRequest = z.infer<typeof PurchaseGiftCardSchema>;
|
|
|
150
100
|
export type IPurchaseGiftCardResponse = IGiftCardDTO & {
|
|
151
101
|
password: string;
|
|
152
102
|
};
|
|
153
|
-
export declare const ValidateGiftCardSchema: z.ZodObject<{
|
|
154
|
-
code: z.ZodString;
|
|
155
|
-
password: z.ZodString;
|
|
156
|
-
}, z.core.$strip>;
|
|
157
|
-
export type IValidateGiftCardRequest = z.infer<typeof ValidateGiftCardSchema>;
|
|
158
|
-
export declare const RedeemGiftCardSchema: z.ZodObject<{
|
|
159
|
-
code: z.ZodString;
|
|
160
|
-
password: z.ZodString;
|
|
161
|
-
amount: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
|
|
162
|
-
description: z.ZodString;
|
|
163
|
-
}, z.core.$strip>;
|
|
164
|
-
export type IRedeemGiftCardRequest = z.infer<typeof RedeemGiftCardSchema>;
|
|
165
|
-
export declare enum EGiftCardTransactionType {
|
|
166
|
-
Purchase = "Purchase",
|
|
167
|
-
Redemption = "Redemption",
|
|
168
|
-
Adjustment = "Adjustment"
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Basic details of a gift card transaction that can be shared with customers.
|
|
172
|
-
*/
|
|
173
|
-
export type IGiftCardTransactionDTO = {
|
|
174
|
-
id: string;
|
|
175
|
-
giftCard: IGiftCardDTO;
|
|
176
|
-
date: Date;
|
|
177
|
-
type: EGiftCardTransactionType;
|
|
178
|
-
amount: number;
|
|
179
|
-
};
|
|
180
103
|
/**
|
|
181
|
-
*
|
|
104
|
+
* Basic details of a gift card that can be shared with customers.
|
|
182
105
|
*/
|
|
183
|
-
export type
|
|
184
|
-
|
|
185
|
-
date: Date;
|
|
186
|
-
type: EGiftCardTransactionType;
|
|
106
|
+
export type IGiftCardDTO = {
|
|
107
|
+
code: string;
|
|
187
108
|
amount: number;
|
|
188
|
-
|
|
189
|
-
|
|
109
|
+
balance: number;
|
|
110
|
+
expiry: Date;
|
|
111
|
+
giverFirstName: string;
|
|
112
|
+
giverLastName: string;
|
|
113
|
+
cardHolder: string;
|
|
114
|
+
message?: string | null;
|
|
190
115
|
};
|
|
191
116
|
/**
|
|
192
|
-
*
|
|
117
|
+
* Details of a gift card that can be shared with admins.
|
|
193
118
|
*/
|
|
194
|
-
export type
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
ip?: string | null;
|
|
202
|
-
url?: string | null;
|
|
203
|
-
username?: string | null;
|
|
204
|
-
userId?: string | null;
|
|
205
|
-
additionalData?: any;
|
|
119
|
+
export type IAdminGiftCardDTO = IGiftCardDTO & {
|
|
120
|
+
createdBy?: string | null;
|
|
121
|
+
giverEmail: string;
|
|
122
|
+
giverPhone: string;
|
|
123
|
+
recipientEmail: string;
|
|
124
|
+
recipientPhone?: string | null;
|
|
125
|
+
notes?: string | null;
|
|
206
126
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -54,8 +54,6 @@ export * from './OHIP/index';
|
|
|
54
54
|
* Image
|
|
55
55
|
*/
|
|
56
56
|
export * from './Image/IRoomstayImage.type';
|
|
57
|
-
/** Maintenance */
|
|
58
|
-
export * from './Maintenance/IMaintenanceStatus.type';
|
|
59
57
|
/**
|
|
60
58
|
* Member Details
|
|
61
59
|
*/
|
|
@@ -86,11 +84,11 @@ export * from './Events/IRoomstayEvent.type';
|
|
|
86
84
|
/**
|
|
87
85
|
* General
|
|
88
86
|
*/
|
|
89
|
-
export * from './General/Format.types';
|
|
90
87
|
export * from './General/HttpMethod.enum';
|
|
91
88
|
export * from './General/IMessage.type';
|
|
92
|
-
export * from './General/Pagination.types';
|
|
93
89
|
export * from './General/Warning.type';
|
|
90
|
+
export * from './General/Pagination.types';
|
|
91
|
+
export * from './General/Format.types';
|
|
94
92
|
/**
|
|
95
93
|
* Media
|
|
96
94
|
*/
|
|
@@ -101,20 +99,10 @@ export * from './Media/IMedia.type';
|
|
|
101
99
|
export * from './Fees/EFeeType.enum';
|
|
102
100
|
export * from './Fees/IFee.type';
|
|
103
101
|
export * from './Fees/IFeeConfigurationOptions.type';
|
|
104
|
-
/**
|
|
105
|
-
* Api
|
|
106
|
-
*/
|
|
107
|
-
export * from './Api/Reservations.type';
|
|
108
|
-
export * from './Api/RoomNightRate.type';
|
|
109
102
|
/**
|
|
110
103
|
* Analytics
|
|
111
104
|
*/
|
|
112
105
|
export * from './Analytics/IBigQueryResults.type';
|
|
113
|
-
/**
|
|
114
|
-
* Gift Cards
|
|
115
|
-
*/
|
|
116
|
-
export * from './GiftCards/GiftCard.types';
|
|
117
|
-
export * from './GiftCards/GiftCardAuth.types';
|
|
118
106
|
/**
|
|
119
107
|
* Addons
|
|
120
108
|
*/
|
|
@@ -130,4 +118,3 @@ export * from './Api/RoomNightRate.type';
|
|
|
130
118
|
*/
|
|
131
119
|
export * from './GiftCards/GiftCard.types';
|
|
132
120
|
export * from './GiftCards/GiftCardAuth.types';
|
|
133
|
-
export * from './GiftCards/GiftCardLogs.enum';
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import Decimal from "decimal.js";
|
|
2
|
-
export declare const RoundingType: {
|
|
3
|
-
[key: string]: Decimal.Rounding;
|
|
4
|
-
};
|
|
5
|
-
interface RoundMoneyOptions {
|
|
6
|
-
precision?: number;
|
|
7
|
-
rounding?: Decimal.Rounding;
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
2
|
* Rounds a monetary amount to two decimal places.
|
|
11
3
|
*
|
|
@@ -13,8 +5,6 @@ interface RoundMoneyOptions {
|
|
|
13
5
|
* with some systems, such as RMS.
|
|
14
6
|
*
|
|
15
7
|
* @param amount a string or number to be rounded
|
|
16
|
-
* @param options an object containing precision and rounding options
|
|
17
8
|
* @returns the rounded amount as a number
|
|
18
9
|
*/
|
|
19
|
-
export declare const roundMoney: (amount: string | number
|
|
20
|
-
export {};
|
|
10
|
+
export declare const roundMoney: (amount: string | number) => number;
|
package/dist/web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>To,AddGiftCardSchema:()=>vo,BaseGiftCardSchema:()=>go,DATE_FORMAT:()=>A,EAddonPricingType:()=>Eo,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>O,EGiftCardTransactionType:()=>bo,EGuaranteePolicyDepositMode:()=>k,EGuarantyPolicyPrepaymentType:()=>w,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Ao,ELogSeverity:()=>No,ELogType:()=>Io,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,EditGiftCardSchema:()=>_o,GuestProfile:()=>d,HttpMethod:()=>I,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>yo,RedeemGiftCardSchema:()=>zo,RefreshGiftCardTokenSchema:()=>ko,RegisterGiftCardAdminSchema:()=>wo,Reservation:()=>u,ReservedPackage:()=>N,RoundingType:()=>Co,TotalCalculator:()=>Yo,ValidateGiftCardSchema:()=>Po,calculateFeeAmount:()=>xo,calculateTotalForMemberBooking:()=>Oo,getFeeOptionValidity:()=>Ho,getFilteredBookingAddonFees:()=>Mo,getFilteredBookingFees:()=>Uo,getFilteredBookingRateFees:()=>Lo,maxString:()=>ho,nameof:()=>Go,preprocessDate:()=>co,preprocessNumber:()=>ao,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>Vo,roundMoney:()=>So,subset:()=>Bo,uppercaseString:()=>qo,validateFormWithZod:()=>so}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class N extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(w||(w={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={}));const A="DD/MM/YYYY";let I,O;function R(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(I||(I={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),Object.freeze({status:"aborted"}),Symbol("zod_brand");class $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class C extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const S={};function x(e){return e&&Object.assign(S,e),S}const Z=/^[cC][^\s-]{8,}$/,F=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,M=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,G=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)$/,B=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{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])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(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 ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,se=/^[^A-Z]*$/,ae=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function we(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(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 Te={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ae(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ie(e){return"string"==typeof e?e:e?.message}function Oe(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ie(e.inst?._zod.def?.error?.(e))??Ie(t?.error?.(e))??Ie(n.customError?.(e))??Ie(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Re(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function $e(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ce=R("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Se={number:"number",bigint:"bigint",object:"date"},xe=R("$ZodCheckLessThan",((e,t)=>{Ce.init(e,t);const n=Se[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})}})),Ze=R("$ZodCheckGreaterThan",((e,t)=>{Ce.init(e,t);const n=Se[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})}})),Fe=R("$ZodCheckMultipleOf",((e,t)=>{Ce.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})}})),De=R("$ZodCheckNumberFormat",((e,t)=>{Ce.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[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=ie)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),je=R("$ZodCheckMaxLength",((e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Re(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ue=R("$ZodCheckMinLength",((e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Re(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=R("$ZodCheckLengthEquals",((e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Re(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Me=R("$ZodCheckStringFormat",((e,t)=>{var n,i;Ce.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),He=R("$ZodCheckRegex",((e,t)=>{Me.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})}})),Ge=R("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=se),Me.init(e,t)})),Be=R("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ae),Me.init(e,t)})),Ve=R("$ZodCheckIncludes",((e,t)=>{Ce.init(e,t);const n=ke(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),Ye=R("$ZodCheckStartsWith",((e,t)=>{Ce.init(e,t);const n=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),qe=R("$ZodCheckEndsWith",((e,t)=>{Ce.init(e,t);const n=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=R("$ZodCheckOverwrite",((e,t)=>{Ce.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Qe{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 Je=(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,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=R("$ZodError",Je),Xe=R("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new $;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,x()))));throw ve(t,o?.callee),t}return s.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,x()))));throw ve(t,o?.callee),t}return s.value},nt=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 $;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>Oe(e,o,x()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=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=>Oe(e,o,x()))))}:{success:!0,data:r.value}},rt=ot(Xe),st=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},at=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=R("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new $;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=R("$ZodString",((e,t)=>{var n;mt.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}})),vt=R("$ZodStringFormat",((e,t)=>{Me.init(e,t),gt.init(e,t)})),_t=R("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),vt.init(e,t)})),yt=R("$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=G(e))}else t.pattern??(t.pattern=G());vt.init(e,t)})),Pt=R("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=B),vt.init(e,t)})),zt=R("$ZodURL",((e,t)=>{vt.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:K.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})}}})),bt=R("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),kt=R("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),vt.init(e,t)})),wt=R("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=Z),vt.init(e,t)})),Et=R("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Tt=R("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),Nt=R("$ZodXID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),At=R("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),It=R("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({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(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),Ot=R("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Rt=R("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),$t=R("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),Ct=R("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),St=R("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),vt.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})}}})),xt=R("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=q),vt.init(e,t)})),Zt=R("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),vt.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 Ft(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=R("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ft(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),jt=R("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ft(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})}})),Ut=R("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Lt=R("$ZodJWT",((e,t)=>{vt.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})}})),Mt=R("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Ht=R("$ZodNumber",((e,t)=>{De.init(e,t),Mt.init(e,t)})),Gt=R("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,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}})),Bt=R("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=R("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=R("$ZodDate",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function qt(e,t,n){e.issues.length&&t.issues.push(...Ae(n,e.issues)),t.value[n]=e.value}const Wt=R("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>qt(t,n,e)))):qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Qt(e,t,n,i){e.issues.length&&t.issues.push(...Ae(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(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 Kt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Qt(e,n,o,t)))):Qt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=R("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(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=_e,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Qt(n,t,e,a)))):Qt(n,t,e,a)}return o?Kt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=R("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,s=!S.jitless,a=s&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Qe(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Oe(e,i,x())))))}),t)}const nn=R("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(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=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>tn(t,o,e,r))):tn(a,o,e,r)}})),on=R("$ZodIntersection",((e,t)=>{mt.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])=>sn(e,t,n))):sn(e,o,r)}}));function rn(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(Pe(e)&&Pe(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=rn(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=rn(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 sn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=rn(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 an=R("$ZodEnum",((e,t)=>{mt.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=>be.has(typeof e))).map((e=>"string"==typeof e?ke(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}})),cn=R("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new C(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 $;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=R("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(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=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=R("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(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)})),pn=R("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=R("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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))})),mn=R("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(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=>gn(t,e))):gn(o,e)}}));function gn(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 vn=R("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(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=>Oe(e,n,x())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Oe(e,n,x())))},input:e.value}),e.issues=[]),e)}})),_n=R("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(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=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=R("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(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(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=R("$ZodCustom",((e,t)=>{Ce.init(e,t),mt.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=>kn(t,n,i,e)));kn(o,n,i,e)}}));function kn(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($e(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class wn{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 En(){return new wn}const Tn=En();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function An(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function In(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function On(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!1})}function Rn(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!0})}function $n(e,t){return new Ze({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function Cn(e,t){return new Ze({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"multiple_of",...Ee(t),value:e})}function xn(e,t){return new je({check:"max_length",...Ee(t),maximum:e})}function Zn(e,t){return new Ue({check:"min_length",...Ee(t),minimum:e})}function Fn(e,t){return new Le({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new We({check:"overwrite",tx:e})}const jn=R("ZodISODateTime",((e,t)=>{It.init(e,t),ai.init(e,t)}));const Un=R("ZodISODate",((e,t)=>{Ot.init(e,t),ai.init(e,t)}));const Ln=R("ZodISOTime",((e,t)=>{Rt.init(e,t),ai.init(e,t)}));const Mn=R("ZodISODuration",((e,t)=>{$t.init(e,t),ai.init(e,t)}));const Hn=(e,t)=>{Ke.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,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Gn=(R("ZodError",Hn),R("ZodError",Hn,{Parent:Error})),Bn=et(Gn),Vn=tt(Gn),Yn=nt(Gn),qn=ot(Gn),Wn=st(Gn),Qn=at(Gn),Jn=ct(Gn),Kn=ut(Gn),Xn=dt(Gn),ei=lt(Gn),ti=pt(Gn),ni=ft(Gn),ii=R("ZodType",((e,t)=>(mt.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)=>we(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Bn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Qn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(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,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Ce({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push($e(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($e(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>qi(e),e.nullable=()=>Qi(e),e.nullish=()=>qi(Qi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>ji(e),e.or=t=>function(e,t){return new Mi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=R("_ZodString",((e,t)=>{gt.init(e,t),ii.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Zn(...t)),e.max=(...t)=>e.check(xn(...t)),e.length=(...t)=>e.check(Fn(...t)),e.nonempty=(...t)=>e.check(Zn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ge({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Be({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=R("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(Nn(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(An(di,t)),e.uuid=t=>e.check(In(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(An(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,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,...Ee(t)})}(jn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(Un,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,...Ee(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Mn,e)}(t))}));function si(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const ai=R("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=R("ZodEmail",((e,t)=>{Pt.init(e,t),ai.init(e,t)}));function ui(e){return Nn(ci,e)}const di=R("ZodGUID",((e,t)=>{_t.init(e,t),ai.init(e,t)})),li=R("ZodUUID",((e,t)=>{yt.init(e,t),ai.init(e,t)})),pi=R("ZodURL",((e,t)=>{zt.init(e,t),ai.init(e,t)})),fi=R("ZodEmoji",((e,t)=>{bt.init(e,t),ai.init(e,t)})),hi=R("ZodNanoID",((e,t)=>{kt.init(e,t),ai.init(e,t)})),mi=R("ZodCUID",((e,t)=>{wt.init(e,t),ai.init(e,t)})),gi=R("ZodCUID2",((e,t)=>{Et.init(e,t),ai.init(e,t)})),vi=R("ZodULID",((e,t)=>{Tt.init(e,t),ai.init(e,t)})),_i=R("ZodXID",((e,t)=>{Nt.init(e,t),ai.init(e,t)})),yi=R("ZodKSUID",((e,t)=>{At.init(e,t),ai.init(e,t)})),Pi=R("ZodIPv4",((e,t)=>{Ct.init(e,t),ai.init(e,t)})),zi=R("ZodIPv6",((e,t)=>{St.init(e,t),ai.init(e,t)})),bi=R("ZodCIDRv4",((e,t)=>{xt.init(e,t),ai.init(e,t)})),ki=R("ZodCIDRv6",((e,t)=>{Zt.init(e,t),ai.init(e,t)})),wi=R("ZodBase64",((e,t)=>{Dt.init(e,t),ai.init(e,t)})),Ei=R("ZodBase64URL",((e,t)=>{jt.init(e,t),ai.init(e,t)})),Ti=R("ZodE164",((e,t)=>{Ut.init(e,t),ai.init(e,t)})),Ni=R("ZodJWT",((e,t)=>{Lt.init(e,t),ai.init(e,t)})),Ai=R("ZodNumber",((e,t)=>{Mt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check($n(t,n)),e.gte=(t,n)=>e.check(Cn(t,n)),e.min=(t,n)=>e.check(Cn(t,n)),e.lt=(t,n)=>e.check(On(t,n)),e.lte=(t,n)=>e.check(Rn(t,n)),e.max=(t,n)=>e.check(Rn(t,n)),e.int=t=>e.check(Ri(t)),e.safe=t=>e.check(Ri(t)),e.positive=t=>e.check($n(0,t)),e.nonnegative=t=>e.check(Cn(0,t)),e.negative=t=>e.check(On(0,t)),e.nonpositive=t=>e.check(Rn(0,t)),e.multipleOf=(t,n)=>e.check(Sn(t,n)),e.step=(t,n)=>e.check(Sn(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 Ii(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ai,e)}const Oi=R("ZodNumberFormat",((e,t)=>{Ht.init(e,t),Ai.init(e,t)}));function Ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}(Oi,e)}const $i=R("ZodBoolean",((e,t)=>{Gt.init(e,t),ii.init(e,t)}));const Ci=R("ZodUnknown",((e,t)=>{Bt.init(e,t),ii.init(e,t)}));function Si(){return new Ci({type:"unknown"})}const xi=R("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Zi(e){return function(e,t){return new e({type:"never",...Ee(t)})}(xi,e)}const Fi=R("ZodDate",((e,t)=>{Yt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(Cn(t,n)),e.max=(t,n)=>e.check(Rn(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 Di=R("ZodArray",((e,t)=>{Wt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Zn(t,n)),e.nonempty=t=>e.check(Zn(1,t)),e.max=(t,n)=>e.check(xn(t,n)),e.length=(t,n)=>e.check(Fn(t,n)),e.unwrap=()=>e.element}));function ji(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const Ui=R("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Gi({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Si()}),e.loose=()=>e.clone({...e._zod.def,catchall:Si()}),e.strict=()=>e.clone({...e._zod.def,catchall:Zi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(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=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return we(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(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 he(this,"shape",n),n},checks:e._zod.def.checks};return we(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return we(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return we(e,me(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 he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(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 he(this,"shape",i),i},checks:[]});return we(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return we(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return we(t,i)}(Xi,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new Ui(n)}const Mi=R("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Hi=R("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Gi=R("ZodEnum",((e,t)=>{an.init(e,t),ii.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 Gi({...t,checks:[],...Ee(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 Gi({...t,checks:[],...Ee(i),entries:o})}}));const Bi=R("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new C(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push($e(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($e(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Bi({type:"transform",transform:e})}const Yi=R("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function qi(e){return new Yi({type:"optional",innerType:e})}const Wi=R("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Wi({type:"nullable",innerType:e})}const Ji=R("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=R("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=R("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=R("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=R("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=R("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=R("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function so(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 ao=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((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),uo=e=>si().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>ao(Ii("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Fi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>si().max(e,`Maximum length is ${e} characters`),mo=Li({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Li({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=Li({balance:po(),expiry:fo(),message:ho(500).nullish(),notes:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),cardHolder:uo(101),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),yo=go.extend({companyId:Ii().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}($i,e)}().default(!0),payment:Li({cardHolder:uo(30),cardNumberToken:uo(50),cardExpiry:uo(5),cardCvcToken:uo(50)}).optional()}),Po=Li({code:uo(10),password:uo(10)}),zo=Po.extend({amount:po(),description:uo(200)});let bo;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(bo||(bo={}));const ko=Li({grant_type:si().readonly().default("refresh_token"),client_id:In(li,undefined),client_secret:si(),refresh_token:si(),scope:si().optional()});const wo=Li({email:ui(),firstName:si().max(100).optional(),lastName:si().max(100).optional(),phone:si().max(20).optional(),scopes:ji(si()).optional()});let Eo;!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"}(Eo||(Eo={}));const To=[Eo.PER_NIGHT,Eo.PER_PERSON_PER_NIGHT,Eo.PER_QUANTITY_NAME_PER_NIGHT,Eo.PER_ROOM_QUANTITY_PER_NIGHT,Eo.PER_PERSON_OCCUPANCY_PER_NIGHT,Eo.PER_ADULT_OCCUPANCY_PER_NIGHT,Eo.PER_CHILD_OCCUPANCY_PER_NIGHT,Eo.PER_ALL_PERSONS_PER_NIGHT];let No,Ao,Io;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(No||(No={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Ao||(Ao={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(Io||(Io={}));const Oo=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 Ro=i(60),$o=i.n(Ro);const Co={UP:$o().ROUND_UP,DOWN:$o().ROUND_DOWN,CEIL:$o().ROUND_CEIL,FLOOR:$o().ROUND_FLOOR,HALF_UP:$o().ROUND_HALF_UP,HALF_DOWN:$o().ROUND_HALF_DOWN,HALF_EVEN:$o().ROUND_HALF_EVEN,HALF_CEIL:$o().ROUND_HALF_CEIL,HALF_FLOOR:$o().ROUND_HALF_FLOOR},So=(e,t)=>{const{precision:n=2,rounding:i=Co.HALF_UP}=t||{};return new($o())(e).toDecimalPlaces(n,i).toNumber()};function xo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=So(n);switch(e.feeType){case O.PercentageOfBooking:if(o)return So(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return So(a/(1-t)*e.amount/(100+e.amount))}return So(a*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return So(e.amount*i);default:return 0}}const Zo=[O.FixedChargePerBooking],Fo=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],Do=[O.PercentageOfBooking];function jo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Uo(e){return jo(e,Zo)}function Lo(e){return jo(e,Fo)}function Mo(e){return jo(e,Do)}function Ho(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const Go=e=>e,Bo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Vo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Yo{}function qo(e){return e.toUpperCase()}Yo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===Eo.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===Eo.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 To.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Yo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Yo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),To.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Yo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Yo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Yo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Yo.calculateReservationAddonTotal(o,t)?.total}})),So(n)}})(),o})()));
|
|
1
|
+
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>$,AddGiftCardSchema:()=>vo,BaseGiftCardSchema:()=>go,DATE_FORMAT:()=>I,EAddonPricingType:()=>A,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>N,EGuaranteePolicyDepositMode:()=>b,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>w,ERoomstayImageSize:()=>z,GuestProfile:()=>d,HttpMethod:()=>k,IAuxiliaryFilterType:()=>g,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>E,PurchaseGiftCardSchema:()=>_o,RefreshGiftCardTokenSchema:()=>yo,RegisterGiftCardAdminSchema:()=>Po,Reservation:()=>u,ReservedPackage:()=>T,TotalCalculator:()=>Fo,calculateFeeAmount:()=>Eo,calculateTotalForMemberBooking:()=>zo,getFeeOptionValidity:()=>xo,getFilteredBookingAddonFees:()=>Ro,getFilteredBookingFees:()=>$o,getFilteredBookingRateFees:()=>Oo,maxString:()=>ho,nameof:()=>Zo,preprocessDate:()=>co,preprocessNumber:()=>ao,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>Co,roundMoney:()=>ko,subset:()=>So,uppercaseString:()=>Do,validateFormWithZod:()=>so}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,w,k;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={}));class E{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 T extends E{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.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(b||(b={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(k||(k={}));const I="DD/MM/YYYY";let N,A;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(N||(N={})),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"}(A||(A={}));const $=[A.PER_NIGHT,A.PER_PERSON_PER_NIGHT,A.PER_QUANTITY_NAME_PER_NIGHT,A.PER_ROOM_QUANTITY_PER_NIGHT,A.PER_PERSON_OCCUPANCY_PER_NIGHT,A.PER_ADULT_OCCUPANCY_PER_NIGHT,A.PER_CHILD_OCCUPANCY_PER_NIGHT,A.PER_ALL_PERSONS_PER_NIGHT];function O(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class R extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Z={};function S(e){return e&&Object.assign(Z,e),Z}const C=/^[cC][^\s-]{8,}$/,F=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,M=/^[a-zA-Z0-9_-]{21}$/,B=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,G=/^([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})$/,L=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)$/,H=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{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])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(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 ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,se=/^[^A-Z]*$/,ae=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(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 Te={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 Ie(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 Ne(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ae(e){return"string"==typeof e?e:e?.message}function $e(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Oe(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Re(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const xe=O("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ze={number:"number",bigint:"bigint",object:"date"},Se=O("$ZodCheckLessThan",((e,t)=>{xe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ce=O("$ZodCheckGreaterThan",((e,t)=>{xe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=O("$ZodCheckMultipleOf",((e,t)=>{xe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),De=O("$ZodCheckNumberFormat",((e,t)=>{xe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[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=ie)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),je=O("$ZodCheckMaxLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Oe(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ue=O("$ZodCheckMinLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Oe(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Me=O("$ZodCheckLengthEquals",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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=Oe(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Be=O("$ZodCheckStringFormat",((e,t)=>{var n,i;xe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Ge=O("$ZodCheckRegex",((e,t)=>{Be.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),Le=O("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=se),Be.init(e,t)})),He=O("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ae),Be.init(e,t)})),Ve=O("$ZodCheckIncludes",((e,t)=>{xe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),Ye=O("$ZodCheckStartsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),qe=O("$ZodCheckEndsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),Qe=O("$ZodCheckOverwrite",((e,t)=>{xe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class We{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 Je=(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,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=O("$ZodError",Je),Xe=O("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new R;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,S()))));throw ve(t,o?.callee),t}return s.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,S()))));throw ve(t,o?.callee),t}return s.value},nt=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 R;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>$e(e,o,S()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=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=>$e(e,o,S()))))}:{success:!0,data:r.value}},rt=ot(Xe),st=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},at=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=O("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;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=Ie(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new R;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ie(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ie(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ie(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new R;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new R;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=O("$ZodString",((e,t)=>{var n;mt.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}})),vt=O("$ZodStringFormat",((e,t)=>{Be.init(e,t),gt.init(e,t)})),_t=O("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=G),vt.init(e,t)})),yt=O("$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=L(e))}else t.pattern??(t.pattern=L());vt.init(e,t)})),Pt=O("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=H),vt.init(e,t)})),zt=O("$ZodURL",((e,t)=>{vt.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:K.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})}}})),bt=O("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),wt=O("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),kt=O("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=C),vt.init(e,t)})),Et=O("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Tt=O("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),It=O("$ZodXID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),Nt=O("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),At=O("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({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(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),$t=O("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Ot=O("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),Rt=O("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=B),vt.init(e,t)})),xt=O("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Zt=O("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),vt.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})}}})),St=O("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=q),vt.init(e,t)})),Ct=O("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Q),vt.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 Ft(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=O("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=W),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ft(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),jt=O("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ft(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})}})),Ut=O("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Mt=O("$ZodJWT",((e,t)=>{vt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Bt=O("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,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}})),Gt=O("$ZodNumber",((e,t)=>{De.init(e,t),Bt.init(e,t)})),Lt=O("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,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}})),Ht=O("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=O("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=O("$ZodDate",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function qt(e,t,n){e.issues.length&&t.issues.push(...Ne(n,e.issues)),t.value[n]=e.value}const Qt=O("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>qt(t,n,e)))):qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Wt(e,t,n,i){e.issues.length&&t.issues.push(...Ne(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(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 Kt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Wt(e,n,o,t)))):Wt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=O("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(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=_e,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Wt(n,t,e,a)))):Wt(n,t,e,a)}return o?Kt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=O("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,s=!Z.jitless,a=s&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new We(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(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=>!Ie(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=>$e(e,i,S())))))}),t)}const nn=O("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(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=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>tn(t,o,e,r))):tn(a,o,e,r)}})),on=O("$ZodIntersection",((e,t)=>{mt.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])=>sn(e,t,n))):sn(e,o,r)}}));function rn(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(Pe(e)&&Pe(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=rn(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=rn(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 sn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ie(e))return e;const i=rn(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 an=O("$ZodEnum",((e,t)=>{mt.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=>be.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),cn=O("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new R;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=O("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(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=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=O("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(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)})),pn=O("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=O("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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))})),mn=O("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(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=>gn(t,e))):gn(o,e)}}));function gn(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 vn=O("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(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=>$e(e,n,S())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>$e(e,n,S())))},input:e.value}),e.issues=[]),e)}})),_n=O("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(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=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=O("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(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(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=O("$ZodCustom",((e,t)=>{xe.init(e,t),mt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Re(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class kn{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 En(){return new kn}const Tn=En();function In(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function Nn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function An(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function $n(e,t){return new Se({check:"less_than",...Ee(t),value:e,inclusive:!1})}function On(e,t){return new Se({check:"less_than",...Ee(t),value:e,inclusive:!0})}function Rn(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function xn(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function Zn(e,t){return new Fe({check:"multiple_of",...Ee(t),value:e})}function Sn(e,t){return new je({check:"max_length",...Ee(t),maximum:e})}function Cn(e,t){return new Ue({check:"min_length",...Ee(t),minimum:e})}function Fn(e,t){return new Me({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new Qe({check:"overwrite",tx:e})}const jn=O("ZodISODateTime",((e,t)=>{At.init(e,t),ai.init(e,t)}));const Un=O("ZodISODate",((e,t)=>{$t.init(e,t),ai.init(e,t)}));const Mn=O("ZodISOTime",((e,t)=>{Ot.init(e,t),ai.init(e,t)}));const Bn=O("ZodISODuration",((e,t)=>{Rt.init(e,t),ai.init(e,t)}));const Gn=(e,t)=>{Ke.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,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Ln=(O("ZodError",Gn),O("ZodError",Gn,{Parent:Error})),Hn=et(Ln),Vn=tt(Ln),Yn=nt(Ln),qn=ot(Ln),Qn=st(Ln),Wn=at(Ln),Jn=ct(Ln),Kn=ut(Ln),Xn=dt(Ln),ei=lt(Ln),ti=pt(Ln),ni=ft(Ln),ii=O("ZodType",((e,t)=>(mt.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)=>ke(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Hn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qn(e,t,n),e.decode=(t,n)=>Wn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(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,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new xe({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Re(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(Re(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>qi(e),e.nullable=()=>Wi(e),e.nullish=()=>qi(Wi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>ji(e),e.or=t=>function(e,t){return new Bi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Gi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=O("_ZodString",((e,t)=>{gt.init(e,t),ii.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 Ge({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Cn(...t)),e.max=(...t)=>e.check(Sn(...t)),e.length=(...t)=>e.check(Fn(...t)),e.nonempty=(...t)=>e.check(Cn(1,...t)),e.lowercase=t=>e.check(function(e){return new Le({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new He({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=O("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(In(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ii,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(Nn(di,t)),e.uuid=t=>e.check(An(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(Nn(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,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,...Ee(t)})}(jn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(Un,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,...Ee(t)})}(Mn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Bn,e)}(t))}));function si(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const ai=O("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=O("ZodEmail",((e,t)=>{Pt.init(e,t),ai.init(e,t)}));function ui(e){return In(ci,e)}const di=O("ZodGUID",((e,t)=>{_t.init(e,t),ai.init(e,t)})),li=O("ZodUUID",((e,t)=>{yt.init(e,t),ai.init(e,t)})),pi=O("ZodURL",((e,t)=>{zt.init(e,t),ai.init(e,t)})),fi=O("ZodEmoji",((e,t)=>{bt.init(e,t),ai.init(e,t)})),hi=O("ZodNanoID",((e,t)=>{wt.init(e,t),ai.init(e,t)})),mi=O("ZodCUID",((e,t)=>{kt.init(e,t),ai.init(e,t)})),gi=O("ZodCUID2",((e,t)=>{Et.init(e,t),ai.init(e,t)})),vi=O("ZodULID",((e,t)=>{Tt.init(e,t),ai.init(e,t)})),_i=O("ZodXID",((e,t)=>{It.init(e,t),ai.init(e,t)})),yi=O("ZodKSUID",((e,t)=>{Nt.init(e,t),ai.init(e,t)})),Pi=O("ZodIPv4",((e,t)=>{xt.init(e,t),ai.init(e,t)})),zi=O("ZodIPv6",((e,t)=>{Zt.init(e,t),ai.init(e,t)})),bi=O("ZodCIDRv4",((e,t)=>{St.init(e,t),ai.init(e,t)})),wi=O("ZodCIDRv6",((e,t)=>{Ct.init(e,t),ai.init(e,t)})),ki=O("ZodBase64",((e,t)=>{Dt.init(e,t),ai.init(e,t)})),Ei=O("ZodBase64URL",((e,t)=>{jt.init(e,t),ai.init(e,t)})),Ti=O("ZodE164",((e,t)=>{Ut.init(e,t),ai.init(e,t)})),Ii=O("ZodJWT",((e,t)=>{Mt.init(e,t),ai.init(e,t)})),Ni=O("ZodNumber",((e,t)=>{Bt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check(Rn(t,n)),e.gte=(t,n)=>e.check(xn(t,n)),e.min=(t,n)=>e.check(xn(t,n)),e.lt=(t,n)=>e.check($n(t,n)),e.lte=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check(On(t,n)),e.int=t=>e.check(Oi(t)),e.safe=t=>e.check(Oi(t)),e.positive=t=>e.check(Rn(0,t)),e.nonnegative=t=>e.check(xn(0,t)),e.negative=t=>e.check($n(0,t)),e.nonpositive=t=>e.check(On(0,t)),e.multipleOf=(t,n)=>e.check(Zn(t,n)),e.step=(t,n)=>e.check(Zn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ai(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ni,e)}const $i=O("ZodNumberFormat",((e,t)=>{Gt.init(e,t),Ni.init(e,t)}));function Oi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}($i,e)}const Ri=O("ZodBoolean",((e,t)=>{Lt.init(e,t),ii.init(e,t)}));const xi=O("ZodUnknown",((e,t)=>{Ht.init(e,t),ii.init(e,t)}));function Zi(){return new xi({type:"unknown"})}const Si=O("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"never",...Ee(t)})}(Si,e)}const Fi=O("ZodDate",((e,t)=>{Yt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(xn(t,n)),e.max=(t,n)=>e.check(On(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 Di=O("ZodArray",((e,t)=>{Qt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Cn(t,n)),e.nonempty=t=>e.check(Cn(1,t)),e.max=(t,n)=>e.check(Sn(t,n)),e.length=(t,n)=>e.check(Fn(t,n)),e.unwrap=()=>e.element}));function ji(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const Ui=O("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Li({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(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=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return ke(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(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 he(this,"shape",n),n},checks:e._zod.def.checks};return ke(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ke(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return ke(e,me(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 he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(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 he(this,"shape",i),i},checks:[]});return ke(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return ke(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(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 he(this,"shape",o),o},checks:[]});return ke(t,i)}(Xi,e,t[0])}));function Mi(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new Ui(n)}const Bi=O("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Gi=O("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Li=O("ZodEnum",((e,t)=>{an.init(e,t),ii.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 Li({...t,checks:[],...Ee(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 Li({...t,checks:[],...Ee(i),entries:o})}}));const Hi=O("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Re(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(Re(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Hi({type:"transform",transform:e})}const Yi=O("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function qi(e){return new Yi({type:"optional",innerType:e})}const Qi=O("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Wi(e){return new Qi({type:"nullable",innerType:e})}const Ji=O("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=O("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=O("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=O("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=O("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=O("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=O("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function so(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 ao=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setHours(0,0,0,0),t):e}),e),uo=e=>si().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>ao(Ai("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Fi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>si().max(e,`Maximum length is ${e} characters`),mo=Mi({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Mi({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=go.extend({companyId:Ai().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}(Ri,e)}().default(!0),payment:Mi({cardHolder:uo(30),cardNumberToken:uo(50),cardExpiry:uo(5),cardCvcToken:uo(50)}).optional()}),yo=Mi({grant_type:si().readonly().default("refresh_token"),client_id:An(li,undefined),client_secret:si(),refresh_token:si(),scope:si().optional()});const Po=Mi({email:ui(),firstName:si().max(100).optional(),lastName:si().max(100).optional(),phone:si().max(20).optional(),scopes:ji(si()).optional()}),zo=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 bo=i(60),wo=i.n(bo);const ko=e=>new(wo())(e).toDecimalPlaces(2).toNumber();function Eo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=ko(n);switch(e.feeType){case N.PercentageOfBooking:if(o)return ko(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return ko(a/(1-t)*e.amount/(100+e.amount))}return ko(a*(e.amount/100));case N.FixedChargePerRoom:case N.FixedChargePerBooking:return e.amount;case N.NightlyChargePerRoom:return ko(e.amount*i);default:return 0}}const To=[N.FixedChargePerBooking],Io=[N.PercentageOfBooking,N.FixedChargePerRoom,N.NightlyChargePerRoom],No=[N.PercentageOfBooking];function Ao(e,t){return e.filter((e=>t.includes(e.feeType)))}function $o(e){return Ao(e,To)}function Oo(e){return Ao(e,Io)}function Ro(e){return Ao(e,No)}function xo(e){return{includeInRates:[N.PercentageOfBooking,N.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===N.PercentageOfBooking,appliesToAddons:e===N.PercentageOfBooking,includePreviousFeesInCalculation:e===N.PercentageOfBooking}}const Zo=e=>e,So=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Co=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Fo{}function Do(e){return e.toUpperCase()}Fo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===A.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===A.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 $.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Fo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Fo.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))),$.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})),Fo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Fo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Fo.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+=Fo.calculateReservationAddonTotal(o,t)?.total}})),ko(n)}})(),o})()));
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Log severity levels.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ELogSeverity {
|
|
5
|
-
Critical = "Critical",
|
|
6
|
-
Error = "Error",
|
|
7
|
-
Warn = "Warn",
|
|
8
|
-
Info = "Info"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Log category types.
|
|
12
|
-
*/
|
|
13
|
-
export declare enum ELogCategory {
|
|
14
|
-
Debug = "Diagnostics",
|
|
15
|
-
Security = "Security",
|
|
16
|
-
Audit = "Audit"
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Log event types.
|
|
20
|
-
*/
|
|
21
|
-
export declare enum ELogType {
|
|
22
|
-
General = "General",
|
|
23
|
-
Authenticated = "Token Authenticated",
|
|
24
|
-
Unauthorized = "Unauthorized Access",
|
|
25
|
-
RefreshToken = "Refresh Token Created",
|
|
26
|
-
AccessToken = "Access Token Created",
|
|
27
|
-
Revoked = "Token Revoked",
|
|
28
|
-
UserCreated = "User Created",
|
|
29
|
-
UserLinked = "User Linked to Company",
|
|
30
|
-
Purchase = "Gift Card Purchased",
|
|
31
|
-
Payment = "Payment Captured",
|
|
32
|
-
Email = "Email Delivery",
|
|
33
|
-
Transaction = "Gift Card Transaction"
|
|
34
|
-
}
|