PageSourceSearch

https://syngrafi.vercel.app/_next/static/chunks/app/(reader)/search/page-112fcd46028d2dc8.js

js syngrafi.vercel.app collected 2026-10-03 05:53:41 UTC 9,445 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[468],{1070:function(e,t,r){Promise.resolve().then(r.bind(r,6524)),Promise.resolve().then(r.t.bind(r,2972,23))},3328:function(e,t,r){"use strict";r.d(t,{H:function(){return a}});var o=r(7437),n=r(2265);let s=["Genesis","Exodus","Leviticus","Numbers","Deuteronomy","Joshua","Judges","Ruth","1 Samuel","2 Samuel","1 Kings","2 Kings","1 Chronicles","2 Chronicles","Ezra","Nehemiah","Esther","Job","Psalms","Proverbs","Ecclesiastes","Song of Solomon","Isaiah","Jeremiah","Lamentations","Ezekiel","Daniel","Hosea","Joel","Amos","Obadiah","Jonah","Micah","Nahum","Habakkuk","Zephaniah","Haggai","Zechariah","Malachi","Matthew","Mark","Luke","John","Acts","Romans","1 Corinthians","2 Corinthians","Galatians","Ephesians","Philippians","Colossians","1 Thessalonians","2 Thessalonians","1 Timothy","2 Timothy","Titus","Philemon","Hebrews","James","1 Peter","2 Peter","1 John","2 John","3 John","Jude","Revelation","1 Nephi","2 Nephi","Jacob","Enos","Jarom","Omni","Words of Mormon","Mosiah","Alma","Helaman","3 Nephi","4 Nephi","Mormon","Ether","Moroni","D&C","Doctrine and Covenants","Moses","Abraham","Joseph Smith—Matthew","Joseph Smith—History","Articles of Faith"];function a(e){let{name:t,defaultValue:r="",placeholder:a,className:l,autoFocus:i,value:u,onChange:d}=e,[c,h]=(0,n.useState)(r),[m,p]=(0,n.useState)(!1),[f,x]=(0,n.useState)(-1),g=(0,n.useRef)(null),b=void 0!==u?u:c,v=b.match(/([a-zA-Z1-4&]+)$/),k=v?v[1].toLowerCase():"",w=k.length>=2?s.filter(e=>e.toLowerCase().startsWith(k)).slice(0,3):[];return(0,o.jsxs)("div",{className:"relative flex-1",children:[(0,o.jsxs)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground z-10",children:[(0,o.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,o.jsx)("path",{d:"M20 20l-3.5-3.5"})]}),(0,o.jsx)("input",{ref:g,type:"text",name:t,value:b,onChange:e=>{let t=e.target.value;h(t),x(-1),null==d||d(t)},onKeyDown:e=>{if(0!==w.length){if("ArrowDown"===e.key)e.preventDefault(),x(e=>e<w.length-1?e+1:e);else if("ArrowUp"===e.key)e.preventDefault(),x(e=>e>-1?e-1:-1);else if("Tab"===e.key){if(w.length>0){e.preventDefault();let t=f>=0?w[f]:w[0],r=b.replace(/[a-zA-Z1-4&]+$/,t+" ");h(r),x(-1),null==d||d(r)}}else if("Enter"===e.key){if(f>=0){e.preventDefault();let t=w[f],r=b.replace(/[a-zA-Z1-4&]+$/,t+" ");h(r),x(-1),null==d||d(r)}}else x(-1)}},onFocus:()=>p(!0),onBlur:()=>setTimeout(()=>p(!1),150),placeholder:a,autoFocus:i,autoComplete:"off",className:l||"w-full rounded-md border border-input bg-background py-2 pl-10 pr-3 text-foreground","aria-label":"Search query"}),m&&w.length>0&&(0,o.jsx)("ul",{className:"absolute left-0 right-0 top-full z-[100] mt-1 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md glass",children:w.map((e,t)=>(0,o.jsxs)("li",{className:"cursor-pointer px-3 py-2 text-sm transition-colors ".concat(t===f?"bg-accent text-accent-foreground font-medium":"hover:bg-muted/50"),onMouseDown:t=>{var r;t.preventDefault();let o=b.replace(/[a-zA-Z1-4&]+$/,e+" ");h(o),x(-1),null==d||d(o),null===(r=g.current)||void 0===r||r.focus()},children:[(0,o.jsx)("span",{className:"font-semibold text-primary",children:e.slice(0,k.length)}),e.slice(k.length)]},e))})]})}},6524:function(e,t,r){"use strict";r.d(t,{SearchForm:function(){return i}});var o=r(7437),n=r(9376),s=r(2265),a=r(3328);function l(e){return(null!=e?e:"").split(",").map(e=>e.trim()).filter(Boolean)}function i(e){let{works:t,initialQuery:r="",initialWorkIds:i="",vectorSearchAvailable:u=!1,initialMode:d}
1=e,c=(0,n.useRouter)(),h=(0,n.useSearchParams)(),[m,p]=(0,s.useTransition)(),f=(0,s.useMemo)(()=>t.map(e=>e.id),[t]),x=(0,s.useMemo)(()=>new Set(f),[f]),g=(0,s.useMemo)(()=>{let e=l(i).filter(e=>x.has(e));return new Set(0===e.length?f:e)},[f,x,i]),[b,v]=(0,s.useState)(()=>g),[k,w]=(0,s.useState)(!1),[y,j]=(0,s.useState)(u?"keyword"===d?"keyword":"semantic":"keyword");(0,s.useEffect)(()=>{v(e=>{let t=new Set;for(let r of e)x.has(r)&&t.add(r);let r=l(i).filter(e=>x.has(e));return r.length>0?new Set(r):0===t.size&&f.length>0?new Set(f):t})},[f,x,i]);let N=b.size,S=t.length,C=S>0&&N===S,P=S>0&&0===N,M=(0,s.useMemo)(()=>t.filter(e=>b.has(e.id)).map(e=>e.id),[b,t]),J=(0,s.useMemo)(()=>0===S||0===N||N===S?"":M.join(","),[M,N,S]),D=(0,s.useMemo)(()=>0===S?"No works":N===S?"All works":"".concat(N," of ").concat(S," works"),[N,S]),E=(0,s.useRef)(null);return(0,s.useEffect)(()=>{E.current&&(E.current.indeterminate=N>0&&N<S)},[N,S]),(0,o.jsxs)("form",{onSubmit:function(e){var t,r,o,n,s,a,l,i,u,d;if(e.preventDefault(),P)return;let m=e.currentTarget,f=null!==(l=null===(r=m.querySelector('[name="q"]'))||void 0===r?void 0:null===(t=r.value)||void 0===t?void 0:t.trim())&&void 0!==l?l:"",x=null!==(i=null===(n=m.querySelector('[name="workIds"]'))||void 0===n?void 0:null===(o=n.value)||void 0===o?void 0:o.trim())&&void 0!==i?i:"",g=new URLSearchParams(null!==(u=null==h?void 0:h.toString())&&void 0!==u?u:"");f?g.set("q",f):g.delete("q"),g.delete("workId"),x?g.set("workIds",x):g.delete("workIds");let b=null!==(d=null===(a=m.querySelector('[name="mode"]'))||void 0===a?void 0:null===(s=a.value)||void 0===s?void 0:s.trim())&&void 0!==d?d:"keyword";"keyword"===b?g.set("mode",b):g.delete("mode"),p(()=>{let e=g.toString();c.push(e?"/search?".concat(e):"/search")})},className:"flex flex-col gap-3",children:[(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)("div",{className:"relative flex-1",children:[(0,o.jsxs)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:[(0,o.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,o.jsx)("path",{d:"M20 20l-3.5-3.5"})]}),(0,o.jsx)(a.H,{name:"q",defaultValue:r,placeholder:"semantic"===y?"Describe what you're looking for...":"Search passages by keyword or book ref (e.g. John 3:16)..."})]}),(0,o.jsx)("button",{type:"submit",disabled:m||P,className:"rounded-md bg-primary px-4 py-2 text-primary-foreground hover:bg-primary/90 disabled:opacity-50","aria-live":"polite",children:(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[m&&(0,o.jsx)("span",{"aria-hidden":"true",className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/40 border-t-primary-foreground"}),(0,o.jsx)("span",{children:m?"Searching...":"Search"})]})})]}),(0,o.jsx)("p",{className:"text-xs text-muted-foreground",children:"Press Enter to search"}),u&&(0,o.jsxs)("div",{className:"flex items-center gap-1 rounded-lg border border-input bg-muted/50 p-1",children:[(0,o.jsx)("button",{type:"button",onClick:()=>j("keyword"),className:"rounded-md px-3 py-1.5 text-sm font-medium transition-colors ".concat("keyword"===y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Keyword"}),(0,o.jsx)("button",{type:"button",onClick:()=>j("semantic"),className:"rounded-md px-3 py-1.5 text-sm font-medium transition-colors ".concat("semantic"===y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Semantic"})]}),(0,o.jsx)("input",{type:"hidden",name:"workIds",value:J}),(0,o.jsx)("input",{type:"hidden",name:"mode",value:y}),(0,o.jsxs)("div",{className:"rounded-md border border-input bg-background",children:[(0,o.jsxs)("button",{type:"button",onClick:()=>w(e=>!e),className:"flex w-full items-center justify-between gap-3 px-3 py-2 text-left","aria-expanded":k,"aria-controls":"work-checkboxes",children:[(0,o.jsxs)("span",{className:"text-sm text-foreground",children:["Works: ",D]}),(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:k?"Hide":"Show"})]}
1),k&&(0,o.jsxs)("div",{id:"work-checkboxes",className:"border-t border-input px-3 py-2",children:[(0,o.jsxs)("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[(0,o.jsx)("input",{ref:E,type:"checkbox",checked:C,onChange:e=>{v(e.currentTarget.checked?new Set(f):new Set)},className:"h-4 w-4 rounded border border-input bg-background"}),(0,o.jsx)("span",{children:C?"Deselect all":"Select all"})]}),(0,o.jsx)("div",{className:"mt-2 max-h-56 space-y-1 overflow-auto",children:t.map(e=>(0,o.jsxs)("label",{className:"flex items-center gap-2 rounded px-1 py-1 text-sm text-foreground",children:[(0,o.jsx)("input",{type:"checkbox",checked:b.has(e.id),onChange:t=>{let r=t.currentTarget.checked;v(t=>{let o=new Set(t);return r?o.add(e.id):o.delete(e.id),o})},className:"h-4 w-4 rounded border border-input bg-background"}),(0,o.jsx)("span",{className:"truncate",children:e.title})]},e.id))}),P&&(0,o.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Select at least one work to search."})]})]})]})}},9376:function(e,t,r){"use strict";var o=r(5475);r.o(o,"useParams")&&r.d(t,{useParams:function(){return o.useParams}}),r.o(o,"usePathname")&&r.d(t,{usePathname:function(){return o.usePathname}}),r.o(o,"useRouter")&&r.d(t,{useRouter:function(){return o.useRouter}}),r.o(o,"useSearchParams")&&r.d(t,{useSearchParams:function(){return o.useSearchParams}})}},function(e){e.O(0,[972,971,117,744],function(){return e(e.s=1070)}),_N_E=e.O()}]);

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.