@vectoriox/iox-ui 5.92.0 → 5.94.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectoriox-iox-ui-commerce-core.mjs","sources":["../../../projects/iox-ui/src/commerce-core/money-error.ts","../../../projects/iox-ui/src/commerce-core/currency.ts","../../../projects/iox-ui/src/commerce-core/decimal.ts","../../../projects/iox-ui/src/commerce-core/money.ts","../../../projects/iox-ui/src/commerce-core/labels.ts","../../../projects/iox-ui/src/commerce-core/limits.ts","../../../projects/iox-ui/src/commerce-core/vat.ts","../../../projects/iox-ui/src/commerce-core/catalog.ts","../../../projects/iox-ui/src/commerce-core/text.ts","../../../projects/iox-ui/src/commerce-core/shipping.ts","../../../projects/iox-ui/src/commerce-core/cart.ts","../../../projects/iox-ui/src/commerce-core/payments.ts","../../../projects/iox-ui/src/commerce-core/orders.ts","../../../projects/iox-ui/src/commerce-core/checkout.ts","../../../projects/iox-ui/src/commerce-core/order-snapshot.ts","../../../projects/iox-ui/src/commerce-core/public-api.ts","../../../projects/iox-ui/src/commerce-core/vectoriox-iox-ui-commerce-core.ts"],"sourcesContent":["export enum MoneyErrorCode {\n UnknownCurrency = 'unknown-currency',\n NotMoney = 'not-money',\n NotInteger = 'not-integer',\n NotANumber = 'not-a-number',\n TooManyDecimals = 'too-many-decimals',\n CurrencyMismatch = 'currency-mismatch',\n NotWhole = 'not-whole',\n Negative = 'negative',\n Overflow = 'overflow',\n OutOfRange = 'out-of-range',\n}\n\nexport class MoneyError extends Error {\n constructor(readonly code: MoneyErrorCode, message: string) {\n super(message);\n this.name = 'MoneyError';\n }\n}\n","import { MoneyError, MoneyErrorCode } from './money-error';\n\nexport enum CurrencyCode {\n ILS = 'ILS',\n USD = 'USD',\n EUR = 'EUR',\n GBP = 'GBP',\n CHF = 'CHF',\n CAD = 'CAD',\n AUD = 'AUD',\n NZD = 'NZD',\n SEK = 'SEK',\n NOK = 'NOK',\n DKK = 'DKK',\n PLN = 'PLN',\n CZK = 'CZK',\n HUF = 'HUF',\n RON = 'RON',\n TRY = 'TRY',\n AED = 'AED',\n SAR = 'SAR',\n QAR = 'QAR',\n EGP = 'EGP',\n MAD = 'MAD',\n ZAR = 'ZAR',\n INR = 'INR',\n CNY = 'CNY',\n HKD = 'HKD',\n SGD = 'SGD',\n THB = 'THB',\n MXN = 'MXN',\n BRL = 'BRL',\n JPY = 'JPY',\n KRW = 'KRW',\n VND = 'VND',\n CLP = 'CLP',\n ISK = 'ISK',\n BHD = 'BHD',\n KWD = 'KWD',\n JOD = 'JOD',\n OMR = 'OMR',\n TND = 'TND',\n}\n\n/** ISO-4217 minor units — our own table, never Intl's CLDR digits (they differ for some codes). */\nexport const CURRENCY_EXPONENTS: Readonly<Record<CurrencyCode, number>> = Object.freeze({\n [CurrencyCode.ILS]: 2,\n [CurrencyCode.USD]: 2,\n [CurrencyCode.EUR]: 2,\n [CurrencyCode.GBP]: 2,\n [CurrencyCode.CHF]: 2,\n [CurrencyCode.CAD]: 2,\n [CurrencyCode.AUD]: 2,\n [CurrencyCode.NZD]: 2,\n [CurrencyCode.SEK]: 2,\n [CurrencyCode.NOK]: 2,\n [CurrencyCode.DKK]: 2,\n [CurrencyCode.PLN]: 2,\n [CurrencyCode.CZK]: 2,\n [CurrencyCode.HUF]: 2,\n [CurrencyCode.RON]: 2,\n [CurrencyCode.TRY]: 2,\n [CurrencyCode.AED]: 2,\n [CurrencyCode.SAR]: 2,\n [CurrencyCode.QAR]: 2,\n [CurrencyCode.EGP]: 2,\n [CurrencyCode.MAD]: 2,\n [CurrencyCode.ZAR]: 2,\n [CurrencyCode.INR]: 2,\n [CurrencyCode.CNY]: 2,\n [CurrencyCode.HKD]: 2,\n [CurrencyCode.SGD]: 2,\n [CurrencyCode.THB]: 2,\n [CurrencyCode.MXN]: 2,\n [CurrencyCode.BRL]: 2,\n [CurrencyCode.JPY]: 0,\n [CurrencyCode.KRW]: 0,\n [CurrencyCode.VND]: 0,\n [CurrencyCode.CLP]: 0,\n [CurrencyCode.ISK]: 0,\n [CurrencyCode.BHD]: 3,\n [CurrencyCode.KWD]: 3,\n [CurrencyCode.JOD]: 3,\n [CurrencyCode.OMR]: 3,\n [CurrencyCode.TND]: 3,\n});\n\nexport const CURRENCY_CODES: readonly CurrencyCode[] = Object.freeze(Object.values(CurrencyCode));\n\nexport function isCurrencyCode(value: unknown): value is CurrencyCode {\n return typeof value === 'string' && Object.prototype.hasOwnProperty.call(CURRENCY_EXPONENTS, value);\n}\n\nexport function currencyExponent(currency: CurrencyCode): number {\n if (!isCurrencyCode(currency)) {\n throw new MoneyError(MoneyErrorCode.UnknownCurrency, `Unknown currency: ${String(currency)}`);\n }\n return CURRENCY_EXPONENTS[currency];\n}\n","import { MoneyError, MoneyErrorCode } from './money-error';\n\nexport interface DecimalDigits {\n negative: boolean;\n int: string;\n frac: string;\n}\n\nexport enum DecimalRounding {\n Exact = 'exact',\n HalfEven = 'half-even',\n}\n\nconst DECIMAL = /^([+-])?(\\d*)(?:\\.(\\d*))?(?:[eE]([+-]?\\d{1,3}))?$/;\n\n/** Plain decimal text, or the e-notation `String(number)` produces below 1e-6 and from 1e21. */\nexport function parseDecimal(text: string): DecimalDigits | null {\n const match = DECIMAL.exec(text);\n if (!match) return null;\n const int = match[2] ?? '';\n const frac = match[3] ?? '';\n if (!int && !frac) return null;\n const digits = int + frac;\n const point = int.length + Number(match[4] ?? 0);\n const shiftedInt = point <= 0 ? '' : point >= digits.length ? digits + '0'.repeat(point - digits.length) : digits.slice(0, point);\n const shiftedFrac = point <= 0 ? '0'.repeat(-point) + digits : point >= digits.length ? '' : digits.slice(point);\n return {\n negative: match[1] === '-',\n int: shiftedInt.replace(/^0+/, ''),\n frac: shiftedFrac.replace(/0+$/, ''),\n };\n}\n\nfunction safeFromDigits(digits: string): number {\n const trimmed = digits.replace(/^0+/, '') || '0';\n const value = trimmed.length > 16 ? Infinity : Number(trimmed);\n if (!Number.isSafeInteger(value)) {\n throw new MoneyError(MoneyErrorCode.Overflow, `${digits} is beyond the safe integer range`);\n }\n return value;\n}\n\n/** Scales a parsed decimal by 10^exponent into an integer, without ever touching a float. */\nexport function decimalToScaledInteger(decimal: DecimalDigits, exponent: number, rounding: DecimalRounding): number {\n const kept = decimal.frac.slice(0, exponent);\n const rest = decimal.frac.slice(exponent);\n if (rest && rounding === DecimalRounding.Exact) {\n throw new MoneyError(MoneyErrorCode.TooManyDecimals, `More than ${exponent} decimal digits`);\n }\n let magnitude = safeFromDigits(decimal.int + kept.padEnd(exponent, '0'));\n if (rest) {\n const first = Number(rest[0]);\n const tie = first === 5 && /^5$/.test(rest);\n const up = first > 5 || (first === 5 && !tie) || (tie && magnitude % 2 === 1);\n if (up) magnitude += 1;\n if (!Number.isSafeInteger(magnitude)) {\n throw new MoneyError(MoneyErrorCode.Overflow, 'Rounded value is beyond the safe integer range');\n }\n }\n return decimal.negative && magnitude !== 0 ? -magnitude : magnitude;\n}\n\n/** Integer division rounded half-to-even; numerator ≥ 0, denominator > 0, both safe integers. */\nexport function divideHalfEven(numerator: number, denominator: number): number {\n let quotient = Math.trunc(numerator / denominator);\n let remainder = numerator - quotient * denominator;\n while (remainder < 0) {\n quotient -= 1;\n remainder += denominator;\n }\n while (remainder >= denominator) {\n quotient += 1;\n remainder -= denominator;\n }\n const twice = remainder * 2;\n if (twice > denominator || (twice === denominator && quotient % 2 === 1)) quotient += 1;\n return quotient;\n}\n\n/** Integer division that never trusts the float quotient: trunc, then corrected by the remainder. */\nfunction divMod(numerator: number, denominator: number): [number, number] {\n let quotient = Math.trunc(numerator / denominator);\n let remainder = numerator - quotient * denominator;\n while (remainder < 0) {\n quotient -= 1;\n remainder += denominator;\n }\n while (remainder >= denominator) {\n quotient += 1;\n remainder -= denominator;\n }\n return [quotient, remainder];\n}\n\n/**\n * round-half-even(a × b / d) for a, b ≥ 0 and d > b, without forming a × b (it can pass 2^53): a = q·d + r, so\n * a·b/d = q·b + r·b/d, where q·b < a and r·b < d·b — callers keep d·b a safe integer.\n */\nexport function mulDivHalfEven(a: number, b: number, d: number): number {\n const [q, r] = divMod(a, d);\n const [f, rest] = divMod(r * b, d);\n let result = q * b + f;\n const twice = rest * 2;\n if (twice > d || (twice === d && result % 2 === 1)) result += 1;\n return result;\n}\n","import { CurrencyCode, currencyExponent, isCurrencyCode } from './currency';\nimport { DecimalRounding, decimalToScaledInteger, divideHalfEven, parseDecimal } from './decimal';\nimport { MoneyError, MoneyErrorCode } from './money-error';\n\nexport interface Money {\n /** Integer minor units (agorot, cents, fils…). */\n amount: number;\n currency: CurrencyCode;\n}\n\nconst MAX_PERCENT_DECIMALS = 6;\n\nexport function isMoney(value: unknown): value is Money {\n if (typeof value !== 'object' || value === null) return false;\n const record = value as Record<string, unknown>;\n return Number.isSafeInteger(record['amount']) && isCurrencyCode(record['currency']);\n}\n\nfunction assertWhole(amount: number, what: string): void {\n if (typeof amount !== 'number' || !Number.isSafeInteger(amount)) {\n throw new MoneyError(MoneyErrorCode.NotInteger, `${what} must be a whole number of minor units, got ${String(amount)}`);\n }\n}\n\nfunction assertMoney(value: Money): void {\n if (typeof value !== 'object' || value === null) {\n throw new MoneyError(MoneyErrorCode.NotMoney, `Not a Money value: ${String(value)}`);\n }\n currencyExponent(value.currency);\n assertWhole(value.amount, 'Money.amount');\n}\n\nfunction assertSameCurrency(a: Money, b: Money): void {\n assertMoney(a);\n assertMoney(b);\n if (a.currency !== b.currency) {\n throw new MoneyError(MoneyErrorCode.CurrencyMismatch, `Cannot combine ${a.currency} with ${b.currency}`);\n }\n}\n\nfunction safeResult(amount: number, currency: CurrencyCode): Money {\n if (!Number.isSafeInteger(amount)) {\n throw new MoneyError(MoneyErrorCode.Overflow, 'Result is beyond the safe integer range');\n }\n return { amount: amount === 0 ? 0 : amount, currency };\n}\n\nexport function money(amount: number, currency: CurrencyCode): Money {\n currencyExponent(currency);\n assertWhole(amount, 'amount');\n return { amount: amount === 0 ? 0 : amount, currency };\n}\n\nfunction decimalText(value: number | string): string | null {\n if (typeof value === 'number') return Number.isFinite(value) ? String(value) : null;\n if (typeof value === 'string') return value.trim();\n return null;\n}\n\n/** Exact: `19.99` → 1999 by reading the digits, never `x * 100`; refuses digits the currency lacks. */\nexport function majorToMinor(major: number | string, currency: CurrencyCode): number {\n const exponent = currencyExponent(currency);\n const text = decimalText(major);\n const decimal = text === null ? null : parseDecimal(text);\n if (!decimal) {\n throw new MoneyError(MoneyErrorCode.NotANumber, `Not a decimal amount: ${String(major)}`);\n }\n return decimalToScaledInteger(decimal, exponent, DecimalRounding.Exact);\n}\n\nexport function minorToMajor(minor: number, currency: CurrencyCode): number {\n const exponent = currencyExponent(currency);\n assertWhole(minor, 'minor');\n return exponent === 0 ? minor : minor / 10 ** exponent;\n}\n\nexport function addMoney(a: Money, b: Money): Money {\n assertSameCurrency(a, b);\n return safeResult(a.amount + b.amount, a.currency);\n}\n\nexport function subtractMoney(a: Money, b: Money): Money {\n assertSameCurrency(a, b);\n return safeResult(a.amount - b.amount, a.currency);\n}\n\nexport function timesMoney(value: Money, quantity: number): Money {\n assertMoney(value);\n if (typeof quantity !== 'number' || !Number.isSafeInteger(quantity)) {\n throw new MoneyError(MoneyErrorCode.NotWhole, `Quantity must be a whole number, got ${String(quantity)}`);\n }\n if (quantity < 0) {\n throw new MoneyError(MoneyErrorCode.Negative, `Quantity cannot be negative, got ${quantity}`);\n }\n return safeResult(value.amount * quantity, value.currency);\n}\n\n/** `percent` of an amount, rounded ONCE to a minor unit, half-to-even (banker's). */\nexport function percentOf(value: Money, percent: number): Money {\n assertMoney(value);\n if (typeof percent !== 'number' || !Number.isFinite(percent)) {\n throw new MoneyError(MoneyErrorCode.NotANumber, `Percent must be a finite number, got ${String(percent)}`);\n }\n if (percent < 0) {\n throw new MoneyError(MoneyErrorCode.Negative, `Percent cannot be negative, got ${percent}`);\n }\n const decimal = parseDecimal(String(percent));\n if (!decimal) {\n throw new MoneyError(MoneyErrorCode.NotANumber, `Percent must be a finite number, got ${String(percent)}`);\n }\n if (decimal.frac.length > MAX_PERCENT_DECIMALS) {\n throw new MoneyError(MoneyErrorCode.TooManyDecimals, `Percent has more than ${MAX_PERCENT_DECIMALS} decimal digits`);\n }\n const scale = decimal.frac.length;\n const percentScaled = decimalToScaledInteger(decimal, scale, DecimalRounding.Exact);\n const numerator = Math.abs(value.amount) * percentScaled;\n if (!Number.isSafeInteger(numerator)) {\n throw new MoneyError(MoneyErrorCode.Overflow, 'Percent of this amount is beyond the safe integer range');\n }\n const magnitude = divideHalfEven(numerator, 100 * 10 ** scale);\n return safeResult(value.amount < 0 ? -magnitude : magnitude, value.currency);\n}\n\nconst formatters = new Map<string, Intl.NumberFormat>();\n\nexport function formatMoney(value: Money, locale: string): string {\n assertMoney(value);\n const exponent = currencyExponent(value.currency);\n const key = `${locale}|${value.currency}`;\n let formatter = formatters.get(key);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: value.currency,\n minimumFractionDigits: exponent,\n maximumFractionDigits: exponent,\n });\n formatters.set(key, formatter);\n }\n return formatter.format(minorToMajor(value.amount, value.currency));\n}\n\n/**\n * For the one boot migration of stored major-unit prices. A stored float may carry arithmetic noise\n * (19.990000000000002), so extra digits round half-to-even instead of refusing. No usable price\n * (null, '', NaN, text, a negative) → null; it never applies twice by itself — the caller marks rows.\n */\nexport function migrateMajorPrice(value: unknown, currency: CurrencyCode): number | null {\n const exponent = currencyExponent(currency);\n if (typeof value !== 'number' && typeof value !== 'string') return null;\n const text = decimalText(value);\n const decimal = text ? parseDecimal(text) : null;\n if (!decimal || (decimal.negative && (decimal.int || decimal.frac))) return null;\n try {\n return decimalToScaledInteger(decimal, exponent, DecimalRounding.HalfEven);\n } catch {\n return null;\n }\n}\n","/**\n * The words a refusal or a state is shown with. A string-rendered site and iox-cms's emails have no translation\n * service, so the core carries English and Hebrew itself (the `blurbHe` / `sentWord` precedent); a host with its\n * own translations may key them by the stable code instead.\n */\nexport enum CommerceLanguage {\n En = 'en',\n He = 'he',\n}\n\nexport interface CommerceLabel {\n readonly en: string;\n readonly he: string;\n}\n\nconst LANGUAGE_ALIASES: Readonly<Record<string, CommerceLanguage>> = Object.freeze({\n en: CommerceLanguage.En,\n he: CommerceLanguage.He,\n iw: CommerceLanguage.He,\n});\n\nexport function commerceLanguage(lang: string | null | undefined): CommerceLanguage {\n const primary = String(lang ?? '').trim().toLowerCase().split(/[-_]/)[0];\n return LANGUAGE_ALIASES[primary] ?? CommerceLanguage.En;\n}\n\nexport function labelIn(label: CommerceLabel, lang: string | null | undefined): string {\n return label[commerceLanguage(lang)];\n}\n","/** A cart holds at most this many distinct lines; more are dropped (`too-many-lines`). */\nexport const MAX_CART_LINES = 100;\n/** One line's quantity is capped here (`quantity-capped`), before stock. */\nexport const MAX_LINE_QUANTITY = 999;\n/**\n * The largest subtotal, shipping price or threshold, in minor units. Subtotal + shipping stays far below 2^53, and\n * the included-VAT arithmetic never forms a product past it.\n */\nexport const MAX_CART_AMOUNT = 10 ** 15;\n","import { currencyExponent } from './currency';\nimport { decimalToScaledInteger, DecimalRounding, mulDivHalfEven, parseDecimal } from './decimal';\nimport { Money } from './money';\nimport { MoneyError, MoneyErrorCode } from './money-error';\n\nexport const MAX_VAT_PERCENT = 100;\n/** 17, 18, 7.7, 8.1 — four decimals is more than any rate in force; it also keeps the arithmetic below 2^53. */\nexport const VAT_PERCENT_MAX_DECIMALS = 4;\n\nexport function isVatPercent(value: unknown): value is number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > MAX_VAT_PERCENT) return false;\n const decimal = parseDecimal(String(value));\n return !!decimal && decimal.frac.length <= VAT_PERCENT_MAX_DECIMALS;\n}\n\n/**\n * The VAT a VAT-INCLUSIVE amount already holds (C-D8): amount × v / (100 + v), rounded ONCE to a minor unit,\n * half-to-even. Exact: v is read as the integer R = v·10^s (s ≤ 4 decimals), so the share is\n * amount × R / (100·10^s + R) in whole numbers. 118.00 at 18 % → 18.00; 100.00 at 17 % → 14.53.\n */\nexport function includedVat(total: Money, vatPercent: number): Money {\n currencyExponent(total.currency);\n if (typeof total.amount !== 'number' || !Number.isSafeInteger(total.amount)) {\n throw new MoneyError(MoneyErrorCode.NotInteger, `total must be a whole number of minor units, got ${String(total.amount)}`);\n }\n if (!isVatPercent(vatPercent)) {\n throw new MoneyError(MoneyErrorCode.OutOfRange, `VAT must be 0–${MAX_VAT_PERCENT} with at most ${VAT_PERCENT_MAX_DECIMALS} decimals, got ${String(vatPercent)}`);\n }\n const decimal = parseDecimal(String(vatPercent))!;\n const scale = decimal.frac.length;\n const rate = decimalToScaledInteger(decimal, scale, DecimalRounding.Exact);\n const magnitude = Math.abs(total.amount);\n if (magnitude > Number.MAX_SAFE_INTEGER / 2) {\n throw new MoneyError(MoneyErrorCode.Overflow, 'Amount is beyond the range VAT is computed for');\n }\n const share = mulDivHalfEven(magnitude, rate, 100 * 10 ** scale + rate);\n return { amount: total.amount < 0 && share !== 0 ? -share : share, currency: total.currency };\n}\n","import { Money } from './money';\n\n/** The storefront's stock word (iox-cms `storefront-projection.ts` speaks the same values). */\nexport enum Availability {\n InStock = 'in_stock',\n Low = 'low',\n Out = 'out',\n}\n\n/**\n * One sellable unit as the seller knows it, in minor units: a product with no options is ONE entry with no\n * `variantId`; a product with options is one entry per variant. iox-cms builds it from the product row (with the\n * stock COUNT); the engine builds it from the storefront projection (with the availability WORD only).\n */\nexport interface CatalogEntry {\n productId: string;\n variantId?: string | null;\n title: string;\n variantName?: string | null;\n /** null = no price set yet (a sample's placeholder): never sold. */\n unitPrice: Money | null;\n compareAt?: Money | null;\n /** The count, where the caller knows it (iox-cms). Wins over `availability`. */\n stock?: number | null;\n /** The word, where only it is known (the engine). */\n availability?: Availability | null;\n /** A variant's switch; a product with no options is `true`. */\n enabled: boolean;\n published: boolean;\n /** false = a digital product: no delivery address, no shipping method. */\n requiresShipping: boolean;\n image?: string | null;\n}\n\n/** How many units may be sold: the count, else 0 for `out` or nothing known, else null = unbounded here (the server checks the count). */\nexport function sellableQuantity(entry: CatalogEntry): number | null {\n if (typeof entry.stock === 'number') return Number.isSafeInteger(entry.stock) && entry.stock > 0 ? entry.stock : 0;\n if (entry.availability === Availability.InStock || entry.availability === Availability.Low) return null;\n return 0;\n}\n\nexport const catalogKey = (productId: string, variantId?: string | null): string => `${productId}\\u0000${variantId ?? ''}`;\n","export const filled = (value: unknown): value is string => typeof value === 'string' && value.trim() !== '';\n\nexport const looksLikeEmail = (value: unknown): boolean => filled(value) && /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value.trim());\n\nexport const digitsOf = (value: unknown): string => (typeof value === 'string' ? value.replace(/\\D/g, '') : '');\n\n/** A phone a person can be called on: 7–15 digits once spaces, dashes, brackets and a leading + are dropped. */\nexport const looksLikePhone = (value: unknown): boolean =>\n filled(value) && /^\\+?[\\d\\s\\-().]+$/.test(value.trim()) && digitsOf(value).length >= 7 && digitsOf(value).length <= 15;\n\n/** An Israeli mobile number (Bit sends to one): 05X-XXXXXXX, or +972 5X-XXXXXXX. */\nexport const looksLikeIsraeliMobile = (value: unknown): boolean =>\n filled(value) && /^\\+?[\\d\\s\\-().]+$/.test(value.trim()) && /^(?:9725|05)\\d{8}$/.test(digitsOf(value));\n","import { CurrencyCode } from './currency';\nimport { CommerceLabel } from './labels';\nimport { MAX_CART_AMOUNT } from './limits';\nimport { isMoney, money, Money, subtractMoney } from './money';\nimport { filled } from './text';\n\n/** Shipping v1 (C-D9): methods per studio, one country. Zones and weights come later. */\nexport enum ShippingMethodKind {\n Pickup = 'pickup',\n Flat = 'flat',\n /** A flat price that becomes free once the goods reach `freeOver`. */\n FreeOver = 'freeOver',\n /** No address, nothing shipped — offered only when nothing in the cart ships. */\n Digital = 'digital',\n}\n\n/** What an owner must fill for a method of a kind. */\nexport enum ShippingField {\n Price = 'price',\n FreeOver = 'freeOver',\n PickupAddress = 'pickupAddress',\n}\n\nexport interface ShippingMethod {\n id: string;\n kind: ShippingMethodKind;\n name: string;\n enabled: boolean;\n price?: Money | null;\n freeOver?: Money | null;\n pickupAddress?: string | null;\n pickupHours?: string | null;\n}\n\ninterface ShippingKindRule {\n readonly needsAddress: boolean;\n /** Offered for a cart where something ships (true) or for one where nothing does (false). */\n readonly forPhysical: boolean;\n readonly requires: readonly ShippingField[];\n readonly price: (method: ShippingMethod, goods: Money) => Money;\n readonly label: CommerceLabel;\n}\n\nconst zero = (goods: Money): Money => money(0, goods.currency);\n\nexport const SHIPPING_KINDS: Readonly<Record<ShippingMethodKind, ShippingKindRule>> = Object.freeze({\n [ShippingMethodKind.Pickup]: {\n needsAddress: false,\n forPhysical: true,\n requires: [ShippingField.PickupAddress],\n price: (_method: ShippingMethod, goods: Money) => zero(goods),\n label: { en: 'Pickup', he: 'איסוף עצמי' },\n },\n [ShippingMethodKind.Flat]: {\n needsAddress: true,\n forPhysical: true,\n requires: [ShippingField.Price],\n price: (method: ShippingMethod) => method.price as Money,\n label: { en: 'Flat-rate delivery', he: 'משלוח במחיר קבוע' },\n },\n [ShippingMethodKind.FreeOver]: {\n needsAddress: true,\n forPhysical: true,\n requires: [ShippingField.Price, ShippingField.FreeOver],\n price: (method: ShippingMethod, goods: Money) =>\n goods.amount >= (method.freeOver as Money).amount ? zero(goods) : (method.price as Money),\n label: { en: 'Delivery, free over an amount', he: 'משלוח, חינם מעל סכום' },\n },\n [ShippingMethodKind.Digital]: {\n needsAddress: false,\n forPhysical: false,\n requires: [],\n price: (_method: ShippingMethod, goods: Money) => zero(goods),\n label: { en: 'Digital — nothing shipped', he: 'דיגיטלי — ללא משלוח' },\n },\n});\n\nconst validAmount = (value: unknown, currency: CurrencyCode): boolean =>\n isMoney(value) && value.currency === currency && value.amount >= 0 && value.amount <= MAX_CART_AMOUNT;\n\nconst SHIPPING_FIELD_CHECKS: Readonly<Record<ShippingField, (method: ShippingMethod, currency: CurrencyCode) => boolean>> = Object.freeze({\n [ShippingField.Price]: (method: ShippingMethod, currency: CurrencyCode) => validAmount(method.price, currency),\n [ShippingField.FreeOver]: (method: ShippingMethod, currency: CurrencyCode) => validAmount(method.freeOver, currency),\n [ShippingField.PickupAddress]: (method: ShippingMethod) => filled(method.pickupAddress),\n});\n\nexport const isShippingMethodKind = (value: unknown): value is ShippingMethodKind =>\n typeof value === 'string' && Object.prototype.hasOwnProperty.call(SHIPPING_KINDS, value);\n\nexport function shippingNeedsAddress(kind: ShippingMethodKind): boolean {\n return isShippingMethodKind(kind) && SHIPPING_KINDS[kind].needsAddress;\n}\n\n/** The fields a method lacks (or holds in another currency) — empty = it can be offered. */\nexport function shippingMethodProblems(method: ShippingMethod, currency: CurrencyCode): ShippingField[] {\n if (!method || !isShippingMethodKind(method.kind)) return [ShippingField.Price];\n return SHIPPING_KINDS[method.kind].requires.filter(field => !SHIPPING_FIELD_CHECKS[field](method, currency));\n}\n\n/** Enabled, complete, with an id and a name: the ONE rule both the offer and the checkout gate read. */\nexport function shippingMethodReady(method: ShippingMethod, currency: CurrencyCode): boolean {\n return !!method && method.enabled === true && filled(method.id) && filled(method.name)\n && shippingMethodProblems(method, currency).length === 0;\n}\n\nexport interface ShippingQuote {\n methodId: string;\n kind: ShippingMethodKind;\n name: string;\n price: Money;\n /** A free-over method whose threshold the goods reached. */\n free: boolean;\n needsAddress: boolean;\n}\n\n/** What a quote reads of a cart. */\nexport interface ShippingGoods {\n currency: CurrencyCode;\n /** The goods after discounts — what a free-over threshold is compared with. */\n goods: Money;\n requiresShipping: boolean;\n lineCount: number;\n}\n\n/** The part of a `PricedCart` the offer reads. */\nexport interface ShippingCart {\n currency: CurrencyCode;\n subtotal: Money;\n discount: Money;\n requiresShipping: boolean;\n lines: readonly unknown[];\n}\n\nexport function quoteShipping(methods: readonly ShippingMethod[], cart: ShippingGoods): ShippingQuote[] {\n const list: readonly ShippingMethod[] = Array.isArray(methods) ? methods : [];\n if (!cart.lineCount) return [];\n const seen = new Set<string>();\n return list\n .filter(method => shippingMethodReady(method, cart.currency)\n && SHIPPING_KINDS[method.kind].forPhysical === cart.requiresShipping\n && !seen.has(method.id) && !!seen.add(method.id))\n .map(method => {\n const rule = SHIPPING_KINDS[method.kind];\n const price = rule.price(method, cart.goods);\n return {\n methodId: method.id,\n kind: method.kind,\n name: method.name,\n price: money(price.amount, price.currency),\n free: method.kind === ShippingMethodKind.FreeOver && price.amount === 0,\n needsAddress: rule.needsAddress,\n };\n });\n}\n\n/**\n * The methods a buyer may choose for this cart, each priced for it (free over: free when the goods after\n * discounts are AT or above the threshold). A cart where nothing ships is offered Digital methods only; a cart\n * where anything ships never is.\n */\nexport function availableShippingMethods(methods: readonly ShippingMethod[], pricedCart: ShippingCart): ShippingQuote[] {\n return quoteShipping(methods, {\n currency: pricedCart.currency,\n goods: subtractMoney(pricedCart.subtotal, pricedCart.discount),\n requiresShipping: pricedCart.requiresShipping,\n lineCount: pricedCart.lines.length,\n });\n}\n","import { CatalogEntry, catalogKey, sellableQuantity } from './catalog';\nimport { CurrencyCode, currencyExponent } from './currency';\nimport { CommerceLabel } from './labels';\nimport { MAX_CART_AMOUNT, MAX_CART_LINES, MAX_LINE_QUANTITY } from './limits';\nimport { addMoney, isMoney, money, Money, subtractMoney, timesMoney } from './money';\nimport { quoteShipping, ShippingMethod, ShippingQuote } from './shipping';\nimport { includedVat, isVatPercent } from './vat';\n\n/** A cart names what and how many — never a price (C-D16, trap T1): every read prices it again. */\nexport interface CartLine {\n productId: string;\n variantId?: string | null;\n quantity: number;\n}\n\nexport interface Cart {\n lines: readonly CartLine[];\n}\n\nexport interface StudioCommerce {\n currency: CurrencyCode;\n /** Prices INCLUDE it (C-D8). */\n vatPercent: number;\n shippingMethods: readonly ShippingMethod[];\n}\n\nexport interface PricingChoice {\n shippingMethodId?: string | null;\n}\n\nexport enum CartIssueCode {\n /** Not a whole number ≥ 1: the line is dropped. */\n InvalidQuantity = 'invalid-quantity',\n /** The same product and variant twice: merged into the first. */\n DuplicateLine = 'duplicate-line',\n TooManyLines = 'too-many-lines',\n QuantityCapped = 'quantity-capped',\n UnknownProduct = 'unknown-product',\n /** The product exists, this variant does not (or the product needs a variant chosen). */\n UnknownVariant = 'unknown-variant',\n Unpublished = 'unpublished',\n VariantDisabled = 'variant-disabled',\n NoPrice = 'no-price',\n CurrencyMismatch = 'currency-mismatch',\n OutOfStock = 'out-of-stock',\n /** Fewer left than asked: the line keeps what is left. */\n QuantityClamped = 'quantity-clamped',\n /** The line would push the subtotal past `MAX_CART_AMOUNT`: dropped. */\n AmountTooLarge = 'amount-too-large',\n /** The chosen shipping method is not offered for this cart: no shipping is priced. */\n ShippingUnavailable = 'shipping-unavailable',\n /** The studio's VAT is not a usable rate: the VAT line reads 0. */\n VatInvalid = 'vat-invalid',\n}\n\nexport const CART_ISSUE_LABELS: Readonly<Record<CartIssueCode, CommerceLabel>> = Object.freeze({\n [CartIssueCode.InvalidQuantity]: { en: 'A quantity was not a whole number, so the item was removed.', he: 'כמות שאינה מספר שלם — הפריט הוסר.' },\n [CartIssueCode.DuplicateLine]: { en: 'The same item appeared twice and was combined.', he: 'אותו פריט הופיע פעמיים ואוחד.' },\n [CartIssueCode.TooManyLines]: { en: 'Your cart has too many different items; the last ones were removed.', he: 'יש בעגלה יותר מדי פריטים שונים; האחרונים הוסרו.' },\n [CartIssueCode.QuantityCapped]: { en: 'That is more than one order can hold; the quantity was lowered.', he: 'הכמות גדולה מהמותר בהזמנה אחת, והיא הוקטנה.' },\n [CartIssueCode.UnknownProduct]: { en: 'An item is no longer sold and was removed.', he: 'פריט כבר לא נמכר והוסר.' },\n [CartIssueCode.UnknownVariant]: { en: 'An option of an item is no longer sold and was removed.', he: 'אפשרות של פריט כבר לא נמכרת והוסרה.' },\n [CartIssueCode.Unpublished]: { en: 'An item is not on sale right now and was removed.', he: 'פריט אינו למכירה כרגע והוסר.' },\n [CartIssueCode.VariantDisabled]: { en: 'An option of an item is not available and was removed.', he: 'אפשרות של פריט אינה זמינה והוסרה.' },\n [CartIssueCode.NoPrice]: { en: 'An item has no price yet and was removed.', he: 'לפריט עדיין אין מחיר, והוא הוסר.' },\n [CartIssueCode.CurrencyMismatch]: { en: 'An item is priced in another currency and was removed.', he: 'פריט מתומחר במטבע אחר והוסר.' },\n [CartIssueCode.OutOfStock]: { en: 'An item is out of stock and was removed.', he: 'פריט אזל מהמלאי והוסר.' },\n [CartIssueCode.QuantityClamped]: { en: 'Fewer are left than you asked for; your cart holds what is left.', he: 'נשארו פחות ממה שביקשתם; בעגלה מה שנשאר.' },\n [CartIssueCode.AmountTooLarge]: { en: 'The order is too large; an item was removed.', he: 'ההזמנה גדולה מדי; פריט הוסר.' },\n [CartIssueCode.ShippingUnavailable]: { en: 'That delivery method is not available for this order. Choose another.', he: 'שיטת המשלוח הזו אינה זמינה להזמנה. בחרו אחרת.' },\n [CartIssueCode.VatInvalid]: { en: 'The shop\\'s VAT rate is not set correctly.', he: 'שיעור המע\"מ של החנות אינו מוגדר כראוי.' },\n});\n\nexport interface CartIssue {\n code: CartIssueCode;\n productId?: string;\n variantId?: string | null;\n /** What the cart asked for. */\n requested?: number;\n /** What the priced line holds now (clamped / capped). */\n quantity?: number;\n shippingMethodId?: string;\n}\n\nexport interface PricedLine {\n productId: string;\n variantId: string | null;\n title: string;\n variantName: string | null;\n quantity: number;\n unitPrice: Money;\n /** Shown struck through — only when it is above the price. */\n compareAt: Money | null;\n lineTotal: Money;\n requiresShipping: boolean;\n image: string | null;\n}\n\nexport interface PricedCart {\n currency: CurrencyCode;\n lines: PricedLine[];\n subtotal: Money;\n /** Zero until coupons (E4); `total` already subtracts it. */\n discount: Money;\n shipping: Money;\n shippingMethod: ShippingQuote | null;\n requiresShipping: boolean;\n /** subtotal − discount + shipping: what the buyer pays. VAT is INSIDE it. */\n total: Money;\n /** The VAT `total` includes: total × v / (100 + v), rounded once half-to-even (`includedVat`). */\n vat: Money;\n vatPercent: number;\n issues: CartIssue[];\n}\n\ninterface LineRefusal {\n readonly code: CartIssueCode;\n readonly refuses: (entry: CatalogEntry, currency: CurrencyCode) => boolean;\n}\n\n/** Checked in order; the first that refuses drops the line. */\nconst LINE_REFUSALS: readonly LineRefusal[] = Object.freeze([\n { code: CartIssueCode.Unpublished, refuses: (entry: CatalogEntry) => entry.published !== true },\n { code: CartIssueCode.VariantDisabled, refuses: (entry: CatalogEntry) => entry.enabled !== true },\n { code: CartIssueCode.NoPrice, refuses: (entry: CatalogEntry) => !isMoney(entry.unitPrice) || entry.unitPrice.amount < 0 },\n { code: CartIssueCode.CurrencyMismatch, refuses: (entry: CatalogEntry, currency: CurrencyCode) => (entry.unitPrice as Money).currency !== currency },\n { code: CartIssueCode.OutOfStock, refuses: (entry: CatalogEntry) => sellableQuantity(entry) === 0 },\n]);\n\nconst isText = (value: unknown): value is string => typeof value === 'string' && value !== '';\nconst variantOf = (line: CartLine): string | null => (isText(line.variantId) ? line.variantId : null);\nconst validQuantity = (quantity: unknown): quantity is number =>\n typeof quantity === 'number' && Number.isSafeInteger(quantity) && quantity >= 1;\n\ninterface WantedLine {\n productId: string;\n variantId: string | null;\n quantity: number;\n}\n\n/** Drops malformed lines, merges duplicates, keeps the first `MAX_CART_LINES` distinct ones. */\nfunction wantedLines(cart: Cart, issues: CartIssue[]): WantedLine[] {\n const lines: readonly CartLine[] = cart && Array.isArray(cart.lines) ? cart.lines : [];\n const byKey = new Map<string, WantedLine>();\n for (const line of lines) {\n const productId = line && isText(line.productId) ? line.productId : '';\n const variantId = line ? variantOf(line) : null;\n if (!productId) {\n issues.push({ code: CartIssueCode.UnknownProduct });\n continue;\n }\n if (!validQuantity(line.quantity)) {\n issues.push({ code: CartIssueCode.InvalidQuantity, productId, variantId });\n continue;\n }\n const key = catalogKey(productId, variantId);\n const same = byKey.get(key);\n if (same) {\n same.quantity = Math.min(same.quantity + line.quantity, Number.MAX_SAFE_INTEGER);\n issues.push({ code: CartIssueCode.DuplicateLine, productId, variantId });\n continue;\n }\n if (byKey.size >= MAX_CART_LINES) {\n issues.push({ code: CartIssueCode.TooManyLines, productId, variantId });\n continue;\n }\n byKey.set(key, { productId, variantId, quantity: line.quantity });\n }\n return [...byKey.values()];\n}\n\nfunction indexCatalog(catalog: readonly CatalogEntry[]): { entries: Map<string, CatalogEntry>; products: Set<string> } {\n const entries = new Map<string, CatalogEntry>();\n const products = new Set<string>();\n const list: readonly CatalogEntry[] = Array.isArray(catalog) ? catalog : [];\n for (const entry of list) {\n if (!entry || !isText(entry.productId)) continue;\n products.add(entry.productId);\n const key = catalogKey(entry.productId, isText(entry.variantId) ? entry.variantId : null);\n if (!entries.has(key)) entries.set(key, entry);\n }\n return { entries, products };\n}\n\nconst compareAtOf = (entry: CatalogEntry, unitPrice: Money): Money | null =>\n isMoney(entry.compareAt) && entry.compareAt.currency === unitPrice.currency && entry.compareAt.amount > unitPrice.amount\n ? money(entry.compareAt.amount, entry.compareAt.currency)\n : null;\n\nfunction lineTotalWithin(unitPrice: Money, quantity: number, subtotal: Money): Money | null {\n try {\n const lineTotal = timesMoney(unitPrice, quantity);\n return subtotal.amount + lineTotal.amount <= MAX_CART_AMOUNT ? lineTotal : null;\n } catch {\n return null;\n }\n}\n\n/**\n * THE pricing function (C-D7, trap T1): the engine shows its result, iox-cms recomputes it at checkout and at\n * payment. Prices come from the catalog only — a cart line carries no number but a quantity. Every money value\n * out is whole minor units in the studio currency. An unusable line is dropped or adjusted and SAID in `issues`.\n */\nexport function priceCart(cart: Cart, catalog: readonly CatalogEntry[], studio: StudioCommerce, choice?: PricingChoice | null): PricedCart {\n const currency = studio.currency;\n currencyExponent(currency);\n const issues: CartIssue[] = [];\n const { entries, products } = indexCatalog(catalog);\n const lines: PricedLine[] = [];\n let subtotal = money(0, currency);\n\n for (const wanted of wantedLines(cart, issues)) {\n const { productId, variantId } = wanted;\n const entry = entries.get(catalogKey(productId, variantId));\n if (!entry) {\n issues.push({ code: products.has(productId) ? CartIssueCode.UnknownVariant : CartIssueCode.UnknownProduct, productId, variantId });\n continue;\n }\n const refusal = LINE_REFUSALS.find(rule => rule.refuses(entry, currency));\n if (refusal) {\n issues.push({ code: refusal.code, productId, variantId, requested: wanted.quantity });\n continue;\n }\n let quantity = wanted.quantity;\n if (quantity > MAX_LINE_QUANTITY) {\n quantity = MAX_LINE_QUANTITY;\n issues.push({ code: CartIssueCode.QuantityCapped, productId, variantId, requested: wanted.quantity, quantity });\n }\n const left = sellableQuantity(entry);\n if (left !== null && quantity > left) {\n const requested = quantity;\n quantity = left;\n issues.push({ code: CartIssueCode.QuantityClamped, productId, variantId, requested, quantity });\n }\n const unitPrice = money((entry.unitPrice as Money).amount, currency);\n const lineTotal = lineTotalWithin(unitPrice, quantity, subtotal);\n if (!lineTotal) {\n issues.push({ code: CartIssueCode.AmountTooLarge, productId, variantId, requested: wanted.quantity });\n continue;\n }\n subtotal = addMoney(subtotal, lineTotal);\n lines.push({\n productId,\n variantId,\n title: String(entry.title ?? ''),\n variantName: isText(entry.variantName) ? entry.variantName : null,\n quantity,\n unitPrice,\n compareAt: compareAtOf(entry, unitPrice),\n lineTotal,\n requiresShipping: entry.requiresShipping !== false,\n image: isText(entry.image) ? entry.image : null,\n });\n }\n\n const discount = money(0, currency);\n const goods = subtractMoney(subtotal, discount);\n const requiresShipping = lines.some(line => line.requiresShipping);\n const chosenId = choice && isText(choice.shippingMethodId) ? choice.shippingMethodId : null;\n const quotes = chosenId ? quoteShipping(studio.shippingMethods, { currency, goods, requiresShipping, lineCount: lines.length }) : [];\n const shippingMethod = chosenId ? quotes.find(quote => quote.methodId === chosenId) ?? null : null;\n if (chosenId && !shippingMethod) issues.push({ code: CartIssueCode.ShippingUnavailable, shippingMethodId: chosenId });\n const shipping = shippingMethod ? shippingMethod.price : money(0, currency);\n const total = addMoney(goods, shipping);\n const vatUsable = isVatPercent(studio.vatPercent);\n if (!vatUsable) issues.push({ code: CartIssueCode.VatInvalid });\n\n return {\n currency,\n lines,\n subtotal,\n discount,\n shipping,\n shippingMethod,\n requiresShipping,\n total,\n vat: vatUsable ? includedVat(total, studio.vatPercent) : money(0, currency),\n vatPercent: vatUsable ? studio.vatPercent : 0,\n issues,\n };\n}\n\n/** The cart a priced cart stands for — what to store back once the buyer has seen the issues. */\nexport function cartOf(priced: PricedCart): Cart {\n return { lines: priced.lines.map(line => ({ productId: line.productId, variantId: line.variantId, quantity: line.quantity })) };\n}\n\n/** Sign-in merge (E3): b's lines join a's; the same product and variant add up. priceCart caps and clamps later. */\nexport function mergeCarts(a: Cart, b: Cart): Cart {\n const merged: CartLine[] = [];\n const byKey = new Map<string, CartLine>();\n const all: CartLine[] = [...(Array.isArray(a?.lines) ? a.lines : []), ...(Array.isArray(b?.lines) ? b.lines : [])];\n for (const line of all.filter(each => !!each && isText(each.productId))) {\n const key = catalogKey(line.productId, variantOf(line));\n const same = byKey.get(key);\n if (same && validQuantity(same.quantity) && validQuantity(line.quantity)) {\n same.quantity = Math.min(same.quantity + line.quantity, Number.MAX_SAFE_INTEGER);\n continue;\n }\n const copy = { productId: line.productId, variantId: variantOf(line), quantity: line.quantity };\n if (!same) byKey.set(key, copy);\n merged.push(copy);\n }\n return { lines: merged };\n}\n","import { CommerceLabel, CommerceLanguage, commerceLanguage, labelIn } from './labels';\nimport { formatMoney, Money } from './money';\nimport { isShippingMethodKind, ShippingMethodKind, SHIPPING_KINDS } from './shipping';\nimport { filled, looksLikeIsraeliMobile } from './text';\n\nexport enum PaymentChannel {\n /** The owner marks the order paid (C-D11). */\n Manual = 'manual',\n /** The studio's PSP; only its verified callback marks the order paid. */\n Online = 'online',\n}\n\nexport enum PaymentMethodKind {\n BankTransfer = 'bankTransfer',\n PayOnPickup = 'payOnPickup',\n CashOnDelivery = 'cashOnDelivery',\n Bit = 'bit',\n /** A PSP's hosted page (E2, Cardcom first) — typed now, not offered yet. */\n Online = 'online',\n}\n\nexport enum PaymentProvider {\n Cardcom = 'cardcom',\n}\n\n/** What an owner fills for a method. */\nexport enum PaymentField {\n AccountName = 'accountName',\n Bank = 'bank',\n Branch = 'branch',\n AccountNumber = 'accountNumber',\n BitPhone = 'bitPhone',\n Provider = 'provider',\n}\n\n/** Which deliveries a method can be used with. */\nexport enum DeliveryFit {\n Any = 'any',\n /** Paid at the counter: only with a pickup method. */\n PickupOnly = 'pickupOnly',\n /** Paid to the courier: only with a method that delivers to an address. */\n AddressOnly = 'addressOnly',\n}\n\ninterface PaymentMethodRule {\n readonly channel: PaymentChannel;\n /** false = typed for a later phase, never shown to a buyer. */\n readonly offered: boolean;\n readonly fields: readonly PaymentField[];\n readonly fit: DeliveryFit;\n readonly label: CommerceLabel;\n /** What the buyer reads after placing the order; `{total}`, `{orderNumber}` and the method's fields fill in. */\n readonly instructions: CommerceLabel;\n}\n\nexport const PAYMENT_METHODS: Readonly<Record<PaymentMethodKind, PaymentMethodRule>> = Object.freeze({\n [PaymentMethodKind.BankTransfer]: {\n channel: PaymentChannel.Manual,\n offered: true,\n fields: [PaymentField.AccountName, PaymentField.Bank, PaymentField.Branch, PaymentField.AccountNumber],\n fit: DeliveryFit.Any,\n label: { en: 'Bank transfer', he: 'העברה בנקאית' },\n instructions: {\n en: 'Transfer {total} to {accountName}, bank {bank}, branch {branch}, account {accountNumber}. Write order {orderNumber} in the transfer\\'s reference. We will confirm your order once the money arrives.',\n he: 'העבירו {total} לחשבון על שם {accountName}, בנק {bank}, סניף {branch}, חשבון {accountNumber}. ציינו את מספר ההזמנה {orderNumber} בפרטי ההעברה. נאשר את ההזמנה כשהכסף יגיע.',\n },\n },\n [PaymentMethodKind.PayOnPickup]: {\n channel: PaymentChannel.Manual,\n offered: true,\n fields: [],\n fit: DeliveryFit.PickupOnly,\n label: { en: 'Pay on pickup', he: 'תשלום באיסוף' },\n instructions: {\n en: 'Pay {total} when you pick up order {orderNumber}.',\n he: 'שלמו {total} כשאתם אוספים את הזמנה {orderNumber}.',\n },\n },\n [PaymentMethodKind.CashOnDelivery]: {\n channel: PaymentChannel.Manual,\n offered: true,\n fields: [],\n fit: DeliveryFit.AddressOnly,\n label: { en: 'Cash on delivery', he: 'מזומן במסירה' },\n instructions: {\n en: 'Pay {total} in cash when order {orderNumber} is delivered.',\n he: 'שלמו {total} במזומן כשהזמנה {orderNumber} נמסרת לכם.',\n },\n },\n [PaymentMethodKind.Bit]: {\n channel: PaymentChannel.Manual,\n offered: true,\n fields: [PaymentField.BitPhone],\n fit: DeliveryFit.Any,\n label: { en: 'Bit', he: 'ביט' },\n instructions: {\n en: 'Send {total} with Bit to {bitPhone}. Write order {orderNumber} in the note. We will confirm your order once the payment arrives.',\n he: 'שלחו {total} בביט למספר {bitPhone}. ציינו את מספר ההזמנה {orderNumber} בהערה. נאשר את ההזמנה כשהתשלום יגיע.',\n },\n },\n [PaymentMethodKind.Online]: {\n channel: PaymentChannel.Online,\n offered: false,\n fields: [PaymentField.Provider],\n fit: DeliveryFit.Any,\n label: { en: 'Card', he: 'כרטיס אשראי' },\n instructions: {\n en: 'You will pay {total} for order {orderNumber} on a secure payment page.',\n he: 'תשלמו {total} עבור הזמנה {orderNumber} בעמוד תשלום מאובטח.',\n },\n },\n});\n\nexport const PAYMENT_FIELD_LABELS: Readonly<Record<PaymentField, CommerceLabel>> = Object.freeze({\n [PaymentField.AccountName]: { en: 'Account holder', he: 'שם בעל החשבון' },\n [PaymentField.Bank]: { en: 'Bank', he: 'בנק' },\n [PaymentField.Branch]: { en: 'Branch', he: 'סניף' },\n [PaymentField.AccountNumber]: { en: 'Account number', he: 'מספר חשבון' },\n [PaymentField.BitPhone]: { en: 'Phone number for Bit', he: 'מספר טלפון לביט' },\n [PaymentField.Provider]: { en: 'Payment provider', he: 'ספק סליקה' },\n});\n\nconst isPaymentProvider = (value: unknown): boolean =>\n typeof value === 'string' && (Object.values(PaymentProvider) as string[]).includes(value);\n\nconst PAYMENT_FIELD_CHECKS: Readonly<Record<PaymentField, (value: unknown) => boolean>> = Object.freeze({\n [PaymentField.AccountName]: filled,\n [PaymentField.Bank]: filled,\n [PaymentField.Branch]: filled,\n [PaymentField.AccountNumber]: filled,\n [PaymentField.BitPhone]: looksLikeIsraeliMobile,\n [PaymentField.Provider]: isPaymentProvider,\n});\n\nconst DELIVERY_FITS: Readonly<Record<DeliveryFit, (kind: ShippingMethodKind | null) => boolean>> = Object.freeze({\n [DeliveryFit.Any]: () => true,\n [DeliveryFit.PickupOnly]: (kind: ShippingMethodKind | null) => kind === ShippingMethodKind.Pickup,\n [DeliveryFit.AddressOnly]: (kind: ShippingMethodKind | null) => !!kind && isShippingMethodKind(kind) && SHIPPING_KINDS[kind].needsAddress,\n});\n\nexport interface PaymentMethodConfig {\n kind: PaymentMethodKind;\n enabled: boolean;\n details?: Partial<Record<PaymentField, string>> | null;\n /** The owner's own words, shown after the instructions. */\n note?: string | null;\n}\n\nexport const isPaymentMethodKind = (value: unknown): value is PaymentMethodKind =>\n typeof value === 'string' && Object.prototype.hasOwnProperty.call(PAYMENT_METHODS, value);\n\nexport function paymentChannelOf(kind: PaymentMethodKind): PaymentChannel {\n return PAYMENT_METHODS[kind].channel;\n}\n\n/** The fields a method lacks or holds in a form it cannot be paid with. */\nexport function paymentMethodProblems(config: PaymentMethodConfig): PaymentField[] {\n if (!config || !isPaymentMethodKind(config.kind)) return [];\n const details = config.details ?? {};\n return PAYMENT_METHODS[config.kind].fields.filter(field => !PAYMENT_FIELD_CHECKS[field](details[field]));\n}\n\n/** Enabled, offered in this phase, complete: the ONE rule the checkout and its gate read. */\nexport function paymentMethodReady(config: PaymentMethodConfig): boolean {\n return !!config && isPaymentMethodKind(config.kind) && config.enabled === true\n && PAYMENT_METHODS[config.kind].offered && paymentMethodProblems(config).length === 0;\n}\n\n/** The methods a buyer may pick with this delivery (null = nothing ships). */\nexport function usablePaymentMethods(configs: readonly PaymentMethodConfig[], shippingKind?: ShippingMethodKind | null): PaymentMethodConfig[] {\n const seen = new Set<PaymentMethodKind>();\n const list: readonly PaymentMethodConfig[] = Array.isArray(configs) ? configs : [];\n return list.filter(config =>\n paymentMethodReady(config)\n && DELIVERY_FITS[PAYMENT_METHODS[config.kind].fit](shippingKind ?? null)\n && !seen.has(config.kind) && !!seen.add(config.kind));\n}\n\nconst LOCALES: Readonly<Record<CommerceLanguage, string>> = Object.freeze({ [CommerceLanguage.En]: 'en-US', [CommerceLanguage.He]: 'he-IL' });\n\n/** What the buyer is told to do, in their language: the method's sentence with the order, the amount and the owner's details, then the owner's note. */\nexport function paymentInstructions(\n config: PaymentMethodConfig,\n order: { orderNumber: string; total: Money },\n lang: string | null | undefined,\n locale?: string,\n): string {\n const rule = PAYMENT_METHODS[config.kind];\n const values: Record<string, string> = {\n ...(config.details ?? {}),\n orderNumber: order.orderNumber,\n total: formatMoney(order.total, locale ?? LOCALES[commerceLanguage(lang)]),\n };\n const sentence = labelIn(rule.instructions, lang).replace(/\\{(\\w+)\\}/g, (_match, name: string) => values[name] ?? '');\n return filled(config.note) ? `${sentence}\\n${config.note.trim()}` : sentence;\n}\n","import { CommerceLabel } from './labels';\nimport { PaymentChannel, paymentChannelOf, PaymentMethodKind } from './payments';\n\n/** C-D11 — the order's closed states. */\nexport enum OrderState {\n /** A manual method: waiting for the owner to see the money. */\n AwaitingPayment = 'awaiting_payment',\n /** An online method: the PSP's page is open. */\n PendingPayment = 'pending_payment',\n Paid = 'paid',\n Fulfilled = 'fulfilled',\n Delivered = 'delivered',\n Cancelled = 'cancelled',\n PaymentFailed = 'payment_failed',\n Refunded = 'refunded',\n PartiallyRefunded = 'partially_refunded',\n}\n\nexport enum OrderEvent {\n /** The buyer tries to pay again after a failure. */\n StartPayment = 'startPayment',\n /** The PSP's verified callback says paid. */\n ConfirmPayment = 'confirmPayment',\n FailPayment = 'failPayment',\n /** The owner saw the money of a manual method. */\n MarkPaid = 'markPaid',\n Fulfil = 'fulfil',\n Deliver = 'deliver',\n Cancel = 'cancel',\n /** Nobody paid in time (the jobs runner). */\n Expire = 'expire',\n Refund = 'refund',\n PartialRefund = 'partialRefund',\n}\n\nexport enum OrderActor {\n Buyer = 'buyer',\n Owner = 'owner',\n /** A VERIFIED payment callback (trap T2) — never the browser's return redirect. */\n PaymentCallback = 'paymentCallback',\n System = 'system',\n}\n\n/** What an order holds of the stock in a state (C-D10). */\nexport enum StockHold {\n None = 'none',\n /** Held for `STOCK_RESERVATION_MINUTES` while a PSP payment is open. */\n Reserved = 'reserved',\n /** Decremented: sold, or promised to a manual order. */\n Taken = 'taken',\n}\n\n/** What the server does to stock when an order moves — read from data, never decided per call site. */\nexport enum StockEffect {\n None = 'none',\n Reserve = 'reserve',\n CommitReservation = 'commitReservation',\n ReleaseReservation = 'releaseReservation',\n /** The conditional atomic decrement (E0's `takeStock`). */\n Take = 'take',\n GiveBack = 'giveBack',\n}\n\nexport enum OrderRefusal {\n /** The event does not apply in this state. */\n InvalidTransition = 'invalid-transition',\n /** It applies — but not from this actor (e.g. the owner marking an online payment paid). */\n ActorNotAllowed = 'actor-not-allowed',\n /** Cancelled and refunded orders move no more. */\n OrderFinal = 'order-final',\n}\n\nexport const STOCK_RESERVATION_MINUTES = 15;\n\nexport const ORDER_STOCK_HOLD: Readonly<Record<OrderState, StockHold>> = Object.freeze({\n [OrderState.AwaitingPayment]: StockHold.Taken,\n [OrderState.PendingPayment]: StockHold.Reserved,\n [OrderState.Paid]: StockHold.Taken,\n [OrderState.Fulfilled]: StockHold.Taken,\n [OrderState.Delivered]: StockHold.Taken,\n [OrderState.Cancelled]: StockHold.None,\n [OrderState.PaymentFailed]: StockHold.None,\n /** A refund never restocks by itself: whether the goods came back is the owner's to say. */\n [OrderState.Refunded]: StockHold.Taken,\n [OrderState.PartiallyRefunded]: StockHold.Taken,\n});\n\n/** from-hold → to-hold → effect. Taken → Reserved never happens (the transitions spec proves it). */\nexport const STOCK_EFFECTS: Readonly<Record<StockHold, Readonly<Record<StockHold, StockEffect>>>> = Object.freeze({\n [StockHold.None]: { [StockHold.None]: StockEffect.None, [StockHold.Reserved]: StockEffect.Reserve, [StockHold.Taken]: StockEffect.Take },\n [StockHold.Reserved]: { [StockHold.None]: StockEffect.ReleaseReservation, [StockHold.Reserved]: StockEffect.None, [StockHold.Taken]: StockEffect.CommitReservation },\n [StockHold.Taken]: { [StockHold.None]: StockEffect.GiveBack, [StockHold.Reserved]: StockEffect.None, [StockHold.Taken]: StockEffect.None },\n});\n\nexport const FINAL_ORDER_STATES: readonly OrderState[] = Object.freeze([OrderState.Cancelled, OrderState.Refunded]);\n\nexport interface OrderTransition {\n readonly from: OrderState;\n readonly event: OrderEvent;\n readonly to: OrderState;\n readonly actors: readonly OrderActor[];\n}\n\nconst OWNER = [OrderActor.Owner];\nconst CALLBACK = [OrderActor.PaymentCallback];\nconst SYSTEM = [OrderActor.System];\nconst REFUNDERS = [OrderActor.Owner, OrderActor.PaymentCallback];\nconst REFUNDABLE = [OrderState.Paid, OrderState.Fulfilled, OrderState.Delivered, OrderState.PartiallyRefunded];\n\n/** THE order state machine (C-D11). Anything not listed is refused. */\nexport const ORDER_TRANSITIONS: readonly OrderTransition[] = Object.freeze([\n { from: OrderState.AwaitingPayment, event: OrderEvent.MarkPaid, to: OrderState.Paid, actors: OWNER },\n { from: OrderState.AwaitingPayment, event: OrderEvent.Cancel, to: OrderState.Cancelled, actors: OWNER },\n { from: OrderState.AwaitingPayment, event: OrderEvent.Expire, to: OrderState.Cancelled, actors: SYSTEM },\n { from: OrderState.PendingPayment, event: OrderEvent.ConfirmPayment, to: OrderState.Paid, actors: CALLBACK },\n { from: OrderState.PendingPayment, event: OrderEvent.FailPayment, to: OrderState.PaymentFailed, actors: CALLBACK },\n { from: OrderState.PendingPayment, event: OrderEvent.Expire, to: OrderState.Cancelled, actors: SYSTEM },\n { from: OrderState.PaymentFailed, event: OrderEvent.StartPayment, to: OrderState.PendingPayment, actors: [OrderActor.Buyer] },\n { from: OrderState.PaymentFailed, event: OrderEvent.ConfirmPayment, to: OrderState.Paid, actors: CALLBACK },\n { from: OrderState.PaymentFailed, event: OrderEvent.Cancel, to: OrderState.Cancelled, actors: OWNER },\n { from: OrderState.PaymentFailed, event: OrderEvent.Expire, to: OrderState.Cancelled, actors: SYSTEM },\n { from: OrderState.Paid, event: OrderEvent.Fulfil, to: OrderState.Fulfilled, actors: OWNER },\n { from: OrderState.PartiallyRefunded, event: OrderEvent.Fulfil, to: OrderState.Fulfilled, actors: OWNER },\n { from: OrderState.Fulfilled, event: OrderEvent.Deliver, to: OrderState.Delivered, actors: OWNER },\n ...REFUNDABLE.map(from => ({ from, event: OrderEvent.Refund, to: OrderState.Refunded, actors: REFUNDERS })),\n ...REFUNDABLE.map(from => ({ from, event: OrderEvent.PartialRefund, to: OrderState.PartiallyRefunded, actors: REFUNDERS })),\n]);\n\nexport type OrderMove =\n | { ok: true; state: OrderState; stock: StockEffect }\n | { ok: false; refusal: OrderRefusal };\n\nexport function stockEffect(from: OrderState | null, to: OrderState): StockEffect {\n return STOCK_EFFECTS[from === null ? StockHold.None : ORDER_STOCK_HOLD[from]][ORDER_STOCK_HOLD[to]];\n}\n\n/** The ONE place an order moves: the next state and what to do to the stock, or why not. */\nexport function nextOrderState(state: OrderState, event: OrderEvent, actor: OrderActor): OrderMove {\n const transition = ORDER_TRANSITIONS.find(each => each.from === state && each.event === event);\n if (!transition) {\n return { ok: false, refusal: FINAL_ORDER_STATES.includes(state) ? OrderRefusal.OrderFinal : OrderRefusal.InvalidTransition };\n }\n if (!transition.actors.includes(actor)) return { ok: false, refusal: OrderRefusal.ActorNotAllowed };\n return { ok: true, state: transition.to, stock: stockEffect(state, transition.to) };\n}\n\nconst OPENING_STATE: Readonly<Record<PaymentChannel, OrderState>> = Object.freeze({\n [PaymentChannel.Manual]: OrderState.AwaitingPayment,\n [PaymentChannel.Online]: OrderState.PendingPayment,\n});\n\n/** A new order's state and stock effect: a manual order takes its stock at once, an online one reserves it. */\nexport function openingOrderState(kind: PaymentMethodKind): { state: OrderState; stock: StockEffect } {\n const state = OPENING_STATE[paymentChannelOf(kind)];\n return { state, stock: stockEffect(null, state) };\n}\n\nexport function reservationExpiresAt(now: Date): Date {\n return new Date(now.getTime() + STOCK_RESERVATION_MINUTES * 60000);\n}\n\nexport const ORDER_STATE_LABELS: Readonly<Record<OrderState, CommerceLabel>> = Object.freeze({\n [OrderState.AwaitingPayment]: { en: 'Awaiting payment', he: 'ממתינה לתשלום' },\n [OrderState.PendingPayment]: { en: 'Payment in progress', he: 'תשלום בתהליך' },\n [OrderState.Paid]: { en: 'Paid', he: 'שולמה' },\n [OrderState.Fulfilled]: { en: 'Fulfilled', he: 'טופלה' },\n [OrderState.Delivered]: { en: 'Delivered', he: 'נמסרה' },\n [OrderState.Cancelled]: { en: 'Cancelled', he: 'בוטלה' },\n [OrderState.PaymentFailed]: { en: 'Payment failed', he: 'התשלום נכשל' },\n [OrderState.Refunded]: { en: 'Refunded', he: 'זוכתה' },\n [OrderState.PartiallyRefunded]: { en: 'Partly refunded', he: 'זוכתה חלקית' },\n});\n","import { CurrencyCode, isCurrencyCode } from './currency';\nimport { CommerceLabel } from './labels';\nimport { paymentMethodReady, PaymentMethodConfig } from './payments';\nimport { ShippingMethod, shippingMethodReady, SHIPPING_KINDS } from './shipping';\nimport { filled, looksLikeEmail, looksLikePhone } from './text';\nimport { isVatPercent } from './vat';\n\n/** The fixed checkout's steps, in order (C-D3); a checkout keeps the FURTHEST it reached (the journey, §3g). */\nexport enum CheckoutStep {\n Contact = 'contact',\n Delivery = 'delivery',\n Payment = 'payment',\n Paid = 'paid',\n}\n\nexport const CHECKOUT_STEPS: readonly CheckoutStep[] = Object.freeze([\n CheckoutStep.Contact,\n CheckoutStep.Delivery,\n CheckoutStep.Payment,\n CheckoutStep.Paid,\n]);\n\nexport const CHECKOUT_STEP_LABELS: Readonly<Record<CheckoutStep, CommerceLabel>> = Object.freeze({\n [CheckoutStep.Contact]: { en: 'Contact', he: 'פרטי קשר' },\n [CheckoutStep.Delivery]: { en: 'Delivery', he: 'משלוח' },\n [CheckoutStep.Payment]: { en: 'Payment', he: 'תשלום' },\n [CheckoutStep.Paid]: { en: 'Paid', he: 'שולם' },\n});\n\nexport function furthestStep(a: CheckoutStep | null | undefined, b: CheckoutStep | null | undefined): CheckoutStep {\n const rank = (step: CheckoutStep | null | undefined) => (step ? CHECKOUT_STEPS.indexOf(step) : -1);\n const best = rank(a) >= rank(b) ? a : b;\n return best && CHECKOUT_STEPS.includes(best) ? best : CheckoutStep.Contact;\n}\n\n/** The pages the OWNER writes and links from checkout (§3k). IOX never writes their text (T14). */\nexport enum LegalPage {\n Terms = 'terms',\n Returns = 'returns',\n Shipping = 'shipping',\n Privacy = 'privacy',\n}\n\n/** Who sells, as Israel's Consumer Protection Law asks a distance seller to say (§3k). */\nexport interface BusinessIdentity {\n legalName?: string | null;\n /** עוסק מורשה / ח.פ / ת.ז */\n businessNumber?: string | null;\n address?: string | null;\n email?: string | null;\n phone?: string | null;\n}\n\nexport interface CheckoutGateFacts {\n currency: unknown;\n vatPercent: unknown;\n paymentMethods: readonly PaymentMethodConfig[];\n shippingMethods: readonly ShippingMethod[];\n /** Any product of the studio that is not digital. */\n anyProductShips: boolean;\n business: BusinessIdentity;\n /** Each page exists and checkout links it. */\n legalPages: Partial<Record<LegalPage, boolean>>;\n}\n\nexport enum CheckoutGateArea {\n Payment = 'payment',\n Money = 'money',\n Shipping = 'shipping',\n Business = 'business',\n LegalPages = 'legalPages',\n}\n\nexport enum CheckoutGateCode {\n NoPaymentMethod = 'no-payment-method',\n CurrencyNotSet = 'currency-not-set',\n VatNotSet = 'vat-not-set',\n NoShippingMethod = 'no-shipping-method',\n BusinessNameMissing = 'business-name-missing',\n BusinessNumberMissing = 'business-number-missing',\n BusinessAddressMissing = 'business-address-missing',\n BusinessEmailMissing = 'business-email-missing',\n BusinessPhoneMissing = 'business-phone-missing',\n TermsPageMissing = 'terms-page-missing',\n ReturnsPageMissing = 'returns-page-missing',\n ShippingPageMissing = 'shipping-page-missing',\n PrivacyPageMissing = 'privacy-page-missing',\n}\n\ninterface CheckoutGateRule {\n readonly code: CheckoutGateCode;\n readonly area: CheckoutGateArea;\n readonly refuses: (facts: CheckoutGateFacts) => boolean;\n readonly label: CommerceLabel;\n}\n\nconst ships = (facts: CheckoutGateFacts) => facts.anyProductShips === true;\nconst page = (facts: CheckoutGateFacts, which: LegalPage) => facts.legalPages?.[which] === true;\nconst business = (facts: CheckoutGateFacts): BusinessIdentity => facts.business ?? {};\n\n/** THE checkout gate (C-D19), in the order the owner fixes things. The server refuses with it; the admin shows the same rows. */\nexport const CHECKOUT_GATE_RULES: readonly CheckoutGateRule[] = Object.freeze([\n {\n code: CheckoutGateCode.NoPaymentMethod,\n area: CheckoutGateArea.Payment,\n refuses: (facts: CheckoutGateFacts) => !(facts.paymentMethods ?? []).some(paymentMethodReady),\n label: { en: 'Turn on a way to get paid', he: 'הפעילו אמצעי תשלום' },\n },\n {\n code: CheckoutGateCode.CurrencyNotSet,\n area: CheckoutGateArea.Money,\n refuses: (facts: CheckoutGateFacts) => !isCurrencyCode(facts.currency),\n label: { en: 'Set the shop\\'s currency', he: 'הגדירו את מטבע החנות' },\n },\n {\n code: CheckoutGateCode.VatNotSet,\n area: CheckoutGateArea.Money,\n refuses: (facts: CheckoutGateFacts) => !isVatPercent(facts.vatPercent),\n label: { en: 'Set the VAT rate', he: 'הגדירו את שיעור המע\"מ' },\n },\n {\n code: CheckoutGateCode.NoShippingMethod,\n area: CheckoutGateArea.Shipping,\n refuses: (facts: CheckoutGateFacts) => ships(facts) && !(isCurrencyCode(facts.currency)\n && (facts.shippingMethods ?? []).some(method => shippingMethodReady(method, facts.currency as CurrencyCode)\n && SHIPPING_KINDS[method.kind].forPhysical)),\n label: { en: 'Add a delivery or pickup method', he: 'הוסיפו שיטת משלוח או איסוף' },\n },\n {\n code: CheckoutGateCode.BusinessNameMissing,\n area: CheckoutGateArea.Business,\n refuses: (facts: CheckoutGateFacts) => !filled(business(facts).legalName),\n label: { en: 'Add the business\\'s legal name', he: 'הוסיפו את השם הרשמי של העסק' },\n },\n {\n code: CheckoutGateCode.BusinessNumberMissing,\n area: CheckoutGateArea.Business,\n refuses: (facts: CheckoutGateFacts) => !filled(business(facts).businessNumber),\n label: { en: 'Add the business number (company or VAT dealer number)', he: 'הוסיפו מספר עוסק או ח.פ' },\n },\n {\n code: CheckoutGateCode.BusinessAddressMissing,\n area: CheckoutGateArea.Business,\n refuses: (facts: CheckoutGateFacts) => !filled(business(facts).address),\n label: { en: 'Add the business address', he: 'הוסיפו את כתובת העסק' },\n },\n {\n code: CheckoutGateCode.BusinessEmailMissing,\n area: CheckoutGateArea.Business,\n refuses: (facts: CheckoutGateFacts) => !looksLikeEmail(business(facts).email),\n label: { en: 'Add an email buyers can write to', he: 'הוסיפו כתובת אימייל לפניות קונים' },\n },\n {\n code: CheckoutGateCode.BusinessPhoneMissing,\n area: CheckoutGateArea.Business,\n refuses: (facts: CheckoutGateFacts) => !looksLikePhone(business(facts).phone),\n label: { en: 'Add a phone number buyers can call', he: 'הוסיפו מספר טלפון לפניות קונים' },\n },\n {\n code: CheckoutGateCode.TermsPageMissing,\n area: CheckoutGateArea.LegalPages,\n refuses: (facts: CheckoutGateFacts) => !page(facts, LegalPage.Terms),\n label: { en: 'Write your terms of sale page', he: 'כתבו עמוד תקנון ותנאי מכירה' },\n },\n {\n code: CheckoutGateCode.ReturnsPageMissing,\n area: CheckoutGateArea.LegalPages,\n refuses: (facts: CheckoutGateFacts) => !page(facts, LegalPage.Returns),\n label: { en: 'Write your returns and cancellation page', he: 'כתבו עמוד מדיניות החזרות וביטולים' },\n },\n {\n code: CheckoutGateCode.ShippingPageMissing,\n area: CheckoutGateArea.LegalPages,\n refuses: (facts: CheckoutGateFacts) => ships(facts) && !page(facts, LegalPage.Shipping),\n label: { en: 'Write your shipping page', he: 'כתבו עמוד מדיניות משלוחים' },\n },\n {\n code: CheckoutGateCode.PrivacyPageMissing,\n area: CheckoutGateArea.LegalPages,\n refuses: (facts: CheckoutGateFacts) => !page(facts, LegalPage.Privacy),\n label: { en: 'Write your privacy page', he: 'כתבו עמוד מדיניות פרטיות' },\n },\n]);\n\nexport interface CheckoutGateRefusal {\n code: CheckoutGateCode;\n area: CheckoutGateArea;\n label: CommerceLabel;\n}\n\nexport interface CheckoutGateResult {\n open: boolean;\n refusals: CheckoutGateRefusal[];\n}\n\n/** Checkout opens only when no rule refuses (C-D19, trap T9: the server's, never a hidden button). */\nexport function checkoutGate(facts: CheckoutGateFacts): CheckoutGateResult {\n const refusals = CHECKOUT_GATE_RULES\n .filter(rule => rule.refuses(facts))\n .map(rule => ({ code: rule.code, area: rule.area, label: rule.label }));\n return { open: refusals.length === 0, refusals };\n}\n","import { PricedCart } from './cart';\nimport { CurrencyCode } from './currency';\nimport { Money, money } from './money';\nimport { PaymentChannel, paymentChannelOf, PaymentField, PaymentMethodConfig, PaymentMethodKind, usablePaymentMethods } from './payments';\nimport { ShippingMethodKind } from './shipping';\nimport { filled, looksLikeEmail } from './text';\n\nexport interface PostalAddress {\n line1: string;\n line2?: string | null;\n city: string;\n postalCode?: string | null;\n /** ISO 3166-1 alpha-2 — one country in v1 (C-D9). */\n country: string;\n}\n\nexport interface OrderBuyer {\n email: string;\n name: string;\n phone?: string | null;\n /** Needed when the delivery method delivers to an address. */\n address?: PostalAddress | null;\n}\n\nexport enum OrderSnapshotRefusal {\n EmptyCart = 'empty-cart',\n /** The priced cart has issues the buyer has not seen: show them the priced cart first. */\n CartChanged = 'cart-changed',\n ShippingNotChosen = 'shipping-not-chosen',\n AddressRequired = 'address-required',\n EmailRequired = 'email-required',\n NameRequired = 'name-required',\n /** Not enabled, not complete, not offered yet, or not usable with this delivery. */\n PaymentMethodUnusable = 'payment-method-unusable',\n}\n\nexport interface OrderSnapshotLine {\n readonly productId: string;\n readonly variantId: string | null;\n readonly title: string;\n readonly variantName: string | null;\n readonly quantity: number;\n readonly unitPrice: Money;\n readonly lineTotal: Money;\n readonly requiresShipping: boolean;\n}\n\n/** What an order stores: frozen, so a later price, name or bank-detail change never changes a placed order. */\nexport interface OrderSnapshot {\n readonly currency: CurrencyCode;\n readonly lines: readonly OrderSnapshotLine[];\n readonly subtotal: Money;\n readonly discount: Money;\n readonly shipping: Money;\n readonly delivery: { readonly methodId: string; readonly kind: ShippingMethodKind; readonly name: string } | null;\n readonly total: Money;\n readonly vat: { readonly percent: number; readonly amount: Money };\n readonly payment: {\n readonly kind: PaymentMethodKind;\n readonly channel: PaymentChannel;\n readonly details: Readonly<Partial<Record<PaymentField, string>>>;\n readonly note: string | null;\n };\n readonly buyer: Readonly<OrderBuyer>;\n}\n\nexport type OrderSnapshotResult =\n | { ok: true; snapshot: OrderSnapshot }\n | { ok: false; refusals: OrderSnapshotRefusal[] };\n\nfunction deepFreeze<T>(value: T): T {\n if (value && typeof value === 'object' && !Object.isFrozen(value)) {\n Object.freeze(value);\n for (const key of Object.keys(value as object)) deepFreeze((value as Record<string, unknown>)[key]);\n }\n return value;\n}\n\nconst copyMoney = (value: Money): Money => money(value.amount, value.currency);\nconst text = (value: unknown): string | null => (filled(value) ? value.trim() : null);\n\nfunction copyAddress(address: PostalAddress | null | undefined): PostalAddress | null {\n if (!address || !filled(address.line1) || !filled(address.city) || !filled(address.country)) return null;\n return {\n line1: address.line1.trim(),\n line2: text(address.line2),\n city: address.city.trim(),\n postalCode: text(address.postalCode),\n country: address.country.trim(),\n };\n}\n\ninterface SnapshotRule {\n readonly refusal: OrderSnapshotRefusal;\n readonly refuses: (priced: PricedCart, payment: PaymentMethodConfig, buyer: OrderBuyer) => boolean;\n}\n\nconst SNAPSHOT_RULES: readonly SnapshotRule[] = Object.freeze([\n { refusal: OrderSnapshotRefusal.EmptyCart, refuses: (priced: PricedCart) => !priced.lines.length },\n { refusal: OrderSnapshotRefusal.CartChanged, refuses: (priced: PricedCart) => priced.issues.length > 0 },\n { refusal: OrderSnapshotRefusal.ShippingNotChosen, refuses: (priced: PricedCart) => priced.requiresShipping && !priced.shippingMethod },\n {\n refusal: OrderSnapshotRefusal.AddressRequired,\n refuses: (priced: PricedCart, _payment: PaymentMethodConfig, buyer: OrderBuyer) => !!priced.shippingMethod?.needsAddress && !copyAddress(buyer?.address),\n },\n { refusal: OrderSnapshotRefusal.EmailRequired, refuses: (_priced: PricedCart, _payment: PaymentMethodConfig, buyer: OrderBuyer) => !looksLikeEmail(buyer?.email) },\n { refusal: OrderSnapshotRefusal.NameRequired, refuses: (_priced: PricedCart, _payment: PaymentMethodConfig, buyer: OrderBuyer) => !filled(buyer?.name) },\n {\n refusal: OrderSnapshotRefusal.PaymentMethodUnusable,\n refuses: (priced: PricedCart, payment: PaymentMethodConfig) => usablePaymentMethods([payment], priced.shippingMethod?.kind ?? null).length === 0,\n },\n]);\n\n/** Freezes what an order stores (lines, unit prices, totals, VAT, currency, delivery, payment, buyer) — or says why it cannot. */\nexport function orderSnapshot(pricedCart: PricedCart, payment: PaymentMethodConfig, buyer: OrderBuyer): OrderSnapshotResult {\n const refusals = SNAPSHOT_RULES.filter(rule => rule.refuses(pricedCart, payment, buyer)).map(rule => rule.refusal);\n if (refusals.length) return { ok: false, refusals };\n const delivery = pricedCart.shippingMethod;\n const snapshot: OrderSnapshot = {\n currency: pricedCart.currency,\n lines: pricedCart.lines.map(line => ({\n productId: line.productId,\n variantId: line.variantId,\n title: line.title,\n variantName: line.variantName,\n quantity: line.quantity,\n unitPrice: copyMoney(line.unitPrice),\n lineTotal: copyMoney(line.lineTotal),\n requiresShipping: line.requiresShipping,\n })),\n subtotal: copyMoney(pricedCart.subtotal),\n discount: copyMoney(pricedCart.discount),\n shipping: copyMoney(pricedCart.shipping),\n delivery: delivery ? { methodId: delivery.methodId, kind: delivery.kind, name: delivery.name } : null,\n total: copyMoney(pricedCart.total),\n vat: { percent: pricedCart.vatPercent, amount: copyMoney(pricedCart.vat) },\n payment: {\n kind: payment.kind,\n channel: paymentChannelOf(payment.kind),\n details: { ...(payment.details ?? {}) },\n note: text(payment.note),\n },\n buyer: {\n email: buyer.email.trim(),\n name: buyer.name.trim(),\n phone: text(buyer.phone),\n address: delivery?.needsAddress ? copyAddress(buyer.address) : null,\n },\n };\n return { ok: true, snapshot: deepFreeze(snapshot) };\n}\n","/**\n * @vectoriox/iox-ui/commerce-core — the shared, FRAMEWORK-FREE core of selling (commerce plan C-D7…C-D11, C-D19).\n *\n * Money is integer minor units in one ISO-4217 currency, so the engine, the builder and iox-cms compute the same\n * totals (trap T6: never a float). E0 shipped Money; E1a adds the cart and its ONE pricing function, shipping v1,\n * manual payment methods, the order state machine, the checkout steps and gate, and the order snapshot. No clock is\n * read anywhere — a caller passes `now`.\n * ⚠️ Not re-exported from the main entry. Consumers wire the usual trio — ng-package raw-ts assets,\n * jest moduleNameMapper, tsconfig paths — or `nest start` dies with ERR_REQUIRE_ESM.\n */\nexport * from './money-error';\nexport * from './currency';\nexport * from './money';\nexport * from './labels';\nexport * from './limits';\nexport * from './vat';\nexport * from './catalog';\nexport * from './shipping';\nexport * from './cart';\nexport * from './payments';\nexport * from './orders';\nexport * from './checkout';\nexport * from './order-snapshot';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,iBAAA,CAAA,GAAA,kBAAoC;AACpC,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,WAAsB;AACtB,IAAA,cAAA,CAAA,YAAA,CAAA,GAAA,aAA0B;AAC1B,IAAA,cAAA,CAAA,YAAA,CAAA,GAAA,cAA2B;AAC3B,IAAA,cAAA,CAAA,iBAAA,CAAA,GAAA,mBAAqC;AACrC,IAAA,cAAA,CAAA,kBAAA,CAAA,GAAA,mBAAsC;AACtC,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,WAAsB;AACtB,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,cAAA,CAAA,YAAA,CAAA,GAAA,cAA2B;AAC/B,CAAC,EAXW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;AAapB,MAAO,UAAW,SAAQ,KAAK,CAAA;IACjC,WAAA,CAAqB,IAAoB,EAAE,OAAe,EAAA;QACtD,KAAK,CAAC,OAAO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vB,YAAA,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AACxB,YAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI;AACtE,SAAA;KACJ;AACD,IAAA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;AACvD;;ACtJA;;;;;;;;;AASG;;ACTH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "5.92.0",
3
+ "version": "5.94.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -23,6 +23,10 @@
23
23
  "types": "./actions-core/index.d.ts",
24
24
  "default": "./fesm2022/vectoriox-iox-ui-actions-core.mjs"
25
25
  },
26
+ "./commerce-core": {
27
+ "types": "./commerce-core/index.d.ts",
28
+ "default": "./fesm2022/vectoriox-iox-ui-commerce-core.mjs"
29
+ },
26
30
  "./composite-core": {
27
31
  "types": "./composite-core/index.d.ts",
28
32
  "default": "./fesm2022/vectoriox-iox-ui-composite-core.mjs"