File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/scripts/router/index.min.js
"use strict";var wp;(wp||={}).router=(()=>{var qt=Object.create;var V=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var $t=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bt=(e,t)=>{for(var r in t)V(e,r,{get:t[r],enumerable:!0})},ut=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Vt(t))!Ut.call(e,a)&&a!==r&&V(e,a,{get:()=>t[a],enumerable:!(n=Qt(t,a))||n.enumerable});return e};var O=(e,t,r)=>(r=e!=null?qt($t(e)):{},ut(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),Gt=e=>ut(V({},"__esModule",{value:!0}),e);var tt=T((ge,Pt)=>{Pt.exports=window.wp.element});var et=T((me,Ot)=>{Ot.exports=window.wp.url});var Rt=T((ye,_t)=>{_t.exports=window.wp.compose});var rt=T((we,At)=>{At.exports=window.ReactJSXRuntime});var Ht=T((Oe,Mt)=>{Mt.exports=window.wp.privateApis});var ce={};Bt(ce,{privateApis:()=>it});var Jt=Object.create;function K(){var e=Jt(null);return e.__=void 0,delete e.__,e}var vt=function(t,r,n){this.path=t,this.matcher=r,this.delegate=n};vt.prototype.to=function(t,r){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),r){if(r.length===0)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,r,this.delegate)}};var $=function(t){this.routes=K(),this.children=K(),this.target=t};$.prototype.add=function(t,r){this.routes[t]=r};$.prototype.addChild=function(t,r,n,a){var o=new $(r);this.children[t]=o;var i=X(t,o,a);a&&a.contextEntered&&a.contextEntered(r,i),n(i)};function X(e,t,r){function n(a,o){var i=e+a;if(o)o(X(i,t,r));else return new vt(i,t,r)}return n}function Yt(e,t,r){for(var n=0,a=0;a<e.length;a++)n+=e[a].path.length;t=t.substr(n);var o={path:t,handler:r};e.push(o)}function dt(e,t,r,n){for(var a=t.routes,o=Object.keys(a),i=0;i<o.length;i++){var s=o[i],c=e.slice();Yt(c,s,a[s]);var u=t.children[s];u?dt(c,u,r,n):r.call(n,c)}}var Wt=function(e,t){var r=new $;e(X("",r,this.delegate)),dt([],r,function(n){t?t(this,n):this.add(n)},this)};function pt(e){return e.split("/").map(Z).join("/")}var Ft=/%|\//g;function Z(e){return e.length<3||e.indexOf("%")===-1?e:decodeURIComponent(e).replace(Ft,encodeURIComponent)}var Kt=/%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g;function gt(e){return encodeURIComponent(e).replace(Kt,decodeURIComponent)}var Xt=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g,B=Array.isArray,Zt=Object.prototype.hasOwnProperty;function mt(e,t){if(typeof e!="object"||e===null)throw new Error("You must pass an object as the second argument to `generate`.");if(!Zt.call(e,t))throw new Error("You must provide param `"+t+"` to `generate`.");var r=e[t],n=typeof r=="string"?r:""+r;if(n.length===0)throw new Error("You must provide a param `"+t+"`.");return n}var M=[];M[0]=function(e,t){for(var r=t,n=e.value,a=0;a<n.length;a++){var o=n.charCodeAt(a);r=r.put(o,!1,!1)}return r};M[1]=function(e,t){return t.put(47,!0,!0)};M[2]=function(e,t){return t.put(-1,!1,!0)};M[4]=function(e,t){return t};var H=[];H[0]=function(e){return e.value.replace(Xt,"\\$1")};H[1]=function(){return"([^/]+)"};H[2]=function(){return"(.+)"};H[4]=function(){return""};var j=[];j[0]=function(e){return e.value};j[1]=function(e,t){var r=mt(t,e.value);return y.ENCODE_AND_DECODE_PATH_SEGMENTS?gt(r):r};j[2]=function(e,t){return mt(t,e.value)};j[4]=function(){return""};var ct=Object.freeze({}),U=Object.freeze([]);function te(e,t,r){t.length>0&&t.charCodeAt(0)===47&&(t=t.substr(1));for(var n=t.split("/"),a=void 0,o=void 0,i=0;i<n.length;i++){var s=n[i],c=0,u=0;s===""?u=4:s.charCodeAt(0)===58?u=1:s.charCodeAt(0)===42?u=2:u=0,c=2<<u,c&12&&(s=s.slice(1),a=a||[],a.push(s),o=o||[],o.push((c&4)!==0)),c&14&&r[u]++,e.push({type:u,value:Z(s)})}return{names:a||U,shouldDecodes:o||U}}function lt(e,t,r){return e.char===t&&e.negate===r}var C=function(t,r,n,a,o){this.states=t,this.id=r,this.char=n,this.negate=a,this.nextStates=o?r:null,this.pattern="",this._regex=void 0,this.handlers=void 0,this.types=void 0};C.prototype.regex=function(){return this._regex||(this._regex=new RegExp(this.pattern)),this._regex};C.prototype.get=function(t,r){var n=this,a=this.nextStates;if(a!==null)if(B(a))for(var o=0;o<a.length;o++){var i=n.states[a[o]];if(lt(i,t,r))return i}else{var s=this.states[a];if(lt(s,t,r))return s}};C.prototype.put=function(t,r,n){var a;if(a=this.get(t,r))return a;var o=this.states;return a=new C(o,o.length,t,r,n),o[o.length]=a,this.nextStates==null?this.nextStates=a.id:B(this.nextStates)?this.nextStates.push(a.id):this.nextStates=[this.nextStates,a.id],a};C.prototype.match=function(t){var r=this,n=this.nextStates;if(!n)return[];var a=[];if(B(n))for(var o=0;o<n.length;o++){var i=r.states[n[o]];ht(i,t)&&a.push(i)}else{var s=this.states[n];ht(s,t)&&a.push(s)}return a};function ht(e,t){return e.negate?e.char!==t&&e.char!==-1:e.char===t||e.char===-1}function ee(e){return e.sort(function(t,r){var n=t.types||[0,0,0],a=n[0],o=n[1],i=n[2],s=r.types||[0,0,0],c=s[0],u=s[1],h=s[2];if(i!==h)return i-h;if(i){if(a!==c)return c-a;if(o!==u)return u-o}return o!==u?o-u:a!==c?c-a:0})}function re(e,t){for(var r=[],n=0,a=e.length;n<a;n++){var o=e[n];r=r.concat(o.match(t))}return r}var G=function(t){this.length=0,this.queryParams=t||{}};G.prototype.splice=Array.prototype.splice;G.prototype.slice=Array.prototype.slice;G.prototype.push=Array.prototype.push;function ne(e,t,r){var n=e.handlers,a=e.regex();if(!a||!n)throw new Error("state not initialized");var o=t.match(a),i=1,s=new G(r);s.length=n.length;for(var c=0;c<n.length;c++){var u=n[c],h=u.names,d=u.shouldDecodes,v=ct,p=!1;if(h!==U&&d!==U)for(var g=0;g<h.length;g++){p=!0;var x=h[g],E=o&&o[i++];v===ct&&(v={}),y.ENCODE_AND_DECODE_PATH_SEGMENTS&&d[g]?v[x]=E&&decodeURIComponent(E):v[x]=E}s[c]={handler:u.handler,params:v,isDynamic:p}}return s}function ft(e){e=e.replace(/\+/gm,"%20");var t;try{t=decodeURIComponent(e)}catch{t=""}return t}var y=function(){this.names=K();var t=[],r=new C(t,0,-1,!0,!1);t[0]=r,this.states=t,this.rootState=r};y.prototype.add=function(t,r){for(var n=this.rootState,a="^",o=[0,0,0],i=new Array(t.length),s=[],c=!0,u=0,h=0;h<t.length;h++){for(var d=t[h],v=te(s,d.path,o),p=v.names,g=v.shouldDecodes;u<s.length;u++){var x=s[u];x.type!==4&&(c=!1,n=n.put(47,!1,!1),a+="/",n=M[x.type](x,n),a+=H[x.type](x))}i[h]={handler:d.handler,names:p,shouldDecodes:g}}c&&(n=n.put(47,!1,!1),a+="/"),n.handlers=i,n.pattern=a+"$",n.types=o;var E;typeof r=="object"&&r!==null&&r.as&&(E=r.as),E&&(this.names[E]={segments:s,handlers:i})};y.prototype.handlersFor=function(t){var r=this.names[t];if(!r)throw new Error("There is no route named "+t);for(var n=new Array(r.handlers.length),a=0;a<r.handlers.length;a++){var o=r.handlers[a];n[a]=o}return n};y.prototype.hasRoute=function(t){return!!this.names[t]};y.prototype.generate=function(t,r){var n=this.names[t],a="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,i=0;i<o.length;i++){var s=o[i];s.type!==4&&(a+="/",a+=j[s.type](s,r))}return a.charAt(0)!=="/"&&(a="/"+a),r&&r.queryParams&&(a+=this.generateQueryString(r.queryParams)),a};y.prototype.generateQueryString=function(t){var r=[],n=Object.keys(t);n.sort();for(var a=0;a<n.length;a++){var o=n[a],i=t[o];if(i!=null){var s=encodeURIComponent(o);if(B(i))for(var c=0;c<i.length;c++){var u=o+"[]="+encodeURIComponent(i[c]);r.push(u)}else s+="="+encodeURIComponent(i),r.push(s)}}return r.length===0?"":"?"+r.join("&")};y.prototype.parseQueryString=function(t){for(var r=t.split("&"),n={},a=0;a<r.length;a++){var o=r[a].split("="),i=ft(o[0]),s=i.length,c=!1,u=void 0;o.length===1?u="true":(s>2&&i.slice(s-2)==="[]"&&(c=!0,i=i.slice(0,s-2),n[i]||(n[i]=[])),u=o[1]?ft(o[1]):""),c?n[i].push(u):n[i]=u}return n};y.prototype.recognize=function(t){var r,n=[this.rootState],a={},o=!1,i=t.indexOf("#");i!==-1&&(t=t.substr(0,i));var s=t.indexOf("?");if(s!==-1){var c=t.substr(s+1,t.length);t=t.substr(0,s),a=this.parseQueryString(c)}t.charAt(0)!=="/"&&(t="/"+t);var u=t;y.ENCODE_AND_DECODE_PATH_SEGMENTS?t=pt(t):(t=decodeURI(t),u=decodeURI(u));var h=t.length;h>1&&t.charAt(h-1)==="/"&&(t=t.substr(0,h-1),u=u.substr(0,u.length-1),o=!0);for(var d=0;d<t.length&&(n=re(n,t.charCodeAt(d)),!!n.length);d++);for(var v=[],p=0;p<n.length;p++)n[p].handlers&&v.push(n[p]);n=ee(v);var g=v[0];return g&&g.handlers&&(o&&g.pattern&&g.pattern.slice(-5)==="(.+)$"&&(u=u+"/"),r=ne(g,u,a)),r};y.VERSION="0.3.4";y.ENCODE_AND_DECODE_PATH_SEGMENTS=!0;y.Normalizer={normalizeSegment:Z,normalizePath:pt,encodePathSegment:gt};y.prototype.map=Wt;var yt=y;function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}var N;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(N||(N={}));var wt=function(e){return e};var xt="beforeunload";var ae="popstate";function St(e){e===void 0&&(e={});var t=e,r=t.window,n=r===void 0?document.defaultView:r,a=n.history;function o(){var l=n.location,f=l.pathname,w=l.search,S=l.hash,b=a.state||{};return[b.idx,wt({pathname:f,search:w,hash:S,state:b.usr||null,key:b.key||"default"})]}var i=null;function s(){if(i)p.call(i),i=null;else{var l=N.Pop,f=o(),w=f[0],S=f[1];if(p.length){if(w!=null){var b=h-w;b&&(i={action:l,location:S,retry:function(){L(b*-1)}},L(b))}}else _(l)}}n.addEventListener(ae,s);var c=N.Pop,u=o(),h=u[0],d=u[1],v=bt(),p=bt();h==null&&(h=0,a.replaceState(z({},a.state,{idx:h}),""));function g(l){return typeof l=="string"?l:ie(l)}function x(l,f){return f===void 0&&(f=null),wt(z({pathname:d.pathname,hash:"",search:""},typeof l=="string"?se(l):l,{state:f,key:oe()}))}function E(l,f){return[{usr:l.state,key:l.key,idx:f},g(l)]}function q(l,f,w){return!p.length||(p.call({action:l,location:f,retry:w}),!1)}function _(l){c=l;var f=o();h=f[0],d=f[1],v.call({action:c,location:d})}function R(l,f){var w=N.Push,S=x(l,f);function b(){R(l,f)}if(q(w,S,b)){var A=E(S,h+1),F=A[0],Q=A[1];try{a.pushState(F,"",Q)}catch{n.location.assign(Q)}_(w)}}function st(l,f){var w=N.Replace,S=x(l,f);function b(){st(l,f)}if(q(w,S,b)){var A=E(S,h),F=A[0],Q=A[1];a.replaceState(F,"",Q),_(w)}}function L(l){a.go(l)}var It={get action(){return c},get location(){return d},createHref:g,push:R,replace:st,go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(f){return v.push(f)},block:function(f){var w=p.push(f);return p.length===1&&n.addEventListener(xt,Et),function(){w(),p.length||n.removeEventListener(xt,Et)}}};return It}function Et(e){e.preventDefault(),e.returnValue=""}function bt(){var e=[];return{get length(){return e.length},push:function(r){return e.push(r),function(){e=e.filter(function(n){return n!==r})}},call:function(r){e.forEach(function(n){return n&&n(r)})}}}function oe(){return Math.random().toString(36).substr(2,8)}function ie(e){var t=e.pathname,r=t===void 0?"/":t,n=e.search,a=n===void 0?"":n,o=e.hash,i=o===void 0?"":o;return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(r+=i.charAt(0)==="#"?i:"#"+i),r}function se(e){var t={};if(e){var r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));var n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}var m=O(tt(),1),P=O(et(),1),J=O(Rt(),1),nt=O(rt(),1),k=St(),at=(0,m.createContext)(null);at.displayName="RoutesContext";var I=(0,m.createContext)({pathArg:"p"});I.displayName="ConfigContext";var Ct=new WeakMap;function Nt(){let e=k.location,t=Ct.get(e);return t||(t={...e,query:Object.fromEntries(new URLSearchParams(e.search))},Ct.set(e,t)),t}function kt(){let e=(0,m.useContext)(at);if(!e)throw new Error("useLocation must be used within a RouterProvider");return e}function Y(){let{pathArg:e,beforeNavigate:t}=(0,m.useContext)(I),r=(0,J.useEvent)(async(n,a={})=>{let o=(0,P.getQueryArgs)(n),i=(0,P.getPath)("http://domain.com/"+n)??"",s=()=>{let u=t?t({path:i,query:o}):{path:i,query:o};return k.push({search:(0,P.buildQueryString)({[e]:u.path,...u.query})},a.state)};if(!window.matchMedia("(min-width: 782px)").matches||!document.startViewTransition||!a.transition){s();return}await new Promise(u=>{let h=a.transition??"";document.documentElement.classList.add(h),document.startViewTransition(()=>s()).finished.finally(()=>{document.documentElement.classList.remove(h),u()})})});return(0,m.useMemo)(()=>({navigate:r,back:k.back,invalidate:()=>{k.replace({search:k.location.search})}}),[r])}function ue(e,t,r,n){let{query:a={}}=e,[o,i]=(0,m.useState)();return(0,m.useEffect)(()=>{let{[r]:s="/",...c}=a,u=t.recognize(s)?.[0];async function h(d){let v=d.handler,p=async(E={})=>{let q=await Promise.all(Object.entries(E).map(async([_,R])=>typeof R=="function"?[_,await R({query:c,params:d.params,...n})]:[_,R]));return Object.fromEntries(q)},[g,x]=await Promise.all([p(v.areas),p(v.widths)]);i({name:v.name,areas:g,widths:x,params:d.params,query:c,path:(0,P.addQueryArgs)(s,c)})}return u?h(u):i({name:"404",path:(0,P.addQueryArgs)(s,c),areas:{},widths:{},query:c,params:{}}),()=>i(void 0)},[t,a,r,n]),o}function Dt({routes:e,pathArg:t,beforeNavigate:r,children:n,matchResolverArgs:a}){let o=(0,m.useSyncExternalStore)(k.listen,Nt,Nt),i=(0,m.useMemo)(()=>{let d=new yt;return(e??[]).forEach(v=>{d.add([{path:v.path,handler:v}],{as:v.name})}),d},[e]),s=ue(o,i,t,a),c=(0,J.usePrevious)(s),u=(0,m.useMemo)(()=>({beforeNavigate:r,pathArg:t}),[r,t]),h=s||c;return h?(0,nt.jsx)(I.Provider,{value:u,children:(0,nt.jsx)(at.Provider,{value:h,children:n})}):null}var W=O(tt(),1),D=O(et(),1);var Lt=O(rt(),1);function ot(e,t={}){let r=Y(),{pathArg:n,beforeNavigate:a}=(0,W.useContext)(I);function o(h){h?.preventDefault(),r.navigate(e,t)}let i=(0,D.getQueryArgs)(e),s=(0,D.getPath)("http://domain.com/"+e)??"",c=(0,W.useMemo)(()=>a?a({path:s,query:i}):{path:s,query:i},[s,i,a]),[u]=window.location.href.split("?");return{href:`${u}?${(0,D.buildQueryString)({[n]:c.path,...c.query})}`,onClick:o}}function Tt({to:e,options:t,children:r,...n}){let{href:a,onClick:o}=ot(e,t);return(0,Lt.jsx)("a",{href:a,onClick:o,...n,children:r})}var jt=O(Ht(),1),{lock:zt,unlock:_e}=(0,jt.__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");var it={};zt(it,{useHistory:Y,useLocation:kt,RouterProvider:Dt,useLink:ot,Link:Tt});return Gt(ce);})();
//# sourceMappingURL=index.min.js.map