Changeset 3458851
- Timestamp:
- 02/11/2026 10:10:45 AM (8 days ago)
- Location:
- counting-number-block
- Files:
-
- 1 deleted
- 16 edited
- 1 copied
-
tags/1.1.2 (copied) (copied from counting-number-block/trunk)
-
tags/1.1.2/build/block.json (modified) (2 diffs)
-
tags/1.1.2/build/frontend.asset.php (modified) (1 diff)
-
tags/1.1.2/build/frontend.js (modified) (1 diff)
-
tags/1.1.2/build/index.asset.php (modified) (1 diff)
-
tags/1.1.2/build/index.js (modified) (1 diff)
-
tags/1.1.2/counting-number.php (modified) (1 diff)
-
tags/1.1.2/readme.txt (modified) (2 diffs)
-
tags/1.1.2/src (deleted)
-
trunk/build/block.json (modified) (2 diffs)
-
trunk/build/frontend.asset.php (modified) (1 diff)
-
trunk/build/frontend.js (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/counting-number.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/block.json (modified) (2 diffs)
-
trunk/src/counting.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
counting-number-block/tags/1.1.2/build/block.json
r3109915 r3458851 18 18 "selector": ".wp-block-boldblocks-counting-number > .value", 19 19 "attribute": "data-value", 20 "__experimentalRole": "content" 20 "__experimentalRole": "content", 21 "default": 1000 21 22 }, 22 23 "startVal": { … … 25 26 "selector": ".wp-block-boldblocks-counting-number > .value", 26 27 "attribute": "data-start-val", 27 "__experimentalRole": "content" 28 "__experimentalRole": "content", 29 "default": 0 28 30 }, 29 31 "duration": { -
counting-number-block/tags/1.1.2/build/frontend.asset.php
r3437288 r3458851 1 <?php return array('dependencies' => array(), 'version' => ' 0a840514dfc88f1f298c');1 <?php return array('dependencies' => array(), 'version' => '265eefd7d118174415ca'); -
counting-number-block/tags/1.1.2/build/frontend.js
r3437288 r3458851 1 (()=>{"use strict";var t=function(){return t=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++)for(var s in n=arguments[e])Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s]);return t},t.apply(this,arguments)},n=function(){function n(n,e,i){var s=this;this.endVal=e,this.options=i,this.version="2. 8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){s.startTime||(s.startTime=t);var n=t-s.startTime;s.remaining=s.duration-n,s.useEasing?s.countDown?s.frameVal=s.startVal-s.easingFn(n,0,s.startVal-s.endVal,s.duration):s.frameVal=s.easingFn(n,s.startVal,s.endVal-s.startVal,s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(n/s.duration);var e=s.countDown?s.frameVal<s.endVal:s.frameVal>s.endVal;s.frameVal=e?s.endVal:s.frameVal,s.frameVal=Number(s.frameVal.toFixed(s.options.decimalPlaces)),s.printValue(s.frameVal),n<s.duration?s.rAF=requestAnimationFrame(s.count):null!==s.finalEndVal?s.update(s.finalEndVal):s.options.onCompleteCallback&&s.options.onCompleteCallback()},this.formatNumber=function(t){var n,e,i,a,o=t<0?"-":"";n=Math.abs(t).toFixed(s.options.decimalPlaces);var r=(n+="").split(".");if(e=r[0],i=r.length>1?s.options.decimal+r[1]:"",s.options.useGrouping){a="";for(var l=3,u=0,h=0,c=e.length;h<c;++h)s.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=s.options.separator+a),u++,a=e[c-h-1]+a;e=a}return s.options.numerals&&s.options.numerals.length&&(e=e.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]})),i=i.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]}))),o+s.options.prefix+e+i+s.options.suffix},this.easeOutExpo=function(t,n,e,i){return e*(1-Math.pow(2,-10*t/i))*1024/1023+n},this.options=t(t({},this.defaults),i),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof n?document.getElementById(n):n,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,n):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return s.handleScroll(s)})),window.onscroll=function(){window.onScrollFns.forEach((function(t){return t()}))},this.handleScroll(this)))}return n.prototype.handleScroll=function(t){if(t&&window&&!t.once){var n=window.innerHeight+window.scrollY,e=t.el.getBoundingClientRect(),i=e.top+window.pageYOffset,s=e.top+e.height+window.pageYOffset;s<n&&s>window.scrollY&&t.paused?(t.paused=!1,setTimeout((function(){return t.start()}),t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>s||i>n)&&!t.paused&&t.reset()}},n.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var n=t-this.startVal;if(Math.abs(n)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var e=this.countDown?1:-1;this.endVal=t+e*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},n.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},n.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},n.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(t){var n;if(this.el){var e=this.formattingFn(t);(null===(n=this.options.plugin)||void 0===n?void 0:n.render)?this.options.plugin.render(this.el,e):"INPUT"===this.el.tagName?this.el.value=e:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=e:this.el.innerHTML=e}},n.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},n.prototype.validateValue=function(t){var n=Number(t);return this.ensureNumber(n)?n:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},n.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},n}();const e=(t,n)=>{t.forEach((t=>{const{observer:e,counter:i,data:s,element:a}=null!=t?t:{};e&&i&&(n?(i.printValue(s?.value),e.unobserve(a)):e.observe(a))}))};var i;i=()=>{const t=document.querySelectorAll(".wp-block-boldblocks-counting-number .value");if(t.length){const i=[];t.forEach((t=>{const e=(t=>{const e=t.dataset,i=Object.keys(e).reduce(((t,n)=>{let i=e[n];if("value"===n){if(!isNaN(parseFloat(i))){let n=0;const e=".";(i+"").indexOf(e)>=0&&(n=(i+"").split(e)[1].length),t.value=i,t.decimalPlaces=n}}else["startVal","duration","scrollSpyDelay"].includes(n)?(i=parseFloat(i),isNaN(i)||("scrollSpyDelay"===n&&(i*=1e3),t[n]=i)):["enableScrollSpy","scrollSpyOnce"].includes(n)?t[n]="true"===i:"disableGrouping"===n?t.useGrouping="true"!==i:["separator","decimal"].includes(n)&&(t[n]=i);return t}),{});if(i?.value){const e=new n(t,i.value,{...i,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),s="is-number-animating",a=new IntersectionObserver((([n])=>{if(n.intersectionRatio>0){const o=n.target.closest(".wp-block-boldblocks-counting-number");o&&!o.classList.contains(s)&&o.classList.add(s),e.reset(),e.start((()=>{o&&o.classList.contains(s)&&o.classList.remove(s)})),i?.scrollSpyOnce&&a.unobserve(t)}}),{threshold:[0]});return a.observe(t),{observer:a,element:t,data:i,counter:e}}})(t);e&&i.push(e)}));const s=window.matchMedia("(prefers-reduced-motion: reduce)");e(i,s.matches),s.addEventListener("change",(()=>{e(i,s.matches)}))}},"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)})();1 (()=>{"use strict";var t=function(){return t=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++)for(var s in n=arguments[e])Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s]);return t},t.apply(this,arguments)},n=function(){function n(n,e,i){var s=this;this.endVal=e,this.options=i,this.version="2.9.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){s.startTime||(s.startTime=t);var n=t-s.startTime;s.remaining=s.duration-n,s.useEasing?s.countDown?s.frameVal=s.startVal-s.easingFn(n,0,s.startVal-s.endVal,s.duration):s.frameVal=s.easingFn(n,s.startVal,s.endVal-s.startVal,s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(n/s.duration);var e=s.countDown?s.frameVal<s.endVal:s.frameVal>s.endVal;s.frameVal=e?s.endVal:s.frameVal,s.frameVal=Number(s.frameVal.toFixed(s.options.decimalPlaces)),s.printValue(s.frameVal),n<s.duration?s.rAF=requestAnimationFrame(s.count):null!==s.finalEndVal?s.update(s.finalEndVal):s.options.onCompleteCallback&&s.options.onCompleteCallback()},this.formatNumber=function(t){var n,e,i,a,o=t<0?"-":"";n=Math.abs(t).toFixed(s.options.decimalPlaces);var r=(n+="").split(".");if(e=r[0],i=r.length>1?s.options.decimal+r[1]:"",s.options.useGrouping){a="";for(var l=3,u=0,h=0,p=e.length;h<p;++h)s.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=s.options.separator+a),u++,a=e[p-h-1]+a;e=a}return s.options.numerals&&s.options.numerals.length&&(e=e.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]})),i=i.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]}))),o+s.options.prefix+e+i+s.options.suffix},this.easeOutExpo=function(t,n,e,i){return e*(1-Math.pow(2,-10*t/i))*1024/1023+n},this.options=t(t({},this.defaults),i),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el="string"==typeof n?document.getElementById(n):n,e=null==e?this.parse(this.el.innerHTML):e,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,n):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return s.handleScroll(s)})),window.onscroll=function(){window.onScrollFns.forEach((function(t){return t()}))},this.handleScroll(this)))}return n.prototype.handleScroll=function(t){if(t&&window&&!t.once){var n=window.innerHeight+window.scrollY,e=t.el.getBoundingClientRect(),i=e.top+window.pageYOffset,s=e.top+e.height+window.pageYOffset;s<n&&s>window.scrollY&&t.paused?(t.paused=!1,setTimeout((function(){return t.start()}),t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>s||i>n)&&!t.paused&&t.reset()}},n.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var n=t-this.startVal;if(Math.abs(n)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var e=this.countDown?1:-1;this.endVal=t+e*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},n.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},n.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},n.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(t){var n;if(this.el){var e=this.formattingFn(t);(null===(n=this.options.plugin)||void 0===n?void 0:n.render)?this.options.plugin.render(this.el,e):"INPUT"===this.el.tagName?this.el.value=e:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=e:this.el.innerHTML=e}},n.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},n.prototype.validateValue=function(t){var n=Number(t);return this.ensureNumber(n)?n:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},n.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},n.prototype.parse=function(t){var n=function(t){return t.replace(/([.,' ])/g,"\\$1")},e=n(this.options.separator),i=n(this.options.decimal),s=t.replace(new RegExp(e,"g"),"").replace(new RegExp(i,"g"),".");return parseFloat(s)},n}();const e=(t,n)=>{t.forEach((t=>{const{observer:e,counter:i,data:s,element:a}=null!=t?t:{};e&&i&&(n?(i.printValue(s?.value),e.unobserve(a)):e.observe(a))}))};var i;i=()=>{const t=document.querySelectorAll(".wp-block-boldblocks-counting-number .value");if(t.length){const i=[];t.forEach((t=>{const e=(t=>{var e;const i=(t=>{const n={},{value:e,startVal:i,duration:s,scrollSpyDelay:a,enableScrollSpy:o,scrollSpyOnce:r,disableGrouping:l,separator:u,decimal:h}=t;if(!e)return null;const p=parseFloat(e);if(isNaN(p))return null;const c=(e.split(".")[1]||"").length;n.value=p,n.decimalPlaces=c;const d=parseFloat(i);isNaN(d)||(n.startVal=d);const m=parseFloat(s);isNaN(m)||(n.duration=m);const f=parseFloat(a);return isNaN(f)||(n.scrollSpyDelay=1e3*f),void 0!==o&&(n.enableScrollSpy="true"===o),void 0!==r&&(n.scrollSpyOnce="true"===r),void 0!==l&&(n.useGrouping="true"!==l),u&&(n.separator=u),h&&(n.decimal=h),n})(t.dataset);if(!i)return;const s=null!==(e=i.scrollSpyDelay)&&void 0!==e?e:0,a=new n(t,i.value,{...i,scrollSpyDelay:0,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),o="is-number-animating",r=new IntersectionObserver((([t])=>{if(!t.isIntersecting)return;const n=t.target.closest(".wp-block-boldblocks-counting-number");a.reset(),setTimeout((()=>{n?.classList.add(o),a.start((()=>{n?.classList.remove(o)}))}),s),i.scrollSpyOnce&&r.unobserve(t.target)}),{threshold:0});return r.observe(t),{observer:r,element:t,data:i,counter:a}})(t);e&&i.push(e)}));const s=window.matchMedia("(prefers-reduced-motion: reduce)");e(i,s.matches),s.addEventListener("change",(()=>{e(i,s.matches)}))}},"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)})(); -
counting-number-block/tags/1.1.2/build/index.asset.php
r3437288 r3458851 1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 08e6ec6b2a0648532d7c');1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7421ae9cc182c5d60c40'); -
counting-number-block/tags/1.1.2/build/index.js
r3437288 r3458851 1 (()=>{"use strict";var e,t={365(){const e=window.wp.blocks;function t(e){var n, a,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(a=t(e[n]))&&(i&&(i+=" "),i+=a)}else for(a in e)e[a]&&(i&&(i+=" "),i+=a);return i}const n=function(){for(var e,n,a=0,i="",r=arguments.length;a<r;a++)(e=arguments[a])&&(n=t(e))&&(i&&(i+=" "),i+=n);return i},a=window.wp.i18n,i=window.wp.primitives,r=window.ReactJSXRuntime,o=(0,r.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,r.jsx)(i.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,r.jsx)(i.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),s=window.wp.blockEditor,l=window.wp.components,u=window.wp.element,c=e=>{const{value:t=1e3,startVal:n=0,duration:a=2,separator:i=",",decimal:r=".",enableScrollSpy:o=!0,scrollSpyOnce:s,scrollSpyDelay:l=0,disableGrouping:u=!1,prefix:c="",suffix:p=""}=e,d={value:t,startVal:n,duration:a,separator:i,decimal:r,enableScrollSpy:o,scrollSpyOnce:s,scrollSpyDelay:l,disableGrouping:u,prefix:c,suffix:p};return Object.keys(d).reduce(((e,t)=>{let n=t;return"startVal"===t?n="start-val":"enableScrollSpy"===t?n="enable-scroll-spy":"scrollSpyOnce"===t?n="scroll-spy-once":"scrollSpyDelay"===t&&(n="scroll-spy-delay"),"disableGrouping"===t?d[t]&&(e["data-disable-grouping"]=d[t]):e[`data-${n}`]=d[t],e}),{})},p=({deprecatedStartVal:e,startVal:t})=>e?"":t;var d=function(){return d=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},d.apply(this,arguments)},h=function(){function e(e,t,n){var a=this;this.endVal=t,this.options=n,this.version="2.8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(e){a.startTime||(a.startTime=e);var t=e-a.startTime;a.remaining=a.duration-t,a.useEasing?a.countDown?a.frameVal=a.startVal-a.easingFn(t,0,a.startVal-a.endVal,a.duration):a.frameVal=a.easingFn(t,a.startVal,a.endVal-a.startVal,a.duration):a.frameVal=a.startVal+(a.endVal-a.startVal)*(t/a.duration);var n=a.countDown?a.frameVal<a.endVal:a.frameVal>a.endVal;a.frameVal=n?a.endVal:a.frameVal,a.frameVal=Number(a.frameVal.toFixed(a.options.decimalPlaces)),a.printValue(a.frameVal),t<a.duration?a.rAF=requestAnimationFrame(a.count):null!==a.finalEndVal?a.update(a.finalEndVal):a.options.onCompleteCallback&&a.options.onCompleteCallback()},this.formatNumber=function(e){var t,n,i,r,o=e<0?"-":"";t=Math.abs(e).toFixed(a.options.decimalPlaces);var s=(t+="").split(".");if(n=s[0],i=s.length>1?a.options.decimal+s[1]:"",a.options.useGrouping){r="";for(var l=3,u=0,c=0,p=n.length;c<p;++c)a.options.useIndianSeparators&&4===c&&(l=2,u=1),0!==c&&u%l==0&&(r=a.options.separator+r),u++,r=n[p-c-1]+r;n=r}return a.options.numerals&&a.options.numerals.length&&(n=n.replace(/[0-9]/g,(function(e){return a.options.numerals[+e]})),i=i.replace(/[0-9]/g,(function(e){return a.options.numerals[+e]}))),o+a.options.prefix+n+i+a.options.suffix},this.easeOutExpo=function(e,t,n,a){return n*(1-Math.pow(2,-10*e/a))*1024/1023+t},this.options=d(d({},this.defaults),n),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(t),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof e?document.getElementById(e):e,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,e):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return a.handleScroll(a)})),window.onscroll=function(){window.onScrollFns.forEach((function(e){return e()}))},this.handleScroll(this)))}return e.prototype.handleScroll=function(e){if(e&&window&&!e.once){var t=window.innerHeight+window.scrollY,n=e.el.getBoundingClientRect(),a=n.top+window.pageYOffset,i=n.top+n.height+window.pageYOffset;i<t&&i>window.scrollY&&e.paused?(e.paused=!1,setTimeout((function(){return e.start()}),e.options.scrollSpyDelay),e.options.scrollSpyOnce&&(e.once=!0)):(window.scrollY>i||a>t)&&!e.paused&&e.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var e=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>e;var t=e-this.startVal;if(Math.abs(t)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=e;var n=this.countDown?1:-1;this.endVal=e+n*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=e,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(e){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),e&&(this.options.onCompleteCallback=e),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(e){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(e),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(e){var t;if(this.el){var n=this.formattingFn(e);(null===(t=this.options.plugin)||void 0===t?void 0:t.render)?this.options.plugin.render(this.el,n):"INPUT"===this.el.tagName?this.el.value=n:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n:this.el.innerHTML=n}},e.prototype.ensureNumber=function(e){return"number"==typeof e&&!isNaN(e)},e.prototype.validateValue=function(e){var t=Number(e);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: ".concat(e),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e}();function m(e){const{attributes:t,attributes:{value:a,textAlign:i,prefix:o="",suffix:l=""}}=e;let u=c(t),d=(0,r.jsx)("span",{className:"sr-value",children:a});return u={...u,"aria-hidden":"true"},t?.deprecatedAccessibility&&(delete u["aria-hidden"],d=null),(0,r.jsxs)("div",{...s.useBlockProps.save({className:n({[`has-text-align-${i}`]:i})}),children:[!!o.trim()&&(0,r.jsx)("span",{className:"prefix",children:o}),(0,r.jsx)("span",{className:"value",...u,children:p(t)}),d,!!l.trim()&&(0,r.jsx)("span",{className:"suffix",children:l})]})}window.addEventListener("boldblocks.countingNumber.settingsUpdated",(({detail:{selector:e}={}})=>{const t=(window.countingManager||(window.countingManager={}),window.countingManager);if(t[e]){var n;const{observer:a,element:i}=null!==(n=t[e])&&void 0!==n?n:{};a&&i&&a.unobserve(i)}let a=document.querySelector(e);if(!a){const t=document.querySelector('iframe[name="editor-canvas"]');t&&(a=t.contentWindow.document.querySelector(e))}a&&(t[e]=(e=>{const t=e.dataset,n=Object.keys(t).reduce(((e,n)=>{let a=t[n];if("value"===n){if(!isNaN(parseFloat(a))){let t=0;const n=".";(a+"").indexOf(n)>=0&&(t=(a+"").split(n)[1].length),e.value=a,e.decimalPlaces=t}}else["startVal","duration","scrollSpyDelay"].includes(n)?(a=parseFloat(a),isNaN(a)||("scrollSpyDelay"===n&&(a*=1e3),e[n]=a)):["enableScrollSpy","scrollSpyOnce"].includes(n)?e[n]="true"===a:"disableGrouping"===n?e.useGrouping="true"!==a:["separator","decimal"].includes(n)&&(e[n]=a);return e}),{});if(n?.value){const t=new h(e,n.value,{...n,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),a="is-number-animating",i=new IntersectionObserver((([r])=>{if(r.intersectionRatio>0){const o=r.target.closest(".wp-block-boldblocks-counting-number");o&&!o.classList.contains(a)&&o.classList.add(a),t.reset(),t.start((()=>{o&&o.classList.contains(a)&&o.classList.remove(a)})),n?.scrollSpyOnce&&i.unobserve(e)}}),{threshold:[0]});return i.observe(e),{observer:i,element:e,data:n,counter:t}}})(a))}));const b=window.React;var f,g,v;function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},y.apply(null,arguments)}const x=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"boldblocks/counting-number","title":"Counting number block","category":"design","description":"This block provides an animated counter effect for numbers.","keywords":["number","counting","counter","animation"],"attributes":{"value":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-value","__experimentalRole":"content"},"startVal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-start-val","__experimentalRole":"content"},"duration":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-duration","default":2},"enableScrollSpy":{"type":"boolean","default":true},"scrollSpyOnce":{"type":"boolean","default":true},"scrollSpyDelay":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-scroll-spy-delay","default":0},"disableGrouping":{"type":"boolean","default":false},"separator":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-separator","default":","},"decimal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-decimal","default":"."},"prefix":{"type":"string","__experimentalRole":"content"},"suffix":{"type":"string","__experimentalRole":"content"}},"supports":{"html":false,"spacing":{"margin":true,"padding":true},"color":{"background":true,"text":true,"gradients":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalDefaultControls":{"fontSize":true,"lineHeight":true,"fontAppearance":true,"textTransform":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":false},"interactivity":{"clientNavigation":true}},"textdomain":"counting-number-block","editorScript":"file:./index.js","viewScript":"file:./frontend.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),w=[{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0}},save:m},{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0},deprecatedStartVal:{type:"boolean",default:!0}},save:m}];(0,e.registerBlockType)(x,{icon:function(e){return b.createElement("svg",y({width:24,height:24,viewBox:"0 0 20 20"},e),f||(f=b.createElement("rect",{width:20,height:20,fill:"#d20962",ry:2})),g||(g=b.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M13.36 9.098c-1.137 0-1.708-.657-1.762-1.278h1.004c.058.223.343.45.773.45.824 0 1.164-.829 1.133-1.856h-.059c-.148.39-.57.742-1.261.742-.91 0-1.72-.613-1.72-1.758 0-1.148.848-1.836 1.973-1.836 1.09 0 2.063.637 2.063 2.688 0 1.867-.723 2.848-2.145 2.848zm.062-2.735c.504 0 .933-.336.933-.972 0-.633-.398-1.008-.94-1.008-.52 0-.927.375-.927 1 0 .64.418.98.934.98"})),v||(v=b.createElement("path",{fill:"#fff",d:"M14.438 10.668V16H13.39v-4.316h-.051l-1.211.859v-.969l1.262-.906h1.046zM6.5 15.5a.5.5 0 0 1-1 0V5.707L4.354 6.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.5.5 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L6.5 5.707z"})))},example:{attributes:{content:"100"}},edit:function(e){const{attributes:t,attributes:{value:i=1e3,startVal:p=0,duration:d=2,scrollSpyOnce:h,scrollSpyDelay:m=0,textAlign:b,disableGrouping:f=!1,separator:g=",",decimal:v=".",prefix:y="",suffix:x=""},setAttributes:w,isSelected:V,clientId:S}=e;(0,u.useEffect)((()=>(window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.settingsUpdated",{detail:{selector:`#block-${S} .value`}})),()=>{window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.removeCounting",{detail:{selector:`#block-${S} .value`}}))})),[i,p,d,h,m,f,g,v]);const k=s.useBlockEditingMode?(0,s.useBlockEditingMode)():"default",_=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.TextControl,{label:(0,a.__)("The number value","counting-number-block"),value:i,onChange:e=>{w({value:e})},type:"number",step:"any"}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Start counting from value","counting-number-block"),value:p,onChange:e=>w({startVal:e}),type:"number",step:"any"})]}),j=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.TextControl,{label:(0,a.__)("Prefix","counting-number-block"),value:y,onChange:e=>w({prefix:e}),help:(0,a.__)("Display before the number.","counting-number-block")}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Suffix","counting-number-block"),value:x,onChange:e=>w({suffix:e}),help:(0,a.__)("Display after the number.","counting-number-block")})]}),E=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.TextControl,{label:(0,a.__)("Duration (in seconds)","counting-number-block"),value:d,onChange:e=>w({duration:e}),type:"number",step:.5,min:0}),(0,r.jsx)(l.ToggleControl,{label:(0,a.__)("Don't group large number","counting-number-block"),checked:f,onChange:e=>w({disableGrouping:e}),help:(0,a.__)("E.G. 1000 instead of 1,000","counting-number-block")}),!f&&(0,r.jsx)(l.TextControl,{label:(0,a.__)("Grouping separator","counting-number-block"),value:g,onChange:e=>w({separator:e}),help:(0,a.__)("E.G. 1,000 instead of 1000","counting-number-block")}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Decimal separator","counting-number-block"),value:v,onChange:e=>w({decimal:e}),help:(0,a.__)("Default (.)","counting-number-block")}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Delay (in seconds)","counting-number-block"),value:m,onChange:e=>w({scrollSpyDelay:e}),type:"number",step:.1,min:0}),(0,r.jsx)(l.ToggleControl,{label:(0,a.__)("Only run once?","counting-number-block"),checked:h,onChange:e=>w({scrollSpyOnce:e})})]}),C=(0,r.jsxs)(r.Fragment,{children:[_,j]}),F=(0,a.__)("Block settings","counting-number-block");return(0,r.jsxs)(r.Fragment,{children:[V&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.BlockControls,{group:"block",children:[(0,r.jsx)(l.Dropdown,{popoverProps:{position:"bottom right"},contentClassName:"counting-number",renderToggle:({isOpen:e,onToggle:t})=>(0,r.jsx)(l.ToolbarButton,{label:F,onClick:t,"aria-haspopup":"true","aria-expanded":e,icon:o}),renderContent:()=>(0,r.jsx)(r.Fragment,{children:C})}),"default"===k&&(0,r.jsx)(s.AlignmentControl,{value:b,onChange:e=>{w({textAlign:e})}})]}),(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(l.PanelBody,{title:F,children:[_,E,j]})})]}),(0,r.jsxs)("div",{...(0,s.useBlockProps)({className:n({[`has-text-align-${b}`]:b})}),children:[!!y.trim()&&(0,r.jsx)("span",{className:"prefix",children:y}),(0,r.jsx)("span",{className:"value",...c(t),children:i}),!!x.trim()&&(0,r.jsx)("span",{className:"suffix",children:x})]})]})},save:m,deprecated:w})}},n={};function a(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,a),r.exports}a.m=t,e=[],a.O=(t,n,i,r)=>{if(!n){var o=1/0;for(c=0;c<e.length;c++){for(var[n,i,r]=e[c],s=!0,l=0;l<n.length;l++)(!1&r||o>=r)&&Object.keys(a.O).every((e=>a.O[e](n[l])))?n.splice(l--,1):(s=!1,r<o&&(o=r));if(s){e.splice(c--,1);var u=i();void 0!==u&&(t=u)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,i,r]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[o,s,l]=n,u=0;if(o.some((t=>0!==e[t]))){for(i in s)a.o(s,i)&&(a.m[i]=s[i]);if(l)var c=l(a)}for(t&&t(n);u<o.length;u++)r=o[u],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(c)},n=globalThis.webpackChunkcounting_number_block=globalThis.webpackChunkcounting_number_block||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[350],(()=>a(365)));i=a.O(i)})();1 (()=>{"use strict";var e,t={365(){const e=window.wp.blocks;function t(e){var n,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(r=t(e[n]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}const n=function(){for(var e,n,r=0,a="",i=arguments.length;r<i;r++)(e=arguments[r])&&(n=t(e))&&(a&&(a+=" "),a+=n);return a},r=window.wp.i18n,a=window.wp.primitives,i=window.ReactJSXRuntime,o=(0,i.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,i.jsx)(a.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,i.jsx)(a.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),s=window.wp.blockEditor,l=window.wp.components,u=window.wp.element,c=e=>{const{value:t=1e3,startVal:n=0,duration:r=2,separator:a=",",decimal:i=".",enableScrollSpy:o=!0,scrollSpyOnce:s,scrollSpyDelay:l=0,disableGrouping:u=!1,prefix:c="",suffix:p=""}=e,d={value:t,startVal:n,duration:r,separator:a,decimal:i,enableScrollSpy:o,scrollSpyOnce:s,scrollSpyDelay:l,disableGrouping:u,prefix:c,suffix:p};return Object.keys(d).reduce(((e,t)=>{let n=t;return"startVal"===t?n="start-val":"enableScrollSpy"===t?n="enable-scroll-spy":"scrollSpyOnce"===t?n="scroll-spy-once":"scrollSpyDelay"===t&&(n="scroll-spy-delay"),"disableGrouping"===t?d[t]&&(e["data-disable-grouping"]=d[t]):e[`data-${n}`]=d[t],e}),{})},p=({deprecatedStartVal:e,startVal:t})=>e?"":t;var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},d.apply(this,arguments)},h=function(){function e(e,t,n){var r=this;this.endVal=t,this.options=n,this.version="2.9.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(e){r.startTime||(r.startTime=e);var t=e-r.startTime;r.remaining=r.duration-t,r.useEasing?r.countDown?r.frameVal=r.startVal-r.easingFn(t,0,r.startVal-r.endVal,r.duration):r.frameVal=r.easingFn(t,r.startVal,r.endVal-r.startVal,r.duration):r.frameVal=r.startVal+(r.endVal-r.startVal)*(t/r.duration);var n=r.countDown?r.frameVal<r.endVal:r.frameVal>r.endVal;r.frameVal=n?r.endVal:r.frameVal,r.frameVal=Number(r.frameVal.toFixed(r.options.decimalPlaces)),r.printValue(r.frameVal),t<r.duration?r.rAF=requestAnimationFrame(r.count):null!==r.finalEndVal?r.update(r.finalEndVal):r.options.onCompleteCallback&&r.options.onCompleteCallback()},this.formatNumber=function(e){var t,n,a,i,o=e<0?"-":"";t=Math.abs(e).toFixed(r.options.decimalPlaces);var s=(t+="").split(".");if(n=s[0],a=s.length>1?r.options.decimal+s[1]:"",r.options.useGrouping){i="";for(var l=3,u=0,c=0,p=n.length;c<p;++c)r.options.useIndianSeparators&&4===c&&(l=2,u=1),0!==c&&u%l==0&&(i=r.options.separator+i),u++,i=n[p-c-1]+i;n=i}return r.options.numerals&&r.options.numerals.length&&(n=n.replace(/[0-9]/g,(function(e){return r.options.numerals[+e]})),a=a.replace(/[0-9]/g,(function(e){return r.options.numerals[+e]}))),o+r.options.prefix+n+a+r.options.suffix},this.easeOutExpo=function(e,t,n,r){return n*(1-Math.pow(2,-10*e/r))*1024/1023+t},this.options=d(d({},this.defaults),n),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el="string"==typeof e?document.getElementById(e):e,t=null==t?this.parse(this.el.innerHTML):t,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(t),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,e):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return r.handleScroll(r)})),window.onscroll=function(){window.onScrollFns.forEach((function(e){return e()}))},this.handleScroll(this)))}return e.prototype.handleScroll=function(e){if(e&&window&&!e.once){var t=window.innerHeight+window.scrollY,n=e.el.getBoundingClientRect(),r=n.top+window.pageYOffset,a=n.top+n.height+window.pageYOffset;a<t&&a>window.scrollY&&e.paused?(e.paused=!1,setTimeout((function(){return e.start()}),e.options.scrollSpyDelay),e.options.scrollSpyOnce&&(e.once=!0)):(window.scrollY>a||r>t)&&!e.paused&&e.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var e=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>e;var t=e-this.startVal;if(Math.abs(t)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=e;var n=this.countDown?1:-1;this.endVal=e+n*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=e,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(e){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),e&&(this.options.onCompleteCallback=e),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(e){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(e),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(e){var t;if(this.el){var n=this.formattingFn(e);(null===(t=this.options.plugin)||void 0===t?void 0:t.render)?this.options.plugin.render(this.el,n):"INPUT"===this.el.tagName?this.el.value=n:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n:this.el.innerHTML=n}},e.prototype.ensureNumber=function(e){return"number"==typeof e&&!isNaN(e)},e.prototype.validateValue=function(e){var t=Number(e);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: ".concat(e),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e.prototype.parse=function(e){var t=function(e){return e.replace(/([.,' ])/g,"\\$1")},n=t(this.options.separator),r=t(this.options.decimal),a=e.replace(new RegExp(n,"g"),"").replace(new RegExp(r,"g"),".");return parseFloat(a)},e}();function m(e){const{attributes:t,attributes:{value:r,textAlign:a,prefix:o="",suffix:l=""}}=e;let u=c(t),d=(0,i.jsx)("span",{className:"sr-value",children:r});return u={...u,"aria-hidden":"true"},t?.deprecatedAccessibility&&(delete u["aria-hidden"],d=null),(0,i.jsxs)("div",{...s.useBlockProps.save({className:n({[`has-text-align-${a}`]:a})}),children:[!!o.trim()&&(0,i.jsx)("span",{className:"prefix",children:o}),(0,i.jsx)("span",{className:"value",...u,children:p(t)}),d,!!l.trim()&&(0,i.jsx)("span",{className:"suffix",children:l})]})}window.addEventListener("boldblocks.countingNumber.settingsUpdated",(({detail:{selector:e}={}})=>{const t=(window.countingManager||(window.countingManager={}),window.countingManager);if(t[e]){var n;const{observer:r,element:a}=null!==(n=t[e])&&void 0!==n?n:{};r&&a&&r.unobserve(a)}let r=document.querySelector(e);if(!r){const t=document.querySelector('iframe[name="editor-canvas"]');t&&(r=t.contentWindow.document.querySelector(e))}r&&(t[e]=(e=>{var t;const n=(e=>{const t={},{value:n,startVal:r,duration:a,scrollSpyDelay:i,enableScrollSpy:o,scrollSpyOnce:s,disableGrouping:l,separator:u,decimal:c}=e;if(!n)return null;const p=parseFloat(n);if(isNaN(p))return null;const d=(n.split(".")[1]||"").length;t.value=p,t.decimalPlaces=d;const h=parseFloat(r);isNaN(h)||(t.startVal=h);const m=parseFloat(a);isNaN(m)||(t.duration=m);const b=parseFloat(i);return isNaN(b)||(t.scrollSpyDelay=1e3*b),void 0!==o&&(t.enableScrollSpy="true"===o),void 0!==s&&(t.scrollSpyOnce="true"===s),void 0!==l&&(t.useGrouping="true"!==l),u&&(t.separator=u),c&&(t.decimal=c),t})(e.dataset);if(!n)return;const r=null!==(t=n.scrollSpyDelay)&&void 0!==t?t:0,a=new h(e,n.value,{...n,scrollSpyDelay:0,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),i="is-number-animating",o=new IntersectionObserver((([e])=>{if(!e.isIntersecting)return;const t=e.target.closest(".wp-block-boldblocks-counting-number");a.reset(),setTimeout((()=>{t?.classList.add(i),a.start((()=>{t?.classList.remove(i)}))}),r),n.scrollSpyOnce&&o.unobserve(e.target)}),{threshold:0});return o.observe(e),{observer:o,element:e,data:n,counter:a}})(r))}));const b=window.React;var g,f,v;function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(null,arguments)}const x=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"boldblocks/counting-number","title":"Counting number block","category":"design","description":"This block provides an animated counter effect for numbers.","keywords":["number","counting","counter","animation"],"attributes":{"value":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-value","__experimentalRole":"content","default":1000},"startVal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-start-val","__experimentalRole":"content","default":0},"duration":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-duration","default":2},"enableScrollSpy":{"type":"boolean","default":true},"scrollSpyOnce":{"type":"boolean","default":true},"scrollSpyDelay":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-scroll-spy-delay","default":0},"disableGrouping":{"type":"boolean","default":false},"separator":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-separator","default":","},"decimal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-decimal","default":"."},"prefix":{"type":"string","__experimentalRole":"content"},"suffix":{"type":"string","__experimentalRole":"content"}},"supports":{"html":false,"spacing":{"margin":true,"padding":true},"color":{"background":true,"text":true,"gradients":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalDefaultControls":{"fontSize":true,"lineHeight":true,"fontAppearance":true,"textTransform":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":false},"interactivity":{"clientNavigation":true}},"textdomain":"counting-number-block","editorScript":"file:./index.js","viewScript":"file:./frontend.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),w=[{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0}},save:m},{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0},deprecatedStartVal:{type:"boolean",default:!0}},save:m}];(0,e.registerBlockType)(x,{icon:function(e){return b.createElement("svg",y({width:24,height:24,viewBox:"0 0 20 20"},e),g||(g=b.createElement("rect",{width:20,height:20,fill:"#d20962",ry:2})),f||(f=b.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M13.36 9.098c-1.137 0-1.708-.657-1.762-1.278h1.004c.058.223.343.45.773.45.824 0 1.164-.829 1.133-1.856h-.059c-.148.39-.57.742-1.261.742-.91 0-1.72-.613-1.72-1.758 0-1.148.848-1.836 1.973-1.836 1.09 0 2.063.637 2.063 2.688 0 1.867-.723 2.848-2.145 2.848zm.062-2.735c.504 0 .933-.336.933-.972 0-.633-.398-1.008-.94-1.008-.52 0-.927.375-.927 1 0 .64.418.98.934.98"})),v||(v=b.createElement("path",{fill:"#fff",d:"M14.438 10.668V16H13.39v-4.316h-.051l-1.211.859v-.969l1.262-.906h1.046zM6.5 15.5a.5.5 0 0 1-1 0V5.707L4.354 6.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.5.5 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L6.5 5.707z"})))},example:{attributes:{content:"100"}},edit:function(e){const{attributes:t,attributes:{value:a=1e3,startVal:p=0,duration:d=2,scrollSpyOnce:h,scrollSpyDelay:m=0,textAlign:b,disableGrouping:g=!1,separator:f=",",decimal:v=".",prefix:y="",suffix:x=""},setAttributes:w,isSelected:V,clientId:S}=e;(0,u.useEffect)((()=>(window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.settingsUpdated",{detail:{selector:`#block-${S} .value`}})),()=>{window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.removeCounting",{detail:{selector:`#block-${S} .value`}}))})),[a,p,d,h,m,g,f,v]);const k=s.useBlockEditingMode?(0,s.useBlockEditingMode)():"default",_=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.TextControl,{label:(0,r.__)("The number value","counting-number-block"),value:a,onChange:e=>{w({value:e})},type:"number",step:"any"}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Start counting from value","counting-number-block"),value:p,onChange:e=>w({startVal:e}),type:"number",step:"any"})]}),E=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.TextControl,{label:(0,r.__)("Prefix","counting-number-block"),value:y,onChange:e=>w({prefix:e}),help:(0,r.__)("Display before the number.","counting-number-block")}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Suffix","counting-number-block"),value:x,onChange:e=>w({suffix:e}),help:(0,r.__)("Display after the number.","counting-number-block")})]}),j=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.TextControl,{label:(0,r.__)("Duration (in seconds)","counting-number-block"),value:d,onChange:e=>w({duration:e}),type:"number",step:.5,min:0}),(0,i.jsx)(l.ToggleControl,{label:(0,r.__)("Don't group large number","counting-number-block"),checked:g,onChange:e=>w({disableGrouping:e}),help:(0,r.__)("E.G. 1000 instead of 1,000","counting-number-block")}),!g&&(0,i.jsx)(l.TextControl,{label:(0,r.__)("Grouping separator","counting-number-block"),value:f,onChange:e=>w({separator:e}),help:(0,r.__)("E.G. 1,000 instead of 1000","counting-number-block")}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Decimal separator","counting-number-block"),value:v,onChange:e=>w({decimal:e}),help:(0,r.__)("Default (.)","counting-number-block")}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Delay (in seconds)","counting-number-block"),value:m,onChange:e=>w({scrollSpyDelay:e}),type:"number",step:.1,min:0}),(0,i.jsx)(l.ToggleControl,{label:(0,r.__)("Only run once?","counting-number-block"),checked:h,onChange:e=>w({scrollSpyOnce:e})})]}),C=(0,i.jsxs)(i.Fragment,{children:[_,E]}),F=(0,r.__)("Block settings","counting-number-block");return(0,i.jsxs)(i.Fragment,{children:[V&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.BlockControls,{group:"block",children:[(0,i.jsx)(l.Dropdown,{popoverProps:{position:"bottom right"},contentClassName:"counting-number",renderToggle:({isOpen:e,onToggle:t})=>(0,i.jsx)(l.ToolbarButton,{label:F,onClick:t,"aria-haspopup":"true","aria-expanded":e,icon:o}),renderContent:()=>(0,i.jsx)(i.Fragment,{children:C})}),"default"===k&&(0,i.jsx)(s.AlignmentControl,{value:b,onChange:e=>{w({textAlign:e})}})]}),(0,i.jsx)(s.InspectorControls,{children:(0,i.jsxs)(l.PanelBody,{title:F,children:[_,j,E]})})]}),(0,i.jsxs)("div",{...(0,s.useBlockProps)({className:n({[`has-text-align-${b}`]:b})}),children:[!!y.trim()&&(0,i.jsx)("span",{className:"prefix",children:y}),(0,i.jsx)("span",{className:"value",...c(t),children:a}),!!x.trim()&&(0,i.jsx)("span",{className:"suffix",children:x})]})]})},save:m,deprecated:w})}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,a,i)=>{if(!n){var o=1/0;for(c=0;c<e.length;c++){for(var[n,a,i]=e[c],s=!0,l=0;l<n.length;l++)(!1&i||o>=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,i<o&&(o=i));if(s){e.splice(c--,1);var u=a();void 0!==u&&(t=u)}}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,a,i]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,[o,s,l]=n,u=0;if(o.some((t=>0!==e[t]))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(l)var c=l(r)}for(t&&t(n);u<o.length;u++)i=o[u],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(c)},n=globalThis.webpackChunkcounting_number_block=globalThis.webpackChunkcounting_number_block||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=r.O(void 0,[350],(()=>r(365)));a=r.O(a)})(); -
counting-number-block/tags/1.1.2/counting-number.php
r3437288 r3458851 5 5 * Requires at least: 5.9 6 6 * Requires PHP: 7.0 7 * Version: 1.1. 17 * Version: 1.1.2 8 8 * Author: Phi Phan 9 9 * Author URI: https://boldblocks.net -
counting-number-block/tags/1.1.2/readme.txt
r3437288 r3458851 5 5 Requires at least: 5.9 6 6 Tested up to: 6.9 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 68 68 == Changelog == 69 69 70 = 1.1.2 = 71 *Release Date - 11 February 2026* 72 73 * Fixed - Delay not working 74 * Fixed - Missing default value that caused an invalid content issue 75 * Improved - Upgraded the CountUp script 76 70 77 = 1.1.1 = 71 78 *Release Date - 11 January 2026* -
counting-number-block/trunk/build/block.json
r3109915 r3458851 18 18 "selector": ".wp-block-boldblocks-counting-number > .value", 19 19 "attribute": "data-value", 20 "__experimentalRole": "content" 20 "__experimentalRole": "content", 21 "default": 1000 21 22 }, 22 23 "startVal": { … … 25 26 "selector": ".wp-block-boldblocks-counting-number > .value", 26 27 "attribute": "data-start-val", 27 "__experimentalRole": "content" 28 "__experimentalRole": "content", 29 "default": 0 28 30 }, 29 31 "duration": { -
counting-number-block/trunk/build/frontend.asset.php
r3437288 r3458851 1 <?php return array('dependencies' => array(), 'version' => ' 0a840514dfc88f1f298c');1 <?php return array('dependencies' => array(), 'version' => '265eefd7d118174415ca'); -
counting-number-block/trunk/build/frontend.js
r3437288 r3458851 1 (()=>{"use strict";var t=function(){return t=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++)for(var s in n=arguments[e])Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s]);return t},t.apply(this,arguments)},n=function(){function n(n,e,i){var s=this;this.endVal=e,this.options=i,this.version="2. 8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){s.startTime||(s.startTime=t);var n=t-s.startTime;s.remaining=s.duration-n,s.useEasing?s.countDown?s.frameVal=s.startVal-s.easingFn(n,0,s.startVal-s.endVal,s.duration):s.frameVal=s.easingFn(n,s.startVal,s.endVal-s.startVal,s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(n/s.duration);var e=s.countDown?s.frameVal<s.endVal:s.frameVal>s.endVal;s.frameVal=e?s.endVal:s.frameVal,s.frameVal=Number(s.frameVal.toFixed(s.options.decimalPlaces)),s.printValue(s.frameVal),n<s.duration?s.rAF=requestAnimationFrame(s.count):null!==s.finalEndVal?s.update(s.finalEndVal):s.options.onCompleteCallback&&s.options.onCompleteCallback()},this.formatNumber=function(t){var n,e,i,a,o=t<0?"-":"";n=Math.abs(t).toFixed(s.options.decimalPlaces);var r=(n+="").split(".");if(e=r[0],i=r.length>1?s.options.decimal+r[1]:"",s.options.useGrouping){a="";for(var l=3,u=0,h=0,c=e.length;h<c;++h)s.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=s.options.separator+a),u++,a=e[c-h-1]+a;e=a}return s.options.numerals&&s.options.numerals.length&&(e=e.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]})),i=i.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]}))),o+s.options.prefix+e+i+s.options.suffix},this.easeOutExpo=function(t,n,e,i){return e*(1-Math.pow(2,-10*t/i))*1024/1023+n},this.options=t(t({},this.defaults),i),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof n?document.getElementById(n):n,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,n):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return s.handleScroll(s)})),window.onscroll=function(){window.onScrollFns.forEach((function(t){return t()}))},this.handleScroll(this)))}return n.prototype.handleScroll=function(t){if(t&&window&&!t.once){var n=window.innerHeight+window.scrollY,e=t.el.getBoundingClientRect(),i=e.top+window.pageYOffset,s=e.top+e.height+window.pageYOffset;s<n&&s>window.scrollY&&t.paused?(t.paused=!1,setTimeout((function(){return t.start()}),t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>s||i>n)&&!t.paused&&t.reset()}},n.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var n=t-this.startVal;if(Math.abs(n)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var e=this.countDown?1:-1;this.endVal=t+e*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},n.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},n.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},n.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(t){var n;if(this.el){var e=this.formattingFn(t);(null===(n=this.options.plugin)||void 0===n?void 0:n.render)?this.options.plugin.render(this.el,e):"INPUT"===this.el.tagName?this.el.value=e:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=e:this.el.innerHTML=e}},n.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},n.prototype.validateValue=function(t){var n=Number(t);return this.ensureNumber(n)?n:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},n.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},n}();const e=(t,n)=>{t.forEach((t=>{const{observer:e,counter:i,data:s,element:a}=null!=t?t:{};e&&i&&(n?(i.printValue(s?.value),e.unobserve(a)):e.observe(a))}))};var i;i=()=>{const t=document.querySelectorAll(".wp-block-boldblocks-counting-number .value");if(t.length){const i=[];t.forEach((t=>{const e=(t=>{const e=t.dataset,i=Object.keys(e).reduce(((t,n)=>{let i=e[n];if("value"===n){if(!isNaN(parseFloat(i))){let n=0;const e=".";(i+"").indexOf(e)>=0&&(n=(i+"").split(e)[1].length),t.value=i,t.decimalPlaces=n}}else["startVal","duration","scrollSpyDelay"].includes(n)?(i=parseFloat(i),isNaN(i)||("scrollSpyDelay"===n&&(i*=1e3),t[n]=i)):["enableScrollSpy","scrollSpyOnce"].includes(n)?t[n]="true"===i:"disableGrouping"===n?t.useGrouping="true"!==i:["separator","decimal"].includes(n)&&(t[n]=i);return t}),{});if(i?.value){const e=new n(t,i.value,{...i,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),s="is-number-animating",a=new IntersectionObserver((([n])=>{if(n.intersectionRatio>0){const o=n.target.closest(".wp-block-boldblocks-counting-number");o&&!o.classList.contains(s)&&o.classList.add(s),e.reset(),e.start((()=>{o&&o.classList.contains(s)&&o.classList.remove(s)})),i?.scrollSpyOnce&&a.unobserve(t)}}),{threshold:[0]});return a.observe(t),{observer:a,element:t,data:i,counter:e}}})(t);e&&i.push(e)}));const s=window.matchMedia("(prefers-reduced-motion: reduce)");e(i,s.matches),s.addEventListener("change",(()=>{e(i,s.matches)}))}},"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)})();1 (()=>{"use strict";var t=function(){return t=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++)for(var s in n=arguments[e])Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s]);return t},t.apply(this,arguments)},n=function(){function n(n,e,i){var s=this;this.endVal=e,this.options=i,this.version="2.9.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){s.startTime||(s.startTime=t);var n=t-s.startTime;s.remaining=s.duration-n,s.useEasing?s.countDown?s.frameVal=s.startVal-s.easingFn(n,0,s.startVal-s.endVal,s.duration):s.frameVal=s.easingFn(n,s.startVal,s.endVal-s.startVal,s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(n/s.duration);var e=s.countDown?s.frameVal<s.endVal:s.frameVal>s.endVal;s.frameVal=e?s.endVal:s.frameVal,s.frameVal=Number(s.frameVal.toFixed(s.options.decimalPlaces)),s.printValue(s.frameVal),n<s.duration?s.rAF=requestAnimationFrame(s.count):null!==s.finalEndVal?s.update(s.finalEndVal):s.options.onCompleteCallback&&s.options.onCompleteCallback()},this.formatNumber=function(t){var n,e,i,a,o=t<0?"-":"";n=Math.abs(t).toFixed(s.options.decimalPlaces);var r=(n+="").split(".");if(e=r[0],i=r.length>1?s.options.decimal+r[1]:"",s.options.useGrouping){a="";for(var l=3,u=0,h=0,p=e.length;h<p;++h)s.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=s.options.separator+a),u++,a=e[p-h-1]+a;e=a}return s.options.numerals&&s.options.numerals.length&&(e=e.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]})),i=i.replace(/[0-9]/g,(function(t){return s.options.numerals[+t]}))),o+s.options.prefix+e+i+s.options.suffix},this.easeOutExpo=function(t,n,e,i){return e*(1-Math.pow(2,-10*t/i))*1024/1023+n},this.options=t(t({},this.defaults),i),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el="string"==typeof n?document.getElementById(n):n,e=null==e?this.parse(this.el.innerHTML):e,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,n):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return s.handleScroll(s)})),window.onscroll=function(){window.onScrollFns.forEach((function(t){return t()}))},this.handleScroll(this)))}return n.prototype.handleScroll=function(t){if(t&&window&&!t.once){var n=window.innerHeight+window.scrollY,e=t.el.getBoundingClientRect(),i=e.top+window.pageYOffset,s=e.top+e.height+window.pageYOffset;s<n&&s>window.scrollY&&t.paused?(t.paused=!1,setTimeout((function(){return t.start()}),t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>s||i>n)&&!t.paused&&t.reset()}},n.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var n=t-this.startVal;if(Math.abs(n)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var e=this.countDown?1:-1;this.endVal=t+e*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},n.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},n.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},n.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(t){var n;if(this.el){var e=this.formattingFn(t);(null===(n=this.options.plugin)||void 0===n?void 0:n.render)?this.options.plugin.render(this.el,e):"INPUT"===this.el.tagName?this.el.value=e:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=e:this.el.innerHTML=e}},n.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},n.prototype.validateValue=function(t){var n=Number(t);return this.ensureNumber(n)?n:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},n.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},n.prototype.parse=function(t){var n=function(t){return t.replace(/([.,' ])/g,"\\$1")},e=n(this.options.separator),i=n(this.options.decimal),s=t.replace(new RegExp(e,"g"),"").replace(new RegExp(i,"g"),".");return parseFloat(s)},n}();const e=(t,n)=>{t.forEach((t=>{const{observer:e,counter:i,data:s,element:a}=null!=t?t:{};e&&i&&(n?(i.printValue(s?.value),e.unobserve(a)):e.observe(a))}))};var i;i=()=>{const t=document.querySelectorAll(".wp-block-boldblocks-counting-number .value");if(t.length){const i=[];t.forEach((t=>{const e=(t=>{var e;const i=(t=>{const n={},{value:e,startVal:i,duration:s,scrollSpyDelay:a,enableScrollSpy:o,scrollSpyOnce:r,disableGrouping:l,separator:u,decimal:h}=t;if(!e)return null;const p=parseFloat(e);if(isNaN(p))return null;const c=(e.split(".")[1]||"").length;n.value=p,n.decimalPlaces=c;const d=parseFloat(i);isNaN(d)||(n.startVal=d);const m=parseFloat(s);isNaN(m)||(n.duration=m);const f=parseFloat(a);return isNaN(f)||(n.scrollSpyDelay=1e3*f),void 0!==o&&(n.enableScrollSpy="true"===o),void 0!==r&&(n.scrollSpyOnce="true"===r),void 0!==l&&(n.useGrouping="true"!==l),u&&(n.separator=u),h&&(n.decimal=h),n})(t.dataset);if(!i)return;const s=null!==(e=i.scrollSpyDelay)&&void 0!==e?e:0,a=new n(t,i.value,{...i,scrollSpyDelay:0,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),o="is-number-animating",r=new IntersectionObserver((([t])=>{if(!t.isIntersecting)return;const n=t.target.closest(".wp-block-boldblocks-counting-number");a.reset(),setTimeout((()=>{n?.classList.add(o),a.start((()=>{n?.classList.remove(o)}))}),s),i.scrollSpyOnce&&r.unobserve(t.target)}),{threshold:0});return r.observe(t),{observer:r,element:t,data:i,counter:a}})(t);e&&i.push(e)}));const s=window.matchMedia("(prefers-reduced-motion: reduce)");e(i,s.matches),s.addEventListener("change",(()=>{e(i,s.matches)}))}},"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)})(); -
counting-number-block/trunk/build/index.asset.php
r3437288 r3458851 1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 08e6ec6b2a0648532d7c');1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7421ae9cc182c5d60c40'); -
counting-number-block/trunk/build/index.js
r3437288 r3458851 1 (()=>{"use strict";var e,t={365(){const e=window.wp.blocks;function t(e){var n, a,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(a=t(e[n]))&&(i&&(i+=" "),i+=a)}else for(a in e)e[a]&&(i&&(i+=" "),i+=a);return i}const n=function(){for(var e,n,a=0,i="",r=arguments.length;a<r;a++)(e=arguments[a])&&(n=t(e))&&(i&&(i+=" "),i+=n);return i},a=window.wp.i18n,i=window.wp.primitives,r=window.ReactJSXRuntime,o=(0,r.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,r.jsx)(i.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,r.jsx)(i.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),s=window.wp.blockEditor,l=window.wp.components,u=window.wp.element,c=e=>{const{value:t=1e3,startVal:n=0,duration:a=2,separator:i=",",decimal:r=".",enableScrollSpy:o=!0,scrollSpyOnce:s,scrollSpyDelay:l=0,disableGrouping:u=!1,prefix:c="",suffix:p=""}=e,d={value:t,startVal:n,duration:a,separator:i,decimal:r,enableScrollSpy:o,scrollSpyOnce:s,scrollSpyDelay:l,disableGrouping:u,prefix:c,suffix:p};return Object.keys(d).reduce(((e,t)=>{let n=t;return"startVal"===t?n="start-val":"enableScrollSpy"===t?n="enable-scroll-spy":"scrollSpyOnce"===t?n="scroll-spy-once":"scrollSpyDelay"===t&&(n="scroll-spy-delay"),"disableGrouping"===t?d[t]&&(e["data-disable-grouping"]=d[t]):e[`data-${n}`]=d[t],e}),{})},p=({deprecatedStartVal:e,startVal:t})=>e?"":t;var d=function(){return d=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},d.apply(this,arguments)},h=function(){function e(e,t,n){var a=this;this.endVal=t,this.options=n,this.version="2.8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(e){a.startTime||(a.startTime=e);var t=e-a.startTime;a.remaining=a.duration-t,a.useEasing?a.countDown?a.frameVal=a.startVal-a.easingFn(t,0,a.startVal-a.endVal,a.duration):a.frameVal=a.easingFn(t,a.startVal,a.endVal-a.startVal,a.duration):a.frameVal=a.startVal+(a.endVal-a.startVal)*(t/a.duration);var n=a.countDown?a.frameVal<a.endVal:a.frameVal>a.endVal;a.frameVal=n?a.endVal:a.frameVal,a.frameVal=Number(a.frameVal.toFixed(a.options.decimalPlaces)),a.printValue(a.frameVal),t<a.duration?a.rAF=requestAnimationFrame(a.count):null!==a.finalEndVal?a.update(a.finalEndVal):a.options.onCompleteCallback&&a.options.onCompleteCallback()},this.formatNumber=function(e){var t,n,i,r,o=e<0?"-":"";t=Math.abs(e).toFixed(a.options.decimalPlaces);var s=(t+="").split(".");if(n=s[0],i=s.length>1?a.options.decimal+s[1]:"",a.options.useGrouping){r="";for(var l=3,u=0,c=0,p=n.length;c<p;++c)a.options.useIndianSeparators&&4===c&&(l=2,u=1),0!==c&&u%l==0&&(r=a.options.separator+r),u++,r=n[p-c-1]+r;n=r}return a.options.numerals&&a.options.numerals.length&&(n=n.replace(/[0-9]/g,(function(e){return a.options.numerals[+e]})),i=i.replace(/[0-9]/g,(function(e){return a.options.numerals[+e]}))),o+a.options.prefix+n+i+a.options.suffix},this.easeOutExpo=function(e,t,n,a){return n*(1-Math.pow(2,-10*e/a))*1024/1023+t},this.options=d(d({},this.defaults),n),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(t),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof e?document.getElementById(e):e,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,e):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return a.handleScroll(a)})),window.onscroll=function(){window.onScrollFns.forEach((function(e){return e()}))},this.handleScroll(this)))}return e.prototype.handleScroll=function(e){if(e&&window&&!e.once){var t=window.innerHeight+window.scrollY,n=e.el.getBoundingClientRect(),a=n.top+window.pageYOffset,i=n.top+n.height+window.pageYOffset;i<t&&i>window.scrollY&&e.paused?(e.paused=!1,setTimeout((function(){return e.start()}),e.options.scrollSpyDelay),e.options.scrollSpyOnce&&(e.once=!0)):(window.scrollY>i||a>t)&&!e.paused&&e.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var e=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>e;var t=e-this.startVal;if(Math.abs(t)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=e;var n=this.countDown?1:-1;this.endVal=e+n*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=e,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(e){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),e&&(this.options.onCompleteCallback=e),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(e){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(e),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(e){var t;if(this.el){var n=this.formattingFn(e);(null===(t=this.options.plugin)||void 0===t?void 0:t.render)?this.options.plugin.render(this.el,n):"INPUT"===this.el.tagName?this.el.value=n:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n:this.el.innerHTML=n}},e.prototype.ensureNumber=function(e){return"number"==typeof e&&!isNaN(e)},e.prototype.validateValue=function(e){var t=Number(e);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: ".concat(e),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e}();function m(e){const{attributes:t,attributes:{value:a,textAlign:i,prefix:o="",suffix:l=""}}=e;let u=c(t),d=(0,r.jsx)("span",{className:"sr-value",children:a});return u={...u,"aria-hidden":"true"},t?.deprecatedAccessibility&&(delete u["aria-hidden"],d=null),(0,r.jsxs)("div",{...s.useBlockProps.save({className:n({[`has-text-align-${i}`]:i})}),children:[!!o.trim()&&(0,r.jsx)("span",{className:"prefix",children:o}),(0,r.jsx)("span",{className:"value",...u,children:p(t)}),d,!!l.trim()&&(0,r.jsx)("span",{className:"suffix",children:l})]})}window.addEventListener("boldblocks.countingNumber.settingsUpdated",(({detail:{selector:e}={}})=>{const t=(window.countingManager||(window.countingManager={}),window.countingManager);if(t[e]){var n;const{observer:a,element:i}=null!==(n=t[e])&&void 0!==n?n:{};a&&i&&a.unobserve(i)}let a=document.querySelector(e);if(!a){const t=document.querySelector('iframe[name="editor-canvas"]');t&&(a=t.contentWindow.document.querySelector(e))}a&&(t[e]=(e=>{const t=e.dataset,n=Object.keys(t).reduce(((e,n)=>{let a=t[n];if("value"===n){if(!isNaN(parseFloat(a))){let t=0;const n=".";(a+"").indexOf(n)>=0&&(t=(a+"").split(n)[1].length),e.value=a,e.decimalPlaces=t}}else["startVal","duration","scrollSpyDelay"].includes(n)?(a=parseFloat(a),isNaN(a)||("scrollSpyDelay"===n&&(a*=1e3),e[n]=a)):["enableScrollSpy","scrollSpyOnce"].includes(n)?e[n]="true"===a:"disableGrouping"===n?e.useGrouping="true"!==a:["separator","decimal"].includes(n)&&(e[n]=a);return e}),{});if(n?.value){const t=new h(e,n.value,{...n,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),a="is-number-animating",i=new IntersectionObserver((([r])=>{if(r.intersectionRatio>0){const o=r.target.closest(".wp-block-boldblocks-counting-number");o&&!o.classList.contains(a)&&o.classList.add(a),t.reset(),t.start((()=>{o&&o.classList.contains(a)&&o.classList.remove(a)})),n?.scrollSpyOnce&&i.unobserve(e)}}),{threshold:[0]});return i.observe(e),{observer:i,element:e,data:n,counter:t}}})(a))}));const b=window.React;var f,g,v;function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},y.apply(null,arguments)}const x=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"boldblocks/counting-number","title":"Counting number block","category":"design","description":"This block provides an animated counter effect for numbers.","keywords":["number","counting","counter","animation"],"attributes":{"value":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-value","__experimentalRole":"content"},"startVal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-start-val","__experimentalRole":"content"},"duration":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-duration","default":2},"enableScrollSpy":{"type":"boolean","default":true},"scrollSpyOnce":{"type":"boolean","default":true},"scrollSpyDelay":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-scroll-spy-delay","default":0},"disableGrouping":{"type":"boolean","default":false},"separator":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-separator","default":","},"decimal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-decimal","default":"."},"prefix":{"type":"string","__experimentalRole":"content"},"suffix":{"type":"string","__experimentalRole":"content"}},"supports":{"html":false,"spacing":{"margin":true,"padding":true},"color":{"background":true,"text":true,"gradients":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalDefaultControls":{"fontSize":true,"lineHeight":true,"fontAppearance":true,"textTransform":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":false},"interactivity":{"clientNavigation":true}},"textdomain":"counting-number-block","editorScript":"file:./index.js","viewScript":"file:./frontend.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),w=[{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0}},save:m},{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0},deprecatedStartVal:{type:"boolean",default:!0}},save:m}];(0,e.registerBlockType)(x,{icon:function(e){return b.createElement("svg",y({width:24,height:24,viewBox:"0 0 20 20"},e),f||(f=b.createElement("rect",{width:20,height:20,fill:"#d20962",ry:2})),g||(g=b.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M13.36 9.098c-1.137 0-1.708-.657-1.762-1.278h1.004c.058.223.343.45.773.45.824 0 1.164-.829 1.133-1.856h-.059c-.148.39-.57.742-1.261.742-.91 0-1.72-.613-1.72-1.758 0-1.148.848-1.836 1.973-1.836 1.09 0 2.063.637 2.063 2.688 0 1.867-.723 2.848-2.145 2.848zm.062-2.735c.504 0 .933-.336.933-.972 0-.633-.398-1.008-.94-1.008-.52 0-.927.375-.927 1 0 .64.418.98.934.98"})),v||(v=b.createElement("path",{fill:"#fff",d:"M14.438 10.668V16H13.39v-4.316h-.051l-1.211.859v-.969l1.262-.906h1.046zM6.5 15.5a.5.5 0 0 1-1 0V5.707L4.354 6.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.5.5 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L6.5 5.707z"})))},example:{attributes:{content:"100"}},edit:function(e){const{attributes:t,attributes:{value:i=1e3,startVal:p=0,duration:d=2,scrollSpyOnce:h,scrollSpyDelay:m=0,textAlign:b,disableGrouping:f=!1,separator:g=",",decimal:v=".",prefix:y="",suffix:x=""},setAttributes:w,isSelected:V,clientId:S}=e;(0,u.useEffect)((()=>(window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.settingsUpdated",{detail:{selector:`#block-${S} .value`}})),()=>{window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.removeCounting",{detail:{selector:`#block-${S} .value`}}))})),[i,p,d,h,m,f,g,v]);const k=s.useBlockEditingMode?(0,s.useBlockEditingMode)():"default",_=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.TextControl,{label:(0,a.__)("The number value","counting-number-block"),value:i,onChange:e=>{w({value:e})},type:"number",step:"any"}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Start counting from value","counting-number-block"),value:p,onChange:e=>w({startVal:e}),type:"number",step:"any"})]}),j=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.TextControl,{label:(0,a.__)("Prefix","counting-number-block"),value:y,onChange:e=>w({prefix:e}),help:(0,a.__)("Display before the number.","counting-number-block")}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Suffix","counting-number-block"),value:x,onChange:e=>w({suffix:e}),help:(0,a.__)("Display after the number.","counting-number-block")})]}),E=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.TextControl,{label:(0,a.__)("Duration (in seconds)","counting-number-block"),value:d,onChange:e=>w({duration:e}),type:"number",step:.5,min:0}),(0,r.jsx)(l.ToggleControl,{label:(0,a.__)("Don't group large number","counting-number-block"),checked:f,onChange:e=>w({disableGrouping:e}),help:(0,a.__)("E.G. 1000 instead of 1,000","counting-number-block")}),!f&&(0,r.jsx)(l.TextControl,{label:(0,a.__)("Grouping separator","counting-number-block"),value:g,onChange:e=>w({separator:e}),help:(0,a.__)("E.G. 1,000 instead of 1000","counting-number-block")}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Decimal separator","counting-number-block"),value:v,onChange:e=>w({decimal:e}),help:(0,a.__)("Default (.)","counting-number-block")}),(0,r.jsx)(l.TextControl,{label:(0,a.__)("Delay (in seconds)","counting-number-block"),value:m,onChange:e=>w({scrollSpyDelay:e}),type:"number",step:.1,min:0}),(0,r.jsx)(l.ToggleControl,{label:(0,a.__)("Only run once?","counting-number-block"),checked:h,onChange:e=>w({scrollSpyOnce:e})})]}),C=(0,r.jsxs)(r.Fragment,{children:[_,j]}),F=(0,a.__)("Block settings","counting-number-block");return(0,r.jsxs)(r.Fragment,{children:[V&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.BlockControls,{group:"block",children:[(0,r.jsx)(l.Dropdown,{popoverProps:{position:"bottom right"},contentClassName:"counting-number",renderToggle:({isOpen:e,onToggle:t})=>(0,r.jsx)(l.ToolbarButton,{label:F,onClick:t,"aria-haspopup":"true","aria-expanded":e,icon:o}),renderContent:()=>(0,r.jsx)(r.Fragment,{children:C})}),"default"===k&&(0,r.jsx)(s.AlignmentControl,{value:b,onChange:e=>{w({textAlign:e})}})]}),(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(l.PanelBody,{title:F,children:[_,E,j]})})]}),(0,r.jsxs)("div",{...(0,s.useBlockProps)({className:n({[`has-text-align-${b}`]:b})}),children:[!!y.trim()&&(0,r.jsx)("span",{className:"prefix",children:y}),(0,r.jsx)("span",{className:"value",...c(t),children:i}),!!x.trim()&&(0,r.jsx)("span",{className:"suffix",children:x})]})]})},save:m,deprecated:w})}},n={};function a(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,a),r.exports}a.m=t,e=[],a.O=(t,n,i,r)=>{if(!n){var o=1/0;for(c=0;c<e.length;c++){for(var[n,i,r]=e[c],s=!0,l=0;l<n.length;l++)(!1&r||o>=r)&&Object.keys(a.O).every((e=>a.O[e](n[l])))?n.splice(l--,1):(s=!1,r<o&&(o=r));if(s){e.splice(c--,1);var u=i();void 0!==u&&(t=u)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,i,r]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[o,s,l]=n,u=0;if(o.some((t=>0!==e[t]))){for(i in s)a.o(s,i)&&(a.m[i]=s[i]);if(l)var c=l(a)}for(t&&t(n);u<o.length;u++)r=o[u],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(c)},n=globalThis.webpackChunkcounting_number_block=globalThis.webpackChunkcounting_number_block||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[350],(()=>a(365)));i=a.O(i)})();1 (()=>{"use strict";var e,t={365(){const e=window.wp.blocks;function t(e){var n,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(r=t(e[n]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}const n=function(){for(var e,n,r=0,a="",i=arguments.length;r<i;r++)(e=arguments[r])&&(n=t(e))&&(a&&(a+=" "),a+=n);return a},r=window.wp.i18n,a=window.wp.primitives,i=window.ReactJSXRuntime,o=(0,i.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,i.jsx)(a.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,i.jsx)(a.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),s=window.wp.blockEditor,l=window.wp.components,u=window.wp.element,c=e=>{const{value:t=1e3,startVal:n=0,duration:r=2,separator:a=",",decimal:i=".",enableScrollSpy:o=!0,scrollSpyOnce:s,scrollSpyDelay:l=0,disableGrouping:u=!1,prefix:c="",suffix:p=""}=e,d={value:t,startVal:n,duration:r,separator:a,decimal:i,enableScrollSpy:o,scrollSpyOnce:s,scrollSpyDelay:l,disableGrouping:u,prefix:c,suffix:p};return Object.keys(d).reduce(((e,t)=>{let n=t;return"startVal"===t?n="start-val":"enableScrollSpy"===t?n="enable-scroll-spy":"scrollSpyOnce"===t?n="scroll-spy-once":"scrollSpyDelay"===t&&(n="scroll-spy-delay"),"disableGrouping"===t?d[t]&&(e["data-disable-grouping"]=d[t]):e[`data-${n}`]=d[t],e}),{})},p=({deprecatedStartVal:e,startVal:t})=>e?"":t;var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},d.apply(this,arguments)},h=function(){function e(e,t,n){var r=this;this.endVal=t,this.options=n,this.version="2.9.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(e){r.startTime||(r.startTime=e);var t=e-r.startTime;r.remaining=r.duration-t,r.useEasing?r.countDown?r.frameVal=r.startVal-r.easingFn(t,0,r.startVal-r.endVal,r.duration):r.frameVal=r.easingFn(t,r.startVal,r.endVal-r.startVal,r.duration):r.frameVal=r.startVal+(r.endVal-r.startVal)*(t/r.duration);var n=r.countDown?r.frameVal<r.endVal:r.frameVal>r.endVal;r.frameVal=n?r.endVal:r.frameVal,r.frameVal=Number(r.frameVal.toFixed(r.options.decimalPlaces)),r.printValue(r.frameVal),t<r.duration?r.rAF=requestAnimationFrame(r.count):null!==r.finalEndVal?r.update(r.finalEndVal):r.options.onCompleteCallback&&r.options.onCompleteCallback()},this.formatNumber=function(e){var t,n,a,i,o=e<0?"-":"";t=Math.abs(e).toFixed(r.options.decimalPlaces);var s=(t+="").split(".");if(n=s[0],a=s.length>1?r.options.decimal+s[1]:"",r.options.useGrouping){i="";for(var l=3,u=0,c=0,p=n.length;c<p;++c)r.options.useIndianSeparators&&4===c&&(l=2,u=1),0!==c&&u%l==0&&(i=r.options.separator+i),u++,i=n[p-c-1]+i;n=i}return r.options.numerals&&r.options.numerals.length&&(n=n.replace(/[0-9]/g,(function(e){return r.options.numerals[+e]})),a=a.replace(/[0-9]/g,(function(e){return r.options.numerals[+e]}))),o+r.options.prefix+n+a+r.options.suffix},this.easeOutExpo=function(e,t,n,r){return n*(1-Math.pow(2,-10*e/r))*1024/1023+t},this.options=d(d({},this.defaults),n),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el="string"==typeof e?document.getElementById(e):e,t=null==t?this.parse(this.el.innerHTML):t,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(t),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,e):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return r.handleScroll(r)})),window.onscroll=function(){window.onScrollFns.forEach((function(e){return e()}))},this.handleScroll(this)))}return e.prototype.handleScroll=function(e){if(e&&window&&!e.once){var t=window.innerHeight+window.scrollY,n=e.el.getBoundingClientRect(),r=n.top+window.pageYOffset,a=n.top+n.height+window.pageYOffset;a<t&&a>window.scrollY&&e.paused?(e.paused=!1,setTimeout((function(){return e.start()}),e.options.scrollSpyDelay),e.options.scrollSpyOnce&&(e.once=!0)):(window.scrollY>a||r>t)&&!e.paused&&e.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var e=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>e;var t=e-this.startVal;if(Math.abs(t)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=e;var n=this.countDown?1:-1;this.endVal=e+n*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=e,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(e){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),e&&(this.options.onCompleteCallback=e),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(e){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(e),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(e){var t;if(this.el){var n=this.formattingFn(e);(null===(t=this.options.plugin)||void 0===t?void 0:t.render)?this.options.plugin.render(this.el,n):"INPUT"===this.el.tagName?this.el.value=n:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n:this.el.innerHTML=n}},e.prototype.ensureNumber=function(e){return"number"==typeof e&&!isNaN(e)},e.prototype.validateValue=function(e){var t=Number(e);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: ".concat(e),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e.prototype.parse=function(e){var t=function(e){return e.replace(/([.,' ])/g,"\\$1")},n=t(this.options.separator),r=t(this.options.decimal),a=e.replace(new RegExp(n,"g"),"").replace(new RegExp(r,"g"),".");return parseFloat(a)},e}();function m(e){const{attributes:t,attributes:{value:r,textAlign:a,prefix:o="",suffix:l=""}}=e;let u=c(t),d=(0,i.jsx)("span",{className:"sr-value",children:r});return u={...u,"aria-hidden":"true"},t?.deprecatedAccessibility&&(delete u["aria-hidden"],d=null),(0,i.jsxs)("div",{...s.useBlockProps.save({className:n({[`has-text-align-${a}`]:a})}),children:[!!o.trim()&&(0,i.jsx)("span",{className:"prefix",children:o}),(0,i.jsx)("span",{className:"value",...u,children:p(t)}),d,!!l.trim()&&(0,i.jsx)("span",{className:"suffix",children:l})]})}window.addEventListener("boldblocks.countingNumber.settingsUpdated",(({detail:{selector:e}={}})=>{const t=(window.countingManager||(window.countingManager={}),window.countingManager);if(t[e]){var n;const{observer:r,element:a}=null!==(n=t[e])&&void 0!==n?n:{};r&&a&&r.unobserve(a)}let r=document.querySelector(e);if(!r){const t=document.querySelector('iframe[name="editor-canvas"]');t&&(r=t.contentWindow.document.querySelector(e))}r&&(t[e]=(e=>{var t;const n=(e=>{const t={},{value:n,startVal:r,duration:a,scrollSpyDelay:i,enableScrollSpy:o,scrollSpyOnce:s,disableGrouping:l,separator:u,decimal:c}=e;if(!n)return null;const p=parseFloat(n);if(isNaN(p))return null;const d=(n.split(".")[1]||"").length;t.value=p,t.decimalPlaces=d;const h=parseFloat(r);isNaN(h)||(t.startVal=h);const m=parseFloat(a);isNaN(m)||(t.duration=m);const b=parseFloat(i);return isNaN(b)||(t.scrollSpyDelay=1e3*b),void 0!==o&&(t.enableScrollSpy="true"===o),void 0!==s&&(t.scrollSpyOnce="true"===s),void 0!==l&&(t.useGrouping="true"!==l),u&&(t.separator=u),c&&(t.decimal=c),t})(e.dataset);if(!n)return;const r=null!==(t=n.scrollSpyDelay)&&void 0!==t?t:0,a=new h(e,n.value,{...n,scrollSpyDelay:0,enableScrollSpy:!1,scrollSpyOnce:!0,useEasing:!0}),i="is-number-animating",o=new IntersectionObserver((([e])=>{if(!e.isIntersecting)return;const t=e.target.closest(".wp-block-boldblocks-counting-number");a.reset(),setTimeout((()=>{t?.classList.add(i),a.start((()=>{t?.classList.remove(i)}))}),r),n.scrollSpyOnce&&o.unobserve(e.target)}),{threshold:0});return o.observe(e),{observer:o,element:e,data:n,counter:a}})(r))}));const b=window.React;var g,f,v;function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(null,arguments)}const x=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"boldblocks/counting-number","title":"Counting number block","category":"design","description":"This block provides an animated counter effect for numbers.","keywords":["number","counting","counter","animation"],"attributes":{"value":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-value","__experimentalRole":"content","default":1000},"startVal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-start-val","__experimentalRole":"content","default":0},"duration":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-duration","default":2},"enableScrollSpy":{"type":"boolean","default":true},"scrollSpyOnce":{"type":"boolean","default":true},"scrollSpyDelay":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-scroll-spy-delay","default":0},"disableGrouping":{"type":"boolean","default":false},"separator":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-separator","default":","},"decimal":{"type":"string","source":"attribute","selector":".wp-block-boldblocks-counting-number > .value","attribute":"data-decimal","default":"."},"prefix":{"type":"string","__experimentalRole":"content"},"suffix":{"type":"string","__experimentalRole":"content"}},"supports":{"html":false,"spacing":{"margin":true,"padding":true},"color":{"background":true,"text":true,"gradients":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalDefaultControls":{"fontSize":true,"lineHeight":true,"fontAppearance":true,"textTransform":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":false},"interactivity":{"clientNavigation":true}},"textdomain":"counting-number-block","editorScript":"file:./index.js","viewScript":"file:./frontend.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),w=[{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0}},save:m},{supports:x.supports,attributes:{...x.attributes,deprecatedAccessibility:{type:"boolean",default:!0},deprecatedStartVal:{type:"boolean",default:!0}},save:m}];(0,e.registerBlockType)(x,{icon:function(e){return b.createElement("svg",y({width:24,height:24,viewBox:"0 0 20 20"},e),g||(g=b.createElement("rect",{width:20,height:20,fill:"#d20962",ry:2})),f||(f=b.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M13.36 9.098c-1.137 0-1.708-.657-1.762-1.278h1.004c.058.223.343.45.773.45.824 0 1.164-.829 1.133-1.856h-.059c-.148.39-.57.742-1.261.742-.91 0-1.72-.613-1.72-1.758 0-1.148.848-1.836 1.973-1.836 1.09 0 2.063.637 2.063 2.688 0 1.867-.723 2.848-2.145 2.848zm.062-2.735c.504 0 .933-.336.933-.972 0-.633-.398-1.008-.94-1.008-.52 0-.927.375-.927 1 0 .64.418.98.934.98"})),v||(v=b.createElement("path",{fill:"#fff",d:"M14.438 10.668V16H13.39v-4.316h-.051l-1.211.859v-.969l1.262-.906h1.046zM6.5 15.5a.5.5 0 0 1-1 0V5.707L4.354 6.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.5.5 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L6.5 5.707z"})))},example:{attributes:{content:"100"}},edit:function(e){const{attributes:t,attributes:{value:a=1e3,startVal:p=0,duration:d=2,scrollSpyOnce:h,scrollSpyDelay:m=0,textAlign:b,disableGrouping:g=!1,separator:f=",",decimal:v=".",prefix:y="",suffix:x=""},setAttributes:w,isSelected:V,clientId:S}=e;(0,u.useEffect)((()=>(window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.settingsUpdated",{detail:{selector:`#block-${S} .value`}})),()=>{window.dispatchEvent(new CustomEvent("boldblocks.countingNumber.removeCounting",{detail:{selector:`#block-${S} .value`}}))})),[a,p,d,h,m,g,f,v]);const k=s.useBlockEditingMode?(0,s.useBlockEditingMode)():"default",_=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.TextControl,{label:(0,r.__)("The number value","counting-number-block"),value:a,onChange:e=>{w({value:e})},type:"number",step:"any"}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Start counting from value","counting-number-block"),value:p,onChange:e=>w({startVal:e}),type:"number",step:"any"})]}),E=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.TextControl,{label:(0,r.__)("Prefix","counting-number-block"),value:y,onChange:e=>w({prefix:e}),help:(0,r.__)("Display before the number.","counting-number-block")}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Suffix","counting-number-block"),value:x,onChange:e=>w({suffix:e}),help:(0,r.__)("Display after the number.","counting-number-block")})]}),j=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.TextControl,{label:(0,r.__)("Duration (in seconds)","counting-number-block"),value:d,onChange:e=>w({duration:e}),type:"number",step:.5,min:0}),(0,i.jsx)(l.ToggleControl,{label:(0,r.__)("Don't group large number","counting-number-block"),checked:g,onChange:e=>w({disableGrouping:e}),help:(0,r.__)("E.G. 1000 instead of 1,000","counting-number-block")}),!g&&(0,i.jsx)(l.TextControl,{label:(0,r.__)("Grouping separator","counting-number-block"),value:f,onChange:e=>w({separator:e}),help:(0,r.__)("E.G. 1,000 instead of 1000","counting-number-block")}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Decimal separator","counting-number-block"),value:v,onChange:e=>w({decimal:e}),help:(0,r.__)("Default (.)","counting-number-block")}),(0,i.jsx)(l.TextControl,{label:(0,r.__)("Delay (in seconds)","counting-number-block"),value:m,onChange:e=>w({scrollSpyDelay:e}),type:"number",step:.1,min:0}),(0,i.jsx)(l.ToggleControl,{label:(0,r.__)("Only run once?","counting-number-block"),checked:h,onChange:e=>w({scrollSpyOnce:e})})]}),C=(0,i.jsxs)(i.Fragment,{children:[_,E]}),F=(0,r.__)("Block settings","counting-number-block");return(0,i.jsxs)(i.Fragment,{children:[V&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.BlockControls,{group:"block",children:[(0,i.jsx)(l.Dropdown,{popoverProps:{position:"bottom right"},contentClassName:"counting-number",renderToggle:({isOpen:e,onToggle:t})=>(0,i.jsx)(l.ToolbarButton,{label:F,onClick:t,"aria-haspopup":"true","aria-expanded":e,icon:o}),renderContent:()=>(0,i.jsx)(i.Fragment,{children:C})}),"default"===k&&(0,i.jsx)(s.AlignmentControl,{value:b,onChange:e=>{w({textAlign:e})}})]}),(0,i.jsx)(s.InspectorControls,{children:(0,i.jsxs)(l.PanelBody,{title:F,children:[_,j,E]})})]}),(0,i.jsxs)("div",{...(0,s.useBlockProps)({className:n({[`has-text-align-${b}`]:b})}),children:[!!y.trim()&&(0,i.jsx)("span",{className:"prefix",children:y}),(0,i.jsx)("span",{className:"value",...c(t),children:a}),!!x.trim()&&(0,i.jsx)("span",{className:"suffix",children:x})]})]})},save:m,deprecated:w})}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,a,i)=>{if(!n){var o=1/0;for(c=0;c<e.length;c++){for(var[n,a,i]=e[c],s=!0,l=0;l<n.length;l++)(!1&i||o>=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,i<o&&(o=i));if(s){e.splice(c--,1);var u=a();void 0!==u&&(t=u)}}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,a,i]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,[o,s,l]=n,u=0;if(o.some((t=>0!==e[t]))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(l)var c=l(r)}for(t&&t(n);u<o.length;u++)i=o[u],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(c)},n=globalThis.webpackChunkcounting_number_block=globalThis.webpackChunkcounting_number_block||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=r.O(void 0,[350],(()=>r(365)));a=r.O(a)})(); -
counting-number-block/trunk/counting-number.php
r3437288 r3458851 5 5 * Requires at least: 5.9 6 6 * Requires PHP: 7.0 7 * Version: 1.1. 17 * Version: 1.1.2 8 8 * Author: Phi Phan 9 9 * Author URI: https://boldblocks.net -
counting-number-block/trunk/readme.txt
r3437288 r3458851 5 5 Requires at least: 5.9 6 6 Tested up to: 6.9 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 68 68 == Changelog == 69 69 70 = 1.1.2 = 71 *Release Date - 11 February 2026* 72 73 * Fixed - Delay not working 74 * Fixed - Missing default value that caused an invalid content issue 75 * Improved - Upgraded the CountUp script 76 70 77 = 1.1.1 = 71 78 *Release Date - 11 January 2026* -
counting-number-block/trunk/src/block.json
r3109915 r3458851 13 13 "selector": ".wp-block-boldblocks-counting-number > .value", 14 14 "attribute": "data-value", 15 "__experimentalRole": "content" 15 "__experimentalRole": "content", 16 "default": 1000 16 17 }, 17 18 "startVal": { … … 20 21 "selector": ".wp-block-boldblocks-counting-number > .value", 21 22 "attribute": "data-start-val", 22 "__experimentalRole": "content" 23 "__experimentalRole": "content", 24 "default": 0 23 25 }, 24 26 "duration": { -
counting-number-block/trunk/src/counting.js
r3109915 r3458851 4 4 import { CountUp } from "countup.js"; 5 5 6 /** 7 * Parse dataset into CountUp options 8 */ 9 const parseDataset = (dataset) => { 10 const data = {}; 11 12 const { 13 value, 14 startVal, 15 duration, 16 scrollSpyDelay, 17 enableScrollSpy, 18 scrollSpyOnce, 19 disableGrouping, 20 separator, 21 decimal, 22 } = dataset; 23 24 // Required value 25 if (!value) return null; 26 27 const numericValue = parseFloat(value); 28 if (isNaN(numericValue)) return null; 29 30 // Decimal places 31 const decimalPlaces = (value.split(".")[1] || "").length; 32 33 data.value = numericValue; 34 data.decimalPlaces = decimalPlaces; 35 36 // Optional numeric fields 37 const parsedStartVal = parseFloat(startVal); 38 if (!isNaN(parsedStartVal)) { 39 data.startVal = parsedStartVal; 40 } 41 42 const parsedDuration = parseFloat(duration); 43 if (!isNaN(parsedDuration)) { 44 data.duration = parsedDuration; 45 } 46 47 const parsedDelay = parseFloat(scrollSpyDelay); 48 if (!isNaN(parsedDelay)) { 49 data.scrollSpyDelay = parsedDelay * 1000; 50 } 51 52 // Boolean fields 53 if (enableScrollSpy !== undefined) { 54 data.enableScrollSpy = enableScrollSpy === "true"; 55 } 56 57 if (scrollSpyOnce !== undefined) { 58 data.scrollSpyOnce = scrollSpyOnce === "true"; 59 } 60 61 // Inverted logic 62 if (disableGrouping !== undefined) { 63 data.useGrouping = disableGrouping !== "true"; 64 } 65 66 // Formatting 67 if (separator) data.separator = separator; 68 if (decimal) data.decimal = decimal; 69 70 return data; 71 }; 72 6 73 export const doCounting = (element) => { 7 const dataset = element.dataset; 8 const data = Object.keys(dataset).reduce((previous, current) => { 9 let value = dataset[current]; 10 if (current === "value") { 11 if (!isNaN(parseFloat(value))) { 12 let decimalPlaces = 0; 13 const decimal = "."; 14 if ((value + "").indexOf(decimal) >= 0) { 15 decimalPlaces = (value + "").split(decimal)[1].length; 16 } 74 const data = parseDataset(element.dataset); 75 if (!data) return; 17 76 18 previous["value"] = value; 19 previous["decimalPlaces"] = decimalPlaces; 77 const scrollSpyDelay = data.scrollSpyDelay ?? 0; 78 const counter = new CountUp(element, data.value, { 79 ...data, 80 scrollSpyDelay: 0, 81 enableScrollSpy: false, 82 scrollSpyOnce: true, 83 useEasing: true, 84 }); 85 86 const animatingClass = "is-number-animating"; 87 88 const observer = new IntersectionObserver( 89 ([entry]) => { 90 if (!entry.isIntersecting) return; 91 92 const blockElement = entry.target.closest( 93 ".wp-block-boldblocks-counting-number", 94 ); 95 96 counter.reset(); 97 setTimeout(() => { 98 blockElement?.classList.add(animatingClass); 99 counter.start(() => { 100 blockElement?.classList.remove(animatingClass); 101 }); 102 }, scrollSpyDelay); 103 104 if (data.scrollSpyOnce) { 105 observer.unobserve(entry.target); 20 106 } 21 } else if (["startVal", "duration", "scrollSpyDelay"].includes(current)) { 22 value = parseFloat(value); 23 if (!isNaN(value)) { 24 if (current === "scrollSpyDelay") { 25 value = value * 1000; 26 } 107 }, 108 { threshold: 0 }, 109 ); 27 110 28 previous[current] = value; 29 } 30 } else if (["enableScrollSpy", "scrollSpyOnce"].includes(current)) { 31 previous[current] = value === "true"; 32 } else if ("disableGrouping" === current) { 33 previous["useGrouping"] = value !== "true"; 34 } else if (["separator", "decimal"].includes(current)) { 35 previous[current] = value; 36 } 111 observer.observe(element); 37 112 38 return previous; 39 }, {}); 40 41 if (data?.value) { 42 const counter = new CountUp(element, data.value, { 43 ...data, 44 enableScrollSpy: false, 45 scrollSpyOnce: true, 46 useEasing: true, 47 }); 48 49 const animatingClass = "is-number-animating"; 50 51 const observer = new IntersectionObserver( 52 ([e]) => { 53 if (e.intersectionRatio > 0) { 54 const blockElement = e.target.closest( 55 ".wp-block-boldblocks-counting-number" 56 ); 57 if ( 58 blockElement && 59 !blockElement.classList.contains(animatingClass) 60 ) { 61 blockElement.classList.add(animatingClass); 62 } 63 64 counter.reset(); 65 counter.start(() => { 66 if ( 67 blockElement && 68 blockElement.classList.contains(animatingClass) 69 ) { 70 blockElement.classList.remove(animatingClass); 71 } 72 }); 73 74 if (data?.scrollSpyOnce) { 75 observer.unobserve(element); 76 } 77 } 78 }, 79 { threshold: [0] } 80 ); 81 82 observer.observe(element); 83 84 return { observer, element, data, counter }; 85 } 113 return { observer, element, data, counter }; 86 114 };
Note: See TracChangeset
for help on using the changeset viewer.