PageSourceSearch

https://cashengine.co.il/assets/VisualLandingEditor-CAebsncs.js

js cashengine.co.il collected 2026-09-24 15:02:14 UTC 245,568 bytes, 36 lines download raw bytes

1import{c as Me,r as F,c4 as fs,j as e,a as R,I as jl,bh as vl,bi as pl,L as i,B as E,bz as cr,b3 as Ke,m as Ye,X as bl,z as ve,bd as S,be as B,bg as w,co as Cs,bJ as Tr,bK as Ir,bL as Lr,b7 as fl,b8 as Cl,b9 as Kr,ba as Yr,cA as Ns,cB as Nl,bq as yl,aX as Er,bE as kl,t as Mr,a1 as Sl,q as W,bB as Bl,an as Re,bl as wl,bj as ur,O as ys,aq as ks,cd as Ss,ce as Bs,aY as ws,aZ as ir,aA as _l,cC as pr,cD as qr,cE as Qr,U as Fl,aD as _s,aF as Fs,aG as Ts,aH as Is,bo as Tl,aI as Il,ar as Ll,b as El,u as Ml,aC as Rl,br as Al,b5 as br,ax as Dl,w as Jr,o as Vl,b6 as Ol,cu as zl}from"./bootstrap-CRBTy1DZ.js";import{K as Se,e as Ul,g as Hl,f as Gl,s as Wl,u as $l,h as Xl,i as Ls,j as Es,k as Ms,l as Kl,C as Rs,m as Yl,n as ql,o as Zr,t as Ql,q as Jl,D as fr,P as Cr,T as Zl,v as Pr,H as Pl,w as et,x as es,G as rt,p as st,y as Ge,z as lt,A as Nr,r as tt,E as at,F as nt,I as it,J as ot,d as As,N as rs,L as ss,M as dt,O as ct,Q as ut}from"./BlockRenderer-syxYlvdX.js";import{D as xt,a as mt,b as ht}from"./dropdown-menu-PtTXpNDE.js";import{l as P,k as d,m as Be,n as Ee,o as Ds,q as gt,u as jt,r as vt,p as ls,W as pt,s as ts,t as bt}from"./useVisualLandingPageTemplates-lAQOfsPA.js";import{S as ft}from"./switch-IC9VNrPh.js";import{T as ne}from"./textarea-CR9CCz-h.js";import{P as Vs,a as Os,b as zs}from"./popover-DiK6rwG0.js";import{S as yr}from"./separator-Fzp8yWTd.js";import{u as Us,S as Ct}from"./SaveVisualLandingTemplateDialog-Z8odTpuV.js";import{U as Nt}from"./upload-CPW4jagZ.js";import{C as sr,D as as,r as yt,a as Hs,M as ns,b as is}from"./browser-olNeelPi.js";import{u as kt}from"./useHiddenProductCategories-DXeoWJWz.js";import{b as St,t as Bt}from"./CategoryTree-Ok-1hIvz.js";import{R as wt}from"./useAliExpressProducts-Dw_RYB7G.js";import{B as _t,I as Ft}from"./italic-CqBkkatj.js";import{L as Tt}from"./list-ordered-D8ULWIQz.js";import{T as Rr}from"./trash-2-RdgoBC5k.js";import{R as Gs}from"./radio-MwavTv5T.js";import{G as Ar}from"./grip-vertical-BidpKocH.js";import{V as os}from"./VisualLandingNavbar-BTsQ4yrf.js";import{U as It}from"./undo-2-bUK4TiHc.js";import{M as Lt}from"./monitor-a9RkwtFS.js";import"./index-Bg6ziU2z.js";import"./useInfiniteQuery-B-JlxvAv.js";import"./productMessageImages-1pEQ1PzQ.js";import"./images-Ddm9FRyR.js";import"./gift-BziJLyU5.js";import"./heart-QdjLTvx-.js";import"./truck-XRZOEiSw.js";import"./aliexpressProductCardTheme-Cx5NMAb0.js";import"./types-DmO-BtXl.js";import"./type-Da1zHhjR.js";import"./image-BPYxqUpy.js";import"./mouse-pointer-click-CTAtk-M4.js";import"./megaphone-Cwq7r_Tv.js";import"./rss-DWs_JjJC.js";import"./list-checks-CuR8vF9n.js";import"./clipboard-list-CYs_LMnD.js";import"./chevrons-up-down-CAw8Ahdd.js";import"./timer-WUFD4ObF.js";import"./hiddenCatalogFallback-DSKyEsH_.js";import"./hiddenCatalogMappers-CBqCC2w6.js";import"./supabaseStoragePublicUrl-C8BQYN8-.js";import"./folder-open-C7v4oXZe.js";import"./folder--Yr81NQZ.js";import"./aliexpressCommission-Cl1imqrU.js";import"./TikTokIcon-BPu2FcRj.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 Et=Me("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Mt=Me("Layers3",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m6.08 9.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1e5n1m"}],["path",{d:"m6.08 14.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1iwflc"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Rt=Me("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Ws=Me("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
22 * @license lucide-react v0.462.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const At=Me("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
27 * @license lucide-react v0.462.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const Dt=Me("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}
31],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
32 * @license lucide-react v0.462.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const Vt=Me("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);function or(r,s,n){const t=r.slice();return t.splice(n<0?t.length+n:n,0,t.splice(s,1)[0]),t}function Ot(r,s){return r.reduce((n,t,o)=>{const m=s.get(t);return m&&(n[o]=m),n},Array(r.length))}function lr(r){return r!==null&&r>=0}function zt(r,s){if(r===s)return!0;if(r.length!==s.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==s[n])return!1;return!0}function Ut(r){return typeof r=="boolean"?{draggable:r,droppable:r}:r}const $s=r=>{let{rects:s,activeIndex:n,overIndex:t,index:o}=r;const m=or(s,t,n),h=s[o],x=m[o];return!x||!h?null:{x:x.left-h.left,y:x.top-h.top,scaleX:x.width/h.width,scaleY:x.height/h.height}},tr={scaleX:1,scaleY:1},Ht=r=>{var s;let{activeIndex:n,activeNodeRect:t,index:o,rects:m,overIndex:h}=r;const x=(s=m[n])!=null?s:t;if(!x)return null;if(o===n){const g=m[h];return g?{x:0,y:n<h?g.top+g.height-(x.top+x.height):g.top-x.top,...tr}:null}const l=Gt(m,o,n);return o>n&&o<=h?{x:0,y:-x.height-l,...tr}:o<n&&o>=h?{x:0,y:x.height+l,...tr}:{x:0,y:0,...tr}};function Gt(r,s,n){const t=r[s],o=r[s-1],m=r[s+1];return t?n<s?o?t.top-(o.top+o.height):m?m.top-(t.top+t.height):0:m?m.top-(t.top+t.height):o?t.top-(o.top+o.height):0:0}const Xs="Sortable",Ks=fs.createContext({activeIndex:-1,containerId:Xs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$s,disabled:{draggable:!1,droppable:!1}});function Wt(r){let{children:s,id:n,items:t,strategy:o=$s,disabled:m=!1}=r;const{active:h,dragOverlay:x,droppableRects:l,over:g,measureDroppableContainers:u}=$l(),b=Xl(Xs,n),f=x.rect!==null,a=F.useMemo(()=>t.map(O=>typeof O=="object"&&"id"in O?O.id:O),[t]),N=h!=null,k=h?a.indexOf(h.id):-1,M=g?a.indexOf(g.id):-1,D=F.useRef(a),y=!zt(a,D.current),I=M!==-1&&k===-1||y,V=Ut(m);Ls(()=>{y&&N&&u(a)},[y,a,N,u]),F.useEffect(()=>{D.current=a},[a]);const C=F.useMemo(()=>({activeIndex:k,containerId:b,disabled:V,disableTransforms:I,items:a,overIndex:M,useDragOverlay:f,sortedRects:Ot(a,l),strategy:o}),[k,b,V.draggable,V.droppable,I,a,M,l,f,o]);return fs.createElement(Ks.Provider,{value:C},s)}const $t=r=>{let{id:s,items:n,activeIndex:t,overIndex:o}=r;return or(n,t,o).indexOf(s)},Xt=r=>{let{containerId:s,isSorting:n,wasDragging:t,index:o,items:m,newIndex:h,previousItems:x,previousContainerId:l,transition:g}=r;return!g||!t||x!==m&&o===h?!1:n?!0:h!==o&&s===l},Kt={duration:200,easing:"ease"},Ys="transform",Yt=Rs.Transition.toString({property:Ys,duration:0,easing:"linear"}),qt={roleDescription:"sortable"};function Qt(r){let{disabled:s,index:n,node:t,rect:o}=r;const[m,h]=F.useState(null),x=F.useRef(n);return Ls(()=>{if(!s&&n!==x.current&&t.current){const l=o.current;if(l){const g=ql(t.current,{ignoreTransform:!0}),u={x:l.left-g.left,y:l.top-g.top,scaleX:l.width/g.width,scaleY:l.height/g.height};(u.x||u.y)&&h(u)}}n!==x.current&&(x.current=n)},[s,n,t,o]),F.useEffect(()=>{m&&h(null)},[m]),m}function Jt(r){let{animateLayoutChanges:s=Xt,attributes:n,disabled:t,data:o,getNewIndex:m=$t,id:h,strategy:x,resizeObserverConfig:l,transition:g=Kt}=r;const{items:u,containerId:b,activeIndex:f,disabled:a,disableTransforms:N,sortedRects:k,overIndex:M,useDragOverlay:D,strategy:y}=F.useContext(Ks),I=Zt(t,a),V=u.indexOf(h),C=F.useMemo(()=>({sortable:{containerId:b,index:V,items:u},...o}),[b,o,V,u]),O=F.useMemo(()=>u.slice(u.indexOf(h)),[u,h]),{rect:U,node:$,isOver:H,setNodeRef:xe}=Es({id:h,data:C,disabled:I.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:re,activatorEvent:_e,activeNodeRect:v,attributes:Y,setNodeRef:Q,listeners:se,isDragging:Oe,over:qe,setActivatorNodeRef:ze,transform:Qe}=Ms({id:h,data:C,attributes:{...qt,...n},disabled:I.draggable}),mr=Kl(xe,Q),de=!!re,te=de&&!N&&lr(f)&&lr(M),Fe=!D&&Oe,Te=Fe&&te?Qe:null,me=te?Te??(x??y)({rects:k,activeNodeRect:v,activeIndex:f,overIndex:M,index:V}):null,fe=lr(f)&&lr(M)?m({id:h,items:u,activeIndex:f,overIndex:M}):V,le=re==null?void 0:re.id,Z=F.useRef({activeId:le,items:u,newIndex:fe,containerId:b}),hr=u!==Z.current.items,He=s({active:re,containerId:b,isDragging:Oe,isSorting:de,id:h,index:V,items:u,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:g,wasDragging:Z.current.activeId!=null}),Ce=Qt({disabled:!He,index:V,node:$,rect:U});return F.useEffect(()=>{de&&Z.current.newIndex!==fe&&(Z.current.newIndex=fe),b!==Z.current.containerId&&(Z.current.containerId=b),u!==Z.current.items&&(Z.current.items=u)},[de,fe,b,u]),F.useEffect(()=>{if(le===Z.current.activeId)return;if(le!=null&&Z.current.activeId==null){Z.current.activeId=le;return}const gr=setTimeout(()=>{Z.current.activeId=le},50);return()=>clearTimeout(gr)},[le]),{active:re,activeIndex:f,attributes:Y,data:C,rect:U,index:V,newIndex:fe,items:u,isOver:H,isSorting:de,isDragging:Oe,listeners:se,node:$,overIndex:M,over:qe,setNodeRef:mr,setActivatorNodeRef:ze,setDroppableNodeRef:xe,setDraggableNodeRef:Q,transform:Ce??me,transition:Ae()};function Ae(){if(Ce||hr&&Z.current.newIndex===V)return Yt;if(!(Fe&&!Yl(_e)||!g)&&(de||He))return Rs.Transition.toString({...g,property:Ys})}}function Zt(r,s){var n,t;return typeof r=="boolean"?{draggable:r,droppable:!1}:{draggable:(n=r==null?void 0:r.draggable)!=null?n:s.draggable,droppable:(t=r==null?void 0:r.droppable)!=null?t:s.droppable}}function dr(r){if(!r)return!1;const s=r.data.current;return!!(s&&"sortable"in s&&typeof s.sortable=="object"&&"containerId"in s.sortable&&"items"in s.sortable&&"index"in s.sortable)}const Pt=[Se.Down,Se.Right,Se.Up,Se.Left],ea=(r,s)=>{let{context:{active:n,collisionRect:t,droppableRects:o,droppableContainers:m,over:h,scrollableAncestors:x}}=s;if(Pt.includes(r.code)){if(r.preventDefault(),!n||!t)return;const l=[];
36m.getEnabled().forEach(b=>{if(!b||b!=null&&b.disabled)return;const f=o.get(b.id);if(f)switch(r.code){case Se.Down:t.top<f.top&&l.push(b);break;case Se.Up:t.top>f.top&&l.push(b);break;case Se.Left:t.left>f.left&&l.push(b);break;case Se.Right:t.left<f.left&&l.push(b);break}});const g=Ul({collisionRect:t,droppableRects:o,droppableContainers:l});let u=Hl(g,"id");if(u===(h==null?void 0:h.id)&&g.length>1&&(u=g[1].id),u!=null){const b=m.get(n.id),f=m.get(u),a=f?o.get(f.id):null,N=f==null?void 0:f.node.current;if(N&&a&&b&&f){const M=Gl(N).some((O,U)=>x[U]!==O),D=qs(b,f),y=ra(b,f),I=M||!D?{x:0,y:0}:{x:y?t.width-a.width:0,y:y?t.height-a.height:0},V={x:a.left,y:a.top};return I.x&&I.y?V:Wl(V,I)}}}};function qs(r,s){return!dr(r)||!dr(s)?!1:r.data.current.sortable.containerId===s.data.current.sortable.containerId}function ra(r,s){return!dr(r)||!dr(s)||!qs(r,s)?!1:r.data.current.sortable.index<s.data.current.sortable.index}function A({children:r}){return e.jsx("p",{className:R("lb-section-title mt-1 block w-full pb-0.5 text-right text-[11px] font-medium text-muted-foreground first:mt-0"),dir:"rtl",children:r})}function j({className:r,dir:s,...n}){return e.jsx(jl,{...n,dir:s??"rtl",className:R("border-input bg-background text-foreground placeholder:text-muted-foreground","text-start placeholder:text-start","hover:border-input hover:bg-muted/55","backdrop-blur-none",r)})}function _({className:r,...s}){return e.jsx(vl,{className:R("landing-editor-light-surface border-border bg-popover text-popover-foreground","dark:border-border dark:bg-popover dark:text-popover-foreground",r),...s})}function c({className:r,...s}){return e.jsx(pl,{className:R("focus:bg-muted focus:text-foreground dark:focus:bg-muted dark:focus:text-foreground","data-[highlighted]:bg-muted data-[highlighted]:text-foreground dark:data-[highlighted]:bg-muted dark:data-[highlighted]:text-foreground",r),...s})}const Qs=[{value:"hsl(var(--foreground))",label:"טקסט ראשי"},{value:"hsl(var(--muted-foreground))",label:"טקסט משני"},{value:"hsl(var(--primary))",label:"Primary"},{value:"hsl(var(--primary-foreground))",label:"על Primary"},{value:"hsl(var(--background))",label:"רקע"},{value:"hsl(var(--card))",label:"כרטיס"},{value:"hsl(var(--muted))",label:"Muted"},{value:"hsl(var(--border))",label:"גבול"},{value:"hsl(var(--destructive))",label:"הדגשה"}],sa=["#0a0a0a","#ffffff","#f4f4f5","#e4e4e7","#a1a1aa","#71717a","#52525b","#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#6366f1","#8b5cf6","#ec4899"];function la(r){var s;return(s=Qs.find(n=>n.value===r))==null?void 0:s.label}function ta(r,s){const n=r.trim();if(/^#[0-9A-Fa-f]{6}$/i.test(n))return`#${n.slice(1).toLowerCase()}`;if(/^#[0-9A-Fa-f]{3}$/i.test(n)){const o=n[1],m=n[2],h=n[3];return`#${o}${o}${m}${m}${h}${h}`.toLowerCase()}const t=s.trim();return/^#[0-9A-Fa-f]{6}$/i.test(t)?`#${t.slice(1).toLowerCase()}`:"#000000"}function ds({value:r,className:s}){const n=r==="transparent";return e.jsx("span",{className:R("relative inline-block h-8 w-8 shrink-0 overflow-hidden rounded-md border border-border shadow-inner",s),children:n?e.jsx("span",{className:"absolute inset-0 bg-[repeating-conic-gradient(#e4e4e7_0%_25%,#ffffff_0%_50%)] bg-[length:8px_8px]","aria-hidden":!0}):e.jsx("span",{className:"absolute inset-0",style:{backgroundColor:r},"aria-hidden":!0})})}function p({label:r,value:s,onChange:n,emptyFallback:t="#000000",onClear:o,allowTransparent:m=!1,className:h}){const[x,l]=F.useState(!1),g=s.trim(),u=g||t,b=F.useMemo(()=>ta(g,t),[g,t]),f=F.useMemo(()=>{if(!g&&o)return"ברירת מחדל";if(g==="transparent")return"שקוף";const N=la(g);return N||(/^#[0-9A-Fa-f]{3,8}$/i.test(g)?g.toUpperCase():g.length>36?`${g.slice(0,33)}…`:g)},[g,o]),a=F.useMemo(()=>{const N=[...Qs];return m?[{value:"transparent",label:"שקוף"},...N]:N},[m]);return e.jsxs("div",{className:R("flex flex-col gap-2.5",h),dir:"rtl",children:[e.jsx(i,{className:"block w-full text-right",children:r}),e.jsxs(Vs,{open:x,onOpenChange:l,children:[e.jsx(Os,{asChild:!0,children:e.jsxs(E,{type:"button",variant:"outline",className:R("h-auto min-h-10 w-full justify-between gap-2 px-3 py-2 text-right font-normal",P),dir:"rtl",children:[e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(ds,{value:u}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:f})]}),e.jsx(cr,{className:"h-4 w-4 shrink-0 opacity-60","aria-hidden":!0})]})}),e.jsx(zs,{className:"landing-editor-light-surface w-[min(100vw-2rem,20rem)] max-h-[min(70vh,28rem)] overflow-y-auto bg-popover p-3 text-popover-foreground [&_p]:text-right",align:"start",children:e.jsxs("div",{className:"space-y-3 text-right",dir:"rtl",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"מערכת (תואם ערכת נושא)"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:a.map(N=>e.jsxs("button",{type:"button",title:N.label,onClick:()=>{n(N.value),l(!1)},className:R("flex flex-col items-center gap-1 rounded-lg border border-transparent p-1.5 text-center transition-colors hover:bg-muted/60",g===N.value&&"border-primary ring-1 ring-primary/30"),children:[e.jsx(ds,{value:N.value==="transparent"?"transparent":N.value,className:"h-7 w-7"}),e.jsx("span",{className:"line-clamp-2 w-full text-[10px] leading-tight text-muted-foreground",children:N.label})]},N.value))}),e.jsx(yr,{}),e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"צבעים מהירים"}),e.jsx("div",{className:"grid grid-cols-8 gap-1.5",children:sa.map(N=>e.jsx("button",{type:"button",title:N,onClick:()=>{n(N),l(!1)},className:R("h-7 w-full rounded border border-border shadow-sm transition-transform hover:scale-105",g.toLowerCase()===N.toLowerCase()&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),style:{backgroundColor:N},"aria-label":N},N))}),e.jsx(yr,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"בוחר מותאם (Hex)"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"ltr",children:[e.jsx("input",{type:"color",value:b,onChange:N=>n(N.target.value),className:"h-10 w-14 cursor-pointer rounded border border-border bg-background p-0.5","aria-label":"בחירת צבע"}),e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:b})]})]}),o&&e.jsxs(e.Fragment,{children:[e.jsx(yr,{}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"w-full text-muted-foreground",onClick:()=>{o(),l(!1)},children:"חזרה לברירת מחדל של הדף"})]})]})})]})]})}function we({label:r,value:s,onChange:n,hint:t,className:o}){const m=F.useRef(null),[h,x]=F.useState(!1),{effectiveUserId:l,isLoading:g,isReadOnly:u}=Ke(),b=!!l&&!g&&!u,f=!!s.trim(),a=async N=>{var M;const k=(M=N.target.files)==null?void 0:M[0];if(N.target.value="",!(!k||!l)){x(!0);try{const D=await Us(k,l);n(D),ve.success("התמונה הועלתה בהצלחה")}catch(D){const y=D instanceof Error?D.message:"שגיאה בהעלאה";ve.error(y)}finally{x(!1)}}};return e.jsxs("div",{className:R("flex flex-col gap-2.5",o),dir:"rtl",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:r}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{ref:m,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"sr-only","aria-hidden":!0,tabIndex:-1,onChange:a}),e.jsxs(E,{type:"button",variant:"secondary",size:"sm",className:R("gap-1.5 shrink-0",P),disabled:!b||h,onClick:()=>{var N;return(N=m.current)==null?void 0:N.click()},"aria-label":"העלאת תמונה מהמחשב",children:[h?e.jsx(Ye,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):e.jsx(Nt,{className:"h-4 w-4","aria-hidden":!0}),"בחר קובץ מהמחשב"]}),f&&!u?e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground",onClick:()=>n(""),"aria-label":"הסרת התמונה",children:[e.jsx(bl,{className:"h-4 w-4","aria-hidden":!0}),"הסר"]}):null]})]}),s.trim().startsWith("http")?e.jsx("div",{className:"overflow-hidden rounded-md border border-border bg-muted/20 p-2",children:e.jsx("img",{src:s,alt:"",className:"mx-auto max-h-36 w-full max-w-md object-contain",loading:"lazy"})}):null,t?e.jsx("p",{className:"text-xs text-muted-foreground",children:t}):null]})}const $e="__parent__";function aa(r,s){const n=String(s??"").trim();if(!n)return{parentId:"",childKey:""};const t=r.find(m=>String(m.category_id)===n);if(!t)return{parentId:"",childKey:""};const o=t.parent_category_id?String(t.parent_category_id):"";return!o||o==="0"?{parentId:String(t.category_id),childKey:$e}:{parentId:o,childKey:String(t.category_id)}}function De(r){return Bt(String(r.category_name??""))||String(r.category_name??r.category_id)}function Js({categories:r,loading:s,categoryId:n,onCategoryChange:t,disabled:o}){const m=r,h=F.useMemo(()=>St(m),[m]),x=F.useMemo(()=>aa(m,String(n??"")),[m,n]),[l,g]=F.useState(x.parentId),[u,b]=F.useState(x.childKey);F.useEffect(()=>{g(x.parentId),b(x.childKey)},[x.parentId,x.childKey]);const f=F.useMemo(()=>
36{if(!l)return[];const k=h.find(M=>String(M.category_id)===l);return((k==null?void 0:k.children)??[]).slice().sort((M,D)=>De(M).localeCompare(De(D),"he"))},[h,l]),a=k=>{if(g(k),!k){b(""),t("");return}b($e),t(k)},N=k=>{if(b(k),!!l){if(k===$e){t(l);return}t(k)}};return e.jsxs("div",{className:R("space-y-3",o&&"pointer-events-none opacity-60"),children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קטגוריה ראשית"}),s?e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/20 px-3 py-2 text-xs text-muted-foreground",children:[e.jsx(Ye,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}),"טוען קטגוריות מ-AliExpress…"]}):e.jsxs(S,{value:l||"__none__",onValueChange:k=>a(k==="__none__"?"":k),disabled:o,children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"בחרו קטגוריה"})}),e.jsxs(_,{children:[e.jsx(c,{value:"__none__",children:"ללא קטגוריה (מוצרים גלובליים בתוך הרשימה)"}),h.slice().sort((k,M)=>De(k).localeCompare(De(M),"he")).map(k=>e.jsx(c,{value:String(k.category_id),children:De(k)},k.category_id))]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תת-קטגוריה"}),e.jsxs(S,{value:u||$e,onValueChange:k=>N(k),disabled:o||s||!l,children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"בחרו תת-קטגוריה"})}),e.jsxs(_,{children:[e.jsx(c,{value:$e,children:"כל הקטגוריה הראשית (רחב)"}),f.map(k=>e.jsx(c,{value:String(k.category_id),children:De(k)},k.category_id))]})]}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:"AliExpress מסננים לפי מזהה קטגוריה מספרי. אם לא בוחרים קטגוריה — המוצרים יהיו לפי היקף הגלובלי שהגדרתם למעלה."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:()=>a(""),disabled:o||s,children:"נקה בחירת קטגוריה"})})]})}function na({children:r}){return e.jsx("p",{className:"mb-0 w-full text-right text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:r})}function Zs({props:r,onPatch:s,className:n,embedded:t}){const o=String(r.blockChromeBackground??""),m=String(r.blockChromeGradient??""),h=r.blockChromeBorderWidth,x=String(r.blockChromeBorderColor??""),l=r.blockChromeBorderRadius,g=r.blockChromePadding,u=r.blockChromeMarginY,b=e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"רקע מעטפת",value:o,emptyFallback:"transparent",onChange:f=>s({blockChromeBackground:f||void 0}),onClear:()=>s({blockChromeBackground:void 0})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גרדיאנט מעטפת (CSS)"}),e.jsx(ne,{dir:"ltr",className:"min-h-[64px] font-mono text-left text-sm",value:m,onChange:f=>s({blockChromeGradient:f.target.value.trim()||void 0}),placeholder:"linear-gradient(180deg, #f8fafc, #ffffff)",rows:2}),e.jsx("p",{className:"text-right text-xs text-muted-foreground",children:"אם ממלאים — מחליף את רקע המעטפת השטוח."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת (px)"}),e.jsx(j,{type:"number",min:0,max:24,dir:"ltr",className:"text-left",value:typeof h=="number"?String(h):"",onChange:f=>{const a=f.target.value===""?void 0:Number(f.target.value);s({blockChromeBorderWidth:a!==void 0&&Number.isFinite(a)?Math.min(24,Math.max(0,a)):void 0})},placeholder:"0"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רדיוס פינות (px)"}),e.jsx(j,{type:"number",min:0,max:96,dir:"ltr",className:"text-left",value:typeof l=="number"?String(l):"",onChange:f=>{const a=f.target.value===""?void 0:Number(f.target.value);s({blockChromeBorderRadius:a!==void 0&&Number.isFinite(a)?Math.min(96,Math.max(0,a)):void 0})},placeholder:"0"})]})]}),e.jsx(p,{label:"צבע מסגרת",value:x,emptyFallback:"hsl(var(--border))",onChange:f=>s({blockChromeBorderColor:f||void 0}),onClear:()=>s({blockChromeBorderColor:void 0})}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריפוד פנימי (p
36x)"}),e.jsx(j,{type:"number",min:0,max:96,dir:"ltr",className:"text-left",value:typeof g=="number"?String(g):"",onChange:f=>{const a=f.target.value===""?void 0:Number(f.target.value);s({blockChromePadding:a!==void 0&&Number.isFinite(a)?Math.min(96,Math.max(0,a)):void 0})},placeholder:"0"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אנכי מעל/מתחת (px)"}),e.jsx(j,{type:"number",min:0,max:120,dir:"ltr",className:"text-left",value:typeof u=="number"?String(u):"",onChange:f=>{const a=f.target.value===""?void 0:Number(f.target.value);s({blockChromeMarginY:a!==void 0&&Number.isFinite(a)?Math.min(120,Math.max(0,a)):void 0})},placeholder:"0"})]})]})]});return t?e.jsx("div",{className:R("flex flex-col gap-3 [&_label]:block [&_label]:text-right",n),dir:"rtl",children:b}):e.jsxs("div",{className:R("flex flex-col gap-3 border-t border-border/60 pt-4 [&_label]:block [&_label]:text-right",n),dir:"rtl",children:[e.jsx(na,{children:"מסגרת ורקע (מעטפת)"}),e.jsx("p",{className:"text-right text-xs text-muted-foreground leading-snug",children:"עוטף את הווידג'ט מבחוץ. רקע/גרדיאנט של המקטע או ה-Hero נשארים בתוך הווידג'ט — אפשר לשלב שכבות."}),b]})}function be({title:r,hint:s,defaultOpen:n,children:t}){return e.jsxs(Tr,{className:"rounded-lg border border-border/60 bg-muted/5",defaultOpen:n,children:[e.jsx(Ir,{asChild:!0,children:e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"flex h-auto min-h-10 w-full items-center justify-between gap-2 px-3 py-2 text-right text-xs font-medium",children:[e.jsx("span",{className:"min-w-0 flex-1 leading-snug",children:r}),e.jsx(cr,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}),e.jsxs(Lr,{className:R("space-y-3 border-t border-border/50 px-3 pb-3 pt-2"),children:[s?e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:s}):null,t]})]})}function ke({label:r,valueKey:s,min:n,max:t,placeholder:o,p:m,onPatch:h}){const x=m[s],l=typeof x=="number"&&Number.isFinite(x)?String(x):"";return e.jsxs("div",{className:d,children:[e.jsx(i,{children:r}),e.jsx(j,{type:"number",min:n,max:t,dir:"ltr",className:"text-left",value:l,placeholder:o,onChange:g=>{const u=g.target.value;if(u===""){h({[s]:void 0});return}const b=Number(u);Number.isFinite(b)&&h({[s]:Math.min(t,Math.max(n,Math.round(b)))})}})]})}function ia({p:r,onPatch:s,pickerMode:n,clearCardStyle:t,presetGlass:o,presetContrast:m,presetSoft:h}){const x=()=>s({...t,...sr});return e.jsx("section",{className:"mt-5 space-y-4 border-t border-border/70 pt-5",dir:"rtl","aria-labelledby":"ae-comparison-design-heading",children:e.jsxs("div",{className:R("overflow-hidden rounded-xl border border-border/60 bg-muted/10 shadow-sm","ring-1 ring-border/40"),children:[e.jsx("div",{className:"border-b border-border/50 bg-muted/30 px-4 py-3 sm:px-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-background/80 text-muted-foreground",children:e.jsx(Cs,{className:"h-4 w-4","aria-hidden":!0})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5 text-right",children:[e.jsx("h3",{id:"ae-comparison-design-heading",className:"text-sm font-semibold leading-tight text-foreground",children:"עיצוב — השוואת מוצרים"}),e.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"כל מה שמתחת לכותרת זו משפיע על מראה הווידג׳ט בלבד. שדה ריק = ערכת נושא או ברירת מחדל של הווידג׳ט. סדר: מעטפת חיצונית, ואז אזורים פנימיים (טבלה, בוחר וכו׳). רענון cache נמצא במקטע שמעל."})]})]})}),e.jsxs("div",{className:"space-y-4 px-4 py-4 sm:px-5 sm:py-5",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:x,children:"איפוס עיצוב (כרטיס + השוואה)"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>s({...t,...sr,...o}),children:"פריסט זכוכית"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>s({...t,...sr,...m}),children:"פריסט ניגודיות"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>s({...t,...sr,...h}),children:"פריסט רך"})]}),e.jsxs("div",{className:"space-y-2 border-t border-border/40 pt-4",children:[e.jsx(be,{title:"מסגרת הבלוק",hint:"מסגרת ורקע (מעטפת): עוטף את הווידג׳ט מבחוץ. רקע/גרדיאנט של המקטע או ה-Hero נשארים בתוך הווידג׳ט — אפשר לשלב שכבות.",defaultOpen:!0,children:e.jsx(Zs,{props:r,onPatch:s,embedded:!0})}),e.jsxs(be,{title:"צל ומסגרת כרטיס הטבלה",hint:"משפיע על מסגרת הטבלה ועל עומק הצל סביבה (לא על אזור החיפוש במצב בוחר).",defaultOpen:!0,children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל כרטיס / טבלה"}),e.jsxs(S,{value:r.productCardShadow?String(r.productCardShadow):"__default",onValueChange:l=>s({productCardShadow:l==="__default"?void 0:l}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"ברירת מחדל (sm)"})}),e.jsxs(_,{children:[e.jsx(c,{value:"__default",children:"ברירת מחדל (sm)"}),e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קל (sm)"}),e.jsx(c,{value:"md",children:"בינוני (md)"}),e.jsx(c,{value:"lg",children:"בולט (lg)"})]})]})]}),e.jsx(ke,{label:"רדיוס פינות כרטיס / טבלה (px)",valueKey:"productCardBorderRadius",min:0,max:32,placeholder:"12",p:r,onPatch:s}),e.jsx(p,{label:"רקע כרטיס הטבלה",value:String(r.productCardBackgroun
36d??""),emptyFallback:"hsl(var(--card))",onChange:l=>s({productCardBackground:l||void 0}),onClear:()=>s({productCardBackground:void 0})}),e.jsx(p,{label:"מסגרת כרטיס הטבלה (ברירת מחדל לטבלה)",value:String(r.productCardBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:l=>s({productCardBorderColor:l||void 0}),onClear:()=>s({productCardBorderColor:void 0})})]}),e.jsxs(be,{title:"כותרת הווידג׳ט ושורת פוטר",hint:"כותרת הבלוק למעלה; מתחת לתוכן מופיע טקסט עדכון / הערות עורך.",children:[e.jsx(p,{label:"צבע כותרת הווידג׳ט",value:String(r.widgetTitleColor??""),emptyFallback:"hsl(var(--foreground))",onChange:l=>s({widgetTitleColor:l||void 0}),onClear:()=>s({widgetTitleColor:void 0})}),e.jsx(p,{label:"צבע טקסט פוטר (עדכון אחרון / הערות)",value:String(r.widgetFooterTextColor??""),emptyFallback:"מושתק לפי צבע משני של מוצר",onChange:l=>s({widgetFooterTextColor:l||void 0}),onClear:()=>s({widgetFooterTextColor:void 0})})]}),n?e.jsxs(be,{title:"מצב בוחר — מעטפת אזור החיפוש",hint:"הקופסה שמסביב לשדה החיפוש, לרשימת התוצאות ולכפתורי הפעולה.",children:[e.jsx(p,{label:"רקע המעטפת",value:String(r.pickerPanelBackground??""),emptyFallback:"רקע מושתק",onChange:l=>s({pickerPanelBackground:l||void 0}),onClear:()=>s({pickerPanelBackground:void 0})}),e.jsx(p,{label:"מסגרת המעטפת",value:String(r.pickerPanelBorderColor??""),emptyFallback:"מסגרת מושתקת",onChange:l=>s({pickerPanelBorderColor:l||void 0}),onClear:()=>s({pickerPanelBorderColor:void 0})}),e.jsx(ke,{label:"רדיוס פינות המעטפת (px)",valueKey:"pickerPanelBorderRadius",min:0,max:40,placeholder:"12",p:r,onPatch:s})]}):null,n?e.jsxs(be,{title:"מצב בוחר — שדה חיפוש וכפתור «חיפוש»",hint:"התווית «חיפוש מוצרים», שורת הקלט והכפתור שמפעיל את החיפוש ב-AliExpress.",children:[e.jsx(p,{label:"צבע תווית «חיפוש מוצרים»",value:String(r.pickerSearchLabelColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerSearchLabelColor:l||void 0}),onClear:()=>s({pickerSearchLabelColor:void 0})}),e.jsx(p,{label:"רקע שדה החיפוש",value:String(r.pickerSearchInputBackground??""),emptyFallback:"#ffffff",onChange:l=>s({pickerSearchInputBackground:l||void 0}),onClear:()=>s({pickerSearchInputBackground:void 0})}),e.jsx(p,{label:"צבע טקסט בשדה החיפוש",value:String(r.pickerSearchInputTextColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerSearchInputTextColor:l||void 0}),onClear:()=>s({pickerSearchInputTextColor:void 0})}),e.jsx(p,{label:"צבע placeholder בשדה החיפוש",value:String(r.pickerSearchInputPlaceholderColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerSearchInputPlaceholderColor:l||void 0}),onClear:()=>s({pickerSearchInputPlaceholderColor:void 0})}),e.jsx(p,{label:"מסגרת שדה החיפוש",value:String(r.pickerSearchInputBorderColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerSearchInputBorderColor:l||void 0}),onClear:()=>s({pickerSearchInputBorderColor:void 0})}),e.jsx(ke,{label:"רדיוס שדה החיפוש (px)",valueKey:"pickerSearchInputBorderRadius",min:0,max:30,placeholder:"10",p:r,onPatch:s}),e.jsx(p,{label:"רקע כפתור «חיפוש»",value:String(r.pickerSearchButtonBackground??""),emptyFallback:"primary",onChange:l=>s({pickerSearchButtonBackground:l||void 0}),onClear:()=>s({pickerSearchButtonBackground:void 0})}),e.jsx(p,{label:"צבע טקסט כפתור «חיפוש»",value:String(r.pickerSearchButtonTextColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerSearchButtonTextColor:l||void 0}),onClear:()=>s({pickerSearchButtonTextColor:void 0})}),e.jsx(ke,{label:"רדיוס כפתור «חיפוש» (px)",valueKey:"pickerSearchButtonBorderRadius",min:0,max:24,placeholder:"8",p:r,onPatch:s})]}):null,n?e.jsxs(be,{title:"מצב בוחר — רשימת תוצאות ושורות",hint:"המיכל של הרשימה הנגללת וכל שורת מוצר בתוצאות החיפוש.",children:[e.jsx(p,{label:"רקע אזור הרשימה",value:String(r.pickerListBackgroun
36d??""),emptyFallback:"מושתק",onChange:l=>s({pickerListBackground:l||void 0}),onClear:()=>s({pickerListBackground:void 0})}),e.jsx(p,{label:"מסגרת אזור הרשימה",value:String(r.pickerListBorderColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerListBorderColor:l||void 0}),onClear:()=>s({pickerListBorderColor:void 0})}),e.jsx(ke,{label:"רדיוס אזור הרשימה (px)",valueKey:"pickerListBorderRadius",min:0,max:24,placeholder:"8",p:r,onPatch:s}),e.jsx(p,{label:"רקע שורת מוצר בתוצאות",value:String(r.pickerHitRowBackground??""),emptyFallback:"שקוף",onChange:l=>s({pickerHitRowBackground:l||void 0}),onClear:()=>s({pickerHitRowBackground:void 0})}),e.jsx(p,{label:"מסגרת שורת מוצר",value:String(r.pickerHitRowBorderColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerHitRowBorderColor:l||void 0}),onClear:()=>s({pickerHitRowBorderColor:void 0})}),e.jsx(ke,{label:"רדיוס שורת מוצר (px)",valueKey:"pickerHitRowBorderRadius",min:0,max:16,placeholder:"6",p:r,onPatch:s}),e.jsx(p,{label:"צבע טקסט «סמנו עד X מוצרים…»",value:String(r.pickerHintTextColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerHintTextColor:l||void 0}),onClear:()=>s({pickerHintTextColor:void 0})})]}):null,n?e.jsxs(be,{title:"מצב בוחר — כפתור «השווה נבחרים» והודעות",hint:"כפתור ההשוואה, מסך ההנחיה לפני בחירה, טעינה ו«לא נמצאו מוצרים».",children:[e.jsx(p,{label:"רקע כפתור «השווה נבחרים»",value:String(r.pickerCompareButtonBackground??""),emptyFallback:"secondary",onChange:l=>s({pickerCompareButtonBackground:l||void 0}),onClear:()=>s({pickerCompareButtonBackground:void 0})}),e.jsx(p,{label:"צבע טקסט כפתור «השווה נבחרים»",value:String(r.pickerCompareButtonTextColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerCompareButtonTextColor:l||void 0}),onClear:()=>s({pickerCompareButtonTextColor:void 0})}),e.jsx(ke,{label:"רדיוס כפתור «השווה נבחרים» (px)",valueKey:"pickerCompareButtonBorderRadius",min:0,max:24,placeholder:"8",p:r,onPatch:s}),e.jsx(p,{label:"רקע תיבת הנחיה / ריק (לפני השוואה)",value:String(r.pickerEmptyPanelBackground??""),emptyFallback:"מושתק",onChange:l=>s({pickerEmptyPanelBackground:l||void 0}),onClear:()=>s({pickerEmptyPanelBackground:void 0})}),e.jsx(p,{label:"מסגרת תיבת הנחיה / ריק",value:String(r.pickerEmptyPanelBorderColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerEmptyPanelBorderColor:l||void 0}),onClear:()=>s({pickerEmptyPanelBorderColor:void 0})}),e.jsx(p,{label:"צבע טקסט בהנחיה / ריק / אין תוצאות",value:String(r.pickerEmptyPanelTextColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerEmptyPanelTextColor:l||void 0}),onClear:()=>s({pickerEmptyPanelTextColor:void 0})}),e.jsx(p,{label:"צבע טקסט «טוען השוואה…»",value:String(r.pickerLoadingTextColor??""),emptyFallback:"מושתק",onChange:l=>s({pickerLoadingTextColor:l||void 0}),onClear:()=>s({pickerLoadingTextColor:void 0})})]}):null,e.jsxs(be,{title:"טבלת ההשוואה",hint:"כותרות העמודות, מסגרת הטבלה, תאי גוף (מלבד שם המוצר) וכפתור «לצפייה» בכל שורה.",children:[e.jsx(p,{label:"רקע שורת כותרות",value:String(r.comparisonTableHeaderBackground??""),emptyFallback:"hsl(var(--muted))",onChange:l=>s({comparisonTableHeaderBackground:l||void 0}),onClear:()=>s({comparisonTableHeaderBackground:void 0})}),e.jsx(p,{label:"צבע טקסט בכותרות העמודות",value:String(r.comparisonTableHeaderTextColor??""),emptyFallback:"מושתק",onChange:l=>s({comparisonTableHeaderTextColor:l||void 0}),onClear:()=>s({comparisonTableHeaderTextColor:void 0})}),e.jsx(p,{label:"מסגרת חיצונית של הטבלה",value:String(r.comparisonTableBorderColor??""),emptyFallback:"כמו מסגרת הכרטיס",onChange:l=>s({comparisonTableBorderColor:l||void 0}),onClear:()=>s({comparisonTableBorderColor:void 0})}),e.jsx(p,{label:"מסגרת בין שורות בגוף הטבלה",value:String(r.comparisonTableBodyRowBorderColor??""),emptyFallback:"מושתק",onChange:l=>s({comparisonTableBodyRowBorderColor:l||void 0}),onClear:()=>s({comparisonTableBodyRowBorderColor:void 0})}),e.jsx(p,{label:"צבע טקסט בעמודות גוף (מכירות, דירוג, הנחה…)",value:String(r.comparisonTableCellTextColor??""),emptyFallback:"מושתק",onChange:l=>s({comparisonTableCellTextColor:l||void 0}),onClear:()=>s({comparisonTableCellTextColor:void 0})}),e.jsx(p,{label:"רקע כפתור «לצפייה»",value:String(r.comparisonViewButtonBackgroun
36d??""),emptyFallback:"secondary",onChange:l=>s({comparisonViewButtonBackground:l||void 0}),onClear:()=>s({comparisonViewButtonBackground:void 0})}),e.jsx(p,{label:"צבע טקסט כפתור «לצפייה»",value:String(r.comparisonViewButtonTextColor??""),emptyFallback:"מושתק",onChange:l=>s({comparisonViewButtonTextColor:l||void 0}),onClear:()=>s({comparisonViewButtonTextColor:void 0})}),e.jsx(ke,{label:"רדיוס כפתור «לצפייה» (px)",valueKey:"comparisonViewButtonBorderRadius",min:0,max:24,placeholder:"8",p:r,onPatch:s})]}),e.jsxs(be,{title:"טקסטים ותגים בתוך מוצר",hint:"שם מוצר, מחיר, מטא־דאטה, תגי הנחה וקופון — בטבלה ובתוצאות החיפוש.",children:[e.jsx(p,{label:"צבע שם מוצר",value:String(r.productTitleColor??""),emptyFallback:"hsl(var(--foreground))",onChange:l=>s({productTitleColor:l||void 0}),onClear:()=>s({productTitleColor:void 0})}),e.jsx(p,{label:"צבע מטא־דאטה (מכירות, דירוג בטבלה כשלא מוגדר נפרד)",value:String(r.productMetaColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:l=>s({productMetaColor:l||void 0}),onClear:()=>s({productMetaColor:void 0})}),e.jsx(p,{label:"צבע מחיר",value:String(r.productPriceColor??""),emptyFallback:"hsl(var(--foreground))",onChange:l=>s({productPriceColor:l||void 0}),onClear:()=>s({productPriceColor:void 0})}),e.jsx(p,{label:"צבע מחיר ישן / משני",value:String(r.productMutedColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:l=>s({productMutedColor:l||void 0}),onClear:()=>s({productMutedColor:void 0})}),e.jsx(p,{label:"תג הנחה — רקע",value:String(r.discountBadgeBackgroun
36d??""),emptyFallback:"hsl(var(--secondary))",onChange:l=>s({discountBadgeBackground:l||void 0}),onClear:()=>s({discountBadgeBackground:void 0})}),e.jsx(p,{label:"תג הנחה — טקסט",value:String(r.discountBadgeTextColor??""),emptyFallback:"hsl(var(--secondary-foreground))",onChange:l=>s({discountBadgeTextColor:l||void 0}),onClear:()=>s({discountBadgeTextColor:void 0})}),e.jsx(p,{label:"תג קופון — רקע",value:String(r.couponBadgeBackground??""),emptyFallback:"transparent",onChange:l=>s({couponBadgeBackground:l||void 0}),onClear:()=>s({couponBadgeBackground:void 0})}),e.jsx(p,{label:"תג קופון — טקסט",value:String(r.couponBadgeTextColor??""),emptyFallback:"hsl(var(--foreground))",onChange:l=>s({couponBadgeTextColor:l||void 0}),onClear:()=>s({couponBadgeTextColor:void 0})}),e.jsx(p,{label:"תג קופון — מסגרת",value:String(r.couponBadgeBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:l=>s({couponBadgeBorderColor:l||void 0}),onClear:()=>s({couponBadgeBorderColor:void 0})})]})]})]})]})})}const oa="grid h-auto w-full grid-cols-2 gap-1 rounded-lg border border-border/60 bg-muted/25 p-1 text-foreground shadow-sm",cs=R("rounded-md px-2 py-2 text-xs font-medium transition-colors","text-muted-foreground hover:bg-muted/50 hover:text-foreground","data-[state=active]:border data-[state=active]:border-border/70 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm");function us({title:r="תוכן ומבנה",hint:s,children:n}){return e.jsxs("section",{className:"space-y-3","aria-labelledby":"lb-inspector-content-title",children:[e.jsx("div",{className:"rounded-lg border border-border/55 bg-muted/10 px-3 py-2.5 sm:px-4",children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border/60 bg-background/90 text-muted-foreground",children:e.jsx(Ns,{className:"h-3.5 w-3.5","aria-hidden":!0})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1 text-right",children:[e.jsx("h3",{id:"lb-inspector-content-title",className:"text-xs font-semibold text-foreground",children:r}),s?e.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:s}):null]})]})}),e.jsx("div",{className:"space-y-3 px-0.5",children:n})]})}function kr({title:r,hint:s,children:n}){const t="lb-inspector-design-title";return e.jsx("section",{className:"mt-1 space-y-3 border-t border-border/70 pt-4","aria-labelledby":t,children:e.jsxs("div",{className:R("overflow-hidden rounded-xl border border-border/60 bg-muted/10 shadow-sm ring-1 ring-border/40"),children:[e.jsx("div",{className:"border-b border-border/50 bg-muted/30 px-4 py-3 sm:px-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-background/80 text-muted-foreground",children:e.jsx(Cs,{className:"h-4 w-4","aria-hidden":!0})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5 text-right",children:[e.jsx("h3",{id:t,className:"text-sm font-semibold leading-tight text-foreground",children:r}),s?e.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:s}):null]})]})}),e.jsx("div",{className:"space-y-4 px-4 py-4 sm:px-5 sm:py-5",children:n})]})})}function X({widgetLabel:r,content:s,design:n,designHint:t="שדות ריקים נשענים על ערכת הנושא של הדף. מסגרת הבלוק שולטת במעטפת החיצונית של הווידג׳ט.",contentHint:o,contentTitle:m,showBlockChrome:h=!0,orphanChrome:x=!1,p:l,onPatch:g}){const u=`עיצוב — ${r}`,b=h?e.jsx(Zs,{props:l,onPatch:g}):null,f=e.jsxs(e.Fragment,{children:[n,b]});return s&&n?e.jsxs(fl,{defaultValue:"content",className:"w-full",dir:"rtl",children:[e.jsxs(Cl,{className:oa,children:[e.jsx(Kr,{value:"content",className:cs,children:"תוכן"}),e.jsx(Kr,{value:"design",className:cs,children:"עיצוב"})]}),e.jsx(Yr,{value:"content",className:"mt-3 space-y-3 focus-visible:outline-none",children:e.jsx(us,{title:m,hint:o,children:s})}),e.jsx(Yr,{value:"design",className:"mt-3 space-y-3 focus-visible:outline-none",children:e.jsx(kr,{title:u,hint:t,children:f})})]}):s&&!n?e.jsxs("div",{className:"space-y-4",children:[e.jsx(us,{title:m,hint:o,children:s}),x&&b?e.jsx(kr,{title:u,hint:"מסגרת ורקע (מעטפת) סביב הווידג׳ט.",children:b}):null]}):!s&&n?e.jsx(kr,{title:u,hint:t,children:f}):null}async function Ps(r){var N,k;const s={action:"categories"};r!=null&&r.targetUserId&&(s.targetUserId=r.targetUserId);const{data:n,error:t}=await Nl("aliexpress-products",s);if(t)throw t;const o=n==null?void 0:n.aliexpress_affiliate_category_get_response,m=o==null?void 0:o.resp_result;if((m==null?void 0:m.resp_code)!==200)return[];const h=(k=(N=m==null?void 0:m.result)==null?void 0:N.categories)==null?void 0:k.category,x=Array.isArray(h)?h:h?[h]:[],l=new Set(wt.map(M=>String(M))),u=x.filter(M=>{const D=!M.parent_category_id||M.parent_category_id==="0",y=l.has(String(M.category_id));return D&&y}).filter((M,D,y)=>D===y.findIndex(I=>I.category_id===M.category_id)),b=new Set(u.map(M=>String(M.category_id))),a=x.filter(M=>!!(M.parent_category_id&&M.parent_category_id!=="0")&&b.has(String(M.parent_category_id))).filter((M,D,y)=>D===y.findIndex(I=>I.category_id===M.category_id));
36return[...u,...a]}const We={productCardBackground:void 0,productCardBorderColor:void 0,productCardBorderRadius:void 0,productCardShadow:void 0,widgetTitleColor:void 0,widgetSubtitleColor:void 0,productTitleColor:void 0,productMetaColor:void 0,productPriceColor:void 0,productMutedColor:void 0,discountBadgeBackground:void 0,discountBadgeTextColor:void 0,couponBadgeBackground:void 0,couponBadgeTextColor:void 0,couponBadgeBorderColor:void 0,comparisonTableHeaderBackground:void 0,dealHeroBackground:void 0},xs={productCardBackground:"hsl(var(--card) / 0.35)",productCardBorderColor:"hsl(var(--border) / 0.55)",productCardBorderRadius:16,productCardShadow:"md",widgetTitleColor:"hsl(var(--foreground))",widgetSubtitleColor:"hsl(var(--muted-foreground))",productTitleColor:"hsl(var(--foreground))",productMetaColor:"hsl(var(--muted-foreground))",productPriceColor:"hsl(var(--foreground))",productMutedColor:"hsl(var(--muted-foreground))",discountBadgeBackground:"hsl(var(--primary) / 0.18)",discountBadgeTextColor:"hsl(var(--primary))",couponBadgeBackgroun
36d:"transparent",couponBadgeTextColor:"hsl(var(--foreground))",couponBadgeBorderColor:"hsl(var(--border))",comparisonTableHeaderBackground:"hsl(var(--muted) / 0.25)",dealHeroBackground:"linear-gradient(135deg, hsl(var(--primary) / 0.12) 0%, hsl(var(--background)) 55%, hsl(var(--background)) 100%)"},ms={productCardBackground:"hsl(222 47% 9%)",productCardBorderColor:"hsl(217 33% 17%)",productCardBorderRadius:12,productCardShadow:"lg",widgetTitleColor:"hsl(210 40% 98%)",widgetSubtitleColor:"hsl(215 20% 70%)",productTitleColor:"hsl(210 40% 98%)",productMetaColor:"hsl(215 20% 72%)",productPriceColor:"hsl(142 70% 48%)",productMutedColor:"hsl(215 16% 52%)",discountBadgeBackground:"hsl(262 83% 58%)",discountBadgeTextColor:"hsl(0 0% 100%)",couponBadgeBackground:"transparent",couponBadgeTextColor:"hsl(210 40% 98%)",couponBadgeBorderColor:"hsl(217 33% 28%)",comparisonTableHeaderBackground:"hsl(222 47% 7%)",dealHeroBackground:"linear-gradient(135deg, hsl(262 40% 18%) 0%, hsl(222 47% 9%) 100%)"},hs={productCardBackground:"hsl(var(--secondary) / 0.22)",productCardBorderColor:"hsl(var(--border) / 0.45)",productCardBorderRadius:14,productCardShadow:"sm",widgetTitleColor:"hsl(var(--foreground))",widgetSubtitleColor:"hsl(var(--muted-foreground))",productTitleColor:"hsl(var(--foreground))",productMetaColor:"hsl(var(--muted-foreground))",productPriceColor:"hsl(var(--foreground))",productMutedColor:"hsl(var(--muted-foreground))",discountBadgeBackgroun
36d:"hsl(var(--muted))",discountBadgeTextColor:"hsl(var(--foreground))",couponBadgeBackground:"hsl(var(--background) / 0.6)",couponBadgeTextColor:"hsl(var(--foreground))",couponBadgeBorderColor:"hsl(var(--border))",comparisonTableHeaderBackground:"hsl(var(--muted) / 0.4)",dealHeroBackground:"linear-gradient(180deg, hsl(var(--secondary) / 0.35), hsl(var(--background)))"};function Sr(r){const s=String(r.categoryId??"").trim(),n=String(r.sort??"LAST_VOLUME_DESC");return!s&&n==="LAST_VOLUME_DESC"?"hot_global":!s&&n==="DEFAULT"?"promo_global":s&&n==="LAST_VOLUME_DESC"?"hot_in_cat":s&&n==="DEFAULT"?"promo_in_cat":"custom"}function da(r,s){r==="hot_global"?s({sort:"LAST_VOLUME_DESC",categoryId:""}):r==="promo_global"?s({sort:"DEFAULT",categoryId:""}):r==="hot_in_cat"?s({sort:"LAST_VOLUME_DESC"}):r==="promo_in_cat"&&s({sort:"DEFAULT"})}function Br({widgetType:r,blockId:s,pageId:n,p:t,onPatch:o}){var V;const m=yl(),{effectiveUserId:h,actualUserId:x,isLoading:l}=Ke(),g=h&&x&&h!==x?h:void 0,u=Er({queryKey:["visual-landing-aliexpress-categories",g??"self"],enabled:!l&&!!x,staleTime:1e3*60*60*6,queryFn:()=>Ps({targetUserId:g})}),b=kl({mutationFn:async()=>{var H;if(!n)throw new Error("חסר מזהה דף");const{data:C,error:O}=await Mr.functions.invoke("refresh-aliexpress-landing-widgets",{body:{pageId:n,blockIds:[s]}});if(O)throw O;const U=C;if(U!=null&&U.error)throw new Error(U.error);const $=(H=U==null?void 0:U.refreshed)==null?void 0:H.find(xe=>xe.blockId===s);if($&&!$.ok)throw new Error($.error||"הרענון נכשל");return!0},onSuccess:async()=>
36{await m.invalidateQueries({queryKey:["visual-landing-aliexpress-widget-cache",n,s]}),ve.success("ה-cache עודכן")},onError:C=>{const O=C instanceof Error?C.message:"שגיאה לא ידועה";ve.error(O)}}),f=String(t.sourceMode??"hotProducts"),a=String(t.sort??"LAST_VOLUME_DESC"),N=r==="aliexpressComparison"?2:r==="aliexpressDealAlert"?1:3,k=r==="aliexpressComparison"?5:r==="aliexpressDealAlert"?6:24,M=r==="aliexpressComparison"||r==="aliexpressDealAlert"?3:8,D=r==="aliexpressComparison"&&String(t.comparisonMode??"source")==="picker",y=e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"Cache"}),e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/15 p-3 text-xs text-muted-foreground",children:"הדף הציבורי קורא נתונים מטבלת cache דרך RPC. בעורך אפשר לרענן ידנית לאחר שינוי הגדרות."}),e.jsx("div",{className:"flex items-center justify-end gap-2 pt-2",children:e.jsxs(E,{type:"button",variant:"secondary",size:"sm",className:"gap-2",disabled:!n||b.isPending,onClick:()=>b.mutate(),children:[b.isPending?e.jsx(Ye,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):e.jsx(Sl,{className:"h-4 w-4","aria-hidden":!0}),"רענון cache"]})})]}),I=((V=Ee(r))==null?void 0:V.label)??r;return e.jsx(X,{widgetLabel:I,contentHint:"כותרות, מקור נתונים מ-AliExpress, קטגוריות, מיון וסינון.",designHint:r==="aliexpressComparison"?"רענון cache, מעטפת הבלוק ואז עיצוב טבלה/בוחר.":"רענון cache, צבעי כרטיסיות, דיל ראשי ומעטפת הבלוק.",content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת"}),e.jsx(j,{value:String(t.title??""),onChange:C=>o({title:C.target.value}),dir:"rtl",className:"text-right"})]}),r==="aliexpressDealAlert"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תת-כותרת"}),e.jsx(j,{value:String(t.subtitle??""),onChange:C=>o({subtitle:C.target.value}),dir:"rtl",className:"text-right"})]}):null,r==="aliexpressComparison"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"סוג השוואה"}),e.jsxs(S,{value:String(t.comparisonMode??"source"),onValueChange:C=>o({comparisonMode:C==="picker"?"picker":"source"}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"source",children:"אוטומטי לפי מקור הנתונים (cache)"}),e.jsx(c,{value:"picker",children:"חיפוש ובחירה בדף"})]})]}),e.jsxs("p",{className:"text-[11px] leading-snug text-muted-foreground",children:["במצב בחירה בדף המבקרים מחפשים ב-AliExpress, מסמנים עד ",String(t.limit??3)," מוצרים, ומקבלים טבלת השוואה."]})]}):null,D?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Placeholder לחיפוש בדף"}),e.jsx(j,{value:String(t.searchPlaceholder??""),onChange:C=>o({searchPlaceholder:C.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מזהי מוצר ברירת מחדל (אופציונלי, מופרדים בפסיק)"}),e.jsx(ne,{value:String(t.pickedProductIds??""),onChange:C=>o({pickedProductIds:C.target.value}),rows:2,dir:"ltr",className:"text-left",placeholder:"לטעינה ראשונית בלי חיפוש"})]})]}):null,e.jsx(A,{children:"מקור נתונים (AliExpress)"}),D?e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground -mt-1",children:'קטגוריה ומיון למטה משפיעים על תוצאות החיפוש בדף. אין שימוש במצב מקור "חמים/חיפוש קבוע" כאן.'}):null,e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מצב מקור"}),e.jsxs(S,{value:f,onValueChange:C=>
36o({sourceMode:C}),disabled:D,children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"hotProducts",children:"מוצרים חמים"}),e.jsx(c,{value:"search",children:"חיפוש לפי מילות מפתח"}),e.jsx(c,{value:"productDetails",children:"מזהי מוצרים"})]})]})]}),f==="hotProducts"&&!D?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקוד מהיר (מוצרים חמים)"}),e.jsxs(S,{value:Sr(t),onValueChange:C=>{const O=C;if(O==="custom"){o({sort:"SALE_PRICE_ASC"});return}if((O==="hot_in_cat"||O==="promo_in_cat")&&!String(t.categoryId??"").trim()){ve('בחרו קטגוריה למטה לפני מצב "בתוך קטגוריה", או השתמשו ב"גלובלי".');return}da(O,o)},children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"hot_in_cat",children:"חמים בתוך קטגוריה (לפי נפח)"}),e.jsx(c,{value:"promo_in_cat",children:"מומלצים / מקודמים בתוך קטגוריה"}),e.jsx(c,{value:"hot_global",children:"חמים גלובלית (ללא קטגוריה)"}),e.jsx(c,{value:"promo_global",children:"מומלצים גלובלית (ללא קטגוריה)"}),e.jsx(c,{value:"custom",children:"מיון מתקדם (מותאם אישית)"})]})]}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:'"גלובלי" מנקה את בחירת הקטגוריה. "בתוך קטגוריה" משאיר את הקטגוריה שבחרתם למטה ומגדיר רק את סוג המיון.'})]}):null,!D&&f==="search"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מילות מפתח"}),e.jsx(j,{value:String(t.keywords??""),onChange:C=>o({keywords:C.target.value}),dir:"rtl",className:"text-right",placeholder:"לדוגמה: wireless earbuds"})]}):null,!D&&f==="productDetails"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מזהי מוצרים (מופרדים בפסיק)"}),e.jsx(ne,{value:String(t.productIds??""),onChange:C=>o({productIds:C.target.value}),rows:4,dir:"ltr",className:"text-left",placeholder:"1234567890,0987654321"})]}):null,f==="hotProducts"||f==="search"||D?e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"קטגוריה מ-AliExpress"}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground -mt-1",children:"בוחרים מהרשימה הרלוונטית (ראשית ואז תת). אין צורך להעתיק מזהים ידנית."}),e.jsx(Js,{categories:u.data??[],loading:u.isLoading||u.isFetching,categoryId:String(t.categoryId??""),onCategoryChange:C=>o({categoryId:C}),disabled:u.isError}),u.isError?e.jsx("p",{className:"text-xs text-destructive",children:"לא ניתן לטעון קטגוריות. בדקו הגדרות AliExpress או נסו שוב."}):null,e.jsxs(Tr,{className:"rounded-lg border border-border/60 bg-muted/10",children:[e.jsx(Ir,{asChild:!0,children:e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"flex w-full items-center justify-between px-3 py-2 text-xs",children:[e.jsx("span",{children:"מזהה קטגוריה ידני (מתקדם)"}),e.jsx(cr,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}),e.jsx(Lr,{className:"px-3 pb-3",children:e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מזהה מספרי"}),e.jsx(j,{value:String(t.categoryId??""),onChange:C=>o({categoryId:C.target.value}),dir:"ltr",className:"text-left",placeholder:"למשל 5090301"})]})})]})]}):null,e.jsxs("div",{className:d,children:[e.jsx(i,{className:R(f==="hotProducts"&&Sr(t)!=="custom"&&"text-muted-foreground"),children:"מיון"}),f==="hotProducts"&&Sr(t)!=="custom"?e.jsx("p",{className:"rounded-md border border-border/70 bg-muted/15 px-3 py-2 text-xs text-muted-foreground",children:'מיון נקבע לפי "מיקוד מהיר" למעלה. בחרו "מיון מתקדם" כדי לפתוח את כל אפשרויות המיון.'}):e.jsxs(S,{value:a,onValueChange:C=>
36o({sort:C}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"DEFAULT",children:"ברירת מחדל AliExpress (מומלצים / מקודמים)"}),e.jsx(c,{value:"LAST_VOLUME_DESC",children:"נפח מכירות"}),e.jsx(c,{value:"SALE_PRICE_ASC",children:"מחיר: מהנמוך לגבוה"}),e.jsx(c,{value:"SALE_PRICE_DESC",children:"מחיר: מהגבוה לנמוך"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כמות מוצרים"}),e.jsx(j,{type:"number",min:N,max:k,value:Number(t.limit??M),onChange:C=>o({limit:Number(C.target.value)||M}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"סינון (בצד הלקוח)"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הנחה מינימלית (%)"}),e.jsx(j,{type:"number",min:0,max:95,value:Number(t.minDiscountPct??0),onChange:C=>o({minDiscountPct:Number(C.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"דירוג מינימלי (0-5)"}),e.jsx(j,{type:"number",min:0,max:5,step:.1,value:Number(t.minRating??0),onChange:C=>o({minRating:Number(C.target.value)||0}),dir:"ltr",className:"text-left"}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:"שדה הדירוג ב-AliExpress לעיתים מגיע כאחוז משוב חיובי — כאן משתמשים בסף בסגנון כוכבים (0-5) כמו בשאר המסכים."})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"ae-free-ship",className:"flex-1 cursor-pointer font-normal text-right",children:"רק משלוח חינם (אם קיים בשדה free_shipping ב-cache)"}),e.jsx(W,{id:"ae-free-ship",checked:!!t.freeShippingOnly,onCheckedChange:C=>o({freeShippingOnly:!!C})})]}),r==="aliexpressTrendingPicks"?e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"רשת (גריד)"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (מחשב)"}),e.jsxs(S,{value:String(t.columnsDesktop??4),onValueChange:C=>o({columnsDesktop:Number.parseInt(C,10)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"}),e.jsx(c,{value:"4",children:"4"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (טאבלט)"}),e.jsxs(S,{value:String(t.columnsTablet??3),onValueChange:C=>o({columnsTablet:Number.parseInt(C,10)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (מובייל)"}),e.jsxs(S,{value:String(t.columnsMobile??2),onValueChange:C=>o({columnsMobile:Number.parseInt(C,10)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח (px)"}),e.jsx(j,{type:"number",min:4,max:32,value:Number(t.gap??12),onChange:C=>o({gap:Number(C.target.value)||12}),dir:"ltr",className:"text-left"})]})]}):null]}),design:e.jsxs(e.Fragment,{children:[y,r==="aliexpressComparison"?e.jsx(ia,{p:t,onPatch:o,pickerMode:D,clearCardStyle:We,presetGlass:xs,presetContrast:ms,presetSoft:hs}):e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"עיצוב כרטיסיות"}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground -mt-1",children:'פריסטים מהירים או צבעים ידניים. ריק = שימוש בערכת הנושא (כהה/בהירה). "מסגרת הבלוק" למטה שולטת במעטפת החיצונית.'}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>o({...We}),children:"ברירת מחדל"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>o({...We,...xs}),children:"זכוכית"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>o({...We,...ms}),children:"ניגודיות"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:Be,onClick:()=>o({...We,...hs}
36),children:"רך"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל כרטיס"}),e.jsxs(S,{value:t.productCardShadow?String(t.productCardShadow):"__default",onValueChange:C=>o({productCardShadow:C==="__default"?void 0:C}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"ברירת מחדל (sm)"})}),e.jsxs(_,{children:[e.jsx(c,{value:"__default",children:"ברירת מחדל (sm)"}),e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קל (sm)"}),e.jsx(c,{value:"md",children:"בינוני (md)"}),e.jsx(c,{value:"lg",children:"בולט (lg)"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רדיוס פינות כרטיס (px)"}),e.jsx(j,{type:"number",min:0,max:32,dir:"ltr",className:"text-left",value:typeof t.productCardBorderRadius=="number"?String(t.productCardBorderRadius):"",onChange:C=>{const O=C.target.value;if(O===""){o({productCardBorderRadius:void 0});return}const U=Number(O);Number.isFinite(U)&&o({productCardBorderRadius:Math.min(32,Math.max(0,Math.round(U)))})},placeholder:"12"})]}),e.jsx(p,{label:"רקע כרטיס / טבלה",value:String(t.productCardBackground??""),emptyFallback:"hsl(var(--card))",onChange:C=>o({productCardBackground:C||void 0}),onClear:()=>o({productCardBackground:void 0})}),e.jsx(p,{label:"מסגרת כרטיס",value:String(t.productCardBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:C=>o({productCardBorderColor:C||void 0}),onClear:()=>o({productCardBorderColor:void 0})}),e.jsx(p,{label:"צבע כותרת הווידג׳ט",value:String(t.widgetTitleColor??""),emptyFallback:"hsl(var(--foreground))",onChange:C=>o({widgetTitleColor:C||void 0}),onClear:()=>o({widgetTitleColor:void 0})}),r==="aliexpressDealAlert"?e.jsx(p,{label:"צבע תת-כותרת",value:String(t.widgetSubtitleColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:C=>o({widgetSubtitleColor:C||void 0}),onClear:()=>o({widgetSubtitleColor:void 0})}):null,e.jsx(p,{label:"צבע שם מוצר",value:String(t.productTitleColor??""),emptyFallback:"hsl(var(--foreground))",onChange:C=>o({productTitleColor:C||void 0}),onClear:()=>o({productTitleColor:void 0})}),e.jsx(p,{label:"צבע מטא-דאטה (מכירות, דירוג)",value:String(t.productMetaColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:C=>o({productMetaColor:C||void 0}),onClear:()=>o({productMetaColor:void 0})}),e.jsx(p,{label:"צבע מחיר",value:String(t.productPriceColor??""),emptyFallback:"hsl(var(--foreground))",onChange:C=>o({productPriceColor:C||void 0}),onClear:()=>o({productPriceColor:void 0})}),e.jsx(p,{label:"צבע מחיר ישן / משני",value:String(t.productMutedColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:C=>o({productMutedColor:C||void 0}),onClear:()=>o({productMutedColor:void 0})}),e.jsx(p,{label:"תג הנחה — רקע",value:String(t.discountBadgeBackgroun
36d??""),emptyFallback:"hsl(var(--secondary))",onChange:C=>o({discountBadgeBackground:C||void 0}),onClear:()=>o({discountBadgeBackground:void 0})}),e.jsx(p,{label:"תג הנחה — טקסט",value:String(t.discountBadgeTextColor??""),emptyFallback:"hsl(var(--secondary-foreground))",onChange:C=>o({discountBadgeTextColor:C||void 0}),onClear:()=>o({discountBadgeTextColor:void 0})}),e.jsx(p,{label:"תג קופון — רקע",value:String(t.couponBadgeBackground??""),emptyFallback:"transparent",onChange:C=>o({couponBadgeBackground:C||void 0}),onClear:()=>o({couponBadgeBackground:void 0})}),e.jsx(p,{label:"תג קופון — טקסט",value:String(t.couponBadgeTextColor??""),emptyFallback:"hsl(var(--foreground))",onChange:C=>o({couponBadgeTextColor:C||void 0}),onClear:()=>o({couponBadgeTextColor:void 0})}),e.jsx(p,{label:"תג קופון — מסגרת",value:String(t.couponBadgeBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:C=>o({couponBadgeBorderColor:C||void 0}),onClear:()=>o({couponBadgeBorderColor:void 0})}),r==="aliexpressDealAlert"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רקע כרטיס הדיל הראשי (CSS)"}),e.jsx(ne,{dir:"ltr",className:"min-h-[72px] font-mono text-left text-sm",value:String(t.dealHeroBackground??""),onChange:C=>o({dealHeroBackground:C.target.value.trim()||void 0}),placeholder:"linear-gradient(135deg, hsl(var(--primary) / 0.12), hsl(var(--background)))",rows:3}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:"אם ריק — משתמשים בגרדיאנט ברירת מחדל. אפשר להדביק כל ערך תקין ל־background (כולל תמונה דרך url(...))."})]}):null]})]}),showBlockChrome:r!=="aliexpressComparison",p:t,onPatch:o})}function ca({p:r,onPatch:s}){var g;const{effectiveUserId:n,actualUserId:t,isLoading:o}=Ke(),m=n&&t&&n!==t?n:void 0,h=Er({queryKey:["visual-landing-aliexpress-categories",m??"self"],enabled:!o&&!!t,staleTime:1e3*60*60*6,queryFn:()=>Ps({targetUserId:m})}),x=String(r.sort??"LAST_VOLUME_DESC"),l=((g=Ee("aliexpressSearch"))==null?void 0:g.label)??"חיפוש ב-AliExpress";return e.jsx(X,{widgetLabel:l,contentHint:"טקסטים, סינון AliExpress ופריסת רשת.",designHint:"שורת חיפוש, כרטיסי תוצאה ומטא — טעינה חיה (ללא cache בטבלה).",content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת"}),e.jsx(j,{value:String(r.title??""),onChange:u=>s({title:u.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Placeholder לחיפוש"}),e.jsx(j,{value:String(r.placeholder??""),onChange:u=>s({placeholder:u.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כשהשאילתה קצרה מדי"}),e.jsx(j,{value:String(r.emptyText??""),onChange:u=>s({emptyText:u.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כשאין תוצאות"}),e.jsx(j,{value:String(r.noResultsText??""),onChange:u=>s({noResultsText:u.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מינימום תווים לחיפוש"}),e.jsx(j,{type:"number",min:1,max:6,value:Number(r.minChars??2),onChange:u=>s({minChars:Number(u.target.value)||2}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מקסימום תוצאות (לשאילתה)"}),e.jsx(j,{type:"number",min:4,max:20,value:Number(r.maxResults??12),onChange:u=>s({maxResults:Number(u.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"סינון AliExpress"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קטגוריה"}),e.jsx(Js,{categories:h.data??[],loading:h.isLoading||h.isFetching,categoryId:String(r.categoryId??""),onCategoryChange:u=>s({categoryId:u}),disabled:h.isError})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיון ברירת מחדל"}),e.jsxs(S,{value:x,onValueChange:u=>s({sort:u}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"DEFAULT",children:"מומלצים / מקודמים"}),e.jsx(c,{value:"LAST_VOLUME_DESC",children:"נפח מכירות"}),e.jsx(c,{value:"SALE_PRICE_ASC",children:"מחיר: מהנמוך לגבוה"}),e.jsx(c,{value:"SALE_PRICE_DESC",children:"מחיר: מהגבוה לנמוך"})]})]})]}),e.jsx(A,{children:"רשת תוצאות"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (מחשב)"}),e.jsxs(S,{value:String(r.columnsDesktop??4),onValueChange:u=>s({columnsDesktop:Number.parseInt(u,10)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"}),e.jsx(c,{value:"4",children:"4"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (טאבלט)"}),e.jsxs(S,{value:String(r.columnsTablet??3),onValueChange:u=>s({columnsTablet:Number.parseInt(u,10)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (מובייל)"}),e.jsxs(S,{value:String(r.columnsMobile??2),onValueChange:u=>s({columnsMobile:Number.parseInt(u,10)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח (px)"}),e.jsx(j,{type:"number",min:4,max:32,value:Number(r.gap??12),onChange:u=>s({gap:Number(u.target.value)||12}),dir:"ltr",className:"text-left"})]})]}),design:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"Cache"}),e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/15 p-3 text-xs text-muted-foreground",children:"ווידג׳ט זה טוען תוצאות חיה מ-AliExpress בעת חיפוש (ללא cache בטבלה). ודאו שמפתחות AliExpress מוגדרים למשתמש."}),e.jsx(A,{children:"עיצוב שורת חיפוש"}),e.jsx(p,{label:"רקע תיבת חיפוש",value:String(r.inputBackgroun
36d??""),emptyFallback:"#ffffff",onChange:u=>s({inputBackground:u}),onClear:()=>s({inputBackground:void 0})}),e.jsx(p,{label:"צבע טקסט בהקלדה",value:String(r.inputTextColor??""),emptyFallback:"#111827",onChange:u=>s({inputTextColor:u}),onClear:()=>s({inputTextColor:void 0})}),e.jsx(p,{label:"צבע Placeholder",value:String(r.inputPlaceholderColor??""),emptyFallback:"#6b7280",onChange:u=>s({inputPlaceholderColor:u}),onClear:()=>s({inputPlaceholderColor:void 0})}),e.jsx(p,{label:"צבע מסגרת תיבת חיפוש",value:String(r.inputBorderColor??""),emptyFallback:"#d4d4d8",onChange:u=>s({inputBorderColor:u}),onClear:()=>s({inputBorderColor:void 0})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רדיוס פינות תיבת חיפוש (px)"}),e.jsx(j,{type:"number",min:0,max:30,value:Number(r.inputBorderRadius??10),onChange:u=>s({inputBorderRadius:Number(u.target.value)||10}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"עיצוב כרטיסי תוצאה (רשת)"}),e.jsx(p,{label:"רקע כרטיס תוצאה",value:String(r.resultsCardBackground??""),emptyFallback:"hsl(var(--card))",onChange:u=>s({resultsCardBackground:u}),onClear:()=>s({resultsCardBackground:void 0})}),e.jsx(p,{label:"מסגרת כרטיס תוצאה",value:String(r.resultsCardBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:u=>s({resultsCardBorderColor:u}),onClear:()=>s({resultsCardBorderColor:void 0})}),e.jsx(p,{label:"צבע טקסט כותרת מוצר בתוצאות",value:String(r.resultsTextColor??""),emptyFallback:"hsl(var(--foreground))",onChange:u=>s({resultsTextColor:u}),onClear:()=>s({resultsTextColor:void 0})}),e.jsx(A,{children:"עיצוב כרטיסי מוצר (מחיר, מטא)"}),e.jsx(p,{label:"רקע כרטיס (מערכת העיצוב המשותפת)",value:String(r.productCardBackground??""),emptyFallback:"hsl(var(--card))",onChange:u=>s({productCardBackground:u||void 0}),onClear:()=>s({productCardBackground:void 0})}),e.jsx(p,{label:"מסגרת כרטיס",value:String(r.productCardBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:u=>s({productCardBorderColor:u||void 0}),onClear:()=>s({productCardBorderColor:void 0})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רדיוס פינות כרטיס (px)"}),e.jsx(j,{type:"number",min:0,max:32,value:typeof r.productCardBorderRadius=="number"?String(r.productCardBorderRadius):"",onChange:u=>{const b=u.target.value;if(b===""){s({productCardBorderRadius:void 0});return}const f=Number(b);Number.isFinite(f)&&s({productCardBorderRadius:Math.min(32,Math.max(0,Math.round(f)))})},placeholder:"12",dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל כרטיס"}),e.jsxs(S,{value:r.productCardShadow?String(r.productCardShadow):"__default",onValueChange:u=>s({productCardShadow:u==="__default"?void 0:u}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"__default",children:"ברירת מחדל (sm)"}),e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קל"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"בולט"})]})]})]}),e.jsx(p,{label:"צבע מחיר",value:String(r.productPriceColor??""),emptyFallback:"hsl(var(--foreground))",onChange:u=>s({productPriceColor:u||void 0}),onClear:()=>s({productPriceColor:void 0})}),e.jsx(p,{label:"צבע מטא-דאטה (מכירות, דירוג)",value:String(r.productMetaColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:u=>s({productMetaColor:u||void 0}),onClear:()=>s({productMetaColor:void 0})}),e.jsx(p,{label:"צבע מחיר מקור (קו חוצה)",value:String(r.productMutedColor??""),emptyFallback:"hsl(var(--muted-foreground))",onChange:u=>s({productMutedColor:u||void 0}),onClear:()=>s({productMutedColor:void 0})})]}),p:r,onPatch:s})}const ua=["😀","😃","😄","😁","😅","😂","🤣","😊","😍","🥰","😘","😉","😎","🤩","🥳","👍","👏","🙏","💪","🔥","✨","💯","❤️","⭐","🎉","✅","⚠️","📦","🛒","💰","🎁","📌","👉","👈","☀️","🌙","💬","📱"];function xa(r){if(!r)return!1;const s=window.getSelection();if(!s||s.rangeCount===0)return!1;let n=s.anchorNode;return(n==null?void 0:n.nodeType)===Node.TEXT_NODE&&(n=n.parentElement),!n||!(n instanceof Node)?!1:r.contains(n)}function gs(r,s){try{document.execCommand(r,!1,s)}catch{}}function ma({value:r,onChange:s,className:n}){const t=F.useRef(null),o=F.useRef(""),[m,h]=F.useState({bold:!1,italic:!1,underline:!1,ul:!1,ol:!1}),x=F.useCallback(()=>{const b=t.current;if(!b)return;const f=b.innerHTML,a=Zr(f);o.current=a,s(a)},[s]),l=F.useCallback(()=>{xa(t.current)&&h({bold:document.queryCommandState("bold"),italic:document.queryCommandState("italic"),underline:document.queryCommandState("underline"),ul:document.queryCommandState("insertUnorderedList"),ol:document.queryCommandState("insertOrderedList")})},[]);F.useEffect(()=>{const b=()=>l();return document.addEventListener("selectionchange",b),()=>document.removeEventListener("selectionchange",b)},[l]),F.useEffect(()=>{const b=t.current;if(!b)return;const f=Zr(Ql(r));f!==o.current&&(b.innerHTML=f,o.current=f)},[r]);const g=(b,f)=>{var a;(a=t.current)==null||a.focus(),gs(b,f),x(),l()},u=b=>{var f;
36(f=t.current)==null||f.focus(),gs("insertText",b),x()};return e.jsxs("div",{className:R("space-y-2",n),children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1 border border-border/80 bg-muted/20 p-1.5 rounded-md",children:[e.jsx(E,{type:"button",variant:m.bold?"default":"outline",size:"icon",className:"h-8 w-8 shrink-0",title:"מודגש","aria-label":"מודגש",onMouseDown:b=>b.preventDefault(),onClick:()=>g("bold"),children:e.jsx(_t,{className:"h-4 w-4"})}),e.jsx(E,{type:"button",variant:m.italic?"default":"outline",size:"icon",className:"h-8 w-8 shrink-0",title:"נטוי","aria-label":"נטוי",onMouseDown:b=>b.preventDefault(),onClick:()=>g("italic"),children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsx(E,{type:"button",variant:m.underline?"default":"outline",size:"icon",className:"h-8 w-8 shrink-0",title:"קו תחתון","aria-label":"קו תחתון",onMouseDown:b=>b.preventDefault(),onClick:()=>g("underline"),children:e.jsx(Vt,{className:"h-4 w-4"})}),e.jsx(E,{type:"button",variant:m.ul?"default":"outline",size:"icon",className:"h-8 w-8 shrink-0",title:"רשימת נקודות","aria-label":"רשימת נקודות",onMouseDown:b=>b.preventDefault(),onClick:()=>g("insertUnorderedList"),children:e.jsx(Bl,{className:"h-4 w-4"})}),e.jsx(E,{type:"button",variant:m.ol?"default":"outline",size:"icon",className:"h-8 w-8 shrink-0",title:"רשימה ממוספרת","aria-label":"רשימה ממוספרת",onMouseDown:b=>b.preventDefault(),onClick:()=>g("insertOrderedList"),children:e.jsx(Tt,{className:"h-4 w-4"})}),e.jsxs(Vs,{children:[e.jsx(Os,{asChild:!0,children:e.jsx(E,{type:"button",variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",title:"אימוג׳י","aria-label":"הוספת אימוג׳י",children:e.jsx(Dt,{className:"h-4 w-4"})})}),e.jsxs(zs,{className:"w-72 p-2",align:"end",dir:"rtl",children:[e.jsx("p",{className:"mb-2 text-center text-xs text-muted-foreground",children:"בחרו אימוג׳י להוספה במיקום הסמן"}),e.jsx("div",{className:"grid max-h-48 grid-cols-8 gap-1 overflow-y-auto",children:ua.map(b=>e.jsx("button",{type:"button",className:"flex h-9 w-9 items-center justify-center rounded-md text-lg hover:bg-muted",onMouseDown:f=>f.preventDefault(),onClick:()=>u(b),children:b},b))})]})]})]}),e.jsx("div",{ref:t,role:"textbox",tabIndex:0,"aria-multiline":"true",contentEditable:!0,suppressContentEditableWarning:!0,dir:"rtl",className:R("min-h-[140px] w-full rounded-md border border-input bg-background px-3 py-2 text-right text-sm leading-relaxed","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","[&_ul]:my-2 [&_ul]:list-disc [&_ul]:ps-5","[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:ps-5","[&_li]:my-0.5","[&_a]:text-primary [&_a]:underline"),onInput:x,onBlur:x}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:"סמנו טקסט ולחצו על הכפתורים. אימוג׳י ניתן להדביק גם מהלוח או לבחור מהרשת למעלה."})]})}const ha=[{value:"truck",label:"משלוח"},{value:"shield",label:"מגן / בטיחות"},{value:"refresh",label:"החזרות"},{value:"clock",label:"זמן"},{value:"package",label:"חבילה"},{value:"headphones",label:"תמיכה"},{value:"badgeCheck",label:"אישור"},{value:"zap",label:"מהירות"}];function ga(r,s){return r.map(n=>({feature:n.feature,values:Array.from({length:s},(t,o)=>String(n.values[o]??""))}))}function ja({items:r,onChange:s}){const n=(m,h)=>{s(r.map((x,l)=>l===m?{...x,...h}:x))},t=()=>s([...r,{iconKey:"truck",title:"כותרת",text:"תיאור קצר"}]),o=m=>{r.length<=1||s(r.filter((h,x)=>x!==m))};return e.jsxs("div",{className:"flex flex-col gap-3",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"פריטים"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:t,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף"]})]}),r.map((m,h)=>e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-border/60 p-2",children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"אייקון"}),e.jsxs(S,{value:String(m.iconKey),onValueChange:x=>n(h,{iconKey:x}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsx(_,{children:ha.map(x=>e.jsx(c,{value:x.value,children:x.label},x.value))})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת"}),e.jsx(j,{value:m.title,onChange:x=>n(h,{title:x.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט"}),e.jsx(ne,{value:m.text,onChange:x=>n(h,{text:x.target.value}),rows:2,dir:"rtl",className:"text-right"})]}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-destructive",onClick:()=>o(h),children:"הסר פריט"})]},h))]})}function va({rows:r,colCount:s,onChange:n}){const t=(x,l,g)=>{n(r.map((u,b)=>b!==x?u:l==="feature"?{...u,feature:String(g)}:{...u,values:g}))},o=(x,l,g)=>{const u=r[x],b=[...pa(u.values,s)];b[l]=g,t(x,"values",b)},m=()=>n([...r,{feature:"שורה חדשה",values:Array.from({length:s},()=>"")}]),h=x=>{r.length<=1||n(r.filter((l,g)=>g!==x))};return e.jsxs("div",{className:"flex flex-col gap-3",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"שורות"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:m,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף שורה"]})]}),r.map((x,l)=>e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-2",children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מאפיין (עמודה ראשונה)"}),e.jsx(j,{value:x.feature,onChange:g=>t(l,"feature",g.target.value),dir:"rtl",className:"text-right"})]}),Array.from({length:s},(g,u)=>e.jsxs("div",{className:d,children:[e.jsxs(i,{children:["ערך עמודה ",u+1]}),e.jsx(j,{value:String(x.values[u]??""),onChange:b=>o(l,u,b.target.value),dir:"rtl",className:"text-right"})]},u)),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-destructive",onClick:()=>h(l),children:"הסר שורה"})]},l))]})}function pa(r,s){return Array.from({length:s},(n,t)=>String((r==null?void 0:r[t])??""))}function ba({p:r,onPatch:s}){const n=String(r.ctaMode??"link");return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"סוג פעולה"}),e.jsxs(S,{value:n,onValueChange:t=>s({ctaMode:t}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"link",children:"קישור (רכישה / דיל)"}),e.jsx(c,{value:"whatsapp",children:"וואטסאפ"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט הכפתור"}),e.jsx(j,{value:String(r.label??""),onChange:t=>s({label:t.target.value}),dir:"rtl",className:"text-right"})]}),n==="link"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קישור (URL)"}),e.jsx(j,{value:String(r.href??""),onChange:t=>s({href:t.target.value}),dir:"ltr",className:"text-left"})]}):e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מספר וואטסאפ (בינלאומי, ספרות)"}),e.jsx(j,{value:String(r.phone??""),onChange:t=>s({phone:t.target.value}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"שורת משנה מעל הכפתור (אופציונלי)"}),e.jsx(j,{value:String(r.caption??""),onChange:t=>s({caption:t.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"sticky-desktop",className:"flex-1 cursor-pointer text-right font-normal",children:"הצג גם בדסקטופ (ברירת מחדל: מובייל בלבד)"}
36),e.jsx(W,{id:"sticky-desktop",checked:!!r.showOnDesktop,onCheckedChange:t=>s({showOnDesktop:!!t})})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח תחתון בדף (px) — מונע שהתוכן יוסתר מתחת לשורה"}),e.jsx(j,{type:"number",min:48,max:160,value:Number(r.bottomReservePx??88),onChange:t=>s({bottomReservePx:Number(t.target.value)||88}),dir:"ltr",className:"text-left"})]})]})}function fa({p:r,onPatch:s}){return e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"שורת הבר התחתונה"}),e.jsx(p,{label:"רקע",value:String(r.barBackgroundColor??""),onChange:n=>s({barBackgroundColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גרדיאנט רקע (אופציונלי, CSS)"}),e.jsx(j,{value:String(r.barGradient??""),onChange:n=>s({barGradient:n.target.value}),dir:"ltr",className:"font-mono text-xs",placeholder:"linear-gradient(...)"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי קו עליון"}),e.jsx(j,{type:"number",min:0,max:8,value:Number(r.barBorderTopWidth??1),onChange:n=>s({barBorderTopWidth:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע קו עליון",value:String(r.barBorderColor??""),onChange:n=>s({barBorderColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אנכי (px)"}),e.jsx(j,{type:"number",min:4,max:32,value:Number(r.barPaddingY??10),onChange:n=>s({barPaddingY:Number(n.target.value)||10}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב מקסימלי לתוכן"}),e.jsxs(S,{value:String(r.innerMaxWidth??"lg"),onValueChange:n=>s({innerMaxWidth:n}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"sm",children:"צר"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"רחב"}),e.jsx(c,{value:"xl",children:"רחב מאוד"}),e.jsx(c,{value:"full",children:"מלא"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל"}),e.jsxs(S,{value:String(r.barShadow??"md"),onValueChange:n=>s({barShadow:n}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קל"}),e.jsx(c,{value:"md",children:"בינוני"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"sticky-blur",className:"flex-1 cursor-pointer text-right font-normal",children:"טשטוש רקע (זכוכית)"}),e.jsx(W,{id:"sticky-blur",checked:r.barBackdropBlur!==!1,onCheckedChange:n=>s({barBackdropBlur:!!n})})]}),e.jsx(A,{children:"שורת משנה"}),e.jsx(p,{label:"צבע",value:String(r.captionColor??""),onChange:n=>s({captionColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:10,max:18,value:Number(r.captionFontSize??12),onChange:n=>s({captionFontSize:Number(n.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"כפתור"}),e.jsx(p,{label:"רקע כפתור",value:String(r.buttonBackgroundColor??""),onChange:n=>s({buttonBackgroundColor:n})}),e.jsx(p,{label:"צבע טקסט",value:String(r.buttonTextColor??""),onChange:n=>s({buttonTextColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:48,value:Number(r.buttonBorderRadius??12),onChange:n=>s({buttonBorderRadius:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:12,max:22,value:Number(r.buttonFontSize??15),onChange:n=>s({buttonFontSize:Number(n.target.value)||15}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"משקל גופן"}),e.jsxs(S,{value:String(r.buttonFontWeight??"semibold"),onValueChange:n=>s({buttonFontWeight:n}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"normal",children:"רגיל"}),e.jsx(c,{value:"medium",children:"בינוני"}),e.jsx(c,{value:"semibold",children:"חצי־מודגש"}),e.jsx(c,{value:"bold",children:"מודגש"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אנכי כפתור (px)"}),e.jsx(j,{type:"number",min:6,max:24,value:Number(r.buttonPaddingY??12),onChange:n=>s({buttonPaddingY:Number(n.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אופקי כפתור (px)"}),e.jsx(j,{type:"number",min:8,max:40,value:Number(r.buttonPaddingX??20),onChange:n=>s({buttonPaddingX:Number(n.target.value)||20}),dir:"ltr",className:"text-left"})]})]})}function Ca({p:r,onPatch:s}){const n=r.items??[];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת הסקשן"}),e.jsx(j,{value:String(r.sectionTitle??""),onChange:t=>s({sectionTitle:t.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תת־כותרת (אופציונלי)"}),e.jsx(j,{value:String(r.sectionSubtitle??""),onChange:t=>s({sectionSubtitle:t.target.value}),dir:"rtl",className:"text-right"})]}),e.jsx(ja,{items:n,onChange:t=>s({items:t})})]})}function Na({p:r,onPatch:s}){return e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"פריסה"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מבנה"}),e.jsxs(S,{value:String(r.layout??"grid"),onValueChange:n=>s({layout:n}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"grid",children:"רשת"}),e.jsx(c,{value:"row",children:"שורה (גלישה)"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (במסכים רחבים, מצב רשת)"}),e.jsxs(S,{value:String(r.columnsDesktop??2),onValueChange:n=>s({columnsDesktop:Number(n)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"}),e.jsx(c,{value:"4",children:"4"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח בין פריטים (px)"}),e.jsx(j,{type:"number",min:4,max:40,value:Number(r.gap??14),onChange:n=>
36s({gap:Number(n.target.value)||14}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור כותרת הסקשן"}),e.jsxs(S,{value:String(r.sectionTitleAlign??"center"),onValueChange:n=>s({sectionTitleAlign:n}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"start",children:"ימין"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"end",children:"שמאל"})]})]})]}),e.jsx(A,{children:"כותרות הסקשן"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל כותרת (px)"}),e.jsx(j,{type:"number",min:14,max:36,value:Number(r.sectionTitleFontSize??20),onChange:n=>s({sectionTitleFontSize:Number(n.target.value)||20}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע כותרת",value:String(r.sectionTitleColor??""),onChange:n=>s({sectionTitleColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל תת־כותרת (px)"}),e.jsx(j,{type:"number",min:11,max:18,value:Number(r.sectionSubtitleFontSize??13),onChange:n=>s({sectionSubtitleFontSize:Number(n.target.value)||13}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע תת־כותרת",value:String(r.sectionSubtitleColor??""),onChange:n=>s({sectionSubtitleColor:n})}),e.jsx(A,{children:"אייקונים"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל (px)"}),e.jsx(j,{type:"number",min:18,max:48,value:Number(r.iconSize??28),onChange:n=>s({iconSize:Number(n.target.value)||28}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע אייקון",value:String(r.iconColor??""),onChange:n=>s({iconColor:n})}),e.jsx(p,{label:"רקע מאחורי אייקון",value:String(r.iconBackgroundColor??""),onChange:n=>s({iconBackgroundColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול רקע אייקון (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(r.iconBorderRadius??12),onChange:n=>s({iconBorderRadius:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"כרטיסיות פריט"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"usp-card",className:"flex-1 cursor-pointer text-right font-normal",children:"מסגרת כרטיס לכל פריט"}),e.jsx(W,{id:"usp-card",checked:r.cardStyle!==!1,onCheckedChange:n=>s({cardStyle:!!n})})]}
36),e.jsx(p,{label:"רקע פריט",value:String(r.itemBackgroundColor??""),onChange:n=>s({itemBackgroundColor:n})}),e.jsx(p,{label:"צבע מסגרת",value:String(r.itemBorderColor??""),onChange:n=>s({itemBorderColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת"}),e.jsx(j,{type:"number",min:0,max:4,value:Number(r.itemBorderWidth??1),onChange:n=>s({itemBorderWidth:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(r.itemBorderRadius??14),onChange:n=>s({itemBorderRadius:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח פנימי (px)"}),e.jsx(j,{type:"number",min:8,max:32,value:Number(r.itemPadding??14),onChange:n=>s({itemPadding:Number(n.target.value)||14}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"טקסט בפריט"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל כותרת פריט (px)"}),e.jsx(j,{type:"number",min:12,max:22,value:Number(r.itemTitleFontSize??15),onChange:n=>s({itemTitleFontSize:Number(n.target.value)||15}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע כותרת פריט",value:String(r.itemTitleColor??""),onChange:n=>s({itemTitleColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל תיאור (px)"}),e.jsx(j,{type:"number",min:11,max:18,value:Number(r.itemTextFontSize??13),onChange:n=>s({itemTextFontSize:Number(n.target.value)||13}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע תיאור",value:String(r.itemTextColor??""),onChange:n=>s({itemTextColor:n})})]})}function ya({p:r,onPatch:s}){const n=r.columnLabels??["אצלנו","במוצרים דומים"],t=n.length>=3?3:2,o=Array.from({length:t},(l,g)=>String(n[g]??["אצלנו","במוצרים דומים","עמודה 3"][g]??"")),m=r.rows??[],h=l=>{const g=r.columnLabels??[],u=l===2?[String(g[0]??"אצלנו"),String(g[1]??"במוצרים דומים")]:[String(g[0]??"אצלנו"),String(g[1]??"עמודה 2"),String(g[2]??"עמודה 3")];s({columnLabels:u,rows:ga(m,l)})},x=(l,g)=>{const u=o.map((b,f)=>f===l?g:b);s({columnLabels:u})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת מעל הטבלה"}),e.jsx(j,{value:String(r.title??""),onChange:l=>s({title:l.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת עמודת המאפיינים"}),e.jsx(j,{value:String(r.featureColumnTitle??""),onChange:l=>s({featureColumnTitle:l.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מספר עמודות ערכים"}),e.jsxs(S,{value:String(t),onValueChange:l=>h(Number(l)),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2 (אנחנו + אחד)"}),e.jsx(c,{value:"3",children:"3 (אנחנו + שניים)"})]})]})]}),o.slice(0,t).map((l,g)=>e.jsxs("div",{className:d,children:[e.jsxs(i,{children:["כותרת עמודה ",g+1]}),e.jsx(j,{value:l,onChange:u=>x(g,u.target.value),dir:"rtl",className:"text-right"})]},g)),e.jsx(va,{rows:m,colCount:t,onChange:l=>s({rows:l})})]})}function ka({p:r,onPatch:s}){const t=(r.columnLabels??[]).length>=3?3:2;return e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"כותרת מעל הטבלה"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:14,max:32,value:Number(r.titleFontSize??18),onChange:o=>s({titleFontSize:Number(o.target.value)||18}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע",value:String(r.titleColor??""),onChange:o=>s({titleColor:o})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור"}),e.jsxs(S,{value:String(r.titleAlign??"center"),onValueChange:o=>s({titleAlign:o}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"start",children:"ימין"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"end",children:"שמאל"})]})]})]}),e.jsx(A,{children:"מסגרת וטבלה"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(r.tableBorderRadius??14),onChange:o=>s({tableBorderRadius:Number(o.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת"}),e.jsx(j,{type:"number",min:0,max:4,value:Number(r.tableBorderWidth??1),onChange:o=>s({tableBorderWidth:Number(o.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע מסגרת",value:String(r.tableBorderColor??""),onChange:o=>s({tableBorderColor:o})}),e.jsx(p,{label:"רקע טבלה",value:String(r.tableBackgroun
36dColor??""),onChange:o=>s({tableBackgroundColor:o})}),e.jsx(A,{children:"שורת כותרות"}),e.jsx(p,{label:"רקע",value:String(r.headerBackgroundColor??""),onChange:o=>s({headerBackgroundColor:o})}),e.jsx(p,{label:"צבע טקסט",value:String(r.headerTextColor??""),onChange:o=>s({headerTextColor:o})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:11,max:16,value:Number(r.headerFontSize??13),onChange:o=>s({headerFontSize:Number(o.target.value)||13}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"תאים"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אופקי (px)"}),e.jsx(j,{type:"number",min:6,max:24,value:Number(r.cellPaddingX??12),onChange:o=>s({cellPaddingX:Number(o.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אנכי (px)"}),e.jsx(j,{type:"number",min:6,max:20,value:Number(r.cellPaddingY??10),onChange:o=>s({cellPaddingY:Number(o.target.value)||10}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל טקסט גוף (px)"}),e.jsx(j,{type:"number",min:11,max:16,value:Number(r.bodyFontSize??13),onChange:o=>s({bodyFontSize:Number(o.target.value)||13}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע טקסט גוף",value:String(r.bodyTextColor??""),onChange:o=>s({bodyTextColor:o})}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"cmp-zebra",className:"flex-1 cursor-pointer text-right font-normal",children:"שורות מתחלפות (זברה)"}),e.jsx(W,{id:"cmp-zebra",checked:r.zebraRows!==!1,onCheckedChange:o=>s({zebraRows:!!o})})]}),e.jsx(p,{label:"רקע שורות זברה",value:String(r.zebraBackgroundColor??""),onChange:o=>s({zebraBackgroundColor:o})}),e.jsx(A,{children:"הדגשת עמודה"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"איזו עמודת ערכים להדגיש (0 = ראשונה)"}),e.jsxs(S,{value:String(Math.min(t-1,Math.max(0,Number(r.highlightColumnIndex??0)))),onValueChange:o=>s({highlightColumnIndex:Number(o)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsx(_,{children:Array.from({length:t},(o,m)=>e.jsxs(c,{value:String(m),children:["עמודה ",m+1]},m))})]})]}),e.jsx(p,{label:"רקע הדגשה",value:String(r.highlightBackgroun
36dColor??""),onChange:o=>s({highlightBackgroundColor:o})})]})}function Sa({p:r,onPatch:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:'תווית מעל (למשל "קוד קופון") — ריק מסתיר'}),e.jsx(j,{value:String(r.badgeText??""),onChange:n=>s({badgeText:n.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הנחיה לגולש"}),e.jsx(ne,{value:String(r.helperText??""),onChange:n=>s({helperText:n.target.value}),rows:3,dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קוד הקופון"}),e.jsx(j,{value:String(r.code??""),onChange:n=>s({code:n.target.value}),dir:"ltr",className:"text-left font-mono"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כפתור העתקה"}),e.jsx(j,{value:String(r.copyButtonLabel??""),onChange:n=>s({copyButtonLabel:n.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הודעה אחרי העתקה"}),e.jsx(j,{value:String(r.copiedFeedback??""),onChange:n=>s({copiedFeedback:n.target.value}),dir:"rtl",className:"text-right"})]})]})}function Ba({p:r,onPatch:s}){return e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"מיכל"}),e.jsx(p,{label:"רקע",value:String(r.containerBackgroundColor??""),onChange:n=>s({containerBackgroundColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גרדיאנט (אופציונלי, CSS)"}),e.jsx(j,{value:String(r.containerGradient??""),onChange:n=>s({containerGradient:n.target.value}),dir:"ltr",className:"font-mono text-xs"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:28,value:Number(r.containerBorderRadius??16),onChange:n=>s({containerBorderRadius:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת"}),e.jsx(j,{type:"number",min:0,max:4,value:Number(r.containerBorderWidth??1),onChange:n=>s({containerBorderWidth:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע מסגרת",value:String(r.containerBorderColor??""),onChange:n=>s({containerBorderColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח פנימי (px)"}),e.jsx(j,{type:"number",min:8,max:40,value:Number(r.containerPadding??18),onChange:n=>s({containerPadding:Number(n.target.value)||18}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח בין אלמנטים (px)"}),e.jsx(j,{type:"number",min:4,max:24,value:Number(r.stackGap??12),onChange:n=>s({stackGap:Number(n.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:'תווית "קופון"'}
36),e.jsx(p,{label:"רקע",value:String(r.badgeBackgroundColor??""),onChange:n=>s({badgeBackgroundColor:n})}),e.jsx(p,{label:"צבע טקסט",value:String(r.badgeTextColor??""),onChange:n=>s({badgeTextColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:10,max:14,value:Number(r.badgeFontSize??11),onChange:n=>s({badgeFontSize:Number(n.target.value)||11}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"הנחיה"}),e.jsx(p,{label:"צבע",value:String(r.helperTextColor??""),onChange:n=>s({helperTextColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:11,max:18,value:Number(r.helperTextFontSize??13),onChange:n=>s({helperTextFontSize:Number(n.target.value)||13}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"תצוגת הקוד"}),e.jsx(p,{label:"רקע",value:String(r.codeBackgroundColor??""),onChange:n=>s({codeBackgroundColor:n})}),e.jsx(p,{label:"צבע טקסט",value:String(r.codeTextColor??""),onChange:n=>s({codeTextColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:14,max:28,value:Number(r.codeFontSize??20),onChange:n=>s({codeFontSize:Number(n.target.value)||20}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:16,value:Number(r.codeBorderRadius??10),onChange:n=>s({codeBorderRadius:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מרווח אותיות"}),e.jsx(j,{type:"number",min:0,max:8,value:Number(r.codeLetterSpacing??2),onChange:n=>s({codeLetterSpacing:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"כפתור העתקה"}),e.jsx(p,{label:"רקע",value:String(r.copyButtonBackgroundColor??""),onChange:n=>s({copyButtonBackgroundColor:n})}),e.jsx(p,{label:"צבע טקסט",value:String(r.copyButtonTextColor??""),onChange:n=>s({copyButtonTextColor:n})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:20,value:Number(r.copyButtonBorderRadius??10),onChange:n=>s({copyButtonBorderRadius:Number(n.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:12,max:18,value:Number(r.copyButtonFontSize??14),onChange:n=>s({copyButtonFontSize:Number(n.target.value)||14}),dir:"ltr",className:"text-left"})]})]})}const wa=[{id:"whatsapp",label:"וואטסאפ",platforms:["whatsapp"],icon:ys},{id:"telegram",label:"טלגרם",platforms:["telegram"],icon:ks},{id:"facebook",label:"פייסבוק",platforms:["facebook"],icon:Ss},{id:"instagram",label:"אינסטגרם",platforms:["instagram"],icon:Bs}];function Dr(r){return String(r??"").trim().toLowerCase()}function _a(r){const s=Dr(r);return s==="telegram"?ks:s==="facebook"?Ss:s==="instagram"?Bs:s==="whatsapp"?ys:Gs}function Fa(r){const n=[...r.filter(o=>o.is_active)],t=[];for(const o of wa){const m=n.filter(h=>o.platforms.includes(Dr(h.platform)));if(m.length!==0){t.push({label:o.label,icon:o.icon,items:m});for(const h of m){const x=n.findIndex(l=>l.id===h.id);x>=0&&n.splice(x,1)}}}return n.length>0&&t.push({label:"אחר",icon:Gs,items:n}),t}const Vr="__none__",el="pcatalog";function Ta(r){if(String(r.feed_source??"").trim().toLowerCase()==="personal_catalog")return el;const s=String(r.messaging_group_id??"").trim();if(s)return`g:${s}`;const n=String(r.legacy_landing_page_id??"").trim();return n?`l:${n}`:Vr}function Ia(r,s){if(!s||s===Vr){r({feed_source:"messaging",messaging_group_id:"",legacy_landing_page_id:void 0,telegram_topic_id:""});return}if(s===el){r({feed_source:"personal_catalog",messaging_group_id:"",legacy_landing_page_id:void 0,telegram_topic_id:""});return}if(s.startsWith("g:")){r({feed_source:"messaging",messaging_group_id:s.slice(2),legacy_landing_page_id:void 0,telegram_topic_id:""});return}s.startsWith("l:")&&r({feed_source:"messaging",legacy_landing_page_id:s.slice(2),messaging_group_id:"",telegram_topic_id:""})}function La(r){const s=[],n=(t,o)=>{var m;for(const h of t)s.push({id:h.id,name:h.name,level:o}),(m=h.children)!=null&&m.length&&n(h.children,o+1)};return n(r,0),s}const wr="__none__";function js({selectedIds:r,onPatch:s}){const{categoryTree:n,isLoading:t}=kt(!1),o=F.useMemo(()=>La(n),[n]),m=r.length===1||r.length>1?r[0]:wr,h=x=>
36{if(x===wr){s({personal_catalog_category_ids:[]});return}s({personal_catalog_category_ids:[x]})};return e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קטגוריה בקטלוג האישי"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"בחרו קטגוריה אחת — יוצגו רק מוצרים ששויכו אליה (כולל תתי־קטגוריה). ללא בחירה — כל המוצרים עם תמונה."}),r.length>1?e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-500",children:"נשמרו כמה קטגוריות ישנות — בחרו שוב קטגוריה אחת כדי לתקן."}):null,e.jsx(ur,{className:"h-52 rounded-md border border-border/60 p-2",children:t?e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(Ye,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):o.length===0?e.jsx("p",{className:"py-3 text-center text-xs text-muted-foreground",children:"אין קטגוריות בקטלוג האישי — ניתן ליצור קטגוריות בעת עריכת מוצר בקטלוג האישי."}):e.jsxs(ws,{className:"space-y-1 pr-1",value:m,onValueChange:h,children:[e.jsxs("label",{className:"flex cursor-pointer flex-row-reverse items-center gap-2 rounded-md py-1 text-sm",children:[e.jsx(ir,{value:wr}),e.jsx("span",{className:"text-right leading-snug text-muted-foreground",children:"ללא סינון (כל הקטלוג)"})]}),o.map(x=>e.jsxs("label",{className:"flex cursor-pointer flex-row-reverse items-center gap-2 rounded-md py-1 text-sm",style:{paddingRight:x.level*12},children:[e.jsx(ir,{value:x.id}),e.jsx("span",{className:"text-right leading-snug",children:x.name})]},x.id))]})})]})}const Ea=[{key:"pc_show_image",label:"תצוגת תמונה"},{key:"pc_show_image_badge",label:"תג מספר תמונות"},{key:"pc_show_gallery",label:"גלריית תמונות"},{key:"pc_show_text",label:"טקסט המוצר"},{key:"pc_show_price",label:"מחיר המוצר"},{key:"pc_show_purchase_link",label:"לינק רכישה"},{key:"pc_show_purchase_button",label:"כפתור רכישה"}];function Ma({p:r,onPatch:s,blockId:n}){const t=Jl(Hs.parse(r));return e.jsxs("div",{className:d,children:[e.jsx(A,{children:"שדות להצגה"}),e.jsx("div",{className:"space-y-2",children:Ea.map(({key:o,label:m})=>e.jsxs("div",{className:"flex flex-row-reverse items-center gap-2",dir:"rtl",children:[e.jsx(W,{id:`${o}-${n}`,checked:t[o],onCheckedChange:h=>s({[o]:h===!0})}),e.jsx(i,{htmlFor:`${o}-${n}`,className:"flex-1 cursor-pointer font-normal text-right",children:m})]},o))})]})}function vs({p:r,onPatch:s,groupedActiveMessagingGroups:n,messagingGroups:t,legacyLandingPages:o,editorScheduledPreviewBlockId:m,widgetKind:h}){const x=h==="messagesFeed"||h==="messagesSearch",l=String(r.feed_source??"").trim().toLowerCase(),g=x&&(l==="personal_catalog"||l==="personal"),u=h==="messagesSearch"||h==="messagesFeed"&&!g,b=String(r.messaging_group_id??"").trim(),f=String(r.legacy_landing_page_id??"").trim(),a=!!(b||f),N=t.find(I=>I.id===b),k=N==null?void 0:N.telegram_topics,M=n.length>0,D=!!(o&&o.length>0),y=Ta(r);return e.jsxs(e.Fragment,{children:[x?e.jsxs("div",{className:d,children:[e.jsx(i,{className:"text-right",children:"מקור התוכן"}),e.jsxs(ws,{className:"flex flex-col gap-3 rounded-md border border-border/60 bg-muted/20 p-3",value:g?"personal":"schedule",onValueChange:I=>{const V=String(r.placeholder??"").trim();if(I==="personal"){const C={feed_source:"personal_catalog",messaging_group_id:"",legacy_landing_page_id:void 0,telegram_topic_id:""};h==="messagesSearch"&&(!V||V===ns)&&(C.placeholder=is),s(C)}else{const C={feed_source:"messaging",personal_catalog_category_ids:[]};h==="messagesSearch"&&(!V||V===is)&&(C.placeholder=ns),s(C)}},children:[e.jsxs("div",{className:"flex flex-row-reverse items-start gap-3",children:[e.jsx(ir,{value:"schedule",id:"feed-src-schedule",className:"mt-0.5"}),e.jsxs(i,{htmlFor:"feed-src-schedule",className:"cursor-pointer text-right text-sm font-normal leading-snug",children:[e.jsx("span",{className:"font-medium text-foreground",children:"מתזמון"}),e.jsx("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:"קבוצות מסרים (וואטסאפ, טלגרם וכו×
36³) או דף נחיתה קלאסי מהתזמון — ייבחרו ברשימה למטה"})]})]}),e.jsxs("div",{className:"flex flex-row-reverse items-start gap-3",children:[e.jsx(ir,{value:"personal",id:"feed-src-personal",className:"mt-0.5"}),e.jsxs(i,{htmlFor:"feed-src-personal",className:"cursor-pointer text-right text-sm font-normal leading-snug",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-medium text-foreground",children:[e.jsx(_l,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":!0}),"קטלוג אישי"]}),e.jsx("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:"מוצרים מוסתרים מהחשבון שלך (כמו בקטלוג האישי). אפשר לסנן לפי קטגוריות אחרי הבחירה"})]})]})]})]}):null,u?e.jsxs("div",{className:d,children:[e.jsx(i,{children:h==="messagesFeed"?"ערוץ או דף נחיתה מתזמון":"מקור ההודעות"}),e.jsxs(S,{value:y,onValueChange:I=>Ia(s,I),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"בחרו מקור"})}),e.jsxs(_,{children:[e.jsx(c,{value:Vr,children:"לא נבחר"}),M||D?e.jsx(pr,{}):null,M?n.map((I,V)=>e.jsxs(qr,{children:[V>0?e.jsx(pr,{}):null,e.jsx(Qr,{className:"text-right",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(I.icon,{className:"h-3.5 w-3.5 text-muted-foreground"}),I.label]})}),I.items.map(C=>e.jsx(c,{value:`g:${C.id}`,children:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[(()=>{const O=_a(C.platform);return e.jsx(O,{className:"h-3.5 w-3.5 text-muted-foreground"})})(),C.group_name]})},`g:${C.id}`))]},I.label)):null,D?e.jsxs(qr,{children:[M?e.jsx(pr,{}):null,e.jsx(Qr,{className:"text-right",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Fl,{className:"h-3.5 w-3.5 text-muted-foreground"}),"דפי נחיתה (מתזמון)"]})}),(o??[]).map(I=>e.jsxs(c,{value:`l:${I.id}`,children:[I.title,e.jsxs("span",{className:"text-muted-foreground",children:[" · ",I.slug]})]},`l:${I.id}`))]}):null]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h==="messagesFeed"?"בחרו קבוצת מסרים או דף נחיתה קלאסי שממנו פורסמו מוצרים.":"קבוצת מסרים או דף נחיתה קלאסי שממנו פורסמו מוצרים בתזמון."})]}):null,u&&Dr(N==null?void 0:N.platform)==="telegram"&&k&&k.length>0?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"נושא טלגרם"}),e.jsxs(S,{value:r.telegram_topic_id?String(r.telegram_topic_id):"all",onValueChange:I=>s({telegram_topic_id:I==="all"?void 0:I}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"כל הנושאים"})}),e.jsxs(_,{children:[e.jsx(c,{value:"all",children:"כל הנושאים"}),k.map(I=>
36e.jsx(c,{value:I.id,children:I.name??I.id},I.id))]})]})]}):null,m&&u&&a?e.jsxs("div",{className:R(d,"mt-2"),children:[e.jsxs("div",{className:"flex flex-row-reverse items-center justify-between gap-3 rounded-md border border-border/60 px-3 py-2.5",children:[e.jsx(ft,{id:`feed-editor-sched-${m}`,checked:!!r.editor_include_scheduled,onCheckedChange:I=>s({editor_include_scheduled:I})}),e.jsx(i,{htmlFor:`feed-editor-sched-${m}`,className:"cursor-pointer text-right text-sm font-normal leading-snug",children:"משוך גם מוצרים בתזמון (בתור)"})]}),e.jsx("p",{className:"text-right text-xs leading-snug text-muted-foreground",children:"בתצוגת העורך בלבד — אחרי מסרים מהמקור שנבחר (נשלחו או פורסמו). הדף החי לגולשים לא משתנה."})]}):null]})}function Ra({block:r,messagingGroups:s,legacyLandingPages:n,onPatch:t,onDuplicate:o,onDelete:m,embedded:h=!1,pageId:x}){var b,f;if(!r)return e.jsx("div",{dir:"rtl",className:R("flex flex-1 items-center justify-center p-4 text-center text-sm text-muted-foreground",!h&&"rounded-xl border border-border bg-card"),children:"לחץ על בלוק בקנבס כדי לערוך תוכן ועיצוב"});const l=r.props,g=((b=Ee(r.type))==null?void 0:b.label)??r.type,u=Fa(s);return e.jsxs("div",{dir:"rtl",className:R("flex min-h-0 min-w-0 w-full flex-1 flex-col text-right",h?"bg-transparent":"h-full rounded-lg border border-border/60 bg-card/80"),children:[e.jsx("div",{className:R("shrink-0 border-b border-border/70 px-3 py-2",h?"sticky top-0 z-10 border-border/60 bg-muted/35 backdrop-blur-sm":"bg-background"),children:e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-1.5",children:[e.jsx("div",{className:"min-w-0 flex-1 text-right",children:e.jsx("span",{className:"text-sm font-medium text-foreground",children:((f=Ee(r.type))==null?void 0:f.label)??r.type})}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:o,children:[e.jsx(wl,{className:"h-3 w-3"}),"שכפול"]}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 px-2 text-xs text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:m,children:[e.jsx(Rr,{className:"h-3 w-3"}),"מחק"]})]})}),e.jsx(ur,{className:R("min-h-0 flex-1",h?"h-full min-h-0":"min-h-[200px]"),children:e.jsxs("div",{className:Ds,children:[r.type==="heading"&&e.jsx(X,{widgetLabel:g,content:e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט"}),e.jsx(j,{value:String(l.text??""),onChange:a=>t({text:a.target.value}),dir:"rtl",className:"text-right"})]}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רמת כותרת"}),e.jsxs(S,{value:String(l.level??"h2"),onValueChange:a=>t({level:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"h1",children:"H1"}),e.jsx(c,{value:"h2",children:"H2"}),e.jsx(c,{value:"h3",children:"H3"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור"}),e.jsxs(S,{value:String(l.align??"center"),onValueChange:a=>t({align:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"ימין"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"left",children:"שמאל"})]})]})]}),e.jsx(p,{label:"צבע טקסט",value:String(l.color??""),onChange:a=>t({color:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:12,max:72,value:Number(l.fontSize??28),onChange:a=>t({fontSize:Number(a.target.value)||28}),dir:"ltr",className:"text-left"})]})]}),p:l,onPatch:t}),r.type==="text"&&e.jsx(X,{widgetLabel:g,content:e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט"}),e.jsx(ma,{value:String(l.content??""),onChange:a=>t({content:a})})]}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור"}),e.jsxs(S,{value:String(l.align??"right"),onValueChange:a=>t({align:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"ימין"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"left",children:"שמאל"})]})]})]}),e.jsx(p,{label:"צבע",value:String(l.color??""),onChange:a=>t({color:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל גופן (px)"}),e.jsx(j,{type:"number",min:12,max:32,value:Number(l.fontSize??16),onChange:a=>t({fontSize:Number(a.target.value)||16}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח תחתון (px)"}),e.jsx(j,{type:"number",min:0,max:64,value:Number(l.marginBottom??16),onChange:a=>t({marginBottom:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]})]}),p:l,onPatch:t}),r.type==="image"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsx(we,{label:"תמונה",value:String(l.src??""),onChange:a=>t({src:a.trim()||as})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט חלופי (alt)"}),e.jsx(j,{value:String(l.alt??""),onChange:a=>t({alt:a.target.value}),dir:"rtl",className:"text-right"})]})]}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב מקסימלי"}),e.jsxs(S,{value:String(l.maxWidth??"lg"),onValueChange:a=>t({maxWidth:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"full",children:"מלא"}),e.jsx(c,{value:"lg",children:"גדול"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"sm",children:"קטן"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:48,value:Number(l.borderRadius??8),onChange:a=>t({borderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"התאמת תמונה"}),e.jsxs(S,{value:String(l.objectFit??"cover"),onValueChange:a=>t({objectFit:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"cover",children:"כיסוי"}),e.jsx(c,{value:"contain",children:"הכלה"})]})]})]})]}),p:l,onPatch:t}),r.type==="imageCtaCard"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsx(we,{label:"תמונה",value:String(l.imageUrl??""),onChange:a=>t({imageUrl:a.trim()||as})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט חלופי (alt)"}),e.jsx(j,{value:String(l.imageAlt??""),onChange:a=>t({imageAlt:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת"}),e.jsx(j,{value:String(l.title??""),onChange:a=>t({title:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תיאור"}),e.jsx(ne,{value:String(l.description??""),onChange:a=>t({description:a.target.value}),className:"min-h-[88px] text-right",dir:"rtl"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כפתור"}),e.jsx(j,{value:String(l.buttonLabel??""),onChange:a=>t({buttonLabel:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קישור כפתור"}),e.jsx(j,{value:String(l.buttonHref??""),onChange:a=>t({buttonHref:a.target.value}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"img-cta-newtab",className:"flex-1 cursor-pointer font-normal text-right",children:"פתיחה בלשונית חדשה"}),e.jsx(W,{id:"img-cta-newtab",checked:!!l.openInNewTab,onCheckedChange:a=>t({openInNewTab:!!a})})]})]}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב מקסימלי"}),e.jsxs(S,{value:String(l.maxWidth??"lg"),onValueChange:a=>t({maxWidth:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"full",children:"מלא"}),e.jsx(c,{value:"xl",children:"XL"}),e.jsx(c,{value:"lg",children:"גדול"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"sm",children:"קטן"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גובה תמונה (px)"}),e.jsx(j,{type:"number",min:140,max:720,value:Number(l.imageHeight??280),onChange:a=>t({imageHeight:Number(a.target.value)||280}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"התאמת תמונה"}),e.jsxs(S,{value:String(l.imageFit??"cover"),onValueChange:a=>t({imageFit:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"cover",children:"כיסוי"}),e.jsx(c,{value:"contain",children:"הכלה"})]})]})]}),e.jsx(p,{label:"רקע כרטיס",value:String(l.cardBackgroun
36dColor??""),onChange:a=>t({cardBackgroundColor:a}),emptyFallback:"hsl(var(--card))"}),e.jsx(p,{label:"צבע טקסט",value:String(l.cardTextColor??""),onChange:a=>t({cardTextColor:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsx(p,{label:"צבע מסגרת כרטיס",value:String(l.cardBorderColor??""),onChange:a=>t({cardBorderColor:a}),emptyFallback:"hsl(var(--border))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת (px)"}),e.jsx(j,{type:"number",min:0,max:8,value:Number(l.cardBorderWidth??1),onChange:a=>t({cardBorderWidth:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות כרטיס (px)"}),e.jsx(j,{type:"number",min:0,max:40,value:Number(l.cardBorderRadius??16),onChange:a=>t({cardBorderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל כרטיס"}),e.jsxs(S,{value:String(l.cardShadow??"sm"),onValueChange:a=>t({cardS
36hadow:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קל"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"חזק"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח פנימי (px)"}),e.jsx(j,{type:"number",min:8,max:36,value:Number(l.contentPadding??16),onChange:a=>t({contentPadding:Number(a.target.value)||16}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מרווח בין אלמנטים (px)"}),e.jsx(j,{type:"number",min:0,max:32,value:Number(l.contentGap??10),onChange:a=>t({contentGap:Number(a.target.value)||10}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"רקע כפתור",value:String(l.buttonBackgroundColor??""),onChange:a=>t({buttonBackgroundColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"צבע טקסט כפתור",value:String(l.buttonTextColor??""),onChange:a=>t({buttonTextColor:a}),emptyFallback:"hsl(var(--primary-foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול פינות כפתור (px)"}),e.jsx(j,{type:"number",min:0,max:40,value:Number(l.buttonBorderRadius??12),onChange:a=>t({buttonBorderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"img-cta-full-btn",className:"flex-1 cursor-pointer font-normal text-right",children:"כפתור ברוחב מלא"}),e.jsx(W,{id:"img-cta-full-btn",checked:!!l.buttonFullWidth,onCheckedChange:a=>t({buttonFullWidth:!!a})})]})]}),p:l,onPatch:t}),r.type==="gallery"&&e.jsx(X,{widgetLabel:g,content:e.jsx(ps,{variant:"content",blockId:r.id,p:l,onPatch:t}),design:e.jsx(ps,{variant:"design",blockId:r.id,p:l,onPatch:t}),p:l,onPatch:t}),r.type==="aliexpressComparison"&&e.jsx(Br,{widgetType:"aliexpressComparison",blockId:r.id,pageId:x,p:l,onPatch:t}),r.type==="aliexpressDealAlert"&&e.jsx(Br,{widgetType:"aliexpressDealAlert",blockId:r.id,pageId:x,p:l,onPatch:t}),r.type==="aliexpressTrendingPicks"&&e.jsx(Br,{widgetType:"aliexpressTrendingPicks",blockId:r.id,pageId:x,p:l,onPatch:t}),r.type==="aliexpressSearch"&&e.jsx(ca,{p:l,onPatch:t}),r.type==="button"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כפתור"}),e.jsx(j,{value:String(l.label??""),onChange:a=>t({label:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קישור"}),e.jsx(j,{value:String(l.href??""),onChange:a=>t({href:a.target.value}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"btn-newtab",className:"flex-1 cursor-pointer font-normal text-right",children:"פתיחה בלשונית חדשה"}),e.jsx(W,{id:"btn-newtab",checked:!!l.openInNewTab,onCheckedChange:a=>t({openInNewTab:!!a})})]})]}),design:e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"צבע רקע",value:String(l.backgroundColor??""),onChange:a=>t({backgroundColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"צבע טקסט",value:String(l.textColor??""),onChange:a=>t({textColor:a}),emptyFallback:"hsl(var(--primary-foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:48,value:Number(l.borderRadius??8),onChange:a=>t({borderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"btn-full",className:"flex-1 cursor-pointer font-normal text-right",children:"רוחב מלא"}),e.jsx(W,{id:"btn-full",checked:!!l.fullWidth,onCheckedChange:a=>t({fullWidth:!!a})})]})]}),p:l,onPatch:t}),r.type==="section"&&e.jsx(X,{widgetLabel:g,content:null,design:e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"צבע רקע",value:String(l.backgroundColor??""),onChange:a=>t({backgroundColor:a}),allowTransparent:!0,emptyFallback:"transparent"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח עליון (px)"}),e.jsx(j,{type:"number",min:0,max:200,value:Number(l.paddingTop??24),onChange:a=>t({paddingTop:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח תחתון (px)"}),e.jsx(j,{type:"number",min:0,max:200,value:Number(l.paddingBottom??24),onChange:a=>t({paddingBottom:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב מקסימלי"}),e.jsxs(S,{value:String(l.maxWidth??"lg"),onValueChange:a=>t({maxWidth:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"sm",children:"sm"}),e.jsx(c,{value:"md",children:"md"}),e.jsx(c,{value:"lg",children:"lg"}),e.jsx(c,{value:"xl",children:"xl"}),e.jsx(c,{value:"full",children:"מלא"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור מקטע"}),e.jsxs(S,{value:String(l.align??"center"),onValueChange:a=>t({align:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"start",children:"התחלה"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"end",children:"סוף"})]})]})]})]}),designHint:"מקטע עוטף בלוקים — רקע וריווח פנימיים של המיכל.",p:l,onPatch:t}),r.type==="spacer"&&e.jsx(X,{widgetLabel:g,content:null,design:e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גובה (px)"}),e.jsx(j,{type:"number",min:4,max:400,value:Number(l.height??24),onChange:a=>t({height:Number(a.target.value)||24}),dir:"ltr",className:"text-left"})]}),p:l,onPatch:t}),r.type==="divider"&&e.jsx(X,{widgetLabel:g,content:null,design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי (px)"}),e.jsx(j,{type:"number",min:1,max:8,value:Number(l.thickness??1),onChange:a=>t({thickness:Number(a.target.value)||1}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע",value:String(l.color??""),onChange:a=>t({color:a}),emptyFallback:"hsl(var(--border))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב"}),e.jsxs(S,{value:String(l.width??"full"),onValueChange:a=>t({width:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"full",children:"מלא"}),e.jsx(c,{value:"half",children:"חצי"}),e.jsx(c,{value:"third",children:"שליש"})]})]})]})]}),p:l,onPatch:t}),r.type==="columns"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מספר עמודות"}),e.jsxs(S,{value:String(l.columnCount??2),onValueChange:a=>t({columnCount:Number(a)===3?3:2}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח בין עמודות (px)"}),e.jsx(j,{type:"number",min:0,max:64,value:Number(l.gap??16),onChange:a=>t({gap:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"תוכן בתוך עמודות נשמר בדף; עריכת בלוקים מקוננים תתווסף בגרסה עתידית."})]}),design:null,contentTitle:"מבנה עמודות",contentHint:"פריסת עמודות בלבד; מסגרת הבלוק למטה בעיצוב.",orphanChrome:!0,p:l,onPatch:t}),r.type==="announcementBar"&&e.jsx(X,{widgetLabel:g,content:e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט"}),e.jsx(j,{value:String(l.text??""),onChange:a=>t({text:a.target.value}),dir:"rtl",className:"text-right"})]}),design:e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"צבע רקע",value:String(l.backgroundColor??""),onChange:a=>t({backgroundColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"צבע טקסט",value:String(l.textColor??""),onChange:a=>t({textColor:a}),emptyFallback:"hsl(var(--primary-foreground))"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"ann-dismiss",className:"flex-1 cursor-pointer font-normal text-right",children:"ניתן לסגירה (בממשק ציבורי עתידי)"}),e.jsx(W,{id:"ann-dismiss",checked:!!l.dismissible,onCheckedChange:a=>t({dismissible:!!a})})]})]}),p:l,onPatch:t}),r.type==="navbar"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsx(we,{label:"לוגו (אופציונלי)",value:String(l.logoUrl??""),onChange:a=>t({logoUrl:a})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט חלופי ללוגו"}),e.jsx(j,{value:String(l.logoAlt??""),onChange:a=>t({logoAlt:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-show-logo",className:"flex-1 cursor-pointer font-normal text-right",children:"הצג לוגו"}),e.jsx(W,{id:"nav-show-logo",checked:l.showLogo!==!1,onCheckedChange:a=>t({showLogo:!!a})})]}),e.jsx(Xa,{items:l.items??[{label:"בית",href:"#"}],onChange:a=>t({items:a})}),e.jsx(A,{children:"דפים מחוברים (ראשי + תתי-דפים)"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-family-enable",className:"flex-1 cursor-pointer font-normal text-right",children:"הוסף אוטומטית לתפריט את משפחת הדפים של העמוד הנוכחי"}),e.jsx(W,{id:"nav-family-enable",checked:!!l.includeFamilyPages,onCheckedChange:a=>t({includeFamilyPages:!!a})})]}),l.includeFamilyPages?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-family-main",className:"flex-1 cursor-pointer font-normal text-right",children:"כלול גם את עמוד האב הראשי"}),e.jsx(W,{id:"nav-family-main",checked:l.includeMainPageLink!==!1,onCheckedChange:a=>t({includeMainPageLink:!!a})})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תצוגת דפים מחוברים"}),e.jsxs(S,{value:String(l.familyDisplayMode??"flat"),onValueChange:a=>t({familyDisplayMode:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"flat",children:"רשימה שטוחה"}),e.jsx(c,{value:"dropdown",children:"Dropdown (ראשי + תתי-דפים)"})]})]})]}),String(l.familyDisplayMode??"flat")==="dropdown"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עומק מקסימלי ל־Dropdown"}),e.jsx(j,{type:"number",min:1,max:6,value:String(Number(l.familyMaxDepth??3)),onChange:a=>t({familyMaxDepth:Math.min(6,Math.max(1,Number(a.target.value||3)))}),className:"text-right"})]}):null,e.jsxs("div",{className:d,children:[e.jsx(i,{children:"איך לשלב עם פריטי תפריט ידניים"}),e.jsxs(S,{value:String(l.familyMergeMode??"append"),onValueChange:a=>
36t({familyMergeMode:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"append",children:"הוסף בסוף"}),e.jsx(c,{value:"prepend",children:"הוסף בתחילה"}),e.jsx(c,{value:"replace",children:"החלף את כל הפריטים הידניים"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מקור טקסט לקישורי דפים מחוברים"}),e.jsxs(S,{value:String(l.familyLabelSource??"title"),onValueChange:a=>t({familyLabelSource:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"title",children:"שם העמוד"}),e.jsx(c,{value:"slug",children:"Slug"})]})]})]})]}):null]}),design:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"קונטיינר וסרגל"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב קונטיינר"}),e.jsxs(S,{value:String(l.containerMaxWidth??"full"),onValueChange:a=>t({containerMaxWidth:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"full",children:"מלא"}),e.jsx(c,{value:"xl",children:"XL"}),e.jsx(c,{value:"lg",children:"LG"}),e.jsx(c,{value:"md",children:"MD"})]})]})]}),e.jsx(p,{label:"צבע רקע",value:String(l.backgroundColor??""),onChange:a=>t({backgroundColor:a}),emptyFallback:"hsl(var(--background))"}),e.jsx(p,{label:"צבע טקסט",value:String(l.textColor??""),onChange:a=>t({textColor:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsx(p,{label:"צבע טקסט בהובר",value:String(l.linkHoverColor??""),onChange:a=>t({linkHoverColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"רקע פריט בהובר",value:String(l.itemHoverBackground??""),onChange:a=>t({itemHoverBackground:a}),emptyFallback:"hsl(var(--muted) / 0.5)"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל"}),e.jsxs(S,{value:String(l.shadow??"sm"),onValueChange:a=>t({shadow:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קטן"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"גדול"})]})]})]}),e.jsx(p,{label:"צבע מסגרת",value:String(l.borderColor??""),onChange:a=>t({borderColor:a}),emptyFallback:"hsl(var(--border))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת (px)"}),e.jsx(j,{type:"number",min:0,max:6,value:Number(l.borderWidth??1),onChange:a=>t({borderWidth:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול פינות (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(l.borderRadius??12),onChange:a=>t({borderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-bottom-border",className:"flex-1 cursor-pointer font-normal text-right",children:"הצג קו תחתון"}),e.jsx(W,{id:"nav-bottom-border",checked:l.showBottomBorder!==!1,onCheckedChange:a=>t({showBottomBorder:!!a})})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אופקי לסרגל (px)"}),e.jsx(j,{type:"number",min:0,max:40,value:Number(l.navPaddingX??12),onChange:a=>t({navPaddingX:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח אנכי לסרגל (px)"}),e.jsx(j,{type:"number",min:0,max:30,value:Number(l.navPaddingY??10),onChange:a=>t({navPaddingY:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"Desktop"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור פריטי תפריט"}),e.jsxs(S,{value:String(l.desktopJustify??"between"),onValueChange:a=>t({desktopJustify:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"between",children:"קצוות"}),e.jsx(c,{value:"start",children:"צמוד לימין"}),e.jsx(c,{value:"center",children:"מרכז"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רווח בין פריטים (px)"}),e.jsx(j,{type:"number",min:0,max:48,value:Number(l.desktopGap??16),onChange:a=>t({desktopGap:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"Mobile"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מצב תפריט במובייל"}),e.jsxs(S,{value:String(l.mobileMenuMode??"toggle"),onValueChange:a=>t({mobileMenuMode:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"toggle",children:"כפתור פתיחה"}),e.jsx(c,{value:"always",children:"תמיד פתוח"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור פריטים במובייל"}),e.jsxs(S,{value:String(l.mobileMenuAlign??"right"),onValueChange:a=>t({mobileMenuAlign:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"ימין"}),e.jsx(c,{value:"center",children:"מרכז"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-mobile-width",className:"flex-1 cursor-pointer font-normal text-right",children:"פריסה מלאה במובייל"}),e.jsx(W,{id:"nav-mobile-width",checked:l.mobileFullWidthMenu!==!1,onCheckedChange:a=>t({mobileFullWidthMenu:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-mobile-open",className:"flex-1 cursor-pointer font-normal text-right",children:"פתוח כברירת מחדל במובייל"}),e.jsx(W,{id:"nav-mobile-open",checked:!!l.mobileMenuDefaultOpen,onCheckedChange:a=>t({mobileMenuDefaultOpen:!!a})})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כפתור מובייל"}),e.jsx(j,{value:String(l.menuButtonLabel??""),onChange:a=>t({menuButtonLabel:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsx(p,{label:"רקע כפתור מובייל",value:String(l.menuButtonBackgroun
36d??""),onChange:a=>t({menuButtonBackground:a}),emptyFallback:"hsl(var(--muted) / 0.45)"}),e.jsx(p,{label:"צבע טקסט כפתור מובייל",value:String(l.menuButtonTextColor??""),onChange:a=>t({menuButtonTextColor:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול פינות כפתור מובייל (px)"}),e.jsx(j,{type:"number",min:0,max:20,value:Number(l.menuButtonRadius??8),onChange:a=>t({menuButtonRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"טיפוגרפיה ופריטים"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל טקסט קישורים (px)"}),e.jsx(j,{type:"number",min:11,max:22,value:Number(l.fontSize??14),onChange:a=>t({fontSize:Number(a.target.value)||14}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"משקל טקסט"}),e.jsxs(S,{value:String(l.fontWeight??"medium"),onValueChange:a=>t({fontWeight:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"normal",children:"רגיל"}),e.jsx(c,{value:"medium",children:"בינוני"}),e.jsx(c,{value:"semibold",children:"חצי מודגש"}),e.jsx(c,{value:"bold",children:"מודגש"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Padding אופקי לפריט (px)"}),e.jsx(j,{type:"number",min:0,max:28,value:Number(l.itemPaddingX??10),onChange:a=>t({itemPaddingX:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Padding אנכי לפריט (px)"}),e.jsx(j,{type:"number",min:0,max:20,value:Number(l.itemPaddingY??6),onChange:a=>t({itemPaddingY:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול פינות לפריט (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(l.itemRadius??8),onChange:a=>t({itemRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"Sticky"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-sticky",className:"flex-1 cursor-pointer font-normal text-right",children:"תפריט דביק בראש המסך"}),e.jsx(W,{id:"nav-sticky",checked:!!l.sticky,onCheckedChange:a=>t({sticky:!!a})})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Offset עליון (px)"}),e.jsx(j,{type:"number",min:0,max:120,value:Number(l.stickyOffsetTop??0),onChange:a=>t({stickyOffsetTop:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"z-index"}),e.jsx(j,{type:"number",min:1,max:100,value:Number(l.zIndex??30),onChange:a=>t({zIndex:Number(a.target.value)||30}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"nav-blur",className:"flex-1 cursor-pointer font-normal text-right",children:"Blur רקע"}),e.jsx(W,{id:"nav-blur",checked:!!l.backdropBlur,onCheckedChange:a=>t({backdropBlur:!!a})})]})]}),p:l,onPatch:t}),r.type==="hero"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת"}),e.jsx(j,{value:String(l.title??""),onChange:a=>t({title:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תת-כותרת"}),e.jsx(j,{value:String(l.subtitle??""),onChange:a=>t({subtitle:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsx(we,{label:"תמונת רקע",value:String(l.backgroundImageUrl??""),onChange:a=>t({backgroundImageUrl:a||void 0})})]}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גובה מינימלי (px)"}),e.jsx(j,{type:"number",min:120,max:800,value:Number(l.minHeight??320),onChange:a=>t({minHeight:Number(a.target.value)||320}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור"}),e.jsxs(S,{value:String(l.align??"center"),onValueChange:a=>t({align:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"ימין"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"left",children:"שמאל"})]})]})]})]}),p:l,onPatch:t}),r.type==="messagesFeed"&&e.jsx(X,{widgetLabel:g,contentTitle:"מקור להצגת מוצרים",contentHint:"בחרו «מתזמון» או «קטלוג אישי». במצב מתזמון תופיע רשימת הערוצים; במצב קטלוג אישי — סינון לפי קטגוריות.",content:e.jsxs(e.Fragment,{children:[e.jsx(vs,{p:l,onPatch:t,groupedActiveMessagingGroups:u,messagingGroups:s,legacyLandingPages:n,editorScheduledPreviewBlockId:r.id,widgetKind:"messagesFeed"}),String(l.feed_source??"").trim().toLowerCase()==="personal_catalog"?e.jsxs(e.Fragment,{children:[e.jsx(js,{selectedIds:Array.isArray(l.personal_catalog_c
36ategory_ids)?l.personal_catalog_category_ids.map(String):[],onPatch:t}),e.jsx(Ma,{p:l,onPatch:t,blockId:r.id})]}):null]}),design:e.jsx(Da,{p:l,onPatch:t,blockId:r.id,isPersonalCatalog:String(l.feed_source??"").trim().toLowerCase()==="personal_catalog"}),designHint:"תצוגה, רשת, צבעים — ובמצב קטלוג אישי גם עיצוב כפתור רכישה.",p:l,onPatch:t}),r.type==="messagesSearch"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"מקור החיפוש"}),e.jsx(vs,{p:l,onPatch:t,groupedActiveMessagingGroups:u,messagingGroups:s,legacyLandingPages:n,widgetKind:"messagesSearch"}),String(l.feed_source??"").trim().toLowerCase()==="personal_catalog"?e.jsx(js,{selectedIds:Array.isArray(l.personal_catalog_category_ids)?l.personal_catalog_category_ids.map(String):[],onPatch:t}):null,e.jsx(A,{children:"חיפוש ותוצאות"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Placeholder לשדה החיפוש"}),e.jsx(j,{value:yt(String(l.feed_source??"").trim().toLowerCase()==="personal_catalog"?"personal_catalog":"messaging",String(l.placeholder??"")),onChange:a=>t({placeholder:a.target.value}),dir:"rtl",className:"text-right"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"משתנה אוטומטית לפי מקור החיפוש — ניתן לערוך לטקסט מותאם אישית."})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כשאין תוצאות"}),e.jsx(j,{value:String(l.emptyText??""),onChange:a=>t({emptyText:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מינימום תווים לחיפוש"}),e.jsx(j,{type:"number",min:1,max:6,value:Number(l.minChars??2),onChange:a=>t({minChars:Number(a.target.value)||2}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל טעינה בכל בקשה"}),e.jsx(j,{type:"number",min:6,max:100,value:Number(l.batchSize??24),onChange:a=>t({batchSize:Number(a.target.value)||24}),dir:"ltr",className:"text-left"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:String(l.feed_source??"").trim().toLowerCase()==="personal_catalog"?"בדף המפורסם החיפוש רץ על הקטלוג האישי (לפי קטגוריה אם נבחרה), בטעינה הדרגתית.":"בדף המפורסם החיפוש עובר על כל ההודעות של הערוץ הנבחר, בטעינה הדרגתית."})]})]}),design:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"עיצוב חיפוש"}),e.jsx(p,{label:"רקע תיבת חיפוש",value:String(l.inputBackground??""),emptyFallback:"#ffffff",onChange:a=>t({inputBackground:a}),onClear:()=>t({inputBackground:void 0})}),e.jsx(p,{label:"צבע טקסט בהקלדה",value:String(l.inputTextColor??""),emptyFallback:"#111827",onChange:a=>t({inputTextColor:a}),onClear:()=>t({inputTextColor:void 0})}),e.jsx(p,{label:"צבע Placeholder",value:String(l.inputPlaceholderColor??""),emptyFallback:"#6b7280",onChange:a=>t({inputPlaceholderColor:a}),onClear:()=>t({inputPlaceholderColor:void 0})}),e.jsx(p,{label:"צבע מסגרת תיבת חיפוש",value:String(l.inputBorderColor??""),emptyFallback:"#d4d4d8",onChange:a=>t({inputBorderColor:a}),onClear:()=>t({inputBorderColor:void 0})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"לבן/כהה קבועים עובדים אותו דבר גם במצב בהיר וגם במצב כהה. צבעי מערכת משתנים לפי ערכת הנושא."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רדיוס פינות תיבת חיפוש (px)"}),e.jsx(j,{type:"number",min:0,max:30,value:Number(l.inputBorderRadius??10),onChange:a=>t({inputBorderRadius:Number(a.target.value)||10}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"עיצוב תוצאות"}),e.jsx(p,{label:"רקע כרטיס תוצאה",value:String(l.resultsCardBackground??""),emptyFallback:"hsl(var(--card))",onChange:a=>t({resultsCardBackground:a}),onClear:()=>t({resultsCardBackground:void 0})}),e.jsx(p,{label:"צבע מסגרת כרטיס תוצאה",value:String(l.resultsCardBorderColor??""),emptyFallback:"hsl(var(--border))",onChange:a=>t({resultsCardBorderColor:a}),onClear:()=>t({resultsCardBorderColor:void 0})}),e.jsx(p,{label:"צבע טקסט בתוצאות",value:String(l.resultsTextColor??""),emptyFallback:"hsl(var(--foreground))",onChange:a=>t({resultsTextColor:a}),onClear:()=>t({resultsTextColor:void 0})})]}),designHint:"שדות החיפוש והתוצאות משתמשים בברירות מחדל קבועות כדי שייראו טוב גם על רקע כהה.",p:l,onPatch:t}),r.type==="whatsappButton"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מספר טלפון (כולל קידומת מדינה)"}),e.jsx(j,{value:String(l.phone??""),onChange:a=>t({phone:a.target.value}),dir:"ltr",className:"text-left",placeholder:"9725..."})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תווית נגישות"}),e.jsx(j,{value:String(l.label??""),onChange:a=>t({label:a.target.value}),dir:"rtl",className:"text-right"})]})]}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקום"}),e.jsxs(S,{value:String(l.position??"bottom-left"),onValueChange:a=>t({position:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"bottom-left",children:"שמאל למטה"}),e.jsx(c,{value:"bottom-right",children:"ימין למטה"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"wa-pulse",className:"flex-1 cursor-pointer font-normal text-right",children:"אנימציית פעימה"}),e.jsx(W,{id:"wa-pulse",checked:!!l.pulse,onCheckedChange:a=>t({pulse:!!a})})]})]}),showBlockChrome:!1,p:l,onPatch:t}),r.type==="embed"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"HTML מוטמע"}),e.jsx(ne,{value:String(l.html??""),onChange:a=>t({html:a.target.value}),rows:8,dir:"ltr",className:"font-mono text-left text-sm"})]}),e.jsx("p",{className:"text-right text-xs text-muted-foreground",children:"התוכן מסונן לצורך אבטחה בפרסום."})]}),design:null,orphanChrome:!0,p:l,onPatch:t}),r.type==="socialLinks"&&e.jsx(X,{widgetLabel:g,content:e.jsx(Ha,{items:l.items??[],onChange:a=>t({items:a})}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור"}),e.jsxs(S,{value:String(l.align??"center"),onValueChange:a=>t({align:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"start",children:"התחלה"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"end",children:"סוף"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל אייקון"}),e.jsxs(S,{value:String(l.iconSize??"md"),onValueChange:a=>t({iconSize:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"sm",children:"קטן"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"גדול"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח (px)"}),e.jsx(j,{type:"number",min:4,max:40,value:Number(l.gap??12),onChange:a=>t({gap:Number(a.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע אייקון",value:String(l.iconColor??""),onChange:a=>t({iconColor:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsx(p,{label:"רקע אייקון",value:String(l.iconBackgroun
36dColor??""),onChange:a=>t({iconBackgroundColor:a}),emptyFallback:"hsl(var(--muted) / 0.4)"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"social-icon-bg-transparent",className:"flex-1 cursor-pointer font-normal text-right",children:"רקע שקוף"}),e.jsx(W,{id:"social-icon-bg-transparent",checked:!!l.iconTransparentBackground,onCheckedChange:a=>t({iconTransparentBackground:!!a})})]})]}),p:l,onPatch:t}),r.type==="iconList"&&e.jsx(X,{widgetLabel:g,content:e.jsx(Ga,{items:l.items??[],onChange:a=>t({items:a})}),design:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פריסה"}),e.jsxs(S,{value:String(l.layout??"stack"),onValueChange:a=>t({layout:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"stack",children:"רשימה"}),e.jsx(c,{value:"grid",children:"רשת"})]})]})]}),String(l.layout??"stack")==="grid"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות בדסקטופ"}),e.jsxs(S,{value:String(l.columnsDesktop??1),onValueChange:a=>t({columnsDesktop:Number(a)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}):null,e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מצב תוכן"}),e.jsxs(S,{value:String(l.contentMode??"full"),onValueChange:a=>t({contentMode:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"full",children:"מלא (כותרת + תיאור)"}),e.jsx(c,{value:"compact",children:"קומפקטי (כותרת בלבד)"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור"}),e.jsxs(S,{value:String(l.align??"start"),onValueChange:a=>t({align:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"start",children:"התחלה"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"end",children:"סוף"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקום אייקון"}),e.jsxs(S,{value:String(l.iconPosition??"right"),onValueChange:a=>t({iconPosition:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"ימין"}),e.jsx(c,{value:"left",children:"שמאל"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח בין פריטים (px)"}),e.jsx(j,{type:"number",min:4,max:40,value:Number(l.gap??12),onChange:a=>t({gap:Number(a.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"אייקון"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל אייקון (px)"}),e.jsx(j,{type:"number",min:14,max:48,value:Number(l.iconSize??22),onChange:a=>t({iconSize:Number(a.target.value)||22}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע אייקון",value:String(l.iconColor??""),onChange:a=>t({iconColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"רקע אייקון",value:String(l.iconBackgroundColor??""),onChange:a=>t({iconBackgroundColor:a}),emptyFallback:"hsl(var(--primary) / 0.12)"}),e.jsx(p,{label:"צבע מסגרת אייקון",value:String(l.iconBorderColor??""),onChange:a=>t({iconBorderColor:a}),emptyFallback:"hsl(var(--border))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת אייקון (px)"}),e.jsx(j,{type:"number",min:0,max:4,value:Number(l.iconBorderWidth??0),onChange:a=>t({iconBorderWidth:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול אייקון (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(l.iconBorderRadius??12),onChange:a=>t({iconBorderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"פריט"}
36),e.jsx(p,{label:"רקע פריט",value:String(l.itemBackgroundColor??""),onChange:a=>t({itemBackgroundColor:a}),emptyFallback:"hsl(var(--card))"}),e.jsx(p,{label:"צבע מסגרת פריט",value:String(l.itemBorderColor??""),onChange:a=>t({itemBorderColor:a}),emptyFallback:"hsl(var(--border))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת פריט (px)"}),e.jsx(j,{type:"number",min:0,max:4,value:Number(l.itemBorderWidth??1),onChange:a=>t({itemBorderWidth:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול פריט (px)"}),e.jsx(j,{type:"number",min:0,max:24,value:Number(l.itemBorderRadius??14),onChange:a=>t({itemBorderRadius:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פדינג פריט (px)"}),e.jsx(j,{type:"number",min:6,max:32,value:Number(l.itemPadding??12),onChange:a=>t({itemPadding:Number(a.target.value)||12}),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"טקסט וקישורים"}),e.jsx(p,{label:"צבע כותרת",value:String(l.titleColor??""),onChange:a=>t({titleColor:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל כותרת (px)"}),e.jsx(j,{type:"number",min:12,max:26,value:Number(l.titleFontSize??15),onChange:a=>t({titleFontSize:Number(a.target.value)||15}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע תיאור",value:String(l.textColor??""),onChange:a=>t({textColor:a}),emptyFallback:"hsl(var(--muted-foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל תיאור (px)"}),e.jsx(j,{type:"number",min:11,max:20,value:Number(l.textFontSize??13),onChange:a=>t({textFontSize:Number(a.target.value)||13}),dir:"ltr",className:"text-left"})]}),e.jsx(p,{label:"צבע קישור",value:String(l.linkColor??""),onChange:a=>t({linkColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(A,{children:"Hover לפריט מקושר"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"אפקט"}),e.jsxs(S,{value:String(l.hoverEffect??"lift"),onValueChange:a=>t({hoverEffect:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"soft",children:"עדין"}),e.jsx(c,{value:"lift",children:"הרמה"})]})]})]}),String(l.hoverEffect??"lift")==="lift"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גובה הרמה 
36(px)"}),e.jsx(j,{type:"number",min:0,max:16,value:Number(l.hoverLiftPx??4),onChange:a=>t({hoverLiftPx:Number(a.target.value)||0}),dir:"ltr",className:"text-left"})]}):null,e.jsx(p,{label:"רקע Hover לפריט",value:String(l.hoverItemBackgroundColor??""),onChange:a=>t({hoverItemBackgroundColor:a}),emptyFallback:"hsl(var(--muted) / 0.45)"}),e.jsx(p,{label:"מסגרת Hover לפריט",value:String(l.hoverItemBorderColor??""),onChange:a=>t({hoverItemBorderColor:a}),emptyFallback:"hsl(var(--primary) / 0.35)"}),e.jsx(p,{label:"צבע אייקון ב-Hover",value:String(l.hoverIconColor??""),onChange:a=>t({hoverIconColor:a}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"צבע טקסט ב-Hover",value:String(l.hoverTextColor??""),onChange:a=>t({hoverTextColor:a}),emptyFallback:"hsl(var(--foreground))"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"icon-list-hover-underline",className:"flex-1 cursor-pointer font-normal text-right",children:"קו תחתון בקישור ב-Hover"}),e.jsx(W,{id:"icon-list-hover-underline",checked:!!l.hoverUnderlineLink,onCheckedChange:a=>t({hoverUnderlineLink:!!a})})]})]}),p:l,onPatch:t}),r.type==="leadForm"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת"}),e.jsx(j,{value:String(l.title??""),onChange:a=>t({title:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"איך לשלוח לידים"}),e.jsxs(S,{value:String(l.delivery??"resend"),onValueChange:a=>t({delivery:a==="custom"?"custom":"resend"}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"resend",children:"אימייל לחשבון שלי (אוטומטי)"}),e.jsx(c,{value:"custom",children:"כתובת POST חיצונית (מתקדם)"})]})]})]}),String(l.delivery??"resend")==="custom"&&e.jsxs("div",{children:[e.jsx(i,{children:"כתובת שליחה (POST, https בלבד)"}),e.jsx(j,{value:String(l.formActionUrl??""),onChange:a=>t({formActionUrl:a.target.value}),dir:"ltr",className:"text-left font-mono text-sm",placeholder:"https://formspree.io/f/..."})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כפתור"}),e.jsx(j,{value:String(l.submitLabel??""),onChange:a=>t({submitLabel:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"lf-name",className:"flex-1 cursor-pointer font-normal text-right",children:"שדה שם"}),e.jsx(W,{id:"lf-name",checked:!!l.showName,onCheckedChange:a=>t({showName:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"lf-email",className:"flex-1 cursor-pointer font-normal text-right",children:"שדה אימייל"}),e.jsx(W,{id:"lf-email",checked:!!l.showEmail,onCheckedChange:a=>t({showEmail:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"lf-phone",className:"flex-1 cursor-pointer font-normal text-right",children:"שדה טלפון"}),e.jsx(W,{id:"lf-phone",checked:!!l.showPhone,onCheckedChange:a=>t({showPhone:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"lf-consent",className:"flex-1 cursor-pointer font-normal text-right",children:"אישור דיוור (תיבת סימון)"}),e.jsx(W,{id:"lf-consent",checked:!!l.requireConsent,onCheckedChange:a=>t({requireConsent:!!a})})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט אישור דיוור"}),e.jsx(ne,{value:String(l.consentText??""),onChange:a=>t({consentText:a.target.value}),rows:2,dir:"rtl",className:"text-right"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:String(l.delivery??"resend")==="resend"?"בדף החי הלידים נשלחים לאימייל של חשבון CashEngine שלכם (Resend).":"השדות נשלחים כ-name, email, phone, consent — התאימו לשירות הטפסים שבחרתם."})]}),design:null,orphanChrome:!0,p:l,onPatch:t}),r.type==="accordion"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"התנה×
36’ות"}),e.jsxs(S,{value:String(l.accordionType??"single"),onValueChange:a=>t({accordionType:a}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"single",children:"פריט אחד פתוח"}),e.jsx(c,{value:"multiple",children:"מספר פריטים פתוחים"})]})]})]}),e.jsx(Wa,{items:l.items??[],onChange:a=>t({items:a})})]}),design:null,orphanChrome:!0,p:l,onPatch:t}),r.type==="testimonials"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות (מסכים רחבים)"}),e.jsxs(S,{value:String(l.columns??2),onValueChange:a=>t({columns:Number(a)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}),e.jsx($a,{items:l.items??[{quote:"",author:"",role:""}],onChange:a=>t({items:a})})]}),design:null,orphanChrome:!0,p:l,onPatch:t}),r.type==="countdownTimer"&&e.jsx(X,{widgetLabel:g,content:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת מעל הספירה"}),e.jsx(j,{value:String(l.title??""),onChange:a=>t({title:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תאריך ושעת יעד"}),e.jsx(j,{type:"datetime-local",value:Va(String(l.targetIso??"")),onChange:a=>t({targetIso:Oa(a.target.value)}),dir:"ltr",className:"text-left font-mono text-sm"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הודעה אחרי סיום"}),e.jsx(j,{value:String(l.endedMessage??""),onChange:a=>t({endedMessage:a.target.value}),dir:"rtl",className:"text-right"})]}),e.jsx(A,{children:"יחידות זמן"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"cd-days",className:"flex-1 cursor-pointer font-normal text-right",children:"ימים"}),e.jsx(W,{id:"cd-days",checked:l.showDays!==!1,onCheckedChange:a=>t({showDays:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"cd-hours",className:"flex-1 cursor-pointer font-normal text-right",children:"שעות"}),e.jsx(W,{id:"cd-hours",checked:l.showHours!==!1,onCheckedChange:a=>t({showHours:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"cd-min",className:"flex-1 cursor-pointer font-normal text-right",children:"דקות"}),e.jsx(W,{id:"cd-min",checked:l.showMinutes!==!1,onCheckedChange:a=>t({showMinutes:!!a})})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:"cd-sec",className:"flex-1 cursor-pointer font-normal text-right",children:"שניות"}),e.jsx(W,{id:"cd-sec",checked:l.showSeconds!==!1,onCheckedChange:a=>t({showSeconds:!!a})})]})]}),design:null,orphanChrome:!0,p:l,onPatch:t}),r.type==="stickyCtaBar"&&e.jsx(X,{widgetLabel:g,content:e.jsx(ba,{p:l,onPatch:t}),design:e.jsx(fa,{p:l,onPatch:t}),p:l,onPatch:t}),r.type==="uspBullets"&&e.jsx(X,{widgetLabel:g,content:e.jsx(Ca,{p:l,onPatch:t}),design:e.jsx(Na,{p:l,onPatch:t}),p:l,onPatch:t}),r.type==="comparisonTable"&&e.jsx(X,{widgetLabel:g,content:e.jsx(ya,{p:l,onPatch:t}),design:e.jsx(ka,{p:l,onPatch:t}),p:l,onPatch:t}),r.type==="couponCode"&&e.jsx(X,{widgetLabel:g,content:e.jsx(Sa,{p:l,onPatch:t}),design:e.jsx(Ba,{p:l,onPatch:t}),p:l,onPatch:t})]})})]})}function Aa(r){return Array.isArray(r)?r.map(s=>{const n=s;return{id:String(n.id??crypto.randomUUID()),url:String(n.url??""),alt:String(n.alt??""),caption:n.caption?String(n.caption):"",link:n.link?String(n.link):"",objectPosition:n.objectPosition?String(n.objectPosition):"center"}}).filter(s=>s.url.trim().length>0):[]}function ps({blockId:r,p:s,onPatch:n,variant:t="all"}){const{effectiveUserId:o,isLoading:m,isReadOnly:h}=Ke(),[x,l]=F.useState([]),g=Aa(s.images),u=!!o&&!m&&!h,b=y=>n({images:y}),f=(y,I)=>{b(g.map(V=>V.id===y?{...V,...I}:V))},a=y=>b(g.filter(I=>I.id!==y)),N=(y,I)=>{const V=g.findIndex($=>$.id===y),C=V+I;if(V<0||C<0||C>=g.length)return;const O=[...g],[U]=O.splice(V,1);O.splice(C,0,U),b(O)},k=async y=>{const I=Array.from(y.target.files??[]);if(y.target.value="",!(!I.length||!o)){l(I.map(V=>V.name));try{const V=[];for(const C of I)try{const O=await Us(C,o);V.push({id:crypto.randomUUID(),url:O,alt:"",caption:"",link:"",objectPosition:"center"}),ve.success(`הועלה: ${C.name}`)}catch(O){const U=O instanceof Error?O.message:"העלאה נכשלה";ve.error(`${C.name}: ${U}`)}finally{l(O=>O.filter(U=>U!==C.name))}V.length>0&&b([...g,...V].slice(0,40))}finally{l([])}}},M=e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"תמונות"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"העלאת תמונות (עד 500KB לתמונה)"}),e.jsx("input",{id:`gallery-upload-${r}`,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",multiple:!0,disabled:!u,onChange:k,className:"block w-full cursor-pointer rounded-md border border-border bg-background px-2 py-1.5 text-xs file:ml-2 file:cursor-pointer file:rounded file:border-0 file:bg-muted file:px-2 file:py-1 file:text-xs"}),x.length>0?e.jsx("div",{className:"space-y-1 text-xs text-muted-foreground",children:x.map(y=>e.jsxs("p",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Ye,{className:"h-3 w-3 animate-spin"}),"מעלה: ",y]},y))}):null]}),e.jsxs("div",{className:"space-y-2.5",children:[g.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"עדיין לא נוספו תמונות לגלריה."}):null,g.map((y,I)=>e.jsxs("div",{className:"rounded-md border border-border/60 p-2 space-y-2",children:[e.jsx("div",{className:"overflow-hidden rounded-md border border-border/60 bg-muted/20 p-1.5",children:e.jsx("img",{src:y.url,alt:y.alt,className:"h-24 w-full object-cover",loading:"lazy"})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Alt"}),e.jsx(j,{value:y.alt,onChange:V=>f(y.id,{alt:V.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כיתוב"}),e.jsx(j,{value:y.caption??"",onChange:V=>f(y.id,{caption:V.target.value}),dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קישור בלחיצה (אופציונלי)"}),e.jsx(j,{value:y.link??"",onChange:V=>f(y.id,{link:V.target.value}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[e.jsx(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 px-2 text-xs",P),disabled:I===0,onClick:()=>N(y.id,-1),children:"למעלה"}),e.jsx(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 px-2 text-xs",P),disabled:I===g.length-1,onClick:()=>N(y.id,1),children:"למטה"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive",onClick:()=>a(y.id),children:"הסר"})]})]},y.id))]})]}),D=e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"פריסה"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות במובייל"}),e.jsxs(S,{value:String(s.columnsMobile??1),onValueChange:y=>n({columnsMobile:Number(y)===2?2:1}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות בטאבלט"}),e.jsxs(S,{value:String(s.columnsTablet??2),onValueChange:y=>n({columnsTablet:Number(y)===3?3:Number(y)===1?1:2}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות בדסקטופ"}),e.jsxs(S,{value:String(s.columnsDesktop??3),onValueChange:y=>n({columnsDesktop:Number(y)===4?4:Number(y)===2?2:Number(y)===1?1:3}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"}),e.jsx(c,{value:"4",children:"4"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ריווח בין תמונות (px)"}),e.jsx(j,{type:"number",min:0,max:40,value:Number(s.gap??12),onChange:y=>
36n({gap:Number(y.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גובה שורות"}),e.jsxs(S,{value:String(s.rowHeightMode??"auto"),onValueChange:y=>n({rowHeightMode:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"auto",children:"אוטומטי"}),e.jsx(c,{value:"fixed",children:"קבוע"}),e.jsx(c,{value:"masonry-like",children:"Masonry"})]})]})]}),String(s.rowHeightMode??"auto")!=="auto"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גובה תמונה (px)"}),e.jsx(j,{type:"number",min:80,max:520,value:Number(s.fixedRowHeight??220),onChange:y=>n({fixedRowHeight:Number(y.target.value)||220}),dir:"ltr",className:"text-left"})]}):null,e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יחס תמונה"}),e.jsxs(S,{value:String(s.aspectRatio??"4 / 3"),onValueChange:y=>n({aspectRatio:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1 / 1",children:"1:1"}),e.jsx(c,{value:"4 / 3",children:"4:3"}),e.jsx(c,{value:"3 / 2",children:"3:2"}),e.jsx(c,{value:"16 / 9",children:"16:9"}),e.jsx(c,{value:"auto",children:"אוטומטי"})]})]})]}),e.jsx(A,{children:"עיצוב והתנהגות"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות (px)"}),e.jsx(j,{type:"number",min:0,max:48,value:Number(s.borderRadius??12),onChange:y=>n({borderRadius:Number(y.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עובי מסגרת (px)"}),e.jsx(j,{type:"number",min:0,max:12,value:Number(s.borderWidth??0),onChange:y=>n({borderWidth:Number(y.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"אטימות מסגרת (%)"}),e.jsx(j,{type:"number",min:0,max:100,value:Number(s.borderOpacity??20),onChange:y=>n({borderOpacity:Number(y.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל"}),e.jsxs(S,{value:String(s.shadow??"sm"),onValueChange:y=>n({shadow:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"עדין"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"חזק"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:`gallery-caption-${r}`,className:"flex-1 cursor-pointer font-normal text-right",children:"להציג כיתובים"}),e.jsx(W,{id:`gallery-caption-${r}`,checked:!!s.showCaption,onCheckedChange:y=>n({showCaption:!!y})})]}),s.showCaption?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקום כיתוב"}),e.jsxs(S,{value:String(s.captionPosition??"below"),onValueChange:y=>n({captionPosition:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"below",children:"מתחת לתמונה"}),e.jsx(c,{value:"overlay",children:"על התמונה"})]})]})]}):null,e.jsxs("div",{className:d,children:[e.jsx(i,{children:"אפקט מעבר"}),e.jsxs(S,{value:String(s.hoverEffect??"zoom"),onValueChange:y=>n({hoverEffect:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"zoom",children:"זום"}),e.jsx(c,{value:"fade",children:"דעיכה"}),e.jsx(c,{value:"lift",children:"הרמה"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פעולה בלחיצה"}),e.jsxs(S,{value:String(s.openMode??"lightbox"),onValueChange:y=>n({openMode:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא פעולה"}),e.jsx(c,{value:"lightbox",children:"פתיחה מוגדלת"}),e.jsx(c,{value:"link",children:"מעבר לקישור"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"התאמת תמונה"}),e.jsxs(S,{value:String(s.imageFit??"cover"),onValueChange:y=>n({imageFit:y}
36),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"cover",children:"כיסוי"}),e.jsx(c,{value:"contain",children:"הכלה"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב מקסימלי"}),e.jsxs(S,{value:String(s.maxWidth??"full"),onValueChange:y=>n({maxWidth:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"full",children:"מלא"}),e.jsx(c,{value:"xl",children:"XL"}),e.jsx(c,{value:"lg",children:"LG"}),e.jsx(c,{value:"md",children:"MD"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"יישור גלריה"}),e.jsxs(S,{value:String(s.alignment??"center"),onValueChange:y=>n({alignment:y}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"start",children:"התחלה"}),e.jsx(c,{value:"center",children:"מרכז"}),e.jsx(c,{value:"end",children:"סוף"})]})]})]})]});return t==="content"?M:t==="design"?D:e.jsxs(e.Fragment,{children:[M,D]})}function ar(r){const s=Number(r);return Number.isFinite(s)?Math.min(100,Math.max(1,Math.round(s))):24}function Da({p:r,onPatch:s,blockId:n,isPersonalCatalog:t=!1}){const o=!!r.loadAllChannel,m=Hs.parse(r),h=t?m.pc_show_purchase_button:!!r.showPurchaseButton,[x,l]=F.useState(()=>String(ar(r.maxItems)));F.useEffect(()=>{l(String(ar(r.maxItems)))},[n,r.maxItems]);const g=()=>{const u=x.trim();if(u===""){l("24"),s({maxItems:24});return}const b=Number(u);if(!Number.isFinite(b)){l(String(ar(r.maxItems)));return}const f=ar(b);l(String(f)),s({maxItems:f})};return e.jsxs(e.Fragment,{children:[e.jsx(A,{children:"תצוגה"}),e.jsxs("div",{className:"flex flex-row-reverse items-start gap-3 sm:items-center",children:[e.jsx(W,{id:`load-all-${n}`,checked:o,onCheckedChange:u=>s({loadAllChannel:u===!0})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5 text-right",children:[e.jsx(i,{htmlFor:`load-all-${n}`,className:"cursor-pointer font-normal leading-snug",children:"הצג את כל ההודעות בערוץ (טעינה הדרגתית)"}),e.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:o?"המספר למטה קובע כמה פריטים נטענים בכל שלב כשגוללים (עד כל ההודעות).":"מגביל כמה הודעות מוצגות בדף."})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:o?"פריטים בכל טעינה":"מקסימום פריטים"}),e.jsx(j,{type:"text",inputMode:"numeric",autoComplete:"off",value:x,onChange:u=>l(u.target.value.replace(/\D/g,"")),onBlur:g,onKeyDown:u=>{u.key==="Enter"&&u.target.blur()},dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"סידור"}),e.jsxs(S,{value:String(r.layout??"grid"),onValueChange:u=>s({layout:u}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"grid",children:"רשת"}),e.jsx(c,{value:"list",children:"רשימה"})]})]})]}),String(r.layout??"grid")!=="list"?e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עמודות ברשת (מובייל ודסקטופ)"}),e.jsxs(S,{value:String(r.columns??2),onValueChange:u=>s({columns:Number(u)}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"1",children:"1"}),e.jsx(c,{value:"2",children:"2"}),e.jsx(c,{value:"3",children:"3"})]})]})]}):null,e.jsx(A,{children:"טקסט הודעה"}),e.jsx(p,{label:"צבע תוכן ההודעה",value:String(r.messageBodyTextColor??""),onChange:u=>s({messageBodyTextColor:u}),emptyFallback:"hsl(var(--muted-foreground))"}),e.jsx(A,{children:"לינק וכפתור רכישה"}),e.jsx(p,{label:"צבע לינק רכישה",value:String(r.purchaseLinkColor??""),onChange:u=>s({purchaseLinkColor:u}),emptyFallback:"hsl(var(--primary))"}),t?null:e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:`purchase-btn-${n}`,className:"flex-1 cursor-pointer font-normal text-right",children:"הצג גם כפתור רכישה"}),e.jsx(W,{id:`purchase-btn-${n}`,checked:!!r.showPurchaseButton,onCheckedChange:u=>s({showPurchaseButton:!!u})})]}),h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:d,children:[e.jsx(i,{children:"טקסט כפתור"}),e.jsx(j,{value:String(r.purchaseButtonLabel??"לינק לרכישה"),onChange:u=>s({purchaseButtonLabel:u.target.value}),dir:"rtl",className:"text-right"})]}),e.jsx(p,{label:"צבע רקע כפתור",value:String(r.purchaseButtonBackgroun
36dColor??""),onChange:u=>s({purchaseButtonBackgroundColor:u}),emptyFallback:"hsl(var(--primary))"}),e.jsx(p,{label:"צבע טקסט כפתור",value:String(r.purchaseButtonTextColor??""),onChange:u=>s({purchaseButtonTextColor:u}),emptyFallback:"hsl(var(--primary-foreground))"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"פינות מעוגלות כפתור (px)"}),e.jsx(j,{type:"number",min:0,max:48,value:Number(r.purchaseButtonBorderRadius??10),onChange:u=>s({purchaseButtonBorderRadius:Number(u.target.value)||0}),dir:"ltr",className:"text-left"})]}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:`purchase-btn-full-${n}`,className:"flex-1 cursor-pointer font-normal text-right",children:"כפתור ברוחב מלא"}),e.jsx(W,{id:`purchase-btn-full-${n}`,checked:!!r.purchaseButtonFullWidth,onCheckedChange:u=>s({purchaseButtonFullWidth:!!u})})]})]}):null]})}function Va(r){if(!(r!=null&&r.trim()))return"";const s=new Date(r);if(Number.isNaN(s.getTime()))return"";const n=t=>String(t).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}`}function Oa(r){if(!(r!=null&&r.trim()))return"";const s=new Date(r);return Number.isNaN(s.getTime())?"":s.toISOString()}const za=[{value:"facebook",label:"Facebook"},{value:"instagram",label:"Instagram"},{value:"youtube",label:"YouTube"},{value:"tiktok",label:"TikTok"},{value:"linkedin",label:"LinkedIn"},{value:"twitter",label:"X / Twitter"},{value:"telegram",label:"Telegram"},{value:"whatsapp",label:"WhatsApp"},{value:"link",label:"קישור כללי"}],Ua=[{value:"check",label:"וי"},{value:"star",label:"כוכב"},{value:"heart",label:"לב"},{value:"shield",label:"מגן"},{value:"zap",label:"ברק"},{value:"gift",label:"מתנה"},{value:"thumbsUp",label:"לייק"},{value:"circleCheck",label:"וי בעיגול"},{value:"sparkles",label:"ניצוצות"},{value:"arrowRight",label:"חץ ימינה"},{value:"badgeCheck",label:"תג מאושר"},{value:"messageCircle",label:"בועת הודעה"}];function Ha({items:r,onChange:s}){const n=(m,h)=>{const x=r.map((l,g)=>g===m?{...l,...h}:l);s(x)},t=()=>s([...r,{platform:"facebook",url:""}]),o=m=>s(r.filter((h,x)=>x!==m));return e.jsxs("div",{className:"flex flex-col gap-2.5",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"קישורים"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:t,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף"]})]}),r.map((m,h)=>e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsxs(S,{value:m.platform,onValueChange:x=>n(h,{platform:x}),children:[e.jsx(B,{className:"w-full text-right sm:w-[140px]",children:e.jsx(w,{})}),e.jsx(_,{children:za.map(x=>e.jsx(c,{value:x.value,children:x.label},x.value))})]}),e.jsx(j,{placeholder:"https://...",value:m.url,onChange:x=>n(h,{url:x.target.value}),dir:"ltr",className:"min-w-0 flex-1 text-left"}),e.jsx(E,{type:"button",variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>o(h),"aria-label":"הסר",children:e.jsx(Rr,{className:"h-4 w-4"})})]},h))]})}function Ga({items:r,onChange:s}){const[n,t]=F.useState(null),o=(l,g)=>{const u=r.map((b,f)=>f===l?{...b,...g}:b);s(u)},m=()=>s([...r,{iconKey:"check",title:"פריט חדש",text:"הוסף טקסט תומך",href:"",openInNewTab:!1}]),h=l=>{r.length<=1||s(r.filter((g,u)=>u!==l))},x=(l,g)=>{if(l===g||l<0||g<0||l>=r.length||g>=r.length)return;const u=[...r],[b]=u.splice(l,1);u.splice(g,0,b),s(u)};return e.jsxs("div",{className:"flex flex-col gap-3",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"פריטי רשימה"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:m,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף"]})]}),r.map((l,g)=>e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-border/60 p-2.5",draggable:!0,onDragStart:()=>t(g),onDragOver:u=>{u.preventDefault()},onDrop:()=>{n!=null&&(x(n,g),t(null))},onDragEnd:()=>t(null),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:["פריט #",g+1]}),e.jsxs("div",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[e.jsx(Ar,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[11px]",children:"גרור לסידור"})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"אייקון"}),e.jsxs(S,{value:String(l.iconKey??"check"),onValueChange:u=>o(g,{iconKey:u}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsx(_,{children:Ua.map(u=>e.jsx(c,{value:u.value,children:u.label},u.value))})]})]}),e.jsx(j,{placeholder:"כותרת",value:String(l.title??""),onChange:u=>o(g,{title:u.target.value}),className:"text-right",dir:"rtl"}),e.jsx(ne,{placeholder:"טקסט ליד האייקון",value:String(l.text??""),onChange:u=>o(g,{text:u.target.value}),rows:2,className:"text-right",dir:"rtl"}),e.jsx(j,{placeholder:"קישור אופציונלי (https://, /path, #anchor, tel:, mailto:)",value:String(l.href??""),onChange:u=>o(g,{href:u.target.value}),className:"text-left",dir:"ltr"}),e.jsxs("div",{className:"flex items-center gap-2",dir:"rtl",children:[e.jsx(i,{htmlFor:`icon-list-new-tab-${g}`,className:"flex-1 cursor-pointer font-normal text-right",children:"פתיחה בטאב חדש"}),e.jsx(W,{id:`icon-list-new-tab-${g}`,checked:!!l.openInNewTab,onCheckedChange:u=>o(g,{openInNewTab:!!u})})]}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-destructive",onClick:()=>h(g),children:"הסר פריט"})]},g)),e.jsx("p",{className:"text-xs text-muted-foreground",children:"אם שדה הקישור ריק, הפריט מוצג ללא לינק."})]})}function Wa({items:r,onChange:s}){const n=(m,h,x)=>{const l=r.map((g,u)=>u===m?{...g,[h]:x}:g);s(l)},t=()=>s([...r,{title:"שאלה חדשה",content:"תשובה"}]),o=m=>{r.length<=1||s(r.filter((h,x)=>x!==m))};return e.jsxs("div",{className:"flex flex-col gap-3",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"פריטים"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:t,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף"]})]}),r.map((m,h)=>e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-border/60 p-2",children:[e.jsx(j,{placeholder:"כותרת",value:m.title,onChange:x=>n(h,"title",x.target.value),className:"text-right",dir:"rtl"}),e.jsx(ne,{placeholder:"תוכן",value:m.content,onChange:x=>n(h,"content",x.target.value),rows:3,className:"text-right",dir:"rtl"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-destructive",onClick:()=>o(h),children:"הסר פריט"})]},h))]})}function $a({items:r,onChange:s}){const n=(m,h,x)=>{const l=r.map((g,u)=>u===m?{...g,[h]:x}:g);s(l)},t=()=>s([...r,{quote:"",author:"",role:""}]),o=m=>{r.length<=1||s(r.filter((h,x)=>x!==m))};return e.jsxs("div",{className:"flex flex-col gap-3",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"ממליצים"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:t,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף"]})]}),r.map((m,h)=>e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-border/60 p-2",children:[e.jsx(ne,{placeholder:"ציטוט",value:m.quote,onChange:x=>n(h,"quote",x.target.value),rows:3,className:"text-right",dir:"rtl"}),e.jsx(j,{placeholder:"שם",value:m.author,onChange:x=>n(h,"author",x.target.value),className:"text-right",dir:"rtl"}),e.jsx(j,{placeholder:"תפקיד (אופציונלי)",value:m.role??"",onChange:x=>n(h,"role",x.target.value),className:"text-right",dir:"rtl"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-destructive",onClick:()=>o(h),children:"הסר"})]},h))]})}function Xa({items:r,onChange:s}){const n=(m,h,x)=>{const l=r.map((g,u)=>u===m?{...g,[h]:x}:g);s(l)},t=()=>s([...r,{label:"קישור",href:"#"}]),o=m=>s(r.filter((h,x)=>x!==m));return e.jsxs("div",{className:"flex flex-col gap-2.5",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(i,{className:"text-right",children:"פריטי תפריט"}),e.jsxs(E,{type:"button",variant:"outline",size:"sm",className:R("h-7 shrink-0 gap-1 text-xs",P),onClick:t,children:[e.jsx(Re,{className:"h-3 w-3"}),"הוסף"]})]}),r.map((m,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{placeholder:"תווית",value:m.label,onChange:x=>n(h,"label",x.target.value),className:"flex-1 text-right",dir:"rtl"}
36),e.jsx(j,{placeholder:"קישור",value:m.href,onChange:x=>n(h,"href",x.target.value),dir:"ltr",className:"flex-1 text-left"}),e.jsx(E,{type:"button",variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>o(h),"aria-label":"הסר",children:e.jsx(Rr,{className:"h-4 w-4"})})]},h))]})}function Le({title:r,children:s}){return e.jsxs(Tr,{defaultOpen:!0,dir:"rtl",className:"rounded-md border border-border/60 bg-background/40",children:[e.jsxs(Ir,{type:"button",className:R("grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 py-2 text-right","text-xs font-semibold text-foreground hover:bg-muted/30"),children:[e.jsx("span",{className:"min-w-0",children:r}),e.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]}),e.jsx(Lr,{className:"space-y-3 px-3 pb-3",children:s})]})}function Ka({embedded:r=!1,onBack:s,title:n,onTitleChange:t,slug:o,onSlugChange:m,metaTitle:h,onMetaTitleChange:x,metaDescription:l,onMetaDescriptionChange:g,ogImageUrl:u,onOgImageUrlChange:b,facebookPixelId:f,onFacebookPixelIdChange:a,pageStyle:N,onPageStylePatch:k,onPageStyleReset:M}){var xe,re,_e;const D=N.backgroundColor??"",y=N.textColor??"",I=N.backgroundGradient??"",V=N.contentMaxWidth??fr,C=(xe=N.googleFontId)!=null&&xe.trim()?N.googleFontId.trim():"inherit",O=((re=N.themePresetId)==null?void 0:re.trim())||"clean-light",U=((_e=Cr.find(v=>v.css===I))==null?void 0:_e.id)??"custom",$=N.navMenuStyle??{},H=v=>k({navMenuStyle:{...N.navMenuStyle??{},...v}});return e.jsxs("div",{dir:"rtl",className:R("flex min-h-0 min-w-0 w-full flex-1 flex-col text-right",r?"bg-transparent":"h-full rounded-lg border border-border/60 bg-card/80"),children:[e.jsxs("div",{className:R("shrink-0 border-b border-border/70 px-3 py-2.5",r?"sticky top-0 z-10 border-border/60 bg-muted/35 backdrop-blur-sm":"bg-muted/30"),children:[e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 px-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:s,children:[e.jsx(Ws,{className:"h-3.5 w-3.5"}),"חזרה לווידג'טים"]})}),e.jsx("h2",{className:"mt-1.5 w-full text-right text-sm font-medium text-foreground",children:"הגדרות דף"}),e.jsx("p",{className:"mt-0.5 text-right text-[11px] leading-snug text-muted-foreground",children:"שם הדף, כתובת, SEO ועיצוב כללי"})]}),e.jsx(ur,{className:R("min-h-0 flex-1",r?"h-full min-h-0":"min-h-[200px]"),children:e.jsxs("div",{className:Ds,children:[e.jsx(A,{children:"תוכן וכתובת"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"שם הדף"}),e.jsx(j,{value:n,onChange:v=>t(v.target.value),dir:"rtl",className:"text-right"}),e.jsx("p",{className:"text-right text-[11px] leading-snug text-muted-foreground",children:"השם שמופיע בעורך ובכותרת העליונה הציבורית (אלא אם תבחר להסתיר שם מהכותרת)."})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Slug (כתובת ציבורית)"}),e.jsx(j,{value:o,onChange:v=>m(v.target.value),dir:"ltr",className:"text-left"})]}),e.jsx(A,{children:"SEO ומעקב"}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת לתוצאות חיפוש (אופציונלי)"}),e.jsx(j,{value:h,onChange:v=>x(v.target.value),placeholder:"ברירת מחדל: כותרת הדף",dir:"rtl",className:"text-right"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"תיאור (אופציונלי)"}),e.jsx(j,{value:l,onChange:v=>g(v.target.value),dir:"rtl",className:"text-right"})]}),e.jsx(we,{label:"תמונת OG",value:u,onChange:v=>b(v),hint:"מוצגת כשמשתפים את הקישור ברשתות חברתיות."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Facebook Pixel ID"}),e.jsx(j,{dir:"ltr",className:"text-left",value:f,onChange:v=>a(v.target.value),placeholder:"מזהה פיקסל"})]}),e.jsx(A,{children:"עיצוב ושדרוג"}),e.jsx("div",{className:"rounded-md border border-primary/30 bg-primary/10 p-2 text-xs text-foreground/90",children:"כל ההגדרות בסעיף זה הן גלובליות ברמת הדף, ומשפיעות על הדף הציבורי כולו (כולל תתי־דפים בירושה)."}),e.jsxs(Le,{title:"תבנית עיצוב ורקע",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"ערכת עיצוב, צבע בסיס, גרדיאנט ותמונת רקע חלים על כל העמוד — כולל הכותרת העליונה — באותו מראה."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"ערכת עיצוב (Preset)"}),e.jsxs(S,{value:O,onValueChange:v=>k({themePresetId:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsx(_,{children:Zl.map(v=>e.jsx(c,{value:v.id,children:v.label},v.id))})]})]}),e.jsx(p,{label:"צבע רקע",value:D,emptyFallback:Pr,onChange:v=>k({backgroundColor:v}),onClear:()=>k({backgroundColor:void 0})}),e.jsx(we,{label:"תמונת רקע",value:N.backgroundImageUrl??"",onChange:v=>k({backgroundImageUrl:v||void 0}
36),hint:"אם מוזן URL תקין, התמונה תוצג כרקע לעמוד."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גרדיאנט מוכן"}),e.jsxs(S,{value:U,onValueChange:v=>{if(v==="custom")return;const Y=Cr.find(Q=>Q.id===v);k({backgroundGradient:(Y==null?void 0:Y.css)||void 0})},children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[Cr.map(v=>e.jsx(c,{value:v.id,children:v.label},v.id)),e.jsx(c,{value:"custom",children:"מותאם ידנית (CSS)"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כהות שכבה על תמונת רקע"}),e.jsx(j,{type:"number",min:0,max:.85,step:.05,className:"text-left",dir:"ltr",value:N.backgroundOverlayOpacity!=null?String(N.backgroundOverlayOpacity):"0",onChange:v=>{const Y=Number(v.target.value);Number.isFinite(Y)&&k({backgroundOverlayOpacity:Math.max(0,Math.min(.85,Y))})}})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גרדיאנט רקע (CSS)"}),e.jsx(ne,{dir:"ltr",className:"min-h-[72px] font-mono text-left text-sm",value:I,onChange:v=>k({backgroundGradient:v.target.value||void 0}),placeholder:"linear-gradient(180deg, #e2e8f0 0%, #ffffff 100%)",rows:3})]})]}),e.jsxs(Le,{title:"כותרת עליונה",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:'מבנה האזור העליון (כותרת, לוגו, רשתות). הרקע והגרדיאנט נלקחים מאותה תבנית כמו שאר העמוד. צבעי הטקסט (שם הדף, תיאור, אייקוני רשתות) נשלטים משדה "צבע טקסט" בסעיף "טקסט" למטה.'}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הצג כותרת עליונה גלובלית"}),e.jsxs(S,{value:N.showTopHeader===!1?"hidden":"shown",onValueChange:v=>k({showTopHeader:v!=="hidden"}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"shown",children:"הצג"}),e.jsx(c,{value:"hidden",children:"הסתר"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"קו מפריד תחת הכותרת"}),e.jsx("p",{className:"text-right text-[11px] leading-snug text-muted-foreground",children:"ברירת מחדל: ללא קו, כך שהרקע נראה רציף מעל לתוכן."}),e.jsxs(S,{value:N.headerBottomBorder===!0?"on":"off",onValueChange:v=>k({headerBottomBorder:v==="on"}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"off",children:"ללא (ברירת מחדל)"}),e.jsx(c,{value:"on",children:"הצג קו תחתון"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הצג שם דף בכותרת העליונה"}),e.jsxs(S,{value:N.showHeaderPageTitle===!1?"hidden":"shown",onValueChange:v=>k({showHeaderPageTitle:v!=="hidden"}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"shown",children:"הצג"}),e.jsx(c,{value:"hidden",children:"הסתר (לוגו ורשתות בלבד)"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"הצג תיאור SEO בכותרת העליונה"}),e.jsxs(S,{value:N.showHeaderMetaDescription===!1?"hidden":"shown",onValueChange:v=>k({showHeaderMetaDescription:v!=="hidden"}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"shown",children:"הצג (אם מולא שדה התיאור למטה)"}),e.jsx(c,{value:"hidden",children:"הסתר מהכותרת"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקום תוכן הכותרת"}),e.jsxs(S,{value:N.headerLayout??"right",onValueChange:v=>k({headerLayout:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"ליד תפריט הדפים (ברירת מחדל)"}),e.jsx(c,{value:"center",children:"מרכז השורה"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צורת אווטאר"}),e.jsxs(S,{value:N.avatarShape??"rounded",onValueChange:v=>k({avatarShape:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"rounded",children:"מעוגל"}),e.jsx(c,{value:"circle",children:"עגול"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"שורות מקסימום לתיאור בכותרת"}),e.jsx("p",{className:"text-right text-[11px] leading-snug text-muted-foreground",children:"חל על הקטע שמגיע משדה «תיאור (אופציונלי)» ב־SEO למטה. בלי תיאור — אין מה לגזור לשורות."}),e.jsx(j,{type:"number",min:1,max:4,className:"text-left",dir:"ltr",value:N.bioMaxLines!=null?String(N.bioMaxLines):"2",onChange:v=>{const Y=Number(v.target.value);Number.isFinite(Y)&&k({bioMaxLines:Math.min(4,Math.max(1,Math.round(Y)))})}})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"סגנון אייקונים חברתיים"}),e.jsxs(S,{value:N.socialIconStyle??"default",onValueChange:v=>k({socialIconStyle:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"default",children:"רגיל"}),e.jsx(c,{value:"minimal",children:"מינימלי"}),e.jsx(c,{value:"pill",children:"Pill"})]})]})]}),e.jsx(we,{label:"לוגו אזור עליון (אופציונלי)",value:N.headerLogoUrl??"",onChange:v=>k({headerLogoUrl:v||void 0}),hint:"יופיע באזור העליון הציבורי של הדף."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקום לוגו ביחס לרשתות"}),e.jsxs(S,{value:N.headerLogoPosition??"above-socials",onValueChange:v=>k({headerLogoPosition:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"above-socials",children:"מעל רשתות"}),e.jsx(c,{value:"below-socials",children:"מתחת לרשתות"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גודל לוגו בכותרת"}),e.jsxs(S,{value:String(N.headerLogoHeightPx!=null&&Number.isFinite(N.headerLogoHeightPx)?N.headerLogoHeightPx:et),onValueChange:v=>{const Y=Number(v);Number.isFinite(Y)&&k({headerLogoHeightPx:Y})},children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsx(_,{children:Pl.map(v=>e.jsx(c,{value:String(v.px),children:v.label},v.px))})]})]})]}),e.jsxs(Le,{title:"תפריט ניווט בין דפים",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:'הזזת תפריט "דפים" / ניווט בין הדפים. ברירת מחדל: מראה מערכת; ניתן להתאים רקע, צבעי טקסט, מסגרות וכיוון.'}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מיקום פתיחה"}),e.jsxs(S,{value:$.sheetSide&&$.sheetSide!=="right"?$.sheetSide:"right",onValueChange:v=>H({sheetSide:v==="right"?void 0:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"right",children:"מימין (ברירת מחדל)"}),e.jsx(c,{value:"left",children:"משמאל"}),e.jsx(c,{value:"top",children:"מלמעלה"}),e.jsx(c,{value:"bottom",children:"מלמטה"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כיוון טקסט"}),e.jsxs(S,{value:$.textDirection==="ltr"?"ltr":"rtl",onValueChange:v=>H({textDirection:v==="ltr"?"ltr":void 0}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"rtl",children:"ימין־לשמאל (ברירת מחדל)"}),e.jsx(c,{value:"ltr",children:"שמאל־לימין"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"כותרת בראש התפריט"}),e.jsx("p",{className:"text-right text-[11px] leading-snug text-muted-foreground",children:'ריק = "ניווט בין דפים".'}),e.jsx(j,{value:$.headerTitleText??"",onChange:v=>H({headerTitleText:v.target.value.trim()?v.target.value:void 0}),dir:"rtl",className:"text-right",placeholder:"ניווט בין דפים"})]}),e.jsx(p,{label:"רקע פאנל (גוף התפריט)",value:$.panelBackgroun
36dColor??"",emptyFallback:Pr,onChange:v=>H({panelBackgroundColor:v||void 0}),onClear:()=>H({panelBackgroundColor:void 0})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גרדיאנט רקע (CSS, אופציונלי)"}),e.jsx(ne,{dir:"ltr",className:"min-h-[64px] font-mono text-left text-sm",value:$.panelBackgroundGradient??"",onChange:v=>H({panelBackgroundGradient:v.target.value.trim()||void 0}),placeholder:"linear-gradient(180deg, #0f172a, #1e293b)",rows:2})]}),e.jsx(p,{label:"מסגרת קצה לפאנל (בצד הפתיחה)",value:$.panelEdgeBorderColor??"",emptyFallback:"transparent",onChange:v=>H({panelEdgeBorderColor:v||void 0}),onClear:()=>H({panelEdgeBorderColor:void 0})}),e.jsx(p,{label:"רקע שורת הכותרת בתפריט",value:$.headerBackgroundColor??"",emptyFallback:"transparent",onChange:v=>H({headerBackgroundColor:v||void 0}),onClear:()=>H({headerBackgroundColor:void 0})}),e.jsx(p,{label:"צבע טקסט הכותרת בתפריט",value:$.headerTextColor??"",emptyFallback:es,onChange:v=>H({headerTextColor:v||void 0}),onClear:()=>H({headerTextColor:void 0})}),e.jsx(p,{label:"מפריד תחת שורת הכותרת",value:$.headerBorderColor??"",emptyFallback:"transparent",onChange:v=>H({headerBorderColor:v||void 0}),onClear:()=>H({headerBorderColor:void 0})}),e.jsx(p,{label:"שם הדף הנוכחי (מעל הקישורים)",value:$.currentPageTextColor??"",emptyFallback:"#64748b",onChange:v=>H({currentPageTextColor:v||void 0}),onClear:()=>H({currentPageTextColor:void 0})}),e.jsx(p,{label:"צבע טקסט קישורי דפים (ריק = כמו ״קישורים״ בדף)",value:$.linkTextColor??"",emptyFallback:"#2563eb",onChange:v=>H({linkTextColor:v||void 0}),onClear:()=>H({linkTextColor:void 0})}),e.jsx(p,{label:"רקע במעבר על קישור (ריק = hover מערכת)",value:$.linkHoverBackgroundColor??"",emptyFallback:"#e4e4e7",onChange:v=>H({linkHoverBackgroundColor:v||void 0}),onClear:()=>H({linkHoverBackgroundColor:void 0})}),e.jsx(p,{label:'תווית "ראשי" (אם רלוונטי)',value:$.secondaryLabelTextColor??"",emptyFallback:"#64748b",onChange:v=>H({secondaryLabelTextColor:v||void 0}),onClear:()=>H({secondaryLabelTextColor:void 0})}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",className:R("w-full",P),onClick:()=>k({navMenuStyle:void 0}),children:"איפוס עיצוב תפריט ניווט"})]}),e.jsxs(Le,{title:"טקסט",children:[e.jsx(p,{label:"צבע טקסט (עמוד מלא וכותרת עליונה)",value:y,emptyFallback:es,onChange:v=>k({textColor:v}),onClear:()=>k({textColor:void 0})}),e.jsx(p,{label:"צבע קישורים (ברירת מחדל)",value:N.linkColor??"",emptyFallback:"#2563eb",onChange:v=>k({linkColor:v||void 0}),onClear:()=>k({linkColor:void 0})}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"גופן (Google Fonts)"}),e.jsxs(S,{value:C,onValueChange:v=>k({googleFontId:v==="inherit"?void 0:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{placeholder:"בחר גופן"})}),e.jsxs(_,{children:[e.jsx(c,{value:"inherit",children:"ברירת מחדל (מערכת)"}),rt.filter(v=>v.id).map(v=>e.jsx(c,{value:v.id,children:v.label},v.id))]})]})]})]}),e.jsxs(Le,{title:"כפתורים",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"משפיע על כל בלוקי Button בעמוד ובדפים יורשים."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"וריאציית כפתור"}),e.jsxs(S,{value:N.buttonVariant??"solid",onValueChange:v=>k({buttonVariant:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"solid",children:"Solid"}),e.jsx(c,{value:"outline",children:"Outline"}),e.jsx(c,{value:"soft",children:"Soft"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"עיגול פינות כפתור (px)"}),e.jsx(j,{type:"number",min:0,max:48,className:"text-left",dir:"ltr",value:N.buttonRadius!=null?String(N.buttonRadius):"12",onChange:v=>{const Y=Number(v.target.value);Number.isFinite(Y)&&k({buttonRadius:Math.min(48,Math.max(0,Math.round(Y)))})}})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"צל לכפתור"}),e.jsxs(S,{value:N.buttonShadow??"sm",onValueChange:v=>k({buttonShadow:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"none",children:"ללא"}),e.jsx(c,{value:"sm",children:"קל"}),e.jsx(c,{value:"md",children:"בינוני"}),e.jsx(c,{value:"lg",children:"חזק"})]})]})]})]}),e.jsxs(Le,{title:"צבעים",children:[e.jsx(p,{label:"צבע מילוי כפתור",value:N.buttonFillColor??"",emptyFallback:"#111827",onChange:v=>k({buttonFillColor:v||void 0}),onClear:()=>k({buttonFillColor:void 0})}),e.jsx(p,{label:"צבע טקסט כפתור",value:N.buttonTextColor??"",emptyFallback:"#ffffff",onChange:v=>k({buttonTextColor:v||void 0}),onClear:()=>k({buttonTextColor:void 0})}),e.jsx(p,{label:"צבע מסגרת כפתור",value:N.buttonBorderColor??"",emptyFallback:"#111827",onChange:v=>k({buttonBorderColor:v||void 0}),onClear:()=>k({buttonBorderColor:void 0})})]}),e.jsxs(Le,{title:"פוטר וקישורים",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"קישורי רשתות חברתיות (מוצגים בכותרת העליונה). אם תת־דף לא מגדיר שדה — הוא יורש מהדף הראשי."}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Instagram URL"}),e.jsx(j,{dir:"ltr",className:"text-left",value:N.socialInstagramUrl??"",onChange:v=>k({socialInstagramUrl:v.target.value||void 0}),placeholder:"https://instagram.com/your-page"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Facebook URL"}),e.jsx(j,{dir:"ltr",className:"text-left",value:N.socialFacebookUrl??"",onChange:v=>k({socialFacebookUrl:v.target.value||void 0}),placeholder:"https://facebook.com/your-page"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"TikTok URL"}),e.jsx(j,{dir:"ltr",className:"text-left",value:N.socialTiktokUrl??"",onChange:v=>k({socialTiktokUrl:v.target.value||void 0}),placeholder:"https://www.tiktok.com/@your-page"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"YouTube URL"}),e.jsx(j,{dir:"ltr",className:"text-left",value:N.socialYoutubeUrl??"",onChange:v=>k({socialYoutubeUrl:v.target.value||void 0}),placeholder:"https://youtube.com/@your-channel"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"WhatsApp URL"}),e.jsx(j,{dir:"ltr",className:"text-left",value:N.socialWhatsappUrl??"",onChange:v=>k({socialWhatsappUrl:v.target.value||void 0}),placeholder:"https://wa.me/972XXXXXXXXX"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"Telegram URL"}),e.jsx(j,{dir:"ltr",className:"text-left",value:N.socialTelegramUrl??"",onChange:v=>k({socialTelegramUrl:v.target.value||void 0}),placeholder:"https://t.me/your-channel"})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"רוחב תוכן מקסימלי"}),e.jsxs(S,{value:V||fr,onValueChange:v=>k({contentMaxWidth:v===fr?void 0:v}),children:[e.jsx(B,{className:"text-right",children:e.jsx(w,{})}),e.jsxs(_,{children:[e.jsx(c,{value:"sm",children:"צר (sm)"}),e.jsx(c,{value:"md",children:"בינוני (md)"}),e.jsx(c,{value:"lg",children:"גדול (lg)"}),e.jsx(c,{value:"xl",children:"רחב (xl)"}),e.jsx(c,{value:"2xl",children:"רחב מאוד (2xl)"}),e.jsx(c,{value:"5xl",children:"ברירת מחדל (5xl)"}
36),e.jsx(c,{value:"7xl",children:"מקסימלי (7xl)"}),e.jsx(c,{value:"full",children:"מלא (ללא הגבלה)"})]})]})]}),e.jsxs("div",{className:d,children:[e.jsx(i,{children:"מרווח בין בלוקים (px)"}),e.jsx(j,{type:"number",min:0,max:96,className:"text-left",dir:"ltr",value:N.blockGap!=null?String(N.blockGap):"",onChange:v=>{const Y=v.target.value;if(Y==="")k({blockGap:void 0});else{const Q=Number(Y);Number.isFinite(Q)&&k({blockGap:Math.min(96,Math.max(0,Math.round(Q)))})}},placeholder:"ללא (ברירת מחדל)"})]})]}),e.jsx(E,{type:"button",variant:"outline",size:"sm",className:R("w-full",P),onClick:M,children:"איפוס עיצוב לברירות מחדל"}),e.jsx("p",{className:"border-t pt-3 text-xs text-muted-foreground",children:"השינויים נשמרים אוטומטית לאחר עריכה."})]})})]})}async function bs(r){const s=r.slug.trim();if(!s)return{ok:!1,message:"נא למלא מזהה URL (slug)"};if(/\s/.test(s))return{ok:!1,message:"אין להשתמש ברווחים ב־slug"};if(s.includes("/")||s.includes("\\"))return{ok:!1,message:"אין להשתמש בתווי נתיב ב־slug"};if(/[%_]/.test(s))return{ok:!1,message:"תווים % ו־_ אינם מותרים ב־slug"};const{data:n,error:t}=await Mr.from("visual_landing_pages").select("id,user_id,is_draft,is_active,slug").neq("id",r.pageId).ilike("slug",s);if(t)return{ok:!1,message:t.message};const o=s.toLowerCase(),m=(n??[]).filter(x=>String(x.slug??"").trim().toLowerCase()===o);return m.some(x=>x.user_id===r.userId)?{ok:!1,message:"הכתובת כבר בשימוש בדף אחר שלך"}:m.some(x=>x.is_draft===!1&&x.is_active!==!1)?{ok:!1,message:"הכתובת תפוסה — דף ציבורי אחר כבר משתמש בה"}:{ok:!0}}function Ya({open:r,onOpenChange:s,title:n,onTitleChange:t,slug:o,onSlugChange:m,logoUrl:h,onLogoUrlChange:x,pageId:l,userId:g,isReadOnly:u,saving:b,onPersist:f}){const[a,N]=F.useState(!1),[k,M]=F.useState(null),[D,y]=F.useState(null),I=F.useCallback(async()=>{if(!r||!l||!g)return;const O=o.trim();if(!O){M(null);return}N(!0),M(null);try{const U=await bs({slug:O,pageId:l,userId:g});U.ok===!1&&M(U.message)}finally{N(!1)}},[r,l,g,o]);F.useEffect(()=>{if(!r){M(null),y(null),N(!1);return}const O=window.setTimeout(()=>{I()},450);return()=>window.clearTimeout(O)},[r,o,I]);const V=typeof window<"u"&&o.trim()?`${window.location.origin}/vl/${o.trim()}`:"",C=async()=>{if(y(null),u){s(!1);return}const O=o.trim();if(!O){y("נא למלא מזהה URL");return}const U=await bs({slug:O,pageId:l,userId:g});if(U.ok===!1){M(U.message),y(U.message);return}try{await f(),s(!1)}catch($){const H=$ instanceof Error?$.message:"שמירה נכשלה";y(H)}};return e.jsx(_s,{open:r,onOpenChange:s,children:e.jsxs(Fs,{className:"max-h-[min(90vh,640px)] gap-0 overflow-hidden p-0 sm:max-w-lg",dir:"rtl",children:[e.jsxs(Ts,{className:"space-y-1 border-b border-border/60 px-4 py-3 text-start",children:[e.jsx(Is,{className:"text-base",children:"הגדרות ראשוניות לדף"}),e.jsx(Tl,{className:"text-xs leading-snug",children:`לפני הוספת ווידג'טים כדאי להגדיר שם, כתובת ציבורית ולוגו. אפשר לערוך שוב בכל עת דרך גלגל השיניים ("הגדרות דף").`})]}),e.jsxs("div",{className:"max-h-[min(70vh,520px)] space-y-4 overflow-y-auto px-4 py-4 text-start",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"שם הדף"}),e.jsx(j,{value:n,onChange:O=>t(O.target.value),dir:"rtl",className:"text-right",disabled:u})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Slug (כתובת ציבורית)"}),e.jsx(j,{value:o,onChange:O=>m(O.target.value),dir:"ltr",className:"text-left",disabled:u,autoComplete:"off"}),V?e.jsxs("p",{className:"text-[11px] leading-snug text-muted-foreground break-all",dir:"ltr",children:["כתובת ציבורית: ",V]}):null,a?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"בודק זמינות…"}):null,k?e.jsx("p",{className:"text-xs text-destructive",children:k}):null]}),e.jsx(we,{label:"לוגו (ראש העמוד)",value:h,onChange:x,hint:"מוצג בכותרת העליונה של הדף הציבורי (ניתן לשנות גם בגודל ובמיקום בהגדרות הדף)."}),D?e.jsx("p",{className:"text-xs text-destructive",children:D}):null]}),e.jsxs(Il,{className:"flex flex-col-reverse gap-2 border-t border-border/60 px-4 py-3 sm:flex-row sm:justify-between",children:[e.jsx(E,{type:"button",variant:"outline",size:"sm",className:P,disabled:b,onClick:()=>s(!1),children:"אחר כך"}),e.jsx(E,{type:"button",size:"sm",className:P,disabled:u||b,onClick:()=>void C(),children:b?"שומר…":"שמירה והמשך"})]})]})})}const Xe="palette:",_r="canvas-drop",nr="col-drop:",qa=["layout","content","commerce","advanced"],Qa={layout:"פריסה",content:"תוכן",commerce:"מסחר",advanced:"מתקדם"};function Ve(r){return Number(r.columnCount??2)===3?["column1","column2","column3"]:["column1","column2"]}function Or(r,s){for(const n of r){if(n.id===s)return n;if(n.type!=="columns")continue;const t=n.props;for(const o of Ve(t)){const m=Array.isArray(t[o])?t[o]:[],h=Or(m,s);if(h)return h}}return null}function xr(r,s,n){let t=!1;return{next:r.map(m=>{if(m.id===s)return t=!0,n(m);if(m.type!=="columns")return m;const h=m.props;let x=!1;const l={...h};for(const g of Ve(h)){const u=Array.isArray(h[g])?h[g]:[],b=xr(u,s,n);b.changed&&(x=!0,t=!0,l[g]=b.next)}return x?{...m,props:l}:m}),changed:t}}function rl(r,s){let n=!1;const t=r.filter(m=>m.id===s?(n=!0,!1):!0);return n?{next:t,removed:!0}:{next:t.map(m=>{if(m.type!=="columns")return m;const h=m.props;let x=!1;const l={...h};for(const g of Ve(h)){const u=Array.isArray(h[g])?h[g]:[],b=rl(u,s);b.removed&&(x=!0,n=!0,l[g]=b.next)}return x?{...m,props:l}:m}),removed:n}}function sl(r,s){for(let n=0;n<r.length;n+=1){const t=r[n];if(t.id===s){const o=bt(t),m=[...r];return m.splice(n+1,0,o),{next:m,copyId:o.id}}}for(let n=0;n<r.length;n+=1){const t=r[n];if(t.type!=="columns")continue;const o=t.props;for(const m of Ve(o)){const h=Array.isArray(o[m])?o[m]:[],x=sl(h,s);if(x.copyId){const l=[...r];return l[n]={...t,props:{...o,[m]:x.next}},{next:l,copyId:x.copyId}}}}return{next:r,copyId:null}}function ll(r,s){let n=null;return{next:r.map(o=>{if(o.type!=="columns")return o;const m=o.props;let h=!1;const x={...m};for(const l of Ve(m)){const g=Array.isArray(m[l])?m[l]:[],u=g.findIndex(f=>f.id===s);if(u>=0){n=g[u];const f=[...g];f.splice(u,1),x[l]=f,h=!0;continue}const b=ll(g,s);b.detached&&(n=b.detached,x[l]=b.next,h=!0)}return h?{...o,props:x}:o}),detached:n}}function Ja(r,s,n,t){let o=!1;return{next:r.map(h=>{if(h.id!==s||h.type!=="columns")return h;const x=h.props;if(n==="column3"&&Number(x.columnCount??2)!==3)return h;const l=Array.isArray(x[n])?x[n]:[];return o=!0,{...h,props:{...x,[n]:[...l,t]}}}),changed:o}}function Fr(r,s){for(const n of r){if(n.type!=="columns")continue;const t=n.props;for(const o of Ve(t)){const m=Array.isArray(t[o])?t[o]:[],h=m.findIndex(l=>l.id===s);if(h>=0)return{parentId:n.id,key:o,index:h};const x=Fr(m,s);if(x)return x}}return null}function Za(r,s){const n=xr(r,s.parentId,x=>{const l=x.props,g=Array.isArray(l[s.key])?l[s.key]:[];if(s.index<0||s.index>=g.length)return x;const u=[...g];return u.splice(s.index,1),{...x,props:{...l,[s.key]:u}}}),t=Or(r,s.parentId);if(!t||t.type!=="columns")return{next:r,removed:null};const o=t.props,m=Array.isArray(o[s.key])?o[s.key]:[],h=s.index>=0&&s.index<m.length?m[s.index]:null;return!h||!n.changed?{next:r,removed:null}:{next:n.next,removed:h}}function Pa(r,s,n){return xr(r,s.parentId,t=>{const o=t.props,m=Array.isArray(o[s.key])?o[s.key]:[],h=Math.max(0,Math.min(s.index,m.length)),x=[...m];return x.splice(h,0,n),{...t,props:{...o,[s.key]:x}}})}function en({block:r,selected:s,onSelect:n,children:t}
36){const{attributes:o,listeners:m,setNodeRef:h,transform:x,transition:l,isDragging:g}=Jt({id:r.id}),b={transform:x?`translate3d(${Number(x.x??0)}px, ${Number(x.y??0)}px, 0) scaleX(${Number(x.scaleX??1)}) scaleY(${Number(x.scaleY??1)})`:void 0,transition:l,opacity:g?.5:1};return e.jsx("div",{ref:h,dir:"rtl",style:b,className:R("cursor-grab touch-none rounded-lg border border-border/80 bg-muted/15 p-2 text-start shadow-sm transition-[border-color,box-shadow,background-color] active:cursor-grabbing hover:border-border hover:bg-muted/25",s&&"border-primary/70 bg-primary/[0.04] ring-1 ring-primary/25"),onClick:f=>{f.stopPropagation(),n()},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&n()},role:"button",tabIndex:0,...o,...m,children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"pointer-events-none mt-1 shrink-0 select-none text-muted-foreground/80","aria-hidden":!0,children:e.jsx(Ar,{className:"h-5 w-5"})}),e.jsx("div",{className:"min-w-0 flex-1 overflow-hidden text-start",children:t})]})})}function rn({type:r,onQuickAdd:s}){const n=Ee(r),{attributes:t,listeners:o,setNodeRef:m,transform:h,isDragging:x}=Ms({id:`${Xe}${r}`,data:{type:r,fromPalette:!0}}),l=F.useRef(null),g=F.useRef(!1),u=n==null?void 0:n.icon,b=h?{transform:`translate3d(${h.x}px, ${h.y}px, 0)`}:void 0;return e.jsxs("button",{type:"button",ref:m,dir:"rtl",style:b,className:R("flex w-full touch-none items-center gap-2 rounded-md border border-border/55 bg-card/80 px-2.5 py-1.5 text-start text-sm transition-colors hover:border-border hover:bg-muted/30",x&&"opacity-60"),onPointerDown:f=>{l.current={x:f.clientX,y:f.clientY},g.current=!1},onPointerMove:f=>{l.current&&(Math.abs(f.clientX-l.current.x)>6||Math.abs(f.clientY-l.current.y)>6)&&(g.current=!0)},onPointerUp:()=>{l.current=null},onClick:()=>{g.current||x||s(r)},...o,...t,children:[e.jsx("span",{className:"min-w-0 flex-1",children:(n==null?void 0:n.label)??r}),u&&e.jsx(u,{className:"h-4 w-4 shrink-0 opacity-80"})]})}function sn({blocks:r,selectedId:s,onSelectBlock:n,surfaceStyle:t,contentMaxWidthClass:o,linkColor:m,buttonVariant:h,buttonRadius:x,buttonShadow:l,buttonTextColor:g,buttonFillColor:u,buttonBorderColor:b,pageId:f,navbarFamilyPages:a,navbarPreview:N}){const{setNodeRef:k,isOver:M}=Es({id:_r}),D=F.useMemo(()=>r.map(I=>I.id),[r]),y={...t,minHeight:"max(420px, 100%)",flexShrink:0};return e.jsxs("div",{ref:k,dir:"rtl",style:y,className:R("w-full shrink-0 rounded-lg border border-dashed border-muted-foreground/30 bg-transparent p-3 text-start transition-[box-shadow,border-color]",M&&"border-primary/50 bg-primary/[0.02] ring-1 ring-primary/25"),id:_r,children:[N,e.jsx("div",{className:R("mx-auto w-full",o),children:e.jsx(Wt,{items:D,strategy:Ht,children:e.jsxs("div",{className:"space-y-4",children:[r.length===0&&e.jsx("p",{className:"py-16 text-center text-sm text-muted-foreground",children:"גרור וידג'טים לכאן"}),r.map(I=>e.jsx(en,{block:I,selected:s===I.id,onSelect:()=>n(I.id),children:e.jsx(As,{doc:{schemaVersion:1,blocks:[I]},ctx:{variant:"editor",pageId:f},linkColor:m,buttonVariant:h,buttonRadius:x,buttonShadow:l,buttonTextColor:g,buttonFillColor:u,buttonBorderColor:b,selectedBlockId:s,onSelectBlock:n,navbarFamilyPages:a})},I.id))]})})})]})}function Jn(){var Wr;const{pageId:r}=Ll(),s=El(),[n,t]=Ml(),{effectiveUserId:o,isReadOnly:m,actualUserId:h}=Ke(),{isAdmin:x}=Rl(),{data:l,isLoading:g,isError:u,error:b,refetch:f}=gt(r),{data:a}=jt(o),N=vt(),{groups:k}=Al(o),{data:M=[]}=Er({queryKey:["visual-editor-legacy-landing-pages",o],enabled:!!o,queryFn:async()=>{const{data:T,error:z}=await Mr.from("landing_pages").select("id, title, slug").eq("user_id",o).order("sort_order",{ascending:!0});if(z)throw z;return T??[]}}),[D,y]=F.useState(""),[I,V]=F.useState(""),[C,O]=F.useState(""),[U,$]=F.useState(""),[H,xe]=F.useState(""),[re,_e]=F.useState(""),[v,Y]=F.useState([]),[Q,se]=F.useState(null),[Oe,qe]=F.useState(!1),[ze,Qe]=F.useState("mobile"),[mr,de]=F.useState("palette"),[te,Fe]=F.useState({}),[Te,Ue]=F.useState(null),[me,fe]=F.useState(!1),[le,Z]=F.useState(!1),[hr,He]=F.useState(!1),[Ce,Ae]=F.useState(null),[gr,zr]=F.useState(!1),Je=F.useRef(!1),Ze=F.useRef([]),Pe=F.useRef([]),ce=F.useCallback((T,z=!0)=>{Y(K=>(z&&(Ze.current.push(K),Pe.current=[]),T))},[]),jr=F.useCallback(()=>
36{if(!Ze.current.length)return;const T=Ze.current.pop();Pe.current.push(v),Y(T)},[v]),vr=F.useCallback(()=>{if(!Pe.current.length)return;const T=Pe.current.pop();Ze.current.push(v),Y(T)},[v]);F.useEffect(()=>{const T=z=>{(z.metaKey||z.ctrlKey)&&z.key==="z"&&(z.preventDefault(),z.shiftKey?vr():jr())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[jr,vr]);const tl=F.useCallback(()=>{if(!n.get("setup"))return;const T=new URLSearchParams(n);T.delete("setup"),t(T,{replace:!0})},[n,t]),er=n.get("setup")==="1";F.useEffect(()=>{fe(!1),Je.current=!1},[r]),F.useEffect(()=>{er||(Je.current=!1)},[er]),F.useEffect(()=>{if(!(!l||l.id!==r)&&(y(l.title),V(l.slug),O(l.meta_title??""),$(l.meta_description??""),xe(l.og_image_url??""),_e(l.facebook_pixel_id??""),!me)){Fe(st(l.page_style));const T=ls(l.blocks);Y(T.blocks),fe(!0)}},[l,r,me]),F.useEffect(()=>{!l||!me||!er||m||Je.current||(Je.current=!0,zr(!0))},[l,me,er,m]);const al=F.useCallback(async()=>{if(!r||!o||!l)throw new Error("חסרים נתונים לשמירה");const T={schemaVersion:1,blocks:v},z=Ge(te);await N.mutateAsync({id:r,user_id:o,title:D,slug:I,meta_title:C.trim()||null,meta_description:U.trim()||null,og_image_url:H.trim()||null,facebook_pixel_id:re.trim()||null,...Object.keys(z).length>0?{page_style:z}:{},blocks:T}),ve.success("הגדרות נשמרו")},[r,o,l,v,te,D,I,C,U,H,re,N]);F.useEffect(()=>{if(!me||!r||!l||!o)return;const T=setTimeout(()=>{const z={schemaVersion:1,blocks:v},K=Ge(te);N.mutate({id:r,user_id:o,title:D,slug:I,meta_title:C.trim()||null,meta_description:U.trim()||null,og_image_url:H.trim()||null,facebook_pixel_id:re.trim()||null,...Object.keys(K).length>0?{page_style:K}:{},blocks:z})},1600);return()=>clearTimeout(T)},[v,D,I,C,U,H,re,te,r,l,o,N,me]);const nl=lt(Nr(ut,{activationConstraint:{distance:10}}),Nr(ct,{activationConstraint:{delay:200,tolerance:8}}),Nr(dt,{coordinateGetter:ea})),il=T=>{const{active:z,over:K}=T;if(Ue(null),!K)return;const ae=String(z.id);if(ae.startsWith(rs)){const ee=ae.slice(rs.length),q=String(K.id);if(q.startsWith(ss)){const ge=q.slice(ss.length);if(!ge||ge===ee)return;const je=Fr(v,ee),oe=Fr(v,ge);if(!je||!oe)return;const ye=Za(v,je);if(!ye.removed)return;const gl=je.parentId===oe.parentId&&je.key===oe.key&&je.index<oe.index?oe.index-1:oe.index,Xr=Pa(ye.next,{parentId:oe.parentId,key:oe.key,index:gl},ye.removed);if(!Xr.changed)return;ce(Xr.next),se(ye.removed.id);return}if(!q.startsWith(nr))return;const J=q.slice(nr.length),pe=J.indexOf(":");if(pe<=0)return;const G=J.slice(0,pe),ue=J.slice(pe+1),he=ll(v,ee);if(!he.detached)return;const ie=Ja(he.next,G,ue,he.detached);if(!ie.changed)return;ce(ie.next),se(he.detached.id);return}if(ae.startsWith(Xe)){const ee=ae.slice(Xe.length),q=ts(ee),J=String(K.id);if(J.startsWith(nr)){const G=J.slice(nr.length),ue=G.indexOf(":");if(ue>0){const he=G.slice(0,ue),ie=G.slice(ue+1),ge=v.find(je=>je.id===he&&je.type==="columns");if(ge){if(ie==="column3"&&Number(ge.props.columnCount??2)!==3)return;const je=v.map(oe=>{if(oe.id!==he)return oe;const ye=oe.props,$r=Array.isArray(ye[ie])?ye[ie]:[];return{...oe,props:{...ye,[ie]:[...$r,q]}}});ce(je),se(he);return}}}if(K.id===_r){ce([...v,q]),se(q.id);return}const pe=v.findIndex(G=>G.id===K.id);if(pe>=0){const G=[...v];G.splice(pe,0,q),ce(G),se(q.id)}return}if(z.id!==K.id){const ee=v.findIndex(J=>J.id===z.id),q=v.findIndex(J=>J.id===K.id);ee>=0&&q>=0&&ce(or(v,ee,q))}},Ur=Q?Or(v,Q):null,L=F.useMemo(()=>tt(te),[te]),Hr=F.useMemo(()=>at(L),[L]),ol=F.useMemo(()=>qa.map(T=>({cat:T,label:Qa[T],items:pt.filter(z=>z.category===T)})).filter(T=>T.items.length>0),[]),rr=F.useMemo(()=>{var pe;if(!r||!(a!=null&&a.length))return[];const T=a.find(G=>G.id===r);if(!T)return[];const z=new Map(a.map(G=>[G.id,G]));let K=T.id;for(;K;){const G=((pe=z.get(K))==null?void 0:pe.parent_page_id)??null;if(!G)break;K=G}if(!K)return[];const ae=new Map;for(const G of a){if(!G.parent_page_id)continue;const ue=ae.get(G.parent_page_id)??[];ue.push(G),ae.set(G.parent_page_id,ue)}const ee=[K],q=new Set,J=[];for(;ee.length;){const G=ee.shift();if(!G||q.has(G))continue;q.add(G);const ue=z.get(G);ue&&J.push(ue);const he=[...ae.get(G)??[]].sort((ie,ge)=>Number(ie.sort_order??0)!==Number(ge.sort_order??0)?Number(ie.sort_order??0)-Number(ge.sort_order??0):ie.title.localeCompare(ge.title,"he"));ee.push(...he.map(ie=>ie.id))}return J.map(G=>({id:G.id,slug:G.slug,title:G.title,is_main:!!G.is_main,parent_page_id:G.parent_page_id,sort_order:Number(G.sort_order??0)}))},[r,a]),Ie=F.useMemo(()=>({id:r??"editor-preview",slug:I||"preview",title:D||"דף בתצוגה מקדימה",is_main:!!(l!=null&&l.is_main),parent_page_id:(l==null?void 0:l.parent_page_id)??null,sort_order:Number((l==null?void 0:l.sort_order)??0),meta_description:U.trim()||null}),[r,I,D,l==null?void 0:l.is_main,l==null?void 0:l.parent_page_id,l==null?void 0:l.sort_order,U]),Gr=F.useMemo(()=>{const T=rr.map(z=>({...z,meta_description:z.id===Ie.id?Ie.meta_description:null}));
36return T.some(z=>z.id===Ie.id)||T.unshift(Ie),T},[rr,Ie]),dl=T=>{if(!Q)return;const z=xr(v,Q,K=>({...K,props:{...K.props,...T}}));z.changed&&ce(z.next)},cl=()=>{if(!Q)return;const T=rl(v,Q);T.removed&&(ce(T.next),se(null))},ul=()=>{if(!Q)return;const T=sl(v,Q);T.copyId&&(ce(T.next),se(T.copyId))},xl=async()=>{if(!(!r||!o||!l))try{const T=Ge(te);await N.mutateAsync({id:r,user_id:o,title:D,slug:I,meta_title:C.trim()||null,meta_description:U.trim()||null,og_image_url:H.trim()||null,facebook_pixel_id:re.trim()||null,...Object.keys(T).length>0?{page_style:T}:{},is_draft:!1,published_at:new Date().toISOString(),blocks:{schemaVersion:1,blocks:v}}),ve.success("הדף פורסם")}catch{ve.error("לא ניתן לפרסם (ייתכן שמזהה URL תפוס)")}};if(g)return e.jsx(br,{hideAppSidebar:!0,plainChrome:!0,children:e.jsx("div",{className:"p-8 text-start",dir:"rtl",children:"טוען…"})});if(u||!l){const T=b instanceof Error?b.message:"לא ניתן לטעון את הדף (בדוק חיבור או הרצת מיגרציות ל־Supabase).";return e.jsx(br,{hideAppSidebar:!0,plainChrome:!0,children:e.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-4 p-8 text-center",dir:"rtl",children:[e.jsx("p",{className:"text-destructive",children:T}),e.jsx(E,{type:"button",variant:"outline",size:"sm",className:P,onClick:()=>void f(),children:"נסה שוב"}),e.jsx(E,{type:"button",variant:"ghost",size:"sm",onClick:()=>s("/landing-builder"),children:"לרשימת דפים"})]})})}const ml={schemaVersion:1,blocks:v},Ne=le?"h-8 gap-1 px-2 text-xs text-foreground hover:bg-muted/70":"h-8 gap-1 px-2 text-xs text-foreground/90 hover:bg-white/10",hl=le?"h-8 w-8 shrink-0 text-foreground hover:bg-muted/70":"h-8 w-8 shrink-0 text-foreground/90 hover:bg-white/10";return e.jsx(br,{hideAppSidebar:!0,plainChrome:!0,children:e.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden md:h-[100dvh] md:max-h-[100dvh]",dir:"rtl",children:[e.jsxs("header",{className:R("sticky top-0 z-30 flex shrink-0 flex-nowrap items-center gap-2 border-b px-3 py-2 text-start transition-colors",le?"landing-editor-light-surface border-border bg-background text-foreground shadow-sm":"border-white/10 glass"),children:[e.jsxs("div",{className:"flex min-w-0 flex-1 basis-0 flex-wrap items-center justify-start gap-1.5",children:[e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,onClick:()=>s("/"),children:[e.jsx(Et,{className:"h-3.5 w-3.5 shrink-0"}),"חזרה"]}),e.jsx("span",{className:R("hidden text-xs sm:inline",le?"text-muted-foreground":"text-foreground/70"),children:"עורך דף נחיתה"}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,onClick:()=>s("/landing-builder"),children:[e.jsx(Dl,{className:"h-3.5 w-3.5 shrink-0"}),"דפים"]}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,onClick:jr,children:[e.jsx(It,{className:"h-3.5 w-3.5 shrink-0"}),"ביטול"]}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,onClick:vr,children:[e.jsx(At,{className:"h-3.5 w-3.5 shrink-0"}),"שחזור"]})]}),e.jsxs("div",{className:"flex min-w-0 max-w-[min(9.5rem,28vw)] shrink flex-col items-center justify-center px-0.5 text-center sm:max-w-none sm:px-1",children:[e.jsx("span",{className:R("w-full truncate font-semibold tracking-tight",le?"text-xs text-foreground sm:text-sm":"text-xs text-foreground/95 sm:text-sm"),children:"CashPages"}),e.jsx("span",{className:R("w-full truncate text-[9px] font-medium leading-tight sm:text-[10px] md:text-xs",le?"text-muted-foreground":"text-foreground/65"),children:"by CashEngine"})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 basis-0 shrink-0 items-center justify-start gap-1.5",dir:"ltr",children:[l.is_draft?e.jsx(Jr,{variant:"secondary",className:R("h-5 px-1.5 text-[10px] font-medium",le?"border border-border bg-muted/50 text-foreground":"border border-white/20 bg-white/10 text-foreground/90"),children:"טיוטה"}):e.jsx(Jr,{variant:"secondary",className:R("h-5 px-1.5 text-[10px] font-medium",le?"border border-primary/30 bg-primary/15 text-foreground":"border border-primary/30 bg-primary/15 text-foreground
36/90"),children:"מפורסם"}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:R(Ne,P),onClick:xl,children:[e.jsx(Rt,{className:"h-3.5 w-3.5 shrink-0"}),"פרסם"]}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,onClick:()=>qe(!0),children:[e.jsx(Vl,{className:"h-3.5 w-3.5 shrink-0"}),"תצוגה"]}),e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,disabled:!o||m,onClick:()=>He(!0),title:"שמירת המצב הנוכחי כתבנית במרקטפלייס",children:[e.jsx(Ns,{className:"h-3.5 w-3.5 shrink-0"}),"תבנית"]}),e.jsxs(xt,{children:[e.jsx(mt,{asChild:!0,children:e.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:Ne,title:"שכבות — סדר הווידג'טים בדף",children:[e.jsx(Mt,{className:"h-3.5 w-3.5 shrink-0"}),"שכבות"]})}),e.jsxs(ht,{align:"end",sideOffset:6,className:"w-[min(26rem,88vw)] p-0",dir:"rtl",children:[e.jsxs("div",{className:"border-b border-border/70 px-3 py-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"שכבות"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"לחיצה לבחירה · גרירה לשינוי סדר הווידג'טים"})]}),e.jsx("div",{className:"max-h-[55vh] overflow-y-auto p-2",children:v.length===0?e.jsx("p",{className:"rounded-md px-2 py-3 text-center text-xs text-muted-foreground",children:"אין עדיין ווידג'טים בעמוד."}):e.jsx("div",{className:"space-y-1",children:v.map((T,z)=>{var q;const K=((q=Ee(T.type))==null?void 0:q.label)??T.type,ae=Q===T.id,ee=Ce===z;return e.jsxs("button",{type:"button",draggable:!0,className:R("flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-right transition-colors",ae?"border-primary/55 bg-primary/10":"border-border/70 bg-background hover:bg-muted/50",ee&&"opacity-60"),onClick:()=>{de("palette"),se(T.id)},onDragStart:()=>Ae(z),onDragEnd:()=>Ae(null),onDragOver:J=>J.preventDefault(),onDrop:()=>{if(Ce==null||Ce===z){Ae(null);return}const J=or(v,Ce,z);ce(J),se(T.id),Ae(null)},children:[e.jsx(Ar,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("span",{className:"min-w-[1.5rem] shrink-0 text-xs text-muted-foreground",children:[z+1,"."]}),e.jsx("span",{className:"truncate text-sm text-foreground",children:K})]},T.id)})})})]})]}),e.jsx(E,{type:"button",variant:"ghost",size:"icon",className:hl,"aria-label":"הגדרות דף",title:"הגדרות דף",onClick:()=>{se(null),de("page")},children:e.jsx(Ol,{className:"h-3.5 w-3.5"})})]})]}),e.jsxs("div",{className:"landing-editor-light-surface flex min-h-0 flex-1 flex-col overflow-hidden bg-background text-foreground","data-landing-editor-light":"",children:[e.jsxs(nt,{sensors:nl,collisionDetection:it,onDragStart:T=>{const z=String(T.active.id);z.startsWith(Xe)?Ue({type:z.slice(Xe.length)}):Ue({id:z})},onDragEnd:il,onDragCancel:()=>Ue(null),children:[e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-hidden p-4 lg:flex-row lg:items-stretch lg:gap-4 lg:p-6",dir:"rtl",children:[e.jsx("aside",{dir:"rtl",className:"landing-editor-sidebar order-2 flex min-h-0 w-full shrink-0 flex-col overflow-hidden text-start lg:order-1 lg:z-20 lg:h-full lg:min-h-0 lg:w-[380px] lg:max-h-full lg:self-stretch",children:e.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-[inherit] bg-inherit",children:Q&&Ur?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sticky top-0 z-10 shrink-0 border-b border-border/70 bg-muted/40 p-2.5 text-start backdrop-blur-sm",children:e.jsxs("button",{type:"button",className:R("inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground underline-offset-4","hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),onClick:()=>{se(null),de("palette")},children:[e.jsx(Ws,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),"חזרה לווידג'טים"]})}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col bg-transparent",children:e.jsx(Ra,{embedded:!0,block:Ur,messagingGroups:k,legacyLandingPages:M,onPatch:dl,onDuplicate:ul,onDelete:cl,pageId:r})})]}):mr==="page"?e.jsx(Ka,{embedded:!0,onBack:()=>de("palette"),title:D,onTitleChange:y,slug:I,onSlugChange:V,metaTitle:C,onMetaTitleChange:O,metaDescription:U,onMetaDescriptionChange:$,ogImageUrl:H,onOgImageUrlChange:xe,facebookPixelId:re,onFacebookPixelIdChange:_e,pageStyle:te,onPageStylePatch:T=>Fe(z=>{if(Object.hasOwn(T,"navMenuStyle")&&T.navMenuStyle===void 0){const{navMenuStyle:ae,...ee}=z,{navMenuStyle:q,...J}=T;return{...ee,...J}}const K={...z,...T};
36return T.navMenuStyle&&(K.navMenuStyle={...z.navMenuStyle??{},...T.navMenuStyle}),K}),onPageStyleReset:()=>Fe({})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{dir:"rtl",className:"sticky top-0 z-10 shrink-0 border-b border-primary/25 bg-gradient-to-bl from-primary/20 via-primary/12 to-primary/5 px-3 py-3 text-start shadow-sm ring-1 ring-inset ring-primary/10 backdrop-blur-sm",children:[e.jsx("h2",{className:"text-sm font-semibold tracking-tight text-foreground sm:text-base",children:"ווידג'טים"}),e.jsx("p",{className:"mt-1 text-xs leading-relaxed text-foreground/80 sm:text-sm",children:"לפי קטגוריה · גרירה לקנבס · לחיצה על בלוק לעריכה"})]}),e.jsx(ur,{className:"h-full min-h-0 flex-1",children:e.jsx("div",{className:"space-y-4 p-2.5",dir:"rtl",children:ol.map(T=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-start text-sm font-semibold text-foreground/80 sm:text-[0.9375rem]",children:T.label}),e.jsx("div",{className:"grid grid-cols-2 gap-x-2 gap-y-1.5",children:T.items.map(z=>e.jsx(rn,{type:z.type,onQuickAdd:K=>{const ae=ts(K);ce([...v,ae]),se(ae.id)}},z.type))})]},T.cat))})})]})})}),e.jsx("div",{className:"order-1 flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overscroll-contain text-start lg:order-2",style:{backgroundColor:L.backgroundColor},onScroll:T=>Z(T.currentTarget.scrollTop>12),children:e.jsx(sn,{blocks:v,selectedId:Q,onSelectBlock:T=>{de("palette"),se(T)},surfaceStyle:Hr,contentMaxWidthClass:L.contentMaxWidthClass,linkColor:L.linkColor,buttonVariant:L.buttonVariant,buttonRadius:L.buttonRadius,buttonShadow:L.buttonShadow,buttonTextColor:L.buttonTextColor,buttonFillColor:L.buttonFillColor,buttonBorderColor:L.buttonBorderColor,pageId:r,navbarFamilyPages:rr,navbarPreview:e.jsx(os,{alwaysShow:!0,inheritPageBackground:!0,page:Ie,siblingPages:Gr,headerStyle:{layout:L.headerLayout,showTopHeader:L.showTopHeader,showHeaderPageTitle:L.showHeaderPageTitle,showHeaderMetaDescription:L.showHeaderMetaDescription,bioMaxLines:L.bioMaxLines,socialIconStyle:L.socialIconStyle,logoUrl:L.headerLogoUrl,logoPosition:L.headerLogoPosition,logoHeightPx:L.headerLogoHeightPx,backgroundColor:L.backgroundColor,textColor:L.textColor,borderColor:L.buttonBorderColor,socialLinks:{instagram:L.socialInstagramUrl,facebook:L.socialFacebookUrl,tiktok:L.socialTiktokUrl,youtube:L.socialYoutubeUrl,whatsapp:L.socialWhatsappUrl,telegram:L.socialTelegramUrl},showBottomBorder:L.headerBottomBorder,navMenu:L.navMenu}})})})]}),e.jsx(ot,{children:Te!=null&&Te.type?e.jsx("div",{className:"landing-editor-light-surface rounded-md border border-border/80 bg-card px-2.5 py-1.5 text-start text-sm shadow-sm ring-1 ring-border/30",dir:"rtl",children:(Wr=Ee(Te.type))==null?void 0:Wr.label}):null})]}),e.jsx(_s,{open:Oe,onOpenChange:qe,children:e.jsxs(Fs,{className:"landing-editor-light-surface max-w-4xl max-h-[90vh] overflow-y-auto bg-background text-foreground",dir:"rtl",children:[e.jsx(Ts,{children:e.jsx(Is,{children:"תצוגה מקדימה"})}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(E,{type:"button",variant:ze==="mobile"?"default":"outline",size:"sm",onClick:()=>Qe("mobile"),className:"gap-1.5",children:[e.jsx(zl,{className:"h-3.5 w-3.5"}),"מובייל"]}),e.jsxs(E,{type:"button",variant:ze==="desktop"?"default":"outline",size:"sm",onClick:()=>Qe("desktop"),className:"gap-1.5",children:[e.jsx(Lt,{className:"h-3.5 w-3.5"}),"דסקטופ"]})]}),e.jsxs("div",{className:R("pointer-events-auto rounded-lg border p-4",ze==="mobile"?"mx-auto w-full max-w-[420px]":"w-full"),style:Hr,children:[e.jsx(os,{alwaysShow:!0,inheritPageBackground:!0,page:Ie,siblingPages:Gr,headerStyle:{layout:L.headerLayout,showTopHeader:L.showTopHeader,showHeaderPageTitle:L.showHeaderPageTitle,showHeaderMetaDescription:L.showHeaderMetaDescription,bioMaxLines:L.bioMaxLines,socialIconStyle:L.socialIconStyle,logoUrl:L.headerLogoUrl,logoPosition:L.headerLogoPosition,logoHeightPx:L.headerLogoHeightPx,backgroundColor:L.backgroundColor,textColor:L.textColor,borderColor:L.buttonBorderColor,socialLinks:{instagram:L.socialInstagramUrl,facebook:L.socialFacebookUrl,tiktok:L.socialTiktokUrl,youtube:L.socialYoutubeUrl,whatsapp:L.socialWhatsappUrl,telegram:L.socialTelegramUrl},showBottomBorder:L.headerBottomBorder,navMenu:L.navMenu}}),e.jsx("div",{className:R("mx-auto w-full",L.contentMaxWidthClass),children:e.jsx(As,{doc:ml,ctx:{variant:"editor",pageId:r},rootGapPx:L.blockGapPx,linkColor:L.linkColor,buttonVariant:L.buttonVariant,buttonRadius:L.buttonRadius,buttonShadow:L.buttonShadow,buttonTextColor:L.buttonTextColor,buttonFillColor:L.buttonFillColor,buttonBorderColor:L.buttonBorderColor,navbarFamilyPages:rr})})]})]})}),o&&r&&l?e.jsx(Ya,{open:gr,onOpenChange:T=>{zr(T),T||tl()},title:D,onTitleChange:y,slug:I,onSlugChange:V,logoUrl:te.headerLogoUrl??"",onLogoUrlChange:T=>Fe(z=>({...z,headerLogoUrl:T||void 0})),pageId:r,userId:o,isReadOnly:m,saving:N.isPending,onPersist:al}):null,e.jsx(Ct,{open:hr,onOpenChange:He,userId:o,actualUserId:h,isAdmin:x,isReadOnly:m,defaultTitle:D?`תבנית: ${D}
36`:"תבנית חדשה",blocks:me?ls({schemaVersion:1,blocks:v}):null,pageStyle:me&&Object.keys(Ge(te)).length>0?Ge(te):null})]})]})})}export{Jn 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.