var N=Object.defineProperty,O=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var f=(e,s,o)=>s in e?N(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,h=(e,s)=>{for(var o in s||(s={}))A.call(s,o)&&f(e,o,s[o]);if(c)for(var o of c(s))B.call(s,o)&&f(e,o,s[o]);return e},S=(e,s)=>O(e,$(s));import{a as C,g as P,i as w,aH as E,ap as K,aM as k,r as z,H as L,j as i,_ as l,I as y,h as R,W as T,bs as U,M as V,f as x,bG as b}from"./main-634.js";import{F as p}from"./bf-767-388.js";import{t as q}from"./bf-676-386.js";import{a as G}from"./bf-178-233.js";import{S as W}from"./bf-982-242.js";import"./bf-638-271.js";import"./bf-247-269.js";import"./bf-25-81.js";import"./bf-692-111.js";import"./bf-400-72.js";import"./bf-438-114.js";import"./bf-486-243.js";import"./bf-497-246.js";import"./bf-723-244.js";import"./bf-299-245.js";import"./bf-534-247.js";import"./bf-962-248.js";import"./bf-343-249.js";import"./bf-791-250.js";import"./bf-641-107.js";import"./bf-570-251.js";import"./bf-838-80.js";import"./bf-297-103.js";import"./bf-284-252.js";import"./bf-17-106.js";import"./bf-671-253.js";import"./bf-334-254.js";import"./bf-710-385.js";import"./bf-423-273.js";import"./bf-457-387.js";import"./bf-577-275.js";import"./bf-288-389.js";import"./bf-939-390.js";function Os(){const{css:e}=C(),{fieldKey:s}=P(),[o,m]=w(E),j=K(k),[g,d]=z.useState(!1);if(!s)return null;const t=L(o[s]),u=t.adminLbl||"",v=t.suggestions||[],H=()=>{d(!0)},M=()=>{d(!1)},F=n=>{t.suggestions=n;const r=x(o,a=>{a[s]=t});m(r),j({unsaved:!0}),b({event:`Suggestion Update: ${t.lbl||u||s}`,type:"suggestion_update",state:{fields:r,fldKey:s}})},_=({target:{checked:n}})=>{if(!y)return;n?t.suggestionHide=!0:(t.suggestionHide=!1,delete t.suggestions);const r=n?"on":"off",a=x(o,I=>{I[s]=t});m(a),b({event:`Suggestion ${r}: ${t.lbl||u||s}`,type:`${r.toLowerCase()}_defaultValue`,state:{fields:a,fldKey:s}})};return i.jsxs(i.Fragment,{children:[i.jsx(W,S(h({id:"sgsn-stng",title:l("Suggestion"),className:e(p.fieldSection,p.hover_tip),switching:!0,tip:q.suggestion,tipProps:{width:250,icnSize:17},toggleAction:_,toggleChecked:t==null?void 0:t.suggestionHide,open:t==null?void 0:t.suggestionHide},y&&{disable:!(t!=null&&t.suggestionHide)}),{isPro:!0,proProperty:"suggestion",children:i.jsx("div",{className:e(p.placeholder,R.mb1),children:i.jsxs(T,{variant:"primary-outline",size:"sm",className:e({mt:10}),onClick:H,dataTestId:"sgsn-stng-btn",children:[l("Add/Edit Suggestions"),i.jsx("span",{className:e(J.plsIcn),children:i.jsx(U,{size:"13",stroke:"4"})})]})})})),i.jsx(V,{md:!0,autoHeight:!0,show:g,setModal:M,className:"o-v",title:l("Suggestion"),children:i.jsx("div",{className:"pos-rel",children:i.jsx(G,{optionMdl:g,options:v,setOptions:n=>F(n),lblKey:"lbl",valKey:"val",checkByDefault:!1})})})]})}const J={plsIcn:{ml:8,mt:3,tm:"rotate(45deg)"}};export{Os as default};
