PageSourceSearch

https://merakal.in/assets/lib-DMCkan9C.js

js merakal.in collected 2026-10-07 16:08:28 UTC 12,218 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{B as t,C as n,E as r,G as i,H as a,I as o,J as s,K as c,L as l,S as u,U as d,Y as f,_ as p,b as m,d as h,f as g,h as _,l as v,m as y,n as b,p as x,q as S,w as C,x as w,y as T}from"./components-CdDI1Kbj.js";import{a as E,c as D,g as O,n as k,s as A}from"./errorBoundaries-BiCkdjdY.js";var j=`application/x-www-form-urlencoded`;function M(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function N(e){return M(e)&&e.tagName.toLowerCase()===`button`}function P(e){return M(e)&&e.tagName.toLowerCase()===`form`}function F(e){return M(e)&&e.tagName.toLowerCase()===`input`}function I(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function L(e,t){return e.button===0&&(!t||t===`_self`)&&!I(e)}function R(e=``){return new URLSearchParams(typeof e==`string`||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]])},[]))}function z(e,t){let n=R(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var B=null;function V(){if(B===null)try{new FormData(document.createElement(`form`),0),B=!1}catch{B=!0}return B}var ee=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function H(e){return e!=null&&!ee.has(e)?(S(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${j}"`),null):e}function te(e,t){let n,r,i,a,o;if(P(e)){let o=e.getAttribute(`action`);r=o?d(o,t):null,n=e.getAttribute(`method`)||`get`,i=H(e.getAttribute(`enctype`))||j,a=new FormData(e)}else if(N(e)||F(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?d(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=H(e.getAttribute(`formenctype`))||H(o.getAttribute(`enctype`))||j,a=new FormData(o,e),!V()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(M(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=j,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var U=e(f(),1),ne=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ne&&(window.__reactRouterVersion=`8.1.0`)}catch{}function re({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=U.useState({action:n.action,location:n.location}),o=U.useCallback(e=>{r===!1?a(e):U.startTransition(()=>a(e))},[r]);return U.useLayoutEffect(()=>n.listen(o),[n,o]),U.createElement(b,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}re.displayName=`unstable_HistoryRouter`;var W=U.forwardRef(function({onClick:e,discover:n=`render`,prefetch:r=`none`,relative:i,reloadDocument:c,replace:l,mask:d,state:f,target:p,to:m,preventScrollReset:g,viewTransition:_,defaultShouldRevalidate:y,...b},x){let{basename:S,navigator:C,useTransitions:w}=U.useContext(u),T=typeof m==`string`&&s.test(m),O=t(m,S);m=O.to;let k=v(m,{relative:i}),j=h(),M=null;if(d){let e=a(d,[],j.mask?j.mask.pathname:`/`,!0);S!==`/`&&(e.pathname=e.pathname===`/`?S:o([S,e.pathname])),M=C.createHref(e)}let[N,P,F]=D(r,b),I=ae(m,{replace:l,mask:d,state:f,target:p,preventScrollReset:g,relative:i,viewTransition:_,defaultShouldRevalidate:y,useTransitions:w});function L(t){e&&e(t),t.defaultPrevented||I(t)}let R=!(O.isExternal||c),z=U.createElement(`a`,{...b,...F,href:(R?M:void 0)||O.absoluteURL||k,onClick:R?L:e,ref:A(x,P),target:p,"data-discover":!T&&n===`render`?`true`:void 0});return N&&!T?U.createElement(U.Fragment,null,z,U.createElement(E,{page:k})):z});W.displayName=`Link`;var ie=U.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let f=_(a,{relative:c.relative}),p=h(),g=U.useContext(m),{navigator:v,basename:y}=U.useContext(u),b=g!=null&&pe(f)&&o===!0,x=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,S=p.pathname,C=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;t||(S=S.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&y&&(C=d(C,y)||C);let w=x!==`/`&&x.endsWith(`/`)?x.length-1:x.length,T=S===x||!r&&S.startsWith(x)&&S.charAt(w)===`/`,E=C!=null&&(C===x||!r&&C.startsWith(x)&&C.charAt(x.length)===`/`),D={isActive:T,isPending:E,isTransitioning:b},O=T?e:void 0,k;k=typeof n==`function`?n(D):[n,T?`active`:null,E?`pending`:null,b?`transitioning`:null].filter(
1Boolean).join(` `);let A=typeof i==`function`?i(D):i;return U.createElement(W,{...c,"aria-current":O,className:k,ref:l,style:A,to:a,viewTransition:o},typeof s==`function`?s(D):s)});ie.displayName=`NavLink`;var G=U.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:c,onSubmit:l,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=U.useContext(u),v=X(),y=le(c,{relative:d}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&s.test(c);return U.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,c=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?U.startTransition(()=>c()):c()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});G.displayName=`Form`;function K({getKey:e,storageKey:t,...n}){let r=U.useContext(k),{basename:i}=U.useContext(u),a=h(),o=g();de({getKey:e,storageKey:t});let s=U.useMemo(()=>{if(!r||!e)return null;let t=$(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
1typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),U.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${O(JSON.stringify(t||Z))}, ${O(JSON.stringify(s))})`}})}K.displayName=`ScrollRestoration`;function q(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function J(e){let t=U.useContext(T);return c(t,q(e)),t}function Y(e){let t=U.useContext(m);return c(t,q(e)),t}function ae(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=x(),f=h(),p=_(e,{relative:s});return U.useCallback(m=>{if(L(m,t)){m.preventDefault();let t=n===void 0?i(f)===i(p):n,h=()=>d(e,{replace:t,mask:r,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?U.startTransition(()=>h()):h()}},[f,d,p,n,r,a,t,e,o,s,c,l,u])}function oe(e){S(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=U.useRef(R(e)),n=U.useRef(!1),r=h(),i=U.useMemo(()=>z(r.search,n.current?null:t.current),[r.search]),a=x();return[i,U.useCallback((e,t)=>{let r=R(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var se=0,ce=()=>`__${String(++se)}__`;function X(){let{router:e}=J(`useSubmit`),{basename:t}=U.useContext(u),n=p(),r=e.fetch,i=e.navigate;return U.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=te(e,t);a.navigate===!1?await r(a.fetcherKey||ce(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function le(e,{relative:t}={}){let{basename:r}=U.useContext(u),a=U.useContext(n);c(a,`useFormAction must be used inside a RouteContext`);let[s]=a.matches.slice(-1),l={..._(e||`.`,{relative:t})},d=h();if(e==null){l.search=d.search;let e=new URLSearchParams(l.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();l.search=n?`?${n}`:``}}return(!e||e===`.`)&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(l.pathname=l.pathname===`/`?r:o([r,l.pathname])),i(l)}function ue({key:e}={}){let{router:t}=J(`useFetcher`),i=Y(`useFetcher`),a=U.useContext(w),o=U.useContext(n),s=o.matches[o.matches.length-1]?.route.id;c(a,`useFetcher must be used inside a FetchersContext`),c(o,`useFetcher must be used inside a RouteContext`),c(s!=null,`useFetcher can only be used on routes that contain a unique "id"`);let l=U.useId(),[u,d]=U.useState(e||l);e&&e!==u&&d(e);let{deleteFetcher:f,getFetcher:p,resetFetcher:m,fetch:h}=t;U.useEffect(()=>(p(u),()=>f(u)),[f,p,u]);let g=U.useCallback(async(e,t)=>{c(s,`No routeId available for fetcher.load()`),await h(u,s,e,t)},[u,s,h]),_=X(),v=U.useCallback(async(e,t)=>{await _(e,{...t,navigate:!1,fetcherKey:u})},[u,_]),y=U.useCallback(e=>m(u,e),[m,u]),b=U.useMemo(()=>{let e=U.forwardRef((e,t)=>U.createElement(G,{...e,navigate:!1,fetcherKey:u,ref:t}));return e.displayName=`fetcher.Form`,e},[u]),x=i.fetchers.get(u)||r,S=a.get(u);return U.useMemo(()=>({Form:b,submit:v,load:g,reset:y,...x,data:S}),[b,v,g,y,x,S])}var Z=`react-router-scroll-positions`,Q={};function $(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:d(e.pathname,n)||e.pathname},t)),i??=e.key,i}function de({getKey:e,storageKey:t}={}){let{router:n}=J(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Y(`useScrollRestoration`),{basename:a}
1=U.useContext(u),o=h(),s=g(),c=y();U.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),fe(U.useCallback(()=>{if(c.state===`idle`){let t=$(o,s,a,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||Z,JSON.stringify(Q))}catch(e){S(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(U.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Z);e&&(Q=JSON.parse(e))}catch{}},[t]),U.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>$(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),U.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{S(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function fe(e,t){let{capture:n}=t||{};U.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function pe(e,{relative:t}={}){let n=U.useContext(C);c(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=J(`useViewTransitionState`),i=_(e,{relative:t});if(!n.isTransitioning)return!1;let a=d(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=d(n.nextLocation.pathname,r)||n.nextLocation.pathname;return l(i.pathname,o)!=null||l(i.pathname,a)!=null}export{oe as a,ue as i,W as n,K as r,G as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.