import{d as $,t as j,r as a,o as i,c as n,b as d,e as V,u as t,Z as C,a2 as q,M as E,N as F,a as D,G,g as w,a0 as O,Q}from"../../../../common/index.DXvi0yH9.js";import{u as Z}from"../../../../common/settings-store.BEthvEFu.js";import{s as z}from"../../../../common/pinia.D9yoqqEz.js";/* empty css                                                                                       *//* empty css                                                                                 */import"../../../../common/Confirmation.vue_vue_type_script_setup_true_lang.BvpajMdU.js";import{_ as A}from"../../../../common/LabelControl.vue_vue_type_script_setup_true_lang.B_b65Eg0.js";import{_ as J}from"../../../../common/Tooltip.vue_vue_type_script_setup_true_lang.BBmniJxI.js";import{_ as K}from"../../../../common/_plugin-vue_export-helper.DlAUqK2U.js";import"../../../../common/transition.CRNcmuQX.js";import"../../../../common/keyboard.D4P2wQc7.js";import"../../../../common/open-closed.CQX5sZkx.js";import"../../../../common/micro-task.CxIZtCgj.js";const W={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-mb-2 stwlite-tw-gap-2"},X={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-mb-2 stwlite-tw-gap-2"},Y=["disabled"],ee=["value"],te={key:0},se=["href"],ae={key:1},le=["placeholder","name"],oe=["innerHTML"],ie=$({__name:"LinkControl",props:{params:{type:Object,required:!0}},emits:["input","fieldData"],setup(L,{emit:M}){var h,g,b;const S=L,{params:T}=j(S),I=Z(),{showPopup:v,componentUpgrade:N}=z(I),e=T.value,B=a(e.options),H=a(e.links),_=a(e.default),s=a(_.value),f=a((h=e.disabled)!=null?h:!1),m=M,l=a([]),P=a((g=e.with_text_condition)!=null?g:!1),c=a(!!((b=e.custom_link)!=null&&b)),r=a(e.custom_link!=""?e.custom_link:"");if(s.value!==""&&!f.value){let o=s.value;s.value=="custom"&&(o=r.value),l.value[e.id]=o,m("fieldData",l.value)}const U=o=>{typeof e.pro<"u"&&e.pro!==null?(typeof e.pro_on_active<"u"&&e.pro_on_active!==null?e.pro_on_active&&s.value!==""&&(v.value=!0,s.value=""):(v.value=!0,s.value=_.value),N.value=e.pro):(o=="custom"?(c.value=!0,l.value[e.id]=r.value):(c.value=!1,l.value[e.id]=o),m("fieldData",l.value))},R=()=>{l.value[e.id]=r.value,m("fieldData",l.value)};return(o,p)=>{var k,x;return i(),n("div",null,[d("div",W,[V(t(A),{params:t(e)},null,8,["params"])]),d("div",X,[C(d("select",{"onUpdate:modelValue":p[0]||(p[0]=u=>s.value=u),onChange:U,disabled:f.value,class:"stwlite-tw-block stwlite-tw-w-full stwlite-tw-max-w-xs stwlite-tw-rounded-md stwlite-tw-border-gray-300 stwlite-tw-shadow-sm focus:stwlite-tw-border-blue-500 focus:stwlite-tw-ring-blue-500 stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border"},[(i(!0),n(E,null,F(B.value,(u,y)=>(i(),n("option",{key:y,value:y},D(u),9,ee))),128))],40,Y),[[q,s.value]]),V(t(J),{params:t(e)},null,8,["params"])]),c.value?w("",!0):(i(),n("div",te,[d("a",{href:H.value[s.value],target:"_blank"},D(t(G)("viewPageText",t(wp.i18n.__)("View Page","saveto-wishlist-lite-for-woocommerce"))),9,se)])),P.value&&c.value?(i(),n("div",ae,[C(d("input",{"onUpdate:modelValue":p[1]||(p[1]=u=>r.value=u),placeholder:t(e).placeholder,name:t(e).id,onInput:R},null,40,le),[[O,r.value]])])):w("",!0),t(e).description!=="undefined"?(i(),n("p",{key:2,class:"stwlite-tw-text-sm stwlite-tw-text-gray-600 stwlite-tw-mt-2",innerHTML:t(Q)((x=(k=t(e))==null?void 0:k.description)!=null?x:"")},null,8,oe)):w("",!0)])}}}),be=K(ie,[["__scopeId","data-v-697b4f41"]]);export{be as default};
