import{o as l,l as y,k as f,R as j,j as e,ar as S,E as v,a9 as s,aR as C,ex as E}from"./app-BgLa5dit.js";import{F as R}from"./Br5jp8YA.chunk.js";import{S as I}from"./BYtBBUvs.chunk.js";const d=[{id:"tcc-v1p3-lti",name:"Thin Common Cartridge V1p3 Lti"},{id:"tcc-v1p3-web",name:"Thin Common Cartridge V1p3 Web"}];function k(r){var c;const a=(c=l(I.library()).data)==null?void 0:c.objectId,o=l(C.currentUser()),i=y(),u=f(),[n,m]=j.useState(d[0].id);function p(){i.success("Your libraries export has been requested. You will receive an email shortly."),r.closePopup()}function x(){i.error("Something went wrong. Please try again.")}function b(){const t={key:"lite.library.video.report",data:{firstName:ClickView.User.firstName,email:ClickView.User.email,customerId:o.data.customerId,formats:[n],libraryIds:[a],presentationId:E.PresentationIds.STREAMABLE_LEARNING}},h=R.requestExport(t);u(h).then(p).catch(x)}return!a||!o.data?e.jsx("div",{className:"text-center p-5",children:e.jsx(S,{as:"div",animation:"border",role:"status"})}):e.jsxs(v,{title:"Export library",closePopup:r.closePopup,children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h2",{className:"h6",children:"Select an export format:"}),e.jsx("select",{className:"form-select",value:n,onChange:t=>m(t.target.value),children:d.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))})]}),e.jsxs(s,{children:[e.jsx(s.Cancel,{onClick:r.closePopup}),e.jsx(s.Submit,{variant:"dark",text:"Export",onClick:b})]})]})}export{k as ExportLibraryView};
//# sourceMappingURL=Ch1yCmcB.chunk.js.map
