(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`98855b37a3d52795063fb5f65b16b203e1f309a7`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`07450829-154b-4693-94f1-95673eecba85`,e._sentryDebugIdIdentifier=`sentry-dbid-07450829-154b-4693-94f1-95673eecba85`)}catch{}})();import{r as e}from"./rolldown-runtime-DSmSHlwF.js";import"./posthog-js-op-4SakF.js";import{C as t,P as n,Q as r,R as i,S as a,T as o,W as s,a as c,b as l,f as u,g as d,i as f,it as p,o as m,ot as h,u as g,w as _,x as v,y}from"./element-plus-B1fHG2BL.js";import{m as b}from"./vue-Dx4PbTpV.js";import{u as x}from"./main-CNgG4xjc.js";import{n as S,t as C}from"./usePopup-DtGdnVsG.js";import{f as w}from"../index.js";import{l as T}from"./components-BVh60UfO.js";import{t as E}from"./header-BTrWDzvy.js";var D={key:0},O={key:1},k={class:`collection-edit__container`},A={class:`collection-edit__control`},j=o({__name:`matchEdit`,setup(e){let{t:o}=b(),j=S(),{goBackCollectionEditPage:M,gotoMatchEditPage:N}=C(),{rules:P}=T(),{saveMatchForm:F}=T(),I=r();function L(){M(j.collectionFormId)}async function R(e){e&&await F(e,async()=>{await M(j.collectionFormId)})}async function z(e){e&&await F(e,async()=>{let e=w();await N({collectionId:j.collectionFormId,matchId:e}),j.InitMatchData(e)})}async function B(){j.DeleteMatchItem(),await M(j.collectionFormId)}return(e,r)=>{let b=i(`icon-font`),S=u,C=c,w=f,T=m,M=g;return n(),a(d,null,[_(E,null,{left:s(()=>[_(b,{name:`arrowLeft`,title:p(o)(`collection.matchItem.op.abandon`),onClick:L},null,8,[`title`])]),title:s(()=>[p(j).matchFormState===p(x).Edit?(n(),a(`h4`,D,h(p(o)(`collection.matchItem.title.edit`)),1)):(n(),a(`h4`,O,h(p(o)(`collection.matchItem.title.new`)),1))]),_:1}),y(`section`,k,[_(w,{ref_key:`matchFormRef`,ref:I,"label-position":`top`,model:p(j).matchForm,"hide-required-asterisk":!0,rules:p(P)},{default:s(()=>[_(C,{label:p(o)(`collection.matchItem.form.name`),prop:`name`},{default:s(()=>[_(S,{modelValue:p(j).matchForm.name,"onUpdate:modelValue":r[0]||=e=>p(j).matchForm.name=e,size:`large`,placeholder:p(o)(`collection.matchItem.placeholder.name`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),_(C,{label:p(o)(`collection.matchItem.form.targetURI`),prop:`target`},{default:s(()=>[_(S,{modelValue:p(j).matchForm.target,"onUpdate:modelValue":r[1]||=e=>p(j).matchForm.target=e,size:`large`,placeholder:p(o)(`collection.matchItem.placeholder.targetURI`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])]),_:1},8,[`model`,`rules`]),_(T),y(`section`,A,[p(j).matchFormState===p(x).Create?(n(),l(M,{key:0,onClick:r[2]||=e=>z(I.value)},{default:s(()=>[t(h(p(o)(`collection.matchItem.op.again`)),1)]),_:1})):v(``,!0),p(j).matchFormState===p(x).Edit?(n(),l(M,{key:1,type:`danger`,onClick:B},{default:s(()=>[t(h(p(o)(`collection.matchItem.op.removeCurrent`)),1)]),_:1})):v(``,!0),_(M,{onClick:L},{default:s(()=>[t(h(p(o)(`collection.matchItem.op.abandon`)),1)]),_:1}),_(M,{type:`primary`,onClick:r[3]||=e=>R(I.value)},{default:s(()=>[t(h(p(o)(`collection.matchItem.op.save`)),1)]),_:1})])])],64)}}});export{j as default};
//# sourceMappingURL=matchEdit-DKzN_Yiu.js.map