@roomstay/core 0.1.81-8 → 0.1.81
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/browser/index.js +4005 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/node/index.cjs +25 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.mjs +4005 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node.js +1 -1
- package/dist/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts +14 -12
- package/dist/types/AnalyticsEvents/MetaCapiTransformer.d.ts +1 -6
- package/dist/types/Booking/PlaceBooking.types.d.ts +0 -1
- package/dist/types/Company/IAdminCompany.type.d.ts +0 -1
- package/dist/types/GiftCards/GiftCard.types.d.ts +0 -9
- package/dist/types/Maintenance/IMaintenanceStatus.type.d.ts +1 -4
- package/dist/types/Member/IMemberVerification.type.d.ts +0 -3
- package/dist/types/Member/IRoomstayMember.type.d.ts +1 -2
- package/dist/types/Newbook/ENewbookSyncStrategy.enum.d.ts +1 -6
- package/dist/types/Newbook/index.d.ts +0 -3
- package/dist/types/PMSSync/index.d.ts +0 -15
- package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -5
- package/dist/types/PromoCode/EPromoCodeDiscountType.enum.d.ts +1 -2
- package/dist/types/index.d.ts +0 -16
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/Addons/Addon.enum.d.ts +3 -0
- package/dist/types/types/Addons/Addon.enum.d.ts.map +1 -0
- package/dist/types/types/Addons/Addon.types.d.ts +56 -0
- package/dist/types/types/Addons/Addon.types.d.ts.map +1 -0
- package/dist/types/types/Analytics/IBigQueryResults.type.d.ts +46 -0
- package/dist/types/types/Analytics/IBigQueryResults.type.d.ts.map +1 -0
- package/dist/types/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts +91 -0
- package/dist/types/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts.map +1 -0
- package/dist/types/types/AnalyticsEvents/IAnalyticsSession.type.d.ts +21 -0
- package/dist/types/types/AnalyticsEvents/IAnalyticsSession.type.d.ts.map +1 -0
- package/dist/types/types/AnalyticsEvents/IRoomstayEventData.type.d.ts +91 -0
- package/dist/types/types/AnalyticsEvents/IRoomstayEventData.type.d.ts.map +1 -0
- package/dist/types/types/AnalyticsEvents/MetaCapiTransformer.d.ts +26 -0
- package/dist/types/types/AnalyticsEvents/MetaCapiTransformer.d.ts.map +1 -0
- package/dist/types/types/Api/Reservations.type.d.ts +85 -0
- package/dist/types/types/Api/Reservations.type.d.ts.map +1 -0
- package/dist/types/types/Api/RoomNightRate.type.d.ts +8 -0
- package/dist/types/types/Api/RoomNightRate.type.d.ts.map +1 -0
- package/dist/types/types/Availability/Availability.types.d.ts +122 -0
- package/dist/types/types/Availability/Availability.types.d.ts.map +1 -0
- package/dist/types/types/Booking/ConfirmBooking.types.d.ts +22 -0
- package/dist/types/types/Booking/ConfirmBooking.types.d.ts.map +1 -0
- package/dist/types/types/Booking/EBooking.types.d.ts +13 -0
- package/dist/types/types/Booking/EBooking.types.d.ts.map +1 -0
- package/dist/types/types/Booking/GetBooking.types.d.ts +8 -0
- package/dist/types/types/Booking/GetBooking.types.d.ts.map +1 -0
- package/dist/types/{Booking/IBookingCreateErrorResponse.d.ts → types/Booking/IBookingCreateErrorResponse.type.d.ts} +3 -0
- package/dist/types/types/Booking/IBookingCreateErrorResponse.type.d.ts.map +1 -0
- package/dist/types/types/Booking/IBookingExtraFields.type.d.ts +20 -0
- package/dist/types/types/Booking/IBookingExtraFields.type.d.ts.map +1 -0
- package/dist/types/types/Booking/IBookingPayment.type.d.ts +115 -0
- package/dist/types/types/Booking/IBookingPayment.type.d.ts.map +1 -0
- package/dist/types/types/Booking/IBookingQuote.type.d.ts +31 -0
- package/dist/types/types/Booking/IBookingQuote.type.d.ts.map +1 -0
- package/dist/types/types/Booking/ICommonQueryParameters.type.d.ts +4 -0
- package/dist/types/types/Booking/ICommonQueryParameters.type.d.ts.map +1 -0
- package/dist/types/types/Booking/Itinerary.types.d.ts +100 -0
- package/dist/types/types/Booking/Itinerary.types.d.ts.map +1 -0
- package/dist/types/types/Booking/PencilReservation.types.d.ts +20 -0
- package/dist/types/types/Booking/PencilReservation.types.d.ts.map +1 -0
- package/dist/types/types/Booking/PlaceBooking.types.d.ts +91 -0
- package/dist/types/types/Booking/PlaceBooking.types.d.ts.map +1 -0
- package/dist/types/types/Company/ECompanyProvider.enum.d.ts +10 -0
- package/dist/types/types/Company/ECompanyProvider.enum.d.ts.map +1 -0
- package/dist/types/types/Company/IAdminCompany.type.d.ts +53 -0
- package/dist/types/types/Company/IAdminCompany.type.d.ts.map +1 -0
- package/dist/types/types/Company/IAdminCompanyUser.type.d.ts +16 -0
- package/dist/types/types/Company/IAdminCompanyUser.type.d.ts.map +1 -0
- package/dist/types/types/Events/ERoomstayEventSource.enum.d.ts +5 -0
- package/dist/types/types/Events/ERoomstayEventSource.enum.d.ts.map +1 -0
- package/dist/types/types/Events/IRoomstayEvent.type.d.ts +51 -0
- package/dist/types/types/Events/IRoomstayEvent.type.d.ts.map +1 -0
- package/dist/types/types/Fees/EFeeType.enum.d.ts +8 -0
- package/dist/types/types/Fees/EFeeType.enum.d.ts.map +1 -0
- package/dist/types/types/Fees/IFee.type.d.ts +12 -0
- package/dist/types/types/Fees/IFee.type.d.ts.map +1 -0
- package/dist/types/types/Fees/IFeeConfigurationOptions.type.d.ts +7 -0
- package/dist/types/types/Fees/IFeeConfigurationOptions.type.d.ts.map +1 -0
- package/dist/types/types/General/Format.types.d.ts +2 -0
- package/dist/types/types/General/Format.types.d.ts.map +1 -0
- package/dist/types/types/General/HttpMethod.enum.d.ts +10 -0
- package/dist/types/types/General/HttpMethod.enum.d.ts.map +1 -0
- package/dist/types/types/General/IMessage.type.d.ts +7 -0
- package/dist/types/types/General/IMessage.type.d.ts.map +1 -0
- package/dist/types/types/General/Pagination.types.d.ts +21 -0
- package/dist/types/types/General/Pagination.types.d.ts.map +1 -0
- package/dist/types/types/General/Warning.type.d.ts +15 -0
- package/dist/types/types/General/Warning.type.d.ts.map +1 -0
- package/dist/types/types/GiftCards/GiftCard.types.d.ts +355 -0
- package/dist/types/types/GiftCards/GiftCard.types.d.ts.map +1 -0
- package/dist/types/types/GiftCards/GiftCardAuth.types.d.ts +32 -0
- package/dist/types/types/GiftCards/GiftCardAuth.types.d.ts.map +1 -0
- package/dist/types/types/GiftCards/GiftCardLogs.enum.d.ts +35 -0
- package/dist/types/types/GiftCards/GiftCardLogs.enum.d.ts.map +1 -0
- package/dist/types/types/Hotel/EHotelAddressRequirement.enum.d.ts +6 -0
- package/dist/types/types/Hotel/EHotelAddressRequirement.enum.d.ts.map +1 -0
- package/dist/types/types/Hotel/EHotelPriceModel.enum.d.ts +6 -0
- package/dist/types/types/Hotel/EHotelPriceModel.enum.d.ts.map +1 -0
- package/dist/types/types/Hotel/EHotelStateFieldConfiguration.enum.d.ts +6 -0
- package/dist/types/types/Hotel/EHotelStateFieldConfiguration.enum.d.ts.map +1 -0
- package/dist/types/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts +5 -0
- package/dist/types/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts.map +1 -0
- package/dist/types/types/Hotel/EIntegration.enum.d.ts +11 -0
- package/dist/types/types/Hotel/EIntegration.enum.d.ts.map +1 -0
- package/dist/types/types/Hotel/IAuxiliaryFilter.type.d.ts +25 -0
- package/dist/types/types/Hotel/IAuxiliaryFilter.type.d.ts.map +1 -0
- package/dist/types/types/Hotel/IHotelColorScheme.type.d.ts +30 -0
- package/dist/types/types/Hotel/IHotelColorScheme.type.d.ts.map +1 -0
- package/dist/types/types/Hotel/IHotelOverrides.type.d.ts +29 -0
- package/dist/types/types/Hotel/IHotelOverrides.type.d.ts.map +1 -0
- package/dist/types/types/Hotel/IHotelReplica.type.d.ts +57 -0
- package/dist/types/types/Hotel/IHotelReplica.type.d.ts.map +1 -0
- package/dist/types/types/Hotel/IHotelService.type.d.ts +7 -0
- package/dist/types/types/Hotel/IHotelService.type.d.ts.map +1 -0
- package/dist/types/types/Image/IRoomstayImage.type.d.ts +9 -0
- package/dist/types/types/Image/IRoomstayImage.type.d.ts.map +1 -0
- package/dist/types/types/Maintenance/IMaintenanceStatus.type.d.ts +30 -0
- package/dist/types/types/Maintenance/IMaintenanceStatus.type.d.ts.map +1 -0
- package/dist/types/types/Media/IMedia.type.d.ts +11 -0
- package/dist/types/types/Media/IMedia.type.d.ts.map +1 -0
- package/dist/types/types/Member/EMembershipProvider.type.d.ts +11 -0
- package/dist/types/types/Member/EMembershipProvider.type.d.ts.map +1 -0
- package/dist/types/types/Member/IMember.type.d.ts +8 -0
- package/dist/types/types/Member/IMember.type.d.ts.map +1 -0
- package/dist/types/types/Member/IMemberVerification.type.d.ts +11 -0
- package/dist/types/types/Member/IMemberVerification.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayCognitoMember.type.d.ts +5 -0
- package/dist/types/types/Member/IRoomstayCognitoMember.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMember.type.d.ts +20 -0
- package/dist/types/types/Member/IRoomstayMember.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMemberBooking.type.d.ts +29 -0
- package/dist/types/types/Member/IRoomstayMemberBooking.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMemberBookingAddress.type.d.ts +10 -0
- package/dist/types/types/Member/IRoomstayMemberBookingAddress.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMemberBookingItem.type.d.ts +26 -0
- package/dist/types/types/Member/IRoomstayMemberBookingItem.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMemberBookingProfile.type.d.ts +12 -0
- package/dist/types/types/Member/IRoomstayMemberBookingProfile.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMemberCards.type.d.ts +13 -0
- package/dist/types/types/Member/IRoomstayMemberCards.type.d.ts.map +1 -0
- package/dist/types/types/Member/IRoomstayMemberJWTData.type.d.ts +4 -0
- package/dist/types/types/Member/IRoomstayMemberJWTData.type.d.ts.map +1 -0
- package/dist/types/{Member → types/Member}/IRoomstayMemberLoyalty.type.d.ts +1 -0
- package/dist/types/types/Member/IRoomstayMemberLoyalty.type.d.ts.map +1 -0
- package/dist/types/types/Member/ISession.type.d.ts +5 -0
- package/dist/types/types/Member/ISession.type.d.ts.map +1 -0
- package/dist/types/types/Newbook/ENewbookRegion.enum.d.ts +8 -0
- package/dist/types/types/Newbook/ENewbookRegion.enum.d.ts.map +1 -0
- package/dist/types/types/Newbook/ENewbookSyncStrategy.enum.d.ts +8 -0
- package/dist/types/types/Newbook/ENewbookSyncStrategy.enum.d.ts.map +1 -0
- package/dist/types/types/Newbook/index.d.ts +3 -0
- package/dist/types/types/Newbook/index.d.ts.map +1 -0
- package/dist/types/types/OHIP/IOHIPConfiguration.types.d.ts +13 -0
- package/dist/types/types/OHIP/IOHIPConfiguration.types.d.ts.map +1 -0
- package/dist/types/types/OHIP/index.d.ts +2 -0
- package/dist/types/types/OHIP/index.d.ts.map +1 -0
- package/dist/types/{RMS/ERMSAuthSyncHistoryStatus.type.d.ts → types/PMSSync/EPMSSyncStatus.enum.d.ts} +4 -3
- package/dist/types/types/PMSSync/EPMSSyncStatus.enum.d.ts.map +1 -0
- package/dist/types/types/PMSSync/IPMSSyncResponse.type.d.ts +11 -0
- package/dist/types/types/PMSSync/IPMSSyncResponse.type.d.ts.map +1 -0
- package/dist/types/types/PMSSync/index.d.ts +18 -0
- package/dist/types/types/PMSSync/index.d.ts.map +1 -0
- package/dist/types/types/Package/Package.types.d.ts +105 -0
- package/dist/types/types/Package/Package.types.d.ts.map +1 -0
- package/dist/types/types/Policies/EGuaranteePolicy.enum.d.ts +12 -0
- package/dist/types/types/Policies/EGuaranteePolicy.enum.d.ts.map +1 -0
- package/dist/types/types/PromoCode/EPromoCodeDiscountType.enum.d.ts +7 -0
- package/dist/types/types/PromoCode/EPromoCodeDiscountType.enum.d.ts.map +1 -0
- package/dist/types/types/PromoCode/PromoCodeStayDateRangeType.enum.d.ts +12 -0
- package/dist/types/types/PromoCode/PromoCodeStayDateRangeType.enum.d.ts.map +1 -0
- package/dist/types/types/RMS/ERMSDiscountType.enum.d.ts +7 -0
- package/dist/types/types/RMS/ERMSDiscountType.enum.d.ts.map +1 -0
- package/dist/types/types/RMS/ERMSSyncStrategy.enum.d.ts +40 -0
- package/dist/types/types/RMS/ERMSSyncStrategy.enum.d.ts.map +1 -0
- package/dist/types/types/RMS/IRMSPropertyDiscount.type.d.ts +34 -0
- package/dist/types/types/RMS/IRMSPropertyDiscount.type.d.ts.map +1 -0
- package/dist/types/types/RMS/IRMSRequirement.type.d.ts +21 -0
- package/dist/types/types/RMS/IRMSRequirement.type.d.ts.map +1 -0
- package/dist/types/types/RMS/RMSBookingSource.type.d.ts +8 -0
- package/dist/types/types/RMS/RMSBookingSource.type.d.ts.map +1 -0
- package/dist/types/types/RMS/RMSGuestDTO.type.d.ts +51 -0
- package/dist/types/types/RMS/RMSGuestDTO.type.d.ts.map +1 -0
- package/dist/types/types/Room/IRoomGroup.type.d.ts +19 -0
- package/dist/types/types/Room/IRoomGroup.type.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +158 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/TotalCalculator.d.ts +73 -0
- package/dist/types/utils/TotalCalculator.d.ts.map +1 -0
- package/dist/types/utils/bookingTotal.d.ts +8 -0
- package/dist/types/utils/bookingTotal.d.ts.map +1 -0
- package/dist/types/utils/calculateFee.d.ts +11 -0
- package/dist/types/utils/calculateFee.d.ts.map +1 -0
- package/dist/types/utils/feeTypes.d.ts +6 -0
- package/dist/types/utils/feeTypes.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +11 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/reflection.d.ts +10 -0
- package/dist/types/utils/reflection.d.ts.map +1 -0
- package/dist/types/utils/roomstayImageResize.d.ts +15 -0
- package/dist/types/utils/roomstayImageResize.d.ts.map +1 -0
- package/dist/types/utils/roundMoney.d.ts +21 -0
- package/dist/types/utils/roundMoney.d.ts.map +1 -0
- package/dist/types/utils/typeUtils.d.ts +2 -0
- package/dist/types/utils/typeUtils.d.ts.map +1 -0
- package/dist/types/utils/uppercaseString.d.ts +2 -0
- package/dist/types/utils/uppercaseString.d.ts.map +1 -0
- package/dist/types/utils/zodUtils.d.ts +20 -0
- package/dist/types/utils/zodUtils.d.ts.map +1 -0
- package/dist/utils/roundMoney.d.ts +1 -11
- package/dist/web.js +1 -1
- package/package.json +1 -1
- package/dist/types/Addon/Addon.enum.d.ts +0 -14
- package/dist/types/Addon/Addon.type.d.ts +0 -24
- package/dist/types/Booking/IBookingStatus.type.d.ts +0 -5
- package/dist/types/Booking/IPrice.type.d.ts +0 -7
- package/dist/types/DisplayPolicy/EDisplayPolicyRuleType.enum.d.ts +0 -6
- package/dist/types/DisplayPolicy/ERuleType.d.ts +0 -6
- package/dist/types/DisplayPolicy/ERuleType.enum.d.ts +0 -6
- package/dist/types/DisplayPolicy/IDisplayPolicy.d.ts +0 -25
- package/dist/types/DisplayPolicy/IDisplayPolicy.type.d.ts +0 -28
- package/dist/types/Newbook/ENewbookDiscountType.enum.d.ts +0 -5
- package/dist/types/Newbook/INewbookDiscount.type.d.ts +0 -9
- package/dist/types/Newbook/INewbookInventoryItem.type.d.ts +0 -9
- package/dist/types/RMS/IRMSSyncResponse.type.d.ts +0 -8
|
@@ -0,0 +1,4005 @@
|
|
|
1
|
+
var Rt = /* @__PURE__ */ ((e) => (e.Pending = "Pending", e.Processing = "Processing", e.Committed = "Committed", e.Cancelled = "Cancelled", e.Reverted = "Reverted", e))(Rt || {}), Dt = /* @__PURE__ */ ((e) => (e.Default = "Default", e.PreCheckoutPencil = "PreCheckoutPencil", e.PostCheckoutPencil = "PostCheckoutPencil", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e.Number = "number", e.Text = "text", e.Date = "date", e.CarReg = "carreg", e))(Ft || {}), Et = /* @__PURE__ */ ((e) => (e.Card = "Card", e.SavedCard = "SavedCard", e.Planpay = "Planpay", e.Adyen = "Adyen", e.Afterpay = "Afterpay", e.PCIBookingCard = "PCIBookingCard", e.TrueRewards = "TrueRewards", e))(Et || {}), Ut = /* @__PURE__ */ ((e) => (e.Passthrough = "Passthrough", e.Adyen = "Adyen", e.Till = "Till", e.RMSPay = "RMSPay", e.Windcave = "Windcave", e.Mastercard = "Mastercard", e.Stripe = "Stripe", e.PayPal = "PayPal", e))(Ut || {}), yt = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.Unpaid = "unpaid", e.Accepted = "accepted", e.Cancelled = "cancelled", e.Refunded = "refunded", e.Rejected = "rejected", e))(yt || {});
|
|
2
|
+
const xc = [];
|
|
3
|
+
class qc {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.reservations = [];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class Bc {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.nights = {}, this.guestCounts = {
|
|
11
|
+
adults: 1,
|
|
12
|
+
children: 0
|
|
13
|
+
}, this.guest = new Lt();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class Lt {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.address = {};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
var jt = /* @__PURE__ */ ((e) => (e.Synxis = "Synxis", e.Availpro = "Availpro", e.RMS = "RMS", e.Siteminder = "Siteminder", e.Roomstay = "Roomstay", e.OHIP = "OHIP", e.Newbook = "Newbook", e))(jt || {}), xt = /* @__PURE__ */ ((e) => (e.SuperAdmin = "SuperAdmin", e.Admin = "Admin", e.Limited = "Limited", e))(xt || {}), qt = /* @__PURE__ */ ((e) => (e.FullAddressRequired = "FullAddressRequired", e.AddressOptionalCountryRequired = "AddressOptionalCountryRequired", e.AddressOptional = "AddressOptional", e))(qt || {}), Bt = /* @__PURE__ */ ((e) => (e.PerPerson = "PerPerson", e.PerDay = "PerDay", e.PerOccupancy = "PerOccupancy", e))(Bt || {}), St = /* @__PURE__ */ ((e) => (e.NotIncluded = "NotIncluded", e.Optional = "Optional", e.Required = "Required", e))(St || {}), Gt = /* @__PURE__ */ ((e) => (e.Monday = "monday", e.Sunday = "sunday", e))(Gt || {}), Vt = /* @__PURE__ */ ((e) => (e.Big4 = "Big4", e.RmsTop10 = "Top10", e.Top10 = "NewTop10", e.Gday = "Gday", e.Salesforce = "Salesforce", e.RAC = "RAC", e.AnalyticsEvents = "AnalyticsEvents", e.MemberJungle = "MemberJungle", e))(Vt || {}), Mt = /* @__PURE__ */ ((e) => (e.AreaDwellingLength = "AreaDwellingLength", e.AreaDwellingType = "AreaDwellingType", e))(Mt || {}), Ht = /* @__PURE__ */ ((e) => (e.Metric = "metric", e.Imperial = "imperial", e))(Ht || {}), Wt = /* @__PURE__ */ ((e) => (e.Percentage = "Percentage", e.Amount = "Amount", e.Bogo = "BOGO", e.NightlyRateOverride = "NightlyRateOverride", e))(Wt || {}), Yt = /* @__PURE__ */ ((e) => (e.Hotel = "hotel", e.HotelImages = "hotelImages", e.Cancellation = "cancellation", e.Room = "room", e.Rates = "rates", e.OneGuaranteePolicy = "oneGuaranteePolicy", e.RoomRates = "roomRates", e.RoomImages = "roomImages", e.BookingSources = "booking-sources", e.Areas = "areas", e.Dwellings = "dwellings", e.AreaDwellings = "areaDwellings", e.ConvertDwellingConfigToAuxInput = "convertDwellingConfigToAuxInput", e.Discounts = "discounts", e.PropertyDiscounts = "propertyDiscounts", e.RoomDiscounts = "roomDiscounts", e.PropertySundries = "propertySundries", e.PropertyFees = "propertyFees", e.PropertyCards = "property-cards", e.Countries = "countries", e.Addons = "addons", e.Requirements = "requirements", e.RoomAddons = "room-addons", e.ClientFacingPromoSync = "clientFacingPromoSync", e.ClientFacingRoomSync = "clientFacingRoomSync", e.ClientFacingRateSync = "clientFacingRateSync", e.ClientFacingAreaSync = "clientFacingAreaSync", e.NewRateFetch = "newRateFetch", e))(Yt || {}), Qt = /* @__PURE__ */ ((e) => (e.Australia = "au", e.AsiaPacific = "ap", e.Europe = "eu", e.UnitedStates = "us", e.Staging = "staging", e))(Qt || {}), Jt = /* @__PURE__ */ ((e) => (e.Rates = "rates", e.Rooms = "rooms", e.Availability = "availability", e.Details = "details", e.Tariffs = "tariffs", e))(Jt || {}), Kt = /* @__PURE__ */ ((e) => (e.New = "new", e.Queued = "queued", e.InProgress = "in_progress", e.Success = "success", e.Failure = "failure", e.RequireResume = "require_resume", e))(Kt || {}), Xt = /* @__PURE__ */ ((e) => (e.Success = "success", e.Failure = "failure", e.New = "new", e.Queued = "queued", e.InProgress = "in_progress", e.RequireResume = "require_resume", e))(Xt || {}), er = /* @__PURE__ */ ((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", e))(er || {}), nr = /* @__PURE__ */ ((e) => (e.Frontend = "frontend", e.Hotel = "hotel", e.Events = "events", e))(nr || {}), tr = /* @__PURE__ */ ((e) => (e.Big4 = "Big4", e.Gday = "Gday", e.Internal = "Internal", e.MemberJungle = "MemberJungle", e.RAC = "RAC", e.RmsTop10 = "RmsTop10", e.Salesforce = "Salesforce", e.Top10 = "Top10", e))(tr || {});
|
|
22
|
+
class rr {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.availability = {};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class Sc extends rr {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments), this.hideDatePicker = !1, this.hideQuantity = !1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
var ir = /* @__PURE__ */ ((e) => (e.Full = "Full", e.Percentage = "Percentage", e.FirstNight = "FirstNight", e.None = "None", e))(ir || {}), or = /* @__PURE__ */ ((e) => (e.FixedAmount = "fixed", e.Percentage = "percentage", e.Nights = "nights", e))(or || {}), sr = /* @__PURE__ */ ((e) => (e.FlatPercent = "flatPercent", e.FlatQuantity = "flatQuantity", e.FlatQuantityPerStay = "flatQuantityPerStay", e.FixedNightlyRate = "fixedNightlyRate", e))(sr || {}), ur = /* @__PURE__ */ ((e) => (e.Allowed = "Allowed", e.Blocked = "Blocked", e))(ur || {}), cr = /* @__PURE__ */ ((e) => (e.None = "None", e.Weekly = "Weekly", e.MonthlyDayOfWeek = "MonthlyDayOfWeek", e.MonthlyDate = "MonthlyDate", e.Yearly = "Yearly", e))(cr || {}), ar = /* @__PURE__ */ ((e) => (e.Eventbrite = "eventbrite", e.ATDW = "atdw", e))(ar || {});
|
|
33
|
+
const Gc = "DD/MM/YYYY";
|
|
34
|
+
var lr = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE", e.PATCH = "PATCH", e.OPTIONS = "OPTIONS", e.HEAD = "HEAD", e))(lr || {}), j = /* @__PURE__ */ ((e) => (e.PercentageOfBooking = "PercentageOfBooking", e.FixedChargePerRoom = "FixedChargePerRoom", e.NightlyChargePerRoom = "NightlyChargePerRoom", e.FixedChargePerBooking = "FixedChargePerBooking", e.DepositSurcharge = "DepositSurcharge", e))(j || {}), ve = /* @__PURE__ */ ((e) => (e.BasketAdd = "Basket/Add", e.BasketAddAddon = "Basket/AddAddon", e.ViewCheckout = "View/Checkout", e.BookingCommitted = "Booking/Committed", e))(ve || {});
|
|
35
|
+
const fr = [
|
|
36
|
+
"em",
|
|
37
|
+
// hashed email
|
|
38
|
+
"ph",
|
|
39
|
+
// hashed phone
|
|
40
|
+
"fn",
|
|
41
|
+
// hashed first name
|
|
42
|
+
"ln",
|
|
43
|
+
// hashed last name
|
|
44
|
+
"ct",
|
|
45
|
+
// hashed city
|
|
46
|
+
"st",
|
|
47
|
+
// hashed state
|
|
48
|
+
"zp",
|
|
49
|
+
// hashed zip
|
|
50
|
+
"country",
|
|
51
|
+
// hashed country
|
|
52
|
+
"external_id"
|
|
53
|
+
// not hashed
|
|
54
|
+
];
|
|
55
|
+
function Vc(e) {
|
|
56
|
+
return {
|
|
57
|
+
[ve.BasketAdd]: "AddToCart",
|
|
58
|
+
[ve.BasketAddAddon]: "AddToCart",
|
|
59
|
+
[ve.ViewCheckout]: "InitiateCheckout",
|
|
60
|
+
[ve.BookingCommitted]: "Purchase"
|
|
61
|
+
}[e];
|
|
62
|
+
}
|
|
63
|
+
function vn(e, n, t) {
|
|
64
|
+
let r = 0;
|
|
65
|
+
const i = [], o = [];
|
|
66
|
+
for (const s of e)
|
|
67
|
+
r += s.totalPrice, s.roomCode && (i.push(s.roomCode), o.push({
|
|
68
|
+
id: s.roomCode,
|
|
69
|
+
quantity: 1,
|
|
70
|
+
item_price: s.totalPrice
|
|
71
|
+
}));
|
|
72
|
+
if (n)
|
|
73
|
+
for (const s of n)
|
|
74
|
+
r += s.totalPrice, s.addonCode && (i.push(s.addonCode), o.push({
|
|
75
|
+
id: s.addonCode,
|
|
76
|
+
quantity: s.quantity,
|
|
77
|
+
item_price: s.unitPrice
|
|
78
|
+
}));
|
|
79
|
+
return {
|
|
80
|
+
currency: t,
|
|
81
|
+
value: r,
|
|
82
|
+
content_ids: i,
|
|
83
|
+
content_type: "hotel",
|
|
84
|
+
contents: o,
|
|
85
|
+
num_items: e.length + ((n == null ? void 0 : n.length) ?? 0)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function dr(e, n) {
|
|
89
|
+
return {
|
|
90
|
+
currency: n,
|
|
91
|
+
value: e.totalPrice,
|
|
92
|
+
content_ids: e.addonCode ? [e.addonCode] : [],
|
|
93
|
+
content_type: "hotel",
|
|
94
|
+
contents: e.addonCode ? [
|
|
95
|
+
{
|
|
96
|
+
id: e.addonCode,
|
|
97
|
+
quantity: e.quantity,
|
|
98
|
+
item_price: e.unitPrice
|
|
99
|
+
}
|
|
100
|
+
] : [],
|
|
101
|
+
num_items: 1
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function Mc(e) {
|
|
105
|
+
if ("addon" in e)
|
|
106
|
+
return dr(
|
|
107
|
+
e.addon,
|
|
108
|
+
e.currency
|
|
109
|
+
);
|
|
110
|
+
if ("item" in e)
|
|
111
|
+
return vn(
|
|
112
|
+
[e.item],
|
|
113
|
+
void 0,
|
|
114
|
+
e.currency
|
|
115
|
+
);
|
|
116
|
+
if ("items" in e) {
|
|
117
|
+
const n = e, t = vn(
|
|
118
|
+
n.items,
|
|
119
|
+
n.addons,
|
|
120
|
+
e.currency
|
|
121
|
+
);
|
|
122
|
+
return "itineraryNumber" in n && (t.order_id = n.itineraryNumber), t;
|
|
123
|
+
}
|
|
124
|
+
throw new Error("Invalid event data");
|
|
125
|
+
}
|
|
126
|
+
function Hc(e) {
|
|
127
|
+
return {
|
|
128
|
+
em: e.email,
|
|
129
|
+
ph: e.phone,
|
|
130
|
+
fn: e.firstName,
|
|
131
|
+
ln: e.lastName,
|
|
132
|
+
ct: e.city,
|
|
133
|
+
st: e.state,
|
|
134
|
+
zp: e.postalCode,
|
|
135
|
+
country: e.country,
|
|
136
|
+
external_id: e.externalId
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function Wc(e, n) {
|
|
140
|
+
const t = { eventID: e };
|
|
141
|
+
if (n)
|
|
142
|
+
for (const r of fr)
|
|
143
|
+
n[r] && (t[r] = n[r]);
|
|
144
|
+
return t;
|
|
145
|
+
}
|
|
146
|
+
function h(e, n, t) {
|
|
147
|
+
function r(u, c) {
|
|
148
|
+
var a;
|
|
149
|
+
Object.defineProperty(u, "_zod", {
|
|
150
|
+
value: u._zod ?? {},
|
|
151
|
+
enumerable: !1
|
|
152
|
+
}), (a = u._zod).traits ?? (a.traits = /* @__PURE__ */ new Set()), u._zod.traits.add(e), n(u, c);
|
|
153
|
+
for (const l in s.prototype)
|
|
154
|
+
l in u || Object.defineProperty(u, l, { value: s.prototype[l].bind(u) });
|
|
155
|
+
u._zod.constr = s, u._zod.def = c;
|
|
156
|
+
}
|
|
157
|
+
const i = (t == null ? void 0 : t.Parent) ?? Object;
|
|
158
|
+
class o extends i {
|
|
159
|
+
}
|
|
160
|
+
Object.defineProperty(o, "name", { value: e });
|
|
161
|
+
function s(u) {
|
|
162
|
+
var c;
|
|
163
|
+
const a = t != null && t.Parent ? new o() : this;
|
|
164
|
+
r(a, u), (c = a._zod).deferred ?? (c.deferred = []);
|
|
165
|
+
for (const l of a._zod.deferred)
|
|
166
|
+
l();
|
|
167
|
+
return a;
|
|
168
|
+
}
|
|
169
|
+
return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
170
|
+
value: (u) => {
|
|
171
|
+
var c, a;
|
|
172
|
+
return t != null && t.Parent && u instanceof t.Parent ? !0 : (a = (c = u == null ? void 0 : u._zod) == null ? void 0 : c.traits) == null ? void 0 : a.has(e);
|
|
173
|
+
}
|
|
174
|
+
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
175
|
+
}
|
|
176
|
+
class he extends Error {
|
|
177
|
+
constructor() {
|
|
178
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
class Bn extends Error {
|
|
182
|
+
constructor(n) {
|
|
183
|
+
super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const Je = {};
|
|
187
|
+
function ce(e) {
|
|
188
|
+
return e && Object.assign(Je, e), Je;
|
|
189
|
+
}
|
|
190
|
+
function hr(e) {
|
|
191
|
+
const n = Object.values(e).filter((r) => typeof r == "number");
|
|
192
|
+
return Object.entries(e).filter(([r, i]) => n.indexOf(+r) === -1).map(([r, i]) => i);
|
|
193
|
+
}
|
|
194
|
+
function Ke(e, n) {
|
|
195
|
+
return typeof n == "bigint" ? n.toString() : n;
|
|
196
|
+
}
|
|
197
|
+
function cn(e) {
|
|
198
|
+
return {
|
|
199
|
+
get value() {
|
|
200
|
+
{
|
|
201
|
+
const n = e();
|
|
202
|
+
return Object.defineProperty(this, "value", { value: n }), n;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function an(e) {
|
|
208
|
+
return e == null;
|
|
209
|
+
}
|
|
210
|
+
function ln(e) {
|
|
211
|
+
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
212
|
+
return e.slice(n, t);
|
|
213
|
+
}
|
|
214
|
+
function pr(e, n) {
|
|
215
|
+
const t = (e.toString().split(".")[1] || "").length, r = n.toString();
|
|
216
|
+
let i = (r.split(".")[1] || "").length;
|
|
217
|
+
if (i === 0 && /\d?e-\d?/.test(r)) {
|
|
218
|
+
const c = r.match(/\d?e-(\d?)/);
|
|
219
|
+
c != null && c[1] && (i = Number.parseInt(c[1]));
|
|
220
|
+
}
|
|
221
|
+
const o = t > i ? t : i, s = Number.parseInt(e.toFixed(o).replace(".", "")), u = Number.parseInt(n.toFixed(o).replace(".", ""));
|
|
222
|
+
return s % u / 10 ** o;
|
|
223
|
+
}
|
|
224
|
+
const wn = Symbol("evaluating");
|
|
225
|
+
function A(e, n, t) {
|
|
226
|
+
let r;
|
|
227
|
+
Object.defineProperty(e, n, {
|
|
228
|
+
get() {
|
|
229
|
+
if (r !== wn)
|
|
230
|
+
return r === void 0 && (r = wn, r = t()), r;
|
|
231
|
+
},
|
|
232
|
+
set(i) {
|
|
233
|
+
Object.defineProperty(e, n, {
|
|
234
|
+
value: i
|
|
235
|
+
// configurable: true,
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
configurable: !0
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
function mr(e) {
|
|
242
|
+
return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
|
|
243
|
+
}
|
|
244
|
+
function oe(e, n, t) {
|
|
245
|
+
Object.defineProperty(e, n, {
|
|
246
|
+
value: t,
|
|
247
|
+
writable: !0,
|
|
248
|
+
enumerable: !0,
|
|
249
|
+
configurable: !0
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function me(...e) {
|
|
253
|
+
const n = {};
|
|
254
|
+
for (const t of e) {
|
|
255
|
+
const r = Object.getOwnPropertyDescriptors(t);
|
|
256
|
+
Object.assign(n, r);
|
|
257
|
+
}
|
|
258
|
+
return Object.defineProperties({}, n);
|
|
259
|
+
}
|
|
260
|
+
function kn(e) {
|
|
261
|
+
return JSON.stringify(e);
|
|
262
|
+
}
|
|
263
|
+
const Sn = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
264
|
+
};
|
|
265
|
+
function De(e) {
|
|
266
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
267
|
+
}
|
|
268
|
+
const gr = cn(() => {
|
|
269
|
+
var e;
|
|
270
|
+
if (typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) != null && e.includes("Cloudflare")))
|
|
271
|
+
return !1;
|
|
272
|
+
try {
|
|
273
|
+
const n = Function;
|
|
274
|
+
return new n(""), !0;
|
|
275
|
+
} catch {
|
|
276
|
+
return !1;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
function ke(e) {
|
|
280
|
+
if (De(e) === !1)
|
|
281
|
+
return !1;
|
|
282
|
+
const n = e.constructor;
|
|
283
|
+
if (n === void 0)
|
|
284
|
+
return !0;
|
|
285
|
+
const t = n.prototype;
|
|
286
|
+
return !(De(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
287
|
+
}
|
|
288
|
+
function Gn(e) {
|
|
289
|
+
return ke(e) ? { ...e } : e;
|
|
290
|
+
}
|
|
291
|
+
const _r = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
292
|
+
function je(e) {
|
|
293
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
294
|
+
}
|
|
295
|
+
function se(e, n, t) {
|
|
296
|
+
const r = new e._zod.constr(n ?? e._zod.def);
|
|
297
|
+
return (!n || t != null && t.parent) && (r._zod.parent = e), r;
|
|
298
|
+
}
|
|
299
|
+
function _(e) {
|
|
300
|
+
const n = e;
|
|
301
|
+
if (!n)
|
|
302
|
+
return {};
|
|
303
|
+
if (typeof n == "string")
|
|
304
|
+
return { error: () => n };
|
|
305
|
+
if ((n == null ? void 0 : n.message) !== void 0) {
|
|
306
|
+
if ((n == null ? void 0 : n.error) !== void 0)
|
|
307
|
+
throw new Error("Cannot specify both `message` and `error` params");
|
|
308
|
+
n.error = n.message;
|
|
309
|
+
}
|
|
310
|
+
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
311
|
+
}
|
|
312
|
+
function vr(e) {
|
|
313
|
+
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
|
|
314
|
+
}
|
|
315
|
+
const wr = {
|
|
316
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
317
|
+
int32: [-2147483648, 2147483647],
|
|
318
|
+
uint32: [0, 4294967295],
|
|
319
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
320
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
321
|
+
};
|
|
322
|
+
function kr(e, n) {
|
|
323
|
+
const t = e._zod.def, r = me(e._zod.def, {
|
|
324
|
+
get shape() {
|
|
325
|
+
const i = {};
|
|
326
|
+
for (const o in n) {
|
|
327
|
+
if (!(o in t.shape))
|
|
328
|
+
throw new Error(`Unrecognized key: "${o}"`);
|
|
329
|
+
n[o] && (i[o] = t.shape[o]);
|
|
330
|
+
}
|
|
331
|
+
return oe(this, "shape", i), i;
|
|
332
|
+
},
|
|
333
|
+
checks: []
|
|
334
|
+
});
|
|
335
|
+
return se(e, r);
|
|
336
|
+
}
|
|
337
|
+
function Nr(e, n) {
|
|
338
|
+
const t = e._zod.def, r = me(e._zod.def, {
|
|
339
|
+
get shape() {
|
|
340
|
+
const i = { ...e._zod.def.shape };
|
|
341
|
+
for (const o in n) {
|
|
342
|
+
if (!(o in t.shape))
|
|
343
|
+
throw new Error(`Unrecognized key: "${o}"`);
|
|
344
|
+
n[o] && delete i[o];
|
|
345
|
+
}
|
|
346
|
+
return oe(this, "shape", i), i;
|
|
347
|
+
},
|
|
348
|
+
checks: []
|
|
349
|
+
});
|
|
350
|
+
return se(e, r);
|
|
351
|
+
}
|
|
352
|
+
function br(e, n) {
|
|
353
|
+
if (!ke(n))
|
|
354
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
355
|
+
const t = e._zod.def.checks;
|
|
356
|
+
if (t && t.length > 0)
|
|
357
|
+
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
358
|
+
const i = me(e._zod.def, {
|
|
359
|
+
get shape() {
|
|
360
|
+
const o = { ...e._zod.def.shape, ...n };
|
|
361
|
+
return oe(this, "shape", o), o;
|
|
362
|
+
},
|
|
363
|
+
checks: []
|
|
364
|
+
});
|
|
365
|
+
return se(e, i);
|
|
366
|
+
}
|
|
367
|
+
function Pr(e, n) {
|
|
368
|
+
if (!ke(n))
|
|
369
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
370
|
+
const t = {
|
|
371
|
+
...e._zod.def,
|
|
372
|
+
get shape() {
|
|
373
|
+
const r = { ...e._zod.def.shape, ...n };
|
|
374
|
+
return oe(this, "shape", r), r;
|
|
375
|
+
},
|
|
376
|
+
checks: e._zod.def.checks
|
|
377
|
+
};
|
|
378
|
+
return se(e, t);
|
|
379
|
+
}
|
|
380
|
+
function zr(e, n) {
|
|
381
|
+
const t = me(e._zod.def, {
|
|
382
|
+
get shape() {
|
|
383
|
+
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
|
|
384
|
+
return oe(this, "shape", r), r;
|
|
385
|
+
},
|
|
386
|
+
get catchall() {
|
|
387
|
+
return n._zod.def.catchall;
|
|
388
|
+
},
|
|
389
|
+
checks: []
|
|
390
|
+
// delete existing checks
|
|
391
|
+
});
|
|
392
|
+
return se(e, t);
|
|
393
|
+
}
|
|
394
|
+
function Zr(e, n, t) {
|
|
395
|
+
const r = me(n._zod.def, {
|
|
396
|
+
get shape() {
|
|
397
|
+
const i = n._zod.def.shape, o = { ...i };
|
|
398
|
+
if (t)
|
|
399
|
+
for (const s in t) {
|
|
400
|
+
if (!(s in i))
|
|
401
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
402
|
+
t[s] && (o[s] = e ? new e({
|
|
403
|
+
type: "optional",
|
|
404
|
+
innerType: i[s]
|
|
405
|
+
}) : i[s]);
|
|
406
|
+
}
|
|
407
|
+
else
|
|
408
|
+
for (const s in i)
|
|
409
|
+
o[s] = e ? new e({
|
|
410
|
+
type: "optional",
|
|
411
|
+
innerType: i[s]
|
|
412
|
+
}) : i[s];
|
|
413
|
+
return oe(this, "shape", o), o;
|
|
414
|
+
},
|
|
415
|
+
checks: []
|
|
416
|
+
});
|
|
417
|
+
return se(n, r);
|
|
418
|
+
}
|
|
419
|
+
function Ar(e, n, t) {
|
|
420
|
+
const r = me(n._zod.def, {
|
|
421
|
+
get shape() {
|
|
422
|
+
const i = n._zod.def.shape, o = { ...i };
|
|
423
|
+
if (t)
|
|
424
|
+
for (const s in t) {
|
|
425
|
+
if (!(s in o))
|
|
426
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
427
|
+
t[s] && (o[s] = new e({
|
|
428
|
+
type: "nonoptional",
|
|
429
|
+
innerType: i[s]
|
|
430
|
+
}));
|
|
431
|
+
}
|
|
432
|
+
else
|
|
433
|
+
for (const s in i)
|
|
434
|
+
o[s] = new e({
|
|
435
|
+
type: "nonoptional",
|
|
436
|
+
innerType: i[s]
|
|
437
|
+
});
|
|
438
|
+
return oe(this, "shape", o), o;
|
|
439
|
+
},
|
|
440
|
+
checks: []
|
|
441
|
+
});
|
|
442
|
+
return se(n, r);
|
|
443
|
+
}
|
|
444
|
+
function fe(e, n = 0) {
|
|
445
|
+
var t;
|
|
446
|
+
if (e.aborted === !0)
|
|
447
|
+
return !0;
|
|
448
|
+
for (let r = n; r < e.issues.length; r++)
|
|
449
|
+
if (((t = e.issues[r]) == null ? void 0 : t.continue) !== !0)
|
|
450
|
+
return !0;
|
|
451
|
+
return !1;
|
|
452
|
+
}
|
|
453
|
+
function Vn(e, n) {
|
|
454
|
+
return n.map((t) => {
|
|
455
|
+
var r;
|
|
456
|
+
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
function $e(e) {
|
|
460
|
+
return typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
461
|
+
}
|
|
462
|
+
function ae(e, n, t) {
|
|
463
|
+
var i, o, s, u, c, a;
|
|
464
|
+
const r = { ...e, path: e.path ?? [] };
|
|
465
|
+
if (!e.message) {
|
|
466
|
+
const l = $e((s = (o = (i = e.inst) == null ? void 0 : i._zod.def) == null ? void 0 : o.error) == null ? void 0 : s.call(o, e)) ?? $e((u = n == null ? void 0 : n.error) == null ? void 0 : u.call(n, e)) ?? $e((c = t.customError) == null ? void 0 : c.call(t, e)) ?? $e((a = t.localeError) == null ? void 0 : a.call(t, e)) ?? "Invalid input";
|
|
467
|
+
r.message = l;
|
|
468
|
+
}
|
|
469
|
+
return delete r.inst, delete r.continue, n != null && n.reportInput || delete r.input, r;
|
|
470
|
+
}
|
|
471
|
+
function fn(e) {
|
|
472
|
+
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
473
|
+
}
|
|
474
|
+
function Ne(...e) {
|
|
475
|
+
const [n, t, r] = e;
|
|
476
|
+
return typeof n == "string" ? {
|
|
477
|
+
message: n,
|
|
478
|
+
code: "custom",
|
|
479
|
+
input: t,
|
|
480
|
+
inst: r
|
|
481
|
+
} : { ...n };
|
|
482
|
+
}
|
|
483
|
+
const Mn = (e, n) => {
|
|
484
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
485
|
+
value: e._zod,
|
|
486
|
+
enumerable: !1
|
|
487
|
+
}), Object.defineProperty(e, "issues", {
|
|
488
|
+
value: n,
|
|
489
|
+
enumerable: !1
|
|
490
|
+
}), e.message = JSON.stringify(n, Ke, 2), Object.defineProperty(e, "toString", {
|
|
491
|
+
value: () => e.message,
|
|
492
|
+
enumerable: !1
|
|
493
|
+
});
|
|
494
|
+
}, Hn = h("$ZodError", Mn), Wn = h("$ZodError", Mn, { Parent: Error });
|
|
495
|
+
function $r(e, n = (t) => t.message) {
|
|
496
|
+
const t = {}, r = [];
|
|
497
|
+
for (const i of e.issues)
|
|
498
|
+
i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(n(i))) : r.push(n(i));
|
|
499
|
+
return { formErrors: r, fieldErrors: t };
|
|
500
|
+
}
|
|
501
|
+
function Ir(e, n) {
|
|
502
|
+
const t = n || function(o) {
|
|
503
|
+
return o.message;
|
|
504
|
+
}, r = { _errors: [] }, i = (o) => {
|
|
505
|
+
for (const s of o.issues)
|
|
506
|
+
if (s.code === "invalid_union" && s.errors.length)
|
|
507
|
+
s.errors.map((u) => i({ issues: u }));
|
|
508
|
+
else if (s.code === "invalid_key")
|
|
509
|
+
i({ issues: s.issues });
|
|
510
|
+
else if (s.code === "invalid_element")
|
|
511
|
+
i({ issues: s.issues });
|
|
512
|
+
else if (s.path.length === 0)
|
|
513
|
+
r._errors.push(t(s));
|
|
514
|
+
else {
|
|
515
|
+
let u = r, c = 0;
|
|
516
|
+
for (; c < s.path.length; ) {
|
|
517
|
+
const a = s.path[c];
|
|
518
|
+
c === s.path.length - 1 ? (u[a] = u[a] || { _errors: [] }, u[a]._errors.push(t(s))) : u[a] = u[a] || { _errors: [] }, u = u[a], c++;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
return i(e), r;
|
|
523
|
+
}
|
|
524
|
+
const dn = (e) => (n, t, r, i) => {
|
|
525
|
+
const o = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
|
|
526
|
+
if (s instanceof Promise)
|
|
527
|
+
throw new he();
|
|
528
|
+
if (s.issues.length) {
|
|
529
|
+
const u = new ((i == null ? void 0 : i.Err) ?? e)(s.issues.map((c) => ae(c, o, ce())));
|
|
530
|
+
throw Sn(u, i == null ? void 0 : i.callee), u;
|
|
531
|
+
}
|
|
532
|
+
return s.value;
|
|
533
|
+
}, hn = (e) => async (n, t, r, i) => {
|
|
534
|
+
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
535
|
+
let s = n._zod.run({ value: t, issues: [] }, o);
|
|
536
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
537
|
+
const u = new ((i == null ? void 0 : i.Err) ?? e)(s.issues.map((c) => ae(c, o, ce())));
|
|
538
|
+
throw Sn(u, i == null ? void 0 : i.callee), u;
|
|
539
|
+
}
|
|
540
|
+
return s.value;
|
|
541
|
+
}, xe = (e) => (n, t, r) => {
|
|
542
|
+
const i = r ? { ...r, async: !1 } : { async: !1 }, o = n._zod.run({ value: t, issues: [] }, i);
|
|
543
|
+
if (o instanceof Promise)
|
|
544
|
+
throw new he();
|
|
545
|
+
return o.issues.length ? {
|
|
546
|
+
success: !1,
|
|
547
|
+
error: new (e ?? Hn)(o.issues.map((s) => ae(s, i, ce())))
|
|
548
|
+
} : { success: !0, data: o.value };
|
|
549
|
+
}, Or = /* @__PURE__ */ xe(Wn), qe = (e) => async (n, t, r) => {
|
|
550
|
+
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
551
|
+
let o = n._zod.run({ value: t, issues: [] }, i);
|
|
552
|
+
return o instanceof Promise && (o = await o), o.issues.length ? {
|
|
553
|
+
success: !1,
|
|
554
|
+
error: new e(o.issues.map((s) => ae(s, i, ce())))
|
|
555
|
+
} : { success: !0, data: o.value };
|
|
556
|
+
}, Cr = /* @__PURE__ */ qe(Wn), Tr = (e) => (n, t, r) => {
|
|
557
|
+
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
558
|
+
return dn(e)(n, t, i);
|
|
559
|
+
}, Rr = (e) => (n, t, r) => dn(e)(n, t, r), Dr = (e) => async (n, t, r) => {
|
|
560
|
+
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
561
|
+
return hn(e)(n, t, i);
|
|
562
|
+
}, Fr = (e) => async (n, t, r) => hn(e)(n, t, r), Er = (e) => (n, t, r) => {
|
|
563
|
+
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
564
|
+
return xe(e)(n, t, i);
|
|
565
|
+
}, Ur = (e) => (n, t, r) => xe(e)(n, t, r), yr = (e) => async (n, t, r) => {
|
|
566
|
+
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
567
|
+
return qe(e)(n, t, i);
|
|
568
|
+
}, Lr = (e) => async (n, t, r) => qe(e)(n, t, r), jr = /^[cC][^\s-]{8,}$/, xr = /^[0-9a-z]+$/, qr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Br = /^[0-9a-vA-V]{20}$/, Sr = /^[A-Za-z0-9]{27}$/, Gr = /^[a-zA-Z0-9_-]{21}$/, Vr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Mr = /^([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})$/, Nn = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Hr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Wr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
569
|
+
function Yr() {
|
|
570
|
+
return new RegExp(Wr, "u");
|
|
571
|
+
}
|
|
572
|
+
const Qr = /^(?:(?: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])$/, Jr = /^(([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})$/, Kr = /^((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])$/, Xr = /^(([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])$/, ei = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Yn = /^[A-Za-z0-9_-]*$/, ni = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, ti = /^\+(?:[0-9]){6,14}[0-9]$/, Qn = "(?:(?:\\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])))", ri = /* @__PURE__ */ new RegExp(`^${Qn}$`);
|
|
573
|
+
function Jn(e) {
|
|
574
|
+
const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
575
|
+
return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
576
|
+
}
|
|
577
|
+
function ii(e) {
|
|
578
|
+
return new RegExp(`^${Jn(e)}$`);
|
|
579
|
+
}
|
|
580
|
+
function oi(e) {
|
|
581
|
+
const n = Jn({ precision: e.precision }), t = ["Z"];
|
|
582
|
+
e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
583
|
+
const r = `${n}(?:${t.join("|")})`;
|
|
584
|
+
return new RegExp(`^${Qn}T(?:${r})$`);
|
|
585
|
+
}
|
|
586
|
+
const si = (e) => {
|
|
587
|
+
const n = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
|
|
588
|
+
return new RegExp(`^${n}$`);
|
|
589
|
+
}, ui = /^\d+$/, ci = /^-?\d+(?:\.\d+)?/i, ai = /true|false/i, li = /^[^A-Z]*$/, fi = /^[^a-z]*$/, S = /* @__PURE__ */ h("$ZodCheck", (e, n) => {
|
|
590
|
+
var t;
|
|
591
|
+
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
592
|
+
}), Kn = {
|
|
593
|
+
number: "number",
|
|
594
|
+
bigint: "bigint",
|
|
595
|
+
object: "date"
|
|
596
|
+
}, Xn = /* @__PURE__ */ h("$ZodCheckLessThan", (e, n) => {
|
|
597
|
+
S.init(e, n);
|
|
598
|
+
const t = Kn[typeof n.value];
|
|
599
|
+
e._zod.onattach.push((r) => {
|
|
600
|
+
const i = r._zod.bag, o = (n.inclusive ? i.maximum : i.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
601
|
+
n.value < o && (n.inclusive ? i.maximum = n.value : i.exclusiveMaximum = n.value);
|
|
602
|
+
}), e._zod.check = (r) => {
|
|
603
|
+
(n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
|
|
604
|
+
origin: t,
|
|
605
|
+
code: "too_big",
|
|
606
|
+
maximum: n.value,
|
|
607
|
+
input: r.value,
|
|
608
|
+
inclusive: n.inclusive,
|
|
609
|
+
inst: e,
|
|
610
|
+
continue: !n.abort
|
|
611
|
+
});
|
|
612
|
+
};
|
|
613
|
+
}), et = /* @__PURE__ */ h("$ZodCheckGreaterThan", (e, n) => {
|
|
614
|
+
S.init(e, n);
|
|
615
|
+
const t = Kn[typeof n.value];
|
|
616
|
+
e._zod.onattach.push((r) => {
|
|
617
|
+
const i = r._zod.bag, o = (n.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
618
|
+
n.value > o && (n.inclusive ? i.minimum = n.value : i.exclusiveMinimum = n.value);
|
|
619
|
+
}), e._zod.check = (r) => {
|
|
620
|
+
(n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
|
|
621
|
+
origin: t,
|
|
622
|
+
code: "too_small",
|
|
623
|
+
minimum: n.value,
|
|
624
|
+
input: r.value,
|
|
625
|
+
inclusive: n.inclusive,
|
|
626
|
+
inst: e,
|
|
627
|
+
continue: !n.abort
|
|
628
|
+
});
|
|
629
|
+
};
|
|
630
|
+
}), di = /* @__PURE__ */ h("$ZodCheckMultipleOf", (e, n) => {
|
|
631
|
+
S.init(e, n), e._zod.onattach.push((t) => {
|
|
632
|
+
var r;
|
|
633
|
+
(r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
|
|
634
|
+
}), e._zod.check = (t) => {
|
|
635
|
+
if (typeof t.value != typeof n.value)
|
|
636
|
+
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
637
|
+
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : pr(t.value, n.value) === 0) || t.issues.push({
|
|
638
|
+
origin: typeof t.value,
|
|
639
|
+
code: "not_multiple_of",
|
|
640
|
+
divisor: n.value,
|
|
641
|
+
input: t.value,
|
|
642
|
+
inst: e,
|
|
643
|
+
continue: !n.abort
|
|
644
|
+
});
|
|
645
|
+
};
|
|
646
|
+
}), hi = /* @__PURE__ */ h("$ZodCheckNumberFormat", (e, n) => {
|
|
647
|
+
var s;
|
|
648
|
+
S.init(e, n), n.format = n.format || "float64";
|
|
649
|
+
const t = (s = n.format) == null ? void 0 : s.includes("int"), r = t ? "int" : "number", [i, o] = wr[n.format];
|
|
650
|
+
e._zod.onattach.push((u) => {
|
|
651
|
+
const c = u._zod.bag;
|
|
652
|
+
c.format = n.format, c.minimum = i, c.maximum = o, t && (c.pattern = ui);
|
|
653
|
+
}), e._zod.check = (u) => {
|
|
654
|
+
const c = u.value;
|
|
655
|
+
if (t) {
|
|
656
|
+
if (!Number.isInteger(c)) {
|
|
657
|
+
u.issues.push({
|
|
658
|
+
expected: r,
|
|
659
|
+
format: n.format,
|
|
660
|
+
code: "invalid_type",
|
|
661
|
+
continue: !1,
|
|
662
|
+
input: c,
|
|
663
|
+
inst: e
|
|
664
|
+
});
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
if (!Number.isSafeInteger(c)) {
|
|
668
|
+
c > 0 ? u.issues.push({
|
|
669
|
+
input: c,
|
|
670
|
+
code: "too_big",
|
|
671
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
672
|
+
note: "Integers must be within the safe integer range.",
|
|
673
|
+
inst: e,
|
|
674
|
+
origin: r,
|
|
675
|
+
continue: !n.abort
|
|
676
|
+
}) : u.issues.push({
|
|
677
|
+
input: c,
|
|
678
|
+
code: "too_small",
|
|
679
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
680
|
+
note: "Integers must be within the safe integer range.",
|
|
681
|
+
inst: e,
|
|
682
|
+
origin: r,
|
|
683
|
+
continue: !n.abort
|
|
684
|
+
});
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
c < i && u.issues.push({
|
|
689
|
+
origin: "number",
|
|
690
|
+
input: c,
|
|
691
|
+
code: "too_small",
|
|
692
|
+
minimum: i,
|
|
693
|
+
inclusive: !0,
|
|
694
|
+
inst: e,
|
|
695
|
+
continue: !n.abort
|
|
696
|
+
}), c > o && u.issues.push({
|
|
697
|
+
origin: "number",
|
|
698
|
+
input: c,
|
|
699
|
+
code: "too_big",
|
|
700
|
+
maximum: o,
|
|
701
|
+
inst: e
|
|
702
|
+
});
|
|
703
|
+
};
|
|
704
|
+
}), pi = /* @__PURE__ */ h("$ZodCheckMaxLength", (e, n) => {
|
|
705
|
+
var t;
|
|
706
|
+
S.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
707
|
+
const i = r.value;
|
|
708
|
+
return !an(i) && i.length !== void 0;
|
|
709
|
+
}), e._zod.onattach.push((r) => {
|
|
710
|
+
const i = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
711
|
+
n.maximum < i && (r._zod.bag.maximum = n.maximum);
|
|
712
|
+
}), e._zod.check = (r) => {
|
|
713
|
+
const i = r.value;
|
|
714
|
+
if (i.length <= n.maximum)
|
|
715
|
+
return;
|
|
716
|
+
const s = fn(i);
|
|
717
|
+
r.issues.push({
|
|
718
|
+
origin: s,
|
|
719
|
+
code: "too_big",
|
|
720
|
+
maximum: n.maximum,
|
|
721
|
+
inclusive: !0,
|
|
722
|
+
input: i,
|
|
723
|
+
inst: e,
|
|
724
|
+
continue: !n.abort
|
|
725
|
+
});
|
|
726
|
+
};
|
|
727
|
+
}), mi = /* @__PURE__ */ h("$ZodCheckMinLength", (e, n) => {
|
|
728
|
+
var t;
|
|
729
|
+
S.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
730
|
+
const i = r.value;
|
|
731
|
+
return !an(i) && i.length !== void 0;
|
|
732
|
+
}), e._zod.onattach.push((r) => {
|
|
733
|
+
const i = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
734
|
+
n.minimum > i && (r._zod.bag.minimum = n.minimum);
|
|
735
|
+
}), e._zod.check = (r) => {
|
|
736
|
+
const i = r.value;
|
|
737
|
+
if (i.length >= n.minimum)
|
|
738
|
+
return;
|
|
739
|
+
const s = fn(i);
|
|
740
|
+
r.issues.push({
|
|
741
|
+
origin: s,
|
|
742
|
+
code: "too_small",
|
|
743
|
+
minimum: n.minimum,
|
|
744
|
+
inclusive: !0,
|
|
745
|
+
input: i,
|
|
746
|
+
inst: e,
|
|
747
|
+
continue: !n.abort
|
|
748
|
+
});
|
|
749
|
+
};
|
|
750
|
+
}), gi = /* @__PURE__ */ h("$ZodCheckLengthEquals", (e, n) => {
|
|
751
|
+
var t;
|
|
752
|
+
S.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
753
|
+
const i = r.value;
|
|
754
|
+
return !an(i) && i.length !== void 0;
|
|
755
|
+
}), e._zod.onattach.push((r) => {
|
|
756
|
+
const i = r._zod.bag;
|
|
757
|
+
i.minimum = n.length, i.maximum = n.length, i.length = n.length;
|
|
758
|
+
}), e._zod.check = (r) => {
|
|
759
|
+
const i = r.value, o = i.length;
|
|
760
|
+
if (o === n.length)
|
|
761
|
+
return;
|
|
762
|
+
const s = fn(i), u = o > n.length;
|
|
763
|
+
r.issues.push({
|
|
764
|
+
origin: s,
|
|
765
|
+
...u ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
|
|
766
|
+
inclusive: !0,
|
|
767
|
+
exact: !0,
|
|
768
|
+
input: r.value,
|
|
769
|
+
inst: e,
|
|
770
|
+
continue: !n.abort
|
|
771
|
+
});
|
|
772
|
+
};
|
|
773
|
+
}), Be = /* @__PURE__ */ h("$ZodCheckStringFormat", (e, n) => {
|
|
774
|
+
var t, r;
|
|
775
|
+
S.init(e, n), e._zod.onattach.push((i) => {
|
|
776
|
+
const o = i._zod.bag;
|
|
777
|
+
o.format = n.format, n.pattern && (o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n.pattern));
|
|
778
|
+
}), n.pattern ? (t = e._zod).check ?? (t.check = (i) => {
|
|
779
|
+
n.pattern.lastIndex = 0, !n.pattern.test(i.value) && i.issues.push({
|
|
780
|
+
origin: "string",
|
|
781
|
+
code: "invalid_format",
|
|
782
|
+
format: n.format,
|
|
783
|
+
input: i.value,
|
|
784
|
+
...n.pattern ? { pattern: n.pattern.toString() } : {},
|
|
785
|
+
inst: e,
|
|
786
|
+
continue: !n.abort
|
|
787
|
+
});
|
|
788
|
+
}) : (r = e._zod).check ?? (r.check = () => {
|
|
789
|
+
});
|
|
790
|
+
}), _i = /* @__PURE__ */ h("$ZodCheckRegex", (e, n) => {
|
|
791
|
+
Be.init(e, n), e._zod.check = (t) => {
|
|
792
|
+
n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
|
|
793
|
+
origin: "string",
|
|
794
|
+
code: "invalid_format",
|
|
795
|
+
format: "regex",
|
|
796
|
+
input: t.value,
|
|
797
|
+
pattern: n.pattern.toString(),
|
|
798
|
+
inst: e,
|
|
799
|
+
continue: !n.abort
|
|
800
|
+
});
|
|
801
|
+
};
|
|
802
|
+
}), vi = /* @__PURE__ */ h("$ZodCheckLowerCase", (e, n) => {
|
|
803
|
+
n.pattern ?? (n.pattern = li), Be.init(e, n);
|
|
804
|
+
}), wi = /* @__PURE__ */ h("$ZodCheckUpperCase", (e, n) => {
|
|
805
|
+
n.pattern ?? (n.pattern = fi), Be.init(e, n);
|
|
806
|
+
}), ki = /* @__PURE__ */ h("$ZodCheckIncludes", (e, n) => {
|
|
807
|
+
S.init(e, n);
|
|
808
|
+
const t = je(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
|
|
809
|
+
n.pattern = r, e._zod.onattach.push((i) => {
|
|
810
|
+
const o = i._zod.bag;
|
|
811
|
+
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(r);
|
|
812
|
+
}), e._zod.check = (i) => {
|
|
813
|
+
i.value.includes(n.includes, n.position) || i.issues.push({
|
|
814
|
+
origin: "string",
|
|
815
|
+
code: "invalid_format",
|
|
816
|
+
format: "includes",
|
|
817
|
+
includes: n.includes,
|
|
818
|
+
input: i.value,
|
|
819
|
+
inst: e,
|
|
820
|
+
continue: !n.abort
|
|
821
|
+
});
|
|
822
|
+
};
|
|
823
|
+
}), Ni = /* @__PURE__ */ h("$ZodCheckStartsWith", (e, n) => {
|
|
824
|
+
S.init(e, n);
|
|
825
|
+
const t = new RegExp(`^${je(n.prefix)}.*`);
|
|
826
|
+
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
|
|
827
|
+
const i = r._zod.bag;
|
|
828
|
+
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t);
|
|
829
|
+
}), e._zod.check = (r) => {
|
|
830
|
+
r.value.startsWith(n.prefix) || r.issues.push({
|
|
831
|
+
origin: "string",
|
|
832
|
+
code: "invalid_format",
|
|
833
|
+
format: "starts_with",
|
|
834
|
+
prefix: n.prefix,
|
|
835
|
+
input: r.value,
|
|
836
|
+
inst: e,
|
|
837
|
+
continue: !n.abort
|
|
838
|
+
});
|
|
839
|
+
};
|
|
840
|
+
}), bi = /* @__PURE__ */ h("$ZodCheckEndsWith", (e, n) => {
|
|
841
|
+
S.init(e, n);
|
|
842
|
+
const t = new RegExp(`.*${je(n.suffix)}$`);
|
|
843
|
+
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
|
|
844
|
+
const i = r._zod.bag;
|
|
845
|
+
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t);
|
|
846
|
+
}), e._zod.check = (r) => {
|
|
847
|
+
r.value.endsWith(n.suffix) || r.issues.push({
|
|
848
|
+
origin: "string",
|
|
849
|
+
code: "invalid_format",
|
|
850
|
+
format: "ends_with",
|
|
851
|
+
suffix: n.suffix,
|
|
852
|
+
input: r.value,
|
|
853
|
+
inst: e,
|
|
854
|
+
continue: !n.abort
|
|
855
|
+
});
|
|
856
|
+
};
|
|
857
|
+
}), Pi = /* @__PURE__ */ h("$ZodCheckOverwrite", (e, n) => {
|
|
858
|
+
S.init(e, n), e._zod.check = (t) => {
|
|
859
|
+
t.value = n.tx(t.value);
|
|
860
|
+
};
|
|
861
|
+
});
|
|
862
|
+
class zi {
|
|
863
|
+
constructor(n = []) {
|
|
864
|
+
this.content = [], this.indent = 0, this && (this.args = n);
|
|
865
|
+
}
|
|
866
|
+
indented(n) {
|
|
867
|
+
this.indent += 1, n(this), this.indent -= 1;
|
|
868
|
+
}
|
|
869
|
+
write(n) {
|
|
870
|
+
if (typeof n == "function") {
|
|
871
|
+
n(this, { execution: "sync" }), n(this, { execution: "async" });
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
const r = n.split(`
|
|
875
|
+
`).filter((s) => s), i = Math.min(...r.map((s) => s.length - s.trimStart().length)), o = r.map((s) => s.slice(i)).map((s) => " ".repeat(this.indent * 2) + s);
|
|
876
|
+
for (const s of o)
|
|
877
|
+
this.content.push(s);
|
|
878
|
+
}
|
|
879
|
+
compile() {
|
|
880
|
+
const n = Function, t = this == null ? void 0 : this.args, i = [...((this == null ? void 0 : this.content) ?? [""]).map((o) => ` ${o}`)];
|
|
881
|
+
return new n(...t, i.join(`
|
|
882
|
+
`));
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
const Zi = {
|
|
886
|
+
major: 4,
|
|
887
|
+
minor: 1,
|
|
888
|
+
patch: 5
|
|
889
|
+
}, T = /* @__PURE__ */ h("$ZodType", (e, n) => {
|
|
890
|
+
var i;
|
|
891
|
+
var t;
|
|
892
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Zi;
|
|
893
|
+
const r = [...e._zod.def.checks ?? []];
|
|
894
|
+
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
895
|
+
for (const o of r)
|
|
896
|
+
for (const s of o._zod.onattach)
|
|
897
|
+
s(e);
|
|
898
|
+
if (r.length === 0)
|
|
899
|
+
(t = e._zod).deferred ?? (t.deferred = []), (i = e._zod.deferred) == null || i.push(() => {
|
|
900
|
+
e._zod.run = e._zod.parse;
|
|
901
|
+
});
|
|
902
|
+
else {
|
|
903
|
+
const o = (u, c, a) => {
|
|
904
|
+
let l = fe(u), f;
|
|
905
|
+
for (const d of c) {
|
|
906
|
+
if (d._zod.def.when) {
|
|
907
|
+
if (!d._zod.def.when(u))
|
|
908
|
+
continue;
|
|
909
|
+
} else if (l)
|
|
910
|
+
continue;
|
|
911
|
+
const m = u.issues.length, k = d._zod.check(u);
|
|
912
|
+
if (k instanceof Promise && (a == null ? void 0 : a.async) === !1)
|
|
913
|
+
throw new he();
|
|
914
|
+
if (f || k instanceof Promise)
|
|
915
|
+
f = (f ?? Promise.resolve()).then(async () => {
|
|
916
|
+
await k, u.issues.length !== m && (l || (l = fe(u, m)));
|
|
917
|
+
});
|
|
918
|
+
else {
|
|
919
|
+
if (u.issues.length === m)
|
|
920
|
+
continue;
|
|
921
|
+
l || (l = fe(u, m));
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
return f ? f.then(() => u) : u;
|
|
925
|
+
}, s = (u, c, a) => {
|
|
926
|
+
if (fe(u))
|
|
927
|
+
return u.aborted = !0, u;
|
|
928
|
+
const l = o(c, r, a);
|
|
929
|
+
if (l instanceof Promise) {
|
|
930
|
+
if (a.async === !1)
|
|
931
|
+
throw new he();
|
|
932
|
+
return l.then((f) => e._zod.parse(f, a));
|
|
933
|
+
}
|
|
934
|
+
return e._zod.parse(l, a);
|
|
935
|
+
};
|
|
936
|
+
e._zod.run = (u, c) => {
|
|
937
|
+
if (c.skipChecks)
|
|
938
|
+
return e._zod.parse(u, c);
|
|
939
|
+
if (c.direction === "backward") {
|
|
940
|
+
const l = e._zod.parse({ value: u.value, issues: [] }, { ...c, skipChecks: !0 });
|
|
941
|
+
return l instanceof Promise ? l.then((f) => s(f, u, c)) : s(l, u, c);
|
|
942
|
+
}
|
|
943
|
+
const a = e._zod.parse(u, c);
|
|
944
|
+
if (a instanceof Promise) {
|
|
945
|
+
if (c.async === !1)
|
|
946
|
+
throw new he();
|
|
947
|
+
return a.then((l) => o(l, r, c));
|
|
948
|
+
}
|
|
949
|
+
return o(a, r, c);
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
e["~standard"] = {
|
|
953
|
+
validate: (o) => {
|
|
954
|
+
var s;
|
|
955
|
+
try {
|
|
956
|
+
const u = Or(e, o);
|
|
957
|
+
return u.success ? { value: u.data } : { issues: (s = u.error) == null ? void 0 : s.issues };
|
|
958
|
+
} catch {
|
|
959
|
+
return Cr(e, o).then((c) => {
|
|
960
|
+
var a;
|
|
961
|
+
return c.success ? { value: c.data } : { issues: (a = c.error) == null ? void 0 : a.issues };
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
vendor: "zod",
|
|
966
|
+
version: 1
|
|
967
|
+
};
|
|
968
|
+
}), pn = /* @__PURE__ */ h("$ZodString", (e, n) => {
|
|
969
|
+
var t;
|
|
970
|
+
T.init(e, n), e._zod.pattern = [...((t = e == null ? void 0 : e._zod.bag) == null ? void 0 : t.patterns) ?? []].pop() ?? si(e._zod.bag), e._zod.parse = (r, i) => {
|
|
971
|
+
if (n.coerce)
|
|
972
|
+
try {
|
|
973
|
+
r.value = String(r.value);
|
|
974
|
+
} catch {
|
|
975
|
+
}
|
|
976
|
+
return typeof r.value == "string" || r.issues.push({
|
|
977
|
+
expected: "string",
|
|
978
|
+
code: "invalid_type",
|
|
979
|
+
input: r.value,
|
|
980
|
+
inst: e
|
|
981
|
+
}), r;
|
|
982
|
+
};
|
|
983
|
+
}), O = /* @__PURE__ */ h("$ZodStringFormat", (e, n) => {
|
|
984
|
+
Be.init(e, n), pn.init(e, n);
|
|
985
|
+
}), Ai = /* @__PURE__ */ h("$ZodGUID", (e, n) => {
|
|
986
|
+
n.pattern ?? (n.pattern = Mr), O.init(e, n);
|
|
987
|
+
}), $i = /* @__PURE__ */ h("$ZodUUID", (e, n) => {
|
|
988
|
+
if (n.version) {
|
|
989
|
+
const r = {
|
|
990
|
+
v1: 1,
|
|
991
|
+
v2: 2,
|
|
992
|
+
v3: 3,
|
|
993
|
+
v4: 4,
|
|
994
|
+
v5: 5,
|
|
995
|
+
v6: 6,
|
|
996
|
+
v7: 7,
|
|
997
|
+
v8: 8
|
|
998
|
+
}[n.version];
|
|
999
|
+
if (r === void 0)
|
|
1000
|
+
throw new Error(`Invalid UUID version: "${n.version}"`);
|
|
1001
|
+
n.pattern ?? (n.pattern = Nn(r));
|
|
1002
|
+
} else
|
|
1003
|
+
n.pattern ?? (n.pattern = Nn());
|
|
1004
|
+
O.init(e, n);
|
|
1005
|
+
}), Ii = /* @__PURE__ */ h("$ZodEmail", (e, n) => {
|
|
1006
|
+
n.pattern ?? (n.pattern = Hr), O.init(e, n);
|
|
1007
|
+
}), Oi = /* @__PURE__ */ h("$ZodURL", (e, n) => {
|
|
1008
|
+
O.init(e, n), e._zod.check = (t) => {
|
|
1009
|
+
try {
|
|
1010
|
+
const r = t.value.trim(), i = new URL(r);
|
|
1011
|
+
n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(i.hostname) || t.issues.push({
|
|
1012
|
+
code: "invalid_format",
|
|
1013
|
+
format: "url",
|
|
1014
|
+
note: "Invalid hostname",
|
|
1015
|
+
pattern: ni.source,
|
|
1016
|
+
input: t.value,
|
|
1017
|
+
inst: e,
|
|
1018
|
+
continue: !n.abort
|
|
1019
|
+
})), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || t.issues.push({
|
|
1020
|
+
code: "invalid_format",
|
|
1021
|
+
format: "url",
|
|
1022
|
+
note: "Invalid protocol",
|
|
1023
|
+
pattern: n.protocol.source,
|
|
1024
|
+
input: t.value,
|
|
1025
|
+
inst: e,
|
|
1026
|
+
continue: !n.abort
|
|
1027
|
+
})), n.normalize ? t.value = i.href : t.value = r;
|
|
1028
|
+
return;
|
|
1029
|
+
} catch {
|
|
1030
|
+
t.issues.push({
|
|
1031
|
+
code: "invalid_format",
|
|
1032
|
+
format: "url",
|
|
1033
|
+
input: t.value,
|
|
1034
|
+
inst: e,
|
|
1035
|
+
continue: !n.abort
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
}), Ci = /* @__PURE__ */ h("$ZodEmoji", (e, n) => {
|
|
1040
|
+
n.pattern ?? (n.pattern = Yr()), O.init(e, n);
|
|
1041
|
+
}), Ti = /* @__PURE__ */ h("$ZodNanoID", (e, n) => {
|
|
1042
|
+
n.pattern ?? (n.pattern = Gr), O.init(e, n);
|
|
1043
|
+
}), Ri = /* @__PURE__ */ h("$ZodCUID", (e, n) => {
|
|
1044
|
+
n.pattern ?? (n.pattern = jr), O.init(e, n);
|
|
1045
|
+
}), Di = /* @__PURE__ */ h("$ZodCUID2", (e, n) => {
|
|
1046
|
+
n.pattern ?? (n.pattern = xr), O.init(e, n);
|
|
1047
|
+
}), Fi = /* @__PURE__ */ h("$ZodULID", (e, n) => {
|
|
1048
|
+
n.pattern ?? (n.pattern = qr), O.init(e, n);
|
|
1049
|
+
}), Ei = /* @__PURE__ */ h("$ZodXID", (e, n) => {
|
|
1050
|
+
n.pattern ?? (n.pattern = Br), O.init(e, n);
|
|
1051
|
+
}), Ui = /* @__PURE__ */ h("$ZodKSUID", (e, n) => {
|
|
1052
|
+
n.pattern ?? (n.pattern = Sr), O.init(e, n);
|
|
1053
|
+
}), yi = /* @__PURE__ */ h("$ZodISODateTime", (e, n) => {
|
|
1054
|
+
n.pattern ?? (n.pattern = oi(n)), O.init(e, n);
|
|
1055
|
+
}), Li = /* @__PURE__ */ h("$ZodISODate", (e, n) => {
|
|
1056
|
+
n.pattern ?? (n.pattern = ri), O.init(e, n);
|
|
1057
|
+
}), ji = /* @__PURE__ */ h("$ZodISOTime", (e, n) => {
|
|
1058
|
+
n.pattern ?? (n.pattern = ii(n)), O.init(e, n);
|
|
1059
|
+
}), xi = /* @__PURE__ */ h("$ZodISODuration", (e, n) => {
|
|
1060
|
+
n.pattern ?? (n.pattern = Vr), O.init(e, n);
|
|
1061
|
+
}), qi = /* @__PURE__ */ h("$ZodIPv4", (e, n) => {
|
|
1062
|
+
n.pattern ?? (n.pattern = Qr), O.init(e, n), e._zod.onattach.push((t) => {
|
|
1063
|
+
const r = t._zod.bag;
|
|
1064
|
+
r.format = "ipv4";
|
|
1065
|
+
});
|
|
1066
|
+
}), Bi = /* @__PURE__ */ h("$ZodIPv6", (e, n) => {
|
|
1067
|
+
n.pattern ?? (n.pattern = Jr), O.init(e, n), e._zod.onattach.push((t) => {
|
|
1068
|
+
const r = t._zod.bag;
|
|
1069
|
+
r.format = "ipv6";
|
|
1070
|
+
}), e._zod.check = (t) => {
|
|
1071
|
+
try {
|
|
1072
|
+
new URL(`http://[${t.value}]`);
|
|
1073
|
+
} catch {
|
|
1074
|
+
t.issues.push({
|
|
1075
|
+
code: "invalid_format",
|
|
1076
|
+
format: "ipv6",
|
|
1077
|
+
input: t.value,
|
|
1078
|
+
inst: e,
|
|
1079
|
+
continue: !n.abort
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
}), Si = /* @__PURE__ */ h("$ZodCIDRv4", (e, n) => {
|
|
1084
|
+
n.pattern ?? (n.pattern = Kr), O.init(e, n);
|
|
1085
|
+
}), Gi = /* @__PURE__ */ h("$ZodCIDRv6", (e, n) => {
|
|
1086
|
+
n.pattern ?? (n.pattern = Xr), O.init(e, n), e._zod.check = (t) => {
|
|
1087
|
+
const [r, i] = t.value.split("/");
|
|
1088
|
+
try {
|
|
1089
|
+
if (!i)
|
|
1090
|
+
throw new Error();
|
|
1091
|
+
const o = Number(i);
|
|
1092
|
+
if (`${o}` !== i)
|
|
1093
|
+
throw new Error();
|
|
1094
|
+
if (o < 0 || o > 128)
|
|
1095
|
+
throw new Error();
|
|
1096
|
+
new URL(`http://[${r}]`);
|
|
1097
|
+
} catch {
|
|
1098
|
+
t.issues.push({
|
|
1099
|
+
code: "invalid_format",
|
|
1100
|
+
format: "cidrv6",
|
|
1101
|
+
input: t.value,
|
|
1102
|
+
inst: e,
|
|
1103
|
+
continue: !n.abort
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
});
|
|
1108
|
+
function nt(e) {
|
|
1109
|
+
if (e === "")
|
|
1110
|
+
return !0;
|
|
1111
|
+
if (e.length % 4 !== 0)
|
|
1112
|
+
return !1;
|
|
1113
|
+
try {
|
|
1114
|
+
return atob(e), !0;
|
|
1115
|
+
} catch {
|
|
1116
|
+
return !1;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
const Vi = /* @__PURE__ */ h("$ZodBase64", (e, n) => {
|
|
1120
|
+
n.pattern ?? (n.pattern = ei), O.init(e, n), e._zod.onattach.push((t) => {
|
|
1121
|
+
t._zod.bag.contentEncoding = "base64";
|
|
1122
|
+
}), e._zod.check = (t) => {
|
|
1123
|
+
nt(t.value) || t.issues.push({
|
|
1124
|
+
code: "invalid_format",
|
|
1125
|
+
format: "base64",
|
|
1126
|
+
input: t.value,
|
|
1127
|
+
inst: e,
|
|
1128
|
+
continue: !n.abort
|
|
1129
|
+
});
|
|
1130
|
+
};
|
|
1131
|
+
});
|
|
1132
|
+
function Mi(e) {
|
|
1133
|
+
if (!Yn.test(e))
|
|
1134
|
+
return !1;
|
|
1135
|
+
const n = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
|
|
1136
|
+
return nt(t);
|
|
1137
|
+
}
|
|
1138
|
+
const Hi = /* @__PURE__ */ h("$ZodBase64URL", (e, n) => {
|
|
1139
|
+
n.pattern ?? (n.pattern = Yn), O.init(e, n), e._zod.onattach.push((t) => {
|
|
1140
|
+
t._zod.bag.contentEncoding = "base64url";
|
|
1141
|
+
}), e._zod.check = (t) => {
|
|
1142
|
+
Mi(t.value) || t.issues.push({
|
|
1143
|
+
code: "invalid_format",
|
|
1144
|
+
format: "base64url",
|
|
1145
|
+
input: t.value,
|
|
1146
|
+
inst: e,
|
|
1147
|
+
continue: !n.abort
|
|
1148
|
+
});
|
|
1149
|
+
};
|
|
1150
|
+
}), Wi = /* @__PURE__ */ h("$ZodE164", (e, n) => {
|
|
1151
|
+
n.pattern ?? (n.pattern = ti), O.init(e, n);
|
|
1152
|
+
});
|
|
1153
|
+
function Yi(e, n = null) {
|
|
1154
|
+
try {
|
|
1155
|
+
const t = e.split(".");
|
|
1156
|
+
if (t.length !== 3)
|
|
1157
|
+
return !1;
|
|
1158
|
+
const [r] = t;
|
|
1159
|
+
if (!r)
|
|
1160
|
+
return !1;
|
|
1161
|
+
const i = JSON.parse(atob(r));
|
|
1162
|
+
return !("typ" in i && (i == null ? void 0 : i.typ) !== "JWT" || !i.alg || n && (!("alg" in i) || i.alg !== n));
|
|
1163
|
+
} catch {
|
|
1164
|
+
return !1;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
const Qi = /* @__PURE__ */ h("$ZodJWT", (e, n) => {
|
|
1168
|
+
O.init(e, n), e._zod.check = (t) => {
|
|
1169
|
+
Yi(t.value, n.alg) || t.issues.push({
|
|
1170
|
+
code: "invalid_format",
|
|
1171
|
+
format: "jwt",
|
|
1172
|
+
input: t.value,
|
|
1173
|
+
inst: e,
|
|
1174
|
+
continue: !n.abort
|
|
1175
|
+
});
|
|
1176
|
+
};
|
|
1177
|
+
}), tt = /* @__PURE__ */ h("$ZodNumber", (e, n) => {
|
|
1178
|
+
T.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? ci, e._zod.parse = (t, r) => {
|
|
1179
|
+
if (n.coerce)
|
|
1180
|
+
try {
|
|
1181
|
+
t.value = Number(t.value);
|
|
1182
|
+
} catch {
|
|
1183
|
+
}
|
|
1184
|
+
const i = t.value;
|
|
1185
|
+
if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
|
|
1186
|
+
return t;
|
|
1187
|
+
const o = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
|
|
1188
|
+
return t.issues.push({
|
|
1189
|
+
expected: "number",
|
|
1190
|
+
code: "invalid_type",
|
|
1191
|
+
input: i,
|
|
1192
|
+
inst: e,
|
|
1193
|
+
...o ? { received: o } : {}
|
|
1194
|
+
}), t;
|
|
1195
|
+
};
|
|
1196
|
+
}), Ji = /* @__PURE__ */ h("$ZodNumber", (e, n) => {
|
|
1197
|
+
hi.init(e, n), tt.init(e, n);
|
|
1198
|
+
}), Ki = /* @__PURE__ */ h("$ZodBoolean", (e, n) => {
|
|
1199
|
+
T.init(e, n), e._zod.pattern = ai, e._zod.parse = (t, r) => {
|
|
1200
|
+
if (n.coerce)
|
|
1201
|
+
try {
|
|
1202
|
+
t.value = !!t.value;
|
|
1203
|
+
} catch {
|
|
1204
|
+
}
|
|
1205
|
+
const i = t.value;
|
|
1206
|
+
return typeof i == "boolean" || t.issues.push({
|
|
1207
|
+
expected: "boolean",
|
|
1208
|
+
code: "invalid_type",
|
|
1209
|
+
input: i,
|
|
1210
|
+
inst: e
|
|
1211
|
+
}), t;
|
|
1212
|
+
};
|
|
1213
|
+
}), Xi = /* @__PURE__ */ h("$ZodUnknown", (e, n) => {
|
|
1214
|
+
T.init(e, n), e._zod.parse = (t) => t;
|
|
1215
|
+
}), eo = /* @__PURE__ */ h("$ZodNever", (e, n) => {
|
|
1216
|
+
T.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
|
|
1217
|
+
expected: "never",
|
|
1218
|
+
code: "invalid_type",
|
|
1219
|
+
input: t.value,
|
|
1220
|
+
inst: e
|
|
1221
|
+
}), t);
|
|
1222
|
+
}), no = /* @__PURE__ */ h("$ZodDate", (e, n) => {
|
|
1223
|
+
T.init(e, n), e._zod.parse = (t, r) => {
|
|
1224
|
+
if (n.coerce)
|
|
1225
|
+
try {
|
|
1226
|
+
t.value = new Date(t.value);
|
|
1227
|
+
} catch {
|
|
1228
|
+
}
|
|
1229
|
+
const i = t.value, o = i instanceof Date;
|
|
1230
|
+
return o && !Number.isNaN(i.getTime()) || t.issues.push({
|
|
1231
|
+
expected: "date",
|
|
1232
|
+
code: "invalid_type",
|
|
1233
|
+
input: i,
|
|
1234
|
+
...o ? { received: "Invalid Date" } : {},
|
|
1235
|
+
inst: e
|
|
1236
|
+
}), t;
|
|
1237
|
+
};
|
|
1238
|
+
});
|
|
1239
|
+
function bn(e, n, t) {
|
|
1240
|
+
e.issues.length && n.issues.push(...Vn(t, e.issues)), n.value[t] = e.value;
|
|
1241
|
+
}
|
|
1242
|
+
const to = /* @__PURE__ */ h("$ZodArray", (e, n) => {
|
|
1243
|
+
T.init(e, n), e._zod.parse = (t, r) => {
|
|
1244
|
+
const i = t.value;
|
|
1245
|
+
if (!Array.isArray(i))
|
|
1246
|
+
return t.issues.push({
|
|
1247
|
+
expected: "array",
|
|
1248
|
+
code: "invalid_type",
|
|
1249
|
+
input: i,
|
|
1250
|
+
inst: e
|
|
1251
|
+
}), t;
|
|
1252
|
+
t.value = Array(i.length);
|
|
1253
|
+
const o = [];
|
|
1254
|
+
for (let s = 0; s < i.length; s++) {
|
|
1255
|
+
const u = i[s], c = n.element._zod.run({
|
|
1256
|
+
value: u,
|
|
1257
|
+
issues: []
|
|
1258
|
+
}, r);
|
|
1259
|
+
c instanceof Promise ? o.push(c.then((a) => bn(a, t, s))) : bn(c, t, s);
|
|
1260
|
+
}
|
|
1261
|
+
return o.length ? Promise.all(o).then(() => t) : t;
|
|
1262
|
+
};
|
|
1263
|
+
});
|
|
1264
|
+
function Fe(e, n, t, r) {
|
|
1265
|
+
e.issues.length && n.issues.push(...Vn(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
1266
|
+
}
|
|
1267
|
+
function rt(e) {
|
|
1268
|
+
const n = Object.keys(e.shape);
|
|
1269
|
+
for (const r of n)
|
|
1270
|
+
if (!e.shape[r]._zod.traits.has("$ZodType"))
|
|
1271
|
+
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
1272
|
+
const t = vr(e.shape);
|
|
1273
|
+
return {
|
|
1274
|
+
...e,
|
|
1275
|
+
keys: n,
|
|
1276
|
+
keySet: new Set(n),
|
|
1277
|
+
numKeys: n.length,
|
|
1278
|
+
optionalKeys: new Set(t)
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
function it(e, n, t, r, i, o) {
|
|
1282
|
+
const s = [], u = i.keySet, c = i.catchall._zod, a = c.def.type;
|
|
1283
|
+
for (const l of Object.keys(n)) {
|
|
1284
|
+
if (u.has(l))
|
|
1285
|
+
continue;
|
|
1286
|
+
if (a === "never") {
|
|
1287
|
+
s.push(l);
|
|
1288
|
+
continue;
|
|
1289
|
+
}
|
|
1290
|
+
const f = c.run({ value: n[l], issues: [] }, r);
|
|
1291
|
+
f instanceof Promise ? e.push(f.then((d) => Fe(d, t, l, n))) : Fe(f, t, l, n);
|
|
1292
|
+
}
|
|
1293
|
+
return s.length && t.issues.push({
|
|
1294
|
+
code: "unrecognized_keys",
|
|
1295
|
+
keys: s,
|
|
1296
|
+
input: n,
|
|
1297
|
+
inst: o
|
|
1298
|
+
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
1299
|
+
}
|
|
1300
|
+
const ro = /* @__PURE__ */ h("$ZodObject", (e, n) => {
|
|
1301
|
+
T.init(e, n);
|
|
1302
|
+
const t = cn(() => rt(n));
|
|
1303
|
+
A(e._zod, "propValues", () => {
|
|
1304
|
+
const s = n.shape, u = {};
|
|
1305
|
+
for (const c in s) {
|
|
1306
|
+
const a = s[c]._zod;
|
|
1307
|
+
if (a.values) {
|
|
1308
|
+
u[c] ?? (u[c] = /* @__PURE__ */ new Set());
|
|
1309
|
+
for (const l of a.values)
|
|
1310
|
+
u[c].add(l);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
return u;
|
|
1314
|
+
});
|
|
1315
|
+
const r = De, i = n.catchall;
|
|
1316
|
+
let o;
|
|
1317
|
+
e._zod.parse = (s, u) => {
|
|
1318
|
+
o ?? (o = t.value);
|
|
1319
|
+
const c = s.value;
|
|
1320
|
+
if (!r(c))
|
|
1321
|
+
return s.issues.push({
|
|
1322
|
+
expected: "object",
|
|
1323
|
+
code: "invalid_type",
|
|
1324
|
+
input: c,
|
|
1325
|
+
inst: e
|
|
1326
|
+
}), s;
|
|
1327
|
+
s.value = {};
|
|
1328
|
+
const a = [], l = o.shape;
|
|
1329
|
+
for (const f of o.keys) {
|
|
1330
|
+
const m = l[f]._zod.run({ value: c[f], issues: [] }, u);
|
|
1331
|
+
m instanceof Promise ? a.push(m.then((k) => Fe(k, s, f, c))) : Fe(m, s, f, c);
|
|
1332
|
+
}
|
|
1333
|
+
return i ? it(a, c, s, u, t.value, e) : a.length ? Promise.all(a).then(() => s) : s;
|
|
1334
|
+
};
|
|
1335
|
+
}), io = /* @__PURE__ */ h("$ZodObjectJIT", (e, n) => {
|
|
1336
|
+
ro.init(e, n);
|
|
1337
|
+
const t = e._zod.parse, r = cn(() => rt(n)), i = (d) => {
|
|
1338
|
+
const m = new zi(["shape", "payload", "ctx"]), k = r.value, w = (b) => {
|
|
1339
|
+
const P = kn(b);
|
|
1340
|
+
return `shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`;
|
|
1341
|
+
};
|
|
1342
|
+
m.write("const input = payload.value;");
|
|
1343
|
+
const F = /* @__PURE__ */ Object.create(null);
|
|
1344
|
+
let $ = 0;
|
|
1345
|
+
for (const b of k.keys)
|
|
1346
|
+
F[b] = `key_${$++}`;
|
|
1347
|
+
m.write("const newResult = {}");
|
|
1348
|
+
for (const b of k.keys) {
|
|
1349
|
+
const P = F[b], Q = kn(b);
|
|
1350
|
+
m.write(`const ${P} = ${w(b)};`), m.write(`
|
|
1351
|
+
if (${P}.issues.length) {
|
|
1352
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
1353
|
+
...iss,
|
|
1354
|
+
path: iss.path ? [${Q}, ...iss.path] : [${Q}]
|
|
1355
|
+
})));
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
if (${P}.value === undefined) {
|
|
1359
|
+
if (${Q} in input) {
|
|
1360
|
+
newResult[${Q}] = undefined;
|
|
1361
|
+
}
|
|
1362
|
+
} else {
|
|
1363
|
+
newResult[${Q}] = ${P}.value;
|
|
1364
|
+
}
|
|
1365
|
+
`);
|
|
1366
|
+
}
|
|
1367
|
+
m.write("payload.value = newResult;"), m.write("return payload;");
|
|
1368
|
+
const G = m.compile();
|
|
1369
|
+
return (b, P) => G(d, b, P);
|
|
1370
|
+
};
|
|
1371
|
+
let o;
|
|
1372
|
+
const s = De, u = !Je.jitless, a = u && gr.value, l = n.catchall;
|
|
1373
|
+
let f;
|
|
1374
|
+
e._zod.parse = (d, m) => {
|
|
1375
|
+
f ?? (f = r.value);
|
|
1376
|
+
const k = d.value;
|
|
1377
|
+
return s(k) ? u && a && (m == null ? void 0 : m.async) === !1 && m.jitless !== !0 ? (o || (o = i(n.shape)), d = o(d, m), l ? it([], k, d, m, f, e) : d) : t(d, m) : (d.issues.push({
|
|
1378
|
+
expected: "object",
|
|
1379
|
+
code: "invalid_type",
|
|
1380
|
+
input: k,
|
|
1381
|
+
inst: e
|
|
1382
|
+
}), d);
|
|
1383
|
+
};
|
|
1384
|
+
});
|
|
1385
|
+
function Pn(e, n, t, r) {
|
|
1386
|
+
for (const o of e)
|
|
1387
|
+
if (o.issues.length === 0)
|
|
1388
|
+
return n.value = o.value, n;
|
|
1389
|
+
const i = e.filter((o) => !fe(o));
|
|
1390
|
+
return i.length === 1 ? (n.value = i[0].value, i[0]) : (n.issues.push({
|
|
1391
|
+
code: "invalid_union",
|
|
1392
|
+
input: n.value,
|
|
1393
|
+
inst: t,
|
|
1394
|
+
errors: e.map((o) => o.issues.map((s) => ae(s, r, ce())))
|
|
1395
|
+
}), n);
|
|
1396
|
+
}
|
|
1397
|
+
const oo = /* @__PURE__ */ h("$ZodUnion", (e, n) => {
|
|
1398
|
+
T.init(e, n), A(e._zod, "optin", () => n.options.some((i) => i._zod.optin === "optional") ? "optional" : void 0), A(e._zod, "optout", () => n.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), A(e._zod, "values", () => {
|
|
1399
|
+
if (n.options.every((i) => i._zod.values))
|
|
1400
|
+
return new Set(n.options.flatMap((i) => Array.from(i._zod.values)));
|
|
1401
|
+
}), A(e._zod, "pattern", () => {
|
|
1402
|
+
if (n.options.every((i) => i._zod.pattern)) {
|
|
1403
|
+
const i = n.options.map((o) => o._zod.pattern);
|
|
1404
|
+
return new RegExp(`^(${i.map((o) => ln(o.source)).join("|")})$`);
|
|
1405
|
+
}
|
|
1406
|
+
});
|
|
1407
|
+
const t = n.options.length === 1, r = n.options[0]._zod.run;
|
|
1408
|
+
e._zod.parse = (i, o) => {
|
|
1409
|
+
if (t)
|
|
1410
|
+
return r(i, o);
|
|
1411
|
+
let s = !1;
|
|
1412
|
+
const u = [];
|
|
1413
|
+
for (const c of n.options) {
|
|
1414
|
+
const a = c._zod.run({
|
|
1415
|
+
value: i.value,
|
|
1416
|
+
issues: []
|
|
1417
|
+
}, o);
|
|
1418
|
+
if (a instanceof Promise)
|
|
1419
|
+
u.push(a), s = !0;
|
|
1420
|
+
else {
|
|
1421
|
+
if (a.issues.length === 0)
|
|
1422
|
+
return a;
|
|
1423
|
+
u.push(a);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
return s ? Promise.all(u).then((c) => Pn(c, i, e, o)) : Pn(u, i, e, o);
|
|
1427
|
+
};
|
|
1428
|
+
}), so = /* @__PURE__ */ h("$ZodIntersection", (e, n) => {
|
|
1429
|
+
T.init(e, n), e._zod.parse = (t, r) => {
|
|
1430
|
+
const i = t.value, o = n.left._zod.run({ value: i, issues: [] }, r), s = n.right._zod.run({ value: i, issues: [] }, r);
|
|
1431
|
+
return o instanceof Promise || s instanceof Promise ? Promise.all([o, s]).then(([c, a]) => zn(t, c, a)) : zn(t, o, s);
|
|
1432
|
+
};
|
|
1433
|
+
});
|
|
1434
|
+
function Xe(e, n) {
|
|
1435
|
+
if (e === n)
|
|
1436
|
+
return { valid: !0, data: e };
|
|
1437
|
+
if (e instanceof Date && n instanceof Date && +e == +n)
|
|
1438
|
+
return { valid: !0, data: e };
|
|
1439
|
+
if (ke(e) && ke(n)) {
|
|
1440
|
+
const t = Object.keys(n), r = Object.keys(e).filter((o) => t.indexOf(o) !== -1), i = { ...e, ...n };
|
|
1441
|
+
for (const o of r) {
|
|
1442
|
+
const s = Xe(e[o], n[o]);
|
|
1443
|
+
if (!s.valid)
|
|
1444
|
+
return {
|
|
1445
|
+
valid: !1,
|
|
1446
|
+
mergeErrorPath: [o, ...s.mergeErrorPath]
|
|
1447
|
+
};
|
|
1448
|
+
i[o] = s.data;
|
|
1449
|
+
}
|
|
1450
|
+
return { valid: !0, data: i };
|
|
1451
|
+
}
|
|
1452
|
+
if (Array.isArray(e) && Array.isArray(n)) {
|
|
1453
|
+
if (e.length !== n.length)
|
|
1454
|
+
return { valid: !1, mergeErrorPath: [] };
|
|
1455
|
+
const t = [];
|
|
1456
|
+
for (let r = 0; r < e.length; r++) {
|
|
1457
|
+
const i = e[r], o = n[r], s = Xe(i, o);
|
|
1458
|
+
if (!s.valid)
|
|
1459
|
+
return {
|
|
1460
|
+
valid: !1,
|
|
1461
|
+
mergeErrorPath: [r, ...s.mergeErrorPath]
|
|
1462
|
+
};
|
|
1463
|
+
t.push(s.data);
|
|
1464
|
+
}
|
|
1465
|
+
return { valid: !0, data: t };
|
|
1466
|
+
}
|
|
1467
|
+
return { valid: !1, mergeErrorPath: [] };
|
|
1468
|
+
}
|
|
1469
|
+
function zn(e, n, t) {
|
|
1470
|
+
if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), fe(e))
|
|
1471
|
+
return e;
|
|
1472
|
+
const r = Xe(n.value, t.value);
|
|
1473
|
+
if (!r.valid)
|
|
1474
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1475
|
+
return e.value = r.data, e;
|
|
1476
|
+
}
|
|
1477
|
+
const uo = /* @__PURE__ */ h("$ZodEnum", (e, n) => {
|
|
1478
|
+
T.init(e, n);
|
|
1479
|
+
const t = hr(n.entries), r = new Set(t);
|
|
1480
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((i) => _r.has(typeof i)).map((i) => typeof i == "string" ? je(i) : i.toString()).join("|")})$`), e._zod.parse = (i, o) => {
|
|
1481
|
+
const s = i.value;
|
|
1482
|
+
return r.has(s) || i.issues.push({
|
|
1483
|
+
code: "invalid_value",
|
|
1484
|
+
values: t,
|
|
1485
|
+
input: s,
|
|
1486
|
+
inst: e
|
|
1487
|
+
}), i;
|
|
1488
|
+
};
|
|
1489
|
+
}), co = /* @__PURE__ */ h("$ZodTransform", (e, n) => {
|
|
1490
|
+
T.init(e, n), e._zod.parse = (t, r) => {
|
|
1491
|
+
if (r.direction === "backward")
|
|
1492
|
+
throw new Bn(e.constructor.name);
|
|
1493
|
+
const i = n.transform(t.value, t);
|
|
1494
|
+
if (r.async)
|
|
1495
|
+
return (i instanceof Promise ? i : Promise.resolve(i)).then((s) => (t.value = s, t));
|
|
1496
|
+
if (i instanceof Promise)
|
|
1497
|
+
throw new he();
|
|
1498
|
+
return t.value = i, t;
|
|
1499
|
+
};
|
|
1500
|
+
});
|
|
1501
|
+
function Zn(e, n) {
|
|
1502
|
+
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
1503
|
+
}
|
|
1504
|
+
const ao = /* @__PURE__ */ h("$ZodOptional", (e, n) => {
|
|
1505
|
+
T.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", A(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), A(e._zod, "pattern", () => {
|
|
1506
|
+
const t = n.innerType._zod.pattern;
|
|
1507
|
+
return t ? new RegExp(`^(${ln(t.source)})?$`) : void 0;
|
|
1508
|
+
}), e._zod.parse = (t, r) => {
|
|
1509
|
+
if (n.innerType._zod.optin === "optional") {
|
|
1510
|
+
const i = n.innerType._zod.run(t, r);
|
|
1511
|
+
return i instanceof Promise ? i.then((o) => Zn(o, t.value)) : Zn(i, t.value);
|
|
1512
|
+
}
|
|
1513
|
+
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
1514
|
+
};
|
|
1515
|
+
}), lo = /* @__PURE__ */ h("$ZodNullable", (e, n) => {
|
|
1516
|
+
T.init(e, n), A(e._zod, "optin", () => n.innerType._zod.optin), A(e._zod, "optout", () => n.innerType._zod.optout), A(e._zod, "pattern", () => {
|
|
1517
|
+
const t = n.innerType._zod.pattern;
|
|
1518
|
+
return t ? new RegExp(`^(${ln(t.source)}|null)$`) : void 0;
|
|
1519
|
+
}), A(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
|
|
1520
|
+
}), fo = /* @__PURE__ */ h("$ZodDefault", (e, n) => {
|
|
1521
|
+
T.init(e, n), e._zod.optin = "optional", A(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1522
|
+
if (r.direction === "backward")
|
|
1523
|
+
return n.innerType._zod.run(t, r);
|
|
1524
|
+
if (t.value === void 0)
|
|
1525
|
+
return t.value = n.defaultValue, t;
|
|
1526
|
+
const i = n.innerType._zod.run(t, r);
|
|
1527
|
+
return i instanceof Promise ? i.then((o) => An(o, n)) : An(i, n);
|
|
1528
|
+
};
|
|
1529
|
+
});
|
|
1530
|
+
function An(e, n) {
|
|
1531
|
+
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
1532
|
+
}
|
|
1533
|
+
const ho = /* @__PURE__ */ h("$ZodPrefault", (e, n) => {
|
|
1534
|
+
T.init(e, n), e._zod.optin = "optional", A(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
|
|
1535
|
+
}), po = /* @__PURE__ */ h("$ZodNonOptional", (e, n) => {
|
|
1536
|
+
T.init(e, n), A(e._zod, "values", () => {
|
|
1537
|
+
const t = n.innerType._zod.values;
|
|
1538
|
+
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
1539
|
+
}), e._zod.parse = (t, r) => {
|
|
1540
|
+
const i = n.innerType._zod.run(t, r);
|
|
1541
|
+
return i instanceof Promise ? i.then((o) => $n(o, e)) : $n(i, e);
|
|
1542
|
+
};
|
|
1543
|
+
});
|
|
1544
|
+
function $n(e, n) {
|
|
1545
|
+
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1546
|
+
code: "invalid_type",
|
|
1547
|
+
expected: "nonoptional",
|
|
1548
|
+
input: e.value,
|
|
1549
|
+
inst: n
|
|
1550
|
+
}), e;
|
|
1551
|
+
}
|
|
1552
|
+
const mo = /* @__PURE__ */ h("$ZodCatch", (e, n) => {
|
|
1553
|
+
T.init(e, n), A(e._zod, "optin", () => n.innerType._zod.optin), A(e._zod, "optout", () => n.innerType._zod.optout), A(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1554
|
+
if (r.direction === "backward")
|
|
1555
|
+
return n.innerType._zod.run(t, r);
|
|
1556
|
+
const i = n.innerType._zod.run(t, r);
|
|
1557
|
+
return i instanceof Promise ? i.then((o) => (t.value = o.value, o.issues.length && (t.value = n.catchValue({
|
|
1558
|
+
...t,
|
|
1559
|
+
error: {
|
|
1560
|
+
issues: o.issues.map((s) => ae(s, r, ce()))
|
|
1561
|
+
},
|
|
1562
|
+
input: t.value
|
|
1563
|
+
}), t.issues = []), t)) : (t.value = i.value, i.issues.length && (t.value = n.catchValue({
|
|
1564
|
+
...t,
|
|
1565
|
+
error: {
|
|
1566
|
+
issues: i.issues.map((o) => ae(o, r, ce()))
|
|
1567
|
+
},
|
|
1568
|
+
input: t.value
|
|
1569
|
+
}), t.issues = []), t);
|
|
1570
|
+
};
|
|
1571
|
+
}), go = /* @__PURE__ */ h("$ZodPipe", (e, n) => {
|
|
1572
|
+
T.init(e, n), A(e._zod, "values", () => n.in._zod.values), A(e._zod, "optin", () => n.in._zod.optin), A(e._zod, "optout", () => n.out._zod.optout), A(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1573
|
+
if (r.direction === "backward") {
|
|
1574
|
+
const o = n.out._zod.run(t, r);
|
|
1575
|
+
return o instanceof Promise ? o.then((s) => Ie(s, n.in, r)) : Ie(o, n.in, r);
|
|
1576
|
+
}
|
|
1577
|
+
const i = n.in._zod.run(t, r);
|
|
1578
|
+
return i instanceof Promise ? i.then((o) => Ie(o, n.out, r)) : Ie(i, n.out, r);
|
|
1579
|
+
};
|
|
1580
|
+
});
|
|
1581
|
+
function Ie(e, n, t) {
|
|
1582
|
+
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1583
|
+
}
|
|
1584
|
+
const _o = /* @__PURE__ */ h("$ZodReadonly", (e, n) => {
|
|
1585
|
+
T.init(e, n), A(e._zod, "propValues", () => n.innerType._zod.propValues), A(e._zod, "values", () => n.innerType._zod.values), A(e._zod, "optin", () => n.innerType._zod.optin), A(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
|
|
1586
|
+
if (r.direction === "backward")
|
|
1587
|
+
return n.innerType._zod.run(t, r);
|
|
1588
|
+
const i = n.innerType._zod.run(t, r);
|
|
1589
|
+
return i instanceof Promise ? i.then(In) : In(i);
|
|
1590
|
+
};
|
|
1591
|
+
});
|
|
1592
|
+
function In(e) {
|
|
1593
|
+
return e.value = Object.freeze(e.value), e;
|
|
1594
|
+
}
|
|
1595
|
+
const vo = /* @__PURE__ */ h("$ZodCustom", (e, n) => {
|
|
1596
|
+
S.init(e, n), T.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1597
|
+
const r = t.value, i = n.fn(r);
|
|
1598
|
+
if (i instanceof Promise)
|
|
1599
|
+
return i.then((o) => On(o, t, r, e));
|
|
1600
|
+
On(i, t, r, e);
|
|
1601
|
+
};
|
|
1602
|
+
});
|
|
1603
|
+
function On(e, n, t, r) {
|
|
1604
|
+
if (!e) {
|
|
1605
|
+
const i = {
|
|
1606
|
+
code: "custom",
|
|
1607
|
+
input: t,
|
|
1608
|
+
inst: r,
|
|
1609
|
+
// incorporates params.error into issue reporting
|
|
1610
|
+
path: [...r._zod.def.path ?? []],
|
|
1611
|
+
// incorporates params.error into issue reporting
|
|
1612
|
+
continue: !r._zod.def.abort
|
|
1613
|
+
// params: inst._zod.def.params,
|
|
1614
|
+
};
|
|
1615
|
+
r._zod.def.params && (i.params = r._zod.def.params), n.issues.push(Ne(i));
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
class wo {
|
|
1619
|
+
constructor() {
|
|
1620
|
+
this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
|
|
1621
|
+
}
|
|
1622
|
+
add(n, ...t) {
|
|
1623
|
+
const r = t[0];
|
|
1624
|
+
if (this._map.set(n, r), r && typeof r == "object" && "id" in r) {
|
|
1625
|
+
if (this._idmap.has(r.id))
|
|
1626
|
+
throw new Error(`ID ${r.id} already exists in the registry`);
|
|
1627
|
+
this._idmap.set(r.id, n);
|
|
1628
|
+
}
|
|
1629
|
+
return this;
|
|
1630
|
+
}
|
|
1631
|
+
clear() {
|
|
1632
|
+
return this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1633
|
+
}
|
|
1634
|
+
remove(n) {
|
|
1635
|
+
const t = this._map.get(n);
|
|
1636
|
+
return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
|
|
1637
|
+
}
|
|
1638
|
+
get(n) {
|
|
1639
|
+
const t = n._zod.parent;
|
|
1640
|
+
if (t) {
|
|
1641
|
+
const r = { ...this.get(t) ?? {} };
|
|
1642
|
+
delete r.id;
|
|
1643
|
+
const i = { ...r, ...this._map.get(n) };
|
|
1644
|
+
return Object.keys(i).length ? i : void 0;
|
|
1645
|
+
}
|
|
1646
|
+
return this._map.get(n);
|
|
1647
|
+
}
|
|
1648
|
+
has(n) {
|
|
1649
|
+
return this._map.has(n);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
function ko() {
|
|
1653
|
+
return new wo();
|
|
1654
|
+
}
|
|
1655
|
+
const Oe = /* @__PURE__ */ ko();
|
|
1656
|
+
function No(e, n) {
|
|
1657
|
+
return new e({
|
|
1658
|
+
type: "string",
|
|
1659
|
+
..._(n)
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
function ot(e, n) {
|
|
1663
|
+
return new e({
|
|
1664
|
+
type: "string",
|
|
1665
|
+
format: "email",
|
|
1666
|
+
check: "string_format",
|
|
1667
|
+
abort: !1,
|
|
1668
|
+
..._(n)
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
function Cn(e, n) {
|
|
1672
|
+
return new e({
|
|
1673
|
+
type: "string",
|
|
1674
|
+
format: "guid",
|
|
1675
|
+
check: "string_format",
|
|
1676
|
+
abort: !1,
|
|
1677
|
+
..._(n)
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
function st(e, n) {
|
|
1681
|
+
return new e({
|
|
1682
|
+
type: "string",
|
|
1683
|
+
format: "uuid",
|
|
1684
|
+
check: "string_format",
|
|
1685
|
+
abort: !1,
|
|
1686
|
+
..._(n)
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
function bo(e, n) {
|
|
1690
|
+
return new e({
|
|
1691
|
+
type: "string",
|
|
1692
|
+
format: "uuid",
|
|
1693
|
+
check: "string_format",
|
|
1694
|
+
abort: !1,
|
|
1695
|
+
version: "v4",
|
|
1696
|
+
..._(n)
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
function Po(e, n) {
|
|
1700
|
+
return new e({
|
|
1701
|
+
type: "string",
|
|
1702
|
+
format: "uuid",
|
|
1703
|
+
check: "string_format",
|
|
1704
|
+
abort: !1,
|
|
1705
|
+
version: "v6",
|
|
1706
|
+
..._(n)
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
function zo(e, n) {
|
|
1710
|
+
return new e({
|
|
1711
|
+
type: "string",
|
|
1712
|
+
format: "uuid",
|
|
1713
|
+
check: "string_format",
|
|
1714
|
+
abort: !1,
|
|
1715
|
+
version: "v7",
|
|
1716
|
+
..._(n)
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
function Zo(e, n) {
|
|
1720
|
+
return new e({
|
|
1721
|
+
type: "string",
|
|
1722
|
+
format: "url",
|
|
1723
|
+
check: "string_format",
|
|
1724
|
+
abort: !1,
|
|
1725
|
+
..._(n)
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
function Ao(e, n) {
|
|
1729
|
+
return new e({
|
|
1730
|
+
type: "string",
|
|
1731
|
+
format: "emoji",
|
|
1732
|
+
check: "string_format",
|
|
1733
|
+
abort: !1,
|
|
1734
|
+
..._(n)
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
function $o(e, n) {
|
|
1738
|
+
return new e({
|
|
1739
|
+
type: "string",
|
|
1740
|
+
format: "nanoid",
|
|
1741
|
+
check: "string_format",
|
|
1742
|
+
abort: !1,
|
|
1743
|
+
..._(n)
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
function Io(e, n) {
|
|
1747
|
+
return new e({
|
|
1748
|
+
type: "string",
|
|
1749
|
+
format: "cuid",
|
|
1750
|
+
check: "string_format",
|
|
1751
|
+
abort: !1,
|
|
1752
|
+
..._(n)
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
function Oo(e, n) {
|
|
1756
|
+
return new e({
|
|
1757
|
+
type: "string",
|
|
1758
|
+
format: "cuid2",
|
|
1759
|
+
check: "string_format",
|
|
1760
|
+
abort: !1,
|
|
1761
|
+
..._(n)
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
function Co(e, n) {
|
|
1765
|
+
return new e({
|
|
1766
|
+
type: "string",
|
|
1767
|
+
format: "ulid",
|
|
1768
|
+
check: "string_format",
|
|
1769
|
+
abort: !1,
|
|
1770
|
+
..._(n)
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
function To(e, n) {
|
|
1774
|
+
return new e({
|
|
1775
|
+
type: "string",
|
|
1776
|
+
format: "xid",
|
|
1777
|
+
check: "string_format",
|
|
1778
|
+
abort: !1,
|
|
1779
|
+
..._(n)
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
function Ro(e, n) {
|
|
1783
|
+
return new e({
|
|
1784
|
+
type: "string",
|
|
1785
|
+
format: "ksuid",
|
|
1786
|
+
check: "string_format",
|
|
1787
|
+
abort: !1,
|
|
1788
|
+
..._(n)
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
function Do(e, n) {
|
|
1792
|
+
return new e({
|
|
1793
|
+
type: "string",
|
|
1794
|
+
format: "ipv4",
|
|
1795
|
+
check: "string_format",
|
|
1796
|
+
abort: !1,
|
|
1797
|
+
..._(n)
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
function Fo(e, n) {
|
|
1801
|
+
return new e({
|
|
1802
|
+
type: "string",
|
|
1803
|
+
format: "ipv6",
|
|
1804
|
+
check: "string_format",
|
|
1805
|
+
abort: !1,
|
|
1806
|
+
..._(n)
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
function Eo(e, n) {
|
|
1810
|
+
return new e({
|
|
1811
|
+
type: "string",
|
|
1812
|
+
format: "cidrv4",
|
|
1813
|
+
check: "string_format",
|
|
1814
|
+
abort: !1,
|
|
1815
|
+
..._(n)
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
function Uo(e, n) {
|
|
1819
|
+
return new e({
|
|
1820
|
+
type: "string",
|
|
1821
|
+
format: "cidrv6",
|
|
1822
|
+
check: "string_format",
|
|
1823
|
+
abort: !1,
|
|
1824
|
+
..._(n)
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
function yo(e, n) {
|
|
1828
|
+
return new e({
|
|
1829
|
+
type: "string",
|
|
1830
|
+
format: "base64",
|
|
1831
|
+
check: "string_format",
|
|
1832
|
+
abort: !1,
|
|
1833
|
+
..._(n)
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
function Lo(e, n) {
|
|
1837
|
+
return new e({
|
|
1838
|
+
type: "string",
|
|
1839
|
+
format: "base64url",
|
|
1840
|
+
check: "string_format",
|
|
1841
|
+
abort: !1,
|
|
1842
|
+
..._(n)
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
function jo(e, n) {
|
|
1846
|
+
return new e({
|
|
1847
|
+
type: "string",
|
|
1848
|
+
format: "e164",
|
|
1849
|
+
check: "string_format",
|
|
1850
|
+
abort: !1,
|
|
1851
|
+
..._(n)
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
function xo(e, n) {
|
|
1855
|
+
return new e({
|
|
1856
|
+
type: "string",
|
|
1857
|
+
format: "jwt",
|
|
1858
|
+
check: "string_format",
|
|
1859
|
+
abort: !1,
|
|
1860
|
+
..._(n)
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
function qo(e, n) {
|
|
1864
|
+
return new e({
|
|
1865
|
+
type: "string",
|
|
1866
|
+
format: "datetime",
|
|
1867
|
+
check: "string_format",
|
|
1868
|
+
offset: !1,
|
|
1869
|
+
local: !1,
|
|
1870
|
+
precision: null,
|
|
1871
|
+
..._(n)
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
function Bo(e, n) {
|
|
1875
|
+
return new e({
|
|
1876
|
+
type: "string",
|
|
1877
|
+
format: "date",
|
|
1878
|
+
check: "string_format",
|
|
1879
|
+
..._(n)
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
function So(e, n) {
|
|
1883
|
+
return new e({
|
|
1884
|
+
type: "string",
|
|
1885
|
+
format: "time",
|
|
1886
|
+
check: "string_format",
|
|
1887
|
+
precision: null,
|
|
1888
|
+
..._(n)
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
function Go(e, n) {
|
|
1892
|
+
return new e({
|
|
1893
|
+
type: "string",
|
|
1894
|
+
format: "duration",
|
|
1895
|
+
check: "string_format",
|
|
1896
|
+
..._(n)
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
function Vo(e, n) {
|
|
1900
|
+
return new e({
|
|
1901
|
+
type: "number",
|
|
1902
|
+
checks: [],
|
|
1903
|
+
..._(n)
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
function Mo(e, n) {
|
|
1907
|
+
return new e({
|
|
1908
|
+
type: "number",
|
|
1909
|
+
coerce: !0,
|
|
1910
|
+
checks: [],
|
|
1911
|
+
..._(n)
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
function Ho(e, n) {
|
|
1915
|
+
return new e({
|
|
1916
|
+
type: "number",
|
|
1917
|
+
check: "number_format",
|
|
1918
|
+
abort: !1,
|
|
1919
|
+
format: "safeint",
|
|
1920
|
+
..._(n)
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
function Wo(e, n) {
|
|
1924
|
+
return new e({
|
|
1925
|
+
type: "boolean",
|
|
1926
|
+
..._(n)
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
function Yo(e) {
|
|
1930
|
+
return new e({
|
|
1931
|
+
type: "unknown"
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
function Qo(e, n) {
|
|
1935
|
+
return new e({
|
|
1936
|
+
type: "never",
|
|
1937
|
+
..._(n)
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
function Jo(e, n) {
|
|
1941
|
+
return new e({
|
|
1942
|
+
type: "date",
|
|
1943
|
+
..._(n)
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1946
|
+
function Tn(e, n) {
|
|
1947
|
+
return new Xn({
|
|
1948
|
+
check: "less_than",
|
|
1949
|
+
..._(n),
|
|
1950
|
+
value: e,
|
|
1951
|
+
inclusive: !1
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
function Ce(e, n) {
|
|
1955
|
+
return new Xn({
|
|
1956
|
+
check: "less_than",
|
|
1957
|
+
..._(n),
|
|
1958
|
+
value: e,
|
|
1959
|
+
inclusive: !0
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
function Rn(e, n) {
|
|
1963
|
+
return new et({
|
|
1964
|
+
check: "greater_than",
|
|
1965
|
+
..._(n),
|
|
1966
|
+
value: e,
|
|
1967
|
+
inclusive: !1
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1970
|
+
function Te(e, n) {
|
|
1971
|
+
return new et({
|
|
1972
|
+
check: "greater_than",
|
|
1973
|
+
..._(n),
|
|
1974
|
+
value: e,
|
|
1975
|
+
inclusive: !0
|
|
1976
|
+
});
|
|
1977
|
+
}
|
|
1978
|
+
function Dn(e, n) {
|
|
1979
|
+
return new di({
|
|
1980
|
+
check: "multiple_of",
|
|
1981
|
+
..._(n),
|
|
1982
|
+
value: e
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
function ut(e, n) {
|
|
1986
|
+
return new pi({
|
|
1987
|
+
check: "max_length",
|
|
1988
|
+
..._(n),
|
|
1989
|
+
maximum: e
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
function Ee(e, n) {
|
|
1993
|
+
return new mi({
|
|
1994
|
+
check: "min_length",
|
|
1995
|
+
..._(n),
|
|
1996
|
+
minimum: e
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
function ct(e, n) {
|
|
2000
|
+
return new gi({
|
|
2001
|
+
check: "length_equals",
|
|
2002
|
+
..._(n),
|
|
2003
|
+
length: e
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
function Ko(e, n) {
|
|
2007
|
+
return new _i({
|
|
2008
|
+
check: "string_format",
|
|
2009
|
+
format: "regex",
|
|
2010
|
+
..._(n),
|
|
2011
|
+
pattern: e
|
|
2012
|
+
});
|
|
2013
|
+
}
|
|
2014
|
+
function Xo(e) {
|
|
2015
|
+
return new vi({
|
|
2016
|
+
check: "string_format",
|
|
2017
|
+
format: "lowercase",
|
|
2018
|
+
..._(e)
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
function es(e) {
|
|
2022
|
+
return new wi({
|
|
2023
|
+
check: "string_format",
|
|
2024
|
+
format: "uppercase",
|
|
2025
|
+
..._(e)
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
function ns(e, n) {
|
|
2029
|
+
return new ki({
|
|
2030
|
+
check: "string_format",
|
|
2031
|
+
format: "includes",
|
|
2032
|
+
..._(n),
|
|
2033
|
+
includes: e
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
function ts(e, n) {
|
|
2037
|
+
return new Ni({
|
|
2038
|
+
check: "string_format",
|
|
2039
|
+
format: "starts_with",
|
|
2040
|
+
..._(n),
|
|
2041
|
+
prefix: e
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
function rs(e, n) {
|
|
2045
|
+
return new bi({
|
|
2046
|
+
check: "string_format",
|
|
2047
|
+
format: "ends_with",
|
|
2048
|
+
..._(n),
|
|
2049
|
+
suffix: e
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
function Pe(e) {
|
|
2053
|
+
return new Pi({
|
|
2054
|
+
check: "overwrite",
|
|
2055
|
+
tx: e
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
function is(e) {
|
|
2059
|
+
return Pe((n) => n.normalize(e));
|
|
2060
|
+
}
|
|
2061
|
+
function os() {
|
|
2062
|
+
return Pe((e) => e.trim());
|
|
2063
|
+
}
|
|
2064
|
+
function ss() {
|
|
2065
|
+
return Pe((e) => e.toLowerCase());
|
|
2066
|
+
}
|
|
2067
|
+
function us() {
|
|
2068
|
+
return Pe((e) => e.toUpperCase());
|
|
2069
|
+
}
|
|
2070
|
+
function cs(e, n, t) {
|
|
2071
|
+
return new e({
|
|
2072
|
+
type: "array",
|
|
2073
|
+
element: n,
|
|
2074
|
+
// get element() {
|
|
2075
|
+
// return element;
|
|
2076
|
+
// },
|
|
2077
|
+
..._(t)
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
function as(e, n, t) {
|
|
2081
|
+
return new e({
|
|
2082
|
+
type: "custom",
|
|
2083
|
+
check: "custom",
|
|
2084
|
+
fn: n,
|
|
2085
|
+
..._(t)
|
|
2086
|
+
});
|
|
2087
|
+
}
|
|
2088
|
+
function ls(e) {
|
|
2089
|
+
const n = fs((t) => (t.addIssue = (r) => {
|
|
2090
|
+
if (typeof r == "string")
|
|
2091
|
+
t.issues.push(Ne(r, t.value, n._zod.def));
|
|
2092
|
+
else {
|
|
2093
|
+
const i = r;
|
|
2094
|
+
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(Ne(i));
|
|
2095
|
+
}
|
|
2096
|
+
}, e(t.value, t)));
|
|
2097
|
+
return n;
|
|
2098
|
+
}
|
|
2099
|
+
function fs(e, n) {
|
|
2100
|
+
const t = new S({
|
|
2101
|
+
check: "custom",
|
|
2102
|
+
..._(n)
|
|
2103
|
+
});
|
|
2104
|
+
return t._zod.check = e, t;
|
|
2105
|
+
}
|
|
2106
|
+
const ds = /* @__PURE__ */ h("ZodISODateTime", (e, n) => {
|
|
2107
|
+
yi.init(e, n), C.init(e, n);
|
|
2108
|
+
});
|
|
2109
|
+
function hs(e) {
|
|
2110
|
+
return qo(ds, e);
|
|
2111
|
+
}
|
|
2112
|
+
const ps = /* @__PURE__ */ h("ZodISODate", (e, n) => {
|
|
2113
|
+
Li.init(e, n), C.init(e, n);
|
|
2114
|
+
});
|
|
2115
|
+
function ms(e) {
|
|
2116
|
+
return Bo(ps, e);
|
|
2117
|
+
}
|
|
2118
|
+
const gs = /* @__PURE__ */ h("ZodISOTime", (e, n) => {
|
|
2119
|
+
ji.init(e, n), C.init(e, n);
|
|
2120
|
+
});
|
|
2121
|
+
function _s(e) {
|
|
2122
|
+
return So(gs, e);
|
|
2123
|
+
}
|
|
2124
|
+
const vs = /* @__PURE__ */ h("ZodISODuration", (e, n) => {
|
|
2125
|
+
xi.init(e, n), C.init(e, n);
|
|
2126
|
+
});
|
|
2127
|
+
function ws(e) {
|
|
2128
|
+
return Go(vs, e);
|
|
2129
|
+
}
|
|
2130
|
+
const ks = (e, n) => {
|
|
2131
|
+
Hn.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
2132
|
+
format: {
|
|
2133
|
+
value: (t) => Ir(e, t)
|
|
2134
|
+
// enumerable: false,
|
|
2135
|
+
},
|
|
2136
|
+
flatten: {
|
|
2137
|
+
value: (t) => $r(e, t)
|
|
2138
|
+
// enumerable: false,
|
|
2139
|
+
},
|
|
2140
|
+
addIssue: {
|
|
2141
|
+
value: (t) => {
|
|
2142
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, Ke, 2);
|
|
2143
|
+
}
|
|
2144
|
+
// enumerable: false,
|
|
2145
|
+
},
|
|
2146
|
+
addIssues: {
|
|
2147
|
+
value: (t) => {
|
|
2148
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, Ke, 2);
|
|
2149
|
+
}
|
|
2150
|
+
// enumerable: false,
|
|
2151
|
+
},
|
|
2152
|
+
isEmpty: {
|
|
2153
|
+
get() {
|
|
2154
|
+
return e.issues.length === 0;
|
|
2155
|
+
}
|
|
2156
|
+
// enumerable: false,
|
|
2157
|
+
}
|
|
2158
|
+
});
|
|
2159
|
+
}, V = h("ZodError", ks, {
|
|
2160
|
+
Parent: Error
|
|
2161
|
+
}), Ns = /* @__PURE__ */ dn(V), bs = /* @__PURE__ */ hn(V), Ps = /* @__PURE__ */ xe(V), zs = /* @__PURE__ */ qe(V), Zs = /* @__PURE__ */ Tr(V), As = /* @__PURE__ */ Rr(V), $s = /* @__PURE__ */ Dr(V), Is = /* @__PURE__ */ Fr(V), Os = /* @__PURE__ */ Er(V), Cs = /* @__PURE__ */ Ur(V), Ts = /* @__PURE__ */ yr(V), Rs = /* @__PURE__ */ Lr(V), R = /* @__PURE__ */ h("ZodType", (e, n) => (T.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
|
|
2162
|
+
{
|
|
2163
|
+
...n,
|
|
2164
|
+
checks: [
|
|
2165
|
+
...n.checks ?? [],
|
|
2166
|
+
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2167
|
+
]
|
|
2168
|
+
}
|
|
2169
|
+
// { parent: true }
|
|
2170
|
+
), e.clone = (t, r) => se(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => Ns(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Ps(e, t, r), e.parseAsync = async (t, r) => bs(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => zs(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Zs(e, t, r), e.decode = (t, r) => As(e, t, r), e.encodeAsync = async (t, r) => $s(e, t, r), e.decodeAsync = async (t, r) => Is(e, t, r), e.safeEncode = (t, r) => Os(e, t, r), e.safeDecode = (t, r) => Cs(e, t, r), e.safeEncodeAsync = async (t, r) => Ts(e, t, r), e.safeDecodeAsync = async (t, r) => Rs(e, t, r), e.refine = (t, r) => e.check(zu(t, r)), e.superRefine = (t) => e.check(Zu(t)), e.overwrite = (t) => e.check(Pe(t)), e.optional = () => yn(e), e.nullable = () => Ln(e), e.nullish = () => yn(Ln(e)), e.nonoptional = (t) => _u(e, t), e.array = () => ft(e), e.or = (t) => cu([e, t]), e.and = (t) => lu(e, t), e.transform = (t) => nn(e, ht(t)), e.default = (t) => pu(e, t), e.prefault = (t) => gu(e, t), e.catch = (t) => wu(e, t), e.pipe = (t) => nn(e, t), e.readonly = () => bu(e), e.describe = (t) => {
|
|
2171
|
+
const r = e.clone();
|
|
2172
|
+
return Oe.add(r, { description: t }), r;
|
|
2173
|
+
}, Object.defineProperty(e, "description", {
|
|
2174
|
+
get() {
|
|
2175
|
+
var t;
|
|
2176
|
+
return (t = Oe.get(e)) == null ? void 0 : t.description;
|
|
2177
|
+
},
|
|
2178
|
+
configurable: !0
|
|
2179
|
+
}), e.meta = (...t) => {
|
|
2180
|
+
if (t.length === 0)
|
|
2181
|
+
return Oe.get(e);
|
|
2182
|
+
const r = e.clone();
|
|
2183
|
+
return Oe.add(r, t[0]), r;
|
|
2184
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), at = /* @__PURE__ */ h("_ZodString", (e, n) => {
|
|
2185
|
+
pn.init(e, n), R.init(e, n);
|
|
2186
|
+
const t = e._zod.bag;
|
|
2187
|
+
e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(Ko(...r)), e.includes = (...r) => e.check(ns(...r)), e.startsWith = (...r) => e.check(ts(...r)), e.endsWith = (...r) => e.check(rs(...r)), e.min = (...r) => e.check(Ee(...r)), e.max = (...r) => e.check(ut(...r)), e.length = (...r) => e.check(ct(...r)), e.nonempty = (...r) => e.check(Ee(1, ...r)), e.lowercase = (r) => e.check(Xo(r)), e.uppercase = (r) => e.check(es(r)), e.trim = () => e.check(os()), e.normalize = (...r) => e.check(is(...r)), e.toLowerCase = () => e.check(ss()), e.toUpperCase = () => e.check(us());
|
|
2188
|
+
}), Ds = /* @__PURE__ */ h("ZodString", (e, n) => {
|
|
2189
|
+
pn.init(e, n), at.init(e, n), e.email = (t) => e.check(ot(lt, t)), e.url = (t) => e.check(Zo(Es, t)), e.jwt = (t) => e.check(xo(Qs, t)), e.emoji = (t) => e.check(Ao(Us, t)), e.guid = (t) => e.check(Cn(Fn, t)), e.uuid = (t) => e.check(st(we, t)), e.uuidv4 = (t) => e.check(bo(we, t)), e.uuidv6 = (t) => e.check(Po(we, t)), e.uuidv7 = (t) => e.check(zo(we, t)), e.nanoid = (t) => e.check($o(ys, t)), e.guid = (t) => e.check(Cn(Fn, t)), e.cuid = (t) => e.check(Io(Ls, t)), e.cuid2 = (t) => e.check(Oo(js, t)), e.ulid = (t) => e.check(Co(xs, t)), e.base64 = (t) => e.check(yo(Hs, t)), e.base64url = (t) => e.check(Lo(Ws, t)), e.xid = (t) => e.check(To(qs, t)), e.ksuid = (t) => e.check(Ro(Bs, t)), e.ipv4 = (t) => e.check(Do(Ss, t)), e.ipv6 = (t) => e.check(Fo(Gs, t)), e.cidrv4 = (t) => e.check(Eo(Vs, t)), e.cidrv6 = (t) => e.check(Uo(Ms, t)), e.e164 = (t) => e.check(jo(Ys, t)), e.datetime = (t) => e.check(hs(t)), e.date = (t) => e.check(ms(t)), e.time = (t) => e.check(_s(t)), e.duration = (t) => e.check(ws(t));
|
|
2190
|
+
});
|
|
2191
|
+
function J(e) {
|
|
2192
|
+
return No(Ds, e);
|
|
2193
|
+
}
|
|
2194
|
+
const C = /* @__PURE__ */ h("ZodStringFormat", (e, n) => {
|
|
2195
|
+
O.init(e, n), at.init(e, n);
|
|
2196
|
+
}), lt = /* @__PURE__ */ h("ZodEmail", (e, n) => {
|
|
2197
|
+
Ii.init(e, n), C.init(e, n);
|
|
2198
|
+
});
|
|
2199
|
+
function Se(e) {
|
|
2200
|
+
return ot(lt, e);
|
|
2201
|
+
}
|
|
2202
|
+
const Fn = /* @__PURE__ */ h("ZodGUID", (e, n) => {
|
|
2203
|
+
Ai.init(e, n), C.init(e, n);
|
|
2204
|
+
}), we = /* @__PURE__ */ h("ZodUUID", (e, n) => {
|
|
2205
|
+
$i.init(e, n), C.init(e, n);
|
|
2206
|
+
});
|
|
2207
|
+
function Fs(e) {
|
|
2208
|
+
return st(we, e);
|
|
2209
|
+
}
|
|
2210
|
+
const Es = /* @__PURE__ */ h("ZodURL", (e, n) => {
|
|
2211
|
+
Oi.init(e, n), C.init(e, n);
|
|
2212
|
+
}), Us = /* @__PURE__ */ h("ZodEmoji", (e, n) => {
|
|
2213
|
+
Ci.init(e, n), C.init(e, n);
|
|
2214
|
+
}), ys = /* @__PURE__ */ h("ZodNanoID", (e, n) => {
|
|
2215
|
+
Ti.init(e, n), C.init(e, n);
|
|
2216
|
+
}), Ls = /* @__PURE__ */ h("ZodCUID", (e, n) => {
|
|
2217
|
+
Ri.init(e, n), C.init(e, n);
|
|
2218
|
+
}), js = /* @__PURE__ */ h("ZodCUID2", (e, n) => {
|
|
2219
|
+
Di.init(e, n), C.init(e, n);
|
|
2220
|
+
}), xs = /* @__PURE__ */ h("ZodULID", (e, n) => {
|
|
2221
|
+
Fi.init(e, n), C.init(e, n);
|
|
2222
|
+
}), qs = /* @__PURE__ */ h("ZodXID", (e, n) => {
|
|
2223
|
+
Ei.init(e, n), C.init(e, n);
|
|
2224
|
+
}), Bs = /* @__PURE__ */ h("ZodKSUID", (e, n) => {
|
|
2225
|
+
Ui.init(e, n), C.init(e, n);
|
|
2226
|
+
}), Ss = /* @__PURE__ */ h("ZodIPv4", (e, n) => {
|
|
2227
|
+
qi.init(e, n), C.init(e, n);
|
|
2228
|
+
}), Gs = /* @__PURE__ */ h("ZodIPv6", (e, n) => {
|
|
2229
|
+
Bi.init(e, n), C.init(e, n);
|
|
2230
|
+
}), Vs = /* @__PURE__ */ h("ZodCIDRv4", (e, n) => {
|
|
2231
|
+
Si.init(e, n), C.init(e, n);
|
|
2232
|
+
}), Ms = /* @__PURE__ */ h("ZodCIDRv6", (e, n) => {
|
|
2233
|
+
Gi.init(e, n), C.init(e, n);
|
|
2234
|
+
}), Hs = /* @__PURE__ */ h("ZodBase64", (e, n) => {
|
|
2235
|
+
Vi.init(e, n), C.init(e, n);
|
|
2236
|
+
}), Ws = /* @__PURE__ */ h("ZodBase64URL", (e, n) => {
|
|
2237
|
+
Hi.init(e, n), C.init(e, n);
|
|
2238
|
+
}), Ys = /* @__PURE__ */ h("ZodE164", (e, n) => {
|
|
2239
|
+
Wi.init(e, n), C.init(e, n);
|
|
2240
|
+
}), Qs = /* @__PURE__ */ h("ZodJWT", (e, n) => {
|
|
2241
|
+
Qi.init(e, n), C.init(e, n);
|
|
2242
|
+
}), mn = /* @__PURE__ */ h("ZodNumber", (e, n) => {
|
|
2243
|
+
tt.init(e, n), R.init(e, n), e.gt = (r, i) => e.check(Rn(r, i)), e.gte = (r, i) => e.check(Te(r, i)), e.min = (r, i) => e.check(Te(r, i)), e.lt = (r, i) => e.check(Tn(r, i)), e.lte = (r, i) => e.check(Ce(r, i)), e.max = (r, i) => e.check(Ce(r, i)), e.int = (r) => e.check(En(r)), e.safe = (r) => e.check(En(r)), e.positive = (r) => e.check(Rn(0, r)), e.nonnegative = (r) => e.check(Te(0, r)), e.negative = (r) => e.check(Tn(0, r)), e.nonpositive = (r) => e.check(Ce(0, r)), e.multipleOf = (r, i) => e.check(Dn(r, i)), e.step = (r, i) => e.check(Dn(r, i)), e.finite = () => e;
|
|
2244
|
+
const t = e._zod.bag;
|
|
2245
|
+
e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
|
|
2246
|
+
});
|
|
2247
|
+
function ge(e) {
|
|
2248
|
+
return Vo(mn, e);
|
|
2249
|
+
}
|
|
2250
|
+
const Js = /* @__PURE__ */ h("ZodNumberFormat", (e, n) => {
|
|
2251
|
+
Ji.init(e, n), mn.init(e, n);
|
|
2252
|
+
});
|
|
2253
|
+
function En(e) {
|
|
2254
|
+
return Ho(Js, e);
|
|
2255
|
+
}
|
|
2256
|
+
const Ks = /* @__PURE__ */ h("ZodBoolean", (e, n) => {
|
|
2257
|
+
Ki.init(e, n), R.init(e, n);
|
|
2258
|
+
});
|
|
2259
|
+
function Xs(e) {
|
|
2260
|
+
return Wo(Ks, e);
|
|
2261
|
+
}
|
|
2262
|
+
const eu = /* @__PURE__ */ h("ZodUnknown", (e, n) => {
|
|
2263
|
+
Xi.init(e, n), R.init(e, n);
|
|
2264
|
+
});
|
|
2265
|
+
function Un() {
|
|
2266
|
+
return Yo(eu);
|
|
2267
|
+
}
|
|
2268
|
+
const nu = /* @__PURE__ */ h("ZodNever", (e, n) => {
|
|
2269
|
+
eo.init(e, n), R.init(e, n);
|
|
2270
|
+
});
|
|
2271
|
+
function tu(e) {
|
|
2272
|
+
return Qo(nu, e);
|
|
2273
|
+
}
|
|
2274
|
+
const ru = /* @__PURE__ */ h("ZodDate", (e, n) => {
|
|
2275
|
+
no.init(e, n), R.init(e, n), e.min = (r, i) => e.check(Te(r, i)), e.max = (r, i) => e.check(Ce(r, i));
|
|
2276
|
+
const t = e._zod.bag;
|
|
2277
|
+
e.minDate = t.minimum ? new Date(t.minimum) : null, e.maxDate = t.maximum ? new Date(t.maximum) : null;
|
|
2278
|
+
});
|
|
2279
|
+
function iu(e) {
|
|
2280
|
+
return Jo(ru, e);
|
|
2281
|
+
}
|
|
2282
|
+
const ou = /* @__PURE__ */ h("ZodArray", (e, n) => {
|
|
2283
|
+
to.init(e, n), R.init(e, n), e.element = n.element, e.min = (t, r) => e.check(Ee(t, r)), e.nonempty = (t) => e.check(Ee(1, t)), e.max = (t, r) => e.check(ut(t, r)), e.length = (t, r) => e.check(ct(t, r)), e.unwrap = () => e.element;
|
|
2284
|
+
});
|
|
2285
|
+
function ft(e, n) {
|
|
2286
|
+
return cs(ou, e, n);
|
|
2287
|
+
}
|
|
2288
|
+
const su = /* @__PURE__ */ h("ZodObject", (e, n) => {
|
|
2289
|
+
io.init(e, n), R.init(e, n), A(e, "shape", () => n.shape), e.keyof = () => dt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Un() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Un() }), e.strict = () => e.clone({ ...e._zod.def, catchall: tu() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => br(e, t), e.safeExtend = (t) => Pr(e, t), e.merge = (t) => zr(e, t), e.pick = (t) => kr(e, t), e.omit = (t) => Nr(e, t), e.partial = (...t) => Zr(pt, e, t[0]), e.required = (...t) => Ar(mt, e, t[0]);
|
|
2290
|
+
});
|
|
2291
|
+
function x(e, n) {
|
|
2292
|
+
const t = {
|
|
2293
|
+
type: "object",
|
|
2294
|
+
get shape() {
|
|
2295
|
+
return oe(this, "shape", e ? mr(e) : {}), this.shape;
|
|
2296
|
+
},
|
|
2297
|
+
..._(n)
|
|
2298
|
+
};
|
|
2299
|
+
return new su(t);
|
|
2300
|
+
}
|
|
2301
|
+
const uu = /* @__PURE__ */ h("ZodUnion", (e, n) => {
|
|
2302
|
+
oo.init(e, n), R.init(e, n), e.options = n.options;
|
|
2303
|
+
});
|
|
2304
|
+
function cu(e, n) {
|
|
2305
|
+
return new uu({
|
|
2306
|
+
type: "union",
|
|
2307
|
+
options: e,
|
|
2308
|
+
..._(n)
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
const au = /* @__PURE__ */ h("ZodIntersection", (e, n) => {
|
|
2312
|
+
so.init(e, n), R.init(e, n);
|
|
2313
|
+
});
|
|
2314
|
+
function lu(e, n) {
|
|
2315
|
+
return new au({
|
|
2316
|
+
type: "intersection",
|
|
2317
|
+
left: e,
|
|
2318
|
+
right: n
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
const en = /* @__PURE__ */ h("ZodEnum", (e, n) => {
|
|
2322
|
+
uo.init(e, n), R.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
|
|
2323
|
+
const t = new Set(Object.keys(n.entries));
|
|
2324
|
+
e.extract = (r, i) => {
|
|
2325
|
+
const o = {};
|
|
2326
|
+
for (const s of r)
|
|
2327
|
+
if (t.has(s))
|
|
2328
|
+
o[s] = n.entries[s];
|
|
2329
|
+
else
|
|
2330
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
2331
|
+
return new en({
|
|
2332
|
+
...n,
|
|
2333
|
+
checks: [],
|
|
2334
|
+
..._(i),
|
|
2335
|
+
entries: o
|
|
2336
|
+
});
|
|
2337
|
+
}, e.exclude = (r, i) => {
|
|
2338
|
+
const o = { ...n.entries };
|
|
2339
|
+
for (const s of r)
|
|
2340
|
+
if (t.has(s))
|
|
2341
|
+
delete o[s];
|
|
2342
|
+
else
|
|
2343
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
2344
|
+
return new en({
|
|
2345
|
+
...n,
|
|
2346
|
+
checks: [],
|
|
2347
|
+
..._(i),
|
|
2348
|
+
entries: o
|
|
2349
|
+
});
|
|
2350
|
+
};
|
|
2351
|
+
});
|
|
2352
|
+
function dt(e, n) {
|
|
2353
|
+
const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2354
|
+
return new en({
|
|
2355
|
+
type: "enum",
|
|
2356
|
+
entries: t,
|
|
2357
|
+
..._(n)
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
const fu = /* @__PURE__ */ h("ZodTransform", (e, n) => {
|
|
2361
|
+
co.init(e, n), R.init(e, n), e._zod.parse = (t, r) => {
|
|
2362
|
+
if (r.direction === "backward")
|
|
2363
|
+
throw new Bn(e.constructor.name);
|
|
2364
|
+
t.addIssue = (o) => {
|
|
2365
|
+
if (typeof o == "string")
|
|
2366
|
+
t.issues.push(Ne(o, t.value, n));
|
|
2367
|
+
else {
|
|
2368
|
+
const s = o;
|
|
2369
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(Ne(s));
|
|
2370
|
+
}
|
|
2371
|
+
};
|
|
2372
|
+
const i = n.transform(t.value, t);
|
|
2373
|
+
return i instanceof Promise ? i.then((o) => (t.value = o, t)) : (t.value = i, t);
|
|
2374
|
+
};
|
|
2375
|
+
});
|
|
2376
|
+
function ht(e) {
|
|
2377
|
+
return new fu({
|
|
2378
|
+
type: "transform",
|
|
2379
|
+
transform: e
|
|
2380
|
+
});
|
|
2381
|
+
}
|
|
2382
|
+
const pt = /* @__PURE__ */ h("ZodOptional", (e, n) => {
|
|
2383
|
+
ao.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
2384
|
+
});
|
|
2385
|
+
function yn(e) {
|
|
2386
|
+
return new pt({
|
|
2387
|
+
type: "optional",
|
|
2388
|
+
innerType: e
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2391
|
+
const du = /* @__PURE__ */ h("ZodNullable", (e, n) => {
|
|
2392
|
+
lo.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
2393
|
+
});
|
|
2394
|
+
function Ln(e) {
|
|
2395
|
+
return new du({
|
|
2396
|
+
type: "nullable",
|
|
2397
|
+
innerType: e
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
const hu = /* @__PURE__ */ h("ZodDefault", (e, n) => {
|
|
2401
|
+
fo.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2402
|
+
});
|
|
2403
|
+
function pu(e, n) {
|
|
2404
|
+
return new hu({
|
|
2405
|
+
type: "default",
|
|
2406
|
+
innerType: e,
|
|
2407
|
+
get defaultValue() {
|
|
2408
|
+
return typeof n == "function" ? n() : Gn(n);
|
|
2409
|
+
}
|
|
2410
|
+
});
|
|
2411
|
+
}
|
|
2412
|
+
const mu = /* @__PURE__ */ h("ZodPrefault", (e, n) => {
|
|
2413
|
+
ho.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
2414
|
+
});
|
|
2415
|
+
function gu(e, n) {
|
|
2416
|
+
return new mu({
|
|
2417
|
+
type: "prefault",
|
|
2418
|
+
innerType: e,
|
|
2419
|
+
get defaultValue() {
|
|
2420
|
+
return typeof n == "function" ? n() : Gn(n);
|
|
2421
|
+
}
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
const mt = /* @__PURE__ */ h("ZodNonOptional", (e, n) => {
|
|
2425
|
+
po.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
2426
|
+
});
|
|
2427
|
+
function _u(e, n) {
|
|
2428
|
+
return new mt({
|
|
2429
|
+
type: "nonoptional",
|
|
2430
|
+
innerType: e,
|
|
2431
|
+
..._(n)
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
const vu = /* @__PURE__ */ h("ZodCatch", (e, n) => {
|
|
2435
|
+
mo.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2436
|
+
});
|
|
2437
|
+
function wu(e, n) {
|
|
2438
|
+
return new vu({
|
|
2439
|
+
type: "catch",
|
|
2440
|
+
innerType: e,
|
|
2441
|
+
catchValue: typeof n == "function" ? n : () => n
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2444
|
+
const ku = /* @__PURE__ */ h("ZodPipe", (e, n) => {
|
|
2445
|
+
go.init(e, n), R.init(e, n), e.in = n.in, e.out = n.out;
|
|
2446
|
+
});
|
|
2447
|
+
function nn(e, n) {
|
|
2448
|
+
return new ku({
|
|
2449
|
+
type: "pipe",
|
|
2450
|
+
in: e,
|
|
2451
|
+
out: n
|
|
2452
|
+
// ...util.normalizeParams(params),
|
|
2453
|
+
});
|
|
2454
|
+
}
|
|
2455
|
+
const Nu = /* @__PURE__ */ h("ZodReadonly", (e, n) => {
|
|
2456
|
+
_o.init(e, n), R.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
2457
|
+
});
|
|
2458
|
+
function bu(e) {
|
|
2459
|
+
return new Nu({
|
|
2460
|
+
type: "readonly",
|
|
2461
|
+
innerType: e
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
const Pu = /* @__PURE__ */ h("ZodCustom", (e, n) => {
|
|
2465
|
+
vo.init(e, n), R.init(e, n);
|
|
2466
|
+
});
|
|
2467
|
+
function zu(e, n = {}) {
|
|
2468
|
+
return as(Pu, e, n);
|
|
2469
|
+
}
|
|
2470
|
+
function Zu(e) {
|
|
2471
|
+
return ls(e);
|
|
2472
|
+
}
|
|
2473
|
+
function gt(e, n) {
|
|
2474
|
+
return nn(ht(e), n);
|
|
2475
|
+
}
|
|
2476
|
+
function Au(e) {
|
|
2477
|
+
return Mo(mn, e);
|
|
2478
|
+
}
|
|
2479
|
+
function Yc(e, n, t) {
|
|
2480
|
+
const r = n.safeParse(t);
|
|
2481
|
+
return r.success ? r.data : (r.error.issues.forEach((i) => {
|
|
2482
|
+
const o = i.path.join(".");
|
|
2483
|
+
e.getFieldState(o) ? e.setError(o, {
|
|
2484
|
+
type: "manual",
|
|
2485
|
+
message: i.message
|
|
2486
|
+
}) : e.setError("root", {
|
|
2487
|
+
type: "manual",
|
|
2488
|
+
message: i.message
|
|
2489
|
+
});
|
|
2490
|
+
}), null);
|
|
2491
|
+
}
|
|
2492
|
+
const $u = (e) => gt((n) => {
|
|
2493
|
+
if (n) {
|
|
2494
|
+
if (typeof n == "string") {
|
|
2495
|
+
const t = Number(n);
|
|
2496
|
+
return isNaN(t) ? n : t;
|
|
2497
|
+
}
|
|
2498
|
+
return n;
|
|
2499
|
+
}
|
|
2500
|
+
}, e), Iu = (e) => gt((n) => {
|
|
2501
|
+
if (!n)
|
|
2502
|
+
return;
|
|
2503
|
+
let t;
|
|
2504
|
+
return typeof n == "string" && (t = new Date(n)), n instanceof Date && (t = n), t ? (t.setUTCHours(0, 0, 0, 0), t) : n;
|
|
2505
|
+
}, e), I = (e) => J().min(1, { error: "Required" }).max(e, `Maximum length is ${e} characters`), _t = () => Se("Invalid email address").min(1, "Required"), Ge = () => $u(
|
|
2506
|
+
ge("Valid amount required").positive("Positive amount required")
|
|
2507
|
+
), vt = () => Iu(
|
|
2508
|
+
iu("Valid date required").min(/* @__PURE__ */ new Date(), "Date must be in the future")
|
|
2509
|
+
), E = (e) => J().max(e, `Maximum length is ${e} characters`), Ou = x({
|
|
2510
|
+
address1: I(100),
|
|
2511
|
+
// Primary address line
|
|
2512
|
+
address2: E(100).optional(),
|
|
2513
|
+
// Secondary address line (optional)
|
|
2514
|
+
city: I(50),
|
|
2515
|
+
// City name
|
|
2516
|
+
state: E(50).optional(),
|
|
2517
|
+
// State/Province (optional for some countries)
|
|
2518
|
+
postcode: E(20).optional(),
|
|
2519
|
+
// Postal/ZIP code (optional for some countries)
|
|
2520
|
+
country: I(50)
|
|
2521
|
+
// Country name
|
|
2522
|
+
}), wt = x({
|
|
2523
|
+
amount: Ge(),
|
|
2524
|
+
message: E(500).nullish(),
|
|
2525
|
+
giverFirstName: I(50),
|
|
2526
|
+
giverLastName: I(50),
|
|
2527
|
+
giverEmail: _t(),
|
|
2528
|
+
giverPhone: I(31),
|
|
2529
|
+
giverAddress: Ou,
|
|
2530
|
+
// Use the international address schema
|
|
2531
|
+
cardHolder: I(101),
|
|
2532
|
+
recipientFirstName: E(50).nullish(),
|
|
2533
|
+
recipientLastName: E(50).nullish(),
|
|
2534
|
+
recipientEmail: Se("Invalid email address").nullish(),
|
|
2535
|
+
recipientPhone: E(31).nullish()
|
|
2536
|
+
}), Qc = wt.extend({
|
|
2537
|
+
expiry: vt(),
|
|
2538
|
+
notes: E(500).nullish()
|
|
2539
|
+
}), Jc = x({
|
|
2540
|
+
balance: Ge(),
|
|
2541
|
+
expiry: vt(),
|
|
2542
|
+
message: E(500).nullish(),
|
|
2543
|
+
notes: E(500).nullish(),
|
|
2544
|
+
giverFirstName: I(50),
|
|
2545
|
+
giverLastName: I(50),
|
|
2546
|
+
giverEmail: _t(),
|
|
2547
|
+
giverPhone: I(31),
|
|
2548
|
+
cardHolder: I(101),
|
|
2549
|
+
recipientEmail: Se("Invalid email address").nullish(),
|
|
2550
|
+
recipientPhone: E(31).nullish()
|
|
2551
|
+
});
|
|
2552
|
+
var Cu = /* @__PURE__ */ ((e) => (e.Passthrough = "Passthrough", e.PaymentProcessor = "PaymentProcessor", e))(Cu || {});
|
|
2553
|
+
const Kc = x({
|
|
2554
|
+
companyId: ge().int().positive(),
|
|
2555
|
+
amount: Ge(),
|
|
2556
|
+
currency: I(3).default("AUD")
|
|
2557
|
+
}), Tu = x({
|
|
2558
|
+
sessionId: I(100),
|
|
2559
|
+
resultCode: I(50),
|
|
2560
|
+
pspReference: E(100).optional()
|
|
2561
|
+
}), Ru = x({
|
|
2562
|
+
cardHolder: I(100),
|
|
2563
|
+
cardNumberToken: E(200),
|
|
2564
|
+
cardCvcToken: E(200),
|
|
2565
|
+
cardExpiry: E(5)
|
|
2566
|
+
// MM/YY format
|
|
2567
|
+
}), Xc = wt.extend({
|
|
2568
|
+
companyId: ge().int().positive(),
|
|
2569
|
+
sendViaEmail: Xs().default(!0),
|
|
2570
|
+
// Payment processor data (Adyen) - provided if using payment processor
|
|
2571
|
+
payment: Tu.optional(),
|
|
2572
|
+
// Passthrough payment data (VGS) - provided if using passthrough tokenization
|
|
2573
|
+
passthroughPayment: Ru.optional()
|
|
2574
|
+
}), ea = x({
|
|
2575
|
+
giftCardId: ge().int().positive(),
|
|
2576
|
+
reason: E(500).optional()
|
|
2577
|
+
}), Du = x({
|
|
2578
|
+
companyId: ge().int().positive().nullish(),
|
|
2579
|
+
code: I(10),
|
|
2580
|
+
password: I(10)
|
|
2581
|
+
}), na = Du.extend({
|
|
2582
|
+
amount: Ge(),
|
|
2583
|
+
description: I(200)
|
|
2584
|
+
});
|
|
2585
|
+
var Fu = /* @__PURE__ */ ((e) => (e.Adyen = "Adyen", e))(Fu || {}), Eu = /* @__PURE__ */ ((e) => (e.Pending = "Pending", e.Authorized = "Authorized", e.Captured = "Captured", e.Failed = "Failed", e.Refunded = "Refunded", e))(Eu || {}), Uu = /* @__PURE__ */ ((e) => (e.Authorised = "Authorised", e.Refused = "Refused", e.Cancelled = "Cancelled", e.Pending = "Pending", e.Received = "Received", e.Error = "Error", e.IdentifyShopper = "IdentifyShopper", e.ChallengeShopper = "ChallengeShopper", e))(Uu || {}), yu = /* @__PURE__ */ ((e) => (e.AUTHORISATION = "AUTHORISATION", e.CAPTURE = "CAPTURE", e.REFUND = "REFUND", e.CANCELLATION = "CANCELLATION", e.REFUND_FAILED = "REFUND_FAILED", e.CAPTURE_FAILED = "CAPTURE_FAILED", e))(yu || {}), Lu = /* @__PURE__ */ ((e) => (e.Purchase = "Purchase", e.Redemption = "Redemption", e.Adjustment = "Adjustment", e))(Lu || {}), ju = /* @__PURE__ */ ((e) => (e.Pending = "Pending", e.Complete = "Complete", e.Cancelled = "Cancelled", e.Expired = "Expired", e))(ju || {});
|
|
2586
|
+
const ta = x({
|
|
2587
|
+
code: I(10),
|
|
2588
|
+
token: I(128)
|
|
2589
|
+
}), ra = x({
|
|
2590
|
+
companyId: ge().int().positive(),
|
|
2591
|
+
code: I(10),
|
|
2592
|
+
token: I(128)
|
|
2593
|
+
}), ia = x({
|
|
2594
|
+
companyId: Au().int().positive()
|
|
2595
|
+
}), oa = x({
|
|
2596
|
+
giftCardPaymentType: dt([
|
|
2597
|
+
"Passthrough",
|
|
2598
|
+
"PaymentProcessor"
|
|
2599
|
+
/* PaymentProcessor */
|
|
2600
|
+
])
|
|
2601
|
+
}), sa = x({
|
|
2602
|
+
merchantAccount: I(100),
|
|
2603
|
+
clientKey: I(100),
|
|
2604
|
+
apiKey: E(200).optional(),
|
|
2605
|
+
webhookHmacKey: E(200).optional()
|
|
2606
|
+
}), ua = x({
|
|
2607
|
+
grant_type: J().readonly().default("refresh_token"),
|
|
2608
|
+
client_id: Fs(),
|
|
2609
|
+
client_secret: J(),
|
|
2610
|
+
refresh_token: J(),
|
|
2611
|
+
scope: J().optional()
|
|
2612
|
+
}), ca = x({
|
|
2613
|
+
email: Se(),
|
|
2614
|
+
firstName: J().max(100).optional(),
|
|
2615
|
+
lastName: J().max(100).optional(),
|
|
2616
|
+
phone: J().max(20).optional(),
|
|
2617
|
+
scopes: ft(J()).optional()
|
|
2618
|
+
});
|
|
2619
|
+
var H = /* @__PURE__ */ ((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))(H || {});
|
|
2620
|
+
const kt = [
|
|
2621
|
+
H.PER_NIGHT,
|
|
2622
|
+
H.PER_PERSON_PER_NIGHT,
|
|
2623
|
+
H.PER_QUANTITY_NAME_PER_NIGHT,
|
|
2624
|
+
H.PER_ROOM_QUANTITY_PER_NIGHT,
|
|
2625
|
+
H.PER_PERSON_OCCUPANCY_PER_NIGHT,
|
|
2626
|
+
H.PER_ADULT_OCCUPANCY_PER_NIGHT,
|
|
2627
|
+
H.PER_CHILD_OCCUPANCY_PER_NIGHT,
|
|
2628
|
+
H.PER_ALL_PERSONS_PER_NIGHT
|
|
2629
|
+
];
|
|
2630
|
+
var xu = /* @__PURE__ */ ((e) => (e.Critical = "Critical", e.Error = "Error", e.Warn = "Warn", e.Info = "Info", e))(xu || {}), qu = /* @__PURE__ */ ((e) => (e.Debug = "Diagnostics", e.Security = "Security", e.Audit = "Audit", e))(qu || {}), Bu = /* @__PURE__ */ ((e) => (e.General = "General", e.Authenticated = "Token Authenticated", e.Unauthorized = "Unauthorized Access", e.RefreshToken = "Refresh Token Created", e.AccessToken = "Access Token Created", e.Revoked = "Token Revoked", e.UserCreated = "User Created", e.UserLinked = "User Linked to Company", e.Purchase = "Gift Card Purchased", e.Payment = "Payment", e.Email = "Email Delivery", e.Transaction = "Gift Card Transaction", e))(Bu || {});
|
|
2631
|
+
const aa = (e) => {
|
|
2632
|
+
let n = 0;
|
|
2633
|
+
const t = Object.values(e.itinerary);
|
|
2634
|
+
for (const r of t) {
|
|
2635
|
+
const i = Object.keys(r.nights);
|
|
2636
|
+
for (const o of i)
|
|
2637
|
+
n += r.nights[o].total;
|
|
2638
|
+
}
|
|
2639
|
+
return n;
|
|
2640
|
+
};
|
|
2641
|
+
/*!
|
|
2642
|
+
* decimal.js v10.4.3
|
|
2643
|
+
* An arbitrary-precision Decimal type for JavaScript.
|
|
2644
|
+
* https://github.com/MikeMcl/decimal.js
|
|
2645
|
+
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
2646
|
+
* MIT Licence
|
|
2647
|
+
*/
|
|
2648
|
+
var de = 9e15, ue = 1e9, tn = "0123456789abcdef", Ue = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", ye = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", rn = {
|
|
2649
|
+
// These values must be integers within the stated ranges (inclusive).
|
|
2650
|
+
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
2651
|
+
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
2652
|
+
// E.g. `Decimal.config({ precision: 20 });`
|
|
2653
|
+
precision: 20,
|
|
2654
|
+
// 1 to MAX_DIGITS
|
|
2655
|
+
// The rounding mode used when rounding to `precision`.
|
|
2656
|
+
//
|
|
2657
|
+
// ROUND_UP 0 Away from zero.
|
|
2658
|
+
// ROUND_DOWN 1 Towards zero.
|
|
2659
|
+
// ROUND_CEIL 2 Towards +Infinity.
|
|
2660
|
+
// ROUND_FLOOR 3 Towards -Infinity.
|
|
2661
|
+
// ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
|
|
2662
|
+
// ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
|
|
2663
|
+
// ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
|
|
2664
|
+
// ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
|
|
2665
|
+
// ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
|
|
2666
|
+
//
|
|
2667
|
+
// E.g.
|
|
2668
|
+
// `Decimal.rounding = 4;`
|
|
2669
|
+
// `Decimal.rounding = Decimal.ROUND_HALF_UP;`
|
|
2670
|
+
rounding: 4,
|
|
2671
|
+
// 0 to 8
|
|
2672
|
+
// The modulo mode used when calculating the modulus: a mod n.
|
|
2673
|
+
// The quotient (q = a / n) is calculated according to the corresponding rounding mode.
|
|
2674
|
+
// The remainder (r) is calculated as: r = a - n * q.
|
|
2675
|
+
//
|
|
2676
|
+
// UP 0 The remainder is positive if the dividend is negative, else is negative.
|
|
2677
|
+
// DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
|
|
2678
|
+
// FLOOR 3 The remainder has the same sign as the divisor (Python %).
|
|
2679
|
+
// HALF_EVEN 6 The IEEE 754 remainder function.
|
|
2680
|
+
// EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
|
|
2681
|
+
//
|
|
2682
|
+
// Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
|
|
2683
|
+
// division (9) are commonly used for the modulus operation. The other rounding modes can also
|
|
2684
|
+
// be used, but they may not give useful results.
|
|
2685
|
+
modulo: 1,
|
|
2686
|
+
// 0 to 9
|
|
2687
|
+
// The exponent value at and beneath which `toString` returns exponential notation.
|
|
2688
|
+
// JavaScript numbers: -7
|
|
2689
|
+
toExpNeg: -7,
|
|
2690
|
+
// 0 to -EXP_LIMIT
|
|
2691
|
+
// The exponent value at and above which `toString` returns exponential notation.
|
|
2692
|
+
// JavaScript numbers: 21
|
|
2693
|
+
toExpPos: 21,
|
|
2694
|
+
// 0 to EXP_LIMIT
|
|
2695
|
+
// The minimum exponent value, beneath which underflow to zero occurs.
|
|
2696
|
+
// JavaScript numbers: -324 (5e-324)
|
|
2697
|
+
minE: -de,
|
|
2698
|
+
// -1 to -EXP_LIMIT
|
|
2699
|
+
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
2700
|
+
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
2701
|
+
maxE: de,
|
|
2702
|
+
// 1 to EXP_LIMIT
|
|
2703
|
+
// Whether to use cryptographically-secure random number generation, if available.
|
|
2704
|
+
crypto: !1
|
|
2705
|
+
// true/false
|
|
2706
|
+
}, Nt, ee, N = !0, Ve = "[DecimalError] ", re = Ve + "Invalid argument: ", bt = Ve + "Precision limit exceeded", Pt = Ve + "crypto unavailable", zt = "[object Decimal]", L = Math.floor, D = Math.pow, Su = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Gu = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Vu = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Zt = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Y = 1e7, v = 7, Mu = 9007199254740991, Hu = Ue.length - 1, on = ye.length - 1, p = { toStringTag: zt };
|
|
2707
|
+
p.absoluteValue = p.abs = function() {
|
|
2708
|
+
var e = new this.constructor(this);
|
|
2709
|
+
return e.s < 0 && (e.s = 1), g(e);
|
|
2710
|
+
};
|
|
2711
|
+
p.ceil = function() {
|
|
2712
|
+
return g(new this.constructor(this), this.e + 1, 2);
|
|
2713
|
+
};
|
|
2714
|
+
p.clampedTo = p.clamp = function(e, n) {
|
|
2715
|
+
var t, r = this, i = r.constructor;
|
|
2716
|
+
if (e = new i(e), n = new i(n), !e.s || !n.s)
|
|
2717
|
+
return new i(NaN);
|
|
2718
|
+
if (e.gt(n))
|
|
2719
|
+
throw Error(re + n);
|
|
2720
|
+
return t = r.cmp(e), t < 0 ? e : r.cmp(n) > 0 ? n : new i(r);
|
|
2721
|
+
};
|
|
2722
|
+
p.comparedTo = p.cmp = function(e) {
|
|
2723
|
+
var n, t, r, i, o = this, s = o.d, u = (e = new o.constructor(e)).d, c = o.s, a = e.s;
|
|
2724
|
+
if (!s || !u)
|
|
2725
|
+
return !c || !a ? NaN : c !== a ? c : s === u ? 0 : !s ^ c < 0 ? 1 : -1;
|
|
2726
|
+
if (!s[0] || !u[0])
|
|
2727
|
+
return s[0] ? c : u[0] ? -a : 0;
|
|
2728
|
+
if (c !== a)
|
|
2729
|
+
return c;
|
|
2730
|
+
if (o.e !== e.e)
|
|
2731
|
+
return o.e > e.e ^ c < 0 ? 1 : -1;
|
|
2732
|
+
for (r = s.length, i = u.length, n = 0, t = r < i ? r : i; n < t; ++n)
|
|
2733
|
+
if (s[n] !== u[n])
|
|
2734
|
+
return s[n] > u[n] ^ c < 0 ? 1 : -1;
|
|
2735
|
+
return r === i ? 0 : r > i ^ c < 0 ? 1 : -1;
|
|
2736
|
+
};
|
|
2737
|
+
p.cosine = p.cos = function() {
|
|
2738
|
+
var e, n, t = this, r = t.constructor;
|
|
2739
|
+
return t.d ? t.d[0] ? (e = r.precision, n = r.rounding, r.precision = e + Math.max(t.e, t.sd()) + v, r.rounding = 1, t = Wu(r, Ct(r, t)), r.precision = e, r.rounding = n, g(ee == 2 || ee == 3 ? t.neg() : t, e, n, !0)) : new r(1) : new r(NaN);
|
|
2740
|
+
};
|
|
2741
|
+
p.cubeRoot = p.cbrt = function() {
|
|
2742
|
+
var e, n, t, r, i, o, s, u, c, a, l = this, f = l.constructor;
|
|
2743
|
+
if (!l.isFinite() || l.isZero())
|
|
2744
|
+
return new f(l);
|
|
2745
|
+
for (N = !1, o = l.s * D(l.s * l, 1 / 3), !o || Math.abs(o) == 1 / 0 ? (t = U(l.d), e = l.e, (o = (e - t.length + 1) % 3) && (t += o == 1 || o == -2 ? "0" : "00"), o = D(t, 1 / 3), e = L((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), o == 1 / 0 ? t = "5e" + e : (t = o.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + e), r = new f(t), r.s = l.s) : r = new f(o.toString()), s = (e = f.precision) + 3; ; )
|
|
2746
|
+
if (u = r, c = u.times(u).times(u), a = c.plus(l), r = z(a.plus(l).times(u), a.plus(c), s + 2, 1), U(u.d).slice(0, s) === (t = U(r.d)).slice(0, s))
|
|
2747
|
+
if (t = t.slice(s - 3, s + 1), t == "9999" || !i && t == "4999") {
|
|
2748
|
+
if (!i && (g(u, e + 1, 0), u.times(u).times(u).eq(l))) {
|
|
2749
|
+
r = u;
|
|
2750
|
+
break;
|
|
2751
|
+
}
|
|
2752
|
+
s += 4, i = 1;
|
|
2753
|
+
} else {
|
|
2754
|
+
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (g(r, e + 1, 1), n = !r.times(r).times(r).eq(l));
|
|
2755
|
+
break;
|
|
2756
|
+
}
|
|
2757
|
+
return N = !0, g(r, e, f.rounding, n);
|
|
2758
|
+
};
|
|
2759
|
+
p.decimalPlaces = p.dp = function() {
|
|
2760
|
+
var e, n = this.d, t = NaN;
|
|
2761
|
+
if (n) {
|
|
2762
|
+
if (e = n.length - 1, t = (e - L(this.e / v)) * v, e = n[e], e)
|
|
2763
|
+
for (; e % 10 == 0; e /= 10)
|
|
2764
|
+
t--;
|
|
2765
|
+
t < 0 && (t = 0);
|
|
2766
|
+
}
|
|
2767
|
+
return t;
|
|
2768
|
+
};
|
|
2769
|
+
p.dividedBy = p.div = function(e) {
|
|
2770
|
+
return z(this, new this.constructor(e));
|
|
2771
|
+
};
|
|
2772
|
+
p.dividedToIntegerBy = p.divToInt = function(e) {
|
|
2773
|
+
var n = this, t = n.constructor;
|
|
2774
|
+
return g(z(n, new t(e), 0, 1, 1), t.precision, t.rounding);
|
|
2775
|
+
};
|
|
2776
|
+
p.equals = p.eq = function(e) {
|
|
2777
|
+
return this.cmp(e) === 0;
|
|
2778
|
+
};
|
|
2779
|
+
p.floor = function() {
|
|
2780
|
+
return g(new this.constructor(this), this.e + 1, 3);
|
|
2781
|
+
};
|
|
2782
|
+
p.greaterThan = p.gt = function(e) {
|
|
2783
|
+
return this.cmp(e) > 0;
|
|
2784
|
+
};
|
|
2785
|
+
p.greaterThanOrEqualTo = p.gte = function(e) {
|
|
2786
|
+
var n = this.cmp(e);
|
|
2787
|
+
return n == 1 || n === 0;
|
|
2788
|
+
};
|
|
2789
|
+
p.hyperbolicCosine = p.cosh = function() {
|
|
2790
|
+
var e, n, t, r, i, o = this, s = o.constructor, u = new s(1);
|
|
2791
|
+
if (!o.isFinite())
|
|
2792
|
+
return new s(o.s ? 1 / 0 : NaN);
|
|
2793
|
+
if (o.isZero())
|
|
2794
|
+
return u;
|
|
2795
|
+
t = s.precision, r = s.rounding, s.precision = t + Math.max(o.e, o.sd()) + 4, s.rounding = 1, i = o.d.length, i < 32 ? (e = Math.ceil(i / 3), n = (1 / He(4, e)).toString()) : (e = 16, n = "2.3283064365386962890625e-10"), o = pe(s, 1, o.times(n), new s(1), !0);
|
|
2796
|
+
for (var c, a = e, l = new s(8); a--; )
|
|
2797
|
+
c = o.times(o), o = u.minus(c.times(l.minus(c.times(l))));
|
|
2798
|
+
return g(o, s.precision = t, s.rounding = r, !0);
|
|
2799
|
+
};
|
|
2800
|
+
p.hyperbolicSine = p.sinh = function() {
|
|
2801
|
+
var e, n, t, r, i = this, o = i.constructor;
|
|
2802
|
+
if (!i.isFinite() || i.isZero())
|
|
2803
|
+
return new o(i);
|
|
2804
|
+
if (n = o.precision, t = o.rounding, o.precision = n + Math.max(i.e, i.sd()) + 4, o.rounding = 1, r = i.d.length, r < 3)
|
|
2805
|
+
i = pe(o, 2, i, i, !0);
|
|
2806
|
+
else {
|
|
2807
|
+
e = 1.4 * Math.sqrt(r), e = e > 16 ? 16 : e | 0, i = i.times(1 / He(5, e)), i = pe(o, 2, i, i, !0);
|
|
2808
|
+
for (var s, u = new o(5), c = new o(16), a = new o(20); e--; )
|
|
2809
|
+
s = i.times(i), i = i.times(u.plus(s.times(c.times(s).plus(a))));
|
|
2810
|
+
}
|
|
2811
|
+
return o.precision = n, o.rounding = t, g(i, n, t, !0);
|
|
2812
|
+
};
|
|
2813
|
+
p.hyperbolicTangent = p.tanh = function() {
|
|
2814
|
+
var e, n, t = this, r = t.constructor;
|
|
2815
|
+
return t.isFinite() ? t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + 7, r.rounding = 1, z(t.sinh(), t.cosh(), r.precision = e, r.rounding = n)) : new r(t.s);
|
|
2816
|
+
};
|
|
2817
|
+
p.inverseCosine = p.acos = function() {
|
|
2818
|
+
var e, n = this, t = n.constructor, r = n.abs().cmp(1), i = t.precision, o = t.rounding;
|
|
2819
|
+
return r !== -1 ? r === 0 ? n.isNeg() ? W(t, i, o) : new t(0) : new t(NaN) : n.isZero() ? W(t, i + 4, o).times(0.5) : (t.precision = i + 6, t.rounding = 1, n = n.asin(), e = W(t, i + 4, o).times(0.5), t.precision = i, t.rounding = o, e.minus(n));
|
|
2820
|
+
};
|
|
2821
|
+
p.inverseHyperbolicCosine = p.acosh = function() {
|
|
2822
|
+
var e, n, t = this, r = t.constructor;
|
|
2823
|
+
return t.lte(1) ? new r(t.eq(1) ? 0 : NaN) : t.isFinite() ? (e = r.precision, n = r.rounding, r.precision = e + Math.max(Math.abs(t.e), t.sd()) + 4, r.rounding = 1, N = !1, t = t.times(t).minus(1).sqrt().plus(t), N = !0, r.precision = e, r.rounding = n, t.ln()) : new r(t);
|
|
2824
|
+
};
|
|
2825
|
+
p.inverseHyperbolicSine = p.asinh = function() {
|
|
2826
|
+
var e, n, t = this, r = t.constructor;
|
|
2827
|
+
return !t.isFinite() || t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, r.rounding = 1, N = !1, t = t.times(t).plus(1).sqrt().plus(t), N = !0, r.precision = e, r.rounding = n, t.ln());
|
|
2828
|
+
};
|
|
2829
|
+
p.inverseHyperbolicTangent = p.atanh = function() {
|
|
2830
|
+
var e, n, t, r, i = this, o = i.constructor;
|
|
2831
|
+
return i.isFinite() ? i.e >= 0 ? new o(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (e = o.precision, n = o.rounding, r = i.sd(), Math.max(r, e) < 2 * -i.e - 1 ? g(new o(i), e, n, !0) : (o.precision = t = r - i.e, i = z(i.plus(1), new o(1).minus(i), t + e, 1), o.precision = e + 4, o.rounding = 1, i = i.ln(), o.precision = e, o.rounding = n, i.times(0.5))) : new o(NaN);
|
|
2832
|
+
};
|
|
2833
|
+
p.inverseSine = p.asin = function() {
|
|
2834
|
+
var e, n, t, r, i = this, o = i.constructor;
|
|
2835
|
+
return i.isZero() ? new o(i) : (n = i.abs().cmp(1), t = o.precision, r = o.rounding, n !== -1 ? n === 0 ? (e = W(o, t + 4, r).times(0.5), e.s = i.s, e) : new o(NaN) : (o.precision = t + 6, o.rounding = 1, i = i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(), o.precision = t, o.rounding = r, i.times(2)));
|
|
2836
|
+
};
|
|
2837
|
+
p.inverseTangent = p.atan = function() {
|
|
2838
|
+
var e, n, t, r, i, o, s, u, c, a = this, l = a.constructor, f = l.precision, d = l.rounding;
|
|
2839
|
+
if (a.isFinite()) {
|
|
2840
|
+
if (a.isZero())
|
|
2841
|
+
return new l(a);
|
|
2842
|
+
if (a.abs().eq(1) && f + 4 <= on)
|
|
2843
|
+
return s = W(l, f + 4, d).times(0.25), s.s = a.s, s;
|
|
2844
|
+
} else {
|
|
2845
|
+
if (!a.s)
|
|
2846
|
+
return new l(NaN);
|
|
2847
|
+
if (f + 4 <= on)
|
|
2848
|
+
return s = W(l, f + 4, d).times(0.5), s.s = a.s, s;
|
|
2849
|
+
}
|
|
2850
|
+
for (l.precision = u = f + 10, l.rounding = 1, t = Math.min(28, u / v + 2 | 0), e = t; e; --e)
|
|
2851
|
+
a = a.div(a.times(a).plus(1).sqrt().plus(1));
|
|
2852
|
+
for (N = !1, n = Math.ceil(u / v), r = 1, c = a.times(a), s = new l(a), i = a; e !== -1; )
|
|
2853
|
+
if (i = i.times(c), o = s.minus(i.div(r += 2)), i = i.times(c), s = o.plus(i.div(r += 2)), s.d[n] !== void 0)
|
|
2854
|
+
for (e = n; s.d[e] === o.d[e] && e--; )
|
|
2855
|
+
;
|
|
2856
|
+
return t && (s = s.times(2 << t - 1)), N = !0, g(s, l.precision = f, l.rounding = d, !0);
|
|
2857
|
+
};
|
|
2858
|
+
p.isFinite = function() {
|
|
2859
|
+
return !!this.d;
|
|
2860
|
+
};
|
|
2861
|
+
p.isInteger = p.isInt = function() {
|
|
2862
|
+
return !!this.d && L(this.e / v) > this.d.length - 2;
|
|
2863
|
+
};
|
|
2864
|
+
p.isNaN = function() {
|
|
2865
|
+
return !this.s;
|
|
2866
|
+
};
|
|
2867
|
+
p.isNegative = p.isNeg = function() {
|
|
2868
|
+
return this.s < 0;
|
|
2869
|
+
};
|
|
2870
|
+
p.isPositive = p.isPos = function() {
|
|
2871
|
+
return this.s > 0;
|
|
2872
|
+
};
|
|
2873
|
+
p.isZero = function() {
|
|
2874
|
+
return !!this.d && this.d[0] === 0;
|
|
2875
|
+
};
|
|
2876
|
+
p.lessThan = p.lt = function(e) {
|
|
2877
|
+
return this.cmp(e) < 0;
|
|
2878
|
+
};
|
|
2879
|
+
p.lessThanOrEqualTo = p.lte = function(e) {
|
|
2880
|
+
return this.cmp(e) < 1;
|
|
2881
|
+
};
|
|
2882
|
+
p.logarithm = p.log = function(e) {
|
|
2883
|
+
var n, t, r, i, o, s, u, c, a = this, l = a.constructor, f = l.precision, d = l.rounding, m = 5;
|
|
2884
|
+
if (e == null)
|
|
2885
|
+
e = new l(10), n = !0;
|
|
2886
|
+
else {
|
|
2887
|
+
if (e = new l(e), t = e.d, e.s < 0 || !t || !t[0] || e.eq(1))
|
|
2888
|
+
return new l(NaN);
|
|
2889
|
+
n = e.eq(10);
|
|
2890
|
+
}
|
|
2891
|
+
if (t = a.d, a.s < 0 || !t || !t[0] || a.eq(1))
|
|
2892
|
+
return new l(t && !t[0] ? -1 / 0 : a.s != 1 ? NaN : t ? 0 : 1 / 0);
|
|
2893
|
+
if (n)
|
|
2894
|
+
if (t.length > 1)
|
|
2895
|
+
o = !0;
|
|
2896
|
+
else {
|
|
2897
|
+
for (i = t[0]; i % 10 === 0; )
|
|
2898
|
+
i /= 10;
|
|
2899
|
+
o = i !== 1;
|
|
2900
|
+
}
|
|
2901
|
+
if (N = !1, u = f + m, s = te(a, u), r = n ? Le(l, u + 10) : te(e, u), c = z(s, r, u, 1), be(c.d, i = f, d))
|
|
2902
|
+
do
|
|
2903
|
+
if (u += 10, s = te(a, u), r = n ? Le(l, u + 10) : te(e, u), c = z(s, r, u, 1), !o) {
|
|
2904
|
+
+U(c.d).slice(i + 1, i + 15) + 1 == 1e14 && (c = g(c, f + 1, 0));
|
|
2905
|
+
break;
|
|
2906
|
+
}
|
|
2907
|
+
while (be(c.d, i += 10, d));
|
|
2908
|
+
return N = !0, g(c, f, d);
|
|
2909
|
+
};
|
|
2910
|
+
p.minus = p.sub = function(e) {
|
|
2911
|
+
var n, t, r, i, o, s, u, c, a, l, f, d, m = this, k = m.constructor;
|
|
2912
|
+
if (e = new k(e), !m.d || !e.d)
|
|
2913
|
+
return !m.s || !e.s ? e = new k(NaN) : m.d ? e.s = -e.s : e = new k(e.d || m.s !== e.s ? m : NaN), e;
|
|
2914
|
+
if (m.s != e.s)
|
|
2915
|
+
return e.s = -e.s, m.plus(e);
|
|
2916
|
+
if (a = m.d, d = e.d, u = k.precision, c = k.rounding, !a[0] || !d[0]) {
|
|
2917
|
+
if (d[0])
|
|
2918
|
+
e.s = -e.s;
|
|
2919
|
+
else if (a[0])
|
|
2920
|
+
e = new k(m);
|
|
2921
|
+
else
|
|
2922
|
+
return new k(c === 3 ? -0 : 0);
|
|
2923
|
+
return N ? g(e, u, c) : e;
|
|
2924
|
+
}
|
|
2925
|
+
if (t = L(e.e / v), l = L(m.e / v), a = a.slice(), o = l - t, o) {
|
|
2926
|
+
for (f = o < 0, f ? (n = a, o = -o, s = d.length) : (n = d, t = l, s = a.length), r = Math.max(Math.ceil(u / v), s) + 2, o > r && (o = r, n.length = 1), n.reverse(), r = o; r--; )
|
|
2927
|
+
n.push(0);
|
|
2928
|
+
n.reverse();
|
|
2929
|
+
} else {
|
|
2930
|
+
for (r = a.length, s = d.length, f = r < s, f && (s = r), r = 0; r < s; r++)
|
|
2931
|
+
if (a[r] != d[r]) {
|
|
2932
|
+
f = a[r] < d[r];
|
|
2933
|
+
break;
|
|
2934
|
+
}
|
|
2935
|
+
o = 0;
|
|
2936
|
+
}
|
|
2937
|
+
for (f && (n = a, a = d, d = n, e.s = -e.s), s = a.length, r = d.length - s; r > 0; --r)
|
|
2938
|
+
a[s++] = 0;
|
|
2939
|
+
for (r = d.length; r > o; ) {
|
|
2940
|
+
if (a[--r] < d[r]) {
|
|
2941
|
+
for (i = r; i && a[--i] === 0; )
|
|
2942
|
+
a[i] = Y - 1;
|
|
2943
|
+
--a[i], a[r] += Y;
|
|
2944
|
+
}
|
|
2945
|
+
a[r] -= d[r];
|
|
2946
|
+
}
|
|
2947
|
+
for (; a[--s] === 0; )
|
|
2948
|
+
a.pop();
|
|
2949
|
+
for (; a[0] === 0; a.shift())
|
|
2950
|
+
--t;
|
|
2951
|
+
return a[0] ? (e.d = a, e.e = Me(a, t), N ? g(e, u, c) : e) : new k(c === 3 ? -0 : 0);
|
|
2952
|
+
};
|
|
2953
|
+
p.modulo = p.mod = function(e) {
|
|
2954
|
+
var n, t = this, r = t.constructor;
|
|
2955
|
+
return e = new r(e), !t.d || !e.s || e.d && !e.d[0] ? new r(NaN) : !e.d || t.d && !t.d[0] ? g(new r(t), r.precision, r.rounding) : (N = !1, r.modulo == 9 ? (n = z(t, e.abs(), 0, 3, 1), n.s *= e.s) : n = z(t, e, 0, r.modulo, 1), n = n.times(e), N = !0, t.minus(n));
|
|
2956
|
+
};
|
|
2957
|
+
p.naturalExponential = p.exp = function() {
|
|
2958
|
+
return sn(this);
|
|
2959
|
+
};
|
|
2960
|
+
p.naturalLogarithm = p.ln = function() {
|
|
2961
|
+
return te(this);
|
|
2962
|
+
};
|
|
2963
|
+
p.negated = p.neg = function() {
|
|
2964
|
+
var e = new this.constructor(this);
|
|
2965
|
+
return e.s = -e.s, g(e);
|
|
2966
|
+
};
|
|
2967
|
+
p.plus = p.add = function(e) {
|
|
2968
|
+
var n, t, r, i, o, s, u, c, a, l, f = this, d = f.constructor;
|
|
2969
|
+
if (e = new d(e), !f.d || !e.d)
|
|
2970
|
+
return !f.s || !e.s ? e = new d(NaN) : f.d || (e = new d(e.d || f.s === e.s ? f : NaN)), e;
|
|
2971
|
+
if (f.s != e.s)
|
|
2972
|
+
return e.s = -e.s, f.minus(e);
|
|
2973
|
+
if (a = f.d, l = e.d, u = d.precision, c = d.rounding, !a[0] || !l[0])
|
|
2974
|
+
return l[0] || (e = new d(f)), N ? g(e, u, c) : e;
|
|
2975
|
+
if (o = L(f.e / v), r = L(e.e / v), a = a.slice(), i = o - r, i) {
|
|
2976
|
+
for (i < 0 ? (t = a, i = -i, s = l.length) : (t = l, r = o, s = a.length), o = Math.ceil(u / v), s = o > s ? o + 1 : s + 1, i > s && (i = s, t.length = 1), t.reverse(); i--; )
|
|
2977
|
+
t.push(0);
|
|
2978
|
+
t.reverse();
|
|
2979
|
+
}
|
|
2980
|
+
for (s = a.length, i = l.length, s - i < 0 && (i = s, t = l, l = a, a = t), n = 0; i; )
|
|
2981
|
+
n = (a[--i] = a[i] + l[i] + n) / Y | 0, a[i] %= Y;
|
|
2982
|
+
for (n && (a.unshift(n), ++r), s = a.length; a[--s] == 0; )
|
|
2983
|
+
a.pop();
|
|
2984
|
+
return e.d = a, e.e = Me(a, r), N ? g(e, u, c) : e;
|
|
2985
|
+
};
|
|
2986
|
+
p.precision = p.sd = function(e) {
|
|
2987
|
+
var n, t = this;
|
|
2988
|
+
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0)
|
|
2989
|
+
throw Error(re + e);
|
|
2990
|
+
return t.d ? (n = At(t.d), e && t.e + 1 > n && (n = t.e + 1)) : n = NaN, n;
|
|
2991
|
+
};
|
|
2992
|
+
p.round = function() {
|
|
2993
|
+
var e = this, n = e.constructor;
|
|
2994
|
+
return g(new n(e), e.e + 1, n.rounding);
|
|
2995
|
+
};
|
|
2996
|
+
p.sine = p.sin = function() {
|
|
2997
|
+
var e, n, t = this, r = t.constructor;
|
|
2998
|
+
return t.isFinite() ? t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + Math.max(t.e, t.sd()) + v, r.rounding = 1, t = Qu(r, Ct(r, t)), r.precision = e, r.rounding = n, g(ee > 2 ? t.neg() : t, e, n, !0)) : new r(NaN);
|
|
2999
|
+
};
|
|
3000
|
+
p.squareRoot = p.sqrt = function() {
|
|
3001
|
+
var e, n, t, r, i, o, s = this, u = s.d, c = s.e, a = s.s, l = s.constructor;
|
|
3002
|
+
if (a !== 1 || !u || !u[0])
|
|
3003
|
+
return new l(!a || a < 0 && (!u || u[0]) ? NaN : u ? s : 1 / 0);
|
|
3004
|
+
for (N = !1, a = Math.sqrt(+s), a == 0 || a == 1 / 0 ? (n = U(u), (n.length + c) % 2 == 0 && (n += "0"), a = Math.sqrt(n), c = L((c + 1) / 2) - (c < 0 || c % 2), a == 1 / 0 ? n = "5e" + c : (n = a.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + c), r = new l(n)) : r = new l(a.toString()), t = (c = l.precision) + 3; ; )
|
|
3005
|
+
if (o = r, r = o.plus(z(s, o, t + 2, 1)).times(0.5), U(o.d).slice(0, t) === (n = U(r.d)).slice(0, t))
|
|
3006
|
+
if (n = n.slice(t - 3, t + 1), n == "9999" || !i && n == "4999") {
|
|
3007
|
+
if (!i && (g(o, c + 1, 0), o.times(o).eq(s))) {
|
|
3008
|
+
r = o;
|
|
3009
|
+
break;
|
|
3010
|
+
}
|
|
3011
|
+
t += 4, i = 1;
|
|
3012
|
+
} else {
|
|
3013
|
+
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (g(r, c + 1, 1), e = !r.times(r).eq(s));
|
|
3014
|
+
break;
|
|
3015
|
+
}
|
|
3016
|
+
return N = !0, g(r, c, l.rounding, e);
|
|
3017
|
+
};
|
|
3018
|
+
p.tangent = p.tan = function() {
|
|
3019
|
+
var e, n, t = this, r = t.constructor;
|
|
3020
|
+
return t.isFinite() ? t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + 10, r.rounding = 1, t = t.sin(), t.s = 1, t = z(t, new r(1).minus(t.times(t)).sqrt(), e + 10, 0), r.precision = e, r.rounding = n, g(ee == 2 || ee == 4 ? t.neg() : t, e, n, !0)) : new r(NaN);
|
|
3021
|
+
};
|
|
3022
|
+
p.times = p.mul = function(e) {
|
|
3023
|
+
var n, t, r, i, o, s, u, c, a, l = this, f = l.constructor, d = l.d, m = (e = new f(e)).d;
|
|
3024
|
+
if (e.s *= l.s, !d || !d[0] || !m || !m[0])
|
|
3025
|
+
return new f(!e.s || d && !d[0] && !m || m && !m[0] && !d ? NaN : !d || !m ? e.s / 0 : e.s * 0);
|
|
3026
|
+
for (t = L(l.e / v) + L(e.e / v), c = d.length, a = m.length, c < a && (o = d, d = m, m = o, s = c, c = a, a = s), o = [], s = c + a, r = s; r--; )
|
|
3027
|
+
o.push(0);
|
|
3028
|
+
for (r = a; --r >= 0; ) {
|
|
3029
|
+
for (n = 0, i = c + r; i > r; )
|
|
3030
|
+
u = o[i] + m[r] * d[i - r - 1] + n, o[i--] = u % Y | 0, n = u / Y | 0;
|
|
3031
|
+
o[i] = (o[i] + n) % Y | 0;
|
|
3032
|
+
}
|
|
3033
|
+
for (; !o[--s]; )
|
|
3034
|
+
o.pop();
|
|
3035
|
+
return n ? ++t : o.shift(), e.d = o, e.e = Me(o, t), N ? g(e, f.precision, f.rounding) : e;
|
|
3036
|
+
};
|
|
3037
|
+
p.toBinary = function(e, n) {
|
|
3038
|
+
return gn(this, 2, e, n);
|
|
3039
|
+
};
|
|
3040
|
+
p.toDecimalPlaces = p.toDP = function(e, n) {
|
|
3041
|
+
var t = this, r = t.constructor;
|
|
3042
|
+
return t = new r(t), e === void 0 ? t : (B(e, 0, ue), n === void 0 ? n = r.rounding : B(n, 0, 8), g(t, e + t.e + 1, n));
|
|
3043
|
+
};
|
|
3044
|
+
p.toExponential = function(e, n) {
|
|
3045
|
+
var t, r = this, i = r.constructor;
|
|
3046
|
+
return e === void 0 ? t = K(r, !0) : (B(e, 0, ue), n === void 0 ? n = i.rounding : B(n, 0, 8), r = g(new i(r), e + 1, n), t = K(r, !0, e + 1)), r.isNeg() && !r.isZero() ? "-" + t : t;
|
|
3047
|
+
};
|
|
3048
|
+
p.toFixed = function(e, n) {
|
|
3049
|
+
var t, r, i = this, o = i.constructor;
|
|
3050
|
+
return e === void 0 ? t = K(i) : (B(e, 0, ue), n === void 0 ? n = o.rounding : B(n, 0, 8), r = g(new o(i), e + i.e + 1, n), t = K(r, !1, e + r.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
|
|
3051
|
+
};
|
|
3052
|
+
p.toFraction = function(e) {
|
|
3053
|
+
var n, t, r, i, o, s, u, c, a, l, f, d, m = this, k = m.d, w = m.constructor;
|
|
3054
|
+
if (!k)
|
|
3055
|
+
return new w(m);
|
|
3056
|
+
if (a = t = new w(1), r = c = new w(0), n = new w(r), o = n.e = At(k) - m.e - 1, s = o % v, n.d[0] = D(10, s < 0 ? v + s : s), e == null)
|
|
3057
|
+
e = o > 0 ? n : a;
|
|
3058
|
+
else {
|
|
3059
|
+
if (u = new w(e), !u.isInt() || u.lt(a))
|
|
3060
|
+
throw Error(re + u);
|
|
3061
|
+
e = u.gt(n) ? o > 0 ? n : a : u;
|
|
3062
|
+
}
|
|
3063
|
+
for (N = !1, u = new w(U(k)), l = w.precision, w.precision = o = k.length * v * 2; f = z(u, n, 0, 1, 1), i = t.plus(f.times(r)), i.cmp(e) != 1; )
|
|
3064
|
+
t = r, r = i, i = a, a = c.plus(f.times(i)), c = i, i = n, n = u.minus(f.times(i)), u = i;
|
|
3065
|
+
return i = z(e.minus(t), r, 0, 1, 1), c = c.plus(i.times(a)), t = t.plus(i.times(r)), c.s = a.s = m.s, d = z(a, r, o, 1).minus(m).abs().cmp(z(c, t, o, 1).minus(m).abs()) < 1 ? [a, r] : [c, t], w.precision = l, N = !0, d;
|
|
3066
|
+
};
|
|
3067
|
+
p.toHexadecimal = p.toHex = function(e, n) {
|
|
3068
|
+
return gn(this, 16, e, n);
|
|
3069
|
+
};
|
|
3070
|
+
p.toNearest = function(e, n) {
|
|
3071
|
+
var t = this, r = t.constructor;
|
|
3072
|
+
if (t = new r(t), e == null) {
|
|
3073
|
+
if (!t.d)
|
|
3074
|
+
return t;
|
|
3075
|
+
e = new r(1), n = r.rounding;
|
|
3076
|
+
} else {
|
|
3077
|
+
if (e = new r(e), n === void 0 ? n = r.rounding : B(n, 0, 8), !t.d)
|
|
3078
|
+
return e.s ? t : e;
|
|
3079
|
+
if (!e.d)
|
|
3080
|
+
return e.s && (e.s = t.s), e;
|
|
3081
|
+
}
|
|
3082
|
+
return e.d[0] ? (N = !1, t = z(t, e, 0, n, 1).times(e), N = !0, g(t)) : (e.s = t.s, t = e), t;
|
|
3083
|
+
};
|
|
3084
|
+
p.toNumber = function() {
|
|
3085
|
+
return +this;
|
|
3086
|
+
};
|
|
3087
|
+
p.toOctal = function(e, n) {
|
|
3088
|
+
return gn(this, 8, e, n);
|
|
3089
|
+
};
|
|
3090
|
+
p.toPower = p.pow = function(e) {
|
|
3091
|
+
var n, t, r, i, o, s, u = this, c = u.constructor, a = +(e = new c(e));
|
|
3092
|
+
if (!u.d || !e.d || !u.d[0] || !e.d[0])
|
|
3093
|
+
return new c(D(+u, a));
|
|
3094
|
+
if (u = new c(u), u.eq(1))
|
|
3095
|
+
return u;
|
|
3096
|
+
if (r = c.precision, o = c.rounding, e.eq(1))
|
|
3097
|
+
return g(u, r, o);
|
|
3098
|
+
if (n = L(e.e / v), n >= e.d.length - 1 && (t = a < 0 ? -a : a) <= Mu)
|
|
3099
|
+
return i = $t(c, u, t, r), e.s < 0 ? new c(1).div(i) : g(i, r, o);
|
|
3100
|
+
if (s = u.s, s < 0) {
|
|
3101
|
+
if (n < e.d.length - 1)
|
|
3102
|
+
return new c(NaN);
|
|
3103
|
+
if (e.d[n] & 1 || (s = 1), u.e == 0 && u.d[0] == 1 && u.d.length == 1)
|
|
3104
|
+
return u.s = s, u;
|
|
3105
|
+
}
|
|
3106
|
+
return t = D(+u, a), n = t == 0 || !isFinite(t) ? L(a * (Math.log("0." + U(u.d)) / Math.LN10 + u.e + 1)) : new c(t + "").e, n > c.maxE + 1 || n < c.minE - 1 ? new c(n > 0 ? s / 0 : 0) : (N = !1, c.rounding = u.s = 1, t = Math.min(12, (n + "").length), i = sn(e.times(te(u, r + t)), r), i.d && (i = g(i, r + 5, 1), be(i.d, r, o) && (n = r + 10, i = g(sn(e.times(te(u, n + t)), n), n + 5, 1), +U(i.d).slice(r + 1, r + 15) + 1 == 1e14 && (i = g(i, r + 1, 0)))), i.s = s, N = !0, c.rounding = o, g(i, r, o));
|
|
3107
|
+
};
|
|
3108
|
+
p.toPrecision = function(e, n) {
|
|
3109
|
+
var t, r = this, i = r.constructor;
|
|
3110
|
+
return e === void 0 ? t = K(r, r.e <= i.toExpNeg || r.e >= i.toExpPos) : (B(e, 1, ue), n === void 0 ? n = i.rounding : B(n, 0, 8), r = g(new i(r), e, n), t = K(r, e <= r.e || r.e <= i.toExpNeg, e)), r.isNeg() && !r.isZero() ? "-" + t : t;
|
|
3111
|
+
};
|
|
3112
|
+
p.toSignificantDigits = p.toSD = function(e, n) {
|
|
3113
|
+
var t = this, r = t.constructor;
|
|
3114
|
+
return e === void 0 ? (e = r.precision, n = r.rounding) : (B(e, 1, ue), n === void 0 ? n = r.rounding : B(n, 0, 8)), g(new r(t), e, n);
|
|
3115
|
+
};
|
|
3116
|
+
p.toString = function() {
|
|
3117
|
+
var e = this, n = e.constructor, t = K(e, e.e <= n.toExpNeg || e.e >= n.toExpPos);
|
|
3118
|
+
return e.isNeg() && !e.isZero() ? "-" + t : t;
|
|
3119
|
+
};
|
|
3120
|
+
p.truncated = p.trunc = function() {
|
|
3121
|
+
return g(new this.constructor(this), this.e + 1, 1);
|
|
3122
|
+
};
|
|
3123
|
+
p.valueOf = p.toJSON = function() {
|
|
3124
|
+
var e = this, n = e.constructor, t = K(e, e.e <= n.toExpNeg || e.e >= n.toExpPos);
|
|
3125
|
+
return e.isNeg() ? "-" + t : t;
|
|
3126
|
+
};
|
|
3127
|
+
function U(e) {
|
|
3128
|
+
var n, t, r, i = e.length - 1, o = "", s = e[0];
|
|
3129
|
+
if (i > 0) {
|
|
3130
|
+
for (o += s, n = 1; n < i; n++)
|
|
3131
|
+
r = e[n] + "", t = v - r.length, t && (o += ne(t)), o += r;
|
|
3132
|
+
s = e[n], r = s + "", t = v - r.length, t && (o += ne(t));
|
|
3133
|
+
} else if (s === 0)
|
|
3134
|
+
return "0";
|
|
3135
|
+
for (; s % 10 === 0; )
|
|
3136
|
+
s /= 10;
|
|
3137
|
+
return o + s;
|
|
3138
|
+
}
|
|
3139
|
+
function B(e, n, t) {
|
|
3140
|
+
if (e !== ~~e || e < n || e > t)
|
|
3141
|
+
throw Error(re + e);
|
|
3142
|
+
}
|
|
3143
|
+
function be(e, n, t, r) {
|
|
3144
|
+
var i, o, s, u;
|
|
3145
|
+
for (o = e[0]; o >= 10; o /= 10)
|
|
3146
|
+
--n;
|
|
3147
|
+
return --n < 0 ? (n += v, i = 0) : (i = Math.ceil((n + 1) / v), n %= v), o = D(10, v - n), u = e[i] % o | 0, r == null ? n < 3 ? (n == 0 ? u = u / 100 | 0 : n == 1 && (u = u / 10 | 0), s = t < 4 && u == 99999 || t > 3 && u == 49999 || u == 5e4 || u == 0) : s = (t < 4 && u + 1 == o || t > 3 && u + 1 == o / 2) && (e[i + 1] / o / 100 | 0) == D(10, n - 2) - 1 || (u == o / 2 || u == 0) && (e[i + 1] / o / 100 | 0) == 0 : n < 4 ? (n == 0 ? u = u / 1e3 | 0 : n == 1 ? u = u / 100 | 0 : n == 2 && (u = u / 10 | 0), s = (r || t < 4) && u == 9999 || !r && t > 3 && u == 4999) : s = ((r || t < 4) && u + 1 == o || !r && t > 3 && u + 1 == o / 2) && (e[i + 1] / o / 1e3 | 0) == D(10, n - 3) - 1, s;
|
|
3148
|
+
}
|
|
3149
|
+
function Re(e, n, t) {
|
|
3150
|
+
for (var r, i = [0], o, s = 0, u = e.length; s < u; ) {
|
|
3151
|
+
for (o = i.length; o--; )
|
|
3152
|
+
i[o] *= n;
|
|
3153
|
+
for (i[0] += tn.indexOf(e.charAt(s++)), r = 0; r < i.length; r++)
|
|
3154
|
+
i[r] > t - 1 && (i[r + 1] === void 0 && (i[r + 1] = 0), i[r + 1] += i[r] / t | 0, i[r] %= t);
|
|
3155
|
+
}
|
|
3156
|
+
return i.reverse();
|
|
3157
|
+
}
|
|
3158
|
+
function Wu(e, n) {
|
|
3159
|
+
var t, r, i;
|
|
3160
|
+
if (n.isZero())
|
|
3161
|
+
return n;
|
|
3162
|
+
r = n.d.length, r < 32 ? (t = Math.ceil(r / 3), i = (1 / He(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), e.precision += t, n = pe(e, 1, n.times(i), new e(1));
|
|
3163
|
+
for (var o = t; o--; ) {
|
|
3164
|
+
var s = n.times(n);
|
|
3165
|
+
n = s.times(s).minus(s).times(8).plus(1);
|
|
3166
|
+
}
|
|
3167
|
+
return e.precision -= t, n;
|
|
3168
|
+
}
|
|
3169
|
+
var z = function() {
|
|
3170
|
+
function e(r, i, o) {
|
|
3171
|
+
var s, u = 0, c = r.length;
|
|
3172
|
+
for (r = r.slice(); c--; )
|
|
3173
|
+
s = r[c] * i + u, r[c] = s % o | 0, u = s / o | 0;
|
|
3174
|
+
return u && r.unshift(u), r;
|
|
3175
|
+
}
|
|
3176
|
+
function n(r, i, o, s) {
|
|
3177
|
+
var u, c;
|
|
3178
|
+
if (o != s)
|
|
3179
|
+
c = o > s ? 1 : -1;
|
|
3180
|
+
else
|
|
3181
|
+
for (u = c = 0; u < o; u++)
|
|
3182
|
+
if (r[u] != i[u]) {
|
|
3183
|
+
c = r[u] > i[u] ? 1 : -1;
|
|
3184
|
+
break;
|
|
3185
|
+
}
|
|
3186
|
+
return c;
|
|
3187
|
+
}
|
|
3188
|
+
function t(r, i, o, s) {
|
|
3189
|
+
for (var u = 0; o--; )
|
|
3190
|
+
r[o] -= u, u = r[o] < i[o] ? 1 : 0, r[o] = u * s + r[o] - i[o];
|
|
3191
|
+
for (; !r[0] && r.length > 1; )
|
|
3192
|
+
r.shift();
|
|
3193
|
+
}
|
|
3194
|
+
return function(r, i, o, s, u, c) {
|
|
3195
|
+
var a, l, f, d, m, k, w, F, $, G, b, P, Q, X, We, ze, _e, Ye, M, Ze, Ae = r.constructor, Qe = r.s == i.s ? 1 : -1, y = r.d, Z = i.d;
|
|
3196
|
+
if (!y || !y[0] || !Z || !Z[0])
|
|
3197
|
+
return new Ae(
|
|
3198
|
+
// Return NaN if either NaN, or both Infinity or 0.
|
|
3199
|
+
!r.s || !i.s || (y ? Z && y[0] == Z[0] : !Z) ? NaN : (
|
|
3200
|
+
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
3201
|
+
y && y[0] == 0 || !Z ? Qe * 0 : Qe / 0
|
|
3202
|
+
)
|
|
3203
|
+
);
|
|
3204
|
+
for (c ? (m = 1, l = r.e - i.e) : (c = Y, m = v, l = L(r.e / m) - L(i.e / m)), M = Z.length, _e = y.length, $ = new Ae(Qe), G = $.d = [], f = 0; Z[f] == (y[f] || 0); f++)
|
|
3205
|
+
;
|
|
3206
|
+
if (Z[f] > (y[f] || 0) && l--, o == null ? (X = o = Ae.precision, s = Ae.rounding) : u ? X = o + (r.e - i.e) + 1 : X = o, X < 0)
|
|
3207
|
+
G.push(1), k = !0;
|
|
3208
|
+
else {
|
|
3209
|
+
if (X = X / m + 2 | 0, f = 0, M == 1) {
|
|
3210
|
+
for (d = 0, Z = Z[0], X++; (f < _e || d) && X--; f++)
|
|
3211
|
+
We = d * c + (y[f] || 0), G[f] = We / Z | 0, d = We % Z | 0;
|
|
3212
|
+
k = d || f < _e;
|
|
3213
|
+
} else {
|
|
3214
|
+
for (d = c / (Z[0] + 1) | 0, d > 1 && (Z = e(Z, d, c), y = e(y, d, c), M = Z.length, _e = y.length), ze = M, b = y.slice(0, M), P = b.length; P < M; )
|
|
3215
|
+
b[P++] = 0;
|
|
3216
|
+
Ze = Z.slice(), Ze.unshift(0), Ye = Z[0], Z[1] >= c / 2 && ++Ye;
|
|
3217
|
+
do
|
|
3218
|
+
d = 0, a = n(Z, b, M, P), a < 0 ? (Q = b[0], M != P && (Q = Q * c + (b[1] || 0)), d = Q / Ye | 0, d > 1 ? (d >= c && (d = c - 1), w = e(Z, d, c), F = w.length, P = b.length, a = n(w, b, F, P), a == 1 && (d--, t(w, M < F ? Ze : Z, F, c))) : (d == 0 && (a = d = 1), w = Z.slice()), F = w.length, F < P && w.unshift(0), t(b, w, P, c), a == -1 && (P = b.length, a = n(Z, b, M, P), a < 1 && (d++, t(b, M < P ? Ze : Z, P, c))), P = b.length) : a === 0 && (d++, b = [0]), G[f++] = d, a && b[0] ? b[P++] = y[ze] || 0 : (b = [y[ze]], P = 1);
|
|
3219
|
+
while ((ze++ < _e || b[0] !== void 0) && X--);
|
|
3220
|
+
k = b[0] !== void 0;
|
|
3221
|
+
}
|
|
3222
|
+
G[0] || G.shift();
|
|
3223
|
+
}
|
|
3224
|
+
if (m == 1)
|
|
3225
|
+
$.e = l, Nt = k;
|
|
3226
|
+
else {
|
|
3227
|
+
for (f = 1, d = G[0]; d >= 10; d /= 10)
|
|
3228
|
+
f++;
|
|
3229
|
+
$.e = f + l * m - 1, g($, u ? o + $.e + 1 : o, s, k);
|
|
3230
|
+
}
|
|
3231
|
+
return $;
|
|
3232
|
+
};
|
|
3233
|
+
}();
|
|
3234
|
+
function g(e, n, t, r) {
|
|
3235
|
+
var i, o, s, u, c, a, l, f, d, m = e.constructor;
|
|
3236
|
+
e:
|
|
3237
|
+
if (n != null) {
|
|
3238
|
+
if (f = e.d, !f)
|
|
3239
|
+
return e;
|
|
3240
|
+
for (i = 1, u = f[0]; u >= 10; u /= 10)
|
|
3241
|
+
i++;
|
|
3242
|
+
if (o = n - i, o < 0)
|
|
3243
|
+
o += v, s = n, l = f[d = 0], c = l / D(10, i - s - 1) % 10 | 0;
|
|
3244
|
+
else if (d = Math.ceil((o + 1) / v), u = f.length, d >= u)
|
|
3245
|
+
if (r) {
|
|
3246
|
+
for (; u++ <= d; )
|
|
3247
|
+
f.push(0);
|
|
3248
|
+
l = c = 0, i = 1, o %= v, s = o - v + 1;
|
|
3249
|
+
} else
|
|
3250
|
+
break e;
|
|
3251
|
+
else {
|
|
3252
|
+
for (l = u = f[d], i = 1; u >= 10; u /= 10)
|
|
3253
|
+
i++;
|
|
3254
|
+
o %= v, s = o - v + i, c = s < 0 ? 0 : l / D(10, i - s - 1) % 10 | 0;
|
|
3255
|
+
}
|
|
3256
|
+
if (r = r || n < 0 || f[d + 1] !== void 0 || (s < 0 ? l : l % D(10, i - s - 1)), a = t < 4 ? (c || r) && (t == 0 || t == (e.s < 0 ? 3 : 2)) : c > 5 || c == 5 && (t == 4 || r || t == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
3257
|
+
(o > 0 ? s > 0 ? l / D(10, i - s) : 0 : f[d - 1]) % 10 & 1 || t == (e.s < 0 ? 8 : 7)), n < 1 || !f[0])
|
|
3258
|
+
return f.length = 0, a ? (n -= e.e + 1, f[0] = D(10, (v - n % v) % v), e.e = -n || 0) : f[0] = e.e = 0, e;
|
|
3259
|
+
if (o == 0 ? (f.length = d, u = 1, d--) : (f.length = d + 1, u = D(10, v - o), f[d] = s > 0 ? (l / D(10, i - s) % D(10, s) | 0) * u : 0), a)
|
|
3260
|
+
for (; ; )
|
|
3261
|
+
if (d == 0) {
|
|
3262
|
+
for (o = 1, s = f[0]; s >= 10; s /= 10)
|
|
3263
|
+
o++;
|
|
3264
|
+
for (s = f[0] += u, u = 1; s >= 10; s /= 10)
|
|
3265
|
+
u++;
|
|
3266
|
+
o != u && (e.e++, f[0] == Y && (f[0] = 1));
|
|
3267
|
+
break;
|
|
3268
|
+
} else {
|
|
3269
|
+
if (f[d] += u, f[d] != Y)
|
|
3270
|
+
break;
|
|
3271
|
+
f[d--] = 0, u = 1;
|
|
3272
|
+
}
|
|
3273
|
+
for (o = f.length; f[--o] === 0; )
|
|
3274
|
+
f.pop();
|
|
3275
|
+
}
|
|
3276
|
+
return N && (e.e > m.maxE ? (e.d = null, e.e = NaN) : e.e < m.minE && (e.e = 0, e.d = [0])), e;
|
|
3277
|
+
}
|
|
3278
|
+
function K(e, n, t) {
|
|
3279
|
+
if (!e.isFinite())
|
|
3280
|
+
return Ot(e);
|
|
3281
|
+
var r, i = e.e, o = U(e.d), s = o.length;
|
|
3282
|
+
return n ? (t && (r = t - s) > 0 ? o = o.charAt(0) + "." + o.slice(1) + ne(r) : s > 1 && (o = o.charAt(0) + "." + o.slice(1)), o = o + (e.e < 0 ? "e" : "e+") + e.e) : i < 0 ? (o = "0." + ne(-i - 1) + o, t && (r = t - s) > 0 && (o += ne(r))) : i >= s ? (o += ne(i + 1 - s), t && (r = t - i - 1) > 0 && (o = o + "." + ne(r))) : ((r = i + 1) < s && (o = o.slice(0, r) + "." + o.slice(r)), t && (r = t - s) > 0 && (i + 1 === s && (o += "."), o += ne(r))), o;
|
|
3283
|
+
}
|
|
3284
|
+
function Me(e, n) {
|
|
3285
|
+
var t = e[0];
|
|
3286
|
+
for (n *= v; t >= 10; t /= 10)
|
|
3287
|
+
n++;
|
|
3288
|
+
return n;
|
|
3289
|
+
}
|
|
3290
|
+
function Le(e, n, t) {
|
|
3291
|
+
if (n > Hu)
|
|
3292
|
+
throw N = !0, t && (e.precision = t), Error(bt);
|
|
3293
|
+
return g(new e(Ue), n, 1, !0);
|
|
3294
|
+
}
|
|
3295
|
+
function W(e, n, t) {
|
|
3296
|
+
if (n > on)
|
|
3297
|
+
throw Error(bt);
|
|
3298
|
+
return g(new e(ye), n, t, !0);
|
|
3299
|
+
}
|
|
3300
|
+
function At(e) {
|
|
3301
|
+
var n = e.length - 1, t = n * v + 1;
|
|
3302
|
+
if (n = e[n], n) {
|
|
3303
|
+
for (; n % 10 == 0; n /= 10)
|
|
3304
|
+
t--;
|
|
3305
|
+
for (n = e[0]; n >= 10; n /= 10)
|
|
3306
|
+
t++;
|
|
3307
|
+
}
|
|
3308
|
+
return t;
|
|
3309
|
+
}
|
|
3310
|
+
function ne(e) {
|
|
3311
|
+
for (var n = ""; e--; )
|
|
3312
|
+
n += "0";
|
|
3313
|
+
return n;
|
|
3314
|
+
}
|
|
3315
|
+
function $t(e, n, t, r) {
|
|
3316
|
+
var i, o = new e(1), s = Math.ceil(r / v + 4);
|
|
3317
|
+
for (N = !1; ; ) {
|
|
3318
|
+
if (t % 2 && (o = o.times(n), xn(o.d, s) && (i = !0)), t = L(t / 2), t === 0) {
|
|
3319
|
+
t = o.d.length - 1, i && o.d[t] === 0 && ++o.d[t];
|
|
3320
|
+
break;
|
|
3321
|
+
}
|
|
3322
|
+
n = n.times(n), xn(n.d, s);
|
|
3323
|
+
}
|
|
3324
|
+
return N = !0, o;
|
|
3325
|
+
}
|
|
3326
|
+
function jn(e) {
|
|
3327
|
+
return e.d[e.d.length - 1] & 1;
|
|
3328
|
+
}
|
|
3329
|
+
function It(e, n, t) {
|
|
3330
|
+
for (var r, i = new e(n[0]), o = 0; ++o < n.length; )
|
|
3331
|
+
if (r = new e(n[o]), r.s)
|
|
3332
|
+
i[t](r) && (i = r);
|
|
3333
|
+
else {
|
|
3334
|
+
i = r;
|
|
3335
|
+
break;
|
|
3336
|
+
}
|
|
3337
|
+
return i;
|
|
3338
|
+
}
|
|
3339
|
+
function sn(e, n) {
|
|
3340
|
+
var t, r, i, o, s, u, c, a = 0, l = 0, f = 0, d = e.constructor, m = d.rounding, k = d.precision;
|
|
3341
|
+
if (!e.d || !e.d[0] || e.e > 17)
|
|
3342
|
+
return new d(e.d ? e.d[0] ? e.s < 0 ? 0 : 1 / 0 : 1 : e.s ? e.s < 0 ? 0 : e : 0 / 0);
|
|
3343
|
+
for (n == null ? (N = !1, c = k) : c = n, u = new d(0.03125); e.e > -2; )
|
|
3344
|
+
e = e.times(u), f += 5;
|
|
3345
|
+
for (r = Math.log(D(2, f)) / Math.LN10 * 2 + 5 | 0, c += r, t = o = s = new d(1), d.precision = c; ; ) {
|
|
3346
|
+
if (o = g(o.times(e), c, 1), t = t.times(++l), u = s.plus(z(o, t, c, 1)), U(u.d).slice(0, c) === U(s.d).slice(0, c)) {
|
|
3347
|
+
for (i = f; i--; )
|
|
3348
|
+
s = g(s.times(s), c, 1);
|
|
3349
|
+
if (n == null)
|
|
3350
|
+
if (a < 3 && be(s.d, c - r, m, a))
|
|
3351
|
+
d.precision = c += 10, t = o = u = new d(1), l = 0, a++;
|
|
3352
|
+
else
|
|
3353
|
+
return g(s, d.precision = k, m, N = !0);
|
|
3354
|
+
else
|
|
3355
|
+
return d.precision = k, s;
|
|
3356
|
+
}
|
|
3357
|
+
s = u;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
function te(e, n) {
|
|
3361
|
+
var t, r, i, o, s, u, c, a, l, f, d, m = 1, k = 10, w = e, F = w.d, $ = w.constructor, G = $.rounding, b = $.precision;
|
|
3362
|
+
if (w.s < 0 || !F || !F[0] || !w.e && F[0] == 1 && F.length == 1)
|
|
3363
|
+
return new $(F && !F[0] ? -1 / 0 : w.s != 1 ? NaN : F ? 0 : w);
|
|
3364
|
+
if (n == null ? (N = !1, l = b) : l = n, $.precision = l += k, t = U(F), r = t.charAt(0), Math.abs(o = w.e) < 15e14) {
|
|
3365
|
+
for (; r < 7 && r != 1 || r == 1 && t.charAt(1) > 3; )
|
|
3366
|
+
w = w.times(e), t = U(w.d), r = t.charAt(0), m++;
|
|
3367
|
+
o = w.e, r > 1 ? (w = new $("0." + t), o++) : w = new $(r + "." + t.slice(1));
|
|
3368
|
+
} else
|
|
3369
|
+
return a = Le($, l + 2, b).times(o + ""), w = te(new $(r + "." + t.slice(1)), l - k).plus(a), $.precision = b, n == null ? g(w, b, G, N = !0) : w;
|
|
3370
|
+
for (f = w, c = s = w = z(w.minus(1), w.plus(1), l, 1), d = g(w.times(w), l, 1), i = 3; ; ) {
|
|
3371
|
+
if (s = g(s.times(d), l, 1), a = c.plus(z(s, new $(i), l, 1)), U(a.d).slice(0, l) === U(c.d).slice(0, l))
|
|
3372
|
+
if (c = c.times(2), o !== 0 && (c = c.plus(Le($, l + 2, b).times(o + ""))), c = z(c, new $(m), l, 1), n == null)
|
|
3373
|
+
if (be(c.d, l - k, G, u))
|
|
3374
|
+
$.precision = l += k, a = s = w = z(f.minus(1), f.plus(1), l, 1), d = g(w.times(w), l, 1), i = u = 1;
|
|
3375
|
+
else
|
|
3376
|
+
return g(c, $.precision = b, G, N = !0);
|
|
3377
|
+
else
|
|
3378
|
+
return $.precision = b, c;
|
|
3379
|
+
c = a, i += 2;
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
function Ot(e) {
|
|
3383
|
+
return String(e.s * e.s / 0);
|
|
3384
|
+
}
|
|
3385
|
+
function un(e, n) {
|
|
3386
|
+
var t, r, i;
|
|
3387
|
+
for ((t = n.indexOf(".")) > -1 && (n = n.replace(".", "")), (r = n.search(/e/i)) > 0 ? (t < 0 && (t = r), t += +n.slice(r + 1), n = n.substring(0, r)) : t < 0 && (t = n.length), r = 0; n.charCodeAt(r) === 48; r++)
|
|
3388
|
+
;
|
|
3389
|
+
for (i = n.length; n.charCodeAt(i - 1) === 48; --i)
|
|
3390
|
+
;
|
|
3391
|
+
if (n = n.slice(r, i), n) {
|
|
3392
|
+
if (i -= r, e.e = t = t - r - 1, e.d = [], r = (t + 1) % v, t < 0 && (r += v), r < i) {
|
|
3393
|
+
for (r && e.d.push(+n.slice(0, r)), i -= v; r < i; )
|
|
3394
|
+
e.d.push(+n.slice(r, r += v));
|
|
3395
|
+
n = n.slice(r), r = v - n.length;
|
|
3396
|
+
} else
|
|
3397
|
+
r -= i;
|
|
3398
|
+
for (; r--; )
|
|
3399
|
+
n += "0";
|
|
3400
|
+
e.d.push(+n), N && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
|
|
3401
|
+
} else
|
|
3402
|
+
e.e = 0, e.d = [0];
|
|
3403
|
+
return e;
|
|
3404
|
+
}
|
|
3405
|
+
function Yu(e, n) {
|
|
3406
|
+
var t, r, i, o, s, u, c, a, l;
|
|
3407
|
+
if (n.indexOf("_") > -1) {
|
|
3408
|
+
if (n = n.replace(/(\d)_(?=\d)/g, "$1"), Zt.test(n))
|
|
3409
|
+
return un(e, n);
|
|
3410
|
+
} else if (n === "Infinity" || n === "NaN")
|
|
3411
|
+
return +n || (e.s = NaN), e.e = NaN, e.d = null, e;
|
|
3412
|
+
if (Gu.test(n))
|
|
3413
|
+
t = 16, n = n.toLowerCase();
|
|
3414
|
+
else if (Su.test(n))
|
|
3415
|
+
t = 2;
|
|
3416
|
+
else if (Vu.test(n))
|
|
3417
|
+
t = 8;
|
|
3418
|
+
else
|
|
3419
|
+
throw Error(re + n);
|
|
3420
|
+
for (o = n.search(/p/i), o > 0 ? (c = +n.slice(o + 1), n = n.substring(2, o)) : n = n.slice(2), o = n.indexOf("."), s = o >= 0, r = e.constructor, s && (n = n.replace(".", ""), u = n.length, o = u - o, i = $t(r, new r(t), o, o * 2)), a = Re(n, t, Y), l = a.length - 1, o = l; a[o] === 0; --o)
|
|
3421
|
+
a.pop();
|
|
3422
|
+
return o < 0 ? new r(e.s * 0) : (e.e = Me(a, l), e.d = a, N = !1, s && (e = z(e, i, u * 4)), c && (e = e.times(Math.abs(c) < 54 ? D(2, c) : q.pow(2, c))), N = !0, e);
|
|
3423
|
+
}
|
|
3424
|
+
function Qu(e, n) {
|
|
3425
|
+
var t, r = n.d.length;
|
|
3426
|
+
if (r < 3)
|
|
3427
|
+
return n.isZero() ? n : pe(e, 2, n, n);
|
|
3428
|
+
t = 1.4 * Math.sqrt(r), t = t > 16 ? 16 : t | 0, n = n.times(1 / He(5, t)), n = pe(e, 2, n, n);
|
|
3429
|
+
for (var i, o = new e(5), s = new e(16), u = new e(20); t--; )
|
|
3430
|
+
i = n.times(n), n = n.times(o.plus(i.times(s.times(i).minus(u))));
|
|
3431
|
+
return n;
|
|
3432
|
+
}
|
|
3433
|
+
function pe(e, n, t, r, i) {
|
|
3434
|
+
var o, s, u, c, a = e.precision, l = Math.ceil(a / v);
|
|
3435
|
+
for (N = !1, c = t.times(t), u = new e(r); ; ) {
|
|
3436
|
+
if (s = z(u.times(c), new e(n++ * n++), a, 1), u = i ? r.plus(s) : r.minus(s), r = z(s.times(c), new e(n++ * n++), a, 1), s = u.plus(r), s.d[l] !== void 0) {
|
|
3437
|
+
for (o = l; s.d[o] === u.d[o] && o--; )
|
|
3438
|
+
;
|
|
3439
|
+
if (o == -1)
|
|
3440
|
+
break;
|
|
3441
|
+
}
|
|
3442
|
+
o = u, u = r, r = s, s = o;
|
|
3443
|
+
}
|
|
3444
|
+
return N = !0, s.d.length = l + 1, s;
|
|
3445
|
+
}
|
|
3446
|
+
function He(e, n) {
|
|
3447
|
+
for (var t = e; --n; )
|
|
3448
|
+
t *= e;
|
|
3449
|
+
return t;
|
|
3450
|
+
}
|
|
3451
|
+
function Ct(e, n) {
|
|
3452
|
+
var t, r = n.s < 0, i = W(e, e.precision, 1), o = i.times(0.5);
|
|
3453
|
+
if (n = n.abs(), n.lte(o))
|
|
3454
|
+
return ee = r ? 4 : 1, n;
|
|
3455
|
+
if (t = n.divToInt(i), t.isZero())
|
|
3456
|
+
ee = r ? 3 : 2;
|
|
3457
|
+
else {
|
|
3458
|
+
if (n = n.minus(t.times(i)), n.lte(o))
|
|
3459
|
+
return ee = jn(t) ? r ? 2 : 3 : r ? 4 : 1, n;
|
|
3460
|
+
ee = jn(t) ? r ? 1 : 4 : r ? 3 : 2;
|
|
3461
|
+
}
|
|
3462
|
+
return n.minus(i).abs();
|
|
3463
|
+
}
|
|
3464
|
+
function gn(e, n, t, r) {
|
|
3465
|
+
var i, o, s, u, c, a, l, f, d, m = e.constructor, k = t !== void 0;
|
|
3466
|
+
if (k ? (B(t, 1, ue), r === void 0 ? r = m.rounding : B(r, 0, 8)) : (t = m.precision, r = m.rounding), !e.isFinite())
|
|
3467
|
+
l = Ot(e);
|
|
3468
|
+
else {
|
|
3469
|
+
for (l = K(e), s = l.indexOf("."), k ? (i = 2, n == 16 ? t = t * 4 - 3 : n == 8 && (t = t * 3 - 2)) : i = n, s >= 0 && (l = l.replace(".", ""), d = new m(1), d.e = l.length - s, d.d = Re(K(d), 10, i), d.e = d.d.length), f = Re(l, 10, i), o = c = f.length; f[--c] == 0; )
|
|
3470
|
+
f.pop();
|
|
3471
|
+
if (!f[0])
|
|
3472
|
+
l = k ? "0p+0" : "0";
|
|
3473
|
+
else {
|
|
3474
|
+
if (s < 0 ? o-- : (e = new m(e), e.d = f, e.e = o, e = z(e, d, t, r, 0, i), f = e.d, o = e.e, a = Nt), s = f[t], u = i / 2, a = a || f[t + 1] !== void 0, a = r < 4 ? (s !== void 0 || a) && (r === 0 || r === (e.s < 0 ? 3 : 2)) : s > u || s === u && (r === 4 || a || r === 6 && f[t - 1] & 1 || r === (e.s < 0 ? 8 : 7)), f.length = t, a)
|
|
3475
|
+
for (; ++f[--t] > i - 1; )
|
|
3476
|
+
f[t] = 0, t || (++o, f.unshift(1));
|
|
3477
|
+
for (c = f.length; !f[c - 1]; --c)
|
|
3478
|
+
;
|
|
3479
|
+
for (s = 0, l = ""; s < c; s++)
|
|
3480
|
+
l += tn.charAt(f[s]);
|
|
3481
|
+
if (k) {
|
|
3482
|
+
if (c > 1)
|
|
3483
|
+
if (n == 16 || n == 8) {
|
|
3484
|
+
for (s = n == 16 ? 4 : 3, --c; c % s; c++)
|
|
3485
|
+
l += "0";
|
|
3486
|
+
for (f = Re(l, i, n), c = f.length; !f[c - 1]; --c)
|
|
3487
|
+
;
|
|
3488
|
+
for (s = 1, l = "1."; s < c; s++)
|
|
3489
|
+
l += tn.charAt(f[s]);
|
|
3490
|
+
} else
|
|
3491
|
+
l = l.charAt(0) + "." + l.slice(1);
|
|
3492
|
+
l = l + (o < 0 ? "p" : "p+") + o;
|
|
3493
|
+
} else if (o < 0) {
|
|
3494
|
+
for (; ++o; )
|
|
3495
|
+
l = "0" + l;
|
|
3496
|
+
l = "0." + l;
|
|
3497
|
+
} else if (++o > c)
|
|
3498
|
+
for (o -= c; o--; )
|
|
3499
|
+
l += "0";
|
|
3500
|
+
else
|
|
3501
|
+
o < c && (l = l.slice(0, o) + "." + l.slice(o));
|
|
3502
|
+
}
|
|
3503
|
+
l = (n == 16 ? "0x" : n == 2 ? "0b" : n == 8 ? "0o" : "") + l;
|
|
3504
|
+
}
|
|
3505
|
+
return e.s < 0 ? "-" + l : l;
|
|
3506
|
+
}
|
|
3507
|
+
function xn(e, n) {
|
|
3508
|
+
if (e.length > n)
|
|
3509
|
+
return e.length = n, !0;
|
|
3510
|
+
}
|
|
3511
|
+
function Ju(e) {
|
|
3512
|
+
return new this(e).abs();
|
|
3513
|
+
}
|
|
3514
|
+
function Ku(e) {
|
|
3515
|
+
return new this(e).acos();
|
|
3516
|
+
}
|
|
3517
|
+
function Xu(e) {
|
|
3518
|
+
return new this(e).acosh();
|
|
3519
|
+
}
|
|
3520
|
+
function ec(e, n) {
|
|
3521
|
+
return new this(e).plus(n);
|
|
3522
|
+
}
|
|
3523
|
+
function nc(e) {
|
|
3524
|
+
return new this(e).asin();
|
|
3525
|
+
}
|
|
3526
|
+
function tc(e) {
|
|
3527
|
+
return new this(e).asinh();
|
|
3528
|
+
}
|
|
3529
|
+
function rc(e) {
|
|
3530
|
+
return new this(e).atan();
|
|
3531
|
+
}
|
|
3532
|
+
function ic(e) {
|
|
3533
|
+
return new this(e).atanh();
|
|
3534
|
+
}
|
|
3535
|
+
function oc(e, n) {
|
|
3536
|
+
e = new this(e), n = new this(n);
|
|
3537
|
+
var t, r = this.precision, i = this.rounding, o = r + 4;
|
|
3538
|
+
return !e.s || !n.s ? t = new this(NaN) : !e.d && !n.d ? (t = W(this, o, 1).times(n.s > 0 ? 0.25 : 0.75), t.s = e.s) : !n.d || e.isZero() ? (t = n.s < 0 ? W(this, r, i) : new this(0), t.s = e.s) : !e.d || n.isZero() ? (t = W(this, o, 1).times(0.5), t.s = e.s) : n.s < 0 ? (this.precision = o, this.rounding = 1, t = this.atan(z(e, n, o, 1)), n = W(this, o, 1), this.precision = r, this.rounding = i, t = e.s < 0 ? t.minus(n) : t.plus(n)) : t = this.atan(z(e, n, o, 1)), t;
|
|
3539
|
+
}
|
|
3540
|
+
function sc(e) {
|
|
3541
|
+
return new this(e).cbrt();
|
|
3542
|
+
}
|
|
3543
|
+
function uc(e) {
|
|
3544
|
+
return g(e = new this(e), e.e + 1, 2);
|
|
3545
|
+
}
|
|
3546
|
+
function cc(e, n, t) {
|
|
3547
|
+
return new this(e).clamp(n, t);
|
|
3548
|
+
}
|
|
3549
|
+
function ac(e) {
|
|
3550
|
+
if (!e || typeof e != "object")
|
|
3551
|
+
throw Error(Ve + "Object expected");
|
|
3552
|
+
var n, t, r, i = e.defaults === !0, o = [
|
|
3553
|
+
"precision",
|
|
3554
|
+
1,
|
|
3555
|
+
ue,
|
|
3556
|
+
"rounding",
|
|
3557
|
+
0,
|
|
3558
|
+
8,
|
|
3559
|
+
"toExpNeg",
|
|
3560
|
+
-de,
|
|
3561
|
+
0,
|
|
3562
|
+
"toExpPos",
|
|
3563
|
+
0,
|
|
3564
|
+
de,
|
|
3565
|
+
"maxE",
|
|
3566
|
+
0,
|
|
3567
|
+
de,
|
|
3568
|
+
"minE",
|
|
3569
|
+
-de,
|
|
3570
|
+
0,
|
|
3571
|
+
"modulo",
|
|
3572
|
+
0,
|
|
3573
|
+
9
|
|
3574
|
+
];
|
|
3575
|
+
for (n = 0; n < o.length; n += 3)
|
|
3576
|
+
if (t = o[n], i && (this[t] = rn[t]), (r = e[t]) !== void 0)
|
|
3577
|
+
if (L(r) === r && r >= o[n + 1] && r <= o[n + 2])
|
|
3578
|
+
this[t] = r;
|
|
3579
|
+
else
|
|
3580
|
+
throw Error(re + t + ": " + r);
|
|
3581
|
+
if (t = "crypto", i && (this[t] = rn[t]), (r = e[t]) !== void 0)
|
|
3582
|
+
if (r === !0 || r === !1 || r === 0 || r === 1)
|
|
3583
|
+
if (r)
|
|
3584
|
+
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
3585
|
+
this[t] = !0;
|
|
3586
|
+
else
|
|
3587
|
+
throw Error(Pt);
|
|
3588
|
+
else
|
|
3589
|
+
this[t] = !1;
|
|
3590
|
+
else
|
|
3591
|
+
throw Error(re + t + ": " + r);
|
|
3592
|
+
return this;
|
|
3593
|
+
}
|
|
3594
|
+
function lc(e) {
|
|
3595
|
+
return new this(e).cos();
|
|
3596
|
+
}
|
|
3597
|
+
function fc(e) {
|
|
3598
|
+
return new this(e).cosh();
|
|
3599
|
+
}
|
|
3600
|
+
function Tt(e) {
|
|
3601
|
+
var n, t, r;
|
|
3602
|
+
function i(o) {
|
|
3603
|
+
var s, u, c, a = this;
|
|
3604
|
+
if (!(a instanceof i))
|
|
3605
|
+
return new i(o);
|
|
3606
|
+
if (a.constructor = i, qn(o)) {
|
|
3607
|
+
a.s = o.s, N ? !o.d || o.e > i.maxE ? (a.e = NaN, a.d = null) : o.e < i.minE ? (a.e = 0, a.d = [0]) : (a.e = o.e, a.d = o.d.slice()) : (a.e = o.e, a.d = o.d ? o.d.slice() : o.d);
|
|
3608
|
+
return;
|
|
3609
|
+
}
|
|
3610
|
+
if (c = typeof o, c === "number") {
|
|
3611
|
+
if (o === 0) {
|
|
3612
|
+
a.s = 1 / o < 0 ? -1 : 1, a.e = 0, a.d = [0];
|
|
3613
|
+
return;
|
|
3614
|
+
}
|
|
3615
|
+
if (o < 0 ? (o = -o, a.s = -1) : a.s = 1, o === ~~o && o < 1e7) {
|
|
3616
|
+
for (s = 0, u = o; u >= 10; u /= 10)
|
|
3617
|
+
s++;
|
|
3618
|
+
N ? s > i.maxE ? (a.e = NaN, a.d = null) : s < i.minE ? (a.e = 0, a.d = [0]) : (a.e = s, a.d = [o]) : (a.e = s, a.d = [o]);
|
|
3619
|
+
return;
|
|
3620
|
+
} else if (o * 0 !== 0) {
|
|
3621
|
+
o || (a.s = NaN), a.e = NaN, a.d = null;
|
|
3622
|
+
return;
|
|
3623
|
+
}
|
|
3624
|
+
return un(a, o.toString());
|
|
3625
|
+
} else if (c !== "string")
|
|
3626
|
+
throw Error(re + o);
|
|
3627
|
+
return (u = o.charCodeAt(0)) === 45 ? (o = o.slice(1), a.s = -1) : (u === 43 && (o = o.slice(1)), a.s = 1), Zt.test(o) ? un(a, o) : Yu(a, o);
|
|
3628
|
+
}
|
|
3629
|
+
if (i.prototype = p, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = ac, i.clone = Tt, i.isDecimal = qn, i.abs = Ju, i.acos = Ku, i.acosh = Xu, i.add = ec, i.asin = nc, i.asinh = tc, i.atan = rc, i.atanh = ic, i.atan2 = oc, i.cbrt = sc, i.ceil = uc, i.clamp = cc, i.cos = lc, i.cosh = fc, i.div = dc, i.exp = hc, i.floor = pc, i.hypot = mc, i.ln = gc, i.log = _c, i.log10 = wc, i.log2 = vc, i.max = kc, i.min = Nc, i.mod = bc, i.mul = Pc, i.pow = zc, i.random = Zc, i.round = Ac, i.sign = $c, i.sin = Ic, i.sinh = Oc, i.sqrt = Cc, i.sub = Tc, i.sum = Rc, i.tan = Dc, i.tanh = Fc, i.trunc = Ec, e === void 0 && (e = {}), e && e.defaults !== !0)
|
|
3630
|
+
for (r = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], n = 0; n < r.length; )
|
|
3631
|
+
e.hasOwnProperty(t = r[n++]) || (e[t] = this[t]);
|
|
3632
|
+
return i.config(e), i;
|
|
3633
|
+
}
|
|
3634
|
+
function dc(e, n) {
|
|
3635
|
+
return new this(e).div(n);
|
|
3636
|
+
}
|
|
3637
|
+
function hc(e) {
|
|
3638
|
+
return new this(e).exp();
|
|
3639
|
+
}
|
|
3640
|
+
function pc(e) {
|
|
3641
|
+
return g(e = new this(e), e.e + 1, 3);
|
|
3642
|
+
}
|
|
3643
|
+
function mc() {
|
|
3644
|
+
var e, n, t = new this(0);
|
|
3645
|
+
for (N = !1, e = 0; e < arguments.length; )
|
|
3646
|
+
if (n = new this(arguments[e++]), n.d)
|
|
3647
|
+
t.d && (t = t.plus(n.times(n)));
|
|
3648
|
+
else {
|
|
3649
|
+
if (n.s)
|
|
3650
|
+
return N = !0, new this(1 / 0);
|
|
3651
|
+
t = n;
|
|
3652
|
+
}
|
|
3653
|
+
return N = !0, t.sqrt();
|
|
3654
|
+
}
|
|
3655
|
+
function qn(e) {
|
|
3656
|
+
return e instanceof q || e && e.toStringTag === zt || !1;
|
|
3657
|
+
}
|
|
3658
|
+
function gc(e) {
|
|
3659
|
+
return new this(e).ln();
|
|
3660
|
+
}
|
|
3661
|
+
function _c(e, n) {
|
|
3662
|
+
return new this(e).log(n);
|
|
3663
|
+
}
|
|
3664
|
+
function vc(e) {
|
|
3665
|
+
return new this(e).log(2);
|
|
3666
|
+
}
|
|
3667
|
+
function wc(e) {
|
|
3668
|
+
return new this(e).log(10);
|
|
3669
|
+
}
|
|
3670
|
+
function kc() {
|
|
3671
|
+
return It(this, arguments, "lt");
|
|
3672
|
+
}
|
|
3673
|
+
function Nc() {
|
|
3674
|
+
return It(this, arguments, "gt");
|
|
3675
|
+
}
|
|
3676
|
+
function bc(e, n) {
|
|
3677
|
+
return new this(e).mod(n);
|
|
3678
|
+
}
|
|
3679
|
+
function Pc(e, n) {
|
|
3680
|
+
return new this(e).mul(n);
|
|
3681
|
+
}
|
|
3682
|
+
function zc(e, n) {
|
|
3683
|
+
return new this(e).pow(n);
|
|
3684
|
+
}
|
|
3685
|
+
function Zc(e) {
|
|
3686
|
+
var n, t, r, i, o = 0, s = new this(1), u = [];
|
|
3687
|
+
if (e === void 0 ? e = this.precision : B(e, 1, ue), r = Math.ceil(e / v), this.crypto)
|
|
3688
|
+
if (crypto.getRandomValues)
|
|
3689
|
+
for (n = crypto.getRandomValues(new Uint32Array(r)); o < r; )
|
|
3690
|
+
i = n[o], i >= 429e7 ? n[o] = crypto.getRandomValues(new Uint32Array(1))[0] : u[o++] = i % 1e7;
|
|
3691
|
+
else if (crypto.randomBytes) {
|
|
3692
|
+
for (n = crypto.randomBytes(r *= 4); o < r; )
|
|
3693
|
+
i = n[o] + (n[o + 1] << 8) + (n[o + 2] << 16) + ((n[o + 3] & 127) << 24), i >= 214e7 ? crypto.randomBytes(4).copy(n, o) : (u.push(i % 1e7), o += 4);
|
|
3694
|
+
o = r / 4;
|
|
3695
|
+
} else
|
|
3696
|
+
throw Error(Pt);
|
|
3697
|
+
else
|
|
3698
|
+
for (; o < r; )
|
|
3699
|
+
u[o++] = Math.random() * 1e7 | 0;
|
|
3700
|
+
for (r = u[--o], e %= v, r && e && (i = D(10, v - e), u[o] = (r / i | 0) * i); u[o] === 0; o--)
|
|
3701
|
+
u.pop();
|
|
3702
|
+
if (o < 0)
|
|
3703
|
+
t = 0, u = [0];
|
|
3704
|
+
else {
|
|
3705
|
+
for (t = -1; u[0] === 0; t -= v)
|
|
3706
|
+
u.shift();
|
|
3707
|
+
for (r = 1, i = u[0]; i >= 10; i /= 10)
|
|
3708
|
+
r++;
|
|
3709
|
+
r < v && (t -= v - r);
|
|
3710
|
+
}
|
|
3711
|
+
return s.e = t, s.d = u, s;
|
|
3712
|
+
}
|
|
3713
|
+
function Ac(e) {
|
|
3714
|
+
return g(e = new this(e), e.e + 1, this.rounding);
|
|
3715
|
+
}
|
|
3716
|
+
function $c(e) {
|
|
3717
|
+
return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
|
|
3718
|
+
}
|
|
3719
|
+
function Ic(e) {
|
|
3720
|
+
return new this(e).sin();
|
|
3721
|
+
}
|
|
3722
|
+
function Oc(e) {
|
|
3723
|
+
return new this(e).sinh();
|
|
3724
|
+
}
|
|
3725
|
+
function Cc(e) {
|
|
3726
|
+
return new this(e).sqrt();
|
|
3727
|
+
}
|
|
3728
|
+
function Tc(e, n) {
|
|
3729
|
+
return new this(e).sub(n);
|
|
3730
|
+
}
|
|
3731
|
+
function Rc() {
|
|
3732
|
+
var e = 0, n = arguments, t = new this(n[e]);
|
|
3733
|
+
for (N = !1; t.s && ++e < n.length; )
|
|
3734
|
+
t = t.plus(n[e]);
|
|
3735
|
+
return N = !0, g(t, this.precision, this.rounding);
|
|
3736
|
+
}
|
|
3737
|
+
function Dc(e) {
|
|
3738
|
+
return new this(e).tan();
|
|
3739
|
+
}
|
|
3740
|
+
function Fc(e) {
|
|
3741
|
+
return new this(e).tanh();
|
|
3742
|
+
}
|
|
3743
|
+
function Ec(e) {
|
|
3744
|
+
return g(e = new this(e), e.e + 1, 1);
|
|
3745
|
+
}
|
|
3746
|
+
p[Symbol.for("nodejs.util.inspect.custom")] = p.toString;
|
|
3747
|
+
p[Symbol.toStringTag] = "Decimal";
|
|
3748
|
+
var q = p.constructor = Tt(rn);
|
|
3749
|
+
Ue = new q(Ue);
|
|
3750
|
+
ye = new q(ye);
|
|
3751
|
+
const Uc = {
|
|
3752
|
+
UP: q.ROUND_UP,
|
|
3753
|
+
DOWN: q.ROUND_DOWN,
|
|
3754
|
+
CEIL: q.ROUND_CEIL,
|
|
3755
|
+
FLOOR: q.ROUND_FLOOR,
|
|
3756
|
+
HALF_UP: q.ROUND_HALF_UP,
|
|
3757
|
+
HALF_DOWN: q.ROUND_HALF_DOWN,
|
|
3758
|
+
HALF_EVEN: q.ROUND_HALF_EVEN,
|
|
3759
|
+
HALF_CEIL: q.ROUND_HALF_CEIL,
|
|
3760
|
+
HALF_FLOOR: q.ROUND_HALF_FLOOR
|
|
3761
|
+
}, le = (e, n) => {
|
|
3762
|
+
const { precision: t = 2, rounding: r = Uc.HALF_UP } = n || {};
|
|
3763
|
+
return new q(e).toDecimalPlaces(t, r).toNumber();
|
|
3764
|
+
};
|
|
3765
|
+
function la(e, n = {}) {
|
|
3766
|
+
const { baseAmount: t = 0, numberOfNights: r = 1, feeIncludedInBaseAmount: i = !1, extractedFromRates: o = !1, removedPercentages: s = [] } = n, u = le(t);
|
|
3767
|
+
switch (e.feeType) {
|
|
3768
|
+
case j.PercentageOfBooking:
|
|
3769
|
+
if (i)
|
|
3770
|
+
return le(u * e.amount / (100 + e.amount));
|
|
3771
|
+
if (o) {
|
|
3772
|
+
const c = s.reduce((l, f) => l + f / (100 + f), 0), a = u / (1 - c);
|
|
3773
|
+
return le(a * e.amount / (100 + e.amount));
|
|
3774
|
+
} else
|
|
3775
|
+
return le(u * (e.amount / 100));
|
|
3776
|
+
case j.FixedChargePerRoom:
|
|
3777
|
+
case j.FixedChargePerBooking:
|
|
3778
|
+
return e.amount;
|
|
3779
|
+
case j.NightlyChargePerRoom:
|
|
3780
|
+
return le(e.amount * r);
|
|
3781
|
+
default:
|
|
3782
|
+
return 0;
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
const yc = [j.FixedChargePerBooking], Lc = [j.PercentageOfBooking, j.FixedChargePerRoom, j.NightlyChargePerRoom], jc = [j.PercentageOfBooking];
|
|
3786
|
+
function _n(e, n) {
|
|
3787
|
+
return e.filter((t) => n.includes(t.feeType));
|
|
3788
|
+
}
|
|
3789
|
+
function fa(e) {
|
|
3790
|
+
return _n(e, yc);
|
|
3791
|
+
}
|
|
3792
|
+
function da(e) {
|
|
3793
|
+
return _n(e, Lc);
|
|
3794
|
+
}
|
|
3795
|
+
function ha(e) {
|
|
3796
|
+
return _n(e, jc);
|
|
3797
|
+
}
|
|
3798
|
+
function pa(e) {
|
|
3799
|
+
return {
|
|
3800
|
+
includeInRates: [j.PercentageOfBooking, j.NightlyChargePerRoom].includes(e),
|
|
3801
|
+
extractFeeFromRates: e === j.PercentageOfBooking,
|
|
3802
|
+
appliesToAddons: e === j.PercentageOfBooking,
|
|
3803
|
+
includePreviousFeesInCalculation: e === j.PercentageOfBooking
|
|
3804
|
+
};
|
|
3805
|
+
}
|
|
3806
|
+
const ma = (e) => e, ga = (e, n) => {
|
|
3807
|
+
const t = {};
|
|
3808
|
+
return n.forEach((r) => {
|
|
3809
|
+
r in e && (t[r] = e[r]);
|
|
3810
|
+
}), t;
|
|
3811
|
+
}, _a = (e, n) => e.includes("cdn.app.roomstay.io") ? e + "?w=" + n : e, ie = class {
|
|
3812
|
+
};
|
|
3813
|
+
ie.calculateBaseAddonTotal = (e, n) => {
|
|
3814
|
+
let t = 0, r = 0, i = 0;
|
|
3815
|
+
e.price && e.quantity && (t = e.quantity * Number(e.price)), e.pricingType === H.PER_ADULT_OCCUPANCY_PER_NIGHT && e.adultQuantity ? t *= e.adultQuantity : e.pricingType === H.PER_CHILD_OCCUPANCY_PER_NIGHT && e.childQuantity && (t *= e.childQuantity), e.adultPrice && e.adultQuantity && (r = e.adultQuantity * Number(e.adultPrice)), e.childPrice && e.childQuantity && (i = e.childQuantity * Number(e.childPrice));
|
|
3816
|
+
let o = t + r + i;
|
|
3817
|
+
return kt.includes(
|
|
3818
|
+
e.pricingType
|
|
3819
|
+
) && e.nights && !n && (o *= e.nights), {
|
|
3820
|
+
indPrice: t,
|
|
3821
|
+
indAdultPrice: r,
|
|
3822
|
+
indChildPrice: i,
|
|
3823
|
+
addonTotal: o
|
|
3824
|
+
};
|
|
3825
|
+
};
|
|
3826
|
+
ie.calculateBasketAddonTotal = (e, n = !1) => (Array.isArray(e) || (e = [e]), e.reduce(
|
|
3827
|
+
(r, i) => {
|
|
3828
|
+
var u, c, a, l, f, d;
|
|
3829
|
+
const o = ie.calculateBaseAddonTotal(
|
|
3830
|
+
i,
|
|
3831
|
+
n
|
|
3832
|
+
);
|
|
3833
|
+
let s = 0;
|
|
3834
|
+
return (i.fee || (u = i.fees) != null && u.length) && i.quantity ? (c = i.fees) != null && c.length ? i.fees.forEach((m) => {
|
|
3835
|
+
s += i.quantity * m.amount;
|
|
3836
|
+
}) : s = i.quantity * Number(i.fee) : ((i.adultFee || (a = i.adultFees) != null && a.length) && i.adultQuantity && ((l = i.adultFees) != null && l.length ? i.adultFees.forEach((m) => {
|
|
3837
|
+
s += i.adultQuantity * m.amount;
|
|
3838
|
+
}) : s += i.adultQuantity ?? 1 * Number(i.adultFee)), (i.childFee || (f = i.childFees) != null && f.length) && i.childQuantity && ((d = i.childFees) != null && d.length ? i.childFees.forEach((m) => {
|
|
3839
|
+
s += i.childQuantity ?? 1 * m.amount;
|
|
3840
|
+
}) : s += i.childQuantity * Number(i.childFee))), kt.includes(
|
|
3841
|
+
i.pricingType
|
|
3842
|
+
) && i.nights && !n && (s *= i.nights), {
|
|
3843
|
+
price: r.price + o.indPrice,
|
|
3844
|
+
adultPrice: r.adultPrice + o.indAdultPrice,
|
|
3845
|
+
childPrice: r.childPrice + o.indChildPrice,
|
|
3846
|
+
totalFees: r.totalFees + s,
|
|
3847
|
+
total: r.total + o.addonTotal + s
|
|
3848
|
+
};
|
|
3849
|
+
},
|
|
3850
|
+
{ price: 0, adultPrice: 0, childPrice: 0, totalFees: 0, total: 0 }
|
|
3851
|
+
));
|
|
3852
|
+
ie.calculateReservationAddonTotal = (e, n = !1) => (Array.isArray(e) || (e = [e]), e.reduce(
|
|
3853
|
+
(r, i) => {
|
|
3854
|
+
var l, f;
|
|
3855
|
+
const o = ie.calculateBaseAddonTotal(
|
|
3856
|
+
i,
|
|
3857
|
+
n
|
|
3858
|
+
);
|
|
3859
|
+
let s, u = i.discount || 0;
|
|
3860
|
+
i.total !== void 0 && i.total !== null ? s = i.total : s = o.addonTotal - u;
|
|
3861
|
+
let c = i.fees || 0;
|
|
3862
|
+
(l = i.itemisedFees) != null && l.length && (c = i.itemisedFees.reduce(
|
|
3863
|
+
(d, m) => d + m.amount,
|
|
3864
|
+
0
|
|
3865
|
+
));
|
|
3866
|
+
const a = (f = i.itemisedFees) != null && f.length ? s : s + c;
|
|
3867
|
+
return {
|
|
3868
|
+
price: r.price + o.indPrice,
|
|
3869
|
+
adultPrice: r.adultPrice + o.indAdultPrice,
|
|
3870
|
+
childPrice: r.childPrice + o.indChildPrice,
|
|
3871
|
+
totalFees: r.totalFees + c,
|
|
3872
|
+
total: r.total + s + c,
|
|
3873
|
+
displayPrice: r.displayPrice + a
|
|
3874
|
+
};
|
|
3875
|
+
},
|
|
3876
|
+
{
|
|
3877
|
+
price: 0,
|
|
3878
|
+
adultPrice: 0,
|
|
3879
|
+
childPrice: 0,
|
|
3880
|
+
totalFees: 0,
|
|
3881
|
+
total: 0,
|
|
3882
|
+
displayPrice: 0
|
|
3883
|
+
}
|
|
3884
|
+
));
|
|
3885
|
+
ie.calculateTotalForReservation = (e, n = !1) => {
|
|
3886
|
+
var r;
|
|
3887
|
+
let t = 0;
|
|
3888
|
+
return (r = e.itemisedFees) == null || r.forEach((i) => {
|
|
3889
|
+
t += i.amount;
|
|
3890
|
+
}), e.reservations.forEach((i) => {
|
|
3891
|
+
var s, u, c;
|
|
3892
|
+
t += i.total.afterTax;
|
|
3893
|
+
const o = ((s = Object.keys(i.nights)) == null ? void 0 : s.length) ?? 0;
|
|
3894
|
+
if ((u = i.addons) != null && u.length) {
|
|
3895
|
+
const a = (i.addons ?? []).map((l) => ({ ...l, nights: o }));
|
|
3896
|
+
t += (c = ie.calculateReservationAddonTotal(
|
|
3897
|
+
a,
|
|
3898
|
+
n
|
|
3899
|
+
)) == null ? void 0 : c.total;
|
|
3900
|
+
}
|
|
3901
|
+
}), le(t);
|
|
3902
|
+
};
|
|
3903
|
+
let wa = ie;
|
|
3904
|
+
function ka(e) {
|
|
3905
|
+
return e.toUpperCase();
|
|
3906
|
+
}
|
|
3907
|
+
export {
|
|
3908
|
+
kt as ADDON_PER_NIGHT_TYPES,
|
|
3909
|
+
Qc as AddGiftCardSchema,
|
|
3910
|
+
yu as AdyenEventCode,
|
|
3911
|
+
Uu as AdyenResultCode,
|
|
3912
|
+
wt as BaseGiftCardSchema,
|
|
3913
|
+
ra as CancelGiftCardTransactionSchema,
|
|
3914
|
+
ta as CompleteGiftCardTransactionSchema,
|
|
3915
|
+
Kc as CreatePaymentSessionSchema,
|
|
3916
|
+
Gc as DATE_FORMAT,
|
|
3917
|
+
H as EAddonPricingType,
|
|
3918
|
+
xt as EAdminCompanyUserRole,
|
|
3919
|
+
Ft as EBookingCustomFieldFormat,
|
|
3920
|
+
Dt as EBookingFlow,
|
|
3921
|
+
Et as EBookingPaymentMethod,
|
|
3922
|
+
Rt as EBookingStatus,
|
|
3923
|
+
jt as ECompanyProvider,
|
|
3924
|
+
Ht as EDistanceUnitType,
|
|
3925
|
+
j as EFeeType,
|
|
3926
|
+
Fu as EGiftCardPaymentProvider,
|
|
3927
|
+
Eu as EGiftCardPaymentStatus,
|
|
3928
|
+
Cu as EGiftCardPaymentType,
|
|
3929
|
+
Lu as EGiftCardTransactionType,
|
|
3930
|
+
ir as EGuaranteePolicyDepositMode,
|
|
3931
|
+
or as EGuarantyPolicyPrepaymentType,
|
|
3932
|
+
qt as EHotelAddressRequirement,
|
|
3933
|
+
Ut as EHotelCardProcessor,
|
|
3934
|
+
Bt as EHotelPriceModel,
|
|
3935
|
+
St as EHotelStateFieldConfiguration,
|
|
3936
|
+
Gt as EHotelWeekdayStartsOn,
|
|
3937
|
+
Vt as EIntegration,
|
|
3938
|
+
qu as ELogCategory,
|
|
3939
|
+
xu as ELogSeverity,
|
|
3940
|
+
Bu as ELogType,
|
|
3941
|
+
tr as EMembershipProvider,
|
|
3942
|
+
Qt as ENewbookRegion,
|
|
3943
|
+
Jt as ENewbookSyncStrategy,
|
|
3944
|
+
Kt as EPMSSyncStatus,
|
|
3945
|
+
yt as EPlanpayBookingStatus,
|
|
3946
|
+
sr as EPromoCodeDiscountType,
|
|
3947
|
+
cr as EPromoCodeStayDateRangeRepeatType,
|
|
3948
|
+
ur as EPromoCodeStayDateRangeType,
|
|
3949
|
+
Xt as ERMSAuthSyncHistoryStatus,
|
|
3950
|
+
Wt as ERMSDiscountType,
|
|
3951
|
+
Yt as ERMSSyncStrategy,
|
|
3952
|
+
ve as ERoomstayEventName,
|
|
3953
|
+
ar as ERoomstayEventSource,
|
|
3954
|
+
er as ERoomstayImageSize,
|
|
3955
|
+
ju as ETransactionStatus,
|
|
3956
|
+
Jc as EditGiftCardSchema,
|
|
3957
|
+
ia as GetCompanyConfigSchema,
|
|
3958
|
+
Lt as GuestProfile,
|
|
3959
|
+
lr as HttpMethod,
|
|
3960
|
+
Mt as IAuxiliaryFilterType,
|
|
3961
|
+
nr as IMaintenanceStatusService,
|
|
3962
|
+
Ou as InternationalAddressSchema,
|
|
3963
|
+
qc as ItineraryResponse,
|
|
3964
|
+
fr as META_USER_DATA_KEYS,
|
|
3965
|
+
xc as PCIBookingCardProcessorTypes,
|
|
3966
|
+
rr as Package,
|
|
3967
|
+
Ru as PassthroughPaymentDataSchema,
|
|
3968
|
+
Tu as PaymentProcessorDataSchema,
|
|
3969
|
+
Xc as PurchaseGiftCardSchema,
|
|
3970
|
+
na as RedeemGiftCardSchema,
|
|
3971
|
+
ua as RefreshGiftCardTokenSchema,
|
|
3972
|
+
ea as RefundGiftCardSchema,
|
|
3973
|
+
ca as RegisterGiftCardAdminSchema,
|
|
3974
|
+
Bc as Reservation,
|
|
3975
|
+
Sc as ReservedPackage,
|
|
3976
|
+
Uc as RoundingType,
|
|
3977
|
+
wa as TotalCalculator,
|
|
3978
|
+
sa as UpdateAdyenConfigSchema,
|
|
3979
|
+
oa as UpdateCompanyConfigSchema,
|
|
3980
|
+
Du as ValidateGiftCardSchema,
|
|
3981
|
+
Wc as buildPixelEventOptions,
|
|
3982
|
+
la as calculateFeeAmount,
|
|
3983
|
+
aa as calculateTotalForMemberBooking,
|
|
3984
|
+
pa as getFeeOptionValidity,
|
|
3985
|
+
ha as getFilteredBookingAddonFees,
|
|
3986
|
+
fa as getFilteredBookingFees,
|
|
3987
|
+
da as getFilteredBookingRateFees,
|
|
3988
|
+
E as maxString,
|
|
3989
|
+
ma as nameof,
|
|
3990
|
+
Iu as preprocessDate,
|
|
3991
|
+
$u as preprocessNumber,
|
|
3992
|
+
_t as requireEmail,
|
|
3993
|
+
vt as requireFutureDate,
|
|
3994
|
+
Ge as requirePositiveAmount,
|
|
3995
|
+
I as requireString,
|
|
3996
|
+
_a as resizeRoomstayImageUrl,
|
|
3997
|
+
le as roundMoney,
|
|
3998
|
+
ga as subset,
|
|
3999
|
+
Vc as toMetaEventName,
|
|
4000
|
+
Mc as transformToMetaEventData,
|
|
4001
|
+
Hc as transformToMetaUserData,
|
|
4002
|
+
ka as uppercaseString,
|
|
4003
|
+
Yc as validateFormWithZod
|
|
4004
|
+
};
|
|
4005
|
+
//# sourceMappingURL=index.js.map
|