1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44285],{4884:(e,t,r)=>{r.d(t,{bL:()=>j,zi:()=>N});var s=r(12115),a=r(85185),n=r(6101),i=r(46081),l=r(5845),o=r(45503),d=r(11275),c=r(63655),u=r(95155),p="Switch",[v,m]=(0,i.A)(p),[h,f]=v(p),x=s.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:o,defaultChecked:d,required:v,disabled:m,value:f="on",onCheckedChange:x,form:b,...g}=e,[j,N]=s.useState(null),k=(0,n.s)(t,e=>N(e)),_=s.useRef(!1),C=!j||b||!!j.closest("form"),[R,S]=(0,l.i)({prop:o,defaultProp:null!=d&&d,onChange:x,caller:p});return(0,u.jsxs)(h,{scope:r,checked:R,disabled:m,children:[(0,u.jsx)(c.sG.button,{type:"button",role:"switch","aria-checked":R,"aria-required":v,"data-state":y(R),"data-disabled":m?"":void 0,disabled:m,value:f,...g,ref:k,onClick:(0,a.mK)(e.onClick,e=>{S(e=>!e),C&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})}),C&&(0,u.jsx)(w,{control:j,bubbles:!_.current,name:i,value:f,checked:R,required:v,disabled:m,form:b,style:{transform:"translateX(-100%)"}})]})});x.displayName=p;var b="SwitchThumb",g=s.forwardRef((e,t)=>{let{__scopeSwitch:r,...s}=e,a=f(b,r);return(0,u.jsx)(c.sG.span,{"data-state":y(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})});g.displayName=b;var w=s.forwardRef((e,t)=>{let{__scopeSwitch:r,control:a,checked:i,bubbles:l=!0,...c}=e,p=s.useRef(null),v=(0,n.s)(p,t),m=(0,o.Z)(i),h=(0,d.X)(a);return s.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(m!==i&&t){let r=new Event("click",{bubbles:l});t.call(e,i),e.dispatchEvent(r)}},[m,i,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:v,style:{...c.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}w.displayName="SwitchBubbleInput";var j=x,N=g},11275:(e,t,r)=>{r.d(t,{X:()=>n});var s=r(12115),a=r(52712);function n(e){let[t,r]=s.useState(void 0);return(0,a.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let s,a;if(!Array.isArray(t)||!t.length)return;let n=t[0];if("borderBoxSize"in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;s=t.inlineSize,a=t.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}},40968:(e,t,r)=>{r.d(t,{Root:()=>l});var s=r(12115),a=r(63655),n=r(95155),i=s.forwardRef((e,t)=>(0,n.jsx)(a.sG.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null===(r=e.onMouseDown)||void 0===r||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label";var l=i},44285:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(95155),a=r(12115),n=r(82714),i=r(89852),l=r(90088),o=r(97168);function d(e){return{title:"string"==typeof(null==e?void 0:e.title)&&e.title?e.title:"What customers say",product_name:"string"==typeof(null==e?void 0:e.product_name)?e.product_name:"",show_schema:(null==e?void 0:e.show_schema)!==!1,reviews:(Array.isArray(null==e?void 0:e.reviews)?e.reviews:[]).map(e=>({author:"string"==typeof(null==e?void 0:e.author)?e.author:"",rating:Math.min(5,Math.max(1,Number(null==e?void 0:e.rating)||5)),text:"string"==typeof(null==e?void 0:e.text)?e.text:"",date:"string"==typeof(null==e?void 0:e.date)?e.date:""}))}}function c(e){let{block:t,onSave:r,onClose:c}=e,[u,p]=a.useState(()=>d(t.content));function v(e){return{...t.content,title:e.title,product_name:e.product_name.trim(),show_schema:e.show_schema,reviews:e.reviews.filter(e=>e.author.trim()&&e.text.trim())}}function m(e){let r={...u,...e};p(r),window.dispatchEvent(new CustomEvent("qs:template:apply-patch",{detail:{op:"update_block",blockId:t._id,content:v(r)}}))}function h(e,t){m({reviews:u.reviews.map((r,s)=>s===e?{...r,...t}:r)})}return(a.useEffect(()=>{p(d(t.content))},[t._id]),"reviews"!==t.type)?null:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)(n.J,{children:"Section title"}),(0,s.jsx)(i.p,{value:u.title,onChange:e=>m({title:e.target.value})})]}),(0,s.jsxs)("div",{className:"grid gap-2 rounded-lg border border-border p-3",children:[(0,s.jsx)(n.J,{children:"Google star snippet (schema.org)"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Star snippets only w
1ork for reviews ABOUT A PRODUCT on its page â name the product to turn the markup on. Business-level reviews still display beautifully, but Google ignores their markup on your own site, so we don't emit it."}),(0,s.jsx)(i.p,{value:u.product_name,onChange:e=>m({product_name:e.target.value}),placeholder:"Product these reviews are about (optional)"}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm",children:"Emit schema when a product is named"}),(0,s.jsx)(l.d,{checked:u.show_schema,onCheckedChange:e=>m({show_schema:!!e})})]})]}),(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(n.J,{children:"Reviews â paste REAL customer reviews, word-for-word"}),(0,s.jsx)("button",{type:"button",onClick:()=>m({reviews:[...u.reviews,{author:"",rating:5,text:"",date:""}]}),className:"rounded-md border border-border px-2 py-1 text-xs hover:bg-accent",children:"+ Add review"})]}),u.reviews.map((e,t)=>(0,s.jsxs)("div",{className:"grid gap-2 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_5.5rem_8.5rem_auto] items-end gap-2",children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[(0,s.jsx)(n.J,{className:"text-xs",children:"Customer name"}),(0,s.jsx)(i.p,{value:e.author,onChange:e=>h(t,{author:e.target.value}),placeholder:"Jane D."})]}),(0,s.jsxs)("div",{className:"grid gap-1",children:[(0,s.jsx)(n.J,{className:"text-xs",children:"Stars"}),(0,s.jsx)("select",{value:e.rating,onChange:e=>h(t,{rating:Number(e.target.value)}),className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:[5,4,3,2,1].map(e=>(0,s.jsx)("option",{value:e,children:"â
".repeat(e)},e))})]}),(0,s.jsxs)("div",{className:"grid gap-1",children:[(0,s.jsx)(n.J,{className:"text-xs",children:"Date (optional)"}),(0,s.jsx)(i.p,{type:"date",value:e.date,onChange:e=>h(t,{date:e.target.value})})]}),(0,s.jsx)("button",{type:"button","aria-label":"Remove review",onClick:()=>m({reviews:u.reviews.filter((e,r)=>r!==t)}),className:"h-9 rounded-md border border-border px-2 text-sm text-muted-foreground hover:text-red-500",children:"â"})]}),(0,s.jsx)("textarea",{value:e.text,onChange:e=>h(t,{text:e.target.value}),rows:2,placeholder:"The review, exactly as the customer wrote itâ¦",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]},t))]}),(0,s.jsxs)("div",{className:"mt-2 flex justify-end gap-2",children:[(0,s.jsx)(o.$,{onClick:()=>null==r?void 0:r({...t,content:v(u)}),children:"Save"}),(0,s.jsx)(o.$,{variant:"secondary",onClick:c,children:"Cancel"})]})]})}},45503:(e,t,r)=>{r.d(t,{Z:()=>a});var s=r(12115);function a(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},74466:(e,t,r)=>{r.d(t,{F:()=>i});var s=r(52596);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=s.$,i=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:l}=t,o=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],s=null==l?void 0:l[e];if(null===t)return null;let n=a(t)||a(s);return i[e][n]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return n(e,o,null==t?void 0:null===(s=t.compoundVariants)||void 0===s?void 0:s.reduce((e,t)=>{let{class:r,className:s,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...l,...d}[t]):({...l,...d})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},82714:(e,t,r)=>{r.d(t,{J:()=>d});var s=r(95155),a=r(12115),n=r(40968),i=r(74466),l=r(70743);let o=(0,i.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Root,{ref:t,className:(0,l.cn)(o(),r),...a})});d.displayName=n.Root.displayName},89852:(e,t,r)=>{r.d(t,{p:()=>i});var s=r(95155),a=r(12115),n=r(70743);let i=a.forwardRef((e,t)=>
1{let{className:r,type:i,id:l,label:o,helperText:d,description:c,error:u,required:p,requiredIndicator:v,containerClassName:m,labelClassName:h,...f}=e,x=a.useId(),b=null!=l?l:x,g=null!=d?d:c;return(0,s.jsxs)("div",{className:(0,n.cn)("grid gap-1",m),children:[null!=o&&(0,s.jsxs)("label",{htmlFor:b,className:(0,n.cn)("text-sm font-medium leading-none","peer-disabled:cursor-not-allowed peer-disabled:opacity-70",h),children:[o,(p||v)&&(0,s.jsx)("span",{className:"ml-0.5 text-red-600","aria-hidden":!0,children:"*"})]}),(0,s.jsx)("input",{id:b,type:i,ref:t,"aria-invalid":!!u||void 0,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",u&&"border-red-500 focus-visible:ring-red-500",r),...f}),(u||g)&&(0,s.jsx)("p",{className:(0,n.cn)("text-xs mt-1",u?"text-red-600":"text-muted-foreground"),children:null!=u?u:g})]})});i.displayName="Input"},90088:(e,t,r)=>{r.d(t,{d:()=>l});var s=r(95155),a=r(12115),n=r(4884),i=r(70743);let l=a.forwardRef((e,t)=>{let{className:r,label:l,helperText:o,error:d,labelPosition:c="right",containerClassName:u,labelClassName:p,id:v,...m}=e,h=a.useId(),f=null!=v?v:"switch-".concat(h),x=l?"".concat(f,"-label"):void 0,b=o||d?"".concat(f,"-desc"):void 0,g=(0,s.jsx)(n.bL,{id:f,ref:t,"aria-labelledby":x,"aria-describedby":b,"aria-invalid":!!d||void 0,className:(0,i.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",d&&"ring-2 ring-red-500 ring-offset-background",r),...m,children:(0,s.jsx)(n.zi,{className:(0,i.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}),w=null!=l?(0,s.jsx)("span",{id:x,className:(0,i.cn)("text-sm font-medium leading-none cursor-pointer select-none","peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p),onClick:()=>{var e,t;let r=document.getElementById(f);null==r||null===(e=r.click)||void 0===e||e.call(r),null==r||null===(t=r.focus)||void 0===t||t.call(r)},children:l}):null,y="top"===c,j="left"===c;return(0,s.jsxs)("div",{className:(0,i.cn)("grid gap-1",u),children:[(0,s.jsxs)("div",{className:(0,i.cn)(y?"flex flex-col gap-2":"flex items-center gap-2",j&&!y?"flex-row-reverse justify-end":void 0),children:[y?w:null,!y&&j?w:null,g,y||j?null:w]}),(d||o)&&(0,s.jsx)("p",{id:b,className:(0,i.cn)("text-xs",d?"text-red-600":"text-muted-foreground"),children:null!=d?d:o})]})});l.displayName=n.bL.displayName},97168:(e,t,r)=>{r.d(t,{$:()=>d,r:()=>o});var s=r(95155),a=r(12115),n=r(99708),i=r(74466),l=r(70743);let o=(0,i.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>
1{let{className:r,variant:a,size:i,asChild:d=!1,...c}=e,u=d?n.DX:"button";return(0,s.jsx)(u,{className:(0,l.cn)(o({variant:a,size:i,className:r})),ref:t,...c})});d.displayName="Button"}}]);
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.