PageSourceSearch

https://zeropointlabs.ai/assets/WizardConfig-Coaronwq.js

js zeropointlabs.ai collected 2026-10-05 15:19:48 UTC 14,562 bytes, 6 lines download raw bytes

vendor: 5,651 bytes, lines 1-6
1import{c as Se,aG as je,J as Ce,r as u,a9 as _e,j as e,a4 as D,a3 as M,aO as Pe,P as B,aM as Re,aR as re,O as Ne,ak as De,u as Me,B as Ee,g as ee,C as K,e as V,f as L,$ as T,a as F,a1 as H,s as q,w as te}from"./index-CLtGP32Z.js";import{u as se}from"./useMutation-BvxM86re.js";import{L as j}from"./label-C5P13FKO.js";import{u as ke}from"./index-DAJOau0q.js";import{S as ne}from"./switch-BuJuE40j.js";import{S as Ie}from"./separator-iZ0hbXOD.js";import{S as Ae}from"./save-DQzP6t1C.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Be=Se("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var ae=["PageUp","PageDown"],oe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ie={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},E="Slider",[Y,Ke,Ve]=je(E),[ce,it]=Ce(E,[Ve]),[Le,O]=ce(E),le=u.forwardRef((s,r)=>{const{name:a,min:t=0,max:o=100,step:l=1,orientation:i="horizontal",disabled:n=!1,minStepsBetweenThumbs:d=0,defaultValue:x=[t],value:g,onValueChange:c=()=>{},onValueCommit:m=()=>{},inverted:w=!1,form:S,...v}=s,h=u.useRef(new Set),f=u.useRef(0),y=i==="horizontal"?Te:Fe,[p=[],k]=_e({prop:g,defaultProp:x,onChange:b=>{var R;(R=[...h.current][f.current])==null||R.focus(),c(b)}}),U=u.useRef(p);function $(b){const C=$e(p,b);I(b,C)}function ye(b){I(b,f.current)}function be(){const b=U.current[f.current];p[f.current]!==b&&m(p)}function I(b,C,{commit:R}={commit:!1}){const J=Ge(l),W=Qe(Math.round((b-t)/l)*l+t,J),A=re(W,[t,o]);k((N=[])=>{const _=Oe(N,A,C);if(Ye(_,d*l)){f.current=_.indexOf(A);const Z=String(_)!==String(N);return Z&&R&&m(_),Z?_:N}else return N})}return e.jsx(Le,{scope:s.__scopeSlider,name:a,disabled:n,min:t,max:o,valueIndexToChangeRef:f,thumbs:h.current,values:p,orientation:i,form:S,children:e.jsx(Y.Provider,{scope:s.__scopeSlider,children:e.jsx(Y.Slot,{scope:s.__scopeSlider,children:e.jsx(y,{"aria-disabled":n,"data-disabled":n?"":void 0,...v,ref:r,onPointerDown:D(v.onPointerDown,()=>{n||(U.current=p)}),min:t,max:o,inverted:w,onSlideStart:n?void 0:$,onSlideMove:n?void 0:ye,onSlideEnd:n?void 0:be,onHomeKeyDown:()=>!n&&I(t,0,{commit:!0}),onEndKeyDown:()=>!n&&I(o,p.length-1,{commit:!0}),onStepKeyDown:({event:b,direction:C})=>{if(!n){const W=ae.includes(b.key)||b.shiftKey&&oe.includes(b.key)?10:1,A=f.current,N=p[A],_=l*W*C;I(N+_,A,{commit:!0})}}})})})})});le.displayName=E;var[de,ue]=ce(E,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Te=u.forwardRef((s,r)=>{const{min:a,max:t,dir:o,inverted:l,onSlideStart:i,onSlideMove:n,onSlideEnd:d,onStepKeyDown:x,...g}=s,[c,m]=u.useState(null),w=M(r,y=>m(y)),S=u.useRef(void 0),v=Pe(o),h=v==="ltr",f=h&&!l||!h&&l;function P(y){const p=S.current||c.getBoundingClientRect(),k=[0,p.width],$=X(k,f?[a,t]:[t,a]);return S.current=p,$(y-p.left)}return e.jsx(de,{scope:s.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:e.jsx(me,{dir:v,"data-orientation":"horizontal",...g,ref:w,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:y=>{const p=P(y.clientX);i==null||i(p)},onSlideMove:y=>{const p=P(y.clientX);n==null||n(p)},onSlideEnd:()=>{S.current=void 0,d==null||d()},onStepKeyDown:y=>{const k=ie[f?"from-left":"from-right"].includes(y.key);x==null||x({event:y,direction:k?-1:1})}})})}),Fe=u.forwardRef((s,r)=>{const{min:a,max:t,inverted:o,onSlideStart:l,onSlideMove:i,onSlideEnd:n,onStepKeyDown:d,...x}=s,g=u.useRef(null),c=M(r,g),m=u.useRef(void 0),w=!o;function S(v){const h=m.current||g.current.getBoundingClientRect(),f=[0,h.height],y=X(f,w?[t,a]:[a,t]);return m.current=h,y(v-h.top)}return e.jsx(de,{scope:s.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:e.jsx(me,{"data-orientation":"vertical",...x,ref:c,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const h=S(v.clientY);l==null||l(h)},onSlideMove:v=>{const h=S(v.clientY);i==null||i(h)},onSlideEnd:()=>{m.current=void 0,n==null||n()},onStepKeyDown:v=>{const f=ie[w?"from-bottom":"from-top"].includes(v.key);d==null||d({event:v,direction:f?-1:1})}})})}),me=u.forwardRef((s,r)=>{const{__scopeSlider:a,onSlideStart:t,onSlideMove:o,onSlideEnd:l,onHomeKeyDown:i,onEndKeyDown:n,onStepKeyDown:d,...x}=s,g=O(E,a);return e.jsx(B.span,{...x,ref:r,onKeyDown:D(s.onKeyDown,c=>{c.key==="Home"?(i(c),c.preventDefault()):c.key==="End"?(n(c),c.preventDefault()):ae.concat(oe).includes(c.key)&&(d(c),c.preventDefault())}),onPointerDown:D(s.onPointerDown,c=>{const m=c.target;m.setPointerCapture(c.pointerId),c.preventDefault(),g.thumbs.has(m)?m.focus():t(c)}),onPointerMove:D(s.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&o(c)}),onPointerUp:D(s.onPointerUp,c=>{const m=c.target;m.hasPointerCapture(c.pointerId)&&(m.releasePointerCapture(c.pointerId),l(c))})})}),fe="SliderTrack",he=u.forwardRef((s,r)=>{const{__scopeSlider:a,...t}=s,o=O(fe,a);return e.jsx(B.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...t,ref:r})});he.displayName=fe;var G="SliderRange",pe=u.forwardRef((s,r)=>{const{__scopeSlider:a,...t}=s,o=O(G,a),l=ue(G,a),i=u.useRef(null),n=M(r,i),d=o.values.length,x=o.values.map(m=>
6ve(m,o.min,o.max)),g=d>1?Math.min(...x):0,c=100-Math.max(...x);return e.jsx(B.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...t,ref:n,style:{...s.style,[l.startEdge]:g+"%",[l.endEdge]:c+"%"}})});pe.displayName=G;var Q="SliderThumb",xe=u.forwardRef((s,r)=>{const a=Ke(s.__scopeSlider),[t,o]=u.useState(null),l=M(r,n=>o(n)),i=u.useMemo(()=>t?a().findIndex(n=>n.ref.current===t):-1,[a,t]);return e.jsx(He,{...s,ref:l,index:i})}),He=u.forwardRef((s,r)=>{const{__scopeSlider:a,index:t,name:o,...l}=s,i=O(Q,a),n=ue(Q,a),[d,x]=u.useState(null),g=M(r,P=>x(P)),c=d?i.form||!!d.closest("form"):!0,m=ke(d),w=i.values[t],S=w===void 0?0:ve(w,i.min,i.max),v=Ue(t,i.values.length),h=m==null?void 0:m[n.size],f=h?We(h,S,n.direction):0;return u.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[n.startEdge]:`calc(${S}% + ${f}px)`},children:[e.jsx(Y.ItemSlot,{scope:s.__scopeSlider,children:e.jsx(B.span,{role:"slider","aria-label":s["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":w,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...l,ref:g,style:w===void 0?{display:"none"}:s.style,onFocus:D(s.onFocus,()=>{i.valueIndexToChangeRef.current=t})})}),c&&e.jsx(ge,{name:o??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:w},t)]})});xe.displayName=Q;var ze="RadioBubbleInput",ge=u.forwardRef(({__scopeSlider:s,value:r,...a},t)=>{const o=u.useRef(null),l=M(o,t),i=Re(r);return u.useEffect(()=>{const n=o.current;if(!n)return;const d=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==r&&g){const c=new Event("input",{bubbles:!0});g.call(n,r),n.dispatchEvent(c)}},[i,r]),e.jsx(B.input,{style:{display:"none"},...a,ref:l,defaultValue:r})});ge.displayName=ze;function Oe(s=[],r,a){const t=[...s];return t[a]=r,t.sort((o,l)=>o-l)}function ve(s,r,a){const l=100/(a-r)*(s-r);return re(l,[0,100])}function Ue(s,r){return r>2?`Value ${s+1} of ${r}`:r===2?["Minimum","Maximum"][s]:void 0}function $e(s,r){if(s.length===1)return 0;const a=s.map(o=>Math.abs(o-r)),t=Math.min(...a);return a.indexOf(t)}function We(s,r,a){const t=s/2,l=X([0,50],[0,t]);return(t-l(r)*a)*a}function qe(s){return s.slice(0,-1).map((r,a)=>s[a+1]-r)}function Ye(s,r){if(r>0){const a=qe(s);return Math.min(...a)>=r}return!0}function X(s,r){return a=>{if(s[0]===s[1]||r[0]===r[1])return r[0];const t=(r[1]-r[0])/(s[1]-s[0]);return r[0]+t*(a-s[0])}}function Ge(s){return(String(s).split(".")[1]||"").length}function Qe(s,r){const a=Math.pow(10,r);return Math.round(s*a)/a}var we=le,Xe=he,Je=pe,Ze=xe;const z=u.forwardRef(({className:s,...r},a)=>e.jsxs(we,{ref:a,className:Ne("relative flex w-full touch-none select-none items-center",s),...r,children:[e.jsx(Xe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(Je,{className:"absolute h-full bg-primary"})}),e.jsx(Ze,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));z.displayName=we.displayName;const ct=()=>{const s=De(),{data:r,isLoading:a}=Me({queryKey:["wizard-config"],queryFn:async()=>{const{data:n,error:d}=await q.from("ai_wizard_config").select("*").single();if(d)throw d;return n}}),[t,o]=u.useState({});u.useEffect(()=>{r&&o(r)},[r]);const l=se({mutationFn:async n=>{const{error:d}=await q.from("ai_wizard_config").update(n).eq("id",r==null?void 0:r.id);if(d)throw d},onSuccess:()=>{s.invalidateQueries({queryKey:["wizard-config"]}),te.success("Configuration Updated",{description:"AI assistant settings saved successfully."})}}),i=se({mutationFn:async()=>{const{data:n,error:d}=await q.functions.invoke("index-website");if(d)throw d;return n},onSuccess:n=>{te.success("Website Indexed",{description:`Successfully indexed ${n.indexed} pages.`})}});return a?e.jsx("div",{children:"Loading..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-2",children:[e.jsx(Ee,{className:"h-8 w-8"}),"AI Assistant Configuration"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Customize your AI research assistant's personality and capabilities"})]}),e.jsxs(ee,{onClick:()=>l.mutate(t),disabled:l.isPending,children:[e.jsx(Ae,{className:"h-4 w-4 mr-2"}),"Save Changes"]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(K,{children:[e.jsxs(V,{children:[e.jsx(L,{children:"Personality Settings"}),e.jsx(T,{children:"Define how the assistant behaves and responds"})]}),e.jsxs(F,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"personality",children:"Base Personality Prompt"}),e.jsx(H,{id:"personality",value:t.personality_prompt||"",onChange:n=>o({...t,personality_prompt:n.target.value}),rows:6,placeholder:"Describe the assistant's personality..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{children:["Honesty Level: ",t.honesty_level||80,"%"]}),e.jsx(z,{value:[t.honesty_level||80],onValueChange:n=>o({...t,honesty_level:n[0]}),max:100,step:5}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Higher = More factual and admits limitations. Lower = More creative and playful."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{children:["Humor Level: ",t.humor_level||70,"%"]}),e.jsx(z,{value:[t.humor_level||70],onValueChange:n=>o({...t,humor_level:n[0]}),max:100,step:5}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Controls tone warmth and approachability"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{children:["Difficulty Level: ",t.difficulty_level||50,"%"]}),e.jsx(z,{value:[t.difficulty_level||50],onValueChange:n=>o({...t,difficulty_level:n[0]}),max:100,step:5}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Higher = More technical. Lower = More accessible."})]})]})]}),e.jsxs(K,{children:[e.jsxs(V,{children:[e.jsx(L,{children:"Custom Messages"}),e.jsx(T,{children:"Personalize key interaction messages"})]}),e.jsxs(F,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"greeting",children:"Greeting Message"}),e.jsx(H,{id:"greeting",value:t.greeting_message||"",onChange:n=>o({...t,greeting_message:n.target.value}),rows:3,placeholder:"First message users see..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"stumped",children:"Fallback Message"}),e.jsx(H,{id:"stumped",value:t.stumped_message||"",onChange:n=>o({...t,stumped_message:n.target.value}),rows:3,placeholder:"Message when assistant can't find an answer..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"custom",children:"Additional Instructions"}),e.jsx(H,{id:"custom",value:t.custom_instructions||"",onChange:n=>o({...t,custom_instructions:n.target.value}),rows:4,placeholder:"Any extra rules or guidelines..."})]})]})]}),e.jsxs(K,{children:[e.jsxs(V,{children:[e.jsx(L,{children:"Capabilities"}),e.jsx(T,{children:"Enable or disable assistant features"})]}),e.jsxs(F,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{htmlFor:"internal-search",children:"Internal Knowledge Base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Search ZPL's research, team, and publications"})]}),e.jsx(ne,{id:"internal-search",checked:t.enable_internal_search??!0,onCheckedChange:n=>o({...t,enable_internal_search:n})})]}),e.jsx(Ie,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{htmlFor:"web-search",children:"Web Search"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Search the internet for latest information"})]}),e.jsx(ne,{id:"web-search",checked:t.enable_web_search??!0,onCheckedChange:n=>o({...t,enable_web_search:n})})]})]})]}),e.jsxs(K,{children:[e.jsxs(V,{children:[e.jsx(L,{children:"Knowledge Base"}),e.jsx(T,{children:"Manage indexed website content"})]}),e.jsxs(F,{className:"space-y-4",children:[e.jsxs(ee,{onClick:()=>i.mutate(),disabled:i.isPending,className:"w-full",children:[e.jsx(Be,{className:`h-4 w-4 mr-2 ${i.isPending?"animate-spin":""}`}),"Reindex Website Now"]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:e.jsx("p",{children:"Indexed content: Blog posts, publications, research projects, team profiles, white papers"})})]})]})]})]})};export{ct as default};

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.