{"version":3,"sources":["jsdelivr-header.js","/npm/antiautoclick@1.0.6/antiautoclick.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,SAAS,cAAc,EAAY,GACjC,IAAI,EAAa,GAEjB,SAAS,QAAU,SAAS,GAW1B,GATG,EAAQ,aAAe,IACxB,EAAW,KAAK,IAAI,MACjB,EAAW,OAAS,EAAQ,cAAc,EAAW,SAIvB,GAA/B,EAAQ,qBAAoD,GAAnB,EAAM,WAAqB,EAAW,OAGxC,GAAvC,EAAQ,oBAAoB,SAAqB,EAAW,QAAU,EAAQ,aAAc,CAC9F,IAAI,EAAoB,EACxB,IAAI,IAAI,KAAK,EACX,GAAG,EAAI,EAAE,CACP,MAAM,EAAa,KAAK,IAAI,EAAW,GAAK,EAAW,EAAE,IACtD,EAAa,IAAmB,EAAoB,EACzD,CAGC,EAAoB,EAAQ,oBAAoB,QACjD,EAAW,MAGf,CAGA,GAA0C,GAAtC,EAAQ,mBAAmB,SAAqB,EAAW,OAAS,EAAQ,aAAc,CAC5F,MAAM,EAAsE,KAArD,EAAW,EAAW,OAAS,GAAK,EAAW,IACjD,EAAW,OAAS,EAEvB,EAAQ,mBAAmB,qBAAqB,EAAW,MAC/E,CACF,CACF","file":"/npm/antiautoclick@1.0.6/antiautoclick.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/antiautoclick@1.0.6/antiautoclick.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","function antiautoclick(punishment, options){\n  var clickTimes = [];\n\n  document.onclick = function(event) {\n    // Save clicks\n    if(options.clicksToSave > 0){\n      clickTimes.push(new Date());\n      if(clickTimes.length > options.clicksToSave) clickTimes.shift();\n    }\n\n    // Detect nonhuman clicking\n    if((options.detectNonhumanClick == true) && (event.isTrusted == false)) punishment.call();\n\n    // Detect click interval\n    if((options.detectClickInterval.enabled == true) && (clickTimes.length == options.clicksToSave)){\n      let maximumDifference = 0;\n      for(let i in clickTimes){\n        if(i > 1){\n          const difference = Math.abs(clickTimes[i] - clickTimes[i-1]);\n          if(difference > maximumDifference) maximumDifference = difference;\n        }\n      }\n\n      if(maximumDifference < options.detectClickInterval.margin){\n        punishment.call();\n      }\n\n    }\n\n    // Detect fast clicking\n    if((options.detectFastClicking.enabled == true) && (clickTimes.length > options.clicksToSave)){\n      const secondsPassed = (clickTimes[clickTimes.length - 1] - clickTimes[0]) * 1000;\n      const avgPerSecond = clickTimes.length / secondsPassed;\n\n      if(avgPerSecond > options.detectFastClicking.maximumAvgPerSecond) punishment.call();\n    }\n  };\n}"]}