PageSourceSearch

https://tsofit.org.il/assets/KibbutzSiteSurvey-BV8lW8lb.js

js tsofit.org.il collected 2026-10-02 14:23:18 UTC 5,694 bytes, 1 lines download raw bytes

1import{ac as I,d7 as L,r as i,d as N,j as e,aI as y,L as G,bG as H,x as P,aC as T,z as w}from"./index-BH8Hq4fF.js";import{S as K}from"./SitePageShell-BgpTtAUN.js";import{R as q}from"./ResidentLoginRedirect-BQvN2YCV.js";import{R as A}from"./refresh-cw-kjmzcQOe.js";import"./usePaymentPlacements-TNXseU1e.js";import"./siteLogoPanel-FM6PxkL_.js";import"./user-cog-BikfPThJ.js";import"./bell-ring-Db0rTCDW.js";import"./life-buoy-7W458jwF.js";import"./log-in-Ci9k4xKf.js";import"./kibbutzSiteUtils-BetuJpui.js";import"./info-CMJoL0mv.js";import"./folder-open-CWzvkunn.js";import"./graduation-cap-DnGVwVvF.js";import"./file-check-BSDzA9vo.js";import"./instagram-BHE3hi9u.js";import"./sliders-horizontal-D7cGhbbA.js";import"./youtube-CpfQxPon.js";import"./leaf-DJuap4o0.js";import"./paymentCatalogs-CvImawYM.js";import"./chevron-left-DaNP-hnR.js";import"./siren-DUj7NgPZ.js";import"./clipboard-check-BKoevPr7.js";import"./personalHeading-DPM7lbxX.js";import"./ContentPageHero-CiDpAGe7.js";const D="#4f46e5";function pe(){const{kibbutzId:a,campaignId:x}=I(),c=L(a),d=c==null?void 0:c.phone,[h,f]=i.useState(null),[k,p]=i.useState(!0),[j,b]=i.useState(""),[C,g]=i.useState(""),l=i.useCallback(async r=>{if(!a||!d){p(!1);return}r||p(!0);try{const t=await N.functions.invoke("residentGroupSurvey",{community_id:a,phone:d,campaign_id:x,action:"get"});f((t==null?void 0:t.data)||null),b("")}catch(t){b((t==null?void 0:t.message)||"שגיאה בטעינת הסקר")}finally{p(!1)}},[a,d,x]);i.useEffect(()=>{l()},[l]),i.useEffect(()=>{const r=setInterval(()=>l(!0),2e4);return()=>clearInterval(r)},[l]);const S=async r=>{g(r);try{const t=await N.functions.invoke("residentGroupSurvey",{community_id:a,phone:d,campaign_id:x,action:"vote",option_id:r});f((t==null?void 0:t.data)||null),w.success("הצבעתך נקלטה")}catch(t){w.error((t==null?void 0:t.message)||"שגיאה בהצבעה")}finally{g("")}};return e.jsx(K,{kibbutzId:a,moduleKey:"resident_registration",pageTitle:"סקר",showHero:!1,hidePageTitleHeader:!0,mainClassName:"flex-1 w-full pt-24 md:pt-28 pb-12",children:({primaryColor:r})=>{const t=r||D;if(!c)return e.jsx(q,{kibbutzId:a});if(k)return e.jsx("div",{className:"flex justify-center py-24",children:e.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-indigo-500 rounded-full animate-spin"})});if(j||!h)return e.jsxs("div",{className:"max-w-md mx-auto px-4 py-16 text-center card-float p-10",children:[e.jsx(y,{className:"w-10 h-10 text-slate-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-slate-500 mb-4",children:j||"הסקר לא נמצא"}),e.jsx(G,{to:H(`/kibbutz-site/${a}/personal`),className:"inline-flex items-center gap-1.5 h-10 px-4 rounded-xl border border-slate-200 text-sm",children:"לאזור האישי"})]});const{survey:u,group_title:_,publisher_name:v,can_vote:o,my_vote:R,results:n}=h,$=(n==null?void 0:n.total)||0;return e.jsx("div",{className:"max-w-2xl mx-auto w-full px-4",dir:"rtl",children:e.jsxs("div",{className:"card-float p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"w-10 h-10 rounded-xl flex items-center justify-center text-white flex-shrink-0",style:{backgroundColor:t},children:e.jsx(y,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-xs text-slate-400",children:[_,v?` · ${v}`:""]}),e.jsx("h1",{className:"text-lg font-extrabold text-slate-900 leading-tight",children:u.question})]})]}),u.description&&e.jsx("p",{className:"text-sm text-slate-500 mt-2",children:u.description}),e.jsxs("div",{className:"flex items-center justify-between mt-4 mb-2",children:[e.jsxs("span",{className:"text-xs text-slate-400 inline-flex items-center gap-1",children:[e.jsx(P,{className:"w-3.5 h-3.5"})," ",$," הצביעו"]}),e.jsxs("button",{onClick:()=>l(!0),className:"text-xs text-slate-400 inline-flex items-center gap-1 hover:text-slate-600",children:[e.jsx(A,{className:"w-3.5 h-3.5"})," רענון"]})]}),e.jsx("div",{className:"space-y-2.5",children:((n==null?void 0:n.options)||[]).map(s=>{const m=R===s.id;return e.jsxs("div",{children:[e.jsxs("button",{disabled:!o||C,onClick:()=>o&&S(s.id),className:`relative w-full text-right rounded-xl border overflow-hidden transition-all ${m?"border-indigo-400 ring-2 ring-indigo-100":"border-slate-200"} ${o?"hover:border-indigo-300 cursor-pointer":"cursor-default"}`,children:[e.jsx("div",{className:"absolute inset-y-0 right-0 opacity-15",style:{width:`${s.percent}%`,backgroundColor:t}}),e.jsxs("div",{className:"relative flex items-center justify-between gap-2 px-4 py-3",children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-slate-800",children:[e.jsx("span",{className:`w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 ${m?"text-white":"border border-slate-300"}`,style:m?{backgroundColor:t}:void 0,children:m&&e.jsx(T,{className:"w-3.5 h-3.5"})}),s.text]}),e.jsxs("span",{className:"text-sm font-bold text-slate-700 flex-shrink-0",children:[s.percent,"% · ",s.count]})]})]}),s.voters&&s.voters.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pr-1",children:s.voters.map((E,z)=>e.jsx("span",{className:"text-[0.6875rem] px-2 py-0.5 rounded-full bg-slate-100 text-slate-600",children:E},z))})]},s.id)})}),!o&&e.jsx("div",{className:"mt-4 rounded-xl bg-amber-50 text-amber-800 text-xs px-3 py-2",children:"הסקר מיועד לחברי הקבוצה. ניתן לצפות בתוצאות בלבד."}),o&&e.jsx("p",{className:"mt-4 text-xs text-slate-400 text-center",children:"ניתן לשנות את הבחירה בכל עת · התוצאות מתעדכנות אונליין"})]})})}})}
1export{pe 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.