@roomstay/core 0.1.53-11 → 0.1.53-3
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/Booking/IBookingPayment.type.d.ts +27 -31
- package/dist/types/Booking/Itinerary.types.d.ts +11 -2
- package/dist/types/Company/ECompanyProvider.enum.d.ts +1 -2
- package/dist/types/Company/IAdminCompany.type.d.ts +0 -2
- package/dist/types/Hotel/EIntegration.enum.d.ts +1 -2
- package/dist/types/index.d.ts +1 -15
- package/dist/utils/index.d.ts +9 -10
- package/dist/web.js +1 -1
- package/package.json +2 -8
- package/dist/node.js.LICENSE.txt +0 -7
- package/dist/types/Analytics/IBigQueryResponse.type.d.ts +0 -24
- package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +0 -11
- package/dist/types/Booking/IBookingStatus.type.d.ts +0 -5
- package/dist/types/Booking/IPrice.type.d.ts +0 -7
- package/dist/types/Fees/IFeeOptions.type.d.ts +0 -6
- package/dist/types/General/Format.types.d.ts +0 -1
- package/dist/types/General/Pagination.types.d.ts +0 -19
- package/dist/types/General/Warning.type.d.ts +0 -14
- package/dist/types/GiftCards/GiftCard.types.d.ts +0 -32
- package/dist/types/GiftCards/GiftCardAuth.types.d.ts +0 -31
- package/dist/types/OHIP/IOHIPConfiguration.types.d.ts +0 -9
- package/dist/types/OHIP/index.d.ts +0 -1
- package/dist/utils/feeOptionRules.d.ts +0 -0
- package/dist/utils/zodUtils.d.ts +0 -19
- package/dist/web.js.LICENSE.txt +0 -7
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;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>A,AddGiftCardSchema:()=>Li,AddonPricingType:()=>R,DATE_FORMAT:()=>T,EAddonPricingType:()=>n,EBookingFlow:()=>u,EBookingPaymentMethod:()=>i,EBookingStatus:()=>a,ECompanyProvider:()=>c,EDistanceUnitType:()=>m,EFeeType:()=>I,EGuarantyPolicyPrepaymentType:()=>y,EHotelCardProcessor:()=>o,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>p,EIntegration:()=>h,EPlanpayBookingStatus:()=>r,ERMSDiscountType:()=>v,ERoomstayEventSource:()=>P,ERoomstayImageSize:()=>_,GuestProfile:()=>w,HttpMethod:()=>z,IAuxiliaryFilterType:()=>f,IMaintenanceStatusService:()=>g,ItineraryResponse:()=>b,PCIBookingCardProcessorTypes:()=>s,Package:()=>E,RefreshGiftCardTokenSchema:()=>Hi,RegisterGiftCardAdminSchema:()=>Mi,Reservation:()=>k,ReservedPackage:()=>N,RoundingType:()=>Vi,TotalCalculator:()=>ao,calculateFeeAmount:()=>Wi,calculateTotalForMemberBooking:()=>Gi,getFeeOptionValidity:()=>io,getFilteredBookingAddonFees:()=>no,getFilteredBookingFees:()=>eo,getFilteredBookingRateFees:()=>to,maxString:()=>ji,nameof:()=>oo,preprocessDate:()=>xi,preprocessNumber:()=>Zi,requireEmail:()=>Fi,requireFutureDate:()=>Ui,requirePositiveAmount:()=>Di,requireString:()=>Si,resizeRoomstayImageUrl:()=>so,roundMoney:()=>Qi,subset:()=>ro,uppercaseString:()=>uo,validateFormWithZod:()=>Ci}),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"}(n||(n={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(i||(i={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(o||(o={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(r||(r={}));const s=[];let a,u,c,d,l,p,h,f,m,v,_,g,y,P,z;!function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(a||(a={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(u||(u={}));class b{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 k{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 w,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 w{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}}!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(c||(c={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(l||(l={})),function(e){e.Monday="monday",e.Sunday="sunday"}(p||(p={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(h||(h={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(f||(f={})),function(e){e.Metric="metric",e.Imperial="imperial"}(m||(m={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(v||(v={})),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"}(_||(_={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(g||(g={}));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 N 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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(y||(y={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(P||(P={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(z||(z={}));const T="DD/MM/YYYY";let I,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(I||(I={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(R||(R={}));const A=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function 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 $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const C={};function Z(e){return e&&Object.assign(C,e),C}const x=/^[cC][^\s-]{8,}$/,S=/^[0-9a-z]+$/,F=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,D=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,j=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,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})$/,M=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)$/,G=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,B=/^(?:(?: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})$/,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])\/([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}=))?$/,q=/^[A-Za-z0-9_-]*$/,J=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,K=/^\+(?:[0-9]){6,14}[0-9]$/,X="(?:(?:\\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])))",ee=new RegExp(`^${X}$`);function te(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 ne=/^\d+$/,ie=/^-?\d+(?:\.\d+)?/i,oe=/^[^A-Z]*$/,re=/^[^a-z]*$/;function se(e,t){return"bigint"==typeof t?t.toString():t}function ae(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ue(e){return null==e}function ce(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function de(e,t,n){Object.defineProperty(e,t,{get(){{const i=n();return e[t]=i,i}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function le(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function pe(e){return JSON.stringify(e)}const he=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function fe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const me=ae((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ve(e){if(!1===fe(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==fe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const _e=new Set(["string","number","symbol"]);function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Pe(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 ze={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 be(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function ke(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function we(e){return"string"==typeof e?e:e?.message}function Ee(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=we(e.inst?._zod.def?.error?.(e))??we(t?.error?.(e))??we(n.customError?.(e))??we(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ne(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Te(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ie=O("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Re={number:"number",bigint:"bigint",object:"date"},Ae=O("$ZodCheckLessThan",((e,t)=>{Ie.init(e,t);const n=Re[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})}})),Oe=O("$ZodCheckGreaterThan",((e,t)=>{Ie.init(e,t);const n=Re[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})}})),$e=O("$ZodCheckMultipleOf",((e,t)=>{Ie.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().split(".")[1]||"").length,o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(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})}})),Ce=O("$ZodCheckNumberFormat",((e,t)=>{Ie.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=ze[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=ne)})),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",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})}})),Ze=O("$ZodCheckMaxLength",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),xe=O("$ZodCheckMinLength",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Se=O("$ZodCheckLengthEquals",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(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})}})),Fe=O("$ZodCheckStringFormat",((e,t)=>{var n,i;Ie.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=()=>{})})),De=O("$ZodCheckRegex",((e,t)=>{Fe.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})}})),Ue=O("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=oe),Fe.init(e,t)})),je=O("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=re),Fe.init(e,t)})),Le=O("$ZodCheckIncludes",((e,t)=>{Ie.init(e,t);const n=ge(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})}})),He=O("$ZodCheckStartsWith",((e,t)=>{Ie.init(e,t);const n=new RegExp(`^${ge(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})}})),Me=O("$ZodCheckEndsWith",((e,t)=>{Ie.init(e,t);const n=new RegExp(`.*${ge(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})}})),Ge=O("$ZodCheckOverwrite",((e,t)=>{Ie.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Be{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 Ye=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,se,2),enumerable:!0})},Ve=O("$ZodError",Ye),Qe=O("$ZodError",Ye,{Parent:Error}),We=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=>Ee(e,r,Z()))));throw he(t,o?.callee),t}return s.value},qe=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=>Ee(e,r,Z()))));throw he(t,o?.callee),t}return s.value},Je=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??Ve)(r.issues.map((e=>Ee(e,o,Z()))))}:{success:!0,data:r.value}},Ke=Je(Qe),Xe=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=>Ee(e,o,Z()))))}:{success:!0,data:r.value}},et=Xe(Qe),tt={major:4,minor:0,patch:0},nt=O("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=be(e);for(const r of t){if(r._zod.when){if(!r._zod.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=be(e,t)))}));else{if(e.issues.length===t)continue;o||(o=be(e,t))}}return i?i.then((()=>e)):e};e._zod.run=(n,o)=>{const r=e._zod.parse(n,o);if(r instanceof Promise){if(!1===o.async)throw new $;return r.then((e=>t(e,i,o)))}return t(r,i,o)}}e["~standard"]={validate:t=>{try{const n=Ke(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return et(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),it=O("$ZodString",((e,t)=>{var n;nt.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}})),ot=O("$ZodStringFormat",((e,t)=>{Fe.init(e,t),it.init(e,t)})),rt=O("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),ot.init(e,t)})),st=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=M(e))}else t.pattern??(t.pattern=M());ot.init(e,t)})),at=O("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=G),ot.init(e,t)})),ut=O("$ZodURL",((e,t)=>{ot.init(e,t),e._zod.check=n=>{try{const i=n.value,o=new URL(i),r=o.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:J.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(!i.endsWith("/")&&r.endsWith("/")?n.value=r.slice(0,-1):n.value=r)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),ct=O("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ot.init(e,t)})),dt=O("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=j),ot.init(e,t)})),lt=O("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=x),ot.init(e,t)})),pt=O("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=S),ot.init(e,t)})),ht=O("$ZodULID",((e,t)=>{t.pattern??(t.pattern=F),ot.init(e,t)})),ft=O("$ZodXID",((e,t)=>{t.pattern??(t.pattern=D),ot.init(e,t)})),mt=O("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),ot.init(e,t)})),vt=O("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=te({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${X}T(?:${i})$`)}(t)),ot.init(e,t)})),_t=O("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ee),ot.init(e,t)})),gt=O("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${te(t)}$`)),ot.init(e,t)})),yt=O("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),ot.init(e,t)})),Pt=O("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=B),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),zt=O("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),ot.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})}}})),bt=O("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=V),ot.init(e,t)})),kt=O("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Q),ot.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function wt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Et=O("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=W),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{wt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Nt=O("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=q),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!q.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return wt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Tt=O("$ZodE164",((e,t)=>{t.pattern??(t.pattern=K),ot.init(e,t)})),It=O("$ZodJWT",((e,t)=>{ot.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})}})),Rt=O("$ZodNumber",((e,t)=>{nt.init(e,t),e._zod.pattern=e._zod.bag.pattern??ie,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}})),At=O("$ZodNumber",((e,t)=>{Ce.init(e,t),Rt.init(e,t)})),Ot=O("$ZodUnknown",((e,t)=>{nt.init(e,t),e._zod.parse=e=>e})),$t=O("$ZodNever",((e,t)=>{nt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Ct=O("$ZodDate",((e,t)=>{nt.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 Zt(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}const xt=O("$ZodArray",((e,t)=>{nt.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=>Zt(t,n,e)))):Zt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function St(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function Ft(e,t,n,i){e.issues.length?void 0===i[n]?t.value[n]=n in i?void 0:e.value:t.issues.push(...ke(n,e.issues)):void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}const Dt=O("$ZodObject",((e,t)=>{nt.init(e,t);const n=ae((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof nt))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=t.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));let i;de(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 o=fe,r=!C.jitless,s=r&&me.value,a=t.catchall;let u;e._zod.parse=(c,d)=>{u??(u=n.value);const l=c.value;if(!o(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;const p=[];if(r&&s&&!1===d?.async&&!0!==d.jitless)i||(i=(e=>{const t=new Be(["shape","payload","ctx"]),i=n.value,o=e=>{const t=pe(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 i.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of i.keys)if(i.optionalKeys.has(e)){const n=r[e];t.write(`const ${n} = ${o(e)};`);const i=pe(e);t.write(`\n if (${n}.issues.length) {\n if (input[${i}] === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${i} in input) newResult[${i}] = undefined;\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}else{const n=r[e];t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${pe(e)}, ...iss.path] : [${pe(e)}]\n })));`),t.write(`newResult[${pe(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),c=i(c,d);else{c.value={};const e=u.shape;for(const t of u.keys){const n=e[t],i=n._zod.run({value:l[t],issues:[]},d),o="optional"===n._zod.optin&&"optional"===n._zod.optout;i instanceof Promise?p.push(i.then((e=>o?Ft(e,c,t,l):St(e,c,t)))):o?Ft(i,c,t,l):St(i,c,t)}}if(!a)return p.length?Promise.all(p).then((()=>c)):c;const h=[],f=u.keySet,m=a._zod,v=m.def.type;for(const e of Object.keys(l)){if(f.has(e))continue;if("never"===v){h.push(e);continue}const t=m.run({value:l[e],issues:[]},d);t instanceof Promise?p.push(t.then((t=>St(t,c,e)))):St(t,c,e)}return h.length&&c.issues.push({code:"unrecognized_keys",keys:h,input:l,inst:e}),p.length?Promise.all(p).then((()=>c)):c}}));function Ut(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Ee(e,i,Z())))))}),t}const jt=O("$ZodUnion",((e,t)=>{nt.init(e,t),de(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),de(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),de(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),de(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=>ce(e.source))).join("|")})$`)}})),e._zod.parse=(n,i)=>{let o=!1;const r=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)r.push(t),o=!0;else{if(0===t.issues.length)return t;r.push(t)}}return o?Promise.all(r).then((t=>Ut(t,n,e,i))):Ut(r,n,e,i)}})),Lt=O("$ZodIntersection",((e,t)=>{nt.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])=>Mt(e,t,n))):Mt(e,o,r)}}));function Ht(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(ve(e)&&ve(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=Ht(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=Ht(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 Mt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),be(e))return e;const i=Ht(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 Gt=O("$ZodEnum",((e,t)=>{nt.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);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>_e.has(typeof e))).map((e=>"string"==typeof e?ge(e):e.toString())).join("|")})$`),e._zod.parse=(t,i)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}})),Bt=O("$ZodTransform",((e,t)=>{nt.init(e,t),e._zod.parse=(e,n)=>{const i=t.transform(e.value,e);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then((t=>(e.value=t,e)));if(i instanceof Promise)throw new $;return e.value=i,e}})),Yt=O("$ZodOptional",((e,t)=>{nt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),de(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)})),Vt=O("$ZodNullable",((e,t)=>{nt.init(e,t),de(e._zod,"optin",(()=>t.innerType._zod.optin)),de(e._zod,"optout",(()=>t.innerType._zod.optout)),de(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)}|null)$`):void 0})),de(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)})),Qt=O("$ZodDefault",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(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=>Wt(e,t))):Wt(i,t)}}));function Wt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const qt=O("$ZodPrefault",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Jt=O("$ZodNonOptional",((e,t)=>{nt.init(e,t),de(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=>Kt(t,e))):Kt(o,e)}}));function Kt(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 Xt=O("$ZodCatch",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"optout",(()=>t.innerType._zod.optout)),de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(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=>Ee(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Ee(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),en=O("$ZodPipe",((e,t)=>{nt.init(e,t),de(e._zod,"values",(()=>t.in._zod.values)),de(e._zod,"optin",(()=>t.in._zod.optin)),de(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>tn(e,t,n))):tn(i,t,n)}}));function tn(e,t,n){return be(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const nn=O("$ZodReadonly",((e,t)=>{nt.init(e,t),de(e._zod,"propValues",(()=>t.innerType._zod.propValues)),de(e._zod,"values",(()=>t.innerType._zod.values)),de(e._zod,"optin",(()=>t.innerType._zod.optin)),de(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(on):on(i)}}));function on(e){return e.value=Object.freeze(e.value),e}const rn=O("$ZodCustom",((e,t)=>{Ie.init(e,t),nt.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=>sn(t,n,i,e)));sn(o,n,i,e)}}));function sn(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(Te(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class an{constructor(){this._map=new WeakMap,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}remove(e){return this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function un(){return new an}const cn=un();function dn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Pe(t)})}function ln(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Pe(t)})}function pn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Pe(t)})}function hn(e,t){return new Ae({check:"less_than",...Pe(t),value:e,inclusive:!1})}function fn(e,t){return new Ae({check:"less_than",...Pe(t),value:e,inclusive:!0})}function mn(e,t){return new Oe({check:"greater_than",...Pe(t),value:e,inclusive:!1})}function vn(e,t){return new Oe({check:"greater_than",...Pe(t),value:e,inclusive:!0})}function _n(e,t){return new $e({check:"multiple_of",...Pe(t),value:e})}function gn(e,t){return new Ze({check:"max_length",...Pe(t),maximum:e})}function yn(e,t){return new xe({check:"min_length",...Pe(t),minimum:e})}function Pn(e,t){return new Se({check:"length_equals",...Pe(t),length:e})}function zn(e){return new Ge({check:"overwrite",tx:e})}const bn=O("ZodISODateTime",((e,t)=>{vt.init(e,t),Sn.init(e,t)}));const kn=O("ZodISODate",((e,t)=>{_t.init(e,t),Sn.init(e,t)}));const wn=O("ZodISOTime",((e,t)=>{gt.init(e,t),Sn.init(e,t)}));const En=O("ZodISODuration",((e,t)=>{yt.init(e,t),Sn.init(e,t)}));const Nn=(e,t)=>{Ve.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)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},Tn=(O("ZodError",Nn),O("ZodError",Nn,{Parent:Error})),In=We(Tn),Rn=qe(Tn),An=Je(Tn),On=Xe(Tn),$n=O("ZodType",((e,t)=>(nt.init(e,t),e.def=t,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)=>ye(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>In(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>An(e,t,n),e.parseAsync=async(t,n)=>Rn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>On(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Pe(n)})}(Oi,e,t)}(t,n)),e.superRefine=t=>e.check(function(e,t){const n=function(e,t){const n=new Ie({check:"custom",...Pe(undefined)});return n._zod.check=e,n}((t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(Te(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(Te(i))}},e(t.value,t))));return n}(t)),e.overwrite=t=>e.check(zn(t)),e.optional=()=>zi(e),e.nullable=()=>ki(e),e.nullish=()=>zi(ki(e)),e.nonoptional=t=>function(e,t){return new Ni({type:"nonoptional",innerType:e,...Pe(t)})}(e,t),e.array=()=>pi(e),e.or=t=>function(e,t){return new mi({type:"union",options:e,...Pe(t)})}([e,t]),e.and=t=>new vi({type:"intersection",left:e,right:t}),e.transform=t=>Ri(e,yi(t)),e.default=t=>{return n=t,new wi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Ei({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new Ti({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Ri(e,t),e.readonly=()=>new Ai({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return cn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>cn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return cn.get(e);const n=e.clone();return cn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Cn=O("_ZodString",((e,t)=>{it.init(e,t),$n.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 De({check:"string_format",format:"regex",...Pe(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Le({check:"string_format",format:"includes",...Pe(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"starts_with",...Pe(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"ends_with",...Pe(t),suffix:e})}(...t)),e.min=(...t)=>e.check(yn(...t)),e.max=(...t)=>e.check(gn(...t)),e.length=(...t)=>e.check(Pn(...t)),e.nonempty=(...t)=>e.check(yn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ue({check:"string_format",format:"lowercase",...Pe(e)})}(t)),e.uppercase=t=>e.check(function(e){return new je({check:"string_format",format:"uppercase",...Pe(e)})}(t)),e.trim=()=>e.check(zn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return zn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(zn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(zn((e=>e.toUpperCase())))})),Zn=O("ZodString",((e,t)=>{it.init(e,t),Cn.init(e,t),e.email=t=>e.check(dn(Fn,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Pe(t)})}(Ln,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Pe(t)})}(ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Pe(t)})}(Hn,t)),e.guid=t=>e.check(ln(Un,t)),e.uuid=t=>e.check(pn(jn,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pe(t)})}(jn,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pe(t)})}(jn,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pe(t)})}(jn,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pe(t)})}(Mn,t)),e.guid=t=>e.check(ln(Un,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Pe(t)})}(Gn,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pe(t)})}(Bn,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Pe(t)})}(Yn,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Pe(t)})}(Xn,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Pe(t)})}(ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Pe(t)})}(Vn,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pe(t)})}(Qn,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pe(t)})}(Wn,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pe(t)})}(qn,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pe(t)})}(Jn,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pe(t)})}(Kn,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Pe(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,...Pe(t)})}(bn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Pe(t)})}(kn,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,...Pe(t)})}(wn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Pe(t)})}(En,e)}(t))}));function xn(e){return function(e,t){return new e({type:"string",...Pe(t)})}(Zn,e)}const Sn=O("ZodStringFormat",((e,t)=>{ot.init(e,t),Cn.init(e,t)})),Fn=O("ZodEmail",((e,t)=>{at.init(e,t),Sn.init(e,t)}));function Dn(e){return dn(Fn,e)}const Un=O("ZodGUID",((e,t)=>{rt.init(e,t),Sn.init(e,t)})),jn=O("ZodUUID",((e,t)=>{st.init(e,t),Sn.init(e,t)})),Ln=O("ZodURL",((e,t)=>{ut.init(e,t),Sn.init(e,t)})),Hn=O("ZodEmoji",((e,t)=>{ct.init(e,t),Sn.init(e,t)})),Mn=O("ZodNanoID",((e,t)=>{dt.init(e,t),Sn.init(e,t)})),Gn=O("ZodCUID",((e,t)=>{lt.init(e,t),Sn.init(e,t)})),Bn=O("ZodCUID2",((e,t)=>{pt.init(e,t),Sn.init(e,t)})),Yn=O("ZodULID",((e,t)=>{ht.init(e,t),Sn.init(e,t)})),Vn=O("ZodXID",((e,t)=>{ft.init(e,t),Sn.init(e,t)})),Qn=O("ZodKSUID",((e,t)=>{mt.init(e,t),Sn.init(e,t)})),Wn=O("ZodIPv4",((e,t)=>{Pt.init(e,t),Sn.init(e,t)})),qn=O("ZodIPv6",((e,t)=>{zt.init(e,t),Sn.init(e,t)})),Jn=O("ZodCIDRv4",((e,t)=>{bt.init(e,t),Sn.init(e,t)})),Kn=O("ZodCIDRv6",((e,t)=>{kt.init(e,t),Sn.init(e,t)})),Xn=O("ZodBase64",((e,t)=>{Et.init(e,t),Sn.init(e,t)})),ei=O("ZodBase64URL",((e,t)=>{Nt.init(e,t),Sn.init(e,t)})),ti=O("ZodE164",((e,t)=>{Tt.init(e,t),Sn.init(e,t)})),ni=O("ZodJWT",((e,t)=>{It.init(e,t),Sn.init(e,t)})),ii=O("ZodNumber",((e,t)=>{Rt.init(e,t),$n.init(e,t),e.gt=(t,n)=>e.check(mn(t,n)),e.gte=(t,n)=>e.check(vn(t,n)),e.min=(t,n)=>e.check(vn(t,n)),e.lt=(t,n)=>e.check(hn(t,n)),e.lte=(t,n)=>e.check(fn(t,n)),e.max=(t,n)=>e.check(fn(t,n)),e.int=t=>e.check(ri(t)),e.safe=t=>e.check(ri(t)),e.positive=t=>e.check(mn(0,t)),e.nonnegative=t=>e.check(vn(0,t)),e.negative=t=>e.check(hn(0,t)),e.nonpositive=t=>e.check(fn(0,t)),e.multipleOf=(t,n)=>e.check(_n(t,n)),e.step=(t,n)=>e.check(_n(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}));const oi=O("ZodNumberFormat",((e,t)=>{At.init(e,t),ii.init(e,t)}));function ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Pe(t)})}(oi,e)}const si=O("ZodUnknown",((e,t)=>{Ot.init(e,t),$n.init(e,t)}));function ai(){return new si({type:"unknown"})}const ui=O("ZodNever",((e,t)=>{$t.init(e,t),$n.init(e,t)}));function ci(e){return function(e,t){return new e({type:"never",...Pe(t)})}(ui,e)}const di=O("ZodDate",((e,t)=>{Ct.init(e,t),$n.init(e,t),e.min=(t,n)=>e.check(vn(t,n)),e.max=(t,n)=>e.check(fn(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 li=O("ZodArray",((e,t)=>{xt.init(e,t),$n.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(yn(t,n)),e.nonempty=t=>e.check(yn(1,t)),e.max=(t,n)=>e.check(gn(t,n)),e.length=(t,n)=>e.check(Pn(t,n)),e.unwrap=()=>e.element}));function pi(e,t){return function(e,t,n){return new e({type:"array",element:t,...Pe(n)})}(li,e,t)}const hi=O("ZodObject",((e,t)=>{Dt.init(e,t),$n.init(e,t),de(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new _i({type:"enum",entries:n,...Pe(void 0)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ai()}),e.loose=()=>e.clone({...e._zod.def,catchall:ai()}),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(!ve(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return le(this,"shape",n),n},checks:[]};return ye(e,n)}(e,t),e.merge=t=>{return i=t,ye(n=e,{...n._zod.def,get shape(){const e={...n._zod.def.shape,...i._zod.def.shape};return le(this,"shape",e),e},catchall:i._zod.def.catchall,checks:[]});var n,i},e.pick=t=>function(e,t){const n={},i=e._zod.def;for(const e in t){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=i.shape[e])}return ye(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.omit=t=>function(e,t){const n={...e._zod.def.shape},i=e._zod.def;for(const e in t){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return ye(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.partial=(...t)=>function(e,t,n){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 ye(t,{...t._zod.def,shape:o,checks:[]})}(Pi,e,t[0]),e.required=(...t)=>function(e,t,n){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 ye(t,{...t._zod.def,shape:o,checks:[]})}(Ni,e,t[0])}));function fi(e,t){const n={type:"object",get shape(){return le(this,"shape",{...e}),this.shape},...Pe(t)};return new hi(n)}const mi=O("ZodUnion",((e,t)=>{jt.init(e,t),$n.init(e,t),e.options=t.options}));const vi=O("ZodIntersection",((e,t)=>{Lt.init(e,t),$n.init(e,t)})),_i=O("ZodEnum",((e,t)=>{Gt.init(e,t),$n.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 _i({...t,checks:[],...Pe(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 _i({...t,checks:[],...Pe(i),entries:o})}})),gi=O("ZodTransform",((e,t)=>{Bt.init(e,t),$n.init(e,t),e._zod.parse=(n,i)=>{n.addIssue=i=>{if("string"==typeof i)n.issues.push(Te(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),t.continue??(t.continue=!0),n.issues.push(Te(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function yi(e){return new gi({type:"transform",transform:e})}const Pi=O("ZodOptional",((e,t)=>{Yt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function zi(e){return new Pi({type:"optional",innerType:e})}const bi=O("ZodNullable",((e,t)=>{Vt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function ki(e){return new bi({type:"nullable",innerType:e})}const wi=O("ZodDefault",((e,t)=>{Qt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ei=O("ZodPrefault",((e,t)=>{qt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ni=O("ZodNonOptional",((e,t)=>{Jt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ti=O("ZodCatch",((e,t)=>{Xt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Ii=O("ZodPipe",((e,t)=>{en.init(e,t),$n.init(e,t),e.in=t.in,e.out=t.out}));function Ri(e,t){return new Ii({type:"pipe",in:e,out:t})}const Ai=O("ZodReadonly",((e,t)=>{nn.init(e,t),$n.init(e,t)})),Oi=O("ZodCustom",((e,t)=>{rn.init(e,t),$n.init(e,t)}));function $i(e,t){return Ri(yi(e),t)}function Ci(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");n in e.getValues()?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const Zi=e=>$i((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),xi=e=>$i((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),Si=e=>xn().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Fi=()=>Dn("Invalid email address").min(1,"Required"),Di=()=>Zi(function(e){return function(e,t){return new e({type:"number",checks:[],...Pe(t)})}(ii,e)}("Valid amount required").positive("Positive amount required")),Ui=()=>xi(function(e){return function(e,t){return new e({type:"date",...Pe(t)})}(di,e)}("Valid date required").min(new Date,"Date must be in the future")),ji=e=>xn().max(e,`Maximum length is ${e} characters`),Li=fi({amount:Di(),expiry:Ui(),giverFirstName:Si(50),giverLastName:Si(50),giverEmail:Fi(),giverPhone:Si(31),cardHolder:Si(100),recipientEmail:Fi(),recipientPhone:ji(31).nullish(),notes:ji(500).nullish()}),Hi=fi({grant_type:xn().readonly().default("refresh_token"),client_id:pn(jn,undefined),client_secret:xn(),refresh_token:xn(),scope:xn().optional()});const Mi=fi({email:Dn(),firstName:xn().max(100).optional(),lastName:xn().max(100).optional(),phone:xn().max(20).optional(),scopes:pi(xn()).optional()}),Gi=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},Bi=require("decimal.js");var Yi=e.n(Bi);const Vi={UP:Yi().ROUND_UP,DOWN:Yi().ROUND_DOWN,CEIL:Yi().ROUND_CEIL,FLOOR:Yi().ROUND_FLOOR,HALF_UP:Yi().ROUND_HALF_UP,HALF_DOWN:Yi().ROUND_HALF_DOWN,HALF_EVEN:Yi().ROUND_HALF_EVEN,HALF_CEIL:Yi().ROUND_HALF_CEIL,HALF_FLOOR:Yi().ROUND_HALF_FLOOR},Qi=(e,t)=>{const{precision:n=2,rounding:i=Vi.HALF_UP}=t||{};return new(Yi())(e).toDecimalPlaces(n,i).toNumber()};function Wi(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Qi(n);switch(e.feeType){case I.PercentageOfBooking:if(o)return Qi(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Qi(a/(1-t)*e.amount/(100+e.amount))}return Qi(a*(e.amount/100));case I.FixedChargePerRoom:case I.FixedChargePerBooking:return e.amount;case I.NightlyChargePerRoom:return Qi(e.amount*i);default:return 0}}const qi=[I.FixedChargePerBooking],Ji=[I.PercentageOfBooking,I.FixedChargePerRoom,I.NightlyChargePerRoom],Ki=[I.PercentageOfBooking];function Xi(e,t){return e.filter((e=>t.includes(e.feeType)))}function eo(e){return Xi(e,qi)}function to(e){return Xi(e,Ji)}function no(e){return Xi(e,Ki)}function io(e){return{includeInRates:[I.PercentageOfBooking,I.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===I.PercentageOfBooking,appliesToAddons:e===I.PercentageOfBooking,includePreviousFeesInCalculation:e===I.PercentageOfBooking}}const oo=e=>e,ro=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},so=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class ao{}function uo(e){return e.toUpperCase()}ao.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return A.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},ao.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ao.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))),A.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})),ao.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ao.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})),ao.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(e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=ao.calculateReservationAddonTotal(o,t)?.total}})),Qi(n)},module.exports=t})();
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},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 i,o,n,r,a,d;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>I,AddonPricingType:()=>f,EAddonPricingType:()=>i,EBookingFlow:()=>n,EBookingPaymentMethod:()=>r,EBookingStatus:()=>o,ECompanyProvider:()=>u,EDistanceUnitType:()=>E,EFeeType:()=>O,EGuarantyPolicyPrepaymentType:()=>T,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>h,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>y,EIntegration:()=>R,EPlanpayBookingStatus:()=>d,ERMSDiscountType:()=>N,ERoomstayEventSource:()=>v,ERoomstayImageSize:()=>m,GuestProfile:()=>P,HttpMethod:()=>C,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>p,ItineraryResponse:()=>s,PCIBookingCardProcessorTypes:()=>c,Package:()=>A,Reservation:()=>l,ReservedPackage:()=>F,RoundingType:()=>L,TotalCalculator:()=>V,calculateFeeAmount:()=>k,calculateTotalForMemberBooking:()=>S,getFeeOptionValidity:()=>w,getFilteredBookingAddonFees:()=>Y,getFilteredBookingFees:()=>M,getFilteredBookingRateFees:()=>x,nameof:()=>j,resizeRoomstayImageUrl:()=>W,roundMoney:()=>U,subset:()=>q,uppercaseString:()=>z}),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"}(i||(i={})),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(o||(o={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(n||(n={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.CommWeb="CommWeb"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(d||(d={}));const c=[];class s{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 l{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 P,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 P{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 u,h,g,y,R,_,E,N,m,p,T,v,C,O,f;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(u||(u={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(h||(h={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(y||(y={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(R||(R={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(E||(E={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(N||(N={})),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"}(m||(m={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(p||(p={}));class A{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 F extends A{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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(T||(T={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(v||(v={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(C||(C={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),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"}(f||(f={}));const I=[f.PER_NIGHT,f.PER_PERSON_PER_NIGHT,f.PER_QUANTITY_NAME_PER_NIGHT,f.PER_ROOM_QUANTITY_PER_NIGHT,f.PER_PERSON_OCCUPANCY_PER_NIGHT,f.PER_ADULT_OCCUPANCY_PER_NIGHT,f.PER_CHILD_OCCUPANCY_PER_NIGHT,f.PER_ALL_PERSONS_PER_NIGHT],S=e=>{let t=0;const i=Object.values(e.itinerary);for(const e of i){const i=Object.keys(e.nights);for(const o of i)t+=e.nights[o].total}return t},H=require("decimal.js");var D=e.n(H);const L={UP:D().ROUND_UP,DOWN:D().ROUND_DOWN,CEIL:D().ROUND_CEIL,FLOOR:D().ROUND_FLOOR,HALF_UP:D().ROUND_HALF_UP,HALF_DOWN:D().ROUND_HALF_DOWN,HALF_EVEN:D().ROUND_HALF_EVEN,HALF_CEIL:D().ROUND_HALF_CEIL,HALF_FLOOR:D().ROUND_HALF_FLOOR},U=(e,t)=>{const{precision:i=2,rounding:o=L.HALF_UP}=t||{};return new(D())(e).toDecimalPlaces(i,o).toNumber()};function k(e,t={}){const{baseAmount:i=0,numberOfNights:o=1,feeIncludedInBaseAmount:n=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,d=U(i);switch(e.feeType){case O.PercentageOfBooking:if(n)return U(d*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return U(d/(1-t)*e.amount/(100+e.amount))}return U(d*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return U(e.amount*o);default:return 0}}const G=[O.FixedChargePerBooking],B=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],b=[O.PercentageOfBooking];function Q(e,t){return e.filter((e=>t.includes(e.feeType)))}function M(e){return Q(e,G)}function x(e){return Q(e,B)}function Y(e){return Q(e,b)}function w(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const j=e=>e,q=(e,t)=>{const i={};return t.forEach((t=>{t in e&&(i[t]=e[t])})),i},W=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class V{}function z(e){return e.toUpperCase()}V.calculateBaseAddonTotal=(e,t)=>{let i=0,o=0,n=0;e.price&&e.quantity&&(i=e.quantity*Number(e.price)),e.pricingType===f.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?i*=e.adultQuantity:e.pricingType===f.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(i*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(o=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(n=e.childQuantity*Number(e.childPrice));let r=i+o+n;return I.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:i,indAdultPrice:o,indChildPrice:n,addonTotal:r}},V.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=0;return(i.fee||i.fees?.length)&&i.quantity?i.fees?.length?i.fees.forEach((e=>{n+=i.quantity*e.amount})):n=i.quantity*Number(i.fee):((i.adultFee||i.adultFees?.length)&&i.adultQuantity&&(i.adultFees?.length?i.adultFees.forEach((e=>{n+=i.adultQuantity*e.amount})):n+=i.adultQuantity??1*Number(i.adultFee)),(i.childFee||i.childFees?.length)&&i.childQuantity&&(i.childFees?.length?i.childFees.forEach((e=>{n+=i.childQuantity??1*e.amount})):n+=i.childQuantity*Number(i.childFee))),I.includes(i.pricingType)&&i.nights&&!t&&(n*=i.nights),{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),V.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=i.fees||0;i.itemisedFees?.length&&(n=i.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=i.itemisedFees?.length?o.addonTotal:o.addonTotal+n;return{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),V.calculateTotalForReservation=(e,t=!1)=>{let i=0;return e.itemisedFees?.forEach((e=>{i+=e.amount})),e.reservations.forEach((e=>{i+=e.total.afterTax;const o=Object.keys(e.nights)?.length??0;if(e.addons?.length){const n=(e.addons??[]).map((e=>({...e,nights:o})));i+=V.calculateReservationAddonTotal(n,t)?.total}})),U(i)},module.exports=t})();
|
|
@@ -19,10 +19,10 @@ export declare enum EHotelCardProcessor {
|
|
|
19
19
|
Till = "Till",
|
|
20
20
|
RMSPay = "RMSPay",
|
|
21
21
|
Windcave = "Windcave",
|
|
22
|
-
|
|
22
|
+
CommWeb = "CommWeb"
|
|
23
23
|
}
|
|
24
24
|
export declare enum EPlanpayBookingStatus {
|
|
25
|
-
Unknown = "unknown"
|
|
25
|
+
Unknown = "unknown",
|
|
26
26
|
Unpaid = "unpaid",
|
|
27
27
|
Accepted = "accepted",
|
|
28
28
|
Cancelled = "cancelled",
|
|
@@ -38,6 +38,31 @@ export type IBookingPaymentTokenizedCard = {
|
|
|
38
38
|
CVV: string;
|
|
39
39
|
Name: string;
|
|
40
40
|
};
|
|
41
|
+
export type EHotelCardProcessorInitData = {
|
|
42
|
+
[EHotelCardProcessor.Passthrough]: undefined;
|
|
43
|
+
[EHotelCardProcessor.Adyen]: {
|
|
44
|
+
roomstayId: string;
|
|
45
|
+
sessionId: string;
|
|
46
|
+
sessionData: string;
|
|
47
|
+
clientKey: string;
|
|
48
|
+
isLive: boolean;
|
|
49
|
+
currency: string;
|
|
50
|
+
amount: number;
|
|
51
|
+
countryCode: string;
|
|
52
|
+
};
|
|
53
|
+
[EHotelCardProcessor.RMSPay]: undefined;
|
|
54
|
+
[EHotelCardProcessor.Till]: {
|
|
55
|
+
redirectUrl: string;
|
|
56
|
+
paymentId: string;
|
|
57
|
+
roomstayId: string;
|
|
58
|
+
};
|
|
59
|
+
[EHotelCardProcessor.Windcave]: {
|
|
60
|
+
redirectUrl: string;
|
|
61
|
+
paymentId: string;
|
|
62
|
+
roomstayId: string;
|
|
63
|
+
};
|
|
64
|
+
[EHotelCardProcessor.CommWeb]: undefined;
|
|
65
|
+
};
|
|
41
66
|
type IPCIBookingCardNotificationData = {
|
|
42
67
|
CaptureCardRequestID: string;
|
|
43
68
|
CaptureCardRequestStatus: string;
|
|
@@ -56,33 +81,4 @@ export type IBookingPayment = {
|
|
|
56
81
|
PCICardDetails?: IPCIBookingCardNotificationData;
|
|
57
82
|
RedirectUrl?: string;
|
|
58
83
|
};
|
|
59
|
-
export type IPaymentCheckoutDetails = {
|
|
60
|
-
planpay?: {
|
|
61
|
-
id: string;
|
|
62
|
-
checkoutWorkflow: {
|
|
63
|
-
type: string;
|
|
64
|
-
id: string;
|
|
65
|
-
scriptUrl: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
external?: {
|
|
69
|
-
id: string;
|
|
70
|
-
redirectUrl: string;
|
|
71
|
-
};
|
|
72
|
-
adyen?: {
|
|
73
|
-
roomstayId: string;
|
|
74
|
-
sessionData: string;
|
|
75
|
-
sessionId: string;
|
|
76
|
-
clientKey: string;
|
|
77
|
-
isLive: boolean;
|
|
78
|
-
currency: string;
|
|
79
|
-
amount: string;
|
|
80
|
-
countryCode: string;
|
|
81
|
-
};
|
|
82
|
-
mastercard?: {
|
|
83
|
-
sessionId: string;
|
|
84
|
-
paymentMode: 'EmbeddedPage' | 'PaymentPage';
|
|
85
|
-
baseUrl: string;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
84
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EBookingPaymentMethod
|
|
1
|
+
import { EBookingPaymentMethod } from './IBookingPayment.type';
|
|
2
2
|
import { ReservedPackage } from '../Package/Package.types';
|
|
3
3
|
export declare class ItineraryResponse {
|
|
4
4
|
roomstayId: string;
|
|
@@ -6,7 +6,16 @@ export declare class ItineraryResponse {
|
|
|
6
6
|
total?: IAmount;
|
|
7
7
|
hotelFrontendId?: string;
|
|
8
8
|
reservations: Reservation[];
|
|
9
|
-
payment?:
|
|
9
|
+
payment?: {
|
|
10
|
+
planpay?: {
|
|
11
|
+
id: string;
|
|
12
|
+
checkoutWorkflow: ICheckoutWorkflowType;
|
|
13
|
+
};
|
|
14
|
+
external?: {
|
|
15
|
+
id: string;
|
|
16
|
+
redirectUrl: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
10
19
|
feesSummary?: IItemisedBookingFeeResponse[];
|
|
11
20
|
itemisedFees?: IItemisedBookingFeeResponse[];
|
|
12
21
|
warnings?: string[];
|
|
@@ -10,7 +10,6 @@ export interface IAdminCompany {
|
|
|
10
10
|
isGiftCardsEnabled: boolean;
|
|
11
11
|
isEventsEnabled: boolean;
|
|
12
12
|
isAnalyticsEnabled: boolean;
|
|
13
|
-
preventMemberPortalWelcomeEmails: boolean;
|
|
14
13
|
hotels: {
|
|
15
14
|
name: string;
|
|
16
15
|
label: string;
|
|
@@ -21,7 +20,6 @@ export interface IAdminCompany {
|
|
|
21
20
|
clientPassword: string;
|
|
22
21
|
useTrainingDb: boolean;
|
|
23
22
|
apiUrl: string;
|
|
24
|
-
pencilGuestId?: number;
|
|
25
23
|
};
|
|
26
24
|
}[];
|
|
27
25
|
enableLighthouseAvailability: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ export * from './Addons/Addon.types';
|
|
|
5
5
|
/**
|
|
6
6
|
* Booking Details
|
|
7
7
|
*/
|
|
8
|
-
export * from './Booking/IBookingPayment.type';
|
|
9
|
-
export * from './Booking/IBookingQuote.type';
|
|
10
8
|
export * from './Booking/EBooking.types';
|
|
11
9
|
export * from './Booking/IBookingCreateErrorResponse.type';
|
|
12
10
|
export * from './Booking/IBookingPayment.type';
|
|
@@ -45,10 +43,6 @@ export * from './Room/IRoomGroup.type';
|
|
|
45
43
|
export * from './RMS/ERMSDiscountType.enum';
|
|
46
44
|
export * from './RMS/IRMSPropertyDiscount.type';
|
|
47
45
|
export * from './RMS/IRMSRequirement.type';
|
|
48
|
-
/**
|
|
49
|
-
* OHIP
|
|
50
|
-
*/
|
|
51
|
-
export * from './OHIP/index';
|
|
52
46
|
/**
|
|
53
47
|
* Image
|
|
54
48
|
*/
|
|
@@ -87,9 +81,6 @@ export * from './Events/ERoomstayEventSource.enum';
|
|
|
87
81
|
*/
|
|
88
82
|
export * from './General/HttpMethod.enum';
|
|
89
83
|
export * from './General/IMessage.type';
|
|
90
|
-
export * from './General/Pagination.types';
|
|
91
|
-
export * from './General/Format.types';
|
|
92
|
-
export * from './General/Warning.type';
|
|
93
84
|
/**
|
|
94
85
|
* Media
|
|
95
86
|
*/
|
|
@@ -113,9 +104,4 @@ export * from './Api/RoomNightRate.type';
|
|
|
113
104
|
/**
|
|
114
105
|
* Analytics
|
|
115
106
|
*/
|
|
116
|
-
export * from
|
|
117
|
-
/**
|
|
118
|
-
* Gift Cards
|
|
119
|
-
*/
|
|
120
|
-
export * from './GiftCards/GiftCard.types';
|
|
121
|
-
export * from './GiftCards/GiftCardAuth.types';
|
|
107
|
+
export * from "./Analytics/IBigQueryResults.type";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from './zodUtils';
|
|
1
|
+
export * from "./bookingTotal";
|
|
2
|
+
export * from "./calculateFee";
|
|
3
|
+
export * from "./feeTypes";
|
|
4
|
+
export * from "./reflection";
|
|
5
|
+
export * from "./roomstayImageResize";
|
|
6
|
+
export * from "./roundMoney";
|
|
7
|
+
export * from "./TotalCalculator";
|
|
8
|
+
export * from "./typeUtils";
|
|
9
|
+
export * from "./uppercaseString";
|
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;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>A,AddGiftCardSchema:()=>Li,AddonPricingType:()=>R,DATE_FORMAT:()=>T,EAddonPricingType:()=>e,EBookingFlow:()=>u,EBookingPaymentMethod:()=>t,EBookingStatus:()=>a,ECompanyProvider:()=>c,EDistanceUnitType:()=>m,EFeeType:()=>I,EGuarantyPolicyPrepaymentType:()=>y,EHotelCardProcessor:()=>n,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>p,EIntegration:()=>h,EPlanpayBookingStatus:()=>r,ERMSDiscountType:()=>v,ERoomstayEventSource:()=>P,ERoomstayImageSize:()=>_,GuestProfile:()=>w,HttpMethod:()=>z,IAuxiliaryFilterType:()=>f,IMaintenanceStatusService:()=>g,ItineraryResponse:()=>b,PCIBookingCardProcessorTypes:()=>s,Package:()=>E,RefreshGiftCardTokenSchema:()=>Hi,RegisterGiftCardAdminSchema:()=>Mi,Reservation:()=>k,ReservedPackage:()=>N,RoundingType:()=>Vi,TotalCalculator:()=>ao,calculateFeeAmount:()=>Wi,calculateTotalForMemberBooking:()=>Gi,getFeeOptionValidity:()=>io,getFilteredBookingAddonFees:()=>no,getFilteredBookingFees:()=>eo,getFilteredBookingRateFees:()=>to,maxString:()=>ji,nameof:()=>oo,preprocessDate:()=>Zi,preprocessNumber:()=>xi,requireEmail:()=>Fi,requireFutureDate:()=>Ui,requirePositiveAmount:()=>Di,requireString:()=>Si,resizeRoomstayImageUrl:()=>so,roundMoney:()=>Qi,subset:()=>ro,uppercaseString:()=>uo,validateFormWithZod:()=>Ci}),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"}(e||(e={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(t||(t={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(n||(n={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(r||(r={}));const s=[];let a,u,c,d,l,p,h,f,m,v,_,g,y,P,z;!function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(a||(a={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(u||(u={}));class b{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 k{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 w,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 w{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}}!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(c||(c={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(l||(l={})),function(e){e.Monday="monday",e.Sunday="sunday"}(p||(p={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(h||(h={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(f||(f={})),function(e){e.Metric="metric",e.Imperial="imperial"}(m||(m={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(v||(v={})),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"}(_||(_={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(g||(g={}));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 N 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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(y||(y={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(P||(P={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(z||(z={}));const T="DD/MM/YYYY";let I,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(I||(I={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(R||(R={}));const A=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function 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 $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const C={};function x(e){return e&&Object.assign(C,e),C}const Z=/^[cC][^\s-]{8,}$/,S=/^[0-9a-z]+$/,F=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,D=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,j=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,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})$/,M=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)$/,G=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,B=/^(?:(?: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})$/,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])\/([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}=))?$/,q=/^[A-Za-z0-9_-]*$/,J=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,K=/^\+(?:[0-9]){6,14}[0-9]$/,X="(?:(?:\\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])))",ee=new RegExp(`^${X}$`);function te(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 ne=/^\d+$/,ie=/^-?\d+(?:\.\d+)?/i,oe=/^[^A-Z]*$/,re=/^[^a-z]*$/;function se(e,t){return"bigint"==typeof t?t.toString():t}function ae(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ue(e){return null==e}function ce(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function de(e,t,n){Object.defineProperty(e,t,{get(){{const i=n();return e[t]=i,i}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function le(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function pe(e){return JSON.stringify(e)}const he=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function fe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const me=ae((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ve(e){if(!1===fe(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==fe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const _e=new Set(["string","number","symbol"]);function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Pe(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 ze={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 be(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function ke(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function we(e){return"string"==typeof e?e:e?.message}function Ee(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=we(e.inst?._zod.def?.error?.(e))??we(t?.error?.(e))??we(n.customError?.(e))??we(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ne(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Te(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ie=O("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Re={number:"number",bigint:"bigint",object:"date"},Ae=O("$ZodCheckLessThan",((e,t)=>{Ie.init(e,t);const n=Re[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})}})),Oe=O("$ZodCheckGreaterThan",((e,t)=>{Ie.init(e,t);const n=Re[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})}})),$e=O("$ZodCheckMultipleOf",((e,t)=>{Ie.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().split(".")[1]||"").length,o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(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})}})),Ce=O("$ZodCheckNumberFormat",((e,t)=>{Ie.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=ze[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=ne)})),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",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})}})),xe=O("$ZodCheckMaxLength",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ze=O("$ZodCheckMinLength",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Se=O("$ZodCheckLengthEquals",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(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})}})),Fe=O("$ZodCheckStringFormat",((e,t)=>{var n,i;Ie.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=()=>{})})),De=O("$ZodCheckRegex",((e,t)=>{Fe.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})}})),Ue=O("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=oe),Fe.init(e,t)})),je=O("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=re),Fe.init(e,t)})),Le=O("$ZodCheckIncludes",((e,t)=>{Ie.init(e,t);const n=ge(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})}})),He=O("$ZodCheckStartsWith",((e,t)=>{Ie.init(e,t);const n=new RegExp(`^${ge(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})}})),Me=O("$ZodCheckEndsWith",((e,t)=>{Ie.init(e,t);const n=new RegExp(`.*${ge(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})}})),Ge=O("$ZodCheckOverwrite",((e,t)=>{Ie.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Be{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 Ye=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,se,2),enumerable:!0})},Ve=O("$ZodError",Ye),Qe=O("$ZodError",Ye,{Parent:Error}),We=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=>Ee(e,r,x()))));throw he(t,o?.callee),t}return s.value},qe=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=>Ee(e,r,x()))));throw he(t,o?.callee),t}return s.value},Je=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??Ve)(r.issues.map((e=>Ee(e,o,x()))))}:{success:!0,data:r.value}},Ke=Je(Qe),Xe=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=>Ee(e,o,x()))))}:{success:!0,data:r.value}},et=Xe(Qe),tt={major:4,minor:0,patch:0},nt=O("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=be(e);for(const r of t){if(r._zod.when){if(!r._zod.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=be(e,t)))}));else{if(e.issues.length===t)continue;o||(o=be(e,t))}}return i?i.then((()=>e)):e};e._zod.run=(n,o)=>{const r=e._zod.parse(n,o);if(r instanceof Promise){if(!1===o.async)throw new $;return r.then((e=>t(e,i,o)))}return t(r,i,o)}}e["~standard"]={validate:t=>{try{const n=Ke(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return et(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),it=O("$ZodString",((e,t)=>{var n;nt.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}})),ot=O("$ZodStringFormat",((e,t)=>{Fe.init(e,t),it.init(e,t)})),rt=O("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),ot.init(e,t)})),st=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=M(e))}else t.pattern??(t.pattern=M());ot.init(e,t)})),at=O("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=G),ot.init(e,t)})),ut=O("$ZodURL",((e,t)=>{ot.init(e,t),e._zod.check=n=>{try{const i=n.value,o=new URL(i),r=o.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:J.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(!i.endsWith("/")&&r.endsWith("/")?n.value=r.slice(0,-1):n.value=r)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),ct=O("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ot.init(e,t)})),dt=O("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=j),ot.init(e,t)})),lt=O("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=Z),ot.init(e,t)})),pt=O("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=S),ot.init(e,t)})),ht=O("$ZodULID",((e,t)=>{t.pattern??(t.pattern=F),ot.init(e,t)})),ft=O("$ZodXID",((e,t)=>{t.pattern??(t.pattern=D),ot.init(e,t)})),mt=O("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),ot.init(e,t)})),vt=O("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=te({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${X}T(?:${i})$`)}(t)),ot.init(e,t)})),_t=O("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ee),ot.init(e,t)})),gt=O("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${te(t)}$`)),ot.init(e,t)})),yt=O("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),ot.init(e,t)})),Pt=O("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=B),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),zt=O("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),ot.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})}}})),bt=O("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=V),ot.init(e,t)})),kt=O("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Q),ot.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function wt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Et=O("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=W),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{wt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Nt=O("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=q),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!q.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return wt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Tt=O("$ZodE164",((e,t)=>{t.pattern??(t.pattern=K),ot.init(e,t)})),It=O("$ZodJWT",((e,t)=>{ot.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})}})),Rt=O("$ZodNumber",((e,t)=>{nt.init(e,t),e._zod.pattern=e._zod.bag.pattern??ie,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}})),At=O("$ZodNumber",((e,t)=>{Ce.init(e,t),Rt.init(e,t)})),Ot=O("$ZodUnknown",((e,t)=>{nt.init(e,t),e._zod.parse=e=>e})),$t=O("$ZodNever",((e,t)=>{nt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Ct=O("$ZodDate",((e,t)=>{nt.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 xt(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}const Zt=O("$ZodArray",((e,t)=>{nt.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=>xt(t,n,e)))):xt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function St(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function Ft(e,t,n,i){e.issues.length?void 0===i[n]?t.value[n]=n in i?void 0:e.value:t.issues.push(...ke(n,e.issues)):void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}const Dt=O("$ZodObject",((e,t)=>{nt.init(e,t);const n=ae((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof nt))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=t.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));let i;de(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 o=fe,r=!C.jitless,s=r&&me.value,a=t.catchall;let u;e._zod.parse=(c,d)=>{u??(u=n.value);const l=c.value;if(!o(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;const p=[];if(r&&s&&!1===d?.async&&!0!==d.jitless)i||(i=(e=>{const t=new Be(["shape","payload","ctx"]),i=n.value,o=e=>{const t=pe(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 i.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of i.keys)if(i.optionalKeys.has(e)){const n=r[e];t.write(`const ${n} = ${o(e)};`);const i=pe(e);t.write(`\n if (${n}.issues.length) {\n if (input[${i}] === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${i} in input) newResult[${i}] = undefined;\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}else{const n=r[e];t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${pe(e)}, ...iss.path] : [${pe(e)}]\n })));`),t.write(`newResult[${pe(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),c=i(c,d);else{c.value={};const e=u.shape;for(const t of u.keys){const n=e[t],i=n._zod.run({value:l[t],issues:[]},d),o="optional"===n._zod.optin&&"optional"===n._zod.optout;i instanceof Promise?p.push(i.then((e=>o?Ft(e,c,t,l):St(e,c,t)))):o?Ft(i,c,t,l):St(i,c,t)}}if(!a)return p.length?Promise.all(p).then((()=>c)):c;const h=[],f=u.keySet,m=a._zod,v=m.def.type;for(const e of Object.keys(l)){if(f.has(e))continue;if("never"===v){h.push(e);continue}const t=m.run({value:l[e],issues:[]},d);t instanceof Promise?p.push(t.then((t=>St(t,c,e)))):St(t,c,e)}return h.length&&c.issues.push({code:"unrecognized_keys",keys:h,input:l,inst:e}),p.length?Promise.all(p).then((()=>c)):c}}));function Ut(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Ee(e,i,x())))))}),t}const jt=O("$ZodUnion",((e,t)=>{nt.init(e,t),de(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),de(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),de(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),de(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=>ce(e.source))).join("|")})$`)}})),e._zod.parse=(n,i)=>{let o=!1;const r=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)r.push(t),o=!0;else{if(0===t.issues.length)return t;r.push(t)}}return o?Promise.all(r).then((t=>Ut(t,n,e,i))):Ut(r,n,e,i)}})),Lt=O("$ZodIntersection",((e,t)=>{nt.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])=>Mt(e,t,n))):Mt(e,o,r)}}));function Ht(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(ve(e)&&ve(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=Ht(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=Ht(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 Mt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),be(e))return e;const i=Ht(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 Gt=O("$ZodEnum",((e,t)=>{nt.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);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>_e.has(typeof e))).map((e=>"string"==typeof e?ge(e):e.toString())).join("|")})$`),e._zod.parse=(t,i)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}})),Bt=O("$ZodTransform",((e,t)=>{nt.init(e,t),e._zod.parse=(e,n)=>{const i=t.transform(e.value,e);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then((t=>(e.value=t,e)));if(i instanceof Promise)throw new $;return e.value=i,e}})),Yt=O("$ZodOptional",((e,t)=>{nt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),de(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)})),Vt=O("$ZodNullable",((e,t)=>{nt.init(e,t),de(e._zod,"optin",(()=>t.innerType._zod.optin)),de(e._zod,"optout",(()=>t.innerType._zod.optout)),de(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)}|null)$`):void 0})),de(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)})),Qt=O("$ZodDefault",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(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=>Wt(e,t))):Wt(i,t)}}));function Wt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const qt=O("$ZodPrefault",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Jt=O("$ZodNonOptional",((e,t)=>{nt.init(e,t),de(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=>Kt(t,e))):Kt(o,e)}}));function Kt(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 Xt=O("$ZodCatch",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"optout",(()=>t.innerType._zod.optout)),de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(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=>Ee(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=>Ee(e,n,x())))},input:e.value}),e.issues=[]),e)}})),en=O("$ZodPipe",((e,t)=>{nt.init(e,t),de(e._zod,"values",(()=>t.in._zod.values)),de(e._zod,"optin",(()=>t.in._zod.optin)),de(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>tn(e,t,n))):tn(i,t,n)}}));function tn(e,t,n){return be(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const nn=O("$ZodReadonly",((e,t)=>{nt.init(e,t),de(e._zod,"propValues",(()=>t.innerType._zod.propValues)),de(e._zod,"values",(()=>t.innerType._zod.values)),de(e._zod,"optin",(()=>t.innerType._zod.optin)),de(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(on):on(i)}}));function on(e){return e.value=Object.freeze(e.value),e}const rn=O("$ZodCustom",((e,t)=>{Ie.init(e,t),nt.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=>sn(t,n,i,e)));sn(o,n,i,e)}}));function sn(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(Te(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class an{constructor(){this._map=new WeakMap,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}remove(e){return this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function un(){return new an}const cn=un();function dn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Pe(t)})}function ln(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Pe(t)})}function pn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Pe(t)})}function hn(e,t){return new Ae({check:"less_than",...Pe(t),value:e,inclusive:!1})}function fn(e,t){return new Ae({check:"less_than",...Pe(t),value:e,inclusive:!0})}function mn(e,t){return new Oe({check:"greater_than",...Pe(t),value:e,inclusive:!1})}function vn(e,t){return new Oe({check:"greater_than",...Pe(t),value:e,inclusive:!0})}function _n(e,t){return new $e({check:"multiple_of",...Pe(t),value:e})}function gn(e,t){return new xe({check:"max_length",...Pe(t),maximum:e})}function yn(e,t){return new Ze({check:"min_length",...Pe(t),minimum:e})}function Pn(e,t){return new Se({check:"length_equals",...Pe(t),length:e})}function zn(e){return new Ge({check:"overwrite",tx:e})}const bn=O("ZodISODateTime",((e,t)=>{vt.init(e,t),Sn.init(e,t)}));const kn=O("ZodISODate",((e,t)=>{_t.init(e,t),Sn.init(e,t)}));const wn=O("ZodISOTime",((e,t)=>{gt.init(e,t),Sn.init(e,t)}));const En=O("ZodISODuration",((e,t)=>{yt.init(e,t),Sn.init(e,t)}));const Nn=(e,t)=>{Ve.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)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},Tn=(O("ZodError",Nn),O("ZodError",Nn,{Parent:Error})),In=We(Tn),Rn=qe(Tn),An=Je(Tn),On=Xe(Tn),$n=O("ZodType",((e,t)=>(nt.init(e,t),e.def=t,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)=>ye(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>In(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>An(e,t,n),e.parseAsync=async(t,n)=>Rn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>On(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Pe(n)})}(Oi,e,t)}(t,n)),e.superRefine=t=>e.check(function(e,t){const n=function(e,t){const n=new Ie({check:"custom",...Pe(undefined)});return n._zod.check=e,n}((t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(Te(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(Te(i))}},e(t.value,t))));return n}(t)),e.overwrite=t=>e.check(zn(t)),e.optional=()=>zi(e),e.nullable=()=>ki(e),e.nullish=()=>zi(ki(e)),e.nonoptional=t=>function(e,t){return new Ni({type:"nonoptional",innerType:e,...Pe(t)})}(e,t),e.array=()=>pi(e),e.or=t=>function(e,t){return new mi({type:"union",options:e,...Pe(t)})}([e,t]),e.and=t=>new vi({type:"intersection",left:e,right:t}),e.transform=t=>Ri(e,yi(t)),e.default=t=>{return n=t,new wi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Ei({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new Ti({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Ri(e,t),e.readonly=()=>new Ai({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return cn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>cn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return cn.get(e);const n=e.clone();return cn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Cn=O("_ZodString",((e,t)=>{it.init(e,t),$n.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 De({check:"string_format",format:"regex",...Pe(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Le({check:"string_format",format:"includes",...Pe(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"starts_with",...Pe(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"ends_with",...Pe(t),suffix:e})}(...t)),e.min=(...t)=>e.check(yn(...t)),e.max=(...t)=>e.check(gn(...t)),e.length=(...t)=>e.check(Pn(...t)),e.nonempty=(...t)=>e.check(yn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ue({check:"string_format",format:"lowercase",...Pe(e)})}(t)),e.uppercase=t=>e.check(function(e){return new je({check:"string_format",format:"uppercase",...Pe(e)})}(t)),e.trim=()=>e.check(zn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return zn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(zn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(zn((e=>e.toUpperCase())))})),xn=O("ZodString",((e,t)=>{it.init(e,t),Cn.init(e,t),e.email=t=>e.check(dn(Fn,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Pe(t)})}(Ln,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Pe(t)})}(ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Pe(t)})}(Hn,t)),e.guid=t=>e.check(ln(Un,t)),e.uuid=t=>e.check(pn(jn,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pe(t)})}(jn,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pe(t)})}(jn,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pe(t)})}(jn,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pe(t)})}(Mn,t)),e.guid=t=>e.check(ln(Un,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Pe(t)})}(Gn,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pe(t)})}(Bn,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Pe(t)})}(Yn,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Pe(t)})}(Xn,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Pe(t)})}(ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Pe(t)})}(Vn,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pe(t)})}(Qn,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pe(t)})}(Wn,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pe(t)})}(qn,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pe(t)})}(Jn,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pe(t)})}(Kn,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Pe(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,...Pe(t)})}(bn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Pe(t)})}(kn,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,...Pe(t)})}(wn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Pe(t)})}(En,e)}(t))}));function Zn(e){return function(e,t){return new e({type:"string",...Pe(t)})}(xn,e)}const Sn=O("ZodStringFormat",((e,t)=>{ot.init(e,t),Cn.init(e,t)})),Fn=O("ZodEmail",((e,t)=>{at.init(e,t),Sn.init(e,t)}));function Dn(e){return dn(Fn,e)}const Un=O("ZodGUID",((e,t)=>{rt.init(e,t),Sn.init(e,t)})),jn=O("ZodUUID",((e,t)=>{st.init(e,t),Sn.init(e,t)})),Ln=O("ZodURL",((e,t)=>{ut.init(e,t),Sn.init(e,t)})),Hn=O("ZodEmoji",((e,t)=>{ct.init(e,t),Sn.init(e,t)})),Mn=O("ZodNanoID",((e,t)=>{dt.init(e,t),Sn.init(e,t)})),Gn=O("ZodCUID",((e,t)=>{lt.init(e,t),Sn.init(e,t)})),Bn=O("ZodCUID2",((e,t)=>{pt.init(e,t),Sn.init(e,t)})),Yn=O("ZodULID",((e,t)=>{ht.init(e,t),Sn.init(e,t)})),Vn=O("ZodXID",((e,t)=>{ft.init(e,t),Sn.init(e,t)})),Qn=O("ZodKSUID",((e,t)=>{mt.init(e,t),Sn.init(e,t)})),Wn=O("ZodIPv4",((e,t)=>{Pt.init(e,t),Sn.init(e,t)})),qn=O("ZodIPv6",((e,t)=>{zt.init(e,t),Sn.init(e,t)})),Jn=O("ZodCIDRv4",((e,t)=>{bt.init(e,t),Sn.init(e,t)})),Kn=O("ZodCIDRv6",((e,t)=>{kt.init(e,t),Sn.init(e,t)})),Xn=O("ZodBase64",((e,t)=>{Et.init(e,t),Sn.init(e,t)})),ei=O("ZodBase64URL",((e,t)=>{Nt.init(e,t),Sn.init(e,t)})),ti=O("ZodE164",((e,t)=>{Tt.init(e,t),Sn.init(e,t)})),ni=O("ZodJWT",((e,t)=>{It.init(e,t),Sn.init(e,t)})),ii=O("ZodNumber",((e,t)=>{Rt.init(e,t),$n.init(e,t),e.gt=(t,n)=>e.check(mn(t,n)),e.gte=(t,n)=>e.check(vn(t,n)),e.min=(t,n)=>e.check(vn(t,n)),e.lt=(t,n)=>e.check(hn(t,n)),e.lte=(t,n)=>e.check(fn(t,n)),e.max=(t,n)=>e.check(fn(t,n)),e.int=t=>e.check(ri(t)),e.safe=t=>e.check(ri(t)),e.positive=t=>e.check(mn(0,t)),e.nonnegative=t=>e.check(vn(0,t)),e.negative=t=>e.check(hn(0,t)),e.nonpositive=t=>e.check(fn(0,t)),e.multipleOf=(t,n)=>e.check(_n(t,n)),e.step=(t,n)=>e.check(_n(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}));const oi=O("ZodNumberFormat",((e,t)=>{At.init(e,t),ii.init(e,t)}));function ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Pe(t)})}(oi,e)}const si=O("ZodUnknown",((e,t)=>{Ot.init(e,t),$n.init(e,t)}));function ai(){return new si({type:"unknown"})}const ui=O("ZodNever",((e,t)=>{$t.init(e,t),$n.init(e,t)}));function ci(e){return function(e,t){return new e({type:"never",...Pe(t)})}(ui,e)}const di=O("ZodDate",((e,t)=>{Ct.init(e,t),$n.init(e,t),e.min=(t,n)=>e.check(vn(t,n)),e.max=(t,n)=>e.check(fn(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 li=O("ZodArray",((e,t)=>{Zt.init(e,t),$n.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(yn(t,n)),e.nonempty=t=>e.check(yn(1,t)),e.max=(t,n)=>e.check(gn(t,n)),e.length=(t,n)=>e.check(Pn(t,n)),e.unwrap=()=>e.element}));function pi(e,t){return function(e,t,n){return new e({type:"array",element:t,...Pe(n)})}(li,e,t)}const hi=O("ZodObject",((e,t)=>{Dt.init(e,t),$n.init(e,t),de(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new _i({type:"enum",entries:n,...Pe(void 0)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ai()}),e.loose=()=>e.clone({...e._zod.def,catchall:ai()}),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(!ve(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return le(this,"shape",n),n},checks:[]};return ye(e,n)}(e,t),e.merge=t=>{return i=t,ye(n=e,{...n._zod.def,get shape(){const e={...n._zod.def.shape,...i._zod.def.shape};return le(this,"shape",e),e},catchall:i._zod.def.catchall,checks:[]});var n,i},e.pick=t=>function(e,t){const n={},i=e._zod.def;for(const e in t){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=i.shape[e])}return ye(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.omit=t=>function(e,t){const n={...e._zod.def.shape},i=e._zod.def;for(const e in t){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return ye(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.partial=(...t)=>function(e,t,n){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 ye(t,{...t._zod.def,shape:o,checks:[]})}(Pi,e,t[0]),e.required=(...t)=>function(e,t,n){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 ye(t,{...t._zod.def,shape:o,checks:[]})}(Ni,e,t[0])}));function fi(e,t){const n={type:"object",get shape(){return le(this,"shape",{...e}),this.shape},...Pe(t)};return new hi(n)}const mi=O("ZodUnion",((e,t)=>{jt.init(e,t),$n.init(e,t),e.options=t.options}));const vi=O("ZodIntersection",((e,t)=>{Lt.init(e,t),$n.init(e,t)})),_i=O("ZodEnum",((e,t)=>{Gt.init(e,t),$n.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 _i({...t,checks:[],...Pe(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 _i({...t,checks:[],...Pe(i),entries:o})}})),gi=O("ZodTransform",((e,t)=>{Bt.init(e,t),$n.init(e,t),e._zod.parse=(n,i)=>{n.addIssue=i=>{if("string"==typeof i)n.issues.push(Te(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),t.continue??(t.continue=!0),n.issues.push(Te(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function yi(e){return new gi({type:"transform",transform:e})}const Pi=O("ZodOptional",((e,t)=>{Yt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function zi(e){return new Pi({type:"optional",innerType:e})}const bi=O("ZodNullable",((e,t)=>{Vt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function ki(e){return new bi({type:"nullable",innerType:e})}const wi=O("ZodDefault",((e,t)=>{Qt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ei=O("ZodPrefault",((e,t)=>{qt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ni=O("ZodNonOptional",((e,t)=>{Jt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ti=O("ZodCatch",((e,t)=>{Xt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Ii=O("ZodPipe",((e,t)=>{en.init(e,t),$n.init(e,t),e.in=t.in,e.out=t.out}));function Ri(e,t){return new Ii({type:"pipe",in:e,out:t})}const Ai=O("ZodReadonly",((e,t)=>{nn.init(e,t),$n.init(e,t)})),Oi=O("ZodCustom",((e,t)=>{rn.init(e,t),$n.init(e,t)}));function $i(e,t){return Ri(yi(e),t)}function Ci(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");n in e.getValues()?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const xi=e=>$i((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),Zi=e=>$i((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),Si=e=>Zn().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Fi=()=>Dn("Invalid email address").min(1,"Required"),Di=()=>xi(function(e){return function(e,t){return new e({type:"number",checks:[],...Pe(t)})}(ii,e)}("Valid amount required").positive("Positive amount required")),Ui=()=>Zi(function(e){return function(e,t){return new e({type:"date",...Pe(t)})}(di,e)}("Valid date required").min(new Date,"Date must be in the future")),ji=e=>Zn().max(e,`Maximum length is ${e} characters`),Li=fi({amount:Di(),expiry:Ui(),giverFirstName:Si(50),giverLastName:Si(50),giverEmail:Fi(),giverPhone:Si(31),cardHolder:Si(100),recipientEmail:Fi(),recipientPhone:ji(31).nullish(),notes:ji(500).nullish()}),Hi=fi({grant_type:Zn().readonly().default("refresh_token"),client_id:pn(jn,undefined),client_secret:Zn(),refresh_token:Zn(),scope:Zn().optional()});const Mi=fi({email:Dn(),firstName:Zn().max(100).optional(),lastName:Zn().max(100).optional(),phone:Zn().max(20).optional(),scopes:pi(Zn()).optional()}),Gi=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 Bi=i(60),Yi=i.n(Bi);const Vi={UP:Yi().ROUND_UP,DOWN:Yi().ROUND_DOWN,CEIL:Yi().ROUND_CEIL,FLOOR:Yi().ROUND_FLOOR,HALF_UP:Yi().ROUND_HALF_UP,HALF_DOWN:Yi().ROUND_HALF_DOWN,HALF_EVEN:Yi().ROUND_HALF_EVEN,HALF_CEIL:Yi().ROUND_HALF_CEIL,HALF_FLOOR:Yi().ROUND_HALF_FLOOR},Qi=(e,t)=>{const{precision:n=2,rounding:i=Vi.HALF_UP}=t||{};return new(Yi())(e).toDecimalPlaces(n,i).toNumber()};function Wi(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Qi(n);switch(e.feeType){case I.PercentageOfBooking:if(o)return Qi(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Qi(a/(1-t)*e.amount/(100+e.amount))}return Qi(a*(e.amount/100));case I.FixedChargePerRoom:case I.FixedChargePerBooking:return e.amount;case I.NightlyChargePerRoom:return Qi(e.amount*i);default:return 0}}const qi=[I.FixedChargePerBooking],Ji=[I.PercentageOfBooking,I.FixedChargePerRoom,I.NightlyChargePerRoom],Ki=[I.PercentageOfBooking];function Xi(e,t){return e.filter((e=>t.includes(e.feeType)))}function eo(e){return Xi(e,qi)}function to(e){return Xi(e,Ji)}function no(e){return Xi(e,Ki)}function io(e){return{includeInRates:[I.PercentageOfBooking,I.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===I.PercentageOfBooking,appliesToAddons:e===I.PercentageOfBooking,includePreviousFeesInCalculation:e===I.PercentageOfBooking}}const oo=e=>e,ro=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},so=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class ao{}function uo(e){return e.toUpperCase()}ao.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return A.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},ao.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ao.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))),A.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})),ao.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ao.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})),ao.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(e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=ao.calculateReservationAddonTotal(o,t)?.total}})),Qi(n)}})(),o})()));
|
|
1
|
+
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},i={};function o(e){var n=i[e];if(void 0!==n)return n.exports;var r=i[e]={exports:{}};return t[e](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{let e,t,i,r,a,d;o.r(n),o.d(n,{ADDON_PER_NIGHT_TYPES:()=>I,AddonPricingType:()=>f,EAddonPricingType:()=>e,EBookingFlow:()=>i,EBookingPaymentMethod:()=>r,EBookingStatus:()=>t,ECompanyProvider:()=>u,EDistanceUnitType:()=>E,EFeeType:()=>O,EGuarantyPolicyPrepaymentType:()=>T,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>h,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>y,EIntegration:()=>R,EPlanpayBookingStatus:()=>d,ERMSDiscountType:()=>p,ERoomstayEventSource:()=>v,ERoomstayImageSize:()=>N,GuestProfile:()=>P,HttpMethod:()=>C,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>m,ItineraryResponse:()=>s,PCIBookingCardProcessorTypes:()=>c,Package:()=>A,Reservation:()=>l,ReservedPackage:()=>F,RoundingType:()=>L,TotalCalculator:()=>V,calculateFeeAmount:()=>k,calculateTotalForMemberBooking:()=>S,getFeeOptionValidity:()=>w,getFilteredBookingAddonFees:()=>Y,getFilteredBookingFees:()=>x,getFilteredBookingRateFees:()=>M,nameof:()=>j,resizeRoomstayImageUrl:()=>q,roundMoney:()=>U,subset:()=>W,uppercaseString:()=>z}),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"}(e||(e={})),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(t||(t={})),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"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.CommWeb="CommWeb"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(d||(d={}));const c=[];class s{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 l{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 P,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 P{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 u,h,g,y,R,_,E,p,N,m,T,v,C,O,f;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(u||(u={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(h||(h={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(y||(y={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(R||(R={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(E||(E={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(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"}(N||(N={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(m||(m={}));class A{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 F extends A{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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(T||(T={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(v||(v={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(C||(C={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),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"}(f||(f={}));const I=[f.PER_NIGHT,f.PER_PERSON_PER_NIGHT,f.PER_QUANTITY_NAME_PER_NIGHT,f.PER_ROOM_QUANTITY_PER_NIGHT,f.PER_PERSON_OCCUPANCY_PER_NIGHT,f.PER_ADULT_OCCUPANCY_PER_NIGHT,f.PER_CHILD_OCCUPANCY_PER_NIGHT,f.PER_ALL_PERSONS_PER_NIGHT],S=e=>{let t=0;const i=Object.values(e.itinerary);for(const e of i){const i=Object.keys(e.nights);for(const o of i)t+=e.nights[o].total}return t};var H=o(60),D=o.n(H);const L={UP:D().ROUND_UP,DOWN:D().ROUND_DOWN,CEIL:D().ROUND_CEIL,FLOOR:D().ROUND_FLOOR,HALF_UP:D().ROUND_HALF_UP,HALF_DOWN:D().ROUND_HALF_DOWN,HALF_EVEN:D().ROUND_HALF_EVEN,HALF_CEIL:D().ROUND_HALF_CEIL,HALF_FLOOR:D().ROUND_HALF_FLOOR},U=(e,t)=>{const{precision:i=2,rounding:o=L.HALF_UP}=t||{};return new(D())(e).toDecimalPlaces(i,o).toNumber()};function k(e,t={}){const{baseAmount:i=0,numberOfNights:o=1,feeIncludedInBaseAmount:n=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,d=U(i);switch(e.feeType){case O.PercentageOfBooking:if(n)return U(d*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return U(d/(1-t)*e.amount/(100+e.amount))}return U(d*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return U(e.amount*o);default:return 0}}const G=[O.FixedChargePerBooking],B=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],b=[O.PercentageOfBooking];function Q(e,t){return e.filter((e=>t.includes(e.feeType)))}function x(e){return Q(e,G)}function M(e){return Q(e,B)}function Y(e){return Q(e,b)}function w(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const j=e=>e,W=(e,t)=>{const i={};return t.forEach((t=>{t in e&&(i[t]=e[t])})),i},q=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class V{}function z(e){return e.toUpperCase()}V.calculateBaseAddonTotal=(e,t)=>{let i=0,o=0,n=0;e.price&&e.quantity&&(i=e.quantity*Number(e.price)),e.pricingType===f.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?i*=e.adultQuantity:e.pricingType===f.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(i*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(o=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(n=e.childQuantity*Number(e.childPrice));let r=i+o+n;return I.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:i,indAdultPrice:o,indChildPrice:n,addonTotal:r}},V.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=0;return(i.fee||i.fees?.length)&&i.quantity?i.fees?.length?i.fees.forEach((e=>{n+=i.quantity*e.amount})):n=i.quantity*Number(i.fee):((i.adultFee||i.adultFees?.length)&&i.adultQuantity&&(i.adultFees?.length?i.adultFees.forEach((e=>{n+=i.adultQuantity*e.amount})):n+=i.adultQuantity??1*Number(i.adultFee)),(i.childFee||i.childFees?.length)&&i.childQuantity&&(i.childFees?.length?i.childFees.forEach((e=>{n+=i.childQuantity??1*e.amount})):n+=i.childQuantity*Number(i.childFee))),I.includes(i.pricingType)&&i.nights&&!t&&(n*=i.nights),{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),V.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=i.fees||0;i.itemisedFees?.length&&(n=i.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=i.itemisedFees?.length?o.addonTotal:o.addonTotal+n;return{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),V.calculateTotalForReservation=(e,t=!1)=>{let i=0;return e.itemisedFees?.forEach((e=>{i+=e.amount})),e.reservations.forEach((e=>{i+=e.total.afterTax;const o=Object.keys(e.nights)?.length??0;if(e.addons?.length){const n=(e.addons??[]).map((e=>({...e,nights:o})));i+=V.calculateReservationAddonTotal(n,t)?.total}})),U(i)}})(),n})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomstay/core",
|
|
3
|
-
"version": "0.1.53-
|
|
3
|
+
"version": "0.1.53-3",
|
|
4
4
|
"description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"@babel/preset-env": "^7.11.0",
|
|
34
34
|
"@babel/preset-typescript": "^7.10.4",
|
|
35
35
|
"@babel/runtime": "^7.11.2",
|
|
36
|
-
"@types/node": "^24.0.12",
|
|
37
36
|
"babel": "^6.23.0",
|
|
38
37
|
"babel-loader": "^8.1.0",
|
|
39
38
|
"decimal.js": "^10.4.3",
|
|
@@ -41,17 +40,12 @@
|
|
|
41
40
|
"resolve-tspaths": "^0.8.3",
|
|
42
41
|
"shx": "^0.3.4",
|
|
43
42
|
"ts-loader": "^9.4.1",
|
|
44
|
-
"typescript": "^
|
|
43
|
+
"typescript": "^4.9.3",
|
|
45
44
|
"webpack": "^5.75.0",
|
|
46
45
|
"webpack-cli": "^5.0.0",
|
|
47
46
|
"yalc": "^1.0.0-pre.53"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"decimal.js": "^10.4.3"
|
|
51
|
-
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"react": "^19.1.0",
|
|
54
|
-
"react-hook-form": "^7.60.0",
|
|
55
|
-
"zod": "^3.25.74"
|
|
56
50
|
}
|
|
57
51
|
}
|
package/dist/node.js.LICENSE.txt
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type IDailyRevenue = {
|
|
2
|
-
date: string;
|
|
3
|
-
revenue: number;
|
|
4
|
-
};
|
|
5
|
-
export type IDailyRoomBreakdown = {
|
|
6
|
-
date: string;
|
|
7
|
-
roomName: string;
|
|
8
|
-
purchases: number;
|
|
9
|
-
};
|
|
10
|
-
export type IRegionBreakdown = {
|
|
11
|
-
country: string;
|
|
12
|
-
region: string;
|
|
13
|
-
purchases: number;
|
|
14
|
-
revenue: number;
|
|
15
|
-
};
|
|
16
|
-
export type IBigQueryResponse = {
|
|
17
|
-
purchases: number;
|
|
18
|
-
cancellations: number;
|
|
19
|
-
revenue: number;
|
|
20
|
-
conversionRate: number;
|
|
21
|
-
dailyRevenue: IDailyRevenue[];
|
|
22
|
-
dailyRoomsBreakdown: IDailyRoomBreakdown[];
|
|
23
|
-
regionBreakdown: IRegionBreakdown[];
|
|
24
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DATE_FORMAT = "DD/MM/YYYY";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type IPaginatedRequest = {
|
|
2
|
-
pageSize?: number;
|
|
3
|
-
currentPage?: number;
|
|
4
|
-
};
|
|
5
|
-
export type IPagination = {
|
|
6
|
-
pageSize: number;
|
|
7
|
-
currentPage: number;
|
|
8
|
-
skip: number;
|
|
9
|
-
};
|
|
10
|
-
export type IPaginatedResponse<T> = {
|
|
11
|
-
pageSize: number;
|
|
12
|
-
currentPage: number;
|
|
13
|
-
totalPages: number;
|
|
14
|
-
totalItems: number;
|
|
15
|
-
data: T[];
|
|
16
|
-
};
|
|
17
|
-
export type IPaginatedSearchRequest = IPaginatedRequest & {
|
|
18
|
-
search?: string;
|
|
19
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A standard warning object with a type, message and extra data
|
|
3
|
-
* @example
|
|
4
|
-
* const warn: Warning<{ field: string; issue: string }> = {
|
|
5
|
-
* type: 'VALIDATION_WARNING',
|
|
6
|
-
* data: { field: 'email', issue: 'invalid_format' },
|
|
7
|
-
* message: 'Email address is not properly formatted.',
|
|
8
|
-
* };
|
|
9
|
-
*/
|
|
10
|
-
export type Warning<TData = unknown> = {
|
|
11
|
-
type: string;
|
|
12
|
-
data: TData;
|
|
13
|
-
message: string;
|
|
14
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4';
|
|
2
|
-
export declare const AddGiftCardSchema: z.ZodObject<{
|
|
3
|
-
amount: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
|
|
4
|
-
expiry: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<Date, unknown, z.core.$ZodTypeInternals<Date, unknown>>>;
|
|
5
|
-
giverFirstName: z.ZodString;
|
|
6
|
-
giverLastName: z.ZodString;
|
|
7
|
-
giverEmail: z.ZodEmail;
|
|
8
|
-
giverPhone: z.ZodString;
|
|
9
|
-
cardHolder: z.ZodString;
|
|
10
|
-
recipientEmail: z.ZodEmail;
|
|
11
|
-
recipientPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
-
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
export type IAddGiftCardRequest = z.infer<typeof AddGiftCardSchema>;
|
|
15
|
-
export type IAddGiftCardResponse = IGiftCardDTO & {
|
|
16
|
-
password: string;
|
|
17
|
-
};
|
|
18
|
-
export type IGiftCardDTO = {
|
|
19
|
-
code: string;
|
|
20
|
-
createdBy?: string | null;
|
|
21
|
-
amount: number;
|
|
22
|
-
balance: number;
|
|
23
|
-
expiry: Date;
|
|
24
|
-
giverFirstName: string;
|
|
25
|
-
giverLastName: string;
|
|
26
|
-
giverEmail: string;
|
|
27
|
-
giverPhone: string;
|
|
28
|
-
cardHolder: string;
|
|
29
|
-
recipientEmail: string;
|
|
30
|
-
recipientPhone?: string | null;
|
|
31
|
-
notes?: string | null;
|
|
32
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4';
|
|
2
|
-
export declare const RefreshGiftCardTokenSchema: z.ZodObject<{
|
|
3
|
-
grant_type: z.ZodDefault<z.ZodReadonly<z.ZodString>>;
|
|
4
|
-
client_id: z.ZodUUID;
|
|
5
|
-
client_secret: z.ZodString;
|
|
6
|
-
refresh_token: z.ZodString;
|
|
7
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
export type IRefreshGiftCardTokenRequest = z.infer<typeof RefreshGiftCardTokenSchema>;
|
|
10
|
-
/**
|
|
11
|
-
* Response from the Gift Card Engine when refreshing a token.
|
|
12
|
-
*/
|
|
13
|
-
export type IGiftCardTokenResponse = {
|
|
14
|
-
token_type: string;
|
|
15
|
-
access_token: string;
|
|
16
|
-
refresh_token?: string;
|
|
17
|
-
expires_in: number;
|
|
18
|
-
scope: string;
|
|
19
|
-
user?: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Request to register a new user on the gift card admin.
|
|
23
|
-
*/
|
|
24
|
-
export declare const RegisterGiftCardAdminSchema: z.ZodObject<{
|
|
25
|
-
email: z.ZodEmail;
|
|
26
|
-
firstName: z.ZodOptional<z.ZodString>;
|
|
27
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
28
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
29
|
-
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
export type IRegisterGiftCardAdminRequest = z.infer<typeof RegisterGiftCardAdminSchema>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './IOHIPConfiguration.types';
|
|
File without changes
|
package/dist/utils/zodUtils.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4';
|
|
2
|
-
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
/**
|
|
4
|
-
* Processes a form submission using Zod for validation.
|
|
5
|
-
*/
|
|
6
|
-
export declare function validateFormWithZod<T extends FieldValues>(formMethods: UseFormReturn<T>, schema: z.ZodSchema<T>, data: any): T;
|
|
7
|
-
/**
|
|
8
|
-
* Preprocesses a form input to convert string values to numbers.
|
|
9
|
-
*/
|
|
10
|
-
export declare const preprocessNumber: (schema: z.ZodType<number>) => z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
|
|
11
|
-
/**
|
|
12
|
-
* Preprocesses a form input to convert string values to dates.
|
|
13
|
-
*/
|
|
14
|
-
export declare const preprocessDate: (schema: z.ZodType<Date>) => z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<Date, unknown, z.core.$ZodTypeInternals<Date, unknown>>>;
|
|
15
|
-
export declare const requireString: (max: number) => z.ZodString;
|
|
16
|
-
export declare const requireEmail: () => z.ZodEmail;
|
|
17
|
-
export declare const requirePositiveAmount: () => z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
|
|
18
|
-
export declare const requireFutureDate: () => z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<Date, unknown, z.core.$ZodTypeInternals<Date, unknown>>>;
|
|
19
|
-
export declare const maxString: (max: number) => z.ZodString;
|