1"use strict";(self.webpackChunkrdc_website=self.webpackChunkrdc_website||[]).push([[2324],{74645(e,t,n){n.d(t,{A:()=>l});n(63696);var s=n(11750),r=n(58116);const i="tabItem_wHwb";var a=n(62540);function o({children:e,className:t,hidden:n}){return(0,a.jsx)("div",{role:"tabpanel",className:(0,s.A)(i,t),hidden:n,children:e})}function l({children:e,className:t,value:n}){const{selectedValue:s,lazy:i}=(0,r.uc)(),l=n===s;return!l&&i?null:(0,a.jsx)(o,{className:t,hidden:!l,children:e})}},6779(e,t,n){n.d(t,{A:()=>m});n(63696);var s=n(11750),r=n(13912),i=n(58116),a=n(63447),o=n(49244);const l="tabList_J5MA",c="tabItem_l0OV";var d=n(62540);function h({className:e}){const{selectedValue:t,selectValue:n,tabValues:r,block:o}=(0,i.uc)(),l=[],{blockElementScrollPositionUntilNextRender:h}=(0,a.a_)(),u=e=>{const s=e.currentTarget,i=l.indexOf(s),a=r[i].value;a!==t&&(h(s),n(a))},p=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,d.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":o},e),children:r.map((({value:e,label:n,attributes:r})=>(0,d.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{l.push(e)},onKeyDown:p,onClick:u,...r,className:(0,s.A)("tabs__item",c,r?.className,{"tabs__item--active":t===e}),children:n??e},e)))})}function u({children:e}){return(0,d.jsx)("div",{className:"margin-top--md",children:e})}function p({className:e,children:t}){return(0,d.jsxs)("div",{className:(0,s.A)(r.G.tabs.container,"tabs-container",l),children:[(0,d.jsx)(h,{className:e}),(0,d.jsx)(u,{children:t})]})}function m(e){const t=(0,o.A)(),n=(0,i.OC)(e);return(0,d.jsx)(i.O_,{value:n,children:(0,d.jsx)(p,{className:e.className,children:(0,i.vT)(e.children)})},String(t))}},58116(e,t,n){n.d(t,{OC:()=>m,O_:()=>x,uc:()=>f,vT:()=>d});var s=n(63696),r=n(39853),i=n(76960),a=n(89624),o=n(99866),l=n(66953),c=n(62540);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e))}function h(e){const{values:t,children:n}=e;return(0,s.useMemo)((()=>{const e=t??function(e){return s.Children.toArray(e).flatMap((e=>{if(!e)return[];if((0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return[e];const t="string"==typeof e.type?e.type:e.type.name;throw new Error(`Docusaurus error: Bad <Tabs> child <${t}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.\nIf you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)})).map((({props:{value:e,label:t,attributes:n,default:s}})=>({value:e,label:t,attributes:n,default:s})))}(n);return function(e){const t=(0,l.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>`'${e.value}'`)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,n])}function u({value:e,tabValues:t}){return t.some((t=>t.value===e))}function p({queryString:e=!1,groupId:t}){const n=(0,r.W6)(),i=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,a.aZ)(i),(0,s.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(n.location.search);t.set(i,e),n.replace({...n.location,search:t.toString()})}),[i,n])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,a=h(e),[l,c]=(0,s.useState)((()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!u({value:e,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:a}))),[d,m]=p({queryString:n,groupId:r}),[g,f]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,r]=(0,o.Dv)(t);return[n,(0,s.useCallback)((e=>{t&&r.set(e)}),[t,r])]}({groupId:r}),x=(()=>{const e=d??g;return u({value:e,tabValues:a})?e:null})();(0,i.A)((()=>{x&&c(x)}),[x]);return{selectedValue:l,selectValue:(0,s.useCallback)((e=>{if(!u({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);c(e),m(e),f(e)}),[m,f,a]),tabValues:a,lazy:e.lazy??!1,block:e.block??!1}}const g=(0,s.createContext)(null);function f(){const e=s.useContext(g);if(!e)throw new Error("useTabsContext() must be used within a Tabs component");return e}function x(e){return(0,c.jsx)(g.Provider,{value:e.value,children:e.children})}}
1,21921(e,t,n){n.d(t,{A:()=>y});var s=n(15989),r=n(63696),i=n(70575),a=n(89511),o=n(11750),l=n(10419),c=n(70167),d=(n(14207),n(76922)),h=n(59004),u=n(95973),p=n(62540);const m=/^\s*\/\/ highlight-(next-line|start|end)\n/gm,g={...c.f,renderSideBySide:!0,renderOverviewRuler:!1,renderGutterMenu:!1,renderMarginRevertIcon:!1,renderIndicators:!1,useInlineViewWhenSpaceIsLimited:!1,enableSplitViewResizing:!1,readOnly:!0,compactMode:!0,diffAlgorithm:"advanced"},f=function({documents:e,fallback:t}){const[n,s]=(0,r.useMemo)((()=>e.map((({value:e})=>e.replaceAll(m,"")))),[e]),{height:f,handleMount:x}=(0,d.A)({initialContentHeight:Math.max(n.split("\n").length,s.split("\n").length)*c.f.lineHeight});return(0,p.jsx)(i.A,{fallback:t,children:()=>(0,u.P)()?t:(0,p.jsx)("div",{className:h.A.playgroundQueryContainer,children:(0,p.jsx)("div",{className:(0,o.A)(h.A.playgroundContainer,h.A.standaloneEditor),children:(0,p.jsx)("div",{className:h.A.playgroundTextEdit,children:(0,p.jsx)("div",{className:h.A.playgroundEditor,children:(0,p.jsx)(a.zC,{language:(0,l.c)(e[0].language),original:n,modified:s,options:g,onMount:x,height:f,theme:"prism",loading:t,keepCurrentOriginalModel:!0,keepCurrentModifiedModel:!0})})})})})})};var x=n(94794),v=n(48529);function y({children:e}){const t=(0,r.useMemo)((()=>(0,v.z7)(e,"Before")),[e]),n=(0,p.jsxs)(x.A,{wrap:!0,children:[(0,p.jsx)(s.A,{language:t[0].language,title:"Before",children:t[0].value}),(0,p.jsx)(s.A,{language:t[1].language,title:"After",children:t[1].value})]});return(0,p.jsx)(f,{documents:t,fallback:n})}},94794(e,t,n){n.d(t,{A:()=>o});var s=n(11750);const r="grid_iD3H",i="wrap_ES0G";var a=n(62540);function o({children:e,wrap:t=!1}){return(0,a.jsx)("div",{className:(0,s.A)(r,{[i]:t}),children:"string"==typeof e||Array.isArray(e)?e:e.props.children})}},3675(e,t,n){n.d(t,{A:()=>C});var s=n(63696),r=n(19153),i=n(76960),a=n(11750),o=n(93865),l=n(48529),c=n(76723),d=n(20211),h=n(70575),u=n(15989),p=n(59004),m=n(62540);function g({fixtures:e}){return(0,m.jsx)("div",{className:p.A.fixtureBlock,children:e.map(((e,t)=>(0,m.jsx)(v,{fixture:e},t)))})}const f=(0,s.memo)(g);function x({fixture:e}){if("fetchResponse"in e||"function"==typeof e.response){const t="fetchResponse"in e?e.fetchResponse:e.response;return(0,m.jsx)(h.A,{children:()=>(0,m.jsx)(u.A,{language:"javascript",className:p.A.fixtureJson,children:`${t}`})})}return(0,m.jsx)(u.A,{language:"json",className:p.A.fixtureJson,children:JSON.stringify(e.response)})}function v({fixture:e}){if("args"in e)return(0,m.jsxs)("div",{className:p.A.fixtureItem,children:[(0,m.jsx)("div",{className:p.A.fixtureHeader,children:e.endpoint.key(...e.args)}),(0,m.jsx)(x,{fixture:e})]},e.endpoint.key(...e.args));const t=e.endpoint;return(0,m.jsxs)("div",{className:p.A.fixtureItem,children:[(0,m.jsxs)("div",{className:p.A.fixtureHeader,children:[t.method," ",t.path]}),(0,m.jsx)(x,{fixture:e})]})}var y=n(90381),j=n(36856),b=n(95973);function k({children:e,groupId:t="playground",defaultOpen:n="n",row:h=!1,hidden:u=!1,fixtures:g=[],getInitialInterceptorData:x,defaultTab:v,headerControls:y}){const{playgroundPosition:j}=(0,r.A)().siteConfig.themeConfig.liveCodeBlock,b=(0,l.xA)(e,v),k=(0,s.useDeferredValue)(b.documents.map((e=>e.value)).join("\n")),[E,C]=(0,s.useState)(!u);(0,i.A)((()=>{u||C(!0)}),[u]);const S=(0,m.jsx)(c.A,{children:(0,m.jsx)(d.A,{...b,interactive:E,layout:h?"row":"stacked",variant:"playground",fixtureContent:g.length?(0,m.jsx)(f,{fixtures:g}):void 0,headerControls:y})},"editor"),I=u?w:(0,m.jsx)(o.A,{fallback:w,children:(0,m.jsx)(A,{code:k,groupId:t,defaultOpen:n,row:h,fixtures:g,getInitialInterceptorData:x})},"preview");return(0,m.jsx)("div",{className:(0,a.A)(p.A.playgroundQueryContainer,{[p.A.hidden]:u}),children:(0,m.jsx)("div",{className:(0,a.A)(p.A.playgroundContainer,{[p.A.row]:h}),children:"top"===j?[I,S]:[S,I]})})}const w=(0,m.jsxs)(y.A,{children:[(0,m.jsx)("div",{className:p.A.playgroundPreview}),(0,m.jsx)(j.I,{})]},"preview"),A=(0,s.lazy)((()=>b.w?Promise.resolve({default:()=>w}):Promise.all([n.e(1869),n.e(4129),n.e(9015)]).then(n.bind(n,11541)))),E=({children:e,groupId:t,hidden:n=!1,defaultOpen:r="n",row:i=!1,fixtures:a=[],defaultTab:o,headerControls:l,getInitialInterceptorData:c=()=>({})})=>(0,m.jsx)(k,{groupId:t,defaultOpen:r,row:i,hidden:n,fixtures:a,getInitialInterceptorData:c,defaultTab:o,headerControls:l,children:"string"==typeof e||Array.isArray(e)?e:s.isValidElement(e)?e.props.children:""}),C=(0,s.memo)(E)},24627(e,t,n){n.d(t,{A:()=>
1o});var s=n(15989),r=n(74645),i=n(6779),a=(n(63696),n(62540));function o({pkgs:e,dev:t=!1}){return(0,a.jsxs)(i.A,{defaultValue:"npm",groupId:"node-packages-program",values:[{label:"NPM",value:"npm"},{label:"Yarn",value:"yarn"},{label:"pnpm",value:"pnpm"},{label:"esm.sh",value:"esm"}],children:[(0,a.jsx)(r.A,{value:"yarn",children:(0,a.jsxs)(s.A,{className:"language-bash",children:["yarn add ",t?"--dev ":"",e]})}),(0,a.jsx)(r.A,{value:"npm",children:(0,a.jsxs)(s.A,{className:"language-bash",children:["npm install --save",t?"Dev ":""," ",e]})}),(0,a.jsx)(r.A,{value:"pnpm",children:(0,a.jsxs)(s.A,{className:"language-bash",children:["pnpm add",t?" -D":""," ",e]})}),(0,a.jsx)(r.A,{value:"esm",children:(0,a.jsx)(s.A,{className:"language-html",children:`<script type="module">\n${e.split(" ").map((e=>` import * from 'https://esm.sh/${e}${t?"?dev":""}';`)).join("\n")}\n<\/script>`})})]})}},93865(e,t,n){n.d(t,{A:()=>a});var s=n(70575),r=n(63696),i=n(62540);function a({fallback:e,children:t}){return(0,i.jsx)(s.A,{fallback:e,children:()=>(0,i.jsx)(r.Suspense,{fallback:e,children:t})})}},51576(e,t,n){n.d(t,{A:()=>a});var s=n(11750),r=(n(63696),n(59004)),i=n(62540);function a({children:e,className:t,onClick:n,small:a=!1}){return(0,i.jsx)("div",{className:(0,s.A)(r.A.playgroundHeader,t,n?r.A.clickable:null,{[r.A.small]:a}),onClick:n,children:e})}},45990(e,t,n){n.d(t,{A:()=>a});var s=n(11750),r=n(59004),i=n(62540);function a({tabs:e}){return(0,i.jsx)("div",{className:r.A.tabs,role:"tablist","aria-orientation":"horizontal",children:e.map((({key:e,label:t,selected:n,onSelect:a})=>(0,i.jsx)("div",{role:"tab","aria-selected":n,tabIndex:n?0:-1,onClick:a,onFocus:a,className:(0,s.A)(r.A.tab,{[r.A.selected]:n}),children:t},e)))})}},76723(e,t,n){n.d(t,{A:()=>o});var s=n(63696),r=n(90162),i=n(14837);var a=n(62540);function o({children:e}){const t=function(){const e=(0,i.A)();return(0,s.useMemo)((()=>({...e,plain:{...e.plain,backgroundColor:"transparent"}})),[e])}();return(0,a.jsx)(r.Q,{theme:t,enableTypeScript:!0,children:e})}},20211(e,t,n){n.d(t,{A:()=>E});var s=n(70575),r=n(79194),i=n(11750),a=n(63696),o=n(51576),l=n(57447),c=n(89511),d=n(19934),h=n.n(d);n(14207);var u=n(10419),p=n(70167),m=n(76922),g=n(90162),f=n(62540);const x=(0,a.memo)(g.w);function v({onChange:e,code:t}){return(0,f.jsx)(x,{onChange:e,code:t})}var y=n(95973);function j({code:e,language:t}){return(0,f.jsx)(g.w,{language:t,code:e,disabled:!0})}function b({onChange:e,code:t,path:n="",onFocus:s,tabIndex:r,highlights:i,autoFocus:o=!1,isFocused:l=!1,language:d,readOnly:g=!1}){const x=(0,a.useMemo)((()=>({...p.f,readOnly:g})),[g]),{height:b,handleMount:k}=(0,m.A)({initialContentHeight:t.split("\n").length*x.lineHeight,isFocused:l}),w=(0,a.useCallback)((e=>{if(o&&e.focus(),i){const t=function(e){if(!e.length)return[];let t=e[0],n=t;const s=[],r=()=>s.push({selectionStartLineNumber:t,selectionStartColumn:0,positionLineNumber:n,positionColumn:0});return e.forEach((e=>{e===n?n++:(r(),t=e,n=e+1)})),r(),s}(h()(i));t.length&&e.setSelections(t)}e.onDidFocusEditorText((()=>{s(r)})),k(e)}),[]),A=(0,a.useMemo)((()=>(0,f.jsx)(j,{language:d,code:t})),[d]);return(0,y.P)()?(0,f.jsx)(v,{onChange:e,code:t}):(0,f.jsx)(c.Ay,{path:n,defaultLanguage:(0,u.c)(d),onChange:e,defaultValue:t,options:x,theme:"prism",onMount:w,height:b,loading:A})}const k=(0,a.memo)(b);var w=n(59004),A=n(45990);function E({documents:e,update:t,layout:n,variant:s,interactive:r=!0,fixtureContent:i,headerControls:o}){const c=(0,l.Gs)(),d="row"===n,[h,u]=(0,a.useState)((()=>e.map((({collapsed:e})=>e)))),p=(0,a.useRef)(e.map((({col:e})=>e))).current,m=(0,a.useCallback)((e=>{u((t=>t.map(((t,n)=>p[n]?t:n!==e))))}),[p]),g=(0,a.useCallback)((e=>{u((t=>t[e]?t.map(((t,n)=>n!==e&&t)):t))}),[]),x=(0,a.useCallback)((e=>{u((t=>t.map(((t,n)=>n===e?!t:t))))}),[]),v=(0,a.useMemo)((()=>e.map(((e,n)=>e=>t(n,e??"")))),[e.length,t]);return(0,f.jsxs)("div",{className:w.A.playgroundTextEdit,children:[(0,f.jsx)(T,{fixtureContent:d?void 0:i,title:d&&1===e.length?e[0].title:void 0,controls:o}),d&&e.length>1?(0,f.jsx)(I,{documents:e,closedList:h,onClick:m,compact:"standalone"===s,hasHeaderControls:null!=o}):null,e.map(((t,n)=>(0,f.jsxs)(a.Fragment,{children:[d&&!t.col||!t.title?null:(0,f.jsx)(S,{onClick:()=>x(n),closed:h[n],title:t.title,collapsible:e.length>1||null!=i}),(0,f.jsx)(C,{hidden:h[n],interactive:r,tabIndex:n,onFocus:d&&!t.col&&e.length>1?m:g,onChange:v[n],code:t.value,path:(0,l.LH)(c,t.path),isFocused:!h[n],language:t.language,highlights:t.highlights,autoFocus:t.autoF
1ocus})]},`${t.path}:${n}`)))]})}function C({hidden:e,interactive:t,...n}){const r=e?null:(0,f.jsx)(j,{code:n.code,language:n.language});return(0,f.jsx)("div",{className:(0,i.A)(w.A.playgroundEditor,{[w.A.hidden]:e}),children:t?(0,f.jsx)(s.A,{fallback:r,children:()=>(0,f.jsx)(k,{...n})}):r})}function S({onClick:e,closed:t,title:n,collapsible:s}){return s?(0,f.jsxs)(o.A,{small:!0,onClick:e,children:[(0,f.jsx)("span",{className:(0,i.A)(w.A.arrow,t?w.A.right:w.A.down),children:"\u25b6"}),n]}):(0,f.jsx)("div",{className:w.A.codeHeader,children:n})}function I({documents:e,closedList:t,onClick:n,compact:s,hasHeaderControls:r}){const a=e.map(((e,t)=>({document:e,index:t}))).filter((({document:e})=>!e.col));return(0,f.jsx)(o.A,{className:(0,i.A)({[w.A.subtabs]:r},w.A.noupper,w.A.tabControls),small:r||s,children:(0,f.jsx)(A.A,{tabs:a.map((({document:e,index:s})=>({key:`${e.path}:${s}`,label:e.title,selected:!t[s],onSelect:()=>n(s)})))})})}function T({title:e=(0,f.jsx)(r.A,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Editor"}),fixtureContent:t,controls:n}){return(0,f.jsxs)(f.Fragment,{children:[null!=t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.A,{small:!0,children:"Fixtures"}),t]}):null,null!=n?(0,f.jsxs)(o.A,{className:w.A.tabControls,children:[(0,f.jsx)("div",{className:w.A.title,children:e}),n]}):null]})}},90381(e,t,n){n.d(t,{A:()=>o});var s=n(79194),r=(n(63696),n(51576)),i=n(59004),a=n(62540);function o({children:e}){return(0,a.jsxs)("div",{className:i.A.previewWrapper,children:[(0,a.jsx)(r.A,{children:(0,a.jsx)(s.A,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"\ud83d\udd34 Live Preview"})}),(0,a.jsx)("div",{className:i.A.playgroundResult,children:e})]})}},36856(e,t,n){n.d(t,{I:()=>x,A:()=>f});var s=n(86535),r=n(11750),i=n(63696),a=n(59004),o=n(49168),l=n(95585),c=n(62540);const d={String:"rgb(195, 232, 141)",Date:"rgb(247, 140, 108)",Number:"rgb(247, 140, 108)",Boolean:"rgb(247, 140, 108)",Null:"rgb(255, 88, 116)",Undefined:"rgb(255, 88, 116)",Function:"rgb(247, 140, 108)",Symbol:"rgb(247, 140, 108)"};function h({value:e}){const t="dark"===(0,o.G)().colorMode,n=(0,i.useMemo)((()=>({tree:{overflow:"auto",flex:"4 1 40%",margin:0,padding:"0 0.5rem 0 0.8rem",backgroundColor:t?"var(--ifm-pre-background)":"rgb(41, 45, 62)",font:"var(--ifm-code-font-size) / var(--ifm-pre-line-height) var(--ifm-font-family-monospace) !important",color:"rgb(227, 227, 227)"},arrowContainer:({style:e})=>({style:{...e,fontFamily:"arial",padding:"7px 7px 7px 0",margin:"-7px calc(0.5em - 7px) -7px 0"}}),arrowSign:{color:"rgb(130, 170, 255)"},label:{color:"rgb(130, 170, 255)"},itemRange:{color:"rgb(105, 112, 152)"},valueText:({style:e},t)=>({style:{...e,color:d[t]}}),base0B:"rgb(191, 199, 213)"})),[t]),s=(0,i.useMemo)(u,[]);return(0,c.jsx)(l.d,{shouldExpandNodeInitially:s,data:e,valueRenderer:m,theme:n,hideRoot:!0})}const u=()=>{let e=0,t=0;return(n,s,r)=>0===r||(!(1!==r||!["entities","results"].includes(String(n[0])))||(2===r&&"entities"===n[1]?t++<2:2===r&&"results"===n[1]||(3===r&&"entities"===n[2]?e++<4:3===r&&"results"===n[2])))},p="undefined"!=typeof Intl?Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3}):void 0,m=(e,t,...n)=>{const s=n[0];return p&&"number"==typeof t&&"string"==typeof s&&isFinite(t)&&("date"===s||s.endsWith("At"))?p.format(t):e};function g({toggle:e,selectedValue:t}){const n="y"===t;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(x,{onClick:e,open:n}),n?(0,c.jsx)(y,{}):null]})}const f=(0,i.memo)(g);function x({onClick:e,open:t=!0}){return(0,c.jsxs)("div",{className:a.A.debugToggle,onClick:e,children:["Store",(0,c.jsx)("span",{className:(0,r.A)(a.A.arrow,t?a.A.right:a.A.left,a.A.vertical),children:"\u25b6"})]})}function v(){const e=(0,i.useContext)(s.zV),t=(0,i.useMemo)((()=>{const{optimistic:t,...n}=e;return n}),[e]);return(0,c.jsx)(h,{value:t})}const y=(0,i.memo)(v)},2386(e,t,n){n.d(t,{A:()=>o});var s=n(15989),r=n(74645),i=n(6779),a=(n(63696),n(62540));function o({repo:e="reactive/data-client",skill:t,skills:n}){const o=(n??(t?[t]:[])).map((e=>` --skill ${e}`)).join("");return(0,a.jsxs)(i.A,{defaultValue:"skills",groupId:"agent-skills-program",values:[{label:"Skills",value:"skills"},{label:"OpenSkills",value:"openskills"}],children:[(0,a.jsx)(r.A,{value:"skills",children:(0,a.jsxs)(s.A,{className:"language-bash",children:["npx skills add ",e,o]})}),(0,a.jsx)(r.A,{value:"openskills",children:(0,a.jsxs)(s.A,{className:"language-bash",children:["npx openskills install ",e,o]})})]})}},21198(e,t,n){var s=n(37156),r=n(8815);class i extends s.A{id="";title="";status="backlog";pk(){return this.id}static key="Task"}const a=(0,r.A)({path:"/tasks/:id",searchParams:{},schema:i,optimistic:!0}),o={1:{id:"1",title:"Design schema",status:"backlog"},2:{id:"2",title:"Write docs",status:"backlog"},3:{id:"3",title:"Build endpoints",status:"in-progress"}
1,4:{id:"4",title:"Review PR",status:"in-progress"}},l=[{endpoint:a.getList.move,response({id:e},t){return this.tasks[e]&&(this.tasks[e]={...this.tasks[e],...t}),this.tasks[e]||{id:e,...t}},delay:500},{endpoint:a.getList,response({status:e}){return Object.values(this.tasks).filter((t=>t.status===e))},delay:150}];n.d(t,["CM",0,l,"oP",0,()=>({tasks:JSON.parse(JSON.stringify(o))})])},8598(e,t,n){var s=n(37156),r=n(8815);class i extends s.A{id=0;title="";body="";static key="Post"}const a=(0,r.A)({path:"/posts/:id",schema:i});class o extends s.A{id=0;postId=0;author="";text="";static key="Comment"}const l=(0,r.A)({path:"/comments/:id",searchParams:{},schema:o}),c=[{endpoint:a.get,args:[{id:1}],response:{id:1,title:"Parallel Data Loading in React",body:"With useFetch() and React.use(), multiple fetches start at the same time \u2014 no sequential waterfalls."},delay:600},{endpoint:l.getList,args:[{postId:1}],response:[{id:1,postId:1,author:"Alice",text:"This pattern is so much faster!"},{id:2,postId:1,author:"Bob",text:"No more request waterfalls \ud83c\udf89"},{id:3,postId:1,author:"Carol",text:"Works great with Suspense boundaries."}],delay:600}];n.d(t,["kf",0,c])},38634(e,t,n){n.r(t),n.d(t,{default:()=>m,metadata:()=>s});var s=n(50050),r=n(62540),i=n(43023),a=(n(94005),n(3675)),o=n(21198),l=n(8598),c=n(21921),d=n(24627),h=n(2386);const u={authorsImageUrls:[void 0]};function p(e){const t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"New Features:"})}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#parallel-data-loading",children:"Parallel data loading with useFetch()"})," - Fetch multiple endpoints concurrently with ",(0,r.jsx)(t.code,{children:"use(useFetch())"}),", avoiding sequential waterfalls"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#collection-move",children:"Collection.move"})," - Move entities between ",(0,r.jsx)(t.a,{href:"/rest/api/Collection",children:"Collections"})," with a single operation"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#collection-move",children:"Collection.moveWith()"})," - Customize move behavior (e.g., prepend instead of append)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#lazy",children:"Lazy"})," - Deferred relationship denormalization for performance and memoization isolation"]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Other Improvements:"})}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#direct-schema-imports",children:"Direct schema imports"})," - Import schema classes directly without the ",(0,r.jsx)(t.code,{children:"schema"})," namespace"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#denormalization-depth-limit",children:"Denormalization depth limit"})," - Prevent stack overflow in large bidirectional entity graphs; configurable via ",(0,r.jsx)(t.a,{href:"/rest/api/Entity#maxEntityDepth",children:(0,r.jsx)(t.code,{children:"Entity.maxEntityDepth"})})," (",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/issues/3822",children:"#3822"}),")"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/api/DevToolsManager#controllers",children:"DevToolsManager"})," exposes ",(0,r.jsx)(t.code,{children:"globalThis.__DC_CONTROLLERS__"})," in dev mode for programmatic store access from ",(0,r.jsx)(t.a,{href:"https://developer.chrome.com/blog/chrome-devtools-mcp",children:"Chrome DevTools MCP"})," and ",(0,r.jsx)(t.a,{href:"https://docs.expo.dev/eas/ai/mcp/",children:"Expo MCP"}),". Use the ",(0,r.jsx)(t.a,{href:"https://skills.sh/reactive/data-client/data-client-react",children:"data-client-react skill"})," to enable AI-assisted debugging."]}),"\n",(0,r.jsx)(t.li,{children:"Remove misleading 'Uncaught Suspense' warning during Next.js SSR"}),"\n",(0,r.jsxs)(t.li,{children:["Fix ",(0,r.jsx)(t.code,{children:"sideEffect: false"}
1)," type being lost with ",(0,r.jsx)(t.code,{children:"method: 'POST'"})," in ",(0,r.jsx)(t.a,{href:"/rest/api/RestEndpoint",children:"RestEndpoint"})]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/api/renderDataHook",children:"renderDataHook()"})," automatic cleanup after each test \u2014 no manual ",(0,r.jsx)(t.code,{children:"cleanup()"})," calls needed"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/api/renderDataHook",children:"renderDataHook()"})," returns per-render ",(0,r.jsx)(t.code,{children:"cleanup()"})," and ",(0,r.jsx)(t.code,{children:"allSettled()"})," for reliable test teardown"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/rest/api/Collection#move",children:"Collection.move"})," makes it easy to move entities between ",(0,r.jsx)(t.a,{href:"/rest/api/Collection",children:"Collections"})," with a single operation:"]}),"\n",(0,r.jsxs)(a.A,{defaultOpen:"n",row:!0,fixtures:o.CM,getInitialInterceptorData:o.oP,children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="TaskResource" collapsed',children:"import { Entity, resource } from '@data-client/rest';
1\n\nexport class Task extends Entity {\n id = '';\n title = '';\n status = 'backlog';\n pk() { return this.id; }\n static key = 'Task';\n}\nexport const TaskResource = resource({\n path: '/tasks/:id',\n searchParams: {} as { status: string },\n schema: Task,\n optimistic: true,\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="TaskCard" {5-9}',children:"import { useController } from '@data-client/react';\nimport { TaskResource, type Task } from './TaskResource';\n\nexport default function TaskCard({ task }: { task: Task }) {\n const handleMove = () => ctrl.fetch(\n TaskResource.getList.move,\n { id: task.id },\n { id: task.id, status: task.status === 'backlog' ? 'in-progress' : 'backlog' },\n );\n const ctrl = useController();\n return (\n <div className=\"listItem\">\n <span style={{ flex: 1 }}>{task.title}</span>\n <button onClick={handleMove}>\n {task.status === 'backlog' ? '\\u25bc' : '\\u25b2'}\n </button>\n </div>\n );\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="TaskBoard" collapsed',children:"import { useSuspense } from '@data-client/react';\nimport { TaskResource } from './TaskResource';\nimport TaskCard from './TaskCard';\n\nfunction TaskBoard() {\n const backlog = useSuspense(TaskResource.getList, { status: 'backlog' });\n const inProgress = useSuspense(TaskResource.getList, { status: 'in-progress' });\n return (\n <div>\n <div className=\"boardColumn\">\n <h4>Backlog</h4>\n {backlog.map(task => <TaskCard key={task.pk()} task={task} />)}\n </div>\n <div className=\"boardColumn\">\n <h4>Active</h4>\n {inProgress.map(task => <TaskCard key={task.pk()} task={task} />)}\n </div>\n </div>\n );\n}\nrender(<TaskBoard />);\n"})})]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#migration-guide",children:"Breaking Changes:"})})}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#path-to-regexp-v8",children:"path-to-regexp v8"})," - ",(0,r.jsx)(t.a,{href:"/rest/api/RestEndpoint#path",children:"RestEndpoint.path"})," syntax updated: ",(0,r.jsx)(t.code,{children:"/:optional?"})," \u2192 ",(0,r.jsx)(t.code,{children:"{/:optional}"}),", ",(0,r.jsx)(t.code,{children:"/:repeat+"})," \u2192 ",(0,r.jsx)(t.code,{children:"/*repeat"})," (typed as ",(0,r.jsx)(t.code,{children:"string[]"}),")"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#usefetch-returns-usablepromise",children:"useFetch() returns UsablePromise"})," - Returns a thenable for ",(0,r.jsx)(t.code,{children:"React.use()"}),"; check ",(0,r.jsx)(t.code,{children:".resolved"})," instead of truthiness"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Upgrade with an automated ",(0,r.jsx)(t.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:n(32869).A+"",children:"codemod"})," for all breaking changes:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-bash",children:"npx jscodeshift -t https://dataclient.io/codemods/v0.16.js --extensions=ts,tsx,js,jsx src/\n"})}),"\n","\n","\n",(0,r.jsx)(t.h2,{id:"collection-move",children:"Collection.move"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/rest/api/Collection#move",children:"Collection.move"})," and ",(0,r.jsx)(t.a,{href:"/rest/api/RestEndpoint#move",children:"RestEndpoint.move"})," make it easy to move entities between collections with a single PATCH request. The entity is automatically removed from collections matching its old state and added to collections matching the new values from the request body."]}),"\n",(0,r.jsx)(t.p,{children:"This is useful for kanban boards, group reassignment, status changes, or any workflow where an item moves between filtered lists."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"const TaskResource = resource({\n path: '/tasks/:id',\n searchParams: {} as { status: string },\n schema: Task,\n});
1\n\n// PATCH /tasks/3 - moves task from 'backlog' to 'in-progress'\nawait ctrl.fetch(\n TaskResource.getList.move,\n { id: '3' },\n // highlight-next-line\n { id: '3', status: 'in-progress' },\n);\n"})}),"\n",(0,r.jsx)(t.p,{children:"Works for both path parameters and search parameters, and supports Array and Values collections."}),"\n",(0,r.jsx)(t.h3,{id:"collectionmovewith",children:"Collection.moveWith()"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/rest/api/Collection#moveWith",children:"Collection.moveWith()"})," constructs a custom move schema, analogous to ",(0,r.jsx)(t.a,{href:"/rest/api/Collection#addWith",children:"addWith()"}),". The ",(0,r.jsx)(t.code,{children:"merge"})," function controls how entities are added to their destination collection (e.g., prepending instead of appending), while the remove behavior is automatically derived. The ",(0,r.jsx)(t.a,{href:"/rest/api/Collection#unshift-merge",children:(0,r.jsx)(t.code,{children:"unshift"})})," merge function is provided for convenience."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"import { Collection, unshift } from '@data-client/rest';\n\nclass MyCollection extends Collection {\n constructor(schema, options) {\n super(schema, options);\n // highlight-next-line\n this.move = this.moveWith(unshift);\n }\n}\n"})}),"\n",(0,r.jsx)(t.h2,{id:"parallel-data-loading",children:"Parallel data loading"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/docs/api/useFetch",children:"useFetch()"})," now returns a ",(0,r.jsx)(t.a,{href:"https://react.dev/reference/react/use",children:"UsablePromise"})," thenable,\nmaking ",(0,r.jsx)(t.code,{children:"use(useFetch(endpoint, args))"})," a drop-in equivalent to ",(0,r.jsx)(t.a,{href:"/docs/api/useSuspense",children:"useSuspense()"})," \u2014\nit suspends when data is loading, returns denormalized data when cached, throws on errors,\nand re-suspends on ",(0,r.jsx)(t.a,{href:"/docs/api/Controller#invalidate",children:"invalidation"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["Because ",(0,r.jsx)(t.code,{children:"useFetch()"})," and ",(0,r.jsx)(t.code,{children:"use()"})," are separate calls, multiple fetches start in parallel.\nAll ",(0,r.jsx)(t.code,{children:"useFetch()"})," calls execute before any ",(0,r.jsx)(t.code,{children:"use()"})," suspends, so every fetch is already in-flight\neven if the first ",(0,r.jsx)(t.code,{children:"use()"})," suspends the component.\nThis avoids the sequential waterfall that occurs with multiple ",(0,r.jsx)(t.code,{children:"useSuspense()"})," calls,\nwhere the second fetch cannot begin until the first resolves.\n",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/pull/3755",children:"#3755"})]}),"\n",(0,r.jsxs)(a.A,{fixtures:l.kf,row:!0,children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Resources" collapsed',children:"import { Entity, resource } from '@data-client/rest';\n\nexport class Post extends Entity {\n id = 0;\n title = '';\n body = '';\n static key = 'Post';\n}\nexport const PostResource = resource({\n path: '/posts/:id',\n schema: Post,\n});\n\nexport class Comment extends Entity {\n id = 0;\n postId = 0;\n author = '';\n text = '';\n static key = 'Comment';\n}\nexport const CommentResource = resource({\n path: '/comments/:id',\n searchParams: {} as { postId: number },\n schema: Comment,\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="PostWithComments" {7-13}',children:"import { use } from 'react';\nimport { useFetch } from '@data-client/react';\nimport { PostResource, CommentResource } from './Resources';\n\nfunction PostWithComments({ id }: { id: number }) {\n // Both fetches start in parallel\n const postPromise = useFetch(PostResource.get, { id });\n const commentsPromise = useFetch(CommentResource.getList, { postId: id });\n\n // use() reads the results \u2014 if the first suspends,\n // the second fetch is already in-flight\n const post = use(postPromise);\n const comments = use(commentsPromise);\n\n return (\n <article>\n <h3>
1{post.title}</h3>\n <p>{post.body}</p>\n <h4>Comments</h4>\n {comments.map(comment => (\n <div key={comment.id} className=\"listItem\">\n <strong>{comment.author}</strong>: {comment.text}\n </div>\n ))}\n </article>\n );\n}\nrender(<PostWithComments id={1} />);\n"})})]}),"\n",(0,r.jsx)(t.h2,{id:"denormalization-depth-limit--lazy",children:"Denormalization depth limit & Lazy"}),"\n",(0,r.jsxs)(t.p,{children:["When schemas have bidirectional relationships across entity types\n(e.g., ",(0,r.jsx)(t.code,{children:"Department \u2192 Building \u2192 Department \u2192 ..."}),"), denormalization traverses every unique\nentity in the connected graph. With small datasets this is invisible, but at scale \u2014 thousands\nof interconnected entities \u2014 the recursion exceeds the JS call stack and throws\n",(0,r.jsx)(t.code,{children:"RangeError: Maximum call stack size exceeded"}),".\n",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/issues/3822",children:"#3822"})]}),"\n",(0,r.jsxs)(t.p,{children:["Two complementary features address this: a ",(0,r.jsx)(t.strong,{children:"depth limit"})," as a safety net, and\n",(0,r.jsx)(t.a,{href:"/rest/api/Lazy",children:(0,r.jsx)(t.strong,{children:"Lazy"})})," for precise, per-field control over which relationships are resolved eagerly."]}),"\n",(0,r.jsx)(t.h3,{id:"denormalization-depth-limit",children:"Denormalization depth limit"}),"\n",(0,r.jsxs)(t.p,{children:["Denormalization now enforces a default depth limit of 64 entity hops. Entities beyond\nthe limit are returned with unresolved ids instead of fully denormalized objects.\nA ",(0,r.jsx)(t.code,{children:"console.error"})," is emitted in development mode when the limit is reached."]}),"\n",(0,r.jsxs)(t.p,{children:["The limit can be configured per-Entity with ",(0,r.jsx)(t.a,{href:"/rest/api/Entity#maxEntityDepth",children:(0,r.jsx)(t.code,{children:"static maxEntityDepth"})}),":"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"class Department extends Entity {\n static maxEntityDepth = 16;\n}\n"})}),"\n",(0,r.jsxs)(t.p,{children:["This prevents crashes, but is a blunt instrument \u2014 it cuts off ",(0,r.jsx)(t.em,{children:"all"})," deep paths,\nincluding legitimate non-cyclic ones. For fine-grained control, use ",(0,r.jsx)(t.a,{href:"#lazy",children:"Lazy"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"lazy",children:"Lazy"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/rest/api/Lazy",children:"Lazy"})," wraps a schema to skip eager denormalization of specific relationship fields.\nDuring parent entity denormalization, the field retains its raw normalized value (primary keys).\nThe relationship can then be resolved on demand via ",(0,r.jsx)(t.a,{href:"/docs/api/useQuery",children:"useQuery"})," using the ",(0,r.jsx)(t.code,{children:".query"})," accessor."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"import { Entity, Lazy } from '@data-client/rest';\n\nclass Department extends Entity {\n id = '';\n name = '';\n buildings: string[] = [];\n\n static schema = {\n // highlight-next-line\n buildings: new Lazy([Building]),\n };\n}\n"})}),"\n",(0,r.jsxs)(t.p,{children:["Unlike the depth limit, ",(0,r.jsx)(t.code,{children:"Lazy"})," is a targeted opt-in per relationship. Only the\nfields you mark as lazy skip eager resolution \u2014 the rest of the schema denormalizes normally.\nThis also improves performance by deferring work for relationships that aren't always\nneeded, and provides ",(0,r.jsx)(t.strong,{children:"memoization isolation"})," \u2014 changes to lazy entities don't invalidate\nthe parent's denormalized form."]}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsx)(t.a,{href:"/rest/api/Lazy",children:"Lazy documentation"})," for full usage details and\n",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/discussions/3828",children:"#3828"})," for design discussion."]}),"\n",(0,r.jsx)(t.h2,{id:"migration-guide",children:"Migration guide"}),"\n",(0,r.jsx)(t.p,{children:"This upgrade requires updating all package versions simultaneously."}),"\n",(0,r.jsx)(d.A,{pkgs:"@data-client/react@^0.16.0 @data-client/rest@^0.16.0 @data-client/endpoint@^0.16.0 @data-client/core@^0.16.0 @data-client/vue@^0.16.0 @data-client/test@^0.16.0 @data-client/img@^0.16.0",upgrade:!0}),"\n",(0,r.jsxs)(t.p,{children:["An automated ",(0,r.jsx)(t.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:n(32869).A
1+"",children:"codemod"})," handles all three breaking changes below \u2014 path syntax, ",(0,r.jsx)(t.code,{children:"useFetch()"})," truthiness, and ",(0,r.jsx)(t.code,{children:"schema"})," namespace imports:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-bash",children:"npx jscodeshift -t https://dataclient.io/codemods/v0.16.js --extensions=ts,tsx,js,jsx src/\n"})}),"\n",(0,r.jsx)(t.h2,{id:"path-to-regexp-v8",children:"path-to-regexp v8"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/rest/api/RestEndpoint#path",children:"RestEndpoint.path"})," now uses ",(0,r.jsx)(t.a,{href:"https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0",children:"path-to-regexp v8"}),",\nwhich changes the syntax for optional parameters, repeating parameters, and special characters."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"v6 syntax"}),(0,r.jsx)(t.th,{children:"v8 syntax"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/:optional?"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"{/:optional}"})}),(0,r.jsx)(t.td,{children:"Optional parameter"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/:repeat+"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/*repeat"})}),(0,r.jsxs)(t.td,{children:["One-or-more repeating (typed as ",(0,r.jsx)(t.code,{children:"string[]"}),")"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/:repeat*"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"{/*repeat}"})}),(0,r.jsxs)(t.td,{children:["Zero-or-more repeating (typed as ",(0,r.jsx)(t.code,{children:"string[]"}),")"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/:with-dash"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:'/:"with-dash"'})}),(0,r.jsx)(t.td,{children:"Quoted parameter name"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/:id(\\d+)"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"/:id"})}),(0,r.jsx)(t.td,{children:"Custom regex removed"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"optional-parameters",children:"Optional parameters"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"?"})," suffix is removed. Wrap the optional segment (including its prefix) in ",(0,r.jsx)(t.code,{children:"{}"}),"."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"const ep = new RestEndpoint({\n path: '/:group/things/:number?',\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"const ep = new RestEndpoint({\n path: '/:group/things{/:number}',\n});\n"})})]}),"\n",(0,r.jsx)(t.p,{children:"Multiple optional segments with different prefixes:"}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"const ep = new RestEndpoint({\n path: '/:attr1?{-:attr2}?{-:attr3}?',\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"const ep = new RestEndpoint({\n path: '{/:attr1}{-:attr2}{-:attr3}',\n});\n"})})]}),"\n",(0,r.jsx)(t.h3,{id:"repeating-parameters",children:"Repeating parameters"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"+"})," (one-or-more) and ",(0,r.jsx)(t.code,{children:"*"})," (zero-or-more) suffixes are removed. Use ",(0,r.jsx)(t.code,{children:"*name"})," wildcard syntax, wrapped in ",(0,r.jsx)(t.code,{children:"{}"})," for zero-or-more."]}),"\n",(0,r.jsxs)(t.p,{children:["Wildcard parameters are now typed as ",(0,r.jsx)(t.code,{children:"string[]"})," (arrays) instead of ",(0,r.jsx)(t.code,{children:"string | number"}),", since they represent multiple path segments."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"const ep = new RestEndpoint({\n path: '/files/:path+',\n});\nep({ path: 'docs/reports/q4' });\nconst optEp = new RestEndpoint({\n path: '/files/:path*',\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"const ep = new RestEndpoint({\n path: '/files/*path',\n});\nep({ path: ['docs', 'reports', 'q4'] });\nconst optEp = new RestEndpoint({\n path: '/files{/*path}',\n});\n"})})]}),"\n",(0,r.jsx)(t.h3,{id:"quoted-parameter-names",children:"Quoted parameter names"}),"\n",(0,r.jsx)(t.p,{children:"Parameter names with special characters (dashes, dots) must now be quoted with double quotes:"}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"const ep = new RestEndpoint({\n path: '/:with-dash',\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"const ep = new RestEndpoint({\n path: '/:\"with-dash\"',\n});\n"})})]}),"\n",(0,r.jsx)(t.h3,{id:"custom-regex-removed",children:"Custom regex removed"}),"\n",(0,r.jsxs)(t.p,{children:["Inline regex patterns like ",(0,r.jsx)(t.code,{children:"/:id(\\d+)"})," are no longer supported. Remove the regex \u2014 validate on the server instead."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"const ep = new RestEndpoint({\n path: '/users/:id(\\\\d+)',\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"const ep = new RestEndpoint({\n path: '/users/:id',\n});\n"})})]}),"\n",(0,r.jsx)(t.h3,{id:"escaping-special-characters",children:"Escaping special characters"}),"\n",(0,r.jsxs)(t.p,{children:["Characters including ",(0,r.jsx)(t.code,{children:"{}()[]+?!:*\\\\"})," must be escaped with ",(0,r.jsx)(t.code,{children:"\\\\"})," when used as ",(0,r.jsx)(t.strong,{children:"literals"})," in the path pattern.\nThese characters are ",(0,r.jsx)(t.a,{href:"https://github.com/pillarjs/path-to-regexp#express--4x",children:"reserved by path-to-regexp"})," and\nunescaped usage throws an ",(0,r.jsx)(t.a,{href:"https://github.com/pillarjs/path-to-regexp#unexpected--or-",children:"Unexpected token error"}),".\nA literal query string in the pattern still needs an escaped ",(0,r.jsx)(t.code,{children:"?"}),", e.g. ",(0,r.jsx)(t.code,{children:"'/resource\\\\?per_page=50'"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["When query segments use ",(0,r.jsx)(t.strong,{children:"named parameters"}),", prefer explicit groups instead of a single escaped ",(0,r.jsx)(t.code,{children:"?"}),":"]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"const ep = new RestEndpoint({\n path: '/search\\\\?q=:q',\n});\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"const ep = new RestEndpoint({\n path: '/search?{q=:q}{&page=:page}',\n});\n"})})]}),"\n",(0,r.jsx)(t.h3,{id:"finding-paths-to-migrate",children:"Finding paths to migrate"}),"\n",(0,r.jsxs)(t.p,{children:["Search your codebase for these patterns in ",(0,r.jsx)(t.code,{children:"path:"})," values:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"?"})})," after a ",(0,r.jsx)(t.code,{children:":param"})," \u2014 optional parameters to convert"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"+"})})," or ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"*"})})," after a ",(0,r.jsx)(t.code,{children:":param"})," \u2014 repeating parameters to convert"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"(\\"})})," after a ",(0,r.jsx)(t.code,{children:":param"})," \u2014 custom regex to remove"]}),"\n",(0,r.jsxs)(t.li,{children:["Parameter names with ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"-"})})," or ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"."})})," \u2014 need quoting"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsx)(t.a,{href:"/rest/api/RestEndpoint#path",children:"RestEndpoint.path"})," for full v8 syntax documentation,\nor ",(0,r.jsx)(t.a,{href:"https://github.com/pillarjs/path-to-regexp#errors",children:"path-to-regexp errors"})," for detailed explanations.\nAI-assisted migration is also available:"]}),"\n",(0,r.jsx)(h.A,{repo:"reactive/data-client",skill:"path-to-regexp-v8-migration"}),"\n",(0,r.jsx)(t.h2,{id:"usefetch-returns-usablepromise",children:"useFetch() returns UsablePromise"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"/docs/api/useFetch",children:"useFetch()"})," now returns a ",(0,r.jsx)(t.code,{children:"UsablePromise"})," thenable with denormalized data, error handling, and a ",(0,r.jsx)(t.code,{children:".resolved"})," property. This makes it directly compatible with ",(0,r.jsx)(t.a,{href:"https://react.dev/reference/react/use",children:"React.use()"})," \u2014 ",(0,r.jsx)(t.code,{children:"use(useFetch(endpoint, args
1))"})," behaves identically to ",(0,r.jsx)(t.a,{href:"/docs/api/useSuspense",children:"useSuspense()"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["Previously ",(0,r.jsx)(t.code,{children:"useFetch()"})," returned ",(0,r.jsx)(t.code,{children:"undefined"})," when data was valid. Code that checked for a fetch via truthiness must now use ",(0,r.jsx)(t.code,{children:".resolved"}),":"]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="Before"',children:"const promise = useFetch(PostResource.get, { id });\nif (promise) {\n // fetch was triggered\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="After"',children:"const promise = useFetch(PostResource.get, { id });\nif (!promise.resolved) {\n // fetch is in-flight\n}\nuse(promise); // suspends or returns denormalized data\n"})})]}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsx)(t.a,{href:"#parallel-data-loading",children:"Parallel data loading"})," above for how this enables concurrent fetches that avoid sequential waterfalls.\n",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/pull/3752",children:"#3752"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/pull/3755",children:"#3755"})]}),"\n",(0,r.jsx)(t.h2,{id:"direct-schema-imports",children:"Direct schema imports"}),"\n",(0,r.jsxs)(t.p,{children:["Schema classes can now be imported directly from ",(0,r.jsx)(t.a,{href:"https://www.npmjs.com/package/@data-client/endpoint",children:"@data-client/endpoint"})," (or ",(0,r.jsx)(t.a,{href:"https://www.npmjs.com/package/@data-client/rest",children:"@data-client/rest"})," which re-exports them) instead of requiring the ",(0,r.jsx)(t.code,{children:"schema"})," namespace. This provides a cleaner import syntax while maintaining full backward compatibility."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="Before"',children:"import { schema } from '@data-client/endpoint';\n\nconst myUnion = new schema.Union(\n { users: User, groups: Group },\n 'type',\n);\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="After"',children:"import { Union } from '@data-client/endpoint';\n\nconst myUnion = new Union(\n { users: User, groups: Group },\n 'type',\n);\n"})})]}),"\n",(0,r.jsxs)(t.p,{children:["All schema classes are available as direct exports: ",(0,r.jsx)(t.a,{href:"/rest/api/Union",children:"Union"}),", ",(0,r.jsx)(t.a,{href:"/rest/api/Invalidate",children:"Invalidate"}),", ",(0,r.jsx)(t.a,{href:"/rest/api/Collection",children:"Collection"}),", ",(0,r.jsx)(t.a,{href:"/rest/api/Query",children:"Query"}),", ",(0,r.jsx)(t.a,{href:"/rest/api/Values",children:"Values"}),", ",(0,r.jsx)(t.a,{href:"/rest/api/All",children:"All"}),", and ",(0,r.jsx)(t.a,{href:"/rest/api/Lazy",children:"Lazy"}),". The ",(0,r.jsx)(t.code,{children:"schema"})," namespace export remains available for backward compatibility."]}),"\n",(0,r.jsx)(t.h3,{id:"upgrade-support",children:"Upgrade support"}),"\n",(0,r.jsxs)(t.p,{children:["As usual, if you have any troubles or questions, feel free to join our ",(0,r.jsx)(t.a,{href:"https://discord.gg/wXGV27xm6t",children:(0,r.jsx)(t.img,{src:"https://img.shields.io/discord/768254430381735967.svg?style=flat-square&colorB=758ED3",alt:"Chat"})})," or ",(0,r.jsx)(t.a,{href:"https://github.com/reactive/data-client/issues/new/choose",children:"file a bug"})]})]})}function m(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}n.d(t,["assets",0,u,"contentTitle",0,undefined,"frontMatter",0,{title:"v0.16: Parallel Fetching, Collection.move, Lazy",description:"Parallel data loading with useFetch(), Collection.move for reordering across lists, and Lazy for deferred relationship denormalization",image:"/img/social/0.16-card.png",authors:["ntucker"],tags:["releases","rest","schema","collection"]},"toc",0,[{value:"Collection.move",id:"collection-move",level:2},{value:"Collection.moveWith()",id:"collectionmovewith",level:3},{value:"Parallel data loading",id:"parallel-data-loading",level:2},{value:"Denormalization depth limit & Lazy",id:"denormalization-depth-limit--lazy",level:2},{value:"Denormalization depth limit",id:"denormalization-depth-limit",level:3},{value:"Lazy",id:"lazy",level:3},{value:"Migration guide",id:"migration-guide",level:2},{value:"path-to-regexp v8",id:"path-to-regexp-v8",level:2},{value:"Optional parameters",id:"optional-parameters",level:3},{value:"Repeating parameters",id:"repeating-parameters",level:3},{value:"Quoted parameter names",id:"quoted-parameter-names",level:3},{value:"Custom regex removed",id:"custom-regex-removed",level:3},{value:"Escaping special characters",id:"escaping-special-characters",level:3},{value:"Finding paths to migrate",id:"finding-paths-to-migrate",level:3},{value:"useFetch() returns UsablePromise",id:"usefetch-returns-usablepromise",level:2},{value:"Direct schema imports",id:"direct-schema-imports",level:2},{value:"Upgrade support",id:"upgrade-support",level:3}]])},32869(e,t,n){const s=n.p+"assets/files/v0.16-707adcbfbd8ee35f345c0e7d96ac2d52.js";n.d(t,["A",0,s])},33503(e,t,n){function s(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}n.d(t,{A:()=>s})},81059(e,t,n){n.d(t,{A:()=>r});var s=0;function r(e){return"__private_"+s+++"_"+e}}
1,65657(e,t,n){n.r(t);const s="rdc/fetch",r="rdc/set",i="rdc/setresponse",a="rdc/optimistic",o="rdc/reset",l="rdc/subscribe",c="rdc/unsubscribe",d="rdc/invalidate",h="rdc/invalidateall",u="rdc/expireall",p="rdc/gc",m=s,g=r,f=i,x=a,v=o,y=l,j=c,b=d,k=h,w=u,A=p;n.d(t,["EXPIREALL",0,u,"EXPIREALL_TYPE",0,w,"FETCH",0,s,"FETCH_TYPE",0,m,"GC",0,p,"GC_TYPE",0,A,"INVALIDATE",0,d,"INVALIDATEALL",0,h,"INVALIDATEALL_TYPE",0,k,"INVALIDATE_TYPE",0,b,"OPTIMISTIC",0,a,"OPTIMISTIC_TYPE",0,x,"RESET",0,o,"RESET_TYPE",0,v,"SET",0,r,"SET_RESPONSE",0,i,"SET_RESPONSE_TYPE",0,f,"SET_TYPE",0,g,"SUBSCRIBE",0,l,"SUBSCRIBE_TYPE",0,y,"UNSUBSCRIBE",0,c,"UNSUBSCRIBE_TYPE",0,j])},39664(e,t,n){n.d(t,{A:()=>s});class s extends Error{}},12878(e,t,n){n.d(t,{A:()=>A});var s=n(33644);class r{constructor(e=[]){this.localCache=new Map,this._args=e}getEntity(e,t,n,s){const r=t.key;this.localCache.has(r)||this.localCache.set(r,new Map);const i=this.localCache.get(r);return i.get(e)||s(i),i.get(e)}getResults(e,t,n){return{data:n(),paths:[]}}argsKey(e){return e(this._args)}}var i=n(18239),a=n(98584);var o=n(53694),l=n(4002),c=n(39664),d=n(46986),h=n(96831),u=n(47154),p=n(44535),m=n(55773),g=n(22868),f=n(89244),x=n(57199),v=n(52751),y=n(64686),j=n(9369);function b(e,t){return e.meta[t]}const k=e=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},w=()=>j.u;class A{constructor({dispatch:e=k,getState:t=w,memo:n=new s.A,gcPolicy:l=new y.m}={}){this.fetch=(e,...t)=>{const n=(0,h.H)(e,{args:t});return this.dispatch(n),e.schema?n.meta.promise.then((n=>function(e,t,n,s=[]){return void 0===e||void 0===t?t:(0,i.A)(a.B.getEntities(n),new r(s),s)(e,t).data}(e.schema,n,{},t))):n.meta.promise},this.fetchIfStale=(e,...t)=>{const{data:n,expiresAt:s,expiryStatus:r}=this.getResponseMeta(e,...t,this.getState());return r!==o.W.Invalid&&Date.now()<=s?n:this.fetch(e,...t)},this.invalidate=(e,...t)=>null!==t[0]?this.dispatch((0,u.i)(e,{args:t})):Promise.resolve(),this.invalidateAll=e=>this.dispatch((0,p.N)((t=>e.testKey(t)))),this.expireAll=e=>this.dispatch((0,m.B)((t=>e.testKey(t)))),this.resetEntireStore=()=>this.dispatch((0,g.W)()),this.setResponse=(e,...t)=>{const n=t[t.length-1],s=(0,f.S)(e,{args:t.slice(0,t.length-1),response:n});return this.dispatch(s)},this.setError=(e,...t)=>{const n=t[t.length-1],s=(0,f.S)(e,{args:t.slice(0,t.length-1),response:n,error:!0});return this.dispatch(s)},this.resolve=(e,t)=>this.dispatch((0,f.S)(e,t)),this.subscribe=(e,...t)=>null!==t[0]?this.dispatch((0,d.K)(e,{args:t})):Promise.resolve(),this.unsubscribe=(e,...t)=>null!==t[0]?this.dispatch((0,d.b)(e,{args:t})):Promise.resolve(),this.snapshot=(e,t)=>new C(this,e,t),this._dispatch=e,this.getState=t,this.memo=n,this.gcPolicy=l}set dispatch(e){this._dispatch=e}get dispatch(){return this._dispatch}bindMiddleware({dispatch:e,getState:t}){this._dispatch=e,this.getState=t}set(e,...t){const n=t[t.length-1],s=(0,x.j)(e,{args:t.slice(0,t.length-1),value:n});return this.dispatch(s)}getError(e,...t){if(null===t[0])return;const n=t[t.length-1],s=t.slice(0,t.length-1),r=e.key(...s),i=b(n,r);return void 0===n.endpoints[r]||"soft"!==(null==i?void 0:i.errorPolicy)?null==i?void 0:i.error:void 0}getResponse(e,...t){return this.getResponseMeta(e,...t)}getResponseMeta(e,...t){const[n,s]=S(t),r=1!==s.length||null!==s[0],i=r?e.key(...s):"",a=r?n.endpoints[i]:void 0,c=e.schema,d=b(n,i);let h=null==d?void 0:d.expiresAt;const u=void 0===a&&void 0!==c,p=u?this.memo.buildQueryKey(c,s,n,i):a;if(!r)return{data:p,expiryStatus:o.W.Valid,expiresAt:1/0,countRef:()=>()=>{}};let m=!1;if(u)m=!(0,l.GW)(p);else if(!c||!E(c))return{data:a,expiryStatus:this.getExpiryStatus(void 0===a,!!e.invalidIfStale,d),expiresAt:h||0,countRef:this.gcPolicy.createCountRef({key:i})};const{data:g,paths:f}=this.memo.denormalize(c,p,n.entities,s);h||(h=m?1:function(e,t){let n=1/0;for(const{key:r,pk:i}of e){var s;const e=null==(s=t[r])||null==(s=s[i])?void 0:s.expiresAt;e<n&&(n=e)}return n}(f,n.entitiesMeta));const x="symbol"==typeof g;return{data:x?void 0:g,expiryStatus:this.getExpiryStatus(x,!!e.invalidIfStale||m,d),expiresAt:h,countRef:this.gcPolicy.createCountRef({key:i,paths:f})}}get(e,...t){const[n,s]=S(t),{data:r}=this.memo.query(e,s,n);return"symbol"==typeof r?void 0:r}getQueryMeta(e,...t){const[n,s]=S(t),{data:r,paths:i}=this.memo.query(e,s,n);return{data:"symbol"==typeof r?void 0:r,countRef:this.gcPolicy.createCountRef({paths:i})}}getExpiryStatus(e,t,n={}){return n.invalidated||e&&!n.error?o.W.Invalid:e||t?o.W.InvalidIfStale:o.W.Valid}}function E(e){if(!e)return!1;if(Array.isArray(e))return 0!==e.length&&E(e[0]);const t=typeof e;return("object"===t||"function"===t)&&("function"==typeof e.normalize||Object.values(e).some((e=>E(e))))}class C{constructor(e,t,n=0){this.state=void 0,this.controller=void 0,this.fetchedAt=void 0,this.abort=C.abort,this.state=t,this.controller=e,this.fetchedAt=n}getResponse(e,...t){return this.controller.getResponse(e,...t,this.state)}getResponseMeta(e,...t){return this.controller.getResponseMeta(e,...t,this.state)}getError(e,...t){return this.controller.getError(e,...t,this.state)}get(e,...t){return this.controller.get(e,...t,this.state)}getQueryMeta(e,...t){return this.controller.getQueryMeta(e,...t,this.state)}}function S(e){const t=e.length,n=new Array(t-1);for(let s=0;s<t-1;s++)n[s]=(0,v.A)(e[s]);return[e[t-1],n]}C.abort=new c.A},55773(e,t,n){n.d(t,{B:()=>r});var s=n(65657);function r(e){return{type:s.EXPIREALL,testKey:e}}},96831(e,t,n){n.d(t,{H:()=>r});var s=n(65657);function r(e,{args:t}){let n=0,r=0;const i=new Promise(((e,t)=>{[n,r]=[e,t]})),a={fetchedAt:Date.now(),resolve:n,reject:r,promise:i};return{type:s.FETCH,key:e.key(...t),args:t,endpoint:e,meta:a}}},47154(e,t,n){n.d(t,{i:()=>r});var s=n(65657);function r(e,{args:t}){return{type:s.INVALIDATE,key:e.key(...t)}}},44535(e,t,n){n.d(t,{N:()=>r});var s=n(65657);function r(e){return{type:s.INVALIDATEALL,testKey:e}}},49622(e,t,n){function s(e,t){const n=Date.now();return{fetchedAt:null!=t?t:n,date:n,expiresAt:n+e}}n.d(t,{u:()=>s})},46934(e,t,n){n.d(t,{S:()=>a});var s=n(49622),r=n(65657),i=n(52751);function a(e,t,n){var a;return{type:r.OPTIMISTIC,key:e.key(...t),args:t.map(i.A),endpoint:e,meta:(0,s.u)(null!=(a=e.dataExpiryLength)?a:6e4,n)}}},22868(e,t,n){n.d(t,{W:()=>r});var s=n(65657);function r(){return{type:s.RESET,date:Date.now()}}},57199(e,t,n){n.d(t,{j:()=>a});var s=n(49622),r=n(65657),i=n(52751);function a(e,{args:t,fetchedAt:n,value:a}){return{type:r.SET,value:a,args:t.map(i.A),schema:e,meta:(0,s.u)(6e4,n)}}},89244(e,t,n){n.d(t,{S:()=>a});var s=n(49622),r=n(65657),i=n(52751);function a(e,{args:t,fetchedAt:n,response:a,error:o=!1}){var l,c;const d=o?null!=(l=e.errorExpiryLength)?l:1e3:null!=(c=e.dataExpiryLength)?c:6e4;return{type:r.SET_RESPONSE,key:e.key(...t),response:a,args:t.map(i.A),endpoint:e,meta:(0,s.u)(d,n),error:o}}},46986(e,t,n){n.d(t,{K:()=>r,b:()=>i});var s=n(65657);function r(e,{args:t}){return{type:s.SUBSCRIBE,key:e.key(...t),args:t,endpoint:e}}function i(e,{args:t}){return{type:s.UNSUBSCRIBE,key:e.key(...t),args:t,endpoint:e}}},52751(e,t,n){const s="undefined"!=typeof FormData?e=>e instanceof FormData?Object.fromEntries(e.entries()):e:e=>e;n.d(t,["A",0,s])}
1,64686(e,t,n){n.d(t,{L:()=>r,m:()=>i});var s=n(65657);class r{constructor({intervalMS:e=3e5,expiryMultiplier:t=2,expiresAt:n}={}){this.endpointCount=new Map,this.entityCount=new Map,this.endpointsQ=new Set,this.entitiesQ=[],n&&(this.expiresAt=n.bind(this)),this.options={intervalMS:e,expiryMultiplier:t}}init(e){this.controller=e,this.intervalId=setInterval((()=>{this.idleCallback((()=>this.runSweep()),{timeout:1e3})}),this.options.intervalMS),"object"==typeof this.intervalId&&"unref"in this.intervalId&&this.intervalId.unref()}cleanup(){clearInterval(this.intervalId)}createCountRef({key:e,paths:t=[]}){return()=>{var n;return e&&this.endpointCount.set(e,(null!=(n=this.endpointCount.get(e))?n:0)+1),t.forEach((e=>{var t;const{key:n,pk:s}=e;this.entityCount.has(n)||this.entityCount.set(n,new Map);const r=this.entityCount.get(n);r.set(s,(null!=(t=r.get(s))?t:0)+1)})),()=>{if(e){const t=this.endpointCount.get(e);void 0!==t&&(t<=1?(this.endpointCount.delete(e),this.endpointsQ.add(e)):this.endpointCount.set(e,t-1))}t.forEach((e=>{const{key:t,pk:n}=e;if(!this.entityCount.has(t))return;const s=this.entityCount.get(t),r=s.get(n);void 0!==r&&(r<=1?(s.delete(n),this.entitiesQ.push(e)):s.set(n,r-1))}))}}}expiresAt({fetchedAt:e,expiresAt:t}){return Math.max((t-e)*this.options.expiryMultiplier,12e4)+e}runSweep(){const e=this.controller.getState(),t=[],n=[],r=Date.now(),i=new Set;for(const s of this.endpointsQ){var a;!this.endpointCount.has(s)&&this.expiresAt(null!=(a=e.meta[s])?a:{fetchedAt:0,date:0,expiresAt:0})<r?n.push(s):i.add(s)}this.endpointsQ=i;const o=[];for(const s of this.entitiesQ){var l,c,d;(null==(l=this.entityCount.get(s.key))||!l.has(s.pk))&&this.expiresAt(null!=(c=null==(d=e.entitiesMeta[s.key])?void 0:d[s.pk])?c:{fetchedAt:0,date:0,expiresAt:0})<r?t.push(s):o.push(s)}this.entitiesQ=o,(t.length||n.length)&&this.controller.dispatch({type:s.GC,entities:t,endpoints:n})}idleCallback(e,t){"function"==typeof requestIdleCallback?requestIdleCallback(e,t):e()}}class i{init(){}cleanup(){}createCountRef(){return()=>()=>{}}}},9369(e,t,n){n.d(t,{A:()=>g,u:()=>f});var s=n(46934);var r=n(65657);var i=n(20455),a=n(4576);var o=n(44038),l=n(47570);class c extends o.W{constructor(e,t,n){super(e),this.newEntities=new Map,this.newIndexes=new Map,this.entitiesMeta=e.entitiesMeta,this.args=t,this.meta=n,this.checkLoop=function(){const e=new Map;return function(t,n,s){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=r.get(n);return i||(i=new Set,r.set(n,i)),!!i.has(s)||(i.add(s),!1)}}()}getNewEntity(e,t){return this.getNewEntities(e).get(t)}getNewEntities(e){let t=this.newEntities.get(e);return void 0===t&&(t=new Map,this.newEntities.set(e,t)),t}getNewIndexes(e){return this.newIndexes.has(e)||(this.newIndexes.set(e,new Map),this.indexes[e]={...this.indexes[e]}),this.newIndexes.get(e)}mergeEntity(e,t,n){const s=e.key;let r=n,i=this.meta,a=this.getNewEntity(s,t);if(a)r=e.merge(a,n);else if(a=this.getEntity(s,t),a){const o=this.getMeta(s,t);r=e.mergeWithStore(o,i,a,n),i=e.mergeMetaWithStore(o,i,a,n)}this.setEntity(e,t,r,i)}setEntity(e,t,n,s=this.meta){const r=e.key,i=this.getNewEntities(r),a=!i.has(t);a&&0===i.size&&(this.entities[r]={...this.entities[r]},this.entitiesMeta[r]={...this.entitiesMeta[r]}),i.set(t,n),e.indexes&&function(e,t,n,s,r,i){for(const a of t){n.has(a)||n.set(a,s[a]={});const t=n.get(a);i[e]&&delete t[i[e][a]],i&&i[e]&&i[e][a]!==r[a]&&(t[i[e][a]]=l.u),a in r&&(t[r[a]]=e)}}(t,e.indexes,this.getNewIndexes(r),this.indexes[r],n,this.entities[r]),this._setEntity(r,t,n),a&&this._setMeta(r,t,s)}invalidate({key:e},t){this.setEntity({key:e},t,l.u)}_setEntity(e,t,n){this.entities[e][t]=n}_setMeta(e,t,n){this.entitiesMeta[e][t]=n}getMeta(e,t){return this.entitiesMeta[e][t]}}const d=(e,t,n=[],{entities:s,indexes:r,entitiesMeta:o}=h,l={fetchedAt:0,date:Date.now(),expiresAt:1/0})=>{if(null==e)return{result:t,entities:s,indexes:r,entitiesMeta:o};const d=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(e);if(null===t||typeof t!==d&&(void 0===e.key||void 0!==e.pk||"string"!=typeof t))throw new Error(`Unexpected input given to normalize. Expected type to be "${d}", found "${null===t?"null":typeof t}".`);const u={entities:{...s},indexes:{...r},entitiesMeta:{...o}},p=(e=>{let t;const n=(n,s,r,o)=>{if(null==s||!n)return s;if("object"!=typeof s){if("function"!=typeof n.normalize)return s;if(!n.acceptsPrimitives)return s&&n.pk?`${s}`:s}if("function"==typeof n.normalize){const i=t;n.pk&&(t=n);const a=n.normalize(s,r,o,e,i);return t=i,a}return"object"!=typeof n?s:(Array.isArray(n)?i.S8:a.S8)(n,s,r,o,e)};return e.visit=n,n})(new c(u,n,l));return{result:p(e,t,t,void 0),entities:u.entities,indexes:u.indexes,entitiesMeta:u.entitiesMeta}};const h={entities:{},indexes:{},entitiesMeta:{}};var u=n(39664);function p(e,t,n){return"AbortError"===n.name?{...e,optimistic:m(e,t)}
1:{...e,meta:{...e.meta,[t.key]:{date:t.meta.date,fetchedAt:t.meta.fetchedAt,expiresAt:t.meta.expiresAt,error:n,errorPolicy:null==t.endpoint.errorPolicy?void 0:t.endpoint.errorPolicy(n)}},optimistic:m(e,t)}}function m(e,t){return e.optimistic.filter((e=>e.key!==t.key||(e.type===r.OPTIMISTIC?e.meta.fetchedAt!==t.meta.fetchedAt:e.meta.date>t.meta.date)))}function g(e){return function(t,n){switch(t||(t=f),n.type){case r.GC:return n.entities.forEach((({key:e,pk:n})=>{var s,r;null==(s=t.entities[e])||delete s[n],null==(r=t.entitiesMeta[e])||delete r[n]})),n.endpoints.forEach((e=>{delete t.endpoints[e],delete t.meta[e]})),t;case r.FETCH:return function(e,t){if(t.endpoint.getOptimisticResponse&&t.endpoint.sideEffect){const n=(0,s.S)(t.endpoint,t.args,t.meta.fetchedAt);return{...e,optimistic:[...e.optimistic,n]}}return e}(t,n);case r.OPTIMISTIC:case r.SET_RESPONSE:return function(e,t,n){if(t.error)return p(e,t,t.response);try{var s;let o;if(t.type===r.OPTIMISTIC){if(!t.endpoint.getOptimisticResponse)return e;try{o=t.endpoint.getOptimisticResponse.call(t.endpoint,n.snapshot(e,t.meta.fetchedAt),...t.args)}catch(i){if(i.constructor===u.A)return e;throw i}}else o=t.response;const{result:l,entities:c,indexes:h,entitiesMeta:p}=d(t.endpoint.schema,o,t.args,e,t.meta),g={...e.endpoints,[t.key]:l};try{if(t.endpoint.update){const e=t.endpoint.update(l,...t.args);Object.keys(e).forEach((t=>{g[t]=e[t](g[t])}))}}catch(a){console.error(`Endpoint.update() error: ${t.key}`),console.error(a)}return{entities:c,endpoints:g,indexes:h,meta:{...e.meta,[t.key]:{date:t.meta.date,fetchedAt:t.meta.fetchedAt,expiresAt:t.meta.expiresAt,prevExpiresAt:null==(s=e.meta[t.key])?void 0:s.expiresAt}},entitiesMeta:p,optimistic:m(e,t),lastReset:e.lastReset}}catch(a){return"object"==typeof a&&(a.message=`Error processing ${t.key}\n\nFull Schema: ${JSON.stringify(t.endpoint.schema,void 0,2)}\n\nError:\n${a.message}`,"response"in t&&(a.response=t.response),a.status=400),p(e,t,a)}}(t,n,e);case r.SET:return function(e,t,n){let s;if("function"==typeof t.value){const r=n.get(t.schema,...t.args,e);if(void 0===r)return e;s=t.value(r)}else s=t.value;try{const{entities:n,indexes:r,entitiesMeta:i}=d(t.schema,s,t.args,e,t.meta);return{entities:n,endpoints:e.endpoints,indexes:r,meta:e.meta,entitiesMeta:i,optimistic:e.optimistic,lastReset:e.lastReset}}catch(r){return e}}(t,n,e);case r.INVALIDATEALL:case r.INVALIDATE:return function(e,t){const n={...e.endpoints},s={...e.meta},i=e=>{delete n[e];const t={...s[e],expiresAt:0,invalidated:!0};delete t.error,s[e]=t};return t.type===r.INVALIDATE?i(t.key):Object.keys(n).forEach((e=>{t.testKey(e)&&i(e)})),{...e,endpoints:n,meta:s}}(t,n);case r.EXPIREALL:return function(e,t){const n={...e.meta};return Object.keys(n).forEach((e=>{t.testKey(e)&&(n[e]={...n[e],expiresAt:1})})),{...e,meta:n}}(t,n);case r.RESET:return{...f,lastReset:n.date};default:return t}}}const f={entities:{},endpoints:{},indexes:{},meta:{},entitiesMeta:{},optimistic:[],lastReset:0}},53694(e,t,n){n.d(t,{W:()=>s});var s={Invalid:1,InvalidIfStale:2,Valid:3}},4002(e,t,n){n.d(t,{Ay:()=>i,GW:()=>a});var s=n(20455),r=n(4576);function i(e){return function t(n,i){if(function(e){return!!e&&"function"==typeof e.queryKey}(n)){if(1===i.length&&null===i[0])return;return n.queryKey(i,t,e)}if("object"==typeof n&&n){return(Array.isArray(n)?s.qv:r.qv)(n,i,t,e)}return n}}function a(e){return void 0!==e&&(!(e&&"object"==typeof e&&!Array.isArray(e))||Object.values(e).every(a))}},31807(e,t,n){n.d(t,{n:()=>r});var s=n(47570);class r{constructor({entities:e,indexes:t}){this.entities=e,this.indexes=t}tracked(e){const t=this,n=[{path:[""],entity:e}];return[{INVALID:s.u,getIndex(...e){const s=t.getIndex(...e);return n.push({path:e,entity:s}),t.getIndexEnd(s,e[2])},getEntity(...e){const s=t.getEntity(...e);return n.push({path:e,entity:s}),s},getEntities(e){const s=t.getEntitiesObject(e);return n.push({path:[e],entity:s}),t.getEntities(e)}},n]}}n.d(t,["g",0,e=>t=>{switch(t.length){case 1:return e.getEntitiesObject(t[0]);case 2:return e.getEntity(t[0],t[1]);case 3:return e.getIndex(t[0],t[1],t[2])}}])},44038(e,t,n){n.d(t,{W:()=>r});var s=n(31807);class r extends s.n{constructor(e){super(e)}getEntitiesObject(e){return this.entities[e]}getEntities(e){const t=this.entities[e];if(void 0!==t)return{keys:()=>Object.keys(t),entries:()=>Object.entries(t)}}getEntity(e,t){var n;return null==(n=this.entities[e])?void 0:n[t]}getIndex(e,t){var n;return null==(n=this.indexes[e])?void 0:n[t]}getIndexEnd(e,t){return null==e?void 0:e[t]}}},44314(e,t,n){n.d(t,["l",0,{}])},47570(e,t,n){const s=Symbol("INVALID");n.d(t,["u",0,s])},18239(e,t,n){n.d(t,{A:()=>c});var s=n(47570),r=n(44314);var i=n(20455),a=n(4576);const o=(e,t,n)=>function(s,i){const a="object"!=typeof i,o=a?e({key:s.key,pk:i}):i;if("symbol"==typeof o)return s.denormalize(o,n);if(void 0===o&&a&&""!==i&&"undefined"!==i)return t.getEntity(i,s,r.l,(e=>{e.set(i,void 0)}));if("object"!=typeof o||null===o)return o;let c=a?i:s.pk(o,void 0,void 0,n.args);return void 0===c||""===c||"undefined"===c?function(e){const t=new Map;return e(t),t.get("")}((e=>l(s,o,"",e,n))):("string"!=typeof c&&(c=`${c}`),t.getEntity(c,s,o,(e=>l(s,o,c,e,n))))};function l(e,t,n,r,i){const a=e.createIfValid(t);void 0===a?r.set(n,s.u):(r.set(n,a),r.set(n,e.denormalize(a,i)))}const c=(e,t,n)=>{let r=0;const l={args:n,unvisit:d,argsKey:e=>t.argsKey(e)},c=o(e,t,l);function d(t,n){if(!t)return n;if(null==n)return n;if("function"==typeof t.denormalize){if(function(e){return null!==e&&void 0!==e.pk}(t)){var o;if(r>=(null!=(o=t.maxEntityDepth)?o:64))return function(e,t,n){var r;const i="object"!=typeof n?e({key:t.key,pk:n}):n;return"object"!=typeof i||null===i?i:null!=(r=t.createIfValid(i))?r:s.u}(e,t,n);r++;const i=c(t,n);return r--,i}return"function"==typeof t.createIfValid&&"string"==typeof n?c(t,n):t.denormalize(n,l)}if("function"==typeof t)return t(n);if("object"==typeof t){return(Array.isArray(t)?i.NU:a.NU)(t,n,l)}return n}return(e,n)=>{const s=Object(n)===n&&Object(e)===e;return t.getResults(n,s,(()=>d(e,n)))}}},33644(e,t,n){n.d(t,{A:()=>m});const s={path:{key:"",pk:""},entity:void 0};
1class r{constructor(e,t,n,r=[]){this.dependencies=[s],this.cycleCache=new Map,this.cycleIndex=-1,this.localCache=new Map,this._hasArgsKey=!1,this._getEntity=e,this._getCache=t,this._resultCache=n,this._args=r}argsKey(e){return this._hasArgsKey=!0,this.dependencies.push({path:e,entity:void 0}),e(this._args)}getEntity(e,t,n,s){const r=t.key,i=this.getOrCreateLocalCache(r);if(i.get(e)){const t=this.cycleCache.get(r);null!=t&&t.has(e)?this.cycleIndex=t.get(e):this.dependencies.push({path:{key:r,pk:e},entity:n})}else{const a=this._getCache(e,t),[o,l]=a.get(n,this._getEntity,this._args);if(l){i.set(e,o.value);const t=o.dependencies;for(let e=0;e<t.length;e++)this.dependencies.push(t[e]);return a.hasStringDeps&&(this._hasArgsKey=!0),o.value}{const t=this.dependencies.length,o=this.getOrCreateCycleCache(r);o.set(e,t),this.dependencies.push({path:{key:r,pk:e},entity:n}),s(i),o.delete(e);const l=this.dependencies.slice(-1===this.cycleIndex?t:this.cycleIndex),c={dependencies:l,value:i.get(e)};a.set(l,c,this._args),this.cycleIndex===t&&(this.cycleIndex=-1)}}return i.get(e)}getOrCreateLocalCache(e){let t=this.localCache.get(e);return t||(t=new Map,this.localCache.set(e,t)),t}getOrCreateCycleCache(e){let t=this.cycleCache.get(e);return t||(t=new Map,this.cycleCache.set(e,t)),t}getResults(e,t,n){if(!t)return{data:n(),paths:this.paths()};let[s,r]=this._resultCache.get(e,this._getEntity,this._args);return void 0===r&&(s=n(),r=this.paths(),this.dependencies[0]={path:{key:"",pk:""},entity:e},this._resultCache.set(this.dependencies,s,this._args,r)),{data:s,paths:r}}paths(){const e=this.dependencies;if(!this._hasArgsKey){const t=new Array(e.length-1);for(let n=1;n<e.length;n++)t[n-1]=e[n].path;return t}const t=[];for(let n=1;n<e.length;n++){const s=e[n].path;"function"!=typeof s&&t.push(s)}return t}}var i=n(44314);class a{constructor(){this.next=new WeakMap,this.nextPath=void 0,this.hasStr=!1}get(e,t,n=[]){let s=this.next.get(e);if(!s)return o;if(this.hasStr)return this._getMixed(s,t,n);for(;s.nextPath;){var r;const e=null!=(r=t(s.nextPath))?r:i.l,n=s.next.get(e);if(!n)return o;s=n}return[s.value,s.journey]}_getMixed(e,t,n){for(;e.nextPath;){let l;if("function"==typeof e.nextPath){var s,r;const t=null!=(s=e.nextPath(n))?s:"\0";l=null==(r=e.nextStr)?void 0:r.get(t)}else{var a;const n=null!=(a=t(e.nextPath))?a:i.l;l=e.next.get(n)}if(!l)return o;e=l}return[e.value,e.journey]}set(e,t,n=[],s){if(e.length<1)throw new c;let r=this;for(const c of e){let e;if("function"==typeof c.path){var a;this.hasStr=!0,r.nextStr||(r.nextStr=new Map);const t=null!=(a=c.path(n))?a:"\0";e=r.nextStr.get(t),e||(e=new l,r.nextStr.set(t,e))}else{var o;if(e=r.next.get(c.entity),!e)e=new l,r.next.set(null!=(o=c.entity)?o:i.l,e)}r.nextPath=c.path,r=e}r.nextPath=void 0,r.value=t,r.journey=null!=s?s:e.map((e=>e.path))}get hasStringDeps(){return this.hasStr}}const o=[void 0,void 0];class l{constructor(){this.next=new WeakMap,this.nextStr=void 0,this.nextPath=void 0,this.value=void 0,this.journey=[]}}class c extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}var d=n(4002);var h=n(98584),u=n(31807),p=n(18239);class m{constructor(e=h.B){var t;this.endpoints=new a,this.queryKeys=new Map,this.policy=e,this._getCache=(t=new Map,(e,n)=>{var s;const r=n.key,i=null!=(s=n.cacheWith)?s:n;t.has(r)||t.set(r,new Map);const o=t.get(r);o.has(e)||o.set(e,new WeakMap);const l=o.get(e);let c=l.get(i);return c||(c=new a,l.set(i,c)),c})}denormalize(e,t,n,s=[]){if(void 0===e)return{data:t,paths:[]};if(void 0===t)return{data:void 0,paths:[]};const i=this.policy.getEntities(n);return(0,p.A)(i,new r(i,this._getCache,this.endpoints,s),s)(e,t)}query(e,t,n,s=JSON.stringify(t)){const r=this.buildQueryKey(e,t,n,s);return r?this.denormalize(e,r,n.entities,t):{data:void 0,paths:[]}}buildQueryKey(e,t,n,s=JSON.stringify(t)){if("object"!=typeof e&&"function"!=typeof e.queryKey||!e)return e;let r=this.queryKeys.get(s);r||(r=new a,this.queryKeys.set(s,r));const i=new this.policy.QueryDelegate(n);let[o,l]=r.get(e,(0,u.g)(i));if(!l){const[n,s]=i.tracked(e);o=(0,d.Ay)(n)(e,t),r.set(s,o)}return o}}},98584(e,t,n){const s={QueryDelegate:n(44038).W,getEntities:e=>({key:t,pk:n})=>{var s;return null==(s=e[t])?void 0:s[n]}};n.d(t,["B",0,s])},20455(e,t,n){n.d(t,{qv:()=>i});const s=e=>e[0],r=e=>void 0!==e&&"symbol"!=typeof e;function i(){}n.d(t,["NU",0,(e,t,n)=>(e=s(e),t.map?t.map((t=>n.unvisit(e,t))).filter(r):t),"S8",0,(e,t,n,r,i)=>{e=s(e);const a=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(t);return a.map((t=>i.visit(e,t,n,r)))}])},4576(e,t,n){n.d(t,{NU:()=>i,S8:()=>r,qv:()=>a});var s=n(47570);const r=(e,t,n,s,r)=>{const i={...t},a=Object.keys(e);for(let o=0;o<a.length;o++){const n=a[o],s=e[n],l=r.visit(s,t[n],t,n);void 0===l?delete i[n]:i[n]=l}return i},i=(e,t,n)=>{if(function(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}(t))return function(e,t,n){let r=!1;const i=Object.keys(e).reduce(((t,s)=>{const i=`${s}`,a=n.unvisit(e[i],t.get(i));return"symbol"==typeof a&&(r=!0),t.has(i)?t.set(i,a):t}),t);return r?s.u:i}(e,t,n);const r={...t};let i=!1;const a=Object.keys(e);for(let s=0;s<a.length;s++){const t=a[s],o=n.unvisit(e[t],r[t]);void 0!==r[t]&&(r[t]=o),"symbol"==typeof o&&(i=!0)}return i?s.u:r};function a(e,t,n,s){const r={};for(const i of Object.keys(e))r[i]=n(e[i],t,s);return r}},86535(e,t,n){var s=n(9369),r=n(12878),i=n(63696);const a=(0,i.createContext)(s.u),o=(0,i.createContext)(new r.A({dispatch:e=>Promise.resolve()})),l=(0,i.createContext)({subscribe:e=>()=>{},getState:()=>s.u,uninitialized:!0});n.d(t,["I5",0,o,"Pd",0,l,"zV",0,a])},35779(e,t,n){n.d(t,{A:()=>s});
1class s extends Error{constructor(e){super(`${e.url}: ${e.statusText||`Status not 'ok': ${e.status}`}`),this.name="NetworkError",this.status=e.status,this.response=e}toJSON(){return{name:this.name,status:this.status,message:this.message,url:this.response.url}}}},50839(e,t,n){n.d(t,{A:()=>f});var s=n(33503),r=n(81059),i=n(50875),a=n(68958),o=n(88024);function l(e,t){if("object"!=typeof e||void 0===e||Array.isArray(e))return;if(e instanceof a.A)return t(e);const n={...e instanceof o.Ay?e.schema:e};for(const s in n){if(!n[s])continue;const e=l(n[s],t);if(e)return e}}function c(e,t){if("object"!=typeof e||void 0===e)return e;if(e instanceof a.A)return t(e);const n={...e instanceof o.Ay?e.schema:e};for(const s in n)n[s]&&(n[s]=c(n[s],t));return n}var d=n(35779);function h(e,t){const n=new Set(e),s=[...e];for(const r of t)n.has(r)||s.push(r);return s}var u=n(93977);const p=/\btext\b|\bxml\b|\bhtml\b|\bjavascript\b|\bcss\b|\bcsv\b|\burlencoded\b/;function m(e){return e.json().catch((e=>{throw e.status=400,e}))}var g=(0,r.A)("hasBody");class f extends i.A{constructor(e){var t;super(null!=(t=e.fetch)?t:async function(...e){const t=(0,s.A)(this,g)[g]&&e.length<2?{}:e[0]||{},n=(0,s.A)(this,g)[g]?e[e.length-1]:void 0;return this.fetchResponse(this.url(t),await this.getRequestInit(n)).then((e=>this.parseResponse(e))).then((t=>this.process(t,...e)))},e),Object.defineProperty(this,g,{writable:!0,value:void 0}),(!("sideEffect"in this)||"method"in e&&!("sideEffect"in e))&&(this.sideEffect="GET"!==e.method&&void 0!==e.method||void 0),void 0===this.method&&(this.method=this.sideEffect?"POST":"GET"),void 0===this.urlPrefix&&(this.urlPrefix=""),(0,s.A)(this,g)[g]=!("body"in this&&void 0===this.body||["GET","DELETE"].includes(this.method)),Object.defineProperty(this,"name",{get(){return"__name"in this?this.__name:this.urlPrefix+this.path}})}key(...e){return`${this.method} ${this.url((0,s.A)(this,g)[g]&&e.length<2?{}:e[0]||{})}`}url(e={}){const t=(0,u.KB)(this.path),n={},s={};Object.keys(e).forEach((r=>{t.has(r)?void 0!==e[r]&&(n[r]=Array.isArray(e[r])?e[r].map(String):String(e[r])):s[r]=e[r]}));const r=(0,u.ts)(this.path)(n);return Object.keys(s).length?`${this.urlPrefix}${r}?${this.searchToString(s)}`:`${this.urlPrefix}${r}`}searchToString(e){return function(e){const t=new URLSearchParams(e);return t.sort(),t.toString()}(e)}getHeaders(e){return e}async getRequestInit(e){const t=(0,u.xJ)(e);t&&(e=JSON.stringify(e));const n={...this.requestInit,method:this.method,signal:this.signal,body:e};return e&&!t||(n.headers={"Content-Type":"application/json",...n.headers}),n.headers=await this.getHeaders(n.headers),n}fetchResponse(e,t){return fetch(e,t).then((e=>{if(!e.ok)throw new d.A(e);return e})).catch((e=>{throw e instanceof TypeError&&(e.status=500),e}))}parseResponse(e){if(204===e.status)return Promise.resolve(null);if(this.content)return"stream"===this.content?Promise.resolve(e.body):"json"===this.content?m(e):e[this.content]();const t=e.headers.get("content-type");if(null!=t&&t.includes("json"))return m(e);const n=t&&!p.test(t);if("string"==typeof this.schema||void 0===this.schema||null===this.schema||this.process!==f.prototype.process)return n?e.blob():e.text();if(n){const t=new d.A(e);throw t.status=400,t.message=`Unexpected binary content-type for schema ${this.schema}`,t}return e.text().then((t=>{const n=new d.A(e);throw n.status=404,n.message=`Unexpected text response for schema ${this.schema}`,n}))}process(e){return e}errorPolicy(e){return e.status>=500?"soft":void 0}get pathRegex(){return(0,u.p1)(this.path)}testKey(e){const t=this.method+" "+this.urlPrefix;if(!e.startsWith(t))return!1;let n=e.lastIndexOf("?");return-1===n&&(n=void 0),this.pathRegex.test(e.substring(t.length,n))}extend(e){class t extends this.constructor{}return Object.assign(t.prototype,this),new t({fetch:this.fetch,...e})}paginated(e){if("string"==typeof e){const t=e;e=({...e})=>(delete e[t],[e])}let t=!1;const n=c(this.schema,(n=>(t=!0,function(e,t){return Object.create(t,{name:{value:`Pagination(${t.schema})`},merge:{value:h},pk:{value:function(n,s,r,i){return t.pk.call(this,n,s,r,e(...i))}}})}
1(e,n))));if(!t)throw new Error("Missing Collection");const s=this;return this.extend({schema:n,key(...t){return s.key.call(this,...e(...t))},name:this.name+".getPage"})}get getPage(){return this.paginated(this.paginationField)}get push(){return this.extend({method:"POST",schema:l(this.schema,(e=>e.push)),name:this.name+".create"})}get unshift(){return this.extend({method:"POST",schema:l(this.schema,(e=>e.unshift)),name:this.name+".create"})}get assign(){return this.extend({method:"POST",schema:l(this.schema,(e=>e.assign)),name:this.name+".create"})}get remove(){return this.extend({method:"PATCH",schema:l(this.schema,(e=>e.remove)),name:this.name+".partialUpdate"})}get move(){const e={method:"PATCH",schema:l(this.schema,(e=>e.move)),searchParams:void 0,name:this.name+".partialUpdate"};return this.movePath&&(e.path=this.movePath),this.extend(e)}}},93977(e,t,n){n.d(t,{p1:()=>j,ts:()=>f,KB:()=>v,xJ:()=>A,nf:()=>E});const s="/",r=e=>e,i=/^[$_\p{ID_Start}]$/u,a=/^[$\u200c\u200d\p{ID_Continue}]$/u;function o(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class l{constructor(e,t){this.tokens=e,this.originalPath=t}}class c extends TypeError{constructor(e,t){let n=e;t&&(n+=`: ${t}`),n+="; visit https://git.new/pathToRegexpError for info",super(n),this.originalPath=t}}function d(e,t={}){const{encodePath:n=r}=t,s=[...e];let o=0;return new l(function t(r){const l=[];let d="";function h(){d&&(l.push({type:"text",value:n(d)}),d="")}for(;o<s.length;){const n=s[o++];if(n===r)return h(),l;if("\\"!==n)if(":"!==n&&"*"!==n)if("{"!==n){if("}"===n||"("===n||")"===n||"["===n||"]"===n||"+"===n||"?"===n||"!"===n)throw new c(`Unexpected ${n} at index ${o-1}`,e);d+=n}else h(),l.push({type:"group",tokens:t("}")});else{const t=":"===n?"param":"wildcard";let r="";if(i.test(s[o]))do{r+=s[o++]}while(a.test(s[o]));else if('"'===s[o]){let t=o;for(;o<s.length;){if('"'===s[++o]){o++,t=0;break}"\\"===s[o]&&o++,r+=s[o]}if(t)throw new c(`Unterminated quote at index ${t}`,e)}if(!r)throw new c(`Missing parameter name at index ${o}`,e);h(),l.push({type:t,name:r})}else{if(o===s.length)throw new c(`Unexpected end after \\ at index ${o}`,e);d+=s[o++]}}if(r)throw new c(`Unexpected end at index ${o}, expected ${r}`,e);return h(),l}(""),e)}function h(e,t,n){const s=e.map((e=>function(e,t,n){if("text"===e.type)return()=>e.value;if("group"===e.type){const s=h(e.tokens,t,n);return(e,t)=>{const n=t.length,r=s(e,t);return t.length===n?r:(t.length=n,"")}}const s=n||r;if("wildcard"===e.type&&!1!==n)return(n,r)=>{const i=n[e.name];if(null==i)return r.push(e.name),"";if(!Array.isArray(i)||0===i.length)throw new TypeError(`Expected "${e.name}" to be a non-empty array`);let a="";for(let o=0;o<i.length;o++){if("string"!=typeof i[o])throw new TypeError(`Expected "${e.name}/${o}" to be a string`);o>0&&(a+=t),a+=s(i[o])}return a};return(t,n)=>{const r=t[e.name];if(null==r)return n.push(e.name),"";if("string"!=typeof r)throw new TypeError(`Expected "${e.name}" to be a string`);return s(r)}}(e,t,n)));return(e,t)=>{let n="";for(const r of s)n+=r(e,t);return n}}function u(e,t={}){const{delimiter:n=s,end:r=!0,sensitive:i=!1,trailing:a=!0}=t,l=[];let h="",u=0;!function e(s){if(Array.isArray(s)){for(const t of s)e(t);return}const r="object"==typeof s?s:d(s,t);p(r.tokens,0,[],(e=>{if(u>=256)throw new c("Too many path combinations",r.originalPath);u>0&&(h+="|"),h+=function(e,t,n,s){let r="",i="",a="",l=0,d=0,h=0;function u(n,s){for(;n<e.length;){const r=e[n++];if(r.type===s)return!0;if("text"===r.type&&r.value.includes(t))break}return!1}function p(t){let n="";for(;t<e.length;){const s=e[t++];if("text"!==s.type)break;n+=s.value}return n}for(;h<e.length;){const g=e[h++];if("text"!==g.type){if("param"!==g.type&&"wildcard"!==g.type)throw new TypeError(`Unknown token type: ${g.type}`);if(l&&!i)throw new c(`Missing text before "${g.name}" ${g.type}`,s);"param"===g.type?(r+=2&d?`(${m(t,i)}+)`:u(h,"wildcard")?`(${m(t,p(h))}+)`:1&d?`(${m(t,i)}+|${o(i)})`:`(${m(t,"")}+)`,d|=l=1):(r+=2&d?`(${m(i,"")}+)`:a?`(${m(a,"")}+|${m(t,"")}+)`:"([^]+)",a="",d|=l=2),n.push(g),i=""}else r+=o(g.value),i+=g.value,2===l&&(a+=g.value),g.value.includes(t)&&(d=0)}return r}(e,n,l,r.originalPath),u++}))}(e);let g=`^(?:${h})`;return a&&(g+="(?:"+o(n)+"$)?"),g+=r?"$":"(?="+o(n)+"|$)",{regexp:new RegExp(g,i?"":"i"),keys:l}}function p(e,t,n,s){for(;t<e.length;){const r=e[t++];if("group"!==r.type)n.push(r);else{const i=n.length;p(r.tokens,0,n,(n=>p(e,t,n,s))),n.length=i}}s(n)}function m(e,t){return t.length>e.length?m(t,e):(e===t&&(t=""),t.length>1?`(?:(?!${o(e)}|${o(t)})[^])`:e.length>1?`(?:(?!${o(e)})[^${o(t)}])`:`[^${o(e+t)}]`)}const g=Object.create(null);function f(e){return e in g||(g[e]=function(e,t={}){const{encode:n=encodeURIComponent,delimiter:r=s}=t,i=h(("object"==typeof e?e:d(e,t)).tokens,r,n);return function(e={}){const t=[],n=i(e,t);if(t.length)throw new TypeError(`Missing parameters: ${t.join(", ")}`);return n}}(e)),g[e]}const x=Object.create(null);function v(e){return e in x||(x[e]=b(d(e).tokens)),x[e]}const y=Object.create(null);function j(e){return e in y||(y[e]=u(e).regexp),y[e]}function b(e){const t=new Set;for(const n of e)switch(n.type){case"param":case"wildcard":t.add(n.name);break;case"group":for(const e of b(n.tokens))t.add(e)}return t}const k=Object.prototype,w=Object.getPrototypeOf;function A(e){return null!==e&&"object"==typeof e&&w(e)===k}function E(e){const t=Math.max(e.lastIndexOf(":"),e.lastIndexOf("*"));if(-1===t)throw new Error("Resource path requires at least one :parameter or *wildcard");let n=e.substring(0,t);return"/"===n[n.length-1]&&(n=n.substring(0,n.length-1)),n}}
1,8815(e,t,n){n.d(t,{A:()=>l});var s=n(98981),r=n(50839),i=n(93977);const{Invalidate:a,Collection:o}=s;function l({path:e,schema:t,Endpoint:n=r.A,Collection:s=o,nonFilterArgumentKeys:l,optimistic:u,paginationField:p,...m}){const g=(0,i.nf)(e),f=e=>`${null==t?void 0:t.name}.${e}`;function x(e,t,n){e[t]=e[t].extend(n)}const v={...m},y={...m},j=new n({...m,path:e,schema:t,name:f("get")});u&&(v.getOptimisticResponse=c,y.getOptimisticResponse=function(e){return function(t,n,s){const r=t.get(e,n);if(!r)throw t.abort;return{...n,...r,...h(s)}}}(t));const b=new n({...v,paginationField:p,movePath:e,path:g,schema:new s([t],void 0===l?void 0:{nonFilterArgumentKeys:l}),name:f("getList")});return{get:j,getList:b,create:b.push.extend({name:f("create")}),update:new n({...v,path:e,schema:t,method:"PUT",name:f("update")}),partialUpdate:new n({...y,path:e,schema:t,method:"PATCH",name:f("partialUpdate")}),delete:new n({...v,path:e,schema:t.process||t._hoistable?new a(t):t,method:"DELETE",name:f("delete"),process:(e,t)=>e&&Object.keys(e).length?e:t,getOptimisticResponse:u?d:void 0}),extend(...e){if("string"==typeof e[0]){const[t,n]=e;if(t in this){const e={...this};return x(e,t,n),e}return{...this,[t]:this.get.extend(n)}}if("function"==typeof e[0]){const t=e[0](this);return{...this,...t}}const t=e[0],n={...this};for(const s in t)x(n,s,t[s]);return n}}}function c(e,t,n){return{...t,...h(n)}}function d(e,t){return t}function h(e){return e instanceof FormData?Object.fromEntries(e.entries()):e}},50050(e){e.exports=JSON.parse('{"permalink":"/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy","source":"@site/blog/2026-04-01-v0.16-parallel-fetching-collection-move-lazy.md","title":"v0.16: Parallel Fetching, Collection.move, Lazy","description":"Parallel data loading with useFetch(), Collection.move for reordering across lists, and Lazy for deferred relationship denormalization","date":"2026-04-01T00:00:00.000Z","tags":[{"inline":false,"label":"Releases","permalink":"/blog/tags/releases","description":"New versions of Reactive Data Client"},{"inline":false,"label":"REST","permalink":"/blog/tags/rest","description":"Representational state transfer: HTTP based APIs"},{"inline":false,"label":"Schemas","permalink":"/blog/tags/schema","description":"TypeSafe definition of a data model"},{"inline":false,"label":"Collections","permalink":"/blog/tags/collection","description":"Mutable Arrays or Values"}],"readingTime":11.47,"hasTruncateMarker":true,"authors":[{"name":"Nathaniel Tucker","title":"Creator of Reactive Data Client","url":"https://github.com/ntucker","socials":{"x":"https://x.com/npinp","linkedin":"https://www.linkedin.com/in/ntucker/","github":"https://github.com/ntucker","stackoverflow":"https://stackoverflow.com/users/nathaniel-tucker"},"imageURL":"https://github.com/ntucker.png","key":"ntucker","page":null}],"frontMatter":{"title":"v0.16: Parallel Fetching, Collection.move, Lazy","description":"Parallel data loading with useFetch(), Collection.move for reordering across lists, and Lazy for deferred relationship denormalization","image":"/img/social/0.16-card.png","authors":["ntucker"],"tags":["releases","rest","schema","collection"]},"unlisted":false,"prevItem":{"title":"v0.18: Scalar, Typed File Downloads, Filter-aware Collections","permalink":"/blog/2026/05/01/v0.18-scalar-typed-downloads"},"nextItem":{"title":"v0.15: Vue 3, Collection.remove, useDebounce Upgrade","permalink":"/blog/2026/01/06/v0.15-vue-support-collection-remove"}}')}}]);
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.