|
1
|
|
-!function(){"use strict";var e={52927:function(e,t,r){var n,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,s={};((e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})})(s,{ElementorError:()=>i,capitalize:()=>capitalize,compareVersions:()=>compareVersions,createError:()=>createError,createTranslate:()=>createTranslate,debounce:()=>debounce,decodeString:()=>decodeString,encodeString:()=>encodeString,ensureError:()=>ensureError,generateUniqueId:()=>generateUniqueId,hasProInstalled:()=>hasProInstalled,hash:()=>hash,hashString:()=>hashString,isProActive:()=>isProActive,isProAtLeast:()=>isProAtLeast,isVersionGreaterOrEqual:()=>isVersionGreaterOrEqual,isVersionLessThan:()=>isVersionLessThan,throttle:()=>throttle,useDebounceState:()=>useDebounceState,useDebouncedCallback:()=>useDebouncedCallback,useSearchState:()=>useSearchState}),e.exports=(n=s,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of u(t))c.call(e,s)||s===r||o(e,s,{get:()=>t[s],enumerable:!(n=a(t,s))||n.enumerable});return e})(o({},"__esModule",{value:!0}),n));var i=class extends Error{context;code;constructor(e,{code:t,context:r=null,cause:n=null}){super(e,{cause:n}),this.context=r,this.code=t}},createError=({code:e,message:t})=>class extends i{constructor({cause:r,context:n}={}){super(t,{cause:r,code:e,context:n})}},ensureError=e=>{if(e instanceof Error)return e;let t,r=null;try{t=JSON.stringify(e)}catch(e){r=e,t="Unable to stringify the thrown value"}return new Error(`Unexpected non-error thrown: ${t}`,{cause:r})},l=r(97557);function debounce(e,t){let r=null;const cancel=()=>{r&&(clearTimeout(r),r=null)},run=(...n)=>{cancel(),r=setTimeout(()=>{e(...n),r=null},t)};return run.flush=(...t)=>{cancel(),e(...t)},run.cancel=cancel,run.pending=()=>!!r,run}function useDebounceState(e={}){const{delay:t=300,initialValue:r=""}=e,[n,o]=(0,l.useState)(r),[a,u]=(0,l.useState)(r),c=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{c.current?.cancel?.()},[]);const s=(0,l.useCallback)(e=>{c.current?.cancel?.(),c.current=debounce(()=>{o(e)},t),c.current()},[t]);return{debouncedValue:n,inputValue:a,handleChange:e=>{u(e),s(e)},setInputValue:u}}var d=r(97557);function useDebouncedCallback(e,t){const r=(0,d.useRef)(e);(0,d.useEffect)(()=>{r.current=e},[e]);const n=(0,d.useMemo)(()=>debounce((...e)=>r.current(...e),t),[t]);return(0,d.useEffect)(()=>()=>{n.cancel()},[n]),n}function throttle(e,t,r=!1){let n=null,o=!1;const cancel=()=>{n&&(clearTimeout(n),n=null)},run=(...a)=>{n?o=!0:(e(...a),n=setTimeout(()=>{n=null,o&&r&&e(...a),o=!1},t))};return run.flush=(...t)=>{cancel(),e(...t)},run.cancel=cancel,run.pending=()=>!!n,run}var encodeString=e=>{const t=Array.from((new TextEncoder).encode(e),e=>String.fromCharCode(e)).join("");return btoa(t)},decodeString=(e,t)=>{try{const t=atob(e),r=new Uint8Array(Array.from(t,e=>e.charCodeAt(0)));return(new TextDecoder).decode(r)}catch{return void 0!==t?t:""}};function hash(e){return JSON.stringify(e,(e,t)=>function isPlainObject(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function hashString(e,t){let r=5381,n=e.length;for(;n;)r=33*r^e.charCodeAt(--n);const o=(r>>>0).toString(36);if(void 0===t)return o;return o.slice(-t).padStart(t,"0")}function useSearchState({localStorageKey:e}){const{debouncedValue:t,inputValue:r,handleChange:n}=useDebounceState({delay:300,initialValue:(()=>{if(e){const t=localStorage.getItem(e);if(t)return localStorage.removeItem(e),t}return""})()});return{debouncedValue:t,inputValue:r,handleChange:n}}function generateUniqueId(e=""){return`${e?`${e}-`:""}${Date.now()}-${Math.random().toString(36).substring(2,9)}`}var capitalize=e=>e.charAt(0).toUpperCase()+e.slice(1),compareVersions=(e,t)=>{const r=String(e||"0.0.0").split(".").map(Number),n=String(t||"0.0.0").split(".").map(Number);for(let e=0;e<Math.max(r.length,n.length);e++){const t=r[e]||0,o=n[e]||0;if(t!==o)return t-o}return 0},isVersionLessThan=(e,t)=>compareVersions(e,t)<0,isVersionGreaterOrEqual=(e,t)=>compareVersions(e,t)>=0;function hasProInstalled(){return window.elementor?.helpers?.hasPro?.()??!1}function isProActive(){return!!hasProInstalled()&&(window.elementorPro?.config?.isActive??!1)}function isProAtLeast(e){const t=function getProVersion(){return window.elementorPro?.config?.version??"0.0"}();if(!t)return!1;const[r,n]=t.split(".").map(Number),[o,a]=e.split(".").map(Number);return r>o||r===o&&n>=a}function createTranslate({configKey:e,defaultStrings:t={}}){return(r,...n)=>{const o=window.elementorAppConfig,a=o?.[e]?.translations;let u={...t,...a}[r];if(!u)return r;for(let e=0;e<n.length;e++)u=u.replace(`%${e+1}$s`,n[e]),u=u.replace("%s",n[e]);return u}}},97557:function(e){e.exports=window.React}},t={};var r=function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}(52927);(window.elementorV2=window.elementorV2||{}).utils=r}(),window.elementorV2.utils?.init?.(); |
|
1
|
+!function(){"use strict";var e={d:function(n,t){for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{ElementorError:function(){return t},capitalize:function(){return h},compareVersions:function(){return m},createError:function(){return r},debounce:function(){return c},decodeString:function(){return s},encodeString:function(){return l},ensureError:function(){return o},generateUniqueId:function(){return g},hash:function(){return f},isVersionGreaterOrEqual:function(){return y},isVersionLessThan:function(){return p},throttle:function(){return a},useDebounceState:function(){return i},useSearchState:function(){return d}});class t extends Error{constructor(e,{code:n,context:t=null,cause:r=null}){super(e,{cause:r}),this.context=t,this.code=n}}const r=({code:e,message:n})=>class extends t{constructor({cause:t,context:r}={}){super(n,{cause:t,code:e,context:r})}},o=e=>{if(e instanceof Error)return e;let n,t=null;try{n=JSON.stringify(e)}catch(e){t=e,n="Unable to stringify the thrown value"}return new Error(`Unexpected non-error thrown: ${n}`,{cause:t})};var u=window.React;function c(e,n){let t=null;const r=()=>{t&&(clearTimeout(t),t=null)},o=(...o)=>{r(),t=setTimeout(()=>{e(...o),t=null},n)};return o.flush=(...n)=>{r(),e(...n)},o.cancel=r,o.pending=()=>!!t,o}function i(e={}){const{delay:n=300,initialValue:t=""}=e,[r,o]=(0,u.useState)(t),[i,a]=(0,u.useState)(t),l=(0,u.useRef)(null);(0,u.useEffect)(()=>()=>{l.current?.cancel?.()},[]);const s=(0,u.useCallback)(e=>{l.current?.cancel?.(),l.current=c(()=>{o(e)},n),l.current()},[n]);return{debouncedValue:r,inputValue:i,handleChange:e=>{a(e),s(e)},setInputValue:a}}function a(e,n,t=!1){let r=null,o=!1;const u=()=>{r&&(clearTimeout(r),r=null)},c=(...u)=>{r?o=!0:(e(...u),r=setTimeout(()=>{r=null,o&&t&&e(...u),o=!1},n))};return c.flush=(...n)=>{u(),e(...n)},c.cancel=u,c.pending=()=>!!r,c}const l=e=>{const n=Array.from((new TextEncoder).encode(e),e=>String.fromCharCode(e)).join("");return btoa(n)},s=(e,n)=>{try{const n=atob(e),t=new Uint8Array(Array.from(n,e=>e.charCodeAt(0)));return(new TextDecoder).decode(t)}catch{return void 0!==n?n:""}};function f(e){return JSON.stringify(e,(e,n)=>function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}(n)?Object.keys(n).sort().reduce((e,t)=>(e[t]=n[t],e),{}):n)}function d({localStorageKey:e}){const{debouncedValue:n,inputValue:t,handleChange:r}=i({delay:300,initialValue:(()=>{if(e){const n=localStorage.getItem(e);if(n)return localStorage.removeItem(e),n}return""})()});return{debouncedValue:n,inputValue:t,handleChange:r}}function g(e=""){return`${e?`${e}-`:""}${Date.now()}-${Math.random().toString(36).substring(2,9)}`}const h=e=>e.charAt(0).toUpperCase()+e.slice(1),m=(e,n)=>{const t=String(e||"0.0.0").split(".").map(Number),r=String(n||"0.0.0").split(".").map(Number);for(let e=0;e<Math.max(t.length,r.length);e++){const n=t[e]||0,o=r[e]||0;if(n!==o)return n-o}return 0},p=(e,n)=>m(e,n)<0,y=(e,n)=>m(e,n)>=0;(window.elementorV2=window.elementorV2||{}).utils=n}(),window.elementorV2.utils?.init?.(); |