2021-05-19 17:09:27 +02:00
|
|
|
this.wp=this.wp||{},this.wp.viewport=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=573)}({0:function(e,t){e.exports=window.wp.element},10:function(e,t){e.exports=window.wp.compose},2:function(e,t){e.exports=window.lodash},5:function(e,t){e.exports=window.wp.data},573:function(e,t,r){"use strict";r.r(t),r.d(t,"store",(function(){return p})),r.d(t,"ifViewportMatches",(function(){return h})),r.d(t,"withViewportMatch",(function(){return b}));var n={};r.r(n),r.d(n,"setIsMatching",(function(){return a}));var o={};r.r(o),r.d(o,"isViewportMatch",(function(){return s}));var i=r(2),c=r(5);var u=function(e={},t){switch(t.type){case"SET_IS_MATCHING":return t.values}return e};function a(e){return{type:"SET_IS_MATCHING",values:e}}function s(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const p=Object(c.createReduxStore)("core/viewport",{reducer:u,actions:n,selectors:o});Object(c.register)(p);var d=(e,t)=>{const r=Object(i.debounce)(()=>{const e=Object(i.mapValues)(n,e=>e.matches);Object(c.dispatch)(p).setIsMatching(e)},{leading:!0}),n=Object(i.reduce)(e,(e,n,o)=>(Object(i.forEach)(t,(t,i)=>{const c=window.matchMedia(`(${t}: ${n}px)`);c.addListener(r);const u=[i,o].join(" ");e[u]=c}),e),{});window.addEventListener("orientationchange",r),r(),r.flush()},f=r(10),l=r(7),w=r(0);var b=e=>Object(f.createHigherOrderComponent)(t=>Object(f.pure)(r=>{const n=Object(i.mapValues)(e,e=>{let[t,r]=e.split(" ");return void 0===r&&(r=t,t=">="),Object(f.useViewportMatch)(r,t)});return Object(w.createElement)(t,Object(l.a)({},r,n))}),"withViewportMatch");var h=e=>Object(f.createHigherOrderComponent)(Object(f.compose)([b({isViewportMatch:e}),Object(f.ifCondition)(e=>e.isViewportMatch)]),"ifViewportMatches");d({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"})},7:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))}});
|