<commit_before>###
  Payform Javascript Library

  URL: https://github.com/jondavidjohn/payform
  Author: <NAME> <<EMAIL>>
  License: MIT
  Version: 1.1.0
###
((name, definition) ->
  if module?
    module.exports = definition()
  else if typeof define is 'function' and typeof define.amd is 'object'
    define(name, definition)
  else
    this[name] = definition()
)('payform', ->

  _getCaretPos = (ele) ->
    if ele.selectionStart?
      return ele.selectionStart
    else if document.selection?
      ele.focus()
      r = document.selection.createRange()
      re = ele.createTextRange()
      rc = re.duplicate()
      re.moveToBookmark(r.getBookmark())
      rc.setEndPoint('EndToStart', re)
      return rc.text.length

  _eventNormalize = (listener) ->
    return (e = window.event) ->
      e.target = e.target or e.srcElement
      e.which = e.which or e.keyCode
      unless e.preventDefault?
        e.preventDefault = -> this.returnValue = false
      listener(e)

  _on = (ele, event, listener) ->
    listener = _eventNormalize(listener)
    if ele.addEventListener?
      ele.addEventListener(event, listener, false)
    else
      ele.attachEvent("on#{event}", listener)

  payform = {}

  # Utils

  defaultFormat = /(\d{1,4})/g

  payform.cards = [
    # Debit cards must come first, since they have more
    # specific patterns than their credit-card equivalents.
    {
      type: 'visaelectron'
      pattern: /^4(026|17500|405|508|844|91[37])/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'maestro'
      pattern: /^(5(018|0[23]|[68])|6(39|7))/
      format: defaultFormat
      length: [12..19]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'forbrugsforeningen'
      pattern: /^600/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'dankort'
      pattern: /^5019/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    # Credit cards
    {
      type: 'visa'
      pattern: /^4/
      format: defaultFormat
      length: [13, 16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'mastercard'
      pattern: /^(5[0-5]|2[2-7])/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'amex'
      pattern: /^3[47]/
      format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/
      length: [15]
      cvcLength: [3..4]
      luhn: true
    }
    {
      type: 'dinersclub'
      pattern: /^3[0689]/
      format: /(\d{1,4})(\d{1,6})?(\d{1,4})?/
      length: [14]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'discover'
      pattern: /^6([045]|22)/<commit_msg>update mastercard range to 51-55<commit_after>###
  Payform Javascript Library

  URL: https://github.com/jondavidjohn/payform
  Author: <NAME> <<EMAIL>>
  License: MIT
  Version: 1.1.0
###
((name, definition) ->
  if module?
    module.exports = definition()
  else if typeof define is 'function' and typeof define.amd is 'object'
    define(name, definition)
  else
    this[name] = definition()
)('payform', ->

  _getCaretPos = (ele) ->
    if ele.selectionStart?
      return ele.selectionStart
    else if document.selection?
      ele.focus()
      r = document.selection.createRange()
      re = ele.createTextRange()
      rc = re.duplicate()
      re.moveToBookmark(r.getBookmark())
      rc.setEndPoint('EndToStart', re)
      return rc.text.length

  _eventNormalize = (listener) ->
    return (e = window.event) ->
      e.target = e.target or e.srcElement
      e.which = e.which or e.keyCode
      unless e.preventDefault?
        e.preventDefault = -> this.returnValue = false
      listener(e)

  _on = (ele, event, listener) ->
    listener = _eventNormalize(listener)
    if ele.addEventListener?
      ele.addEventListener(event, listener, false)
    else
      ele.attachEvent("on#{event}", listener)

  payform = {}

  # Utils

  defaultFormat = /(\d{1,4})/g

  payform.cards = [
    # Debit cards must come first, since they have more
    # specific patterns than their credit-card equivalents.
    {
      type: 'visaelectron'
      pattern: /^4(026|17500|405|508|844|91[37])/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'maestro'
      pattern: /^(5(018|0[23]|[68])|6(39|7))/
      format: defaultFormat
      length: [12..19]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'forbrugsforeningen'
      pattern: /^600/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'dankort'
      pattern: /^5019/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    # Credit cards
    {
      type: 'visa'
      pattern: /^4/
      format: defaultFormat
      length: [13, 16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'mastercard'
      pattern: /^(5[1-5]|2[2-7])/
      format: defaultFormat
      length: [16]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'amex'
      pattern: /^3[47]/
      format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/
      length: [15]
      cvcLength: [3..4]
      luhn: true
    }
    {
      type: 'dinersclub'
      pattern: /^3[0689]/
      format: /(\d{1,4})(\d{1,6})?(\d{1,4})?/
      length: [14]
      cvcLength: [3]
      luhn: true
    }
    {
      type: 'discover'
      pattern: /^6([045]|22)/
{'fraction_non_alphanumeric': 0.14915315971589874, 'fraction_numerical': 0.040429794208705155, 'mean_word_length': 2.0819304152637486, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2597046', 'n_tokens_mistral': 2071, 'n_tokens_neox': 1969, 'n_words': 429}