import{d as M,ar as O,bm as R,A as o,bn as i,bo as u,bp as c,h as v,a9 as t,bu as C,aa as A,by as E,bq as F,a4 as $,bs as S,br as f}from"../../../../common/preload-helper.BAt0wiQU.js";import{g as z,p as G}from"../../index.CwVZreOu.js";import{u as J}from"../../../../common/settings-store.DAVbzJl3.js";/* empty css                                                                                      */import"../../../../common/DnDDataTableControl.vue_vue_type_style_index_0_scoped_0b913e4f_lang.CI1SyTf2.js";/* empty css                                                                                                 */import{_ as K}from"../../../../common/LabelControl.vue_vue_type_script_setup_true_lang.8NM1WLzi.js";/* empty css                                                                                        */import{j as Q,S as W}from"../../../../common/index.BZuLeNql.js";import{I as X}from"../../../../common/index.CaM6juwS.js";import"../../../../common/index.Bkgl5HZD.js";import"../../../../common/motion.DDNFslEg.js";import"../../../../common/KeyCode.D63Tfrq7.js";import"../../../../common/SearchOutlined.DEk5RLel.js";import"../../../../common/pickAttrs.CU3mp8mt.js";import"../../../../common/slide.DNI51Zgv.js";import"../../../../common/index.K7lONbTM.js";import"../../../../common/isMobile.DycClExL.js";import"../../../../common/useMergedState.BxRmC9rL.js";import"../../../../common/useState.9-uUdCQD.js";import"../../../../common/DownOutlined.DGkCTtd_.js";import"../../../../common/FormItemContext.B-agHi0o.js";import"../../../../common/createContext.DKLY0CB7.js";import"../../../../common/statusUtils.-yEA-Gfk.js";import"../../../../common/compact-item.CKdY6bQm.js";import"../../../../common/index.C2RKq64j.js";import"../../../../common/index.BQlS3R_s.js";import"../../../../common/index.2Llx5d_f.js";import"../../../../common/warning.Dss1f44C.js";import"../../../../common/isPlainObject.DBTCFiJr.js";const Y={class:"wwp-row-handle"},Z={class:"wwp-left-content"},ee={class:"wwp-right-content"},te={key:0,style:{"padding-left":"10px"}},ae=["href"],oe=["innerHTML"],le={key:2},Ue=M({__name:"LinkControl",props:{params:{type:Object,required:!0}},emits:["input","fieldData"],setup(D,{emit:I}){var g,b,k;const T=D,{params:B}=O(T),L=J(),{showPopup:_,componentUpgrade:N}=R(L),e=B.value,H=o(e.options),P=o(e.links),h=o(e.default),a=o(h.value),w=o((g=e.disabled)!=null?g:!1),d=I,l=o([]),U=o((b=e.with_text_condition)!=null?b:!1),p=o(!!((k=e.custom_link)!=null&&k)),n=o(e.custom_link!=""?e.custom_link:"");if(a.value!==""&&!w.value){let s=a.value;a.value=="custom"&&(s=n.value),l.value[e.id]=s,d("fieldData",l.value)}const j=s=>{typeof e.pro<"u"&&e.pro!==null?(typeof e.pro_on_active<"u"&&e.pro_on_active!==null?e.pro_on_active&&a.value!==""&&(_.value=!0,a.value=""):(_.value=!0,a.value=h.value),N.value=e.pro):(s=="custom"?(p.value=!0,l.value[e.id]=n.value):(p.value=!1,l.value[e.id]=s),d("fieldData",l.value))},q=()=>{l.value[e.id]=n.value,d("fieldData",l.value)};return(s,m)=>{var y,x;return i(),u("div",Y,[c("div",Z,[v(t(K),{params:t(e)},null,8,["params"])]),c("div",ee,[v(t(W),{ref:"select",value:a.value,"onUpdate:value":m[0]||(m[0]=r=>a.value=r),"show-search":"",name:t(e).id,style:{"max-width":"320px",width:"100%"},disabled:w.value,onChange:j},{default:C(()=>[(i(!0),u(A,null,E(H.value,(r,V)=>(i(),F(t(Q),{key:V,value:V},{default:C(()=>[$(S(r),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","name","disabled"]),p.value?f("",!0):(i(),u("span",te,[c("a",{href:P.value[a.value],target:"_blank"},S(t(z)("viewPageText",t(wp.i18n.__)("View Page","woocommerce-wholesale-prices"))),9,ae)])),t(e).description!=="undefined"?(i(),u("p",{key:1,innerHTML:t(G)((x=(y=t(e))==null?void 0:y.description)!=null?x:"")},null,8,oe)):f("",!0),U.value&&p.value?(i(),u("div",le,[v(t(X),{value:n.value,"onUpdate:value":m[1]||(m[1]=r=>n.value=r),placeholder:t(e).placeholder,name:t(e).id,onInput:q},null,8,["value","placeholder","name"])])):f("",!0)])])}}});export{Ue as default};
