Build 533169stable
Module 354172
4,198 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{Kl:()=>B});var r,i,s,a,o=n(64700),l=n(340287),u=n(814947),c=n(873263);function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}let _="get",f="application/x-www-form-urlencoded";function p(e){return null!=e&&"string"==typeof e.tagName}function h(e){return p(e)&&"button"===e.tagName.toLowerCase()}function m(e){return p(e)&&"form"===e.tagName.toLowerCase()}function E(e){return p(e)&&"input"===e.tagName.toLowerCase()}function g(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function A(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}let I=null;function T(){if(null===I)try{new FormData(document.createElement("form"),0),I=!1}catch(e){I=!0}return I}let S=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function y(e){return null==e||S.has(e)?e:null}function v(e,t){let n,r,i,s,a;if(m(e)){let a=e.getAttribute("action");r=a?stripBasename(a,t):null,n=e.getAttribute("method")||_,i=y(e.getAttribute("enctype"))||f,s=new FormData(e)}else if(h(e)||E(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let o=e.getAttribute("formaction")||a.getAttribute("action");if(r=o?stripBasename(o,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||_,i=y(e.getAttribute("formenctype"))||y(a.getAttribute("enctype"))||f,s=new FormData(a,e),!T()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?t+".":"";s.append(e+"x","0"),s.append(e+"y","0")}else t&&s.append(t,r)}}else if(p(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else n=_,r=null,i=f,a=e;return s&&"text/plain"===i&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}let N="6";try{window.__reactRouterVersion=N}catch(e){}function C(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)n[e]=new UNSAFE_ErrorResponseImpl(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if(r.__subType){let t=window[r.__subType];if("function"==typeof t)try{let i=new t(r.message);i.stack="",n[e]=i}catch(e){}}if(null==n[e]){let t=Error(r.message);t.stack="",n[e]=t}}else n[e]=r;return n}let R="startTransition",O=(r||(r=n.t(o,2)))[R],b="flushSync",D=(i||(i=n.t(l,2)))[b],L="useId";(r||(r=n.t(o,2)))[L];"u">typeof window&&void 0!==window.document&&window.document.createElement;function w(e){let t=React.useContext(UNSAFE_DataRouterContext);return t||UNSAFE_invariant(!1),t}function M(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function P(){if("u"<typeof document)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(s||(s={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(a||(a={}));let x=0,k=()=>"__"+String(++x)+"__",U="react-router-scroll-positions",G=null;function F(e,t){let{capture:n}=t||{};React.useEffect(()=>{let t=null!=n?{capture:n}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}},[e,n])}let V="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:()=>{};function B(e){let{children:t}=e,n=(0,c.W6)(),[r,i]=o.useState(()=>({location:n.location,action:n.action}));return V(()=>{n.listen((e,t)=>i({location:e,action:t}))},[n]),o.createElement(u.Ix,{navigationType:r.action,location:r.location,navigator:n},o.createElement(u.BV,null,o.createElement(u.qh,{path:"*",element:t})))}}