!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="651edc65-b324-4237-b6d6-9ed9e9fbe942",e._sentryDebugIdIdentifier="sentry-dbid-651edc65-b324-4237-b6d6-9ed9e9fbe942")}catch(e){}}();var _sentryModuleMetadataGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};"use strict";_sentryModuleMetadataGlobal._sentryModuleMetadata=_sentryModuleMetadataGlobal._sentryModuleMetadata||{},_sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack]=Object.assign({},_sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack],{"_sentryBundlerPluginAppKey:sentry-changelog":!0}),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[644],{6129:(e,t,r)=>{var n=r(94685);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},17198:(e,t,r)=>{e.exports.jsxRuntime=r(95155)},81311:(e,t,r)=>{r.d(t,{m:()=>f});var n={};r.r(n),r.d(n,{MDXContext:()=>s,MDXProvider:()=>c,useMDXComponents:()=>o,withMDXComponents:()=>u});var l=r(12115),a=r(17198);let s=l.createContext({});function u(e){return function(t){let r=o(t.components);return l.createElement(e,{...t,allComponents:r})}}function o(e){let t=l.useContext(s);return l.useMemo(()=>"function"==typeof e?e(t):{...t,...e},[t,e])}let i={};function c({components:e,children:t,disableParentContext:r}){let n;return n=r?"function"==typeof e?e({}):e||i:o(e),l.createElement(s.Provider,{value:n},t)}function f(e){let{compiledSource:t,frontmatter:r,scope:s,components:u={},lazy:o}=e,[i,f]=(0,l.useState)(!o||"undefined"==typeof window);(0,l.useEffect)(()=>{if(o){let e=window.requestIdleCallback(()=>{f(!0)});return()=>window.cancelIdleCallback(e)}},[]);let d=(0,l.useMemo)(()=>{let e=Object.assign({opts:{...n,...a.jsxRuntime}},{frontmatter:r},s),l=Object.keys(e),u=Object.values(e),o=Reflect.construct(Function,l.concat("".concat(t)));return o.apply(o,u).default},[s,t]);if(!i)return l.createElement("div",{dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0});let h=l.createElement(c,{components:u},l.createElement(d,null));return o?l.createElement("div",null,h):h}"undefined"!=typeof window&&(window.requestIdleCallback=window.requestIdleCallback||function(e){var t=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})},15366:(e,t,r)=>{r.d(t,{rl:()=>f,IN:()=>i,GJ:()=>o,tU:()=>u,ZA:()=>R});var n=function(){try{if("undefined"==typeof localStorage)return!1;let e="nuqs-localStorage-test";localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;if(localStorage.removeItem(e),!t)return!1}catch(e){return console.error("[nuqs]: debug mode is disabled (localStorage unavailable).",e),!1}let e=localStorage.getItem("debug")??"";return e.includes("nuqs")||e.includes("next-usequerystate")}();function l(e,...t){if(!n)return;let r=function(e,...t){return e.replace(/%[sfdO]/g,e=>{let r=t.shift();return"%O"===e&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}(e,...t);performance.mark(r),console.log(e,...t)}function a(e,t,r){try{return e(t)}catch(e){return function(e,...t){n&&console.warn(e,...t)}("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function s(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),a(e.parse,r)}return{eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}var u=s({parse:e=>e,serialize:e=>`${e}`}),o=s({parse:e=>{let t=parseInt(e);return Number.isNaN(t)?null:t},serialize:e=>Math.round(e).toFixed()});function i(e,t=","){let r=e.eq??((e,t)=>e===t),n=encodeURIComponent(t);return s({parse:r=>""===r?[]:r.split(t).map((r,l)=>a(e.parse,r.replaceAll(n,t),`[${l}]`)).filter(e=>null!=e),serialize:r=>r.map(r=>(e.serialize?e.serialize(r):String(r)).replaceAll(t,n)).join(t),eq:(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>r(e,t[n]))})}function c(e){if(0===e.size)return"";let t=[];for(let[r,n]of e.entries()){let e=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${e}=${n.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(//g,"%3E")}`)}return"?"+t.join("&")}function f(e){return function(t,r={}){let[n,l]=d(t)?function(e){if("string"==typeof e){let[t="",r]=e.split("?");return[t,new URLSearchParams(r)]}return e instanceof URLSearchParams?["",new URLSearchParams(e)]:[e.origin+e.pathname,new URLSearchParams(e.searchParams)]}(t):["",new URLSearchParams],a=d(t)?r:t;if(null===a){for(let t in e)l.delete(t);return n+c(l)}for(let t in e){let r=e[t],n=a[t];if(!r||void 0===n)continue;let s=void 0!==r.defaultValue&&(r.eq??((e,t)=>e===t))(n,r.defaultValue);null===n||r.clearOnDefault&&s?l.delete(t):l.set(t,r.serialize(n))}return n+c(l)}}function d(e){return"string"==typeof e||e instanceof URLSearchParams||e instanceof URL}s({parse:e=>{let t=parseInt(e,16);return Number.isNaN(t)?null:t},serialize:e=>{let t=Math.round(e).toString(16);return t.padStart(t.length+t.length%2,"0")}}),s({parse:e=>{let t=parseFloat(e);return Number.isNaN(t)?null:t},serialize:e=>e.toString()}),s({parse:e=>"true"===e,serialize:e=>e?"true":"false"}),s({parse:e=>{let t=parseInt(e);return Number.isNaN(t)?null:new Date(t)},serialize:e=>e.valueOf().toString()}),s({parse:e=>{let t=new Date(e);return Number.isNaN(t.valueOf())?null:t},serialize:e=>e.toISOString()});var h={409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` was about to load on top.",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function p(e){return`[nuqs] ${h[e]} See https://err.47ng.com/NUQS-${e}`}var y=r(6129),m=r(12115),g=function(){if("undefined"==typeof window||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}(),w=new Map,b={history:"replace",scroll:!1,shallow:!0,throttleMs:g},S=new Set,M=0,_=null;function q(e){return w.get(e)??null}function v(e,t){return(e.split("#")[0]??"")+c(t)+location.hash}var O=Symbol("__nuqs__SYNC__"),I="__nuqs__NO_SYNC__",P=Symbol("__nuqs__NOTIFY__"),N=function(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(e){e(r)}),(n=e.get("*"))&&n.slice().map(function(e){e(t,r)})}}}();function R(e,{history:t="replace",shallow:r=!0,scroll:n=!1,throttleMs:s=g,parse:u=e=>e,serialize:o=String,eq:i=(e,t)=>e===t,defaultValue:c,clearOnDefault:f=!1,startTransition:d}={history:"replace",scroll:!1,shallow:!0,throttleMs:g,parse:e=>e,serialize:String,eq:(e,t)=>e===t,clearOnDefault:!1,defaultValue:void 0}){let h=(0,y.useRouter)(),P=(0,y.useSearchParams)(),E=m.useRef(null),[k,C]=m.useState(()=>{let t=q(e),r=P?.get(e)??null,n=t??r;return E.current=n,null===n?null:a(u,n,e)}),x=m.useRef(k);l("[nuqs `%s`] render - state: %O, iSP: %s",e,k,P?.get(e)??null),m.useEffect(()=>{if(window.next?.version!=="14.0.3")return;let t=P.get(e)??null;if(t===E.current)return;let r=null===t?null:a(u,t,e);l("[nuqs `%s`] syncFromUseSearchParams %O",e,r),x.current=r,E.current=t,C(r)},[P?.get(e),e]),m.useInsertionEffect(()=>{function t({state:t,query:r}){l("[nuqs `%s`] updateInternalState %O",e,t),x.current=t,E.current=r,C(t)}function r(r){let n=r.get(e);if(n===E.current)return;let s=null===n?null:a(u,n,e);l("[nuqs `%s`] syncFromURL %O",e,s),t({state:s,query:n})}return l("[nuqs `%s`] subscribing to sync",e),N.on(O,r),N.on(e,t),()=>{l("[nuqs `%s`] unsubscribing from sync",e),N.off(O,r),N.off(e,t)}},[e]);let U=m.useCallback((a,u={})=>{let y="function"==typeof a?a(x.current??c??null):a;return(u.clearOnDefault??f)&&null!==y&&void 0!==c&&i(y,c)&&(y=null),E.current=function(e,t,r,n){let a=null===t?null:r(t);return l("[nuqs queue] Enqueueing %s=%s %O",e,a,n),w.set(e,a),"push"===n.history&&(b.history="push"),n.scroll&&(b.scroll=!0),!1===n.shallow&&(b.shallow=!1),n.startTransition&&(S.add(n.startTransition),b.shallow=!1),b.throttleMs=Math.max(n.throttleMs??g,Number.isFinite(b.throttleMs)?b.throttleMs:0),a}(e,y,o,{history:u.history??t,shallow:u.shallow??r,scroll:u.scroll??n,throttleMs:u.throttleMs??s,startTransition:u.startTransition??d}),N.emit(e,{state:y,query:E.current}),null===_&&(_=new Promise((e,t)=>{if(!Number.isFinite(b.throttleMs)){l("[nuqs queue] Skipping flush due to throttleMs=Infinity"),e(new URLSearchParams(location.search)),setTimeout(()=>{_=null},0);return}function r(){M=performance.now();let[r,n]=function(e){let t=new URLSearchParams(location.search);if(0===w.size)return[t,null];let r=Array.from(w.entries()),n={...b},a=Array.from(S);for(let[e,a]of(w.clear(),S.clear(),b.history="replace",b.scroll=!1,b.shallow=!0,b.throttleMs=g,l("[nuqs queue] Flushing queue %O with options %O",r,n),r))null===a?t.delete(e):t.set(e,a);try{let r=window.next?.router;if("string"==typeof r?.state?.asPath){let e=v(r.state.asPath.split("?")[0]??"",t);l("[nuqs queue (pages)] Updating url: %s",e),("push"===n.history?r.push:r.replace).call(r,e,e,{scroll:n.scroll,shallow:n.shallow})}else{let r=v(location.origin+location.pathname,t);l("[nuqs queue (app)] Updating url: %s",r);let s="push"===n.history?history.pushState:history.replaceState,u=(window.next?.version??"")>="14.1.0"?null:history.state;s.call(history,u,I,r),n.scroll&&window.scrollTo(0,0),n.shallow||function(e,t){let r=n=>{if(n===e.length)return t();let l=e[n];if(!l)throw Error("Invalid transition function");l(()=>r(n+1))};r(0)}(a,()=>{e.replace(r,{scroll:!1})})}return[t,null]}catch(e){return console.error(p(429),r.map(([e])=>e).join(),e),[t,e]}}(h);null===n?e(r):t(r),_=null}setTimeout(function(){let e=performance.now()-M,t=b.throttleMs,n=Math.max(0,Math.min(t,t-e));l("[nuqs queue] Scheduling flush in %f ms. Throttled at %f ms",n,t),0===n?r():setTimeout(r,n)},0)})),_},[e,t,r,n,s,d]);return[k??c??null,U]}"object"==typeof history&&function(){let e="1.20.0",t=history.__nuqs_patched;if(t){t!==e&&console.error(p(409),t,e);return}for(let t of(l("[nuqs] Patching history with %s",e),["pushState","replaceState"])){let e=history[t].bind(history);history[t]=function(r,n,a){if(!a)return l("[nuqs] history.%s(null) (%s) %O",t,n,r),e(r,n,a);let s=n===I?"internal":"external",u=new URL(a,location.origin).searchParams;if(l("[nuqs] history.%s(%s) (%s) %O",t,a,s,r),"external"===s){for(let[e,t]of u.entries()){let r=q(e);null!==r&&r!==t&&(l("[nuqs] Overwrite detected for key: %s, Server: %s, queue: %s",e,t,r),u.set(e,r))}setTimeout(()=>{l("[nuqs] External history.%s call: triggering sync with %s",t,u),N.emit(O,u),N.emit(P,{search:u,source:s})},0)}else setTimeout(()=>{N.emit(P,{search:u,source:s})},0);return e(r,n===I?"":n,a)}}Object.defineProperty(history,"__nuqs_patched",{value:e,writable:!1,enumerable:!1,configurable:!1})}()}}]);