Edit File by line
/home/zeestwma/ajeebong.../wp-inclu.../js/dist/script-m.../interact...
File: debug.js
/******/ var __webpack_modules__ = ({
[0] Fix | Delete
[1] Fix | Delete
/***/ 380:
[2] Fix | Delete
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
[3] Fix | Delete
[4] Fix | Delete
[5] Fix | Delete
// EXPORTS
[6] Fix | Delete
__webpack_require__.d(__webpack_exports__, {
[7] Fix | Delete
zj: () => (/* reexport */ getConfig),
[8] Fix | Delete
SD: () => (/* reexport */ getContext),
[9] Fix | Delete
V6: () => (/* reexport */ getElement),
[10] Fix | Delete
$K: () => (/* reexport */ getServerContext),
[11] Fix | Delete
vT: () => (/* reexport */ getServerState),
[12] Fix | Delete
jb: () => (/* binding */ privateApis),
[13] Fix | Delete
yT: () => (/* reexport */ splitTask),
[14] Fix | Delete
M_: () => (/* reexport */ store),
[15] Fix | Delete
hb: () => (/* reexport */ useCallback),
[16] Fix | Delete
vJ: () => (/* reexport */ useEffect),
[17] Fix | Delete
ip: () => (/* reexport */ useInit),
[18] Fix | Delete
Nf: () => (/* reexport */ useLayoutEffect),
[19] Fix | Delete
Kr: () => (/* reexport */ useMemo),
[20] Fix | Delete
li: () => (/* reexport */ A),
[21] Fix | Delete
J0: () => (/* reexport */ d),
[22] Fix | Delete
FH: () => (/* reexport */ useWatch),
[23] Fix | Delete
v4: () => (/* reexport */ withScope),
[24] Fix | Delete
mh: () => (/* reexport */ withSyncEvent)
[25] Fix | Delete
});
[26] Fix | Delete
[27] Fix | Delete
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
[28] Fix | Delete
var preact_module = __webpack_require__(622);
[29] Fix | Delete
;// ./node_modules/preact/hooks/dist/hooks.module.js
[30] Fix | Delete
var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function p(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return hooks_module_o=1,h(D,n)}function h(n,u,i){var o=p(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=p(hooks_module_t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}
[31] Fix | Delete
[32] Fix | Delete
;// ./node_modules/@preact/signals-core/dist/signals-core.module.js
[33] Fix | Delete
var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)}
[34] Fix | Delete
;// ./node_modules/@preact/signals/dist/signals.module.js
[35] Fix | Delete
var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])}
[36] Fix | Delete
;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js
[37] Fix | Delete
const namespaceStack = [];
[38] Fix | Delete
const getNamespace = () => namespaceStack.slice(-1)[0];
[39] Fix | Delete
const setNamespace = namespace => {
[40] Fix | Delete
namespaceStack.push(namespace);
[41] Fix | Delete
};
[42] Fix | Delete
const resetNamespace = () => {
[43] Fix | Delete
namespaceStack.pop();
[44] Fix | Delete
};
[45] Fix | Delete
[46] Fix | Delete
;// ./node_modules/@wordpress/interactivity/build-module/scopes.js
[47] Fix | Delete
/**
[48] Fix | Delete
* External dependencies
[49] Fix | Delete
*/
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Internal dependencies
[53] Fix | Delete
*/
[54] Fix | Delete
[55] Fix | Delete
// Store stacks for the current scope and the default namespaces and export APIs
[56] Fix | Delete
// to interact with them.
[57] Fix | Delete
const scopeStack = [];
[58] Fix | Delete
const getScope = () => scopeStack.slice(-1)[0];
[59] Fix | Delete
const setScope = scope => {
[60] Fix | Delete
scopeStack.push(scope);
[61] Fix | Delete
};
[62] Fix | Delete
const resetScope = () => {
[63] Fix | Delete
scopeStack.pop();
[64] Fix | Delete
};
[65] Fix | Delete
[66] Fix | Delete
// Wrap the element props to prevent modifications.
[67] Fix | Delete
const immutableMap = new WeakMap();
[68] Fix | Delete
const immutableError = () => {
[69] Fix | Delete
throw new Error('Please use `data-wp-bind` to modify the attributes of an element.');
[70] Fix | Delete
};
[71] Fix | Delete
const immutableHandlers = {
[72] Fix | Delete
get(target, key, receiver) {
[73] Fix | Delete
const value = Reflect.get(target, key, receiver);
[74] Fix | Delete
return !!value && typeof value === 'object' ? deepImmutable(value) : value;
[75] Fix | Delete
},
[76] Fix | Delete
set: immutableError,
[77] Fix | Delete
deleteProperty: immutableError
[78] Fix | Delete
};
[79] Fix | Delete
const deepImmutable = target => {
[80] Fix | Delete
if (!immutableMap.has(target)) {
[81] Fix | Delete
immutableMap.set(target, new Proxy(target, immutableHandlers));
[82] Fix | Delete
}
[83] Fix | Delete
return immutableMap.get(target);
[84] Fix | Delete
};
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Retrieves the context inherited by the element evaluating a function from the
[88] Fix | Delete
* store. The returned value depends on the element and the namespace where the
[89] Fix | Delete
* function calling `getContext()` exists.
[90] Fix | Delete
*
[91] Fix | Delete
* @param namespace Store namespace. By default, the namespace where the calling
[92] Fix | Delete
* function exists is used.
[93] Fix | Delete
* @return The context content.
[94] Fix | Delete
*/
[95] Fix | Delete
const getContext = namespace => {
[96] Fix | Delete
const scope = getScope();
[97] Fix | Delete
if (true) {
[98] Fix | Delete
if (!scope) {
[99] Fix | Delete
throw Error('Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
[100] Fix | Delete
}
[101] Fix | Delete
}
[102] Fix | Delete
return scope.context[namespace || getNamespace()];
[103] Fix | Delete
};
[104] Fix | Delete
[105] Fix | Delete
/**
[106] Fix | Delete
* Retrieves a representation of the element where a function from the store
[107] Fix | Delete
* is being evaluated. Such representation is read-only, and contains a
[108] Fix | Delete
* reference to the DOM element, its props and a local reactive state.
[109] Fix | Delete
*
[110] Fix | Delete
* @return Element representation.
[111] Fix | Delete
*/
[112] Fix | Delete
const getElement = () => {
[113] Fix | Delete
const scope = getScope();
[114] Fix | Delete
if (true) {
[115] Fix | Delete
if (!scope) {
[116] Fix | Delete
throw Error('Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
[117] Fix | Delete
}
[118] Fix | Delete
}
[119] Fix | Delete
const {
[120] Fix | Delete
ref,
[121] Fix | Delete
attributes
[122] Fix | Delete
} = scope;
[123] Fix | Delete
return Object.freeze({
[124] Fix | Delete
ref: ref.current,
[125] Fix | Delete
attributes: deepImmutable(attributes)
[126] Fix | Delete
});
[127] Fix | Delete
};
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Retrieves the part of the inherited context defined and updated from the
[131] Fix | Delete
* server.
[132] Fix | Delete
*
[133] Fix | Delete
* The object returned is read-only, and includes the context defined in PHP
[134] Fix | Delete
* with `wp_interactivity_data_wp_context()`, including the corresponding
[135] Fix | Delete
* inherited properties. When `actions.navigate()` is called, this object is
[136] Fix | Delete
* updated to reflect the changes in the new visited page, without affecting the
[137] Fix | Delete
* context returned by `getContext()`. Directives can subscribe to those changes
[138] Fix | Delete
* to update the context if needed.
[139] Fix | Delete
*
[140] Fix | Delete
* @example
[141] Fix | Delete
* ```js
[142] Fix | Delete
* store('...', {
[143] Fix | Delete
* callbacks: {
[144] Fix | Delete
* updateServerContext() {
[145] Fix | Delete
* const context = getContext();
[146] Fix | Delete
* const serverContext = getServerContext();
[147] Fix | Delete
* // Override some property with the new value that came from the server.
[148] Fix | Delete
* context.overridableProp = serverContext.overridableProp;
[149] Fix | Delete
* },
[150] Fix | Delete
* },
[151] Fix | Delete
* });
[152] Fix | Delete
* ```
[153] Fix | Delete
*
[154] Fix | Delete
* @param namespace Store namespace. By default, the namespace where the calling
[155] Fix | Delete
* function exists is used.
[156] Fix | Delete
* @return The server context content.
[157] Fix | Delete
*/
[158] Fix | Delete
const getServerContext = namespace => {
[159] Fix | Delete
const scope = getScope();
[160] Fix | Delete
if (true) {
[161] Fix | Delete
if (!scope) {
[162] Fix | Delete
throw Error('Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.');
[163] Fix | Delete
}
[164] Fix | Delete
}
[165] Fix | Delete
return scope.serverContext[namespace || getNamespace()];
[166] Fix | Delete
};
[167] Fix | Delete
[168] Fix | Delete
;// ./node_modules/@wordpress/interactivity/build-module/utils.js
[169] Fix | Delete
/**
[170] Fix | Delete
* External dependencies
[171] Fix | Delete
*/
[172] Fix | Delete
[173] Fix | Delete
[174] Fix | Delete
[175] Fix | Delete
/**
[176] Fix | Delete
* Internal dependencies
[177] Fix | Delete
*/
[178] Fix | Delete
[179] Fix | Delete
[180] Fix | Delete
/**
[181] Fix | Delete
* Executes a callback function after the next frame is rendered.
[182] Fix | Delete
*
[183] Fix | Delete
* @param callback The callback function to be executed.
[184] Fix | Delete
* @return A promise that resolves after the callback function is executed.
[185] Fix | Delete
*/
[186] Fix | Delete
const afterNextFrame = callback => {
[187] Fix | Delete
return new Promise(resolve => {
[188] Fix | Delete
const done = () => {
[189] Fix | Delete
clearTimeout(timeout);
[190] Fix | Delete
window.cancelAnimationFrame(raf);
[191] Fix | Delete
setTimeout(() => {
[192] Fix | Delete
callback();
[193] Fix | Delete
resolve();
[194] Fix | Delete
});
[195] Fix | Delete
};
[196] Fix | Delete
const timeout = setTimeout(done, 100);
[197] Fix | Delete
const raf = window.requestAnimationFrame(done);
[198] Fix | Delete
});
[199] Fix | Delete
};
[200] Fix | Delete
[201] Fix | Delete
/**
[202] Fix | Delete
* Returns a promise that resolves after yielding to main.
[203] Fix | Delete
*
[204] Fix | Delete
* @return Promise<void>
[205] Fix | Delete
*/
[206] Fix | Delete
const splitTask = typeof window.scheduler?.yield === 'function' ? window.scheduler.yield.bind(window.scheduler) : () => {
[207] Fix | Delete
return new Promise(resolve => {
[208] Fix | Delete
setTimeout(resolve, 0);
[209] Fix | Delete
});
[210] Fix | Delete
};
[211] Fix | Delete
[212] Fix | Delete
/**
[213] Fix | Delete
* Creates a Flusher object that can be used to flush computed values and notify listeners.
[214] Fix | Delete
*
[215] Fix | Delete
* Using the mangled properties:
[216] Fix | Delete
* this.c: this._callback
[217] Fix | Delete
* this.x: this._compute
[218] Fix | Delete
* https://github.com/preactjs/signals/blob/main/mangle.json
[219] Fix | Delete
*
[220] Fix | Delete
* @param compute The function that computes the value to be flushed.
[221] Fix | Delete
* @param notify The function that notifies listeners when the value is flushed.
[222] Fix | Delete
* @return The Flusher object with `flush` and `dispose` properties.
[223] Fix | Delete
*/
[224] Fix | Delete
function createFlusher(compute, notify) {
[225] Fix | Delete
let flush = () => undefined;
[226] Fix | Delete
const dispose = E(function () {
[227] Fix | Delete
flush = this.c.bind(this);
[228] Fix | Delete
this.x = compute;
[229] Fix | Delete
this.c = notify;
[230] Fix | Delete
return compute();
[231] Fix | Delete
});
[232] Fix | Delete
return {
[233] Fix | Delete
flush,
[234] Fix | Delete
dispose
[235] Fix | Delete
};
[236] Fix | Delete
}
[237] Fix | Delete
[238] Fix | Delete
/**
[239] Fix | Delete
* Custom hook that executes a callback function whenever a signal is triggered.
[240] Fix | Delete
* Version of `useSignalEffect` with a `useEffect`-like execution. This hook
[241] Fix | Delete
* implementation comes from this PR, but we added short-cirtuiting to avoid
[242] Fix | Delete
* infinite loops: https://github.com/preactjs/signals/pull/290
[243] Fix | Delete
*
[244] Fix | Delete
* @param callback The callback function to be executed.
[245] Fix | Delete
*/
[246] Fix | Delete
function utils_useSignalEffect(callback) {
[247] Fix | Delete
y(() => {
[248] Fix | Delete
let eff = null;
[249] Fix | Delete
let isExecuting = false;
[250] Fix | Delete
const notify = async () => {
[251] Fix | Delete
if (eff && !isExecuting) {
[252] Fix | Delete
isExecuting = true;
[253] Fix | Delete
await afterNextFrame(eff.flush);
[254] Fix | Delete
isExecuting = false;
[255] Fix | Delete
}
[256] Fix | Delete
};
[257] Fix | Delete
eff = createFlusher(callback, notify);
[258] Fix | Delete
return eff.dispose;
[259] Fix | Delete
}, []);
[260] Fix | Delete
}
[261] Fix | Delete
[262] Fix | Delete
/**
[263] Fix | Delete
* Returns the passed function wrapped with the current scope so it is
[264] Fix | Delete
* accessible whenever the function runs. This is primarily to make the scope
[265] Fix | Delete
* available inside hook callbacks.
[266] Fix | Delete
*
[267] Fix | Delete
* Asynchronous functions should use generators that yield promises instead of awaiting them.
[268] Fix | Delete
* See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store
[269] Fix | Delete
*
[270] Fix | Delete
* @param func The passed function.
[271] Fix | Delete
* @return The wrapped function.
[272] Fix | Delete
*/
[273] Fix | Delete
[274] Fix | Delete
function withScope(func) {
[275] Fix | Delete
const scope = getScope();
[276] Fix | Delete
const ns = getNamespace();
[277] Fix | Delete
let wrapped;
[278] Fix | Delete
if (func?.constructor?.name === 'GeneratorFunction') {
[279] Fix | Delete
wrapped = async (...args) => {
[280] Fix | Delete
const gen = func(...args);
[281] Fix | Delete
let value;
[282] Fix | Delete
let it;
[283] Fix | Delete
while (true) {
[284] Fix | Delete
setNamespace(ns);
[285] Fix | Delete
setScope(scope);
[286] Fix | Delete
try {
[287] Fix | Delete
it = gen.next(value);
[288] Fix | Delete
} finally {
[289] Fix | Delete
resetScope();
[290] Fix | Delete
resetNamespace();
[291] Fix | Delete
}
[292] Fix | Delete
try {
[293] Fix | Delete
value = await it.value;
[294] Fix | Delete
} catch (e) {
[295] Fix | Delete
setNamespace(ns);
[296] Fix | Delete
setScope(scope);
[297] Fix | Delete
gen.throw(e);
[298] Fix | Delete
} finally {
[299] Fix | Delete
resetScope();
[300] Fix | Delete
resetNamespace();
[301] Fix | Delete
}
[302] Fix | Delete
if (it.done) {
[303] Fix | Delete
break;
[304] Fix | Delete
}
[305] Fix | Delete
}
[306] Fix | Delete
return value;
[307] Fix | Delete
};
[308] Fix | Delete
} else {
[309] Fix | Delete
wrapped = (...args) => {
[310] Fix | Delete
setNamespace(ns);
[311] Fix | Delete
setScope(scope);
[312] Fix | Delete
try {
[313] Fix | Delete
return func(...args);
[314] Fix | Delete
} finally {
[315] Fix | Delete
resetNamespace();
[316] Fix | Delete
resetScope();
[317] Fix | Delete
}
[318] Fix | Delete
};
[319] Fix | Delete
}
[320] Fix | Delete
[321] Fix | Delete
// If function was annotated via `withSyncEvent()`, maintain the annotation.
[322] Fix | Delete
const syncAware = func;
[323] Fix | Delete
if (syncAware.sync) {
[324] Fix | Delete
const syncAwareWrapped = wrapped;
[325] Fix | Delete
syncAwareWrapped.sync = true;
[326] Fix | Delete
return syncAwareWrapped;
[327] Fix | Delete
}
[328] Fix | Delete
return wrapped;
[329] Fix | Delete
}
[330] Fix | Delete
[331] Fix | Delete
/**
[332] Fix | Delete
* Accepts a function that contains imperative code which runs whenever any of
[333] Fix | Delete
* the accessed _reactive_ properties (e.g., values from the global state or the
[334] Fix | Delete
* context) is modified.
[335] Fix | Delete
*
[336] Fix | Delete
* This hook makes the element's scope available so functions like
[337] Fix | Delete
* `getElement()` and `getContext()` can be used inside the passed callback.
[338] Fix | Delete
*
[339] Fix | Delete
* @param callback The hook callback.
[340] Fix | Delete
*/
[341] Fix | Delete
function useWatch(callback) {
[342] Fix | Delete
utils_useSignalEffect(withScope(callback));
[343] Fix | Delete
}
[344] Fix | Delete
[345] Fix | Delete
/**
[346] Fix | Delete
* Accepts a function that contains imperative code which runs only after the
[347] Fix | Delete
* element's first render, mainly useful for initialization logic.
[348] Fix | Delete
*
[349] Fix | Delete
* This hook makes the element's scope available so functions like
[350] Fix | Delete
* `getElement()` and `getContext()` can be used inside the passed callback.
[351] Fix | Delete
*
[352] Fix | Delete
* @param callback The hook callback.
[353] Fix | Delete
*/
[354] Fix | Delete
function useInit(callback) {
[355] Fix | Delete
y(withScope(callback), []);
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
/**
[359] Fix | Delete
* Accepts a function that contains imperative, possibly effectful code. The
[360] Fix | Delete
* effects run after browser paint, without blocking it.
[361] Fix | Delete
*
[362] Fix | Delete
* This hook is equivalent to Preact's `useEffect` and makes the element's scope
[363] Fix | Delete
* available so functions like `getElement()` and `getContext()` can be used
[364] Fix | Delete
* inside the passed callback.
[365] Fix | Delete
*
[366] Fix | Delete
* @param callback Imperative function that can return a cleanup
[367] Fix | Delete
* function.
[368] Fix | Delete
* @param inputs If present, effect will only activate if the
[369] Fix | Delete
* values in the list change (using `===`).
[370] Fix | Delete
*/
[371] Fix | Delete
function useEffect(callback, inputs) {
[372] Fix | Delete
y(withScope(callback), inputs);
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
/**
[376] Fix | Delete
* Accepts a function that contains imperative, possibly effectful code. Use
[377] Fix | Delete
* this to read layout from the DOM and synchronously re-render.
[378] Fix | Delete
*
[379] Fix | Delete
* This hook is equivalent to Preact's `useLayoutEffect` and makes the element's
[380] Fix | Delete
* scope available so functions like `getElement()` and `getContext()` can be
[381] Fix | Delete
* used inside the passed callback.
[382] Fix | Delete
*
[383] Fix | Delete
* @param callback Imperative function that can return a cleanup
[384] Fix | Delete
* function.
[385] Fix | Delete
* @param inputs If present, effect will only activate if the
[386] Fix | Delete
* values in the list change (using `===`).
[387] Fix | Delete
*/
[388] Fix | Delete
function useLayoutEffect(callback, inputs) {
[389] Fix | Delete
_(withScope(callback), inputs);
[390] Fix | Delete
}
[391] Fix | Delete
[392] Fix | Delete
/**
[393] Fix | Delete
* Returns a memoized version of the callback that only changes if one of the
[394] Fix | Delete
* inputs has changed (using `===`).
[395] Fix | Delete
*
[396] Fix | Delete
* This hook is equivalent to Preact's `useCallback` and makes the element's
[397] Fix | Delete
* scope available so functions like `getElement()` and `getContext()` can be
[398] Fix | Delete
* used inside the passed callback.
[399] Fix | Delete
*
[400] Fix | Delete
* @param callback Callback function.
[401] Fix | Delete
* @param inputs If present, the callback will only be updated if the
[402] Fix | Delete
* values in the list change (using `===`).
[403] Fix | Delete
*
[404] Fix | Delete
* @return The callback function.
[405] Fix | Delete
*/
[406] Fix | Delete
function useCallback(callback, inputs) {
[407] Fix | Delete
return q(withScope(callback), inputs);
[408] Fix | Delete
}
[409] Fix | Delete
[410] Fix | Delete
/**
[411] Fix | Delete
* Pass a factory function and an array of inputs. `useMemo` will only recompute
[412] Fix | Delete
* the memoized value when one of the inputs has changed.
[413] Fix | Delete
*
[414] Fix | Delete
* This hook is equivalent to Preact's `useMemo` and makes the element's scope
[415] Fix | Delete
* available so functions like `getElement()` and `getContext()` can be used
[416] Fix | Delete
* inside the passed factory function.
[417] Fix | Delete
*
[418] Fix | Delete
* @param factory Factory function that returns that value for memoization.
[419] Fix | Delete
* @param inputs If present, the factory will only be run to recompute if
[420] Fix | Delete
* the values in the list change (using `===`).
[421] Fix | Delete
*
[422] Fix | Delete
* @return The memoized value.
[423] Fix | Delete
*/
[424] Fix | Delete
function useMemo(factory, inputs) {
[425] Fix | Delete
return T(withScope(factory), inputs);
[426] Fix | Delete
}
[427] Fix | Delete
[428] Fix | Delete
/**
[429] Fix | Delete
* Creates a root fragment by replacing a node or an array of nodes in a parent element.
[430] Fix | Delete
* For wrapperless hydration.
[431] Fix | Delete
* See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c
[432] Fix | Delete
*
[433] Fix | Delete
* @param parent The parent element where the nodes will be replaced.
[434] Fix | Delete
* @param replaceNode The node or array of nodes to replace in the parent element.
[435] Fix | Delete
* @return The created root fragment.
[436] Fix | Delete
*/
[437] Fix | Delete
const createRootFragment = (parent, replaceNode) => {
[438] Fix | Delete
replaceNode = [].concat(replaceNode);
[439] Fix | Delete
const sibling = replaceNode[replaceNode.length - 1].nextSibling;
[440] Fix | Delete
function insert(child, root) {
[441] Fix | Delete
parent.insertBefore(child, root || sibling);
[442] Fix | Delete
}
[443] Fix | Delete
return parent.__k = {
[444] Fix | Delete
nodeType: 1,
[445] Fix | Delete
parentNode: parent,
[446] Fix | Delete
firstChild: replaceNode[0],
[447] Fix | Delete
childNodes: replaceNode,
[448] Fix | Delete
insertBefore: insert,
[449] Fix | Delete
appendChild: insert,
[450] Fix | Delete
removeChild(c) {
[451] Fix | Delete
parent.removeChild(c);
[452] Fix | Delete
}
[453] Fix | Delete
};
[454] Fix | Delete
};
[455] Fix | Delete
[456] Fix | Delete
/**
[457] Fix | Delete
* Transforms a kebab-case string to camelCase.
[458] Fix | Delete
*
[459] Fix | Delete
* @param str The kebab-case string to transform to camelCase.
[460] Fix | Delete
* @return The transformed camelCase string.
[461] Fix | Delete
*/
[462] Fix | Delete
function kebabToCamelCase(str) {
[463] Fix | Delete
return str.replace(/^-+|-+$/g, '').toLowerCase().replace(/-([a-z])/g, function (_match, group1) {
[464] Fix | Delete
return group1.toUpperCase();
[465] Fix | Delete
});
[466] Fix | Delete
}
[467] Fix | Delete
const logged = new Set();
[468] Fix | Delete
[469] Fix | Delete
/**
[470] Fix | Delete
* Shows a warning with `message` if environment is not `production`.
[471] Fix | Delete
*
[472] Fix | Delete
* Based on the `@wordpress/warning` package.
[473] Fix | Delete
*
[474] Fix | Delete
* @param message Message to show in the warning.
[475] Fix | Delete
*/
[476] Fix | Delete
const warn = message => {
[477] Fix | Delete
if (true) {
[478] Fix | Delete
if (logged.has(message)) {
[479] Fix | Delete
return;
[480] Fix | Delete
}
[481] Fix | Delete
[482] Fix | Delete
// eslint-disable-next-line no-console
[483] Fix | Delete
console.warn(message);
[484] Fix | Delete
[485] Fix | Delete
// Throwing an error and catching it immediately to improve debugging
[486] Fix | Delete
// A consumer can use 'pause on caught exceptions'
[487] Fix | Delete
try {
[488] Fix | Delete
throw Error(message);
[489] Fix | Delete
} catch (e) {
[490] Fix | Delete
// Do nothing.
[491] Fix | Delete
}
[492] Fix | Delete
logged.add(message);
[493] Fix | Delete
}
[494] Fix | Delete
};
[495] Fix | Delete
[496] Fix | Delete
/**
[497] Fix | Delete
* Checks if the passed `candidate` is a plain object with just the `Object`
[498] Fix | Delete
* prototype.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function