PageSourceSearch

https://www.dcm.co.uk/dist/assets/count_up_controller-BQ-Kukxt.js

js dcm.co.uk collected 2026-10-02 10:26:06 UTC 2,542 bytes, 2 lines download raw bytes

1var b=Object.defineProperty;var x=(u,t,e)=>t in u?b(u,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[t]=e;var f=(u,t,e)=>x(u,typeof t!="symbol"?t+"":t,e);import{C as g}from"./controller-DL_XDwt0.js";import"./app-CQlf5mo4.js";class N extends g{static get targets(){return["number"]}connect(){var t,e;if(this.hasAnimated=!1,!this.manualValue){if((e=(t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)"))!=null&&e.matches){this.animateImmediately();return}if(!("IntersectionObserver"in window)){this.animateImmediately();return}this.observer=new IntersectionObserver(n=>{var s;const i=n[0];!i||!i.isIntersecting||this.hasAnimated||(this.hasAnimated=!0,(s=this.observer)==null||s.disconnect(),this.animate())},{threshold:this.thresholdValue}),this.observer.observe(this.element)}}start(){var t;this.hasAnimated||(this.hasAnimated=!0,(t=this.observer)==null||t.disconnect(),this.animate())}disconnect(){var t;(t=this.observer)==null||t.disconnect()}animateImmediately(){this.hasAnimated||(this.hasAnimated=!0,this.numberTargets.forEach(t=>{const e=this.parseNumber(t.textContent);e&&(t.textContent=e.format(e.to))}))}animate(){const t=this.numberTargets.map(s=>{const a=this.parseNumber(s.textContent);return a?{el:s,...a}:null}).filter(Boolean);if(!t.length)return;const e=performance.now(),n=Math.max(0,this.durationValue),i=s=>{const a=n===0?1:Math.min(1,(s-e)/n),o=this.easeOutCubic(a);t.forEach(r=>{const m=r.from+(r.to-r.from)*o;r.el.textContent=r.format(m)}),a<1?requestAnimationFrame(i):t.forEach(r=>{r.el.textContent=r.format(r.to)})};requestAnimationFrame(i)}parseNumber(t){var c;const e=(t??"").trim();if(!e)return null;const n=e.match(/^(?<prefix>[^\d-]*)(?<num>-?\d[\d,]*(?:\.\d+)?)(?<suffix>.*)$/);if(!((c=n==null?void 0:n.groups)!=null&&c.num))return null;const i=n.groups.prefix??"",s=n.groups.suffix??"",a=n.groups.num,o=(a.split(".")[1]||"").length,r=Number(a.replaceAll(",",""));if(!Number.isFinite(r))return null;const m=this.startValue;return{prefix:i,suffix:s,from:m,to:r,decimals:o,format:h=>{const l=Number.isFinite(h)?h:r,d=o>0?l.toFixed(o):String(Math.round(l)),p=o>0?Number(d).toLocaleString("en-GB",{minimumFractionDigits:o,maximumFractionDigits:o}):Number(d).toLocaleString("en-GB");return`${i}${p}${s}`}}}easeOutCubic(t){return 1-Math.pow(1-t,3)}}f(N,"values",{duration:{type:Number,default:1500},start:{type:Number,default:0},threshold:{type:Number,default:.3},manual:{type:Boolean,default:!1}});export{N as default};
2//# sourceMappingURL=count_up_controller-BQ-Kukxt.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.