File "index.min.js"
Full Path: /home/pumpbmko/public_html/wp-content/plugins/gutenberg/build/router/index.min.js
File size: 4.2 KB
MIME-type: text/plain
Charset: utf-8
(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r: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,{privateApis:()=>b});const n=window.wp.element;function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(null,arguments)}var o;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));var a="beforeunload";function i(e){e.preventDefault(),e.returnValue=""}function u(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}const c=window.wp.url,s=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,c=n.history;function s(){var e=n.location,t=e.pathname,r=e.search,o=e.hash,a=c.state||{};return[a.idx,{pathname:t,search:r,hash:o,state:a.usr||null,key:a.key||"default"}]}var l=null;n.addEventListener("popstate",(function(){if(l)w.call(l),l=null;else{var e=o.Pop,t=s(),n=t[0],r=t[1];if(w.length){if(null!=n){var a=p-n;a&&(l={action:e,location:r,retry:function(){S(-1*a)}},S(a))}}else b(e)}}));var f=o.Pop,h=s(),p=h[0],d=h[1],v=u(),w=u();function g(e){return"string"==typeof e?e:(n=(t=e).pathname,r=void 0===n?"/":n,o=t.search,a=void 0===o?"":o,i=t.hash,u=void 0===i?"":i,a&&"?"!==a&&(r+="?"===a.charAt(0)?a:"?"+a),u&&"#"!==u&&(r+="#"===u.charAt(0)?u:"#"+u),r);var t,n,r,o,a,i,u}function y(e,t){return void 0===t&&(t=null),r({pathname:d.pathname,hash:"",search:""},"string"==typeof e?function(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function m(e,t){return[{usr:e.state,key:e.key,idx:t},g(e)]}function P(e,t,n){return!w.length||(w.call({action:e,location:t,retry:n}),!1)}function b(e){f=e;var t=s();p=t[0],d=t[1],v.call({action:f,location:d})}function S(e){c.go(e)}return null==p&&(p=0,c.replaceState(r({},c.state,{idx:p}),"")),{get action(){return f},get location(){return d},createHref:g,push:function e(t,r){var a=o.Push,i=y(t,r);if(P(a,i,(function(){e(t,r)}))){var u=m(i,p+1),s=u[0],l=u[1];try{c.pushState(s,"",l)}catch(e){n.location.assign(l)}b(a)}},replace:function e(t,n){var r=o.Replace,a=y(t,n);if(P(r,a,(function(){e(t,n)}))){var i=m(a,p),u=i[0],s=i[1];c.replaceState(u,"",s),b(r)}},go:S,back:function(){S(-1)},forward:function(){S(1)},listen:function(e){return v.push(e)},block:function(e){var t=w.push(e);return 1===w.length&&n.addEventListener(a,i),function(){t(),w.length||n.removeEventListener(a,i)}}}}(),l=s.push,f=s.replace;function h(e){if(e.hasOwnProperty("wp_theme_preview"))return e;const t=new URLSearchParams(s.location.search).get("wp_theme_preview");return null===t?e:{...e,wp_theme_preview:t}}const p=new WeakMap;s.push=function(e,t){const n=(0,c.buildQueryString)(h(e));return l.call(s,{search:n},t)},s.replace=function(e,t){const n=(0,c.buildQueryString)(h(e));return f.call(s,{search:n},t)},s.getLocationWithParams=function(){const e=s.location;let t=p.get(e);return t||(t={...e,params:Object.fromEntries(new URLSearchParams(e.search))},p.set(e,t)),t};const d=s,v=window.ReactJSXRuntime,w=(0,n.createContext)(),g=(0,n.createContext)(),y=window.wp.privateApis,{lock:m,unlock:P}=(0,y.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/router"),b={};m(b,{useHistory:function(){return(0,n.useContext)(g)},useLocation:function(){return(0,n.useContext)(w)},RouterProvider:function({children:e}){const t=(0,n.useSyncExternalStore)(d.listen,d.getLocationWithParams,d.getLocationWithParams);return(0,v.jsx)(g.Provider,{value:d,children:(0,v.jsx)(w.Provider,{value:t,children:e})})}}),(window.wp=window.wp||{}).router=t})();
//# sourceMappingURL=index.min.js.map