PageSourceSearch

https://zerosnag.ai/_next/static/chunks/2261-29a5325d8ba57a47.js

js zerosnag.ai collected 2026-10-05 14:56:26 UTC 3,618 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2261],{92261:(e,t,r)=>{r.d(t,{_y:()=>n,CF:()=>i,IT:()=>a,su:()=>o});var s=r(12115);let n=s.createContext(null),i=()=>s.useContext(n);r(92723);let o=()=>(()=>{let e=(0,s.useContext)(n),[t,r]=(0,s.useState)(e.currentStatus);return(0,s.useEffect)(()=>{let t=e.registerListener({statusChanged:e=>{r(e)}});return()=>t?.()},[e]),t})();function a(e,t=[],r={}){let n=i();if(!n)return{...u,isLoading:!1,error:Error("PowerSync not configured.")};let{parsedQuery:c,queryChanged:l}=((e,t=[],r)=>{let n=i(),o=s.useMemo(()=>JSON.stringify(t),[t]),a=s.useMemo(()=>"string"==typeof e?{compile:()=>({sql:e,parameters:t}),execute:()=>n.getAll(e,t),stringifiedParameters:o}:{compile:()=>{let t=e.compile();return{sql:t.sql,parameters:[...t.parameters]}},execute:()=>e.execute()},[e,n,o]),u=((e,t)=>{let r;try{r=e.compile()}catch(e){return!1}let n=r,i=e.stringifiedParameters??JSON.stringify(n.parameters),o=JSON.stringify(t),a=s.useRef({sqlStatement:n.sql,stringifiedParams:i,stringifiedOptions:o});return(a.current.sqlStatement!==n.sql||a.current.stringifiedParams!=i||a.current.stringifiedOptions!=o)&&(a.current.sqlStatement=n.sql,a.current.stringifiedParams=i,a.current.stringifiedOptions=o,!0)})(a,r);return{parsedQuery:a,queryChanged:u}})(e,t,r),g=function(e,t){let r=function(e){let t=i(),r=o(),n=(0,s.useMemo)(()=>JSON.stringify(e),[e]),a=(0,s.useMemo)(()=>e.map(e=>({stream:t.syncStream(e.name,e.parameters??void 0),options:e})),[n]);return(0,s.useEffect)(()=>{let e=!0,t=[];for(let r of a)r.stream.subscribe(r.options).then(r=>{e?t.push(r):r.unsubscribe()});return()=>{for(let r of(e=!1,t))r.unsubscribe()}},[n]),(0,s.useMemo)(()=>a.map(e=>r.forStream(e.stream)??null),[r,n])}(t??[]);return!t||t.every((e,t)=>!e.waitForStream||r[t]?.subscription?.hasSynced===!0)}(0,r?.streams),f=r?.runQueryOnce==!0,p=(e=>{let{query:t,powerSync:r,queryChanged:n,active:i}=e,[o,a]=s.useState({isLoading:!0,isFetching:!0,data:[],error:void 0}),u=s.useCallback(async e=>{a(e=>({...e,isLoading:!0,isFetching:!0,error:void 0}));try{let s=t.compile(),n=await t.execute({sql:s.sql,parameters:[...s.parameters],db:r});if(e.aborted)return;a(e=>({...e,isLoading:!1,isFetching:!1,data:n,error:void 0}))}catch(e){a(t=>({...t,isLoading:!1,isFetching:!1,data:[],error:e}))}},[n,t]);return s.useEffect(()=>{if(i){let e=new AbortController;return u(e.signal),()=>{e.abort()}}},[r,i,n]),{...o,refresh:u}})({query:c,powerSync:n,queryChanged:l,active:f&&g}),m=(e=>{let{query:t,powerSync:r,queryChanged:n,options:i,active:o}=e;function a(){return o?i.rowComparator?r.customQuery(t).differentialWatch({rowComparator:i.rowComparator,reportFetching:i.reportFetching,throttleMs:i.throttleMs}):r.customQuery(t).watch({reportFetching:i.reportFetching,throttleMs:i.throttleMs}):null}let[u,c]=s.useState(a),l=s.useRef(null);s.useEffect(()=>{u?.close();let e=a();return c(e),()=>{l.current?.(),e?.close()}},[r,o]),n&&(u?.updateSettings({query:t,throttleMs:i.throttleMs,reportFetching:i.reportFetching}),l.current?.(),l.current=u?.registerListener({settingsWillUpdate:()=>{l.current?.(),l.current=null}}));let g=(i.reportFetching??!0)&&!!l.current,f=(e=>{let[t,r]=s.useState(e?.state);return s.useEffect(()=>{if(e)return r(e.state),e.registerListener({onStateChange:e=>{r({...e})}})},[e]),t})(u);return{data:f?.data??[],isLoading:f?.isLoading??!0,error:f?.error,isFetching:f?.isFetching||g}})({query:c,powerSync:n,queryChanged:l,options:{reportFetching:r.reportFetching,rowComparator:r.rowComparator},active:!f&&g});return g?(f?p:m)??u:{...u}}let u={isLoading:!0,isFetching:!1,data:[],error:void 0}}}]);

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.