| 1 |
!function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{apiFetch:function(){return s},controls:function(){return a},dispatch:function(){return c},select:function(){return u}});var r=window.wp.apiFetch,n=e.n(r);const o=function(e){return e.isRegistryControl=!0,e},s=e=>({type:"API_FETCH",request:e});function u(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return{type:"SELECT",storeKey:e,selectorName:t,args:n}}function c(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return{type:"DISPATCH",storeKey:e,actionName:t,args:n}}const a={API_FETCH(e){let{request:t}=e;return n()(t)},SELECT:o((e=>t=>{let{storeKey:r,selectorName:n,args:o}=t;return e.select(r)[n].hasResolver?((e,t)=>{let{storeKey:r,selectorName:n,args:o}=t;return new Promise((t=>{const s=()=>e.select("").hasFinishedResolution(r,n,o),u=()=>e.select(r)[n].apply(null,o),c=u();if(s())return t(c);const a=e.subscribe((()=>{s()&&(a(),t(u()))}))}))})(e,{storeKey:r,selectorName:n,args:o}):e.select(r)[n](...o)})),DISPATCH:o((e=>t=>{let{storeKey:r,actionName:n,args:o}=t;return e.dispatch(r)[n](...o)}))};(window.LP=window.LP||{}).dataControls=t}(); |