@roomstay/core 0.2.0-1 → 0.2.0-2

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