{"version":3,"file":"stimulus-animated-number-CWUN13S3.js","sources":["../../../node_modules/stimulus-animated-number/dist/stimulus-animated-number.mjs"],"sourcesContent":["import { Controller as n } from \"@hotwired/stimulus\";\nclass i extends n {\n connect() {\n this.lazyValue ? this.lazyAnimate() : this.animate();\n }\n animate() {\n let e = null;\n const t = (a) => {\n e || (e = a);\n const r = a - e, s = Math.min(r / this.durationValue, 1);\n this.element.innerHTML = Math.floor(s * (this.endValue - this.startValue) + this.startValue).toString(), s < 1 && window.requestAnimationFrame(t);\n };\n window.requestAnimationFrame(t);\n }\n lazyAnimate() {\n new IntersectionObserver((t, a) => {\n t.forEach((r) => {\n r.isIntersecting && (this.animate(), a.unobserve(r.target));\n });\n }, this.lazyAnimateOptions).observe(this.element);\n }\n get lazyAnimateOptions() {\n return {\n threshold: this.lazyThresholdValue,\n rootMargin: this.lazyRootMarginValue\n };\n }\n}\ni.values = {\n start: Number,\n end: Number,\n duration: Number,\n lazyThreshold: Number,\n lazyRootMargin: {\n type: String,\n default: \"0px\"\n },\n lazy: Boolean\n};\nexport {\n i as default\n};\n"],"names":["i","n","e","t","a","r","s"],"mappings":"8CACA,MAAMA,UAAUC,CAAE,CAChB,SAAU,CACR,KAAK,UAAY,KAAK,YAAW,EAAK,KAAK,SAC5C,CACD,SAAU,CACR,IAAIC,EAAI,KACR,MAAMC,EAAKC,GAAM,CACfF,IAAMA,EAAIE,GACV,MAAMC,EAAID,EAAIF,EAAGI,EAAI,KAAK,IAAID,EAAI,KAAK,cAAe,CAAC,EACvD,KAAK,QAAQ,UAAY,KAAK,MAAMC,GAAK,KAAK,SAAW,KAAK,YAAc,KAAK,UAAU,EAAE,WAAYA,EAAI,GAAK,OAAO,sBAAsBH,CAAC,CACtJ,EACI,OAAO,sBAAsBA,CAAC,CAC/B,CACD,aAAc,CACZ,IAAI,qBAAqB,CAAC,EAAG,IAAM,CACjC,EAAE,QAASE,GAAM,CACfA,EAAE,iBAAmB,KAAK,QAAS,EAAE,EAAE,UAAUA,EAAE,MAAM,EACjE,CAAO,CACP,EAAO,KAAK,kBAAkB,EAAE,QAAQ,KAAK,OAAO,CACjD,CACD,IAAI,oBAAqB,CACvB,MAAO,CACL,UAAW,KAAK,mBAChB,WAAY,KAAK,mBACvB,CACG,CACH,CACAL,EAAE,OAAS,CACT,MAAO,OACP,IAAK,OACL,SAAU,OACV,cAAe,OACf,eAAgB,CACd,KAAM,OACN,QAAS,KACV,EACD,KAAM,OACR","x_google_ignoreList":[0]}