import{d as P,e as R}from"./Flex-Cq4As9pu.js";import{n as b}from"./isSSR-BoRVR0fW.js";const C=(e,r,t)=>{const s=R(e,r,t);return b()(s)},M=(e,r)=>{const t=P();return C(t,e,r)};/**
 * @remix-run/router v1.15.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var g;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(g||(g={}));function v(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function m(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}var w;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(w||(w={}));function U(e,r){r===void 0&&(r={});let t=e;t.endsWith("*")&&t!=="*"&&!t.endsWith("/*")&&(m(!1,'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".')),t=t.replace(/\*$/,"/*"));const s=t.startsWith("/")?"/":"",n=a=>a==null?"":typeof a=="string"?a:String(a),i=t.split(/\/+/).map((a,o,f)=>{if(o===f.length-1&&a==="*")return n(r["*"]);const h=a.match(/^:([\w-]+)(\??)$/);if(h){const[,l,c]=h;let d=r[l];return v(c==="?"||d!=null,'Missing ":'+l+'" param'),n(d)}return a.replace(/\?$/g,"")}).filter(a=>!!a);return s+i.join("/")}function A(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[t,s]=S(e.path,e.caseSensitive,e.end),n=r.match(t);if(!n)return null;let i=n[0],a=i.replace(/(.)\/+$/,"$1"),o=n.slice(1);return{params:s.reduce((u,h,l)=>{let{paramName:c,isOptional:d}=h;if(c==="*"){let y=o[l]||"";a=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const p=o[l];return d&&!p?u[c]=void 0:u[c]=E(p||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function S(e,r,t){r===void 0&&(r=!1),t===void 0&&(t=!0),m(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,f)=>(s.push({paramName:o,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,r?void 0:"i"),s]}function E(e,r){try{return decodeURIComponent(e)}catch(t){return m(!1,'The value for the URL param "'+r+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),e}}const $=["post","put","patch","delete"];new Set($);const T=["get",...$];new Set(T);export{U as g,A as m,M as u};
