import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{Evt as t,Fct as n,Lct as r,Mvt as i,cdt as a,ldt as o,lvt as s,pvt as c,xvt as l}from"./app-initial-BHB6SClA.js";function u(){let e=(0,y.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:b,queryFn:d,retry:!1,staleTime:a.FIVE_MINUTES},e[0]=t):t=e[0],l(t)}function d(){return n.safeGet(`/wham/settings/user`)}function f(){let e=(0,y.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:x,queryFn:p,retry:!1,staleTime:a.FIVE_MINUTES},e[0]=t):t=e[0],l(t)}function p(){return n.safeGet(`/wham/settings/configs/user-preferences`)}function m(){let e=(0,y.c)(2),n=t(),r;return e[0]===n?r=e[1]:(r={mutationFn:h,onSuccess:e=>{n.setQueryData(b,e)}},e[0]=n,e[1]=r),c(r)}function h(e){return n.safePatch(`/wham/settings/user`,{requestBody:e})}function g(e,t,n){let r=(e.match(/{/g)??[]).length;if(r!==(e.match(/}/g)??[]).length)return`bracket-mismatch`;if(r===0)return`missing-pattern`;let i=n.map(e=>e.value);if((e.match(/{([^}]+)}/g)??[]).some(e=>!i.includes(e)))return`invalid-pattern`;let a=v(e,n,e=>`x`.repeat(e.char_count));return a.length>t?`too-long`:a.startsWith(`/`)?`leading-slash`:/^[a-zA-Z0-9./\-_]+$/.test(a)?null:`invalid-characters`}function _(e,t){return v(e,t,e=>e.example)}function v(e,t,n){let r=e;for(let e of t)r=r.replaceAll(e.value,n(e));return r}var y,b,x,S=e((()=>{y=i(),s(),o(),r(),b=[`cloud-user-preferences`],x=[`cloud-preferences-config`]}));export{u as a,f as i,g as n,m as o,S as r,_ as t};
//# sourceMappingURL=cloud-preferences-CBs_FcMz.js.map