!function(){function t(t){return!!("string"!=typeof t&&"number"!=typeof t||"string"==typeof t&&isNaN(parseFloat(t)))}function e(e,n,r){if(""===e||t(e))return"";let i="string"==typeof e?parseFloat(e):e;return"number"==typeof n&&i<n&&(i=n),"number"==typeof r&&i>r&&(i=r),i}function n(e){if(""===e||null===e||t(e))return{number:"",unit:""};let n=String(e).trim(),r=-1<n.indexOf("-")?"-":"",i=function(t){if(!t)return"";let e=String(t).match(/[a-z%]+$/i);return e?e[0]:""}(n=n.replace(r,"")),u=i?n.replace(i,""):n;if(""===(u=u.trim()))return{number:"",unit:i};let o=u.endsWith("."),f=parseFloat(u=r+u);return isNaN(f)?{number:"",unit:i}:{number:f,unit:i,hasTrailingDotBeforeUnit:!!i&&!!o}}wp.customize.controlConstructor["wpbf-responsive-generic"]=wp.customize.wpbfDynamicControl.extend({initWpbfControl:function(r){let i=(r=r||this).params;"wpbf-responsive-generic"===i.type&&r.container.find(".wpbf-control-form input, .wpbf-control-form textarea").on("input",function(u){let o=r.setting?.get(),f="string"==typeof o?function(t,r,i,u,o){let f="string"==typeof i?function(t){if(""!==t&&t)try{return JSON.parse(t)}catch(t){return}}(i):i;if(!f)return function(t){let e={};return t.forEach(t=>{e[t]=""}),e}(r);let s={};return r.forEach(r=>{if(!f.hasOwnProperty(r)){s[r]="";return}let i=f[r];"number"===t&&(i=function(t,r,i){let u=String(t).trim();if(""===u)return"";if("-"===u)return"-";let o=u.endsWith(".");u=o?u.replace(".",""):u;let f=n(t);if(""===f.number)return o?"0.":"";let s=f.number;return("number"==typeof r||"number"==typeof i)&&(s=e(s,r,i)),o?s+".":s}(f[r],u,o)),s[r]="string"!=typeof i&&"number"!=typeof i?"":i}),s}(i.subtype,i.devices,o,i.min,i.max):o,s=this.parentNode,a=s instanceof HTMLElement?s.dataset.wpbfDevice:void 0;if(!a||!f||!f.hasOwnProperty(a))return;let p=this instanceof HTMLInputElement||this instanceof HTMLTextAreaElement?this.value:"";if("number"===i.subtype||"number-unit"===i.subtype){var l,m;i.max=(l=i.min,m=i.max,void 0===l||void 0===m||null===l||null===m?m:Math.max(l,m)),p="number"===i.subtype?e(p,i.min,i.max):function(r,i,u){if(""===r||t(r))return"";let o=n(r),f=o.number,s=o.unit;if(""===f)return"";let a=e(f,i,u);return s?`${a}${s}`:a}(p,i.min,i.max)}f[a]=p;let c=i.saveAsJson?function(t){try{return JSON.stringify(t)}catch(t){return""}}(f):f;r.setting?.set(c)})}})}();
