import{aJ as p,az as u,aj as I,dK as S,aP as m,L as U,ao as g,o as x,W as E,r as P,E as B,p as F}from"./app-k0jcl5PQ.js";import{C as y}from"./He_KJRxT.chunk.js";import{u as A}from"./CLC2sKlT.chunk.js";import"./DTRakM4e.chunk.js";const D="shared.makeInteractive",e=U.encloseNamespace(D);function T(k){var o,c,r,d;const{videoId:n,closePopup:s}=k,[v,b]=p.useState(!1),[a,f]=p.useState(null),i=u(I.currentUser()),t=u(S.video(n)),{createInteractive:h}=A({feedback:(a==null?void 0:a.id)==="feedback",setShowSpinner:b,closePopup:s,name:(o=t.data)==null?void 0:o.name,duration:(c=t.data)==null?void 0:c.duration,objectId:(r=t.data)==null?void 0:r.id,currentUser:i.data,baseAnalyticsData:{video:{id:n,name:(d=t.data)==null?void 0:d.name}}});function w(){var l;x.logUserAction({video:{id:n,name:(l=t.data)==null?void 0:l.name}},{location:F.NewInteractive,entity:B.Interactive,actionType:P.Create,workflowPhase:E.Discard}),s()}const C=[{id:"feedback",title:e("feedbackTitle"),description:e("feedbackDescription"),imageUrl:m.Interactives.FeedbackOptions.FEEDBACK},{id:"no-feedback",title:e("noFeedbackTitle"),description:e("noFeedbackDescription"),imageUrl:m.Interactives.FeedbackOptions.NO_FEEDBACK}];return g.jsx(y,{title:e("title"),closePopup:s,options:C,selectOption:f,selection:a,showLoadingSpinner:!t.data||!i.data,cancelButtonProps:{onClick:w,text:e("cancel"),variant:"link"},submitButtonProps:{onClick:h,text:e("continue"),variant:"dark",showSpinner:v,disabled:!a}})}export{T as NewInteractiveView};
//# sourceMappingURL=B-0PjSDm.chunk.js.map
