PageSourceSearch

https://www.wequal.com/assets/AdminE2DRModeDefaults-eN1pKH1Z.js

js wequal.com collected 2026-10-06 11:10:19 UTC 3,222 bytes, 1 lines download raw bytes

1import{r,s as f,j as e,v as p,aj as g,cl as l,aO as w}from"./index-CGIDmj67.js";import{C as N,a as v,b as y,c as C}from"./card-Cvg9c-km.js";import{E as k,B as M,a as d}from"./E2FieldLabel-vHxY3phK.js";import{E as t}from"./e2FieldCopy-DGK_OKWc.js";import{S}from"./save-BMZ6Puc1.js";const F=()=>{const[c,i]=r.useState([]),[u,_]=r.useState(!0),[m,x]=r.useState(!1);r.useEffect(()=>{f.from("e2_dr_mode_defaults").select("*").order("mode").then(({data:s})=>{i(s||[]),_(!1)})},[]);const o=(s,a,h)=>{i(b=>b.map(n=>n.mode===s?{...n,[a]:h}:n))},j=async()=>{x(!0);for(const s of c)await f.from("e2_dr_mode_defaults").update({max_clips:s.max_clips,framework_on:s.framework_on,reflection_mandatory:s.reflection_mandatory,go_deeper_cta:s.go_deeper_cta,shadow_mode_enabled:s.shadow_mode_enabled,updated_at:new Date().toISOString()}).eq("id",s.id);x(!1),w.success("Mode defaults saved")};return u?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(p,{className:"w-6 h-6 animate-spin"})}):e.jsx(k,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(M,{tooltip:t.drModeDefaults.save,children:e.jsxs(g,{onClick:j,disabled:m,size:"sm",children:[m?e.jsx(p,{className:"w-4 h-4 animate-spin"}):e.jsx(S,{className:"w-4 h-4"})," Save"]})})}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:c.map(s=>e.jsxs(N,{children:[e.jsx(v,{children:e.jsxs(y,{className:"capitalize",children:[s.mode," Mode"]})}),e.jsxs(C,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{label:"Max clips",tooltip:t.drModeDefaults.max_clips,className:"text-sm text-muted-foreground"}),e.jsx("input",{type:"number",value:s.max_clips,onChange:a=>o(s.mode,"max_clips",parseInt(a.target.value)),className:"w-20 bg-card border border-border rounded px-2 py-1 text-sm"})]}),e.jsxs("div",{children:[e.jsx(d,{label:"Profile preference",tooltip:t.drModeDefaults.profile_pref,className:"text-sm text-muted-foreground"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:(s.profile_preference||[]).join(" → ")})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{label:"Framework lens on",tooltip:t.drModeDefaults.framework_on,className:"text-sm"}),e.jsx(l,{checked:s.framework_on,onCheckedChange:a=>o(s.mode,"framework_on",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{label:"Reflection mandatory",tooltip:t.drModeDefaults.reflection_mandatory,className:"text-sm"}),e.jsx(l,{checked:s.reflection_mandatory,onCheckedChange:a=>o(s.mode,"reflection_mandatory",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{label:"Go deeper CTA",tooltip:t.drModeDefaults.go_deeper_cta,className:"text-sm"}),e.jsx(l,{checked:s.go_deeper_cta,onCheckedChange:a=>o(s.mode,"go_deeper_cta",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{label:"Shadow mode enabled",tooltip:t.drModeDefaults.shadow_mode,className:"text-sm"}),e.jsx(l,{checked:s.shadow_mode_enabled,onCheckedChange:a=>o(s.mode,"shadow_mode_enabled",a)})]})]})]},s.mode))})]})})};export{F 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.