import{u as p,j as o,Y as g,h as E,i as j,o as c,S as k,aP as C,ag as u,aR as A,aQ as w,g as x}from"./app-BgLa5dit.js";import{W as L}from"./D8ca7W7r.chunk.js";import{W as V}from"./CZyx6Aii.chunk.js";import{W as n,a as _,g as v,b as y,c as d}from"./BwfkiyJS.chunk.js";import{W as M}from"./CPx1XrU-.chunk.js";import{W as D}from"./CnYYY4AA.chunk.js";import{u as S}from"./CKjyFQLY.chunk.js";import"./B3eOBVf8.chunk.js";import"./3nM7jLnE.chunk.js";import"./CPXlV0fg.chunk.js";import"./MEkA24R1.chunk.js";import"./DJ0pq8J_.chunk.js";import"./C53kfXmd.chunk.js";import"./CG7zbly5.chunk.js";function T(e){const[i]=p(e.viewModelKey);return n.useSetWorkbenchConfirmationCallback(e.onConfirmClick,e.viewModelKey),o.jsxs(o.Fragment,{children:[o.jsxs(V,{children:[o.jsx("p",{className:"fw-semibold mb-1",children:"Add to the following audience:"}),o.jsx("ul",{className:"mb-0",children:i.assocIds.map(t=>o.jsx("li",{children:o.jsx(g,{appLink:{application:j.SUBJECTS,action:E.Subjects.EDIT_AUDIENCE,args:[i.presentationId,t]},openInNewTab:!0,children:e.audiences.find(s=>s.masterId.toString()===t.toString()).name})},t))})]}),o.jsxs("div",{className:"my-3",children:[o.jsx("h3",{className:"h6 mt-2",children:e.objects.length?`The above changes will be applied to the selected ${e.objects.length} videos:`:"The above changes will be applied to the selected 1 video:"}),o.jsx(L,{items:e.objects,rowHeight:_,getComponent:t=>n.getItemComponent(t,e.type)})]})]})}function Q(e){const{workingList:i}=S(e.listId),[t]=p(d.VIDEO_VIEW_MODEL_KEY),s=c(A.currentUser()),l=c((t==null?void 0:t.presentationId)&&k.presentationAudiences(t.presentationId)),h=C(),a=v(e.listId),m=c(D.videosById(i)),b=n.useCreateJobErrorAlert();function f(r){x.trigger({...a.wizardActionStatus.polling,params:{jobId:r.id}})}function I(){if(!t)return;const r=n.getCreateJobRequestData(t,i,s.data.id);w(h,M.createJob(r,f,b))}const W=!!s.data&&!!m.data&&!!l.data;return o.jsx(y,{appLinks:a,currentStep:"confirmation",viewModelKey:d.VIDEO_VIEW_MODEL_KEY,type:u.Video,loaded:W,listId:e.listId,children:o.jsx(T,{type:u.Video,objects:m.data,appLinks:a,viewModelKey:d.VIDEO_VIEW_MODEL_KEY,audiences:l.data,onConfirmClick:I})})}export{Q as WorkbenchVideoAddToAudiencesConfirmationView};
//# sourceMappingURL=Doe9GBgm.chunk.js.map
