{"version":3,"sources":["../src/redirect-query.ts"],"sourcesContent":["/** Preserve an incoming query when a redirect destination does not declare one. */\nexport function appendFarmRedirectQuery(destination: string, search: string): string {\n  if (!search || search === \"?\") return destination;\n\n  const hashIndex = destination.indexOf(\"#\");\n  const pathAndQuery = hashIndex === -1 ? destination : destination.slice(0, hashIndex);\n  if (pathAndQuery.includes(\"?\")) return destination;\n\n  if (hashIndex === -1) return `${destination}${search}`;\n  return `${pathAndQuery}${search}${destination.slice(hashIndex)}`;\n}\n"],"mappings":";;;;;AACO,SAAS,wBAAwB,aAAqB,QAAwB;AACnF,MAAI,CAAC,UAAU,WAAW,IAAK,QAAO;AAEtC,QAAM,YAAY,YAAY,QAAQ,GAAG;AACzC,QAAM,eAAe,cAAc,KAAK,cAAc,YAAY,MAAM,GAAG,SAAS;AACpF,MAAI,aAAa,SAAS,GAAG,EAAG,QAAO;AAEvC,MAAI,cAAc,GAAI,QAAO,GAAG,WAAW,GAAG,MAAM;AACpD,SAAO,GAAG,YAAY,GAAG,MAAM,GAAG,YAAY,MAAM,SAAS,CAAC;AAChE;AATgB;","names":[]}