/**
 * English UI copy for POS (retail POS). Import from pos.html only.
 * Do not change persisted payment method strings in pos.html (Cash / Card / Mobile banking).
 */

export const POS_LOCALE = 'en-US';

export const POS = {
    navSubtitle: 'Counter sales',
    dashboard: 'Dashboard',
    todaySummary: "Today's POS",
    salesCount: 'Sales',
    countSuffix: '',
    totalLabel: 'Total',
    networkTitle: 'Network',
    online: 'Online',
    offline: 'Offline',
    refund: 'Refund',
    dayClose: 'Day close',
    refreshSummary: 'Refresh',

    barcodeLabel: 'Barcode / SKU',
    f2Focus: '(F2 focus)',
    barcodePlaceholder: 'Scan or type — Enter to add to cart',
    barcodeAria: 'Scan or type barcode or SKU',
    searchPlaceholder: 'Search products…',
    allCategories: 'All categories',
    loadingProducts: 'Loading products…',
    recentSales: 'Recent POS sales',
    recentPlaceholder: 'Tap refresh to load…',

    cartTitle: 'Cart',
    lineSubtotal: 'Line subtotal',
    estGrossMargin: 'Est. gross margin',
    estMarginHint: '(avg cost, excl. discount/tax)',
    estGrossProfit: 'Est. gross profit',
    marginMissingCost: (n) =>
        `Estimate: ${n} line(s) have no purchase history — not included in COGS estimate.`,
    belowCostBanner: (preview, extra) =>
        `<span class="font-semibold text-red-800">Below unit cost:</span> ${preview}${extra ? ` ${extra}` : ''}.`,
    belowCostExtra: (n) => `+${n} more`,

    discountBdt: 'Discount (৳)',
    discountPct: 'Discount (%)',
    discountTotal: 'Discount total',
    taxVat: 'Tax / VAT',
    netBeforeTax: 'Net (excl. tax)',
    payable: 'Payable',
    paymentSplit: 'Payment split',
    payAllCash: 'All cash',
    payAllCard: 'All card',
    payAllMobile: 'All mobile',
    cashBdt: 'Cash (৳)',
    cardBdt: 'Card (৳)',
    mobileBdt: 'Mobile banking (৳)',
    totalPayment: 'Total payment',
    remainingPayment: 'Due',
    changeDue: 'Change',
    changeHint: 'If cash is over the total, make cash + card + mobile equal payable before checkout.',

    customerNamePh: 'Customer name (optional)',
    customerPhonePh: 'Mobile (optional)',
    notePh: 'Counter note (optional)',
    completeSale: 'Complete sale',
    reprintLast: 'Reprint last receipt',
    clearCart: 'Clear cart',

    scanPickTitle: 'Multiple matches — pick one',
    closeAria: 'Close',

    refundTitle: 'POS refund / stock return',
    orderLabel: 'Order',
    refundReasonLabel: 'Reason (optional)',
    refundReasonPh: 'Why return',
    refundApply: 'Apply refund',

    closeTitle: 'Day close — reconciliation',
    expectedToday: 'Expected today (POS)',
    cash: 'Cash',
    card: 'Card',
    mobile: 'Mobile',
    total: 'Total',
    closeHintLegacyCash:
        'For older orders with cash-only expected, the cash line shows ',
    countedCash: 'Counted cash (৳)',
    countedCard: 'Counted card (৳)',
    countedMobile: 'Counted mobile (৳)',
    countedCashLegacy: 'Counted cash (legacy)',
    noteLabel: 'Note',
    save: 'Save',
    print: 'Print',
    closeOfflineNote: 'Queued sales sync when online — use the header queue button.',

    lineDiscountHeading: 'Line discount',
    lineDiscBdtPh: '৳ off line',
    lineDiscPctPh: '% off line',

    toastQueuedOffline: 'Sale queued — will sync when you are online.',
    toastQueuedRetry: 'Saved to queue — tap the queue button to retry.',
    toastOutboxSynced: (n) => `Synced ${n} queued sale(s).`,

    holdEmpty: 'No held carts on this device.',
    holdYou: 'Your hold',
    holdOther: (uid) => `Cashier ${String(uid).slice(0, 8)}…`,
    holdRegister: (r) => `Register ${r}`,
    holdRecall: 'Load',
    holdDelete: 'Delete',
    holdReplaceCart: 'Replace current cart with this hold?',
    holdDeleteConfirm: 'Delete this held cart?',
    toastHoldSaved: 'Cart held.',
    toastHoldFail: 'Could not save hold.',
    toastHoldRecalled: 'Cart loaded from hold.',

    recentPreview: 'Preview',
    recentRepeat: 'Repeat',

    refundLegacyStockTag: ' · ⚠ stock flag',
    refundLegacyStockWarn:
        'This order is missing the stock_updated flag. Refund anyway? Double-check stock and ledger after.',

    managerLineDiscountReason: 'line-level discount approval',
    managerEnterPin: (r) => `Enter manager PIN (${r}):`,
    managerPinNotConfigured: (r) => `No manager PIN in site settings — allow anyway? (${r})`,
    managerPinBad: 'Incorrect PIN.',
    belowCostBlockReason: 'below-cost sale (blocked until manager PIN)',

    closeSlipRegister: (r) => `Register: ${r}`,
    closeSlipCashier: (u) => `Cashier: ${u}`,

    repeatReplaceCart: 'Clear cart and load this sale as a new basket?',
    repeatNoLines: 'No lines could be loaded into the cart.',
    repeatLoaded: 'Basket loaded from sale.',

    variantTitle: 'Choose variant',
    weightTitle: 'Enter weight',
    weightSub: 'Connect a scale or enter manual weight (kg) below.',
    liveWeightKg: 'Live weight (kg)',
    scaleConnect: 'Connect scale (Serial)',
    scaleDisconnect: 'Disconnect',
    manualWeightKg: 'Manual weight (kg)',
    manualWeightPh: 'e.g. 1.250',
    addToCart: 'Add to cart',
    cancel: 'Cancel',
    weightSerialNote:
        'Hardware scale works in browsers with Web Serial; otherwise manual weight is required.',

    toastProductMissing: 'Product not found.',
    toastPickVariant: 'Choose a variant.',
    toastNoMatch: 'No match.',
    toastOrderLoadFail: 'Could not load order.',
    toastOrderNotFound: 'Order not found.',
    toastOrderNotRefundable: 'This order cannot be refunded.',
    toastRefundQty: 'Enter return quantities.',
    toastRefundLineOver: (n) => `Line ${n}: quantity too high.`,
    toastProductGone: (name) => `Product missing: ${name}`,
    toastRefundDoneFull: 'Full refund completed.',
    toastRefundDonePartial: 'Partial refund completed.',
    toastCloseSaved: 'Day close saved.',
    toastNoReceiptYet: 'No receipt printed yet.',
    toastOrderLoadErr: 'Failed to load order.',
    toastPickOrder: 'Select an order.',
    toastRefundFail: 'Refund failed.',
    toastCartEmptyAdd: 'Add items to the cart.',
    toastCheckoutBusy: 'Checkout in progress, please wait.',
    toastProductRemoved: (name) => `Product no longer exists: ${name}`,
    toastStockLow: (name) => `Insufficient stock: ${name}`,
    toastEnterPayment: 'Enter payment (cash / card / mobile).',
    toastPaymentMustMatch: 'Payment total must equal payable amount.',
    toastZeroPayExtra: 'Payable is ৳0; remove extra payment.',
    belowCostConfirm: (preview, more) =>
        `Warning (Phase 5): Below-cost sale risk — ${preview}${more}.\nContinue checkout?`,
    errOrderKey: 'Failed to create order key.',
    toastSaleSaved: 'Sale saved.',
    toastSaveFail: 'Save failed.',
    toastWeightOrStable: 'Enter weight or wait until the reading is stable.',
    toastWeightRange: (min, max) => `Weight must be between ${min} and ${max} kg.`,
    toastNoPrice: 'Price not set.',
    toastStockWeight: 'Not enough stock for this weight.',
    toastStockLimit: 'Stock limit.',
    toastStockNone: 'Out of stock.',
    toastQtyStock: 'Not enough quantity in stock.',
    toastAddedCart: 'Added to cart.',
    toastWebSerialNone: 'Web Serial not available — enter weight manually.',
    weightStableReady: 'Stable weight — tap Add to cart',
    weightWaiting: 'Waiting for stable weight…',
    toastScaleConnected: 'Scale connected.',
    toastScaleFail: 'Scale connection failed.',
    toastCloseSaveFail: 'Save failed.',

    refundLoading: 'Loading…',
    refundPickOrder: '— Select an order —',
    refundNoOrders: 'No eligible orders',
    refundLinesLoadFail: 'Could not load order lines.',
    refundSold: 'Sold',
    refundKg: ' kg',
    refundRefundable: 'Returnable',
    refundNoLines: 'No lines.',

    emptyCart: 'Cart is empty — add products',
    perKg: '/kg',
    kgSuffix: ' kg',
    lossRiskBadge: 'LOSS RISK',
    qtyMinus: 'Decrease quantity',
    qtyPlus: 'Increase quantity',
    removeLine: 'Remove',
    stockUnlimited: 'Stock: ∞',
    stockCount: (n) => `Stock: ${n}`,
    stockOut: 'Out of stock',
    variantsLabel: 'Variants',
    variantsAllOut: 'All out',
    addToCartBtn: 'Add',
    addDisabled: 'No stock',
    noProducts: 'No products match.',
    weightedTag: 'WEIGHT',
    printBtn: 'Print',

    recentEmpty: 'No POS sales yet.',
    recentLoadFail: 'Failed to load.',

    confirmClearCart: 'Clear the cart?',
    confirmCloseOverwrite: 'A close for today already exists. Overwrite?',

    closeSlipDayClose: (date) => `Day close — ${date}`,
    closeExpectedCash: 'Expected cash',
    closeExpectedCard: 'Expected card',
    closeExpectedMobile: 'Expected mobile',
    closeCountedCash: 'Counted cash',
    closeCountedCard: 'Counted card',
    closeCountedMobile: 'Counted mobile',
    closeVarCash: 'Variance cash',
    closeVarCard: 'Variance card',
    closeVarMobile: 'Variance mobile',

    receiptTitle: 'POS receipt',
    receiptOrder: 'Order',
    receiptSubtotal: 'Subtotal',
    receiptDiscount: 'Discount',
    receiptTaxTotal: 'Tax total',
    receiptTotal: 'Total',
    receiptPayment: 'Payment',
    receiptThanks: 'Thank you',
    receiptDefaultStore: 'Store',

    variantStock: (s) => (s === '∞' ? 'Stock: ∞' : `Stock: ${s}`),
    stockUnlimitedShort: '∞',

    categoryOthers: 'Others'
};
