react-covideo-embed 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -573,4 +573,4 @@
573
573
  `,kR=e=>{let{children:t,style:n,hideHeader:r=!1,hideCloseButtonInHeader:i=!1,headerTextStyle:o,closeModalOnBackdropOrEscPress:a=!0,headerText:s,headerMargin:l,closeModal:c,closeIcon:u,closeIconPosition:f="right",shouldReturnFocusAfterClose:d=!0,parentSelector:p}=e;(0,E.useEffect)((()=>{const e=document.getElementById("root");return e&&(e.style.overflow="hidden"),()=>{e&&(e.style.overflow="")}}),[]);const h=u||k().createElement(aT,{color:wM.gray60,width:"24px",height:"24px",onClick:c}),y=(0,E.useRef)(null);return k().createElement(mM(),{shouldReturnFocusAfterClose:d,ref:y,isOpen:!0,onRequestClose:a?c:void 0,style:{overlay:{...wR,...n&&n.overlay},content:{...SR,...n&&n.content}},ariaHideApp:!1,contentLabel:"Example Modal",parentSelector:()=>document.querySelector(p||"body")},!r&&k().createElement(CR,{className:"ai-assist",margin:l,style:{..."left"===f&&{justifyContent:"left",flex:1}}},!i&&"left"===f&&h,k().createElement(ER,{className:"ai-assist",style:o},s),!i&&"right"===f&&h),t)},_R=e=>k().createElement(nD,Object.assign({},e),k().createElement(Uc,{color:"rgba(30, 164, 95, 1)",size:26,style:{minWidth:26,maxWidth:26}})),OR=e=>{let{closeModal:t,handleSubmitGeneratedContent:n,handleOnCopySuccess:r}=e;const{promptType:i,promptUseCase:o,changePromptUseCase:a,isLoading:s,generateContentWithAi:l,promptsLeft:c,generatedText:u,changeVehicleTitle:f,changeVin:d,crmData:p,sender:h,changeSender:y,senderCompany:m,changeSenderCompany:v,recipient:g,changeRecipient:x,vin:b,nextStep:w,changeNextStep:S,changeFormalityLevel:C,detailLevel:E,changeDetailLevel:_,changeEnthusiasmLevel:O,changeAdditionalInfo:P,additionalInfo:T,changeGeneratedText:A,changeBaseText:j,templateOptions:I,selectedTemplateOption:M,changeSelectedTemplateOption:D,linksetOptions:R,selectedLinksetOption:F,changeSelectedLinksetOption:L,overlayOptions:B,selectedOverlayOption:N,changeSelectedOverlayOption:z,generatedThumnail:V,generatedUrl:U}=(()=>{const e=k().useContext(lD);if(void 0===e)throw new Error("useAI must be used within a AiProvider");return e})(),{userData:H,currentAiTheme:G}=sD(),{isAutomotiveSalesRole:W,customer:q}=H;if(!Number(q.hasCovideoMagic))return null;const $=i===OM.CRM_MESSAGE?MM.HTML:MM.PLAIN,Z=i===OM.CRM_MESSAGE,Y=i===OM.TELEPROPTER_SCRIPT,Q=!!n,K=i!==OM.SMS&&E>=TM.MID,X=c<=0,J=s||X,ee=s||X||!u.length,te=i===OM.CRM_MESSAGE;return k().createElement(kR,{closeModal:t,headerText:`Generate ${i} with Covideo AI Assist`,style:{content:{width:"1120px"}}},k().createElement(mD,{disabled:X,className:"ai-assist"},k().createElement(CD,null,k().createElement(ED,null,te&&k().createElement(bR,{templateOptions:I,selectedTemplate:M,setSelectedTemplate:D,ctaOptions:R,selectedCta:F,setSelectedCta:L,overlaysOptions:B,selectedOverlay:N,setSelectedOverlay:z,extraStyle:{label:{color:"#9297a2",marginTop:0},wrapper:{marginTop:0},control:{minHeight:44,maxHeight:64}}}),k().createElement(SD,null,k().createElement(wD,null,k().createElement(bD,null,"Your name"),k().createElement(ND,{radius:"6px",value:h,onChange:e=>y(e.target.value),placeholder:"Enter your name"})),k().createElement(wD,null,k().createElement(bD,null,"Company Name"),k().createElement(ND,{radius:"6px",value:m,onChange:e=>v(e.target.value),placeholder:"Enter your company name"}))),k().createElement(SD,null,k().createElement(wD,null,k().createElement(xD,null,k().createElement(bD,null,"Message category"),k().createElement(yD,{text:"Select the type of message you’d like Covideo AI Assist to create. You can also enter your own if it’s not included in the dropdown."})),k().createElement(QD,{width:276,value:IM.find((e=>e&&e.value===o)),options:IM,onChange:e=>a(e.value),placeholder:"Enter use case",menuPortalTarget:document.body,menuPosition:"fixed",menuPlacement:"bottom",extendStyles:{container:{width:"100%"},control:{width:"100%"}},formatCreateLabel:e=>k().createElement("div",{style:{color:CM[G].colors.primaryColor,display:"flex",alignItems:"center"}},k().createElement(zc,{color:wM.blue40}),"  Write"," ",`"${e}"`)})),!Y&&k().createElement(wD,null,k().createElement(xD,null,k().createElement(bD,null,"Their name"),k().createElement(yD,{text:"Enter the name of the person or persons you’re sending your message to."})),k().createElement(ND,{radius:"6px",value:g,onChange:e=>x(e.target.value),placeholder:"Enter customer name"}))),k().createElement(SD,null,W&&k().createElement(wD,null,k().createElement(xD,null,k().createElement(bD,null,"Vehicle")),k().createElement(dR,{onChangeVehicle:e=>e?e.itemId?(f(e.title||""),void d(e.vin||"")):(f(e.vin||""),void d("")):(f(""),void d("")),selectedVin:b,fetchSold:!1,creatable:i!==OM.CRM_MESSAGE,placeholder:"Search vehicles...",borderRadius:"6px",dropdownOptionLabelMaxWidth:"95%",menuZindex:9999,limitedSingleValueWidth:"218px"})),k().createElement(wD,null,k().createElement(xD,null,k().createElement(bD,null,"Next steps"),k().createElement(yD,{text:"Briefly describe what you would like your recipient to do next. Ex: “Call me back”, “Click the button”, or “Write a review”.",style:{content:{marginLeft:"50px"}}})),k().createElement(ND,{radius:"6px",value:w,onChange:e=>S(e.target.value),placeholder:"Enter next steps"}))),k().createElement(_D,null,k().createElement(PD,null,k().createElement(TD,null,k().createElement(AD,{display:"block"},"Casual"),k().createElement(AD,{textAlign:"right",display:"block"},"Formal")),k().createElement(AD,null,"Casual"),k().createElement(OD,null,k().createElement(vR,{marks:!0,defaultValue:AM.MID,min:AM.LOW,max:AM.HIGH,onChange:e=>C(e),width:"374px"})),k().createElement(AD,{textAlign:"right"},"Formal")),k().createElement(PD,null,k().createElement(TD,null,k().createElement(AD,{display:"block"},"Reserved"),k().createElement(AD,{textAlign:"right",display:"block"},"Enthusiastic")),k().createElement(AD,null,"Reserved"),k().createElement(OD,null,k().createElement(vR,{marks:!0,defaultValue:jM.MID,min:jM.LOW,max:jM.HIGH,onChange:e=>O(e),width:"374px"})),k().createElement(AD,{textAlign:"right"},"Enthusiastic")),i!==OM.SMS&&k().createElement(PD,null,k().createElement(TD,null,k().createElement(AD,{display:"block"},"Brief"),k().createElement(AD,{textAlign:"right",display:"block"},"Detailed")),k().createElement(AD,null,"Brief"),k().createElement(OD,null,k().createElement(vR,{marks:!0,defaultValue:TM.MID,min:TM.LOW,max:TM.HIGH,onChange:e=>_(e),width:"374px"})),k().createElement(AD,{textAlign:"right"},"Detailed"))),K&&k().createElement(SD,null,k().createElement(wD,null,k().createElement(gD,{value:T,onChange:e=>P(e.target.value),placeholder:"Include any additional information you’d like Covideo AI Assist to consider."})))),k().createElement(DD,null,!X&&k().createElement(LD,null,c," prompts left this month"),X&&k().createElement(LD,{color:wM.red100},k().createElement(dT,null)," ",k().createElement("span",null,"0 prompts left this month")),k().createElement(RD,{onClick:()=>l(),text:"Generate",icon:k().createElement(dD,{color:wM.white}),margin:"0",disabled:J,backgroundcolor:wM.magic100,textColor:wM.white,border:"0",currentAiTheme:G}))),k().createElement(kD,null,k().createElement(jD,null,s&&k().createElement(vD,null,k().createElement(FD,null,k().createElement(KP(),{animationData:hD,loop:!0,autoplay:!0}))),!s&&$===MM.PLAIN&&k().createElement(ID,{disabled:s,value:u,onChange:e=>{A(e.target.value),j(e.target.value)}}),!s&&$===MM.HTML&&k().createElement(MD,{disabled:s,dangerouslySetInnerHTML:{__html:u}})),k().createElement(DD,null,Z&&k().createElement(uD,{onClick:()=>(async()=>{var e;document.addEventListener("copy",(e=>{e.preventDefault(),e.clipboardData&&(e.clipboardData.setData("text/html",u),e.clipboardData.setData("text/plain",p&&p.data.url||""))}),{once:!0}),document.execCommand("copy"),e={title:"CRM Code Copied!"},YP(k().createElement(_R,Object.assign({},e)),{progressStyle:{background:"transparent"},position:e.position||"top-right",closeButton:k().createElement(rD,Object.assign({},e))}),r&&await r(),t()})(),text:"Copy",margin:"0",textPadding:"8px 16px",disabled:ee,backgroundcolor:CM[G].colors.primaryColor,textColor:wM.white,border:"1px solid transparent"}),Q&&k().createElement(uD,{margin:"0",textPadding:"8px 16px",onClick:()=>(async()=>{n&&(await n(u,U,V),t())})(),text:"Insert This",disabled:ee,backgroundcolor:CM[G].colors.primaryColor,textColor:wM.white,border:"1px solid transparent"})))))},PR=new v.QueryClient({defaultOptions:{queries:{retry:0,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1},mutations:{retry:0}}}),TR=uh(uD)`
574
574
  border: ${e=>{let{border:t}=e;return t}};
575
575
  background: ${e=>{let{backgroundcolor:t,currentAiTheme:n}=e;return"gradient"===t?`linear-gradient(31deg, ${wM.magic100} 0%, ${CM[n].colors.primaryColor} 100%)`:t}};
576
- `,AR=e=>{let{handleSubmitGeneratedContent:t,handleOnCopySuccess:n,defaultPromptType:r,defaultPromptUseCase:i=PM.INITIAL_REACH_OUT,defaultRecipient:o="",defaultVin:a="",userInput:s="",autoGenerate:l=!1,margin:c="0",height:u="auto",iconPadding:f="12px 2px 12px 10px",backgroundcolor:d="#8D31D6",border:p,iconColor:h=wM.white,videoId:y,btnLabel:m="",hoverPopup:g,hoverPosition:x="above",disabled:b,title:w}=e;const{userData:S,currentAiTheme:C}=sD(),{customer:_}=S,O=S.isAutomotiveServiceRole,[P,T]=(0,E.useState)(!1),A=()=>T(!0);if(O||!Number(_.hasCovideoMagic))return null;const j=()=>k().createElement(TR,{onClick:A,iconPadding:f,title:w,text:m,backgroundcolor:d,border:"gradient"===d?"0":p,icon:"gradient"===h?k().createElement(fD,null):k().createElement(dD,{color:h}),textColor:wM.white,margin:"0",height:u,currentAiTheme:C,disabled:b}),I=!!g;return k().createElement(v.QueryClientProvider,{client:PR},k().createElement("div",{style:{margin:c},className:"ai-assist"},I&&k().createElement(_M,{showtriangle:!0,position:x,padding:"0",width:"auto",hoverable:k().createElement(j,null),popup:g}),!I&&k().createElement(j,null),P&&k().createElement(cD,{defaultPromptType:r,defaultPromptUseCase:i,defaultRecipient:o,defaultVin:a,userInput:s,videoId:y,autoGenerate:l},k().createElement(OR,{closeModal:()=>T(!1),handleSubmitGeneratedContent:t,handleOnCopySuccess:n}))))},jR=e=>{let{children:t}=e;return k().createElement(nh,{theme:{color:"blue"}},t)},IR=e=>{let{...t}=e;return k().createElement(aD,{userData:t.userData,token:t.token,aiAssistTheme:t.aiAssistTheme,env:t.env},k().createElement(jR,null,k().createElement(AR,{userInput:t.userInput,defaultPromptType:t.defaultPromptType,handleSubmitGeneratedContent:t.handleSubmitGeneratedContent,margin:t.margin,hoverPopup:t.hoverPopup,hoverPosition:t.hoverPosition,btnLabel:t.btnLabel,height:t.height,backgroundcolor:t.backgroundcolor,iconPadding:t.iconPadding,videoId:t.videoId,defaultVin:t.defaultVin,iconColor:t.iconColor,border:t.border,autoGenerate:t.autoGenerate,title:t.title,handleOnCopySuccess:t.handleOnCopySuccess,defaultRecipient:t.defaultRecipient,defaultPromptUseCase:t.defaultPromptUseCase,disabled:t.disabled})))};var MR;!function(e){e.TELEPROPTER_SCRIPT="Teleprompter Script",e.EMAIL="Email",e.SMS="SMS",e.CRM_MESSAGE="CRM Message"}(MR||(MR={}));var DR,RR,FR,LR,BR,NR,zR,VR,UR,HR,GR,WR,qR,$R,ZR,YR,QR,KR,XR,JR,eF,tF,nF,rF,iF,oF,aF=2,sF=0,lF=1,cF=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},uF=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},fF=function(){return fF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fF.apply(this,arguments)},dF=function(e){return t=void 0,n=void 0,i=function(){var t,n,r,i,o;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(a){switch(a.label){case 0:return t=S.bearerToken,n=e.videoId,e.type,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["videoId","type"]),i=fF({},r),o=fF(fF({},t),{"Content-Type":"application/json"}),[4,kn().post("".concat(b,"share/quickshare/").concat(n,"/mark-as-sent"),i,{headers:o})];case 1:return[2,a.sent().data]}}))},new((r=void 0)||(r=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i},pF=function(){return pF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pF.apply(this,arguments)},hF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},yF=function(e){var t=e.video,n=e.videoRequest,r=e.setShowModalQuickShareMarkAsSent,i=e.handleOnMarkAsSentSuccessCallback,o=Nl().userData,a=function(e){var t,n,r=Nl().userData,i=Xl(r),o=Ju().toast,a=(t=function(e,t){return cF(void 0,void 0,void 0,(function(){var n;return uF(this,(function(r){return n=function(n){n.clipboardData&&(n.clipboardData.setData("text/html",t||""),n.clipboardData.setData("text/plain",e)),n.preventDefault()},document.addEventListener("copy",(function(e){return n(e)}),{once:!0}),document.execCommand("copy"),[2]}))}))},n=function(e,t){return cF(void 0,void 0,void 0,(function(){var n,r,i;return uF(this,(function(o){switch(o.label){case 0:return n=document.createElement("textArea"),i=(r=navigator.clipboard).write,[4,new ClipboardItem({"text/plain":new Promise((function(t){return cF(void 0,void 0,void 0,(function(){return uF(this,(function(n){return t(new Blob([e],{type:"text/plain"})),[2]}))}))})),"text/html":new Promise((function(e){return cF(void 0,void 0,void 0,(function(){var r,i;return uF(this,(function(o){return n.style.visibility="hidden",n.setAttribute("contenteditable","true"),n.value=t||"",document.body.appendChild(n),(r=document.createRange()).selectNodeContents(n),null==(i=window.getSelection())||i.removeAllRanges(),null==i||i.addRange(r),null==n||n.setSelectionRange(0,999999),e(new Blob([n.value],{type:"text/html"})),[2]}))}))}))})];case 1:return[4,i.apply(r,[[o.sent()]])];case 2:return o.sent(),n&&n.remove&&n.remove(),[2]}}))}))},{copyClipboard:function(e,r){return cF(void 0,void 0,void 0,(function(){var i;return uF(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),_t?[4,n(e,r)]:[3,2];case 1:return o.sent(),[3,4];case 2:return[4,t(e,r)];case 3:o.sent(),o.label=4;case 4:return[3,6];case 5:return i=o.sent(),console.log(i),[3,6];case 6:return[2]}}))}))}}).copyClipboard,s=Mt(),l=s.onVideoInsert,c=s.onVideoInsertError,u=i?null===r.customer.markVideosAsSent?aF:parseInt(r.customer.markVideosAsSent.toString(),10):sF;return(0,v.useMutation)(dF,{onSuccess:function(t,n){var r=function(e,t){switch(t.type){case"crm_code":return{title:"CRM Code Copied!",clipboardText:e.url,clipboardHtml:e.html};case"url":return{title:"URL Copied!",clipboardText:e.url};case"html_code":return{title:"Raw HTML Copied!",clipboardText:e.legacyHtml};case"quickshare":return{title:"Link copied to clipboard!",clipboardText:e.url,clipboardHtml:e.html}}}(t,n);u===lF&&o({message:"Video marked as Sent"}),u===aF&&n.markAsSentConfirmed&&o({message:"Video marked as Sent"}),r&&(r.clipboardText&&a(r.clipboardText,null==r?void 0:r.clipboardHtml),r.title&&setTimeout((function(){o({message:r.title})}),100)),null==l||l({url:t.url,thumbnail:t.thumbnail,html:t.html}),e()},onError:function(e){null==c||c(e)}})}((function(){null==i||i(),r(!1)})),s=a.isLoading,l=a.mutateAsync,c=function(e){return r=void 0,i=void 0,a=function(){var r,i=e.markAsSentConfirmed,o=e.videoActivityType,a=hF(e,["markAsSentConfirmed","videoActivityType"]);return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){switch(e.label){case 0:return r=pF(pF(pF({videoId:"number"==typeof t?t.toString():(null==t?void 0:t.id)||"",vin:(null==n?void 0:n.vin)||"",useAutomotive:!!(null==n?void 0:n.vin)},o?{videoActivityType:o}:{}),void 0!==i?{markAsSentConfirmed:i}:{}),a),[4,l(r)];case 1:return[2,e.sent()]}}))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}));var r,i,o,a};return{onQuickShareButtonClick:function(e){var t=e.videoActivityType,n=hF(e,["videoActivityType"]),i=Xl(o)?null===o.customer.markVideosAsSent?aF:parseInt(o.customer.markVideosAsSent.toString(),10):sF;return i===sF?c(pF({videoActivityType:t},n)):i===aF?r(!0):i===lF?c(pF({videoActivityType:t},n)):void 0},isQuickshareLoading:s,onQuickShareMutationHandler:c}},mF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},vF=function(){return vF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vF.apply(this,arguments)},gF=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},xF=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},bF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},wF=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},SF=tt.div(DR||(DR=mF(["\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n opacity: ",";\n &:hover {\n .small-insert-video-button {\n display: none;\n }\n .large-insert-video-button {\n display: flex;\n }\n }\n"],["\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n opacity: ",";\n &:hover {\n .small-insert-video-button {\n display: none;\n }\n .large-insert-video-button {\n display: flex;\n }\n }\n"])),di,(function(e){var t=e.opacity;return null!=t?t:"1"})),CF=tt.div(RR||(RR=mF(["\n position: relative;\n aspect-ratio: 16 / 9;\n min-height: 100px;\n background-color: ",";\n"],["\n position: relative;\n aspect-ratio: 16 / 9;\n min-height: 100px;\n background-color: ",";\n"])),(function(e){return e.backgroundColor||"transparent"})),EF=tt.div(FR||(FR=mF(["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n"],["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n"])),di),kF=tt.div(LR||(LR=mF(["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n min-height: 40px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"],["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n min-height: 40px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"])),Pi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),_F=tt.div(BR||(BR=mF(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"])),Oi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),OF=tt.div(NR||(NR=mF(["\n position: absolute;\n left: 12px;\n bottom: 12px;\n background-color: ",";\n border-radius: 24px;\n color: ",";\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n padding: 4px 8px;\n min-width: 50px;\n"],["\n position: absolute;\n left: 12px;\n bottom: 12px;\n background-color: ",";\n border-radius: 24px;\n color: ",";\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n padding: 4px 8px;\n min-width: 50px;\n"])),"rgba(39, 42, 50, 0.4)",di),PF=tt.img(zR||(zR=mF(["\n position: absolute;\n top: 0;\n height: 100%;\n left: 50%;\n transform: translateX(-50%);\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n height: 100%;\n left: 50%;\n transform: translateX(-50%);\n opacity: ",";\n"])),(function(e){return e.visible?1:0})),TF=tt.div(VR||(VR=mF(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n"])),xi),AF=tt.div(UR||(UR=mF(["\n display: flex;\n justify-content: space-between;\n position: relative;\n z-index: 1;\n padding: 8px;\n"],["\n display: flex;\n justify-content: space-between;\n position: relative;\n z-index: 1;\n padding: 8px;\n"]))),jF=tt.div(HR||(HR=mF(["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"],["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"]))),IF=function(e){var n,r,i,o,a=e.video,s=e.isMerge,l=e.selectedVideosData,c=e.setSelectedVideosData,u=(null==a?void 0:a.folder)===Fn,f=Mt(),d=f.showQuickshareFeature,p=f.showVoiceoverFeature,h=f.showInsertFeature,y=f.showAiAssistFeature,m=f.env,v=Nl().userData,g=Jl(v),x=ec(v),w=function(e,t){return e&&(!!(null==t?void 0:t.customer.vAutoDealerId)||!!(null==t?void 0:t.customer.eDealerId)||!!(null==t?void 0:t.customer.homeNetId)||!!(null==t?void 0:t.customer.maxDigitalId)||!!(null==t?void 0:t.customer.dealersLinkId)||!!(null==t?void 0:t.customer.dealerCueId)||!!(null==t?void 0:t.customer.autoRevolutionId)||!!(null==t?void 0:t.customer.vinsolutionsIMSDealerId)||!!(null==t?void 0:t.customer.dealerDotComIMS)||!!(null==t?void 0:t.customer.dealerCenterDealerId)||function(e){var t;return"64604"===(null===(t=null==e?void 0:e.customerId)||void 0===t?void 0:t.toString())}(t))}(x,v),k=Xl(v),_=dn(),O=bF((0,E.useState)(0),2),P=O[0],T=O[1],A=bF((0,E.useState)(!1),2),j=A[0],I=A[1],M=bF((0,E.useState)(!1),2),D=M[0],R=M[1],F=bF((0,E.useState)(!1),2),L=F[0],B=F[1],N=bF((0,E.useState)(!1),2),z=N[0],V=N[1],U=bF((0,E.useState)(),2),H=U[0],G=U[1],W=Ju().toast,q=(0,E.createRef)(),$=C().headers.Authorization,Z=function(){V(!1),clearTimeout(H)},Y=function(e){q.current&&!z&&V(!0)},Q=yF({video:a,videoRequest:null==a?void 0:a.videoRequest,setShowModalQuickShareMarkAsSent:B}),K=Q.onQuickShareMutationHandler,X=Q.isQuickshareLoading,J=Q.onQuickShareButtonClick,ee=a?function(e,t,n){void 0===n&&(n="YYYY-MM-DD HH:mm:ss");var r=t.timeZone||Intl.DateTimeFormat().resolvedOptions().timeZone||yt().tz.guess(),i=yt()(e,["M/DD/YYYY h:mm:ss A","M/DD/YYYY, h:mm:ss A","M/D/YYYY h:mm:ss A","M/D/YYYY, h:mm:ss A","MM/DD/YYYY"]),o=-yt()().tz("America/New_York").utcOffset(),a=yt()().tz(r).utcOffset(),s=i.add(o,"minute");return yt()(s).add(a,"minute").format(n)}(a.recordDate,v,"MM/DD/YYYY hh:mm:ss A"):"";return(0,E.useEffect)((function(){z&&T(P+1)}),[z]),(0,E.useEffect)((function(){if(P>0&&z){clearTimeout(H);var e=setTimeout(T,1e3,P+1);G(e)}}),[P]),(0,E.useEffect)((function(){return q.current&&(q.current.addEventListener("load",Z,!0),q.current.addEventListener("error",Y,!0)),function(){q.current&&(q.current.removeEventListener("loadedmetadata",Z,!0),q.current.removeEventListener("error",Y,!0))}}),[q]),a?(0,t.jsxs)(SF,{children:[(0,t.jsxs)(CF,vF({backgroundColor:Ai},{children:[(0,t.jsx)(PF,{src:a.thumbnail,ref:q,visible:!z},a.id+P),!s&&(0,t.jsxs)(AF,{children:[(0,t.jsxs)(jF,{children:[!u&&(0,t.jsxs)(t.Fragment,{children:[h&&(0,t.jsx)(yo,{padding:"0 8px",height:"32px",onClick:function(){return _.push("/insert-video/".concat(null==a?void 0:a.id))},textColor:Si,backgroundColor:di,icon:(0,t.jsx)(tT,{size:18,color:Si}),hoverBorderColor:gi,title:"Insert"}),d&&(0,t.jsx)(yo,{padding:"0 8px",title:"QuickShare",height:"32px",onClick:function(){return J({videoActivityType:pu.QUICKSHARE,type:"quickshare"})},textColor:Si,backgroundColor:di,icon:X?(0,t.jsx)(go,{size:12,color:Si}):(0,t.jsx)(JP,{size:18,color:Si}),hoverBorderColor:gi,disabled:X}),y&&(0,t.jsx)(IR,{defaultPromptType:MR.CRM_MESSAGE,handleSubmitGeneratedContent:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){return J({videoActivityType:pu.CRM_SHARE,type:"quickshare"}),[2]}))}))},handleOnCopySuccess:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){return J({videoActivityType:pu.CRM_SHARE,type:"quickshare"}),[2]}))}))},margin:"0 12px 0 0",height:"40px",backgroundcolor:di,iconColor:"gradient",iconPadding:"9px 11px",videoId:a?a.id:"",defaultVin:(null===(n=null==a?void 0:a.videoRequest)||void 0===n?void 0:n.vin)||"",token:$,userData:{customer:{business:v.customer.business,hasCovideoMagic:"1"===(null===(i=null===(r=null==v?void 0:v.customer)||void 0===r?void 0:r.hasCovideoMagic)||void 0===i?void 0:i.toString())},firstName:v.firstName,isAutomotiveSalesRole:x,isAutomotiveServiceRole:g,isIMSEnabled:w},aiAssistTheme:k?"automotive":"covideo",title:"AI assist",env:m})]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{padding:"0 8px",title:"Copy to Primary",height:"32px",onClick:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){switch(e.label){case 0:if(!a)return[2];I(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,(t=a.id,Ln(void 0,void 0,void 0,(function(){var e,n,r;return Bn(this,(function(i){switch(i.label){case 0:return e=S.bearerToken,n={url:"/videos/".concat(t,"/move"),baseURL:b,method:zn,headers:e,data:{videoId:t,copy:!0,videoFolder:"Primary"}},[4,Tn(n).catch((function(e){return e}))];case 1:if((r=i.sent())instanceof Error)throw r;return[2,r]}}))})))];case 2:return e.sent(),W({message:"Video copied successfully."}),[3,4];case 3:return e.sent(),W({message:"Copy failed, please try again later."}),[3,4];case 4:return I(!1),[2]}var t}))}))},textColor:Si,backgroundColor:di,icon:j?(0,t.jsx)(go,{size:12,color:Si}):(0,t.jsx)(Lc,{size:18,color:Si}),hoverBorderColor:gi,disabled:j}),(0,t.jsx)(yo,{padding:"0 8px",title:"Download",height:"32px",onClick:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){switch(e.label){case 0:if(!a)return[2];R(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,(t=a.id,n="".concat(a.title,".mp4"),Ln(void 0,void 0,void 0,(function(){var e,r,i;return Bn(this,(function(o){switch(o.label){case 0:return e=S.bearerToken,r={url:"/videos/".concat(t,"/download"),baseURL:b,method:Nn,headers:e,responseType:"blob"},[4,Tn(r).catch((function(e){return e}))];case 1:if((i=o.sent())instanceof Error)throw i;return[2,(0,Rn.saveAs)(new Blob([i],{type:"video/mp4"}),n)]}}))})))];case 2:return e.sent(),[3,4];case 3:return e.sent(),W({message:"Download failed, please try again later."}),[3,4];case 4:return R(!1),[2]}var t,n}))}))},textColor:Si,backgroundColor:di,icon:D?(0,t.jsx)(go,{size:12,color:Si}):(0,t.jsx)(Bc,{size:18,color:Si}),hoverBorderColor:gi,disabled:D})]})]}),p&&!u&&(0,t.jsx)(yo,{padding:"0 8px",title:"Voiceover",height:"32px",onClick:function(){return _.push("/voiceover/".concat(a.id))},textColor:Si,backgroundColor:di,icon:(0,t.jsx)(XP,{size:18,color:Si}),hoverBorderColor:gi})]}),s&&(0,t.jsx)(lc,{width:"24px",blueCheck:!0,style:{marginLeft:10,marginTop:10},checked:l.find((function(e){return e.id===a.id})),onChange:function(e){return function(e){var t=e.target.checked;c(t?wF(wF([],bF(l),!1),[a],!1):l.filter((function(e){return e.id!=a.id})))}(e)}}),z&&(0,t.jsx)(TF,{children:(0,t.jsx)(go,{})}),!!(null==a?void 0:a.videoLength)&&(0,t.jsx)(OF,{children:(o=a.videoLength,new Date(o).toISOString().substring(14,19))})]})),(0,t.jsxs)(EF,{children:[(0,t.jsx)(kF,{children:a.title}),(0,t.jsxs)(_F,{children:[(0,t.jsx)(iT,{size:16,color:ki,style:{marginRight:6}}),ee]})]}),L&&(0,t.jsx)(Tf,{markAsSentPayload:{type:"quickshare"},isQuickShareLoading:X,quickShareMarkAsSentHandler:K,handleModalClose:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){return B(!1),[2]}))}))}})]}):(0,t.jsxs)(SF,vF({opacity:".3"},{children:[(0,t.jsx)(CF,vF({backgroundColor:Ei},{children:(0,t.jsx)(OF,{children:" "})})),(0,t.jsxs)(EF,{children:[(0,t.jsx)(kF,vF({backgroundColor:Ei,width:"100%"},{children:" "})),(0,t.jsx)(_F,vF({backgroundColor:Ei,width:"70%"},{children:" "}))]})]}))},MF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},DF=tt.div(WR||(WR=MF(["\n position: relative;\n width: 216px;\n ","\n"],["\n position: relative;\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(GR||(GR=MF(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),RF=tt.div(qR||(qR=MF(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),FF=tt.div($R||($R=MF(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),LF=function(e){var n=e.prevSearch,r=e.handleSearch,i=Mt().containerWidth,o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(n||""),2),a=o[0],s=o[1];return(0,t.jsxs)(DF,{children:[(0,t.jsx)(RF,{children:(0,t.jsx)(fT,{onClick:function(){return r(a)},size:17})}),(0,t.jsx)(lo,{width:"100%",type:"text",padding:"8px 8px 8px 40px",value:a,placeholder:i>=ti?"Search videos...":"Search...",onKeyUp:function(e){"Enter"===e.key&&r(a)},onChange:function(e){s(e.currentTarget.value)}}),""!==a&&(0,t.jsx)(FF,{children:(0,t.jsx)(Fc,{onClick:function(){return s(""),void r("")},size:17})})]})},BF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},NF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},zF=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},VF=tt.div(YR||(YR=BF(["\n position: relative;\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n z-index: 0;\n ","\n"],["\n position: relative;\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n z-index: 0;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(ZR||(ZR=BF(["\n grid-template-columns: 1fr;\n "],["\n grid-template-columns: 1fr;\n "])))})),UF=tt.div(KR||(KR=BF(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n ","\n"],["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n ","\n"])),_i,(function(e){return e.theme.containerWidth<ni&&Ne(QR||(QR=BF(["\n top: 32px;\n width: 100%;\n text-align: center;\n "],["\n top: 32px;\n width: 100%;\n text-align: center;\n "])))})),HF=function(e){var n=e.size,r=e.message;return(0,t.jsxs)(VF,{children:[(0,t.jsx)(UF,{children:r}),zF([],NF(Array(n)),!1).map((function(e,n){return(0,t.jsx)(IF,{},n)}))]})},GF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},WF=function(){return WF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},WF.apply(this,arguments)},qF=tt.div(XR||(XR=GF(["\n position: relative;\n"],["\n position: relative;\n"]))),$F=tt.div(JR||(JR=GF(["\n position: absolute;\n cursor: pointer;\n top: 40px;\n min-height: 20px;\n background: pink;\n width: 100%;\n box-shadow: 0px 0px 4px rgba(66, 79, 104, 0.08),\n 0px 6px 12px rgba(66, 79, 104, 0.06);\n border-radius: 8px;\n background: ",";\n"],["\n position: absolute;\n cursor: pointer;\n top: 40px;\n min-height: 20px;\n background: pink;\n width: 100%;\n box-shadow: 0px 0px 4px rgba(66, 79, 104, 0.08),\n 0px 6px 12px rgba(66, 79, 104, 0.06);\n border-radius: 8px;\n background: ",";\n"])),di),ZF=function(e){var n=e.name,r=e.handleUpdateToken,i=Mt().hasExternalJwt,o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(!1),2),a=o[0],s=o[1],l=function(e){var t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(E.useState(null),2),n=t[0],r=t[1];E.useEffect((function(){if(n){var e=function(e){n.contains(e.target)||s(!1)};return document.addEventListener("click",e,!0),function(){return document.removeEventListener("click",e,!0)}}}),[n]);var i=E.useCallback((function(e){return r(e)}),[]);return{ref:i}}().ref,c=dn();return i?null:(0,t.jsxs)(qF,WF({ref:l},{children:[(0,t.jsx)(yo,{text:n,backgroundColor:a?Ci:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(uT,{size:18,color:_i}),iconOther:a?(0,t.jsx)(rT,{}):(0,t.jsx)(nT,{}),onClick:function(){s((function(e){return!e}))}}),a&&(0,t.jsx)($F,WF({onClick:function(){return r(""),Pt(),void c.go(0)}},{children:(0,t.jsx)(yo,{text:"Log Out",textColor:Ri,backgroundColor:"transparent",borderColor:"transparent",icon:(0,t.jsx)(Ac,{size:18,color:Mi})})}))]}))},YF=tt.div(eF||(eF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),Oi),QF=function(e){var n=e.page,r=e.size,i=e.count,o=n*r+1,a=n*r+r;return a>i&&(a=i),(0,t.jsxs)(YF,{children:[o,"-",a," of ",i]})};!function(e){e.NoStatus="",e.Pending="pending",e.Denied="denied",e.Approved="approved"}(tF||(tF={})),function(e){e.NoStatus="",e.NotSent="not_sent",e.Sent="sent",e.Watched="watched",e.Deleted="deleted"}(nF||(nF={})),function(e){e.NoType="",e.Marketing="Marketing",e.Prospecting="Prospecting",e.RespondToInquiry="Respond to Inquiry",e.ThanksForYourBusiness="Thanks For Your Business"}(rF||(rF={})),function(e){e.NoType="",e.AdditionalRepair="Additional Repair",e.RepairInquiry="Repair inquiry",e.RegularService="Regular service",e.ServiceReminder="Service reminder",e.QuoteRequest="Quote request"}(iF||(iF={})),function(e){e[e.LEGACY=0]="LEGACY",e[e.FREE=1]="FREE",e[e.PRO=2]="PRO",e[e.TEAMS=3]="TEAMS",e[e.ENTERPRISE=4]="ENTERPRISE"}(oF||(oF={}));var KF,XF,JF,eL,tL,nL,rL,iL,oL,aL,sL,lL,cL,uL,fL,dL,pL,hL,yL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},mL=function(){return mL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mL.apply(this,arguments)},vL=tt.div(lL||(lL=yL(["\n visibility: hidden;\n opacity: 0;\n position: absolute;\n ","\n height: auto;\n width: ",";\n max-width: ",";\n padding: ",";\n background: ",";\n border: 1px solid ",";\n box-shadow: 0px 8px 32px rgba(29, 30, 36, 0.08);\n border-radius: 5px;\n z-index: 99;\n cursor: initial;\n ","\n // TODO: add support for other triangle positions when needed\n ","\n ","\n"],["\n visibility: hidden;\n opacity: 0;\n position: absolute;\n ","\n height: auto;\n width: ",";\n max-width: ",";\n padding: ",";\n background: ",";\n border: 1px solid ",";\n box-shadow: 0px 8px 32px rgba(29, 30, 36, 0.08);\n border-radius: 5px;\n z-index: 99;\n cursor: initial;\n ","\n // TODO: add support for other triangle positions when needed\n ","\n ","\n"])),(function(e){return"bottom"===e.position?Ne(KF||(KF=yL(["\n top: 100%;\n left: 50%;\n transform: translate(-50%);\n "],["\n top: 100%;\n left: 50%;\n transform: translate(-50%);\n "]))):"below"===e.position?Ne(XF||(XF=yL(["\n top: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "],["\n top: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "]))):"bottom-left"===e.position?Ne(JF||(JF=yL(["\n top: 100%;\n left: 0%;\n "],["\n top: 100%;\n left: 0%;\n "]))):"right"===e.position?Ne(eL||(eL=yL(["\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n "],["\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n "]))):"top-left"===e.position?Ne(tL||(tL=yL(["\n bottom: 100%;\n left: 0%;\n "],["\n bottom: 100%;\n left: 0%;\n "]))):"top-right"===e.position?Ne(nL||(nL=yL(["\n bottom: 100%;\n right: 0%;\n "],["\n bottom: 100%;\n right: 0%;\n "]))):"top"===e.position?Ne(rL||(rL=yL(["\n bottom: 100%;\n left: 50%;\n transform: translate(-50%);\n "],["\n bottom: 100%;\n left: 50%;\n transform: translate(-50%);\n "]))):"above"===e.position?Ne(iL||(iL=yL(["\n bottom: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "],["\n bottom: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "]))):null}),(function(e){return e.width}),(function(e){return e.maxWidth}),(function(e){return e.padding}),di,"#f7f8fa",(function(e){return e.showTriangle&&Ne(oL||(oL=yL(["\n &:after {\n content: '';\n display: block;\n position: absolute;\n }\n "],["\n &:after {\n content: '';\n display: block;\n position: absolute;\n }\n "])))}),(function(e){var t=e.showTriangle,n=e.position;return t&&("above"===n||"top"===n)&&Ne(aL||(aL=yL(["\n &:after {\n border-bottom: 0;\n border-top: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "],["\n &:after {\n border-bottom: 0;\n border-top: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "])),di)}),(function(e){var t=e.showTriangle,n=e.position;return t&&"below"===n&&Ne(sL||(sL=yL(["\n &:after {\n border-top: 0;\n border-bottom: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "],["\n &:after {\n border-top: 0;\n border-bottom: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "])),di)})),gL=tt.div(uL||(uL=yL(["\n position: relative;\n ","\n"],["\n position: relative;\n ","\n"])),(function(e){var t=e.disableHover,n=e.cursor;return t?null:Ne(cL||(cL=yL(["\n cursor: ",";\n &:hover "," {\n visibility: visible;\n opacity: 1;\n transition-delay: 300ms;\n }\n "],["\n cursor: ",";\n &:hover "," {\n visibility: visible;\n opacity: 1;\n transition-delay: 300ms;\n }\n "])),n,vL)})),xL=function(e){var n=e.hoverable,r=e.className,i=e.popup,o=e.position,a=void 0===o?"bottom":o,s=e.padding,l=void 0===s?"24px":s,c=e.width,u=void 0===c?"267px":c,f=e.maxWidth,d=void 0===f?"":f,p=e.disableHover,h=void 0!==p&&p,y=e.showTriangle,m=void 0!==y&&y,v=e.cursor,g=void 0===v?"pointer":v;return(0,t.jsxs)(gL,mL({disableHover:h,className:r,cursor:g},{children:[(0,t.jsx)(vL,mL({width:u,position:a,padding:l,showTriangle:m,maxWidth:d||u},{children:i})),n]}))},bL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},wL=function(){return wL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wL.apply(this,arguments)},SL=tt.div(fL||(fL=bL(["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"],["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"])),yi),CL=tt.div(pL||(pL=bL(["\n width: auto;\n height: 100vh;\n ","\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"],["\n width: auto;\n height: 100vh;\n ","\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"])),(function(e){return e.theme.containerWidth>=ti&&Ne(dL||(dL=bL(["\n width: 100vw;\n "],["\n width: 100vw;\n "])))})),EL=tt.div(hL||(hL=bL(["\n height: ",";\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n"],["\n height: ",";\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n"])),(function(e){return e.maxHeight?e.maxHeight:"100vh"}),(function(e){return e.overflowY}),(function(e){return e.overflowX}),(function(e){if(e.disableFullScreen)return"\n height: ".concat(e.overrideBodyHeight&&e.maxHeight?e.maxHeight:"auto",";\n width: ").concat(e.widthOnDesktop?e.widthOnDesktop:"auto",";\n ")})),kL=function(e){var n=e.style,r=void 0===n?{}:n,i=e.children,o=e.widthOnDesktop,a=e.disableFullScreen,s=e.maxHeight,l=e.overrideBodyHeight,c=void 0!==l&&l,u=e.bodyOverflowY,f=void 0===u?"auto":u,d=e.bodyOverflowX,p=void 0===d?"hidden":d;return(0,E.useEffect)((function(){if(document&&document.body){var e=document.body.className;document.body.className=e+(e?" ":"")+"modal-open"}return function(){document&&document.body&&(document.body.className=document.body.className.replace(/ ?modal-open/,""))}}),[]),(0,t.jsx)(SL,wL({style:r},{children:(0,t.jsx)(CL,{children:(0,t.jsx)(EL,wL({disableFullScreen:a,widthOnDesktop:o,maxHeight:s,overrideBodyHeight:c,overflowX:p,overflowY:f},{children:i}))})}))},_L=function(){return _L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_L.apply(this,arguments)},OL={data:null,error:null,loading:!0,progress:0},PL=function(e,t){switch(t.type){case"REQUEST":return _L(_L({},e),{loading:!0,error:null});case"PROGRESS":return _L(_L({},e),{progress:Math.min(e.progress+(n=25,Math.floor(Math.random()*Math.floor(n))),100)});case"SUCCESS":return _L(_L({},e),{data:t.data,loading:!1,error:null,progress:100});case"FAILURE":return _L(_L({},e),{data:null,loading:!1,error:t.error,progress:100});default:return e}var n},TL=function(){return TL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},TL.apply(this,arguments)},AL=function(e){var t=e.method,n=e.pathname,r=e.origin,i=e.params,o=e.autoFetch,a=void 0!==o&&o,s=e.showToastMessage,l=void 0===s||s,c=function(e){var t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useReducer)(PL,{data:null,error:"",loading:!1}||OL),2);return{state:t[0],dispatch:t[1]}}(),u=c.state,f=c.dispatch,d=u.data,p=u.error,h=u.loading,y=u.progress,m=Ju().toast,v=function(e,o){return a=void 0,s=void 0,u=function(){var a,s,c,u;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(d){return f({type:"REQUEST"}),a=setInterval((function(){f({type:"PROGRESS"})}),200),(s=null==e?void 0:e.baseURL)||(s=r||"https://www.covideo.com/api/v2.0"),c=s===b?S.bearerToken:S.headers,u={url:n,baseURL:s,method:void 0!==t?t:"get",params:i},kn()(TL(TL(TL({},u),{headers:c}),e)).then((function(e){var n=e.data,r=e.success;n&&n.message&&l&&m({title:n.message}),n.id&&(n.video_id=n.id),"patch"===t&&(Array.isArray(n)&&(n=n.length>0?"SUCCESS":r),n=!0===n?"SUCCESS":"ERROR"),o>=0&&(n.id=o,n.data&&(n.data.id=o)),f({type:"SUCCESS",data:n}),clearInterval(a)})).catch((function(e){f({type:"FAILURE",error:e.message}),l&&m({title:e.message}),clearInterval(a)})),[2]}))},new((c=void 0)||(c=Promise))((function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function r(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c((function(e){e(i)}))).then(n,r)}i((u=u.apply(a,s||[])).next())}));var a,s,c,u};return a&&null==d&&!1===h&&!p&&v(),{data:d,loading:h,error:p,fetchData:v,progress:y}},jL=function(){var e=AL({pathname:"",origin:b}),t=e.data,n=e.error,r=e.loading,i=e.fetchData;return{videoData:t||null,loading:r,error:n,fetch:function(e){i({method:"post",url:"/videos",baseURL:b,data:{filename:e.filename,title:e.title}},e.hasOwnProperty("id")?e.id:void 0)},progress:e.progress}},IL=function(){var e=AL({pathname:""}),t=e.data,n=e.error,r=e.loading,i=e.fetchData,o=e.progress;return{encodeData:t&&(t.data||t.jobId)||null,loading:r,error:n,fetch:function(e){var t=e.videoId;return i({method:"post",url:"videos/".concat(t,"/encode"),baseURL:b})},progress:o}},ML=function(){var e=AL({origin:b}),t=e.data,n=e.error,r=e.loading,i=e.fetchData;return{presignedUrl:t,loading:r,error:n,fetch:function(e){i({method:"get",url:"aws/signedurl?filename=".concat(e.fileName,"&filetype=").concat(e.type),baseURL:b},e.hasOwnProperty("id")?e.id:void 0)}}},DL=function(){return DL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},DL.apply(this,arguments)},RL=(0,E.createContext)({}),FL=function(e){var n=e.children,r=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)({}),2),i={action:r[0],setAction:r[1]};return(0,t.jsx)(RL.Provider,DL({value:i},{children:n}))},LL=(RL.Consumer,function(e){return{type:e.type,meta:e.meta}}),BL=function(e){return{type:e.type,payload:e.payload,meta:e.meta}},NL=function(e){var t=e.type,n=e.payload,r=e.meta,i=e.error;return{type:t,payload:n,meta:r,error:void 0===i||i}},zL=function(){return zL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zL.apply(this,arguments)};function VL(e,t){switch(t.type){case"FETCH_REQUEST":return zL(zL({},e),{loading:!0,error:null});case"FETCH_SUCCESS":return zL(zL({},e),{data:t.payload,loading:!1,error:null});case"FETCH_FAILURE":return zL(zL({},e),{loading:!1,error:t.payload});default:return e}}var UL={data:void 0,loading:!1,error:null},HL=function(){var e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useReducer)(VL,UL),2),t=e[0],n=e[1],r=t.error,i=t.loading,o=t.data,a=Ju().toast;!function(e){var t=(0,E.useContext)(RL).action;(0,E.useEffect)((function(){e(t)}),[t,e])}(n);var s=(0,E.useCallback)((function(e){return t=void 0,r=void 0,o=function(){var t,r,i;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(o){switch(o.label){case 0:n(LL({type:"FETCH_REQUEST"})),t=function(t){e.onUploadProgress(t,e.hasOwnProperty("id")?e.id:void 0)},o.label=1;case 1:return o.trys.push([1,3,,4]),r=function(){var e;return-1!==(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.indexOf("Firefox"))}(),[4,kn().put(e.url,e.file,{headers:{"content-type":!r&&e.contentType?e.contentType:e.file.type},onUploadProgress:t})];case 2:return o.sent(),n(BL({type:"FETCH_SUCCESS",payload:{success:!0,id:e.hasOwnProperty("id")?e.id:void 0}})),[2];case 3:if((i=o.sent())instanceof Error)throw a({message:null==i?void 0:i.message}),n(NL({type:"FETCH_FAILURE",payload:"Something wen wrong"})),new Error(i.message);return[3,4];case 4:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(t,r||[])).next())}));var t,r,i,o}),[]);return{data:o,loading:i,error:r,uploadVideo:s}},GL=function(){return GL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},GL.apply(this,arguments)};function WL(e,t){switch(t.type){case"FETCH_REQUEST":return GL(GL({},e),{loading:!0,error:null});case"FETCH_SUCCESS":return GL(GL({},e),{data:t.payload,loading:!1,error:null});case"FETCH_FAILURE":return GL(GL({},e),{data:void 0,loading:!1,error:t.payload});default:return e}}var qL,$L=function(){var e=(0,E.useContext)(RL).setAction,t=Ju().toast,n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useReducer)(WL,{data:void 0,loading:!1,error:null,isValid:!1}),2),r=n[0],i=n[1],o=r.data,a=r.error,s=r.loading;return{start:function(n){return r=void 0,a=void 0,l=function(){var r,a;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(s){switch(s.label){case 0:i(LL({type:"FETCH_REQUEST"})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Yn(n)];case 2:return r=s.sent(),i(BL({type:"FETCH_SUCCESS",payload:r})),t({title:"Transcription Started"}),[2,{data:o,loading:!1,error:null}];case 3:return a=s.sent(),t({message:a}),i(NL({type:"FETCH_FAILURE",payload:"Something went wrong"})),e({type:"START_VIDEO_TRANSCRIPTION"}),[2,Promise.reject({loading:!1,error:"Something went wrong"})];case 4:return[2]}}))},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,i)}o((l=l.apply(r,a||[])).next())}));var r,a,s,l},data:o,loading:s,error:a}};function ZL(){return ZL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZL.apply(this,arguments)}const YL=tt((function(e){return E.createElement("svg",ZL({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),qL||(qL=E.createElement("g",{fill:"#272A32"},E.createElement("path",{id:"bqn2hmlmqa",d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))))}))(QL||(QL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"1"}));var QL,KL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},XL=function(){return XL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},XL.apply(this,arguments)},JL=tt.div(iB||(iB=KL(["\n margin-top: ","px;\n text-align: center;\n width: ","px;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n height: ","px;\n background-color: ",";\n\n .file-exists {\n text-align: left;\n color: red;\n }\n\n .drag-drop-zone {\n display: block;\n width: ","px;\n max-width: 100%;\n height: ","px;\n border: 1px dashed ",";\n border-radius: 5px;\n color: ",";\n font-size: 16px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n box-sizing: border-box;\n\n input {\n background: none !important;\n border: none;\n padding: 0 !important;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n color: ",";\n }\n }\n }\n\n .drag-drop-zone.inside-drag-area {\n svg {\n opacity: 0.7;\n }\n }\n\n .drag-drop-zone.outside-drag-area {\n svg {\n opacity: 0.3;\n }\n }\n\n .dropped-files li {\n color: #07f;\n padding: 3px;\n text-align: left;\n font-weight: bold;\n }\n\n .file {\n display: none;\n }\n"],["\n margin-top: ","px;\n text-align: center;\n width: ","px;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n height: ","px;\n background-color: ",";\n\n .file-exists {\n text-align: left;\n color: red;\n }\n\n .drag-drop-zone {\n display: block;\n width: ","px;\n max-width: 100%;\n height: ","px;\n border: 1px dashed ",";\n border-radius: 5px;\n color: ",";\n font-size: 16px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n box-sizing: border-box;\n\n input {\n background: none !important;\n border: none;\n padding: 0 !important;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n color: ",";\n }\n }\n }\n\n .drag-drop-zone.inside-drag-area {\n svg {\n opacity: 0.7;\n }\n }\n\n .drag-drop-zone.outside-drag-area {\n svg {\n opacity: 0.3;\n }\n }\n\n .dropped-files li {\n color: #07f;\n padding: 3px;\n text-align: left;\n font-weight: bold;\n }\n\n .file {\n display: none;\n }\n"])),(function(e){return e.marginTop}),(function(e){return e.width}),(function(e){return e.height}),(function(e){return e.backgroundColor||di}),(function(e){return e.width-2}),(function(e){return e.height}),Wi,Fi,"#007BFF"),eB=tt.div(oB||(oB=KL(["\n height: 100%;\n width: 100%;\n float: left;\n line-height: 0.2;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n z-index: -1;\n background-color: ",";\n"],["\n height: 100%;\n width: 100%;\n float: left;\n line-height: 0.2;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n z-index: -1;\n background-color: ",";\n"])),(function(e){return e.backgroundColor?e.backgroundColor:e.isActive?"#f6f7f9":"#fff"})),tB=tt.div(aB||(aB=KL(["\n svg {\n opacity: 1 !important;\n }\n"],["\n svg {\n opacity: 1 !important;\n }\n"]))),nB=tt.p(sB||(sB=KL(["\n width: 317px;\n margin: 0 0 21px;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: ",";\n"],["\n width: 317px;\n margin: 0 0 21px;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: ",";\n"])),pi);const rB=function(e){var n=e.accept,r=void 0===n?".csv, text/csv":n,i=e.inputStyle,o=void 0===i?{}:i,a=e.onDrop,s=e.text,l=void 0===s?"Drag and drop your files here or":s,c=e.width,u=void 0===c?528:c,f=e.height,d=void 0===f?100:f,p=e.marginTop,h=void 0===p?0:p,y=e.disabled,m=void 0!==y&&y,v=e.textStyle,g=e.backgroundColor,x=e.placeholder,b=void 0===x?"Browse files...":x,w=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(k().useReducer((function(e,t){var n,i;switch(t.type){case"SET_DROP_DEPTH":return XL(XL({},e),{dropDepth:t.dropDepth});case"SET_IN_DROP_ZONE":return XL(XL({},e),{inDropZone:t.inDropZone});case"ADD_FILE_TO_LIST":var o=!0;try{for(var a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.files),s=a.next();!s.done;s=a.next()){var l=s.value;o=r.includes(l.name.substr(-4))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o?XL(XL({},e),{fileList:e.fileList.concat(t.files)}):e;default:return e}}),{dropDepth:0,inDropZone:!1,fileList:[]}),2),S=w[0],C=w[1],E=function(){var e=document.getElementById("file");e&&e.click&&e.click()};return(0,t.jsx)(JL,XL({width:u,height:d,marginTop:h,backgroundColor:g},{children:(0,t.jsx)("div",XL({className:S.inDropZone?"drag-drop-zone inside-drag-area":"drag-drop-zone outside-drag-area",onDrop:function(e){return a(e)},onDragOver:function(e){return function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",C({type:"SET_IN_DROP_ZONE",inDropZone:!0})}(e)},onDragEnter:function(e){return function(e){e.preventDefault(),e.stopPropagation(),C({type:"SET_DROP_DEPTH",dropDepth:S.dropDepth+1})}(e)},onDragLeave:function(e){return function(e){e.preventDefault(),e.stopPropagation(),e.target&&e.target.id.includes("text-")||(C({type:"SET_DROP_DEPTH",dropDepth:S.dropDepth-1}),C({type:"SET_IN_DROP_ZONE",inDropZone:!1}))}(e)}},{children:(0,t.jsxs)(eB,XL({id:"text-browse",isActive:S.inDropZone,backgroundColor:g},{children:[!S.inDropZone&&0===S.fileList.length&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nB,XL({style:v},{children:l})),S.inDropZone?(0,t.jsx)("input",{type:"button",value:"browse your files...",onClick:E}):(0,t.jsx)(tB,{children:(0,t.jsx)(yo,{text:b,textColor:"#fff",backgroundColor:Qi,icon:(0,t.jsx)(YL,{color:"#fff"}),disabled:m,onClick:E,fontSize:"15px"})})]}),S.inDropZone&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)("p",XL({id:"text-drop"},{children:"Drop file here"}))]}),S.fileList[0]&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsxs)("p",{children:[S.fileList[0][0].name," is ready"]})]}),(0,t.jsx)("input",{className:"file",id:"file",type:"file",style:o,accept:r,onChange:function(e){return a(e)},disabled:m})]}))}))}))};var iB,oB,aB,sB,lB,cB,uB,fB,dB,pB,hB,yB,mB,vB,gB,xB,bB,wB,SB,CB,EB,kB,_B,OB=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},PB=tt.div(lB||(lB=OB(["\n min-height: 400px;\n position: relative;\n"],["\n min-height: 400px;\n position: relative;\n"]))),TB=tt.div(cB||(cB=OB(["\n font-size: 15px;\n color: ",";\n background-color: ",";\n\n display: flex;\n flex-direction: column;\n\n margin-top: 18px;\n padding: 20px 30px;\n\n min-height: 340px;\n max-height: 340px;\n overflow-y: auto;\n overflow-x: hidden !important;\n width: 500px;\n max-width: 100%;\n"],["\n font-size: 15px;\n color: ",";\n background-color: ",";\n\n display: flex;\n flex-direction: column;\n\n margin-top: 18px;\n padding: 20px 30px;\n\n min-height: 340px;\n max-height: 340px;\n overflow-y: auto;\n overflow-x: hidden !important;\n width: 500px;\n max-width: 100%;\n"])),Yi,Ci),AB=tt.div(fB||(fB=OB(["\n display: flex;\n justify-content: right;\n align-items: center;\n\n padding: 10px 20px;\n\n ","\n"],["\n display: flex;\n justify-content: right;\n align-items: center;\n\n padding: 10px 20px;\n\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(uB||(uB=OB(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),jB=(tt.label(pB||(pB=OB(["\n padding: ",";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: flex;\n align-items: center;\n cursor: ",";\n height: 40px;\n font-size: 15px;\n color: ",";\n background-color: ",";\n border-radius: 6px;\n border: 1px solid ",";\n font-weight: 600;\n\n ","\n"],["\n padding: ",";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: flex;\n align-items: center;\n cursor: ",";\n height: 40px;\n font-size: 15px;\n color: ",";\n background-color: ",";\n border-radius: 6px;\n border: 1px solid ",";\n font-weight: 600;\n\n ","\n"])),(function(e){return e.disabled?"8px 16px 8px 35px":"8px 16px 8px 12px"}),(function(e){return e.isAddMoreEnabled?"pointer":"not-allowed"}),Bi,Hi,ji,(function(e){return e.disabled&&Ne(dB||(dB=OB(["\n cursor: ",";\n "],["\n cursor: ",";\n "])),e.isAddMoreEnabled?"pointer":"not-allowed")})),tt.div(hB||(hB=OB(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"])))),IB=tt.div(yB||(yB=OB(["\n display: flex;\n"],["\n display: flex;\n"]))),MB=tt.div(mB||(mB=OB(["\n width: 0%;\n color: white;\n background-color: transparent;\n height: 4px;\n text-align: right;\n font-size: 1px;\n border-radius: 15px;\n"],["\n width: 0%;\n color: white;\n background-color: transparent;\n height: 4px;\n text-align: right;\n font-size: 1px;\n border-radius: 15px;\n"]))),DB=tt.div(gB||(gB=OB(["\n width: 50%;\n color: black;\n padding: 1%;\n text-align: left;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"],["\n width: 50%;\n color: black;\n padding: 1%;\n text-align: left;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(vB||(vB=OB(["\n font-size: 15px;\n "],["\n font-size: 15px;\n "])))})),RB=tt.div(xB||(xB=OB(["\n display: flex;\n background: ",";\n"],["\n display: flex;\n background: ",";\n"])),Ci),FB=tt.div(wB||(wB=OB(["\n flex-grow: 1;\n color: black;\n padding: 1%;\n text-align: right;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"],["\n flex-grow: 1;\n color: black;\n padding: 1%;\n text-align: right;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(bB||(bB=OB(["\n font-size: 15px;\n "],["\n font-size: 15px;\n "])))})),LB=tt.div(CB||(CB=OB(["\n position: absolute;\n top: -47px;\n left: 0;\n padding: 0 32px;\n height: 30px;\n font-size: 18px;\n color: ",";\n background-color: white;\n\n ","\n"],["\n position: absolute;\n top: -47px;\n left: 0;\n padding: 0 32px;\n height: 30px;\n font-size: 18px;\n color: ",";\n background-color: white;\n\n ","\n"])),Pi,(function(e){return e.theme.containerWidth<ti&&Ne(SB||(SB=OB(["\n font-size: 16px;\n "],["\n font-size: 16px;\n "])))})),BB=tt.div(EB||(EB=OB(["\n display: flex;\n height: 249px;\n padding: 32px;\n align-items: center;\n"],["\n display: flex;\n height: 249px;\n padding: 32px;\n align-items: center;\n"]))),NB=function(){return NB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},NB.apply(this,arguments)},zB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},VB=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},UB=tt.div(kB||(kB=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-size: 14px;\n color: ",";\n height: 20px;\n margin-top: 15px;\n"],["\n font-size: 14px;\n color: ",";\n height: 20px;\n margin-top: 15px;\n"])),Ri),HB=function(e){var n=e.progress,r=e.uploadingData,i=e.setUploadingData,o=[],a=[],s=[],l=[],c=zB(k().useState([{elementId:0,isTitleNotEmpty:!0}]),2),u=c[0],f=c[1];for(var d in r)o.push(r[d]),a=(l=o.filter((function(e){return 1===e.showActiveVideo}))).filter((function(e){return 1===e.status})),s=l.reduce((function(e,t){return t.progressEvent.total+e}),0);var p=function(e){return e.status>=1};return(0,t.jsxs)("div",{children:[!!n&&(0,t.jsxs)(LB,{children:[(0,t.jsx)("span",{children:(0,t.jsxs)("b",{children:[a.length," of ",l.length]})})," videos uploading (",Ot(s)," MB)"]}),o.map((function(e){return(0,t.jsxs)(jB,{children:[" ",e.showActiveVideo?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(IB,NB({style:NB({},p(e)&&{flexDirection:"column"})},{children:[(0,t.jsx)(lo,{maxLength:100,type:"text",value:e.title,readOnly:!!n,width:"100%",onChange:function(t){return function(e,t){u.filter((function(t){return t.elementId===e})).forEach((function(e){var t=u.indexOf(e);t>=0&&f(u.splice(t,1))})),f(VB(VB([],zB(u),!1),[{elementId:e,isTitleNotEmpty:!!t.trimStart()}],!1)),i((function(n){var r;return NB(NB({},n),((r={})[e]=NB(NB({},n[e]),{title:t}),r))}))}(e.id,t.target.value)}}),p(e)&&(0,t.jsxs)("div",NB({style:{width:"100%",marginTop:"18px",backgroundColor:"white"}},{children:[(0,t.jsx)(MB,{style:{width:e.progressEvent.percentage+"%",backgroundColor:Qi}}),(0,t.jsxs)(RB,{children:[(0,t.jsx)(DB,{children:(r=e.status,0===r?"Waiting...":1===r?"Uploading...":"Encoding...")}),(0,t.jsx)(FB,{children:Ot(e.progressEvent.loaded)+" MB/"+Ot(e.progressEvent.total)+" MB"})]})]}))]})),u.map((function(n){return n.elementId!==e.id||n.isTitleNotEmpty?(0,t.jsx)("div",{},"el-".concat(n.elementId)):(0,t.jsx)(UB,{children:"Video title is required!"},"error-".concat(n.elementId))}))]}):""]},"Video-list-".concat(e.id));var r}))]})},GB=function(){return GB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},GB.apply(this,arguments)},WB=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},qB=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},$B=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};!function(e){e[e.FORM=0]="FORM",e[e.UPLOADING=1]="UPLOADING",e[e.CREATE=2]="CREATE",e[e.ENCODE=3]="ENCODE"}(_B||(_B={}));const ZB=function(e){var n=e.handleModalClose,r=e.onSuccess,i=Ju().toast,o=Nl().userData,a=$L().start,s=$B((0,E.useState)(_B.FORM),2),l=s[0],c=s[1],u=$B((0,E.useState)({}),2),f=u[0],d=u[1],p=$B((0,E.useState)(!1),2),h=p[0],y=p[1],m=$B((0,E.useState)(!1),2),v=m[0],g=m[1],x=$B((0,E.useState)(!1),2),b=x[0],w=x[1],S=$B((0,E.useState)(_B.FORM),2),C=S[0],k=S[1],_=$B((0,E.useState)([]),2),O=_[0],P=_[1],T=$B((0,E.useState)({loaded:0,total:0,percentage:0}),2),A=(T[0],T[1]),j=ML(),I=j.presignedUrl,M=j.fetch,D=j.loading,R=j.error,F=HL(),L=F.uploadVideo,B=F.loading,N=F.data,z=F.error,V=jL(),U=V.fetch,H=V.loading,G=V.videoData,W=V.error,q=IL(),$=q.fetch,Z=q.loading,Y=q.encodeData;(0,E.useEffect)((function(){if(!D&&!R&&Object.keys(f).length){c(_B.UPLOADING),k(_B.UPLOADING);var e=(I||{id:-1}).id;if(void 0===e)return;Object.keys(f).length&&(f[e].status=1,d(f)),L({url:I.url,file:f[e].file,onUploadProgress:X,id:I.id})}}),[I]),(0,E.useEffect)((function(){if(!B&&!z&&N&&Object.keys(f).length){var e=(N||{id:-1}).id;if(void 0===e)return;Object.keys(f).length&&(f[e].status=2,d(f));var t=f[e];k(_B.CREATE),U({filename:t.file.name,title:t.title,id:N.id})}}),[B,N]),(0,E.useEffect)((function(){l===_B.FORM||f&&Object.keys(f).length||c(_B.FORM);var e=[],t=[];Object.keys(f).forEach((function(n){e.push(!(!f[n].title||!f[n].title.trimStart())),t.push(f[n].title.length>100)})),e.includes(!1)?y(!0):t.includes(!0)?(i({title:"Video title can not be more than 100 characters!"}),y(!0)):y(!1)}),[f]),(0,E.useEffect)((function(){if(!H&&!W&&G&&Object.keys(f).length){k(_B.ENCODE);var e=(G||{id:-1}).id;if(void 0===e)return;Object.keys(f).length&&(f[e].status=3,d(f)),P([Number(G.video_id)]),$({videoId:G.video_id,customerId:o.customerId})}}),[H,G]),(0,E.useEffect)((function(){Z||!Y||O.length!==Object.keys(f).length||Object.values(f).some((function(e){return e.status<3}))||(J(),r(O),n())}),[H,Y,O]);var Q=function(){if(C===_B.FORM)return n();w(!0)},K=function(){g(!0),Object.keys(f).forEach((function(e){var t=f[e].file;M({fileName:t.name,type:t.type,id:parseInt(e,10)})}))},X=function(e,t){var n=Math.round(100*e.loaded/e.total);if(void 0!==t&&f[t]){var r=GB({},f);r[t].progressEvent={loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:n},d(r),A({loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:n})}},J=function(){if(o.autoTranscribe&&G&&G.id)try{setTimeout((function(){a(G.id)}),5e3)}catch(e){console.log(e)}},ee=!!Object.keys(f).length,te=function(e){var n=e.disabled,r=void 0!==n&&n,i=e.title,o=void 0===i?"Upload":i,a=e.onClick,s=void 0===a?K:a;return(0,t.jsx)(yo,{text:o,backgroundColor:Qi,textColor:di,onClick:s,margin:"0",padding:"8px 16px",fontSize:"15px",disabled:r})},ne=(0,t.jsxs)(PB,{children:[(0,t.jsx)(TB,GB({style:GB({},!ee&&{backgroundColor:"transparent",marginTop:0,maxHeight:"400px"})},{children:ee?(0,t.jsx)(HB,{uploadingData:f,setUploadingData:d,progress:C}):(0,t.jsx)(rB,{onDrop:function(e){return WB(void 0,void 0,void 0,(function(){var t;return qB(this,(function(n){switch(n.label){case 0:return e.preventDefault(),e.stopPropagation(),(t=e.dataTransfer||e.target)&&t.files&&t.files.length?[4,(r=t.files,WB(void 0,void 0,void 0,(function(){var e,t;return qB(this,(function(n){for(e=function(e){if(!/.*\.(avchd|swf|flv|mov|qt|wmv|mkv|m4v|m4p|mpv|mp2|mpe|mpg|ogg|mp4|avi|webm|mpeg)/i.test(r[e].name))return i({title:"".concat(r[e].name," is of invalid type and won't be uploaded.")}),"continue";var t=r[e].name.split("."),n="mkv"===t[1]?"video/x-matroska":r[e].type,a=new File([r[e]],Ct(o,t[t.length-1]),{type:n,lastModified:r[e].lastModified});d((function(e){var n=GB({},e),r=0;if(Object.keys(e).length){var i=Object.keys(e);r=parseInt(i[i.length-1],10)+1}return n[r]={id:r,file:a,title:t[0],progressEvent:{loaded:0,total:0,percentage:0},status:0,showActiveVideo:1},n}))},t=0;t<r.length;t++)e(t);return[2]}))})))]:[3,2];case 1:return n.sent(),[3,3];case 2:i({title:"Oops! Something went wrong, try again in a few moments"}),n.label=3;case 3:return[2]}var r}))}))},marginTop:0,height:350,width:440,accept:"video/*,.mkv"})})),ee&&(0,t.jsxs)(AB,{children:[(0,t.jsx)(yo,{text:"Cancel",backgroundColor:Hi,textColor:Fi,onClick:Q,margin:"0 12px 0 0",padding:"8px 16px",fontSize:"15px"}),(0,t.jsx)(te,{disabled:h||v})]})]}),re=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(TB,{children:(0,t.jsx)(HB,{uploadingData:f,setUploadingData:d,progress:C})}),(0,t.jsxs)(AB,GB({style:{justifyContent:"right"}},{children:[(0,t.jsx)(yo,{text:"Cancel",backgroundColor:Hi,textColor:Fi,onClick:Q,margin:"0 12px 0 0",padding:"8px 16px",fontSize:"15px"}),(0,t.jsx)(te,{disabled:!0})]}))]}),ie=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(TB,{children:(0,t.jsx)(BB,{children:"You will have to restart your video upload from the beginning if you cancel now. Are you sure you want to cancel this upload?"})}),(0,t.jsxs)(AB,{children:[(0,t.jsx)(yo,{text:"Cancel Upload",backgroundColor:Hi,textColor:Fi,onClick:n,margin:"0 12px 0 0",padding:"8px 16px",fontSize:"15px"}),(0,t.jsx)(te,{title:"Continue Upload",onClick:function(){return w(!1)}})]})]});return[ne,(0,t.jsx)(PB,{children:b?ie:re})][l]};var YB,QB,KB,XB,JB,eN,tN,nN,rN,iN,oN,aN,sN,lN,cN,uN,fN,dN,pN,hN,yN,mN,vN,gN,xN,bN,wN,SN,CN,EN,kN,_N,ON,PN,TN,AN,jN,IN,MN,DN,RN,FN,LN,BN,NN,zN,VN=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UN=function(){return UN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UN.apply(this,arguments)},HN=tt.div(YB||(YB=VN(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 25px 30px 5px 30px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 25px 30px 5px 30px;\n"]))),GN=tt.div(QB||(QB=VN(["\n font-weight: bold;\n font-size: 18px;\n"],["\n font-weight: bold;\n font-size: 18px;\n"]))),WN=function(e){var n=e.handleModalClose,r=e.disabled,i=e.onSuccess;return(0,t.jsxs)(kL,UN({disableFullScreen:!0},{children:[(0,t.jsxs)(HN,{children:[(0,t.jsx)(GN,{children:"Upload new video"}),(0,t.jsx)(vu,{style:{position:"static",padding:0,height:"fit-content",width:"fit-content"},disabled:r,onClick:n})]}),(0,t.jsx)(ZB,{handleModalClose:n,onSuccess:i})]}))},qN=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$N=function(){return $N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$N.apply(this,arguments)},ZN=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},YN=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},QN=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},KN=tt.div(KB||(KB=qN(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),XN=tt.div(JB||(JB=qN(["\n display: flex;\n justify-content: space-between;\n gap: 16px;\n ","\n"],["\n display: flex;\n justify-content: space-between;\n gap: 16px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(XB||(XB=qN(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),JN=tt.div(tN||(tN=qN(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(eN||(eN=qN(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])))})),ez=tt.div(rN||(rN=qN(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(nN||(nN=qN(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),tz=tt.div(oN||(oN=qN(["\n width: 216px;\n ","\n"],["\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(iN||(iN=qN(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),nz=tt.div(lN||(lN=qN(["\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n ","\n ","\n"],["\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n ","\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(aN||(aN=qN(["\n grid-template-columns: 1fr 1fr;\n "],["\n grid-template-columns: 1fr 1fr;\n "])))}),(function(e){return e.theme.containerWidth<ti&&Ne(sN||(sN=qN(["\n grid-template-columns: 1fr;\n "],["\n grid-template-columns: 1fr;\n "])))})),rz={folderId:-2,name:"Primary",isDeletable:!1},iz=function(e){var n=e.handleUpdateToken,r=Nl().userData,i=Ju().toast,o=Mt(),a=o.hasExternalJwt,s=o.showMergeFeature,l=o.showWheelsTVFeature,c=o.showRecordFeature,u=o.showUploadFeature,f=o.showFolderFeature,d=o.containerWidth,p=QN((0,E.useState)(!1),2),h=p[0],y=p[1],g=QN((0,E.useState)([]),2),x=g[0],w=g[1],C=QN((0,E.useState)(!1),2),k=C[0],_=C[1],O=Xl(r),P=ec(r),T=QN((0,E.useState)(0),2),A=T[0],j=T[1],I=dn(),M=QN((0,E.useState)({page:0,size:6,folderId:rz.folderId,searchQuery:""}),2),D=M[0],R=M[1],F=(0,v.useQuery)("cds-folders",Gn,{refetchOnWindowFocus:!1,staleTime:5e8,select:function(e){var t=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],QN(e),!1);return r.automotiveRole===Dl.TECHNICIAN&&(t=e.filter((function(e){return"Vault"!==e.name&&"Private"!==e.name}))),t}}).data,L=F?(0,Eu.keyBy)(F,"folderId"):{},B=L[D.folderId]||rz,N=L[D.folderId]?L[D.folderId].name:rz.name;N=N===Hn?Un:N;var z=(0,v.useQuery)(["cds-videos",D],(function(){return ZN(void 0,void 0,void 0,(function(){return YN(this,(function(e){return[2,(t={folder:N,search:D.searchQuery,size:D.size,page:D.page},Ln(void 0,void 0,void 0,(function(){var e,n,r,i,o;return Bn(this,(function(a){switch(a.label){case 0:return e=S.bearerToken,[4,Tn({url:"/videos",baseURL:b,method:Nn,headers:e,params:{start:(t.page||0)*(t.size||10),limit:t.size,search:t.search,folder:t.folder}}).catch((function(e){return e}))];case 1:if((n=a.sent())instanceof Error)throw n;return r=(null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.videos)||(null==n?void 0:n.videos)||[],[2,{count:(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.count)||(null==n?void 0:n.count)||0,videos:r}]}}))})))];var t}))}))}),{refetchOnWindowFocus:!1,enabled:!!(null==F?void 0:F.length)}),V=z.data,U=z.isLoading,H=V||{count:0,videos:[]},G=H.count,W=H.videos,q=(null==F?void 0:F.filter(Boolean).filter((function(e){return e.folderId!==Un})).map((function(e){return{value:e.folderId,label:e.name}})).concat([{value:Un,label:Hn}]))||[],$=function(){y(!1),localStorage.removeItem(m.merge),w([])},Z=function(e){"left"===e&&R((function(e){return $N($N({},e),{page:e.page-1})})),"right"===e&&R((function(e){return $N($N({},e),{page:e.page+1})}))};(0,E.useEffect)((function(){var e,t=null===(e=r.customer)||void 0===e?void 0:e.packageId;Number(t)!==oF.FREE&&Number(t)!==oF.PRO||(i({message:"Please upgrade you account to use eLead integration."}),n(""),I.go(0))}),[]),(0,E.useEffect)((function(){var e=localStorage.getItem(m.merge);if(e)try{var t=JSON.parse(e)||[];w(t),y(!!t.length)}catch(e){localStorage.removeItem(m.merge)}}),[]),(0,E.useEffect)((function(){A&&I.push("/preview-upload/".concat(A))}),[A]);var Y=(null==B?void 0:B.name)===Fn;return(0,t.jsxs)(KN,{children:[(0,t.jsx)(io,{left:a?(0,t.jsx)(Jr,{isAutomotive:O}):(0,t.jsx)(ZF,{name:r.firstName||r.lastName||"Welcome",handleUpdateToken:n}),center:!a&&(0,t.jsx)(Jr,{isAutomotive:O}),right:(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsx)(yo,{onClick:function(){return _(!0)},text:d>ri?"Upload":"",textColor:Bi,backgroundColor:Hi,borderColor:ji,fontSize:"15px",icon:(0,t.jsx)(Nc,{size:22})}),c&&(0,t.jsx)(yo,{onClick:function(){return I.push("/record/home")},text:d>ri?"Record":"",icon:(0,t.jsx)(Rc,{size:22}),textColor:di,backgroundColor:Ri,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsxs)(XN,{children:[(0,t.jsxs)(JN,{children:[(0,t.jsx)(LF,{handleSearch:function(e){var t=e.toLowerCase();R((function(e){return $N($N({},e),{page:0,searchQuery:t})}))},prevSearch:D.searchQuery}),f&&(0,t.jsx)(tz,{children:(0,t.jsx)(bl,{options:q,value:{value:(null==B?void 0:B.folderId)||rz.folderId,label:(null==B?void 0:B.name)||rz.name},onChange:function(e){var t,n;return(n=null!==(t=null==e?void 0:e.value)&&void 0!==t?t:rz.folderId).toString()===(-1).toString()&&$(),void R((function(e){return $N($N({},e),{page:0,folderId:n})}))},isSearchable:!1})})]}),(l||s)&&(0,t.jsxs)(t.Fragment,{children:[!h&&(0,t.jsxs)(JN,{children:[l&&r.wheelsTV&&(!O||P)&&(0,t.jsx)(yo,{onClick:function(){return I.push("/wheels-tv")},icon:(0,t.jsx)(oT,{size:18,color:Si}),text:"WheelsTV",textColor:Si,backgroundColor:di,borderColor:bi,fontSize:"15px"}),s&&(0,t.jsx)(yo,{onClick:function(){return Y?{}:y(!0)},text:"Merge Videos",textColor:Si,backgroundColor:di,borderColor:bi,fontSize:"15px",disabled:Y})]}),h&&(0,t.jsxs)(JN,{children:[(0,t.jsx)(yo,{onClick:$,text:"Cancel",textColor:Si,backgroundColor:di,borderColor:bi,fontSize:"15px"}),(0,t.jsx)(xL,{width:"250px",position:"top-right",popup:(0,t.jsxs)(t.Fragment,{children:[x.length<2&&"Select 2+ videos to merge",x.length>9&&"Select maximum 9 videos"]}),cursor:"initial",showTriangle:!0,disableHover:x.length>=2&&x.length<=9,hoverable:(0,t.jsx)(yo,{onClick:function(){localStorage.setItem(m.merge,JSON.stringify(x));var e=x.map((function(e){return e.id})).filter(Boolean).join(",");I.push("/merge/?videos=".concat(e))},text:"Merge Videos",textColor:di,disabled:Y||x.length<2||x.length>9,backgroundColor:Qi,fontSize:"15px"})})]})]})]}),(0,t.jsxs)(t.Fragment,{children:[!U&&!!W.length&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nz,{children:W.map((function(e,n){return(0,t.jsx)(IF,{video:e,isMerge:h,selectedVideosData:x,setSelectedVideosData:w},n)}))}),(0,t.jsxs)(ez,{children:[(0,t.jsx)(QF,{page:D.page,size:D.size,count:G}),(0,t.jsx)(yo,{onClick:function(){return Z("left")},icon:(0,t.jsx)(Hc,{size:22}),disabled:0===D.page}),(0,t.jsx)(yo,{onClick:function(){return Z("right")},icon:(0,t.jsx)(Gc,{size:22}),disabled:W.length<D.size||(D.page+1)*D.size>=G})]})]}),U&&(0,t.jsx)(HF,{message:"Loading...",size:D.size}),!U&&!W.length&&(0,t.jsx)(HF,{message:"No videos match your query",size:D.size})]})]}),k&&(0,t.jsx)(WN,{handleModalClose:function(){return _(!1)},onSuccess:function(e){return ZN(void 0,void 0,void 0,(function(){return YN(this,(function(t){return e.length?(j(e[0]),[2]):[2]}))}))}})]})},oz=function(){return oz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oz.apply(this,arguments)},az=tt.div(cN||(cN=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),(function(e){return e.color||_i})),sz=function(e){var n=e.text,r=e.color;return(0,t.jsx)(az,oz({color:r},{children:n}))},lz=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},cz=function(){return cz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cz.apply(this,arguments)},uz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},fz=tt.div(uN||(uN=lz(["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n padding: 50px 0;\n"],["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n padding: 50px 0;\n"]))),dz=tt.div(fN||(fN=lz(["\n width: 400px;\n max-width: calc(100% - 32px);\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 16px;\n padding: 32px;\n"],["\n width: 400px;\n max-width: calc(100% - 32px);\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 16px;\n padding: 32px;\n"])),di),pz=tt.form(dN||(dN=lz(["\n margin-top: 24px;\n display: block;\n"],["\n margin-top: 24px;\n display: block;\n"]))),hz=tt.div(pN||(pN=lz(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-bottom: 24px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-bottom: 24px;\n"]))),yz=tt.div(hN||(hN=lz(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),mz=tt.a(yN||(yN=lz(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),Si),vz=tt.div(mN||(mN=lz(["\n text-align: center;\n color: ",";\n font-weight: 600;\n font-size: 18px;\n line-height: 24px;\n"],["\n text-align: center;\n color: ",";\n font-weight: 600;\n font-size: 18px;\n line-height: 24px;\n"])),Si),gz=tt.div(vN||(vN=lz(["\n text-align: center;\n color: ",";\n font-size: 12px;\n margin-top: 12px;\n"],["\n text-align: center;\n color: ",";\n font-size: 12px;\n margin-top: 12px;\n"])),Si),xz=tt.div(gN||(gN=lz(["\n border-radius: 6px;\n color: #721c24;\n background-color: #f8d7da;\n border: 1px solid #f5c6cb;\n padding: 12px 20px;\n margin-bottom: 16px;\n"],["\n border-radius: 6px;\n color: #721c24;\n background-color: #f8d7da;\n border: 1px solid #f5c6cb;\n padding: 12px 20px;\n margin-bottom: 16px;\n"]))),bz=tt.div(xN||(xN=lz(["\n position: relative;\n"],["\n position: relative;\n"]))),wz=tt.div(bN||(bN=lz(["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),Sz=function(e){var n=e.handleUpdateToken,r=Mt().hasExternalJwt,i=uz((0,E.useState)(""),2),o=i[0],a=i[1],s=uz((0,E.useState)(""),2),l=s[0],c=s[1],u=uz((0,E.useState)(""),2),f=u[0],d=u[1],p=uz((0,E.useState)(!1),2),h=p[0],y=p[1],m=dn();return r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(io,{center:(0,t.jsx)(Jr,{})}),(0,t.jsx)(fz,{children:(0,t.jsxs)(dz,{children:[(0,t.jsx)(vz,{children:"Login failed"}),(0,t.jsx)(gz,{children:"External token invalid."})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(io,{center:(0,t.jsx)(Jr,{})}),(0,t.jsx)(fz,{children:(0,t.jsxs)(dz,{children:[(0,t.jsx)(vz,{children:"Login to your Covideo account"}),(0,t.jsxs)(pz,cz({onSubmit:function(e){return t=void 0,r=void 0,a=function(){var t,r;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(i){switch(i.label){case 0:e.preventDefault(),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,Dn({username:o,password:l})];case 2:return t=i.sent(),r=t.accessToken,[4,n(r)];case 3:return i.sent(),m.go(0),[3,5];case 4:return i.sent(),d("Incorrect Login"),[3,5];case 5:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,s)}l((a=a.apply(t,r||[])).next())}));var t,r,i,a}},{children:[(0,t.jsxs)(hz,{children:[(0,t.jsx)(sz,{text:"Username"}),(0,t.jsx)(lo,{width:"100%",type:"text",value:o,placeholder:"Username",required:!0,onChange:function(e){return a(e.target.value)}})]}),(0,t.jsxs)(hz,{children:[(0,t.jsx)(sz,{text:"Password"}),(0,t.jsxs)(bz,{children:[(0,t.jsx)(lo,{width:"100%",type:h?"text":"password",value:l,placeholder:"Password",required:!0,padding:"8px 40px 8px 8px",onChange:function(e){return c(e.target.value)}}),(0,t.jsxs)(wz,cz({onClick:function(){y((function(e){return!e}))}},{children:[!h&&(0,t.jsx)(lT,{size:22}),h&&(0,t.jsx)(sT,{size:22})]}))]})]}),f&&(0,t.jsx)(xz,{children:f}),(0,t.jsxs)(yz,{children:[(0,t.jsx)(yo,{backgroundColor:"rgba(255, 139, 34, 1)",textColor:di,text:"Login",type:"submit",fontSize:"15px",disabled:""===o||""===l}),(0,t.jsx)(mz,cz({target:"_blank",href:"https://www.covideo.com/reset-password/"},{children:"Forgot password?"}))]})]}))]})})]})},Cz=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ez=function(){return Ez=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ez.apply(this,arguments)},kz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_z=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Oz=tt.div(wN||(wN=Cz(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ",";\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ",";\n"])),(function(e){return e.marginBottom?e.marginBottom:"0"})),Pz=tt.div(SN||(SN=Cz(["\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n"]))),Tz=tt.div(CN||(CN=Cz(["\n margin-bottom: ",";\n width: ",";\n"],["\n margin-bottom: ",";\n width: ",";\n"])),(function(e){return e.marginBottom?e.marginBottom:"16px"}),(function(e){return e.width?e.width:"auto"})),Az=tt.p(EN||(EN=Cz(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0 0 8px 0;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0 0 8px 0;\n"])),_i),jz=tt.label(kN||(kN=Cz(["\n margin-left: 12px;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n margin-left: 12px;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),Pi),Iz=tt.a(_N||(_N=Cz(["\n max-height: 24px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n text-align: right;\n color: ",";\n text-decoration: underline;\n &:hover {\n cursor: pointer;\n }\n"],["\n max-height: 24px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n text-align: right;\n color: ",";\n text-decoration: underline;\n &:hover {\n cursor: pointer;\n }\n"])),vi),Mz=tt.input(ON||(ON=Cz(["\n width: 100%;\n border-radius: 4px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n border: solid 1px ",";\n outline: none;\n padding: 8px 12px;\n"],["\n width: 100%;\n border-radius: 4px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n border: solid 1px ",";\n outline: none;\n padding: 8px 12px;\n"])),Ci),Dz={control:function(e){return Ez(Ez({},e),{height:"40px"})},indicatorSeparator:function(){return{display:"none"}}},Rz=function(e){var n=e.linksetsData,r=e.linksetsLoading,i=e.templatesData,o=e.templatesLoading,a=e.overlaysData,s=e.overlaysLoading,l=e.checkboxes,c=e.selectedCheckboxes,u=e.setSelectedCheckboxes,f=e.insertVideoData,d=e.setInsertVideoData,p=Mt(),h=p.showCTAFeature,y=p.showLandingPageFeature,m=p.showReactionsFeature,v=kz((0,E.useState)([]),2),g=v[0],x=v[1],b=kz((0,E.useState)([]),2),w=b[0],S=b[1],C=kz((0,E.useState)([]),2),_=C[0],O=C[1],P=kz((0,E.useState)(!1),2),T=P[0],A=P[1],j=-1===f.templateId;(0,E.useEffect)((function(){!T&&w.length&&d(Ez(Ez({},f),{overlayId:w[0].value}))}),[T]),(0,E.useEffect)((function(){x((i||[]).map((function(e){return{value:e.id,label:e.title}})))}),[i]),(0,E.useEffect)((function(){S((a||[]).map((function(e){var t=e.id,n=e.title;return{value:t.toString(),label:n}})))}),[a]);var I=ku().debounce((function(e){d(Ez(Ez({},f),j?{overlayId:e}:{linksetId:e}))}),1e3);return(0,E.useEffect)((function(){var e=[{value:"-1",label:"None"}];e=n.every((function(e){return"-1"!==e.id}))?e.concat((n||[]).map((function(e){var t=e.id,n=e.title;return{value:t.toString(),label:n}}))):(n||[]).map((function(e){var t=e.id,n=e.title;return{value:t.toString(),label:n}})),O(e)}),[n]),k().useEffect((function(){-1!==f.templateId&&A(!1),w.length<=0&&S([{value:"",label:""}])}),[j]),(0,t.jsxs)(t.Fragment,{children:[y&&(0,t.jsx)(Oz,{children:(0,t.jsxs)(Tz,Ez({width:"100%"},{children:[(0,t.jsx)(Az,{children:"Landing Page"}),(0,t.jsx)(cl,{value:g.find((function(e){return e.value===f.templateId})),styles:Dz,options:g,onChange:function(e){return null!==e&&d(Ez(Ez({},f),{templateId:parseInt(e.value)}))},isLoading:o})]}))}),(h||j)&&(0,t.jsx)(Oz,{children:(0,t.jsxs)(Tz,Ez({width:"100%",marginBottom:"35px"},{children:[(0,t.jsxs)(Oz,{children:[(0,t.jsx)(Az,{children:j?"Websites":"CTAs"}),j&&(0,t.jsx)(Iz,Ez({onClick:function(){return A((function(e){return!e}))}},{children:T?"Use Existing":"Add New"}))]}),!T&&(0,t.jsx)(cl,{"aria-label":"CTA",id:"select-cta-dropdown",className:"dropdown",value:j?w.find((function(e){return e.value==f.overlayId})):_.find((function(e){return e.value==f.linksetId})),isClearable:j,placeholder:j?"No Websites":"No CTAs",options:j?w:_,onChange:function(e){if(e)return d(Ez(Ez({},f),j?{overlayId:e.value}:{linksetId:e.value}))},isLoading:j?s:r}),T&&(0,t.jsx)(Mz,{type:"text",placeholder:"Enter website",onChange:function(e){I(e.target.value)}})]}))}),!!l.length&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(Tz,Ez({width:"100%",marginBottom:"15px"},{children:l.filter((function(e){return m||"enableReactions"!==e.value})).map((function(e,n){return(0,t.jsx)(Oz,{children:(0,t.jsxs)(Pz,{children:[(0,t.jsx)(lc,{id:"check-".concat(n),width:"24px",blueCheck:!0,checked:c.some((function(t){return t.value===e.value})),onChange:function(t){var n=t.target.checked;u(n?_z(_z([],kz(c),!1),[e],!1):c.filter((function(t){return t.value!==e.value})))}}),(0,t.jsx)(jz,Ez({htmlFor:"check-".concat(n)},{children:e.label}))]})},"check-".concat(n))}))}))})]})},Fz=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Lz=function(){return Lz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lz.apply(this,arguments)},Bz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Nz=tt.div(PN||(PN=Fz(["\n display: flex;\n align-items: center;\n padding-left: 12px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 12px;\n"]))),zz=tt.div(TN||(TN=Fz(["\n margin-left: 0px;\n width: 100%;\n"],["\n margin-left: 0px;\n width: 100%;\n"]))),Vz=tt.div(AN||(AN=Fz(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"],["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),Uz=tt.div(jN||(jN=Fz(["\n max-width: 100%;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 256px;\n margin-right: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ",";\n"],["\n max-width: 100%;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 256px;\n margin-right: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ",";\n"])),Pi),Hz=tt.div(IN||(IN=Fz(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n text-align: right;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n text-align: right;\n"])),_i),Gz=tt.div(MN||(MN=Fz(["\n padding-left: 6px;\n"],["\n padding-left: 6px;\n"]))),Wz=tt.div(DN||(DN=Fz(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 6px;\n height: 72px;\n border: 1px dashed ",";\n border-radius: 6px;\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 6px;\n height: 72px;\n border: 1px dashed ",";\n border-radius: 6px;\n &:hover {\n cursor: pointer;\n }\n"])),vi),qz=tt.div(RN||(RN=Fz(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n padding: 16px;\n gap: 8px;\n height: 108px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"],["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n padding: 16px;\n gap: 8px;\n height: 108px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"])),di),$z=tt.div(FN||(FN=Fz(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 36px;\n margin-bottom: 5px;\n padding: 0 8px;\n"],["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 36px;\n margin-bottom: 5px;\n padding: 0 8px;\n"]))),Zz=tt.div(LN||(LN=Fz(["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 50%;\n"],["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 50%;\n"]))),Yz=tt.div(BN||(BN=Fz(["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n gap: 4px;\n"],["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n gap: 4px;\n"]))),Qz=tt.div(NN||(NN=Fz(["\n padding: 16px;\n height: 72px;\n background-color: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"],["\n padding: 16px;\n height: 72px;\n background-color: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"])),di),Kz=tt.div(zN||(zN=Fz(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"])),(function(e){return e.fontWeight||"500"}),(function(e){return e.color||Si})),Xz={control:function(e,t){return Lz(Lz({},e),{height:"40px",boxShadow:"none",borderColor:t.isFocused?Si:ki,":hover":{borderColor:Si},":focus":{borderColor:Si},":active":{borderColor:Si}})},option:function(e){return Lz(Lz({},e),{backgroundColor:"transparent",color:Pi,padding:"8px",cursor:"pointer",":hover":{backgroundColor:"transparent",opacity:".8"},":focus":{backgroundColor:"transparent",opacity:".8"}})},indicatorSeparator:function(){return{display:"none"}},valueContainer:function(e){return Lz(Lz({},e),{padding:4,overflow:"show"})}},Jz=function(e){return(0,t.jsx)(t.Fragment,{})},eV=function(e,t){if("0"===e.value)return!0;var n=e.label.toLowerCase(),r=e.data.vin?e.data.vin.toLowerCase():"";return"".concat(n," ").concat(r).includes(t.toLowerCase())},tV=function(e){return(0,t.jsx)(Nz,{children:(0,t.jsx)(zz,{children:(0,t.jsx)(Ss.Option,Lz({},e))})})},nV=function(e){var n=e.label,r=e.vin;return(0,t.jsxs)(Vz,{children:[(0,t.jsx)(Uz,{children:n}),(0,t.jsxs)(Hz,{children:[" ",r]})]})},rV=function(e){e.children;var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]);return(0,t.jsx)(Gz,{children:n.data.label})},iV=function(e){return(0,t.jsx)(Ss.NoOptionsMessage,Lz({},e,{children:"No vehicles found, try entering a different name or VIN."}))},oV=function(e){var n=e.onChangeVehicle,r=e.handleChangeVehicleButtonPress,i=e.handleRemoveVehicleButtonPress,o=e.setAddingVehicle,a=e.selectedVin,s=void 0===a?"":a,l=e.placeholder,c=void 0===l?"Search vehicle by name or VIN...":l,u=e.fetchSold,f=void 0===u||u,d=e.addingVehicle,p=void 0===d||d,h=function(e){var t,n,r,i,o,a,s,l,c,u,f;return ec(e)&&(!!(null===(t=null==e?void 0:e.customer)||void 0===t?void 0:t.vAutoDealerId)||!!(null===(n=null==e?void 0:e.customer)||void 0===n?void 0:n.eDealerId)||!!(null===(r=null==e?void 0:e.customer)||void 0===r?void 0:r.homeNetId)||!!(null===(i=null==e?void 0:e.customer)||void 0===i?void 0:i.maxDigitalId)||!!(null===(o=null==e?void 0:e.customer)||void 0===o?void 0:o.dealersLinkId)||!!(null===(a=null==e?void 0:e.customer)||void 0===a?void 0:a.dealerCueId)||!!(null===(s=null==e?void 0:e.customer)||void 0===s?void 0:s.autoRevolutionId)||!!(null===(l=null==e?void 0:e.customer)||void 0===l?void 0:l.vinsolutionsIMSDealerId)||!!(null===(c=null==e?void 0:e.customer)||void 0===c?void 0:c.dealerDotComIMS)||!!(null===(u=null==e?void 0:e.customer)||void 0===u?void 0:u.dealerCenterDealerId)||!!(null===(f=null==e?void 0:e.customer)||void 0===f?void 0:f.dealrCloudId))}(Nl().userData),y=Bz((0,E.useState)(""),2),m=y[0],g=y[1],x=Bz((0,E.useState)(s),2),b=x[0],w=x[1],S=Mt().showUpgradeMessageFeature,C=function(e){var t=e.size,n=void 0===t?10:t,r=e.page,i=void 0===r?0:r,o=e.sort,a=void 0===o?"":o,s=e.searchQuery,l=void 0===s?"":s,c=e.soldFilter,u=void 0===c?"":c,f=e.videosRecordedFilter,d=void 0===f?"":f,p=e.countRecorded,h=void 0!==p&&p,y=e.enabled,m=void 0===y||y;return(0,v.useQuery)(["inventoryItems",n,i,a,l,u,d,m,h],(function(){return e=void 0,t=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){return[2,er({limit:n,start:i*n,sort:a,search:l||"",soldFilter:u,videosRecordedFilter:d,countRecorded:h})]}))},new((r=void 0)||(r=Promise))((function(n,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}));var e,t,r,o}),{refetchOnWindowFocus:!1,staleTime:h?0:36e5,enabled:m})}({searchQuery:b,countRecorded:!1,enabled:h,soldFilter:f?"2":"0"}).data,k=C?C.items:[];(0,E.useEffect)((function(){w(s)}),[s]),(0,E.useEffect)((function(){if(C&&""!==s&&k){var e=k.filter((function(e){return e.vin===s}));if(!e.length)return i(),void g("");g(e[0].title)}}),[k,s]);var _=k.map((function(e){return Lz(Lz({},e),{value:e.vin,label:e.title})}));return h?p?(0,t.jsx)(Qz,{children:(0,t.jsx)(cl,{components:{Option:tV,DropdownIndicator:Jz,SingleValue:rV,NoOptionsMessage:iV},styles:Xz,options:_,value:_.find((function(e){return e.value===s})),onChange:function(e){n(e||void 0),g((null==e?void 0:e.title)||"")},autoFocus:!0,isSearchable:!0,isClearable:!0,placeholder:c,filterOption:eV,formatOptionLabel:nV,onInputChange:function(e){e.length<2||w(e)}})}):s?(0,t.jsxs)(qz,{children:[(0,t.jsxs)($z,{children:[(0,t.jsxs)(Zz,{children:[(0,t.jsx)(oT,{size:20,color:gi}),(0,t.jsx)(Kz,{children:m})]}),(0,t.jsx)(Kz,Lz({color:gi,fontWeight:"400"},{children:s}))]}),(0,t.jsxs)(Yz,{children:[(0,t.jsx)(yo,{onClick:function(){r(),g("")},text:"Change",textColor:Si,backgroundColor:bi,borderColor:bi,fontSize:"13px"}),(0,t.jsx)(yo,{onClick:function(){i(),g("")},text:"Remove",textColor:Ri,backgroundColor:Di,borderColor:Di,fontSize:"13px"})]})]}):(0,t.jsxs)(Wz,Lz({onClick:function(){return o(!0)}},{children:[(0,t.jsx)(oT,{size:20,color:Si}),"Add Vehicle"]})):S?(0,t.jsxs)(t.Fragment,{children:["To enable the integration with your Inventory Management System, please call us at",(0,t.jsx)("br",{}),(0,t.jsx)("a",Lz({href:"tel:8003061445"},{children:"800-306-1445"}))]}):null},aV=__webpack_require__(2085),sV={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},lV=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],cV=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],uV=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],fV="undefined"!=typeof window&&void 0!==window.document?window.document:{},dV="fullscreenEnabled"in fV&&Object.keys(sV)||lV[0]in fV&&lV||cV[0]in fV&&cV||uV[0]in fV&&uV||[],pV={requestFullscreen:function(e){return e[dV[sV.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[dV[sV.requestFullscreen]]},get exitFullscreen(){return fV[dV[sV.exitFullscreen]].bind(fV)},get fullscreenPseudoClass(){return":"+dV[sV.fullscreen]},addEventListener:function(e,t,n){return fV.addEventListener(dV[sV[e]],t,n)},removeEventListener:function(e,t,n){return fV.removeEventListener(dV[sV[e]],t,n)},get fullscreenEnabled(){return Boolean(fV[dV[sV.fullscreenEnabled]])},set fullscreenEnabled(e){},get fullscreenElement(){return fV[dV[sV.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return fV[("on"+dV[sV.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return fV[("on"+dV[sV.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return fV[("on"+dV[sV.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return fV[("on"+dV[sV.fullscreenerror]).toLowerCase()]=e}};const hV=pV;var yV,mV,vV,gV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},xV=function(){return xV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xV.apply(this,arguments)},bV=tt.div(yV||(yV=gV(["\n width: 100%;\n display: flex;\n cursor: pointer;\n flex: 1;\n padding-bottom: ",";\n"],["\n width: 100%;\n display: flex;\n cursor: pointer;\n flex: 1;\n padding-bottom: ",";\n"])),(function(e){return"".concat(e.small?"0px":" 0px 12px")})),wV=tt.progress(mV||(mV=gV(["\n width: 100%;\n color: white;\n opacity: 1;\n height: ","; /* TODO: it's 4px in design */\n border-radius: ",";\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &::-webkit-progress-bar {\n border-radius: 4px;\n }\n &::-webkit-progress-value {\n background-color: white;\n border-radius: 4px;\n }\n"],["\n width: 100%;\n color: white;\n opacity: 1;\n height: ","; /* TODO: it's 4px in design */\n border-radius: ",";\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &::-webkit-progress-bar {\n border-radius: 4px;\n }\n &::-webkit-progress-value {\n background-color: white;\n border-radius: 4px;\n }\n"])),(function(e){return"".concat((e.small,"4px"))}),(function(e){return"".concat(e.small?"1px":"4px")})),SV=function(e){var n=e.duration,r=void 0===n?.1:n,i=e.currentTime,o=void 0===i?0:i,a=e.scrub,s=e.color,l=e.small,c=E.createRef();return(0,t.jsx)(bV,xV({small:l},{children:(0,t.jsx)(wV,{ref:c,onClick:function(e){return a(e,c)},value:o.toString(),min:"0",max:r.toString(),color:s,small:l})}))},CV=function(){return CV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},CV.apply(this,arguments)},EV=function(e){return(0,t.jsxs)("svg",CV({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},{children:[(0,t.jsx)("defs",{children:(0,t.jsx)("path",{id:"volumeOff-a",d:"M3.63 3.635a.996.996 0 0 0 0 1.41l3.66 3.66-.29.3H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 1 0 1.41-1.41L5.05 3.635c-.39-.39-1.02-.39-1.42 0zM19 12.005c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85 2.57 1.04 4.39 3.56 4.39 6.5zm-8.71-6.29l-.17.17L12 7.765v-1.35c0-.89-1.08-1.33-1.71-.7zm6.21 6.29a4.5 4.5 0 0 0-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"})}),(0,t.jsxs)("g",CV({fill:"none",fillRule:"evenodd"},{children:[(0,t.jsx)("mask",CV({id:"volumeOff-b",fill:"#fff"},{children:(0,t.jsx)("use",{xlinkHref:"#volumeOff-a"})})),(0,t.jsx)("g",CV({fill:"#fff",fillOpacity:"1",mask:"url(#volumeOff-b)"},{children:(0,t.jsx)("path",{d:"M0 0h24v24H0z"})}))]}))]}))};function kV(){return kV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kV.apply(this,arguments)}const _V=tt((function(e){return E.createElement("svg",kV({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),vV||(vV=E.createElement("g",{fill:"#FFF"},E.createElement("path",{d:"M7.928 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69l-8.14-5.17c-.67-.43-1.54.05-1.54.84z"}))))}))(OV||(OV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n opacity: ",";\n }\n"])),(function(e){return e.width||"40px"}),(function(e){return e.height||"40px"}),(function(e){return e.opacity||"inherit"}));var OV,PV;function TV(){return TV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TV.apply(this,arguments)}const AV=tt((function(e){return E.createElement("svg",TV({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),PV||(PV=E.createElement("g",{fill:"#272A32"},E.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))))}))(jV||(jV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var jV,IV,MV;function DV(){return DV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DV.apply(this,arguments)}const RV=tt((function(e){return E.createElement("svg",DV({width:20,height:17,viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),IV||(IV=E.createElement("path",{d:"M17.2907 7.4906C17.3029 7.31501 17.3614 7.14578 17.46 7C17.5559 6.84858 17.6907 6.72571 17.8504 6.64426C18.0101 6.56281 18.1887 6.52577 18.3676 6.53701C18.5464 6.54826 18.719 6.60738 18.8672 6.70818C19.0154 6.80898 19.1338 6.94776 19.21 7.11C19.8115 8.53356 20.0749 10.0772 19.9794 11.6196C19.884 13.1621 19.4324 14.6614 18.66 16C18.4838 16.3052 18.2301 16.5584 17.9245 16.734C17.619 16.9097 17.2724 17.0014 16.92 17H3.07C2.72098 16.9979 2.37858 16.9045 2.07683 16.7291C1.77509 16.5536 1.52451 16.3023 1.35 16C0.294996 14.182 -0.160348 12.0779 0.0486524 9.98638C0.257653 7.89489 1.12037 5.92243 2.51426 4.34919C3.90815 2.77594 5.76232 1.68191 7.81341 1.2225C9.8645 0.763091 12.0082 0.961661 13.94 1.79C14.1082 1.85914 14.2544 1.97285 14.3628 2.11888C14.4712 2.26492 14.5377 2.43776 14.5552 2.61879C14.5727 2.79982 14.5405 2.98219 14.462 3.14628C14.3836 3.31036 14.2619 3.44995 14.11 3.55C13.9642 3.64865 13.795 3.70707 13.6194 3.71936C13.4438 3.73165 13.2681 3.69738 13.11 3.62C12.4369 3.33395 11.7264 3.14538 11 3.06C9.56439 2.8728 8.10489 3.07868 6.77709 3.6557C5.44928 4.23271 4.30294 5.15924 3.46028 6.3365C2.61762 7.51376 2.11023 8.89763 1.99219 10.3406C1.87414 11.7835 2.14988 13.2314 2.79 14.53C2.87447 14.6931 3.0022 14.8297 3.1592 14.9249C3.31619 15.0202 3.49638 15.0704 3.68 15.07H16.33C16.5126 15.0713 16.6921 15.0227 16.849 14.9292C17.0059 14.8358 17.1342 14.7012 17.22 14.54C17.9267 13.0705 18.1674 11.4201 17.91 9.81C17.8129 9.18733 17.6382 8.57927 17.39 8C17.3126 7.84191 17.2784 7.66618 17.2907 7.4906Z",fill:"#001B53"})),MV||(MV=E.createElement("path",{d:"M8.00391 11.005C8.00391 10.4743 8.21474 9.96527 8.59002 9.58999L17.08 3.92999L11.42 12.42C11.0447 12.7953 10.5357 13.0061 10.005 13.0061C9.74223 13.0061 9.48201 12.9543 9.23923 12.8538C8.99644 12.7532 8.77584 12.6058 8.59002 12.42C8.4042 12.2342 8.2568 12.0136 8.15623 11.7708C8.05567 11.528 8.00391 11.2678 8.00391 11.005Z",fill:"#001B53"})))}))(FV||(FV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"16px"}),(function(e){return e.height||"16px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var FV,LV;function BV(){return BV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BV.apply(this,arguments)}const NV=tt((function(e){return E.createElement("svg",BV({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16"},e),LV||(LV=E.createElement("g",{fill:"#FFF"},E.createElement("path",{id:"1i74dgfm6a",d:"M5.867 10.603L3.533 8.27c-.123-.125-.291-.195-.466-.195-.176 0-.344.07-.467.195-.26.26-.26.673 0 .933l2.793 2.794c.26.26.68.26.94 0l7.067-7.06c.26-.26.26-.674 0-.934-.123-.124-.291-.195-.467-.195-.175 0-.343.07-.466.195l-6.6 6.6z"}))))}))(zV||(zV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"21px"}),(function(e){return e.height||"21px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var zV,VV,UV,HV;function GV(){return GV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GV.apply(this,arguments)}const WV=tt((function(e){return E.createElement("svg",GV({width:17,height:16,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),VV||(VV=E.createElement("path",{d:"M8.74879 15.5C9.98351 14.5267 10.9932 13.3025 11.7099 11.9101C12.6346 10.2752 12.8809 8.34818 12.3967 6.53663C11.7134 4.27231 9.38853 2.90737 7.05456 3.40021C6.94008 3.40021 6.81798 3.40021 6.66534 3.44556C6.90886 2.37277 7.46631 1.39487 8.268 0.634113C8.41309 0.529008 8.59337 0.483023 8.77169 0.505633C12.8205 0.691686 16.0048 3.99977 15.9987 8.01366C15.9925 12.0275 12.7982 15.3261 8.74879 15.5Z",fill:"white",fillOpacity:.6})),UV||(UV=E.createElement("path",{d:"M8.88889 12.6667C8.65533 13.6898 8.14446 14.629 7.41224 15.3814C7.29627 15.4733 7.14802 15.5145 7.00121 15.4955C3.12899 15.2168 0.100864 12.0474 0.00246105 8.17019C-0.0959416 4.29297 2.76752 0.974331 6.62063 0.5C6.44556 0.652084 6.32378 0.758542 6.2096 0.872605C3.96458 2.91166 2.91204 5.9516 3.41614 8.94065C3.59752 10.118 4.24244 11.1741 5.20739 11.8739C6.17234 12.5737 7.37725 12.8591 8.55398 12.6667C8.66548 12.659 8.77739 12.659 8.88889 12.6667Z",fill:"white",fillOpacity:.6})),HV||(HV=E.createElement("path",{d:"M6.23576 8.24597C6.23576 7.57717 6.23576 6.91572 6.23576 6.25427C6.23576 5.59282 6.49402 5.51932 6.98959 5.79125C8.10637 6.44535 9.22315 7.10681 10.326 7.77561C10.7797 8.04754 10.7797 8.36357 10.326 8.6355C9.19523 9.32635 8.06449 10.0025 6.91979 10.6713C6.50798 10.9138 6.2218 10.7668 6.2218 10.2744C6.2218 9.59828 6.2218 8.92212 6.2218 8.24597",fill:"white"})))}))(qV||(qV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"21px"}),(function(e){return e.height||"21px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var qV,$V,ZV,YV,QV,KV,XV,JV,eU,tU,nU,rU,iU,oU,aU,sU,lU,cU,uU,fU=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},dU=function(){return dU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dU.apply(this,arguments)},pU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},hU=tt.div($V||($V=fU(["\n display: flex;\n align-items: center;\n color: white;\n font-size: 14px;\n flex-direction: column;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n color: white;\n font-size: 14px;\n flex-direction: column;\n justify-content: space-between;\n"]))),yU=tt.div(ZV||(ZV=fU(["\n margin-top: 6px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: white;\n font-size: 14px;\n"],["\n margin-top: 6px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: white;\n font-size: 14px;\n"]))),mU=tt.div(YV||(YV=fU(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: max-content;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: max-content;\n"]))),vU=tt.div(QV||(QV=fU(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),gU=tt.div(KV||(KV=fU(["\n width: ",";\n height: ",";\n cursor: pointer;\n margin-right: ",";\n transition: all 0.3s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"],["\n width: ",";\n height: ",";\n cursor: pointer;\n margin-right: ",";\n transition: all 0.3s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"])),(function(e){return"".concat(e.small?"16px":"20px")}),(function(e){return"".concat(e.small?"16px":"20px")}),(function(e){return"".concat(e.small?"6px":"8px")})),xU=tt.input(XV||(XV=fU(["\n /* RESET */\n width: 74px;\n opacity: 1;\n visibility: visible;\n transition: all 0.4s;\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n background: transparent; /* Otherwise white in Chrome */\n\n &:focus {\n outline: none; /* Removes the blue border. We should probably do some kind of focus styling for accessibility reasons though. */\n }\n &::-ms-track {\n width: 96px;\n cursor: pointer;\n /* Hides the slider so custom styles can be added */\n background: transparent;\n border-color: transparent;\n color: transparent;\n height: ",";\n }\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: pointer;\n opacity: 0.75;\n background: ",";\n border-radius: ",";\n border: 0.2px solid transparent;\n }\n\n &::-webkit-slider-thumb {\n border: 1px solid transparent;\n height: ",";\n width: ",";\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n -webkit-appearance: none;\n margin-top: -3px;\n }\n"],["\n /* RESET */\n width: 74px;\n opacity: 1;\n visibility: visible;\n transition: all 0.4s;\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n background: transparent; /* Otherwise white in Chrome */\n\n &:focus {\n outline: none; /* Removes the blue border. We should probably do some kind of focus styling for accessibility reasons though. */\n }\n &::-ms-track {\n width: 96px;\n cursor: pointer;\n /* Hides the slider so custom styles can be added */\n background: transparent;\n border-color: transparent;\n color: transparent;\n height: ",";\n }\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: pointer;\n opacity: 0.75;\n background: ",";\n border-radius: ",";\n border: 0.2px solid transparent;\n }\n\n &::-webkit-slider-thumb {\n border: 1px solid transparent;\n height: ",";\n width: ",";\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n -webkit-appearance: none;\n margin-top: -3px;\n }\n"])),(function(e){return"".concat((e.small,"2px"))}),(function(e){return"".concat((e.small,"2px"))}),(function(e){return e.color}),(function(e){return"".concat((e.small,"2px"))}),(function(e){return"".concat((e.small,"6px"))}),(function(e){return"".concat((e.small,"6px"))}),(function(e){return e.color})),bU=tt.div(JV||(JV=fU(["\n display: flex;\n width: 100px;\n align-items: center;\n overflow: hidden;\n transition: all 0.4s;\n margin-right: 8px;\n"],["\n display: flex;\n width: 100px;\n align-items: center;\n overflow: hidden;\n transition: all 0.4s;\n margin-right: 8px;\n"]))),wU=tt.div(eU||(eU=fU(["\n height: ",";\n width: ",";\n cursor: pointer;\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"],["\n height: ",";\n width: ",";\n cursor: pointer;\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"])),(function(e){return"".concat(e.small?"15px":"20px")}),(function(e){return"".concat(e.small?"15px":"20px")})),SU=tt.div(tU||(tU=fU(["\n margin-right: 16px;\n color: ",";\n\n ","\n"],["\n margin-right: 16px;\n color: ",";\n\n ","\n"])),(function(e){return e.color}),(function(e){if(e.width&&e.width<330)return"font-size: 11px;"})),CU=tt.div(nU||(nU=fU(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 3px;\n border-radius: 5px;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n ","\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 3px;\n border-radius: 5px;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n ","\n"])),(function(e){if(e.active&&"#000000"===e.color)return"\n background-color: white;\n &:hover {\n background: white;\n }\n path {\n fill: ".concat(e.color,";\n }")})),EU=tt.div(rU||(rU=fU(["\n z-index: 200;\n overflow-y: auto;\n margin-top: -340px;\n margin-left: -140px;\n min-width: 110px;\n max-width: 160px;\n max-height: 292px;\n cursor: pointer;\n position: absolute;\n background-color: white;\n border: 1px solid #f7f8fa;\n box-sizing: border-box;\n box-shadow: 0px 6px 16px rgba(29, 30, 36, 0.06);\n border-radius: 5px;\n color: ",";\n display: flex;\n flex-direction: column;\n ","\n\n p {\n padding: 8px 24px;\n height: 24px;\n color: #9297a2;\n font-size: 14px;\n line-height: 20px;\n margin: 0;\n ","\n }\n\n div {\n display: flex;\n justify-content: space-between;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n padding: 8px 24px;\n height: 24px;\n ","\n path {\n fill: #272a32;\n }\n\n &:hover {\n background-color: ",";\n }\n }\n"],["\n z-index: 200;\n overflow-y: auto;\n margin-top: -340px;\n margin-left: -140px;\n min-width: 110px;\n max-width: 160px;\n max-height: 292px;\n cursor: pointer;\n position: absolute;\n background-color: white;\n border: 1px solid #f7f8fa;\n box-sizing: border-box;\n box-shadow: 0px 6px 16px rgba(29, 30, 36, 0.06);\n border-radius: 5px;\n color: ",";\n display: flex;\n flex-direction: column;\n ","\n\n p {\n padding: 8px 24px;\n height: 24px;\n color: #9297a2;\n font-size: 14px;\n line-height: 20px;\n margin: 0;\n ","\n }\n\n div {\n display: flex;\n justify-content: space-between;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n padding: 8px 24px;\n height: 24px;\n ","\n path {\n fill: #272a32;\n }\n\n &:hover {\n background-color: ",";\n }\n }\n"])),Fi,(function(e){return e.width&&e.width<330?"max-width: 120px;\n max-height: 142px;\n margin-top: -198px;\n margin-left: -105px;":e.width&&e.width<500?"max-width: 150px;\n max-height: 192px;\n margin-top: -250px;\n margin-left: -135px;":void 0}),(function(e){return e.width&&e.width<330?"font-size: 9px;\n line-height: 12px;\n padding: 8px 16px;":e.width&&e.width<500?"font-size: 11px;\n line-height: 15px;":void 0}),(function(e){return e.width&&e.width<330?"font-size: 10px;\n line-height: 13px;\n height: 13px;":e.width&&e.width<500?"font-size: 12px;\n line-height: 16px;\n height: 18px;":void 0}),Li),kU=[{value:2,label:"2.0x"},{value:1.5,label:"1.5x"},{value:1.25,label:"1.25x"},{value:1,label:"1.0x"},{value:.75,label:"0.75x"},{value:.5,label:"0.5x"}],_U=function(e){var n=e.isVideoPaused,r=e.isVideoMuted,i=e.togglePlay,o=e.handleMute,a=e.handleFullScreen,s=e.duration,l=void 0===s?0:s,c=e.currentTime,u=void 0===c?0:c,f=e.handleVolumeControl,d=e.volumeRange,p=e.playerIconsColor,h=e.playerBackgroundColor,y=e.setPlayBack,m=e.isVisible,v=e.small,g=e.videoRef,x=e.scrub,b=pU(E.useState(!1),2),w=b[0],S=b[1],C=pU(E.useState(1),2),k=C[0],_=C[1],O=function(e){var t=Math.floor(e/60),n=t.toString(),r="".concat(Math.floor(e-60*t));return 1===n.length&&(n="0".concat(t)),1===r.length&&(r="0".concat(r)),"".concat(t,":").concat(r)},P=O(u),T=E.createRef(),A=100*d;return E.useEffect((function(){m||S(!1)}),[m]),(0,t.jsxs)(hU,dU({small:v},{children:[(0,t.jsx)(SV,{duration:l,currentTime:u,scrub:x,color:p,small:v}),(0,t.jsxs)(yU,{children:[(0,t.jsxs)(mU,{children:[(0,t.jsx)(gU,dU({small:v,onClick:i},{children:n?(0,t.jsx)(_V,{color:p,width:20,height:20}):(0,t.jsx)(AV,{color:p,width:20,height:20})})),!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(bU,{children:[(0,t.jsx)(wU,dU({small:v,onClick:o},{children:r?(0,t.jsx)(EV,{color:p}):(0,t.jsx)(eT,{style:{color:p,fontSize:20}})})),(0,t.jsx)(xU,{ref:T,"aria-label":"Volume Range",type:"range",min:"0",value:A.toString(),onChange:function(e){return f(e,T)},max:"100",step:"1",color:p,small:v})]}),(0,t.jsxs)(SU,dU({width:g.current&&g.current.clientWidth,color:p},{children:[P," / ",O(l)]}))]})]}),!v&&(0,t.jsxs)(vU,{children:[(0,t.jsx)(CU,dU({active:w,color:h,onClick:function(){S(!w)}},{children:(0,t.jsx)(RV,{color:p})})),w&&(0,t.jsxs)(EU,dU({width:g.current&&g.current.clientWidth},{children:[(0,t.jsx)("p",{children:"Playback Speed"}),kU.map((function(e){return(0,t.jsxs)("div",dU({onClick:function(){return t=e.value,y&&y(t),void _(t);var t}},{children:[(0,t.jsx)("span",{children:e.label})," ",k==e.value&&(0,t.jsx)(NV,{width:g.current&&g.current.clientWidth<500?"16px":"20px",height:g.current&&g.current.clientWidth<500?"16px":"20px"})]}),e.value)}))]})),(0,t.jsx)(CU,dU({onClick:a},{children:(0,t.jsx)(qc,{style:{color:p,fontSize:20}})})),(0,t.jsx)(WV,{style:{marginLeft:4},height:17,fill:di})]})]})]}))},OU=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},PU=function(){return PU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},PU.apply(this,arguments)},TU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},AU=tt.div(oU||(oU=OU(["\n box-sizing: border-box;\n overflow: overlay;\n display: flex;\n justify-content: center;\n padding-right: 0px;\n height: ",";\n width: ",";\n margin: ",";\n ","\n"],["\n box-sizing: border-box;\n overflow: overlay;\n display: flex;\n justify-content: center;\n padding-right: 0px;\n height: ",";\n width: ",";\n margin: ",";\n ","\n"])),(function(e){return e.height?e.height:"100%"}),(function(e){return e.width?e.width:""}),(function(e){return e.margin?e.margin:""}),(function(e){return e.disablePointerEvents&&Ne(iU||(iU=OU(["\n pointer-events: none;\n "],["\n pointer-events: none;\n "])))})),jU=tt.figure(aU||(aU=OU(["\n border-radius: 4px;\n ","\n margin: 0;\n position: relative;\n height: 100%;\n /* TODO - check if this is ok */\n max-width: 800px;\n overflow: hidden;\n\n ","\n"],["\n border-radius: 4px;\n ","\n margin: 0;\n position: relative;\n height: 100%;\n /* TODO - check if this is ok */\n max-width: 800px;\n overflow: hidden;\n\n ","\n"])),(function(e){return e.borderBottomRadius?"\n border-bottom-left-radius: ".concat(e.borderBottomRadius,";\n border-bottom-right-radius: ").concat(e.borderBottomRadius,";\n "):""}),(function(e){return e.preventWideSize?"width: auto;":"\n ".concat(fi.lg," {\n width: 720px;\n }\n ")})),IU=tt((function(e){var t=e.handle,n=e.onChange,r=e.children,i=e.className,o=[];return i&&o.push(i),o.push("fullscreen"),t.active&&o.push("fullscreen-enabled"),(0,E.useEffect)((function(){n&&n(t.active,t)}),[t.active]),k().createElement("div",{className:o.join(" "),ref:t.node,style:t.active?{height:"100%",width:"100%"}:void 0},r)}))(sU||(sU=OU(["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n background-color: ",";\n"],["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n background-color: ",";\n"])),(function(e){return e.backgroundColor?e.backgroundColor:""})),MU=tt.video(lU||(lU=OU(["\n border-radius: ",";\n position: relative;\n width: 100%;\n height: ",";\n object-fit: contain; /*object-fit: contain to fix the issue of vertical video SUS-687*/\n max-height: ",";\n"],["\n border-radius: ",";\n position: relative;\n width: 100%;\n height: ",";\n object-fit: contain; /*object-fit: contain to fix the issue of vertical video SUS-687*/\n max-height: ",";\n"])),(function(e){return e.borderBottomRadius||"4px"}),(function(e){return e.isFullScreen?"100%":e.height}),(function(e){return e.isFullScreen?"100%":"unset"})),DU=tt.div(cU||(cU=OU(["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n z-index: 4;\n"],["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n z-index: 4;\n"])),"rgba(255,255,255, .85)"),RU=tt.div(uU||(uU=OU(["\n transition: all 0.15s;\n position: absolute;\n opacity: ",";\n left: 0;\n right: 0;\n bottom: ",";\n background-color: ",";\n padding: ",";\n"],["\n transition: all 0.15s;\n position: absolute;\n opacity: ",";\n left: 0;\n right: 0;\n bottom: ",";\n background-color: ",";\n padding: ",";\n"])),(function(e){return e.isVisible?1:0}),(function(e){return e.isFullScreen?"0px":"7px"}),(function(e){return e.hex}),(function(e){return"".concat(e.small?"0px 2px 1px":"8px")})),FU=function(e){var n=e.videoSource,r=e.thumbnail,i=e.small,o=e.videoRef,a=e.autoplay,s=e.playlist,l=e.preventWideSize,c=e.hideContext,u=void 0!==c&&c,f=e.startWithControls,d=void 0===f||f,p=e.height,h=e.width,y=e.margin,m=e.disableControls,v=void 0!==m&&m,g=e.borderBottomRadius,x=e.FullscreenVideoWrapperBackgroundColor,b=e.setIsVideoLoading,w=e.setVideoDuration,S="rgba(28, 106, 207, 0.8)",C=di,k=TU(E.useState(!0),2),_=k[0],O=k[1],P=TU(E.useState(!1),2),T=P[0],A=P[1],j=TU(E.useState(1),2),I=j[0],M=j[1],D=TU(E.useState(0),2),R=D[0],F=D[1],L=TU(E.useState(0),2),B=L[0],N=L[1],z=TU(E.useState(d),2),V=z[0],U=z[1],H=TU(E.useState(!1),2),G=H[0],W=H[1],q=TU(E.useState(0),2),$=q[0],Z=q[1],Y=Nl().userData,Q=Xl(Y),K=E.useRef(V),X=E.useRef(0),J=TU(E.useState(0),2),ee=J[0],te=J[1],ne=E.createRef(),re=function(){var e=o.current;e&&(_?e.play():e.pause())},ie=function(){var e=(0,E.useState)(!1),t=e[0],n=e[1],r=(0,E.useRef)(null);(0,E.useEffect)((function(){var e=function(){n(hV.fullscreenElement===r.current)};return hV.addEventListener("fullscreenchange",e),function(){return hV.removeEventListener("fullscreenchange",e)}}),[]);var i=(0,E.useCallback)((function(){return hV.fullscreenElement?hV.exitFullscreen().then((function(){return hV.requestFullscreen(r.current)})):r.current?hV.requestFullscreen(r.current):void 0}),[]),o=(0,E.useCallback)((function(){return hV.fullscreenElement===r.current?hV.exitFullscreen():Promise.resolve()}),[]);return(0,E.useMemo)((function(){return{active:t,enter:i,exit:o,node:r}}),[t,i,o])}();E.useEffect((function(){setTimeout((function(){return window.dispatchEvent(new Event("resize"))}),200)}),[ie.active]),E.useEffect((function(){var e=o.current;if(e.textTracks.length&&e.textTracks[0]){for(var t=V?-4:-1,n=e.textTracks[0].cues,r=0;r<n.length;r++)n[r].line=t;e.textTracks[0].activeCues[0]&&(e.textTracks[0].activeCues[0].line=t)}}),[V]);var oe=function(){o.current&&isFinite(o.current.duration)&&(F(o.current.duration),w&&w(o.current.duration))},ae=function(){o.current&&o.current.networkState==HTMLMediaElement.NETWORK_NO_SOURCE&&!G&&(console.log("error loading mp4"),W(!0))},se=function(){W(!1),clearTimeout($),o.current&&o.current.duration===1/0&&(o.current.currentTime=1e101,o.current.ontimeupdate=function(){this.ontimeupdate=function(){},o.current&&(o.current.currentTime=0)})};E.useEffect((function(){b&&b(G),G&&te(ee+1)}),[G]),E.useEffect((function(){var e;if(ee>0&&G){clearTimeout($);var t=setTimeout(te,1e3*ee,ee+1);Z(t),null===(e=o.current)||void 0===e||e.load()}}),[ee]),E.useEffect((function(){return o.current&&(o.current.addEventListener("durationchange",oe,!0),o.current.addEventListener("loadedmetadata",se,!0),o.current.addEventListener("error",ae,!0),o.current.addEventListener("pause",(function(){return O(!0)}),!0),o.current.addEventListener("play",(function(){return O(!1)}),!0),ne&&ne.current&&(o.current.addEventListener("mouseenter",ce),o.current.addEventListener("mouseleave",le),ne.current.addEventListener("mouseenter",ce),ne.current.addEventListener("mouseleave",le))),function(){o.current&&(o.current.removeEventListener("durationchange",oe,!0),o.current.removeEventListener("loadedmetadata",se,!0),o.current.removeEventListener("error",ae,!0))}}),[o]);var le=function(){o.current&&(o.current.paused||(U(!1),K.current=!1))},ce=function(){v||(U(!0),K.current=!0)};E.useEffect((function(){s&&s.length>0&&(X.current=0,N(0),O(!0))}),[s]),E.useEffect((function(){var e=function(){if(o.current&&(N(o.current.currentTime),X&&s&&s[X.current]&&o.current.currentTime>=s[X.current].endTime)){var e=new Event("ended");o.current.dispatchEvent(e)}},t=function(){if(o.current&&s&&(X.current++,X.current<s.length&&s[X.current].videoSource)){o.current.poster=s[X.current].autogeneratedThumbnail;var e="",t=s[X.current].startTime,n=s[X.current].endTime;(t||n)&&(e="#t=".concat(t||0).concat(n?","+n:""));var r=(""+s[X.current].videoSource).split("#t=")[0]+e;o.current.src=r,o.current.play()}};return o.current&&o.current.addEventListener("timeupdate",e,!0),o.current&&o.current.addEventListener("ended",t,!0),o.current&&a&&(o.current.play(),O(!1)),function(){o.current&&(o.current.removeEventListener("timeupdate",e,!0),o.current.removeEventListener("ended",t,!0))}}),[o]);var ue=aV.hex.rgb(S)||[];return(0,t.jsx)(AU,PU({small:i,height:p,width:h,margin:y,disablePointerEvents:v},{children:(0,t.jsx)(jU,PU({small:i,preventWideSize:l,borderBottomRadius:g},{children:(0,t.jsxs)(IU,PU({handle:ie,backgroundColor:x},{children:[(0,t.jsx)(MU,PU({onContextMenu:function(e){u&&e.preventDefault()},poster:G?"":r,preload:"metadata",ref:o,onClick:re,isFullScreen:ie.active,height:p||"auto",borderBottomRadius:g},{children:(0,t.jsx)("source",{src:n,type:"video/mp4"},ee+X.current+n)}),n),G&&(0,t.jsx)(DU,{children:(0,t.jsx)(Eo,{height:"100%",isLoading:G,text:"processing..."})}),!v&&(0,t.jsx)(RU,PU({ref:ne,r:ue[0],g:ue[1],b:ue[2],hex:S,small:i,isVisible:V,isFullScreen:ie.active},{children:(0,t.jsx)(_U,{isVideoPaused:_,togglePlay:re,isVideoMuted:T,handleMute:function(){var e=o.current;e&&(T?(M(1),A(!1),e.volume=1):(M(0),A(!0),e.volume=0))},handleFullScreen:function(){return ie.active?ie.exit():ie.enter()},setPlayBack:function(e){o.current.playbackRate=e},setTranslate:function(){},duration:R,currentTime:B,handleVolumeControl:function(e,t){var n=t.current&&t.current.offsetWidth,r=e.target.value;if(r>100&&(r=100),r<0&&(r=0),o.current&&n){var i=Number((r/n).toFixed(2));if(Math.floor(100*o.current.volume)==e.target.valueAsNumber)return;M(i),i<0&&(i=0,M(0)),i>1&&(M(1),i=1),0===i&&A(!0),1!==i&&A(!1),o.current.volume=i}},volumeRange:I,playerIconsColor:C,small:i,scrub:function(e,t){var n=t.current?t.current.offsetWidth:640;if(o.current){var r=e.nativeEvent.offsetX/n*o.current.duration;o.current.currentTime=r}},playerBackgroundColor:S,captionsEnabled:!1,captions:"",isVisible:V,videoRef:o,isAutomotive:Q})}))]}))}))}))},LU=__webpack_require__(2473),BU=__webpack_require__.n(LU),NU=Math.sqrt(50),zU=Math.sqrt(10),VU=Math.sqrt(2);function UU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function HU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UU(Object(n),!0).forEach((function(t){$U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function GU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qU(e,t,n){return t&&WU(e.prototype,t),n&&WU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QU(e,t)}function YU(e){return YU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YU(e)}function QU(e,t){return QU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QU(e,t)}function KU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XU(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=YU(e);if(t){var i=YU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return KU(e)}(this,n)}}function JU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||tH(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eH(e){return function(e){if(Array.isArray(e))return nH(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tH(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tH(e,t){if(e){if("string"==typeof e)return nH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nH(e,t):void 0}}function nH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rH="react-compound-slider:";function iH(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t,n){return t.val>n.val?e?-1:1:n.val>t.val?e?1:-1:0}}function oH(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.findIndex((function(e){return e.key===t}));if(-1!==i){var o=e[i],a=o.key;return o.val===n?e:[].concat(eH(e.slice(0,i)),[{key:a,val:n}],eH(e.slice(i+1))).sort(iH(r))}return e}function aH(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function sH(e){var t=e.type,n=void 0===t?"":t,r=e.touches;return!r||r.length>1||"touchend"===n.toLowerCase()&&r.length>0}function lH(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function cH(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=0,i=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var i=t.getValue(e);return e!==i&&(r+=1,BU()(!n,"".concat(rH," Invalid value encountered. Changing ").concat(e," to ").concat(i,"."))),i})).map((function(e,t){return{key:"$$-".concat(t),val:e}})).sort(iH(e));return{handles:i,changes:r}}function uH(e,t,n,r,i){for(var o=-1,a=!0,s=0;s<e.length;s++){var l=e[s],c=t[s];if(!c||c.key!==l.key)return e;c.val!==l.val&&(o=s,a=c.val-l.val>0)}if(-1===o)return e;for(var u=a?n:-n,f=0;f<t.length;f++){var d=t[f],p=t[f+1];if(p&&d.val===p.val){if(f===o){var h=p.val+u;if(i(h)===h){var y=uH(t,oH(t,p.key,p.val+u,r),n,r,i);return y===t?e:y}return e}var m=d.val+u;if(i(m)===m){var v=uH(t,oH(t,d.key,d.val+u,r),n,r,i);return v===t?e:v}return e}}return t}function fH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.forEach((function(t){return t&&t(e)}))}}var dH=function(){return{value:0,percent:0}},pH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).getRailProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.props,r=n.emitMouse,i=n.emitTouch;return HU(HU({},t),{},{onMouseDown:fH(t&&t.onMouseDown,r),onTouchStart:fH(t&&t.onTouchStart,i)})},e}return qU(n,[{key:"render",value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,r=t.activeHandleID,i=void 0===r?"":r,o=(0,t.children)({getEventData:n||dH,activeHandleID:i,getRailProps:e});return o&&k().Children.only(o)}}]),n}(E.Component),hH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).autofocus=function(e){e.target instanceof HTMLElement&&e.target.focus()},e.getHandleProps=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.props,i=r.emitKeyboard,o=r.emitMouse,a=r.emitTouch;return HU(HU({},n),{},{onKeyDown:fH(n&&n.onKeyDown,(function(e){return i&&i(e,t)})),onMouseDown:fH(n&&n.onMouseDown,e.autofocus,(function(e){return o&&o(e,t)})),onTouchStart:fH(n&&n.onTouchStart,(function(e){return a&&a(e,t)}))})},e}return qU(n,[{key:"render",value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,r=void 0===n?"":n,i=t.children,o=t.handles,a=i({handles:void 0===o?[]:o,activeHandleID:r,getHandleProps:e});return a&&k().Children.only(a)}}]),n}(E.Component),yH=function(){function e(){GU(this,e),this.interpolator=void 0,this.domain=[0,1],this.range=[0,1],this.domain=[0,1],this.range=[0,1],this.interpolator=null}return qU(e,[{key:"createInterpolator",value:function(e,t){var n=this,r=e[0],i=e[1],o=t[0],a=t[1];return i<r?function(e){return n.interpolateValue(a,o)(n.deinterpolateValue(i,r)(e))}:function(e){return n.interpolateValue(o,a)(n.deinterpolateValue(r,i)(e))}}},{key:"interpolateValue",value:function(e,t){return t-=e=+e,function(n){return e+t*n}}},{key:"deinterpolateValue",value:function(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(){return t}}},{key:"rescale",value:function(){return this.interpolator=null,this}},{key:"getValue",value:function(e){var t=this.domain,n=this.range;return(this.interpolator||(this.interpolator=this.createInterpolator(t,n)))(+e)}},{key:"setDomain",value:function(e){return this.domain=[e[0],e[1]],this.rescale(),this}},{key:"getDomain",value:function(){return this.domain}},{key:"setRange",value:function(e){return this.range=[e[0],e[1]],this}},{key:"getRange",value:function(){return this.range}},{key:"getTicks",value:function(e){var t=this.domain;return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=function(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=NU?10:o>=zU?5:o>=VU?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=NU?10:o>=zU?5:o>=VU?2:1)}(e,t,n))||!isFinite(a))return[];if(a>0){let n=Math.round(e/a),r=Math.round(t/a);for(n*a<e&&++n,r*a>t&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)*a}else{a=-a;let n=Math.round(e*a),r=Math.round(t*a);for(n/a<e&&++n,r/a>t&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)/a}return r&&o.reverse(),o}(t[0],t[t.length-1],e||10)}}]),e}(),mH=function(){return{value:0,percent:0}},vH=function(e){ZU(n,e);var t=XU(n);function n(){return GU(this,n),t.apply(this,arguments)}return qU(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.values,r=e.scale,i=void 0===r?new yH:r,o=e.count,a=void 0===o?10:o,s=e.getEventData,l=void 0===s?mH:s,c=e.activeHandleID,u=t({getEventData:l,activeHandleID:void 0===c?"":c,ticks:(n||i.getTicks(a)).map((function(e){return{id:"$$-".concat(e),value:e,percent:i.getValue(e)}}))});return u&&k().Children.only(u)}}]),n}(E.Component),gH=function(){return{value:0,percent:0}},xH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).getTrackProps=function(t){var n=e.props,r=n.emitMouse,i=n.emitTouch;return HU(HU({},t||{}),{},{onMouseDown:fH(t&&t.onMouseDown,r),onTouchStart:fH(t&&t.onTouchStart,i)})},e}return qU(n,[{key:"render",value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,r=t.left,i=void 0===r||r,o=t.right,a=void 0===o||o,s=t.scale,l=void 0===s?new yH:s,c=t.handles,u=void 0===c?[]:c,f=t.getEventData,d=void 0===f?gH:f,p=t.activeHandleID,h=void 0===p?"":p,y=l.getDomain(),m=[],v=0;v<u.length+1;v++){var g=u[v-1],x=u[v];0===v&&!0===i?g={id:"$",value:y[0],percent:0}:v===u.length&&!0===a&&(x={id:"$",value:y[1],percent:100}),g&&x&&m.push({id:"".concat(g.id,"-").concat(x.id),source:g,target:x})}var b=n({getEventData:d,activeHandleID:h,tracks:m,getTrackProps:e});return b&&k().Children.only(b)}}]),n}(E.Component);function bH(e,t,n){return Math.min(Math.max(e,t),n)}var wH,SH,CH,EH,kH,_H,OH,PH=qU((function e(){var t=this;GU(this,e),this.step=1,this.domain=[0,1],this.range=[0,1],this.setDomain=function(e){return t.domain=[e[0],e[1]],t},this.setRange=function(e){return t.range=[e[0],e[1]],t},this.setStep=function(e){return t.step=e,t},this.getValue=function(e){var n=JU(t.domain,2),r=n[0],i=n[1],o=JU(t.range,2),a=o[0],s=o[1],l=t.step,c=(bH(e,r,i)-r)/(i-r);return bH(l*Math.round(c*(s-a)/l)+a,a<s?a:s,s>a?s:a)}})),TH="undefined"!=typeof window&&"undefined"!=typeof document,AH=function(){},jH=[0,100],IH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).state={step:.1,values:[],domain:jH,handles:[],reversed:!1,activeHandleID:"",valueToPerc:null,valueToStep:null,pixelToStep:null},e.slider=k().createRef(),e.onKeyDown=function(t,n){var r=["ArrowRight","ArrowUp"],i=["ArrowDown","ArrowLeft"],o=KU(e),a=o.state.handles,s=o.props,l=s.step,c=void 0===l?.1:l,u=s.reversed,f=void 0!==u&&u,d=s.vertical,p=void 0!==d&&d,h=s.domain,y=void 0===h?[0,100]:h,m=t.key||"".concat(t.keyCode);if(r.concat(i).includes(m)){if(p){var v=[i,r];r=v[0],i=v[1]}t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault();var g=a.find((function(e){return e.key===n}));if(g){var x=g.val,b=x;r.includes(m)?b=function(e,t,n,r){var i=r?e-t:e+t;return r?Math.max(n[0],i):Math.min(n[1],i)}(x,c,y,f):i.includes(m)&&(b=function(e,t,n,r){var i=r?e+t:e-t;return r?Math.min(n[1],i):Math.max(n[0],i)}(x,c,y,f));var w=a.map((function(e){return e.key===n?{key:e.key,val:b}:e}));e.submitUpdate(w,!0)}}},e.onMouseDown=function(t,n){e.onStart(t,n,!1)},e.onTouchStart=function(t,n){sH(t)||e.onStart(t,n,!0)},e.getEventData=function(t,n){var r,i=KU(e),o=i.state,a=o.pixelToStep,s=o.valueToPerc,l=i.props.vertical;return a.setDomain(aH(e.slider.current,l)),n&&t instanceof TouchEvent?r=a.getValue(lH(l,t)):t instanceof MouseEvent&&(r=a.getValue(l?t.clientY:t.pageX)),{value:r,percent:s.getValue(r)}},e.onMouseMove=function(t){var n=KU(e),r=n.state,i=r.handles,o=r.pixelToStep,a=r.activeHandleID,s=void 0===a?"":a,l=n.props,c=l.vertical,u=l.reversed,f=void 0!==u&&u;o.setDomain(aH(e.slider.current,c));var d=oH(i,s,o.getValue(c?t.clientY:t.pageX),f);e.submitUpdate(d)},e.onTouchMove=function(t){var n=KU(e),r=n.state,i=r.handles,o=r.pixelToStep,a=r.activeHandleID,s=n.props,l=s.vertical,c=s.reversed;if(null!==o&&!sH(t)){o.setDomain(aH(e.slider.current,l));var u=oH(i,a,o.getValue(lH(l,t)),c);e.submitUpdate(u)}},e.onMouseUp=function(){var t=KU(e),n=t.state,r=n.handles,i=void 0===r?[]:r,o=n.activeHandleID,a=t.props,s=a.onChange,l=void 0===s?AH:s,c=a.onSlideEnd,u=void 0===c?AH:c;l(i.map((function(e){return e.val}))),u(i.map((function(e){return e.val})),{activeHandleID:o}),e.setState({activeHandleID:""}),TH&&(document.removeEventListener("mousemove",e.onMouseMove),document.removeEventListener("mouseup",e.onMouseUp))},e.onTouchEnd=function(){var t=KU(e),n=t.state,r=n.handles,i=n.activeHandleID,o=t.props,a=o.onChange,s=void 0===a?AH:a,l=o.onSlideEnd,c=void 0===l?AH:l;s(r.map((function(e){return e.val}))),c(r.map((function(e){return e.val})),{activeHandleID:i}),e.setState({activeHandleID:""}),TH&&(document.removeEventListener("touchmove",e.onTouchMove),document.removeEventListener("touchend",e.onTouchEnd))},e}return qU(n,[{key:"componentDidMount",value:function(){var e=this.state.pixelToStep,t=this.props.vertical;e.setDomain(aH(this.slider.current,t))}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"removeListeners",value:function(){TH&&(document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"onStart",value:function(e,t,n){var r=this.state.handles,i=this.props.onSlideStart,o=void 0===i?AH:i;n||e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),r.find((function(e){return e.key===t}))?(this.setState({activeHandleID:t}),o(r.map((function(e){return e.val})),{activeHandleID:t}),n?this.addTouchEvents():this.addMouseEvents()):(this.setState({activeHandleID:""}),this.handleRailAndTrackClicks(e,n))}},{key:"handleRailAndTrackClicks",value:function(e,t){var n,r=this,i=this.state,o=i.handles,a=i.pixelToStep,s=this.props,l=s.vertical,c=s.reversed,u=void 0!==c&&c,f=this.slider;a.setDomain(aH(f.current,l)),n=t?a.getValue(lH(l,e)):a.getValue(l?e.clientY:e.pageX);for(var d="",p=1/0,h=0;h<o.length;h++){var y=o[h],m=y.key,v=y.val,g=Math.abs(v-n);g<p&&(d=m,p=g)}var x=oH(o,d,n,u);this.setState({activeHandleID:d},(function(){r.submitUpdate(x,!0),t?r.addTouchEvents():r.addMouseEvents()}))}},{key:"addMouseEvents",value:function(){TH&&(document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp))}},{key:"addTouchEvents",value:function(){TH&&(document.addEventListener("touchmove",this.onTouchMove),document.addEventListener("touchend",this.onTouchEnd))}},{key:"submitUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.mode,i=void 0===r?1:r,o=n.step,a=void 0===o?.1:o,s=n.onUpdate,l=void 0===s?AH:s,c=n.onChange,u=void 0===c?AH:c,f=n.reversed,d=void 0!==f&&f,p=this.state.valueToStep.getValue;this.setState((function(n){var r=n.handles,o=[];if("function"==typeof i)o=i(r,e,a,d,p),BU()(Array.isArray(o),"Custom mode function did not return an array.");else switch(i){case 1:o=function(e,t){return t}(0,e);break;case 2:o=function(e,t){for(var n=0;n<e.length;n++){if(e[n].key!==t[n].key)return e;if(t[n+1]&&t[n].val===t[n+1].val)return e}return t}(r,e);break;case 3:o=uH(r,e,a,d,p);break;default:o=e,BU()(!1,"".concat(rH," Invalid mode value."))}return l(o.map((function(e){return e.val}))),t&&u(o.map((function(e){return e.val}))),{handles:o}}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.handles,r=t.valueToPerc,i=t.activeHandleID,o=this.props,a=o.className,s=o.rootStyle,l=void 0===s?{}:s,c=o.rootProps,u=void 0===c?{}:c,f=o.component,d=void 0===f?"div":f,p=o.disabled,h=void 0!==p&&p,y=o.flatten,m=void 0!==y&&y,v=n.map((function(e){var t=e.key,n=e.val;return{id:t,value:n,percent:r.getValue(n)}})),g=k().Children.map(this.props.children,(function(t){return!0===function(e){if(!(0,E.isValidElement)(e))return!1;var t=e.type,n=t?t.name:"";return n===hH.name||n===pH.name||n===vH.name||n===xH.name}(t)?k().cloneElement(t,{scale:r,handles:v,activeHandleID:i,getEventData:e.getEventData,emitKeyboard:h?AH:e.onKeyDown,emitMouse:h?AH:e.onMouseDown,emitTouch:h?AH:e.onTouchStart}):t}));return m?k().createElement(k().Fragment,null,k().createElement(d,HU(HU({},u),{},{style:l,className:a,ref:this.slider})),g):k().createElement(k().Fragment,null,k().createElement(d,HU(HU({},u),{},{style:l,className:a,ref:this.slider}),g))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.step,r=void 0===n?.1:n,i=e.values,o=e.domain,a=void 0===o?jH:o,s=e.reversed,l=void 0!==s&&s,c=e.onUpdate,u=void 0===c?AH:c,f=e.onChange,d=void 0===f?AH:f,p=e.warnOnChanges,h=void 0!==p&&p,y=t.valueToPerc,m=t.valueToStep,v=t.pixelToStep,g={};if(y&&m&&v||(y=new yH,m=new PH,v=new PH,g.valueToPerc=y,g.valueToStep=m,g.pixelToStep=v),t.domain===jH||null===t.step||null===t.domain||null===t.reversed||r!==t.step||a[0]!==t.domain[0]||a[1]!==t.domain[1]||l!==t.reversed){var x=JU(a,2),b=x[0],w=x[1];m.setStep(r).setRange([b,w]).setDomain([b,w]),!0===l?(y.setDomain([b,w]).setRange([100,0]),v.setStep(r).setRange([w,b])):(y.setDomain([b,w]).setRange([0,100]),v.setStep(r).setRange([b,w])),BU()(w>b,"".concat(rH," Max must be greater than min (even if reversed). Max is ").concat(w,". Min is ").concat(b,"."));var S=cH(i||t.values,l,m,h),C=S.handles;(S.changes||void 0===i||i===t.values)&&(u(C.map((function(e){return e.val}))),d(C.map((function(e){return e.val})))),g.step=r,g.values=i,g.domain=a===jH?eH(a):a,g.handles=C,g.reversed=l}else if(!function(e,t){return e===t||e.length===t.length&&e.reduce(function(e){return function(t,n,r){return t&&e[r]===n}}(t),!0)}(i,t.values)){var E=cH(i,l,m,h),k=E.handles;E.changes&&(u(k.map((function(e){return e.val}))),d(k.map((function(e){return e.val})))),g.values=i,g.handles=k}return Object.keys(g).length?g:null}}]),n}(E.PureComponent),MH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},DH=tt.video(wH||(wH=MH(["\n height: auto;\n width: ",";\n object-fit: cover;\n object-position: center;\n &:nth-child(1) {\n border-radius: 6px 0 0 6px;\n }\n &:nth-child(",") {\n border-radius: 0 6px 6px 0;\n }\n"],["\n height: auto;\n width: ",";\n object-fit: cover;\n object-position: center;\n &:nth-child(1) {\n border-radius: 6px 0 0 6px;\n }\n &:nth-child(",") {\n border-radius: 0 6px 6px 0;\n }\n"])),(function(e){return e.width}),(function(e){return e.numberOfStills})),RH=tt.div(SH||(SH=MH(["\n position: absolute;\n left: 0;\n right: 0;\n height: 48px;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap;\n"],["\n position: absolute;\n left: 0;\n right: 0;\n height: 48px;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap;\n"]))),FH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},LH=function(){return LH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},LH.apply(this,arguments)},BH=tt.div(CH||(CH=FH(["\n position: absolute;\n width: 100%;\n height: 48px;\n cursor: pointer;\n"],["\n position: absolute;\n width: 100%;\n height: 48px;\n cursor: pointer;\n"]))),NH=tt.div(EH||(EH=FH(["\n position: absolute;\n width: 100%;\n height: 48px;\n pointer-events: none;\n background-color: rgba(0, 27, 83, 0.15);\n border-radius: 6px;\n"],["\n position: absolute;\n width: 100%;\n height: 48px;\n pointer-events: none;\n background-color: rgba(0, 27, 83, 0.15);\n border-radius: 6px;\n"]))),zH=function(e){var n=e.getRailProps;return(0,t.jsxs)(E.Fragment,{children:[(0,t.jsx)(BH,LH({},n())),(0,t.jsx)(NH,{})]})},VH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UH=function(){return UH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UH.apply(this,arguments)},HH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},GH=tt.div(kH||(kH=VH(["\n left: ",";\n position: absolute;\n transform: ",";\n z-index: 400;\n width: 24px;\n height: 48px;\n cursor: pointer;\n"],["\n left: ",";\n position: absolute;\n transform: ",";\n z-index: 400;\n width: 24px;\n height: 48px;\n cursor: pointer;\n"])),(function(e){return e.percent}),(function(e){return e.transform})),WH=tt.div(_H||(_H=VH(["\n left: ",";\n background-color: ",";\n position: absolute;\n transform: ",";\n z-index: 2;\n width: 24px;\n height: 48px;\n border-radius: ",";\n &:before {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 12px;\n background: ",";\n border-radius: 4px;\n }\n"],["\n left: ",";\n background-color: ",";\n position: absolute;\n transform: ",";\n z-index: 2;\n width: 24px;\n height: 48px;\n border-radius: ",";\n &:before {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 12px;\n background: ",";\n border-radius: 4px;\n }\n"])),(function(e){return e.percent}),(function(e){return e.isDisabled?"#666":Ti}),(function(e){return e.transform}),(function(e){return e.borderRadius}),di),qH=function(e){var n=HH(e.domain,2),r=n[0],i=n[1],o=e.handle,a=o.id,s=o.value,l=o.percent,c=e.showFloatingPreview,u=void 0===c||c,f=e.isActive,d=e.disabled,p=e.getHandleProps,h=e.videoRef,y=e.changeVideoPosition,m=void 0===y||y,v=e.nChild,g=HH(k().useState(!1),2),x=g[0],b=g[1],w=k().createRef();k().useEffect((function(){f&&(u&&(w.current.currentTime=s||0),m&&(h.current.currentTime=s||0))}),[s,w,m,h]);var S=St(s).split(".")[0],C=St(s).split(".")[1];return(0,t.jsxs)(E.Fragment,{children:[u&&(0,t.jsxs)(t.Fragment,{children:[!x&&!f||d?null:(0,t.jsxs)("div",UH({style:{left:"".concat(l,"%"),position:"absolute",marginLeft:"-15px",marginTop:"52px",zIndex:1}},{children:[(0,t.jsx)("div",{style:{width:0,height:0,marginLeft:21,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderBottom:"6px solid "}}),(0,t.jsxs)("div",UH({style:{width:"auto",padding:4,fontSize:12,fontWeight:500,letterSpacing:.34,backgroundColor:Ti,color:"#fff",textAlign:"center",position:"fixed",zIndex:99999}},{children:[S,(0,t.jsx)("span",UH({style:{fontSize:9,fontWeight:400,letterSpacing:.34,color:"#fff",opacity:.7}},{children:"."+C}))]}))]})),(0,t.jsx)("div",UH({style:{left:"".concat(l,"%"),position:"absolute",marginLeft:"-38px",marginTop:"-92px",zIndex:3,visibility:!x&&!f||d?"hidden":"visible"}},{children:(0,t.jsx)("div",UH({style:{width:141,height:80,border:"solid 2px ".concat(Ti),backgroundColor:Ui,display:"flex",justifyContent:"center"}},{children:(0,t.jsx)("video",{ref:w,height:"100%",src:e.videoSource},"previewvideoRef")}))}))]}),(0,t.jsx)(GH,UH({percent:"".concat(l,"%")},p(a),{onMouseEnter:function(){b(!0)},onMouseLeave:function(){b(!1)},transform:0===v?"translate(0px,0%)":"translate(-15px,0%)"})),(0,t.jsx)(WH,{role:"slider","aria-valuemin":r,"aria-valuemax":i,"aria-valuenow":s,percent:"".concat(l,"%"),borderRadius:0===v?"5px 0px 0px 5px;":"0px 5px 5px 0px",isDisabled:d,transform:0===v?"translate(0px,0%)":"translate(-15px,0%)"})]})},$H=function(){return $H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$H.apply(this,arguments)},ZH=function(e){var n=e.source,r=e.target,i=e.getTrackProps,o=e.disabled;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",$H({style:{position:"absolute",height:48,zIndex:1,backgroundColor:o?"#999":"rgba(0,0,0,.7)",cursor:"pointer",left:"0",width:"".concat(n.percent+1,"%"),borderRadius:"6px 0 0 6px"}},i())),(0,t.jsx)("div",$H({style:{position:"absolute",height:48,zIndex:1,backgroundColor:o?"#999":"transparent",cursor:"pointer",left:"".concat(n.percent,"%"),width:"".concat(r.percent-n.percent,"%"),borderRadius:6}},i())),(0,t.jsx)("div",$H({style:{position:"absolute",height:48,zIndex:1,backgroundColor:o?"#999":"rgba(0,0,0,.7)",cursor:"pointer",left:"".concat(r.percent,"%"),width:"".concat(100-r.percent,"%"),borderRadius:"0 6px 6px 0"}},i()))]})},YH=function(){return YH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},YH.apply(this,arguments)},QH=function(e){var n=e.tick,r=e.count;return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{position:"absolute",width:2,height:48,opacity:.4,backgroundColor:hi,left:"".concat(n.percent,"%"),zIndex:1}}),(0,t.jsx)("div",YH({style:{position:"absolute",marginTop:52,fontSize:10,textAlign:"center",marginLeft:"".concat(-100/r/2,"%"),width:"".concat(100/r,"%"),left:"".concat(n.percent,"%")}},{children:St(n.value).split(".")[0]}))]})},KH=function(){return KH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},KH.apply(this,arguments)},XH=tt.div(OH||(OH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n position: relative;\n width: ",";\n height: 48px;\n"],["\n position: relative;\n width: ",";\n height: 48px;\n"])),(function(e){return e.width})),JH={position:"relative",width:"100%",backgroundColor:"rgba(0, 27, 83, 0.4)"},eG=E.memo((function(e){for(var n=e.videoSource,r=e.videoDuration,i=e.numberOfStills,o=[],a=100/i,s=0;s<i;s++)o.push(k().createRef());return(0,E.useEffect)((function(){o.forEach((function(e,t){e.current&&(e.current.currentTime=r*(t/i))}))}),[o]),(0,t.jsx)(RH,{children:o.map((function(e,r){return(0,t.jsx)(DH,{ref:e,src:n,width:"".concat(a,"%"),numberOfStills:i},"previewvideoRef-".concat(r))}))})})),tG=function(e){var n=e.videoDuration,r=e.videoSource,i=e.setTrimDuration,o=void 0===i?function(){}:i,a=e.setStart,s=void 0===a?function(){}:a,l=e.value,c=e.setValue,u=e.addHistory,f=void 0===u?function(){}:u,d=e.onSlideEnd,p=void 0===d?function(){}:d,h=e.valueRef,y=e.videoRef,m=e.showTickTime,v=void 0===m||m,g=e.changeVideoPosition,x=void 0===g||g,b=e.showFloatingPreview,w=void 0===b||b,S=e.width,C=[0,n];E.useEffect((function(){var e=[0,n||0];l[1]||c(e)}),[n]),E.useEffect((function(){return y&&y.current&&(y.current.addEventListener("play",(function(e){return _(e)})),y.current.addEventListener("timeupdate",(function(e){return k(e)}))),function(){y&&y.current&&(y.current.removeEventListener("play",(function(e){return _(e)})),y.current.removeEventListener("timeupdate",(function(e){return k(e)})))}}),[y]);var k=function(e){var t=e.target;t.currentTime>h.current[1]&&0!=h.current[1]&&t.pause()},_=function(e){var t=e.target;(t.currentTime>=h.current[1]||t.currentTime<h.current[0])&&(t.currentTime=h.current[0])},O=E.useMemo((function(){return n}),[n]);return(0,t.jsx)(XH,KH({width:S},{children:(0,t.jsxs)(IH,KH({rootStyle:JH,mode:1,step:1e-7,domain:C,reversed:!1,onChange:function(e){if(!isNaN(e[0])&&!isNaN(e[1])){var t=e.slice();f(t),c(t),h.current=t}},onUpdate:function(e){o(e[1]-e[0]),s(e[0])},values:l,onSlideEnd:function(e){p(e)}},{children:[(0,t.jsx)(eG,{numberOfStills:14,videoSource:r,videoDuration:O}),(0,t.jsx)(pH,{children:function(e){return(0,t.jsx)(zH,KH({},e))}}),(0,t.jsx)(hH,{children:function(e){var n=e.handles,i=e.activeHandleID,o=e.getHandleProps;return(0,t.jsx)("div",KH({className:"slider-handles"},{children:n.map((function(e,n){return(0,t.jsx)(qH,{showFloatingPreview:w,nChild:n,handle:e,domain:C,isActive:e.id===i,getHandleProps:o,videoSource:r,videoRef:y,changeVideoPosition:x},e.id)}))}))}}),(0,t.jsx)(xH,KH({left:!1,right:!1},{children:function(e){var n=e.tracks,r=e.getTrackProps;return(0,t.jsx)("div",KH({className:"slider-tracks"},{children:n.map((function(e){var n=e.id,i=e.source,o=e.target;return(0,t.jsx)(ZH,{source:i,target:o,getTrackProps:r},n)}))}))}})),v&&(0,t.jsx)(vH,KH({count:10},{children:function(e){var n=e.ticks;return(0,t.jsx)("div",KH({className:"slider-ticks"},{children:n.map((function(e){return(0,t.jsx)(QH,{tick:e,count:n.length},e.id)}))}))}}))]}))}))},nG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},rG=function(){return rG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rG.apply(this,arguments)},iG=tt.div(sG||(sG=nG(["\n margin-top: 8px;\n font-weight: 400;\n color: ",";\n\n span {\n text-decoration: underline;\n cursor: pointer;\n }\n"],["\n margin-top: 8px;\n font-weight: 400;\n color: ",";\n\n span {\n text-decoration: underline;\n cursor: pointer;\n }\n"])),"rgba(78, 84, 97, 1)"),oG=tt(tG)(lG||(lG=nG(["\n height: 48px;\n width: 100%;\n background-color: ",";\n"],["\n height: 48px;\n width: 100%;\n background-color: ",";\n"])),Ci);const aG=function(e){var n=e.videoRef,r=e.videoDuration,i=e.videoSource,o=e.setValue,a=e.value,s=e.isVideoTrimmed,l=e.valueRef,c=e.isVideoLoading,u=void 0===c||c;return(0,t.jsxs)(t.Fragment,{children:[u?(0,t.jsx)(oG,{width:"100%",videoRef:null,videoDuration:0,videoSource:"",setValue:o,value:[0,0],valueRef:l,showTickTime:!1,showFloatingPreview:!1}):(0,t.jsx)(tG,{width:"100%",videoRef:n,videoDuration:r,videoSource:i,setValue:o,value:a,valueRef:l,showTickTime:!1,showFloatingPreview:!1}),s&&(0,t.jsxs)(iG,{children:["Trimmed.",(0,t.jsx)("span",rG({style:{marginLeft:8},onClick:function(){o([0,r]),l.current&&(l.current=[0,r]),n.current&&(n.current.currentTime=0)}},{children:"Revert to Original"}))]})]})};var sG,lG,cG,uG,fG,dG,pG,hG,yG,mG,vG,gG,xG,bG,wG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},SG=function(){return SG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},SG.apply(this,arguments)},CG=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},EG=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},kG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_G=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},OG=tt.div(cG||(cG=wG(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),PG=tt.div(uG||(uG=wG(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),TG=tt.div(fG||(fG=wG(["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n flex-wrap: wrap;\n gap: 16px;\n"],["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n flex-wrap: wrap;\n gap: 16px;\n"]))),AG=tt.div(pG||(pG=wG(["\n box-sizing: border-box;\n width: 100%;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n"])),(function(e){return e.theme.containerWidth>=ri&&Ne(dG||(dG=wG(["\n width: calc(50% - 8px);\n "],["\n width: calc(50% - 8px);\n "])))})),jG=tt.div(yG||(yG=wG(["\n box-sizing: border-box;\n width: 100%;\n margin-top: 16px;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n margin-top: 16px;\n ","\n"])),(function(e){return e.theme.containerWidth>=ri&&Ne(hG||(hG=wG(["\n margin-top: 0;\n width: calc(50% - 8px);\n "],["\n margin-top: 0;\n width: calc(50% - 8px);\n "])))})),IG=tt.div(mG||(mG=wG(["\n margin-bottom: 24px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n .fullscreen {\n height: auto;\n }\n"],["\n margin-bottom: 24px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n .fullscreen {\n height: auto;\n }\n"])),di),MG=tt.div(vG||(vG=wG(["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n border-radius: 6px;\n"],["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n border-radius: 6px;\n"])),di),DG=tt.div(gG||(gG=wG(["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"],["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"])),Pi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),RG=tt.div(xG||(xG=wG(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"])),Oi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),FG="pending",LG=[{label:"Enable video reactions & comments",value:"enableReactions"}],BG=function(){var e=Mt().showInsertFeature,n=Mt(),r=n.showTrimFeature,i=n.showCTAFeature,o=n.showLandingPageFeature,a=n.showReactionsFeature,s=Ju().toast,l=Nl().userData,c=Xl(l),u=Jl(l),f=ec(l),d=function(e){var t;return!(!(null===(t=e.customer)||void 0===t?void 0:t.reactionsPreference)||"0"===e.customer.reactionsPreference.toString())}(l),p=function(e){var t;return!!(e.reactionsPreference&&"1"===e.reactionsPreference.toString()||null===e.reactionsPreference&&(null===(t=e.customer)||void 0===t?void 0:t.reactionsPreference)&&"1"===e.customer.reactionsPreference.toString())}(l),h=pn().videoId,y=dn(),m=kG((0,E.useState)([]),2),v=m[0],g=m[1],x=kG((0,E.useState)(!1),2),w=x[0],C=x[1],k=kG((0,E.useState)(!1),2),_=k[0],O=k[1],P=kG((0,E.useState)([]),2),T=P[0],A=P[1],j=kG((0,E.useState)(!1),2),I=j[0],M=j[1],D=kG((0,E.useState)(!0),2),R=D[0],F=D[1],L=kG((0,E.useState)(!1),2),B=L[0],N=L[1],z=kG((0,E.useState)({}),2),V=z[0],U=z[1],H=kG((0,E.useState)({videoId:h,templateId:0,linksetId:"",overlayId:"",vin:""}),2),G=H[0],W=H[1],q=kG((0,E.useState)(LG),2),$=q[0],Z=q[1],Y=kG((0,E.useState)(FG),2),Q=Y[0],K=Y[1],X=kG((0,E.useState)(!c||u),2),J=X[0],ee=X[1],te=kG((0,E.useState)([]),2),ne=te[0],re=te[1],ie=kG((0,E.useState)([]),2),oe=ie[0],ae=ie[1],se=kG((0,E.useState)(0),2),le=se[0],ce=se[1],ue={id:0,title:"".concat(u?"Service":"Sales"," page")},fe=kG((0,E.useState)([]),2),de=fe[0],pe=fe[1],he=kG((0,E.useState)(!1),2),ye=he[0],me=he[1],ve=kG((0,E.useState)(!1),2),ge=ve[0],xe=ve[1],be=kG((0,E.useState)(!1),2),we=be[0],Se=be[1],Ce=kG((0,E.useState)(!0),2),Ee=Ce[0],ke=Ce[1],_e=c?null===l.customer.markVideosAsSent?aF:parseInt(l.customer.markVideosAsSent.toString(),10):sF,Oe=yF({video:V,videoRequest:null==V?void 0:V.videoRequest,setShowModalQuickShareMarkAsSent:Se,handleOnMarkAsSentSuccessCallback:function(){me(!1)}}),Pe=Oe.onQuickShareMutationHandler,Te=Oe.isQuickshareLoading,Ae=Oe.onQuickShareButtonClick,je=kG((0,E.useState)([0,0]),2),Ie=je[0],Me=je[1],De=kG((0,E.useState)(0),2),Re=De[0],Fe=De[1],Le=(0,E.useRef)([0,0]),Be=function(){return CG(void 0,void 0,void 0,(function(){var e,t,n;return EG(this,(function(r){switch(r.label){case 0:return O(!0),[4,(i={start:0,limit:100,search:""},Qn(void 0,void 0,void 0,(function(){var e,t;return Kn(this,(function(n){switch(n.label){case 0:return e=S.bearerToken,[4,Tn({url:"/templates",baseURL:b,method:Xn,params:i,headers:e}).catch((function(e){return e}))];case 1:if((t=n.sent())instanceof Error)throw t;return[2,t]}}))}))).catch((function(e){return e}))];case 1:return(e=r.sent())instanceof Error||(t=e.templates,(n=null==e?void 0:e.default)?(ce(parseInt(n.id)),W((function(e){return SG(SG({},e),{templateId:parseInt(n.id)})})),t.find((function(e){return e.id===n.id}))||(t=_G([n],kG(t),!1))):W((function(e){return SG(SG({},e),{templateId:0})})),(0,Eu.keyBy)(t,"id")[-1]||t.push({id:-1,title:"Website Overlay",thumbnailURL:"https://www.covideo.com/SampleTemplates/WebsiteOverlay_small.jpg",typeId:18}),O(!1),re(t),ae(t)),[2]}var i}))}))},Ne=function(){return CG(void 0,void 0,void 0,(function(){var e,t;return EG(this,(function(n){switch(n.label){case 0:return M(!0),[4,(r={start:0,limit:100,search:""},Qn(void 0,void 0,void 0,(function(){var e,t;return Kn(this,(function(n){switch(n.label){case 0:return e=S.bearerToken,[4,Tn({url:"/overlays",baseURL:b,method:Xn,params:r,headers:e}).catch((function(e){return e}))];case 1:if((t=n.sent())instanceof Error)throw t;return[2,t]}}))}))).catch((function(e){return e}))];case 1:return(e=n.sent())instanceof Error||(t=e.websiteUrls,M(!1),A(t)),[2]}var r}))}))},ze=function(){return CG(void 0,void 0,void 0,(function(){var e,t,n,r;return EG(this,(function(i){switch(i.label){case 0:return me(!0),e=f&&0===G.templateId,t=!!de.some((function(e){return"enableReactions"===e.value})),n=h,ge?[4,CG(void 0,void 0,void 0,(function(){return EG(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Zn(h,{duration:Ie[1],start:Ie[0],title:V.title})];case 1:return[2,e.sent()];case 2:return e.sent(),s({message:"Something went wrong while trimming the video, try again later!"}),[3,3];case 3:return[2]}}))}))]:[3,2];case 1:(r=i.sent())&&(n=r.id),i.label=2;case 2:return[2,{videoShareSetData:{videoId:n,vin:Q!==FG?Q:"",templateId:G.templateId||0,linksetId:G.linksetId||0,overlayId:G.overlayId||0,allowReactions:t},useAutomotive:e}]}}))}))};(0,E.useEffect)((function(){CG(void 0,void 0,void 0,(function(){var e;return EG(this,(function(t){switch(t.label){case 0:return F(!0),[4,Wn(h)];case 1:return(e=t.sent())&&U(e),F(!1),[2]}}))})),c&&CG(void 0,void 0,void 0,(function(){var e;return EG(this,(function(t){switch(t.label){case 0:return F(!0),[4,(n=h,tr(void 0,void 0,void 0,(function(){var e,t,r;return nr(this,(function(i){switch(i.label){case 0:return e=S.bearerToken,t={url:"/video-requests/".concat(n,"/get-by-videoid"),baseURL:b,method:rr,headers:e},[4,Tn(t).catch((function(e){return e}))];case 1:if((r=i.sent())instanceof Error)throw r;return[2,r]}}))})))];case 1:return(e=t.sent())&&K(e.vin||""),F(!1),[2]}var n}))})),CG(void 0,void 0,void 0,(function(){var e,t;return EG(this,(function(n){switch(n.label){case 0:return C(!0),[4,(r={start:0,limit:100,search:""},Qn(void 0,void 0,void 0,(function(){var e,t,n,i,o,a,s,l;return Kn(this,(function(c){switch(c.label){case 0:return t=void 0===(e=r.search)?"":e,i=void 0===(n=r.start)?0:n,a=void 0===(o=r.limit)?0:o,s=S.bearerToken,[4,Tn({url:"/exitlinksets",baseURL:b,method:Xn,headers:s,params:{search:t,start:i,limit:a}}).catch((function(e){return e}))];case 1:if((l=c.sent())instanceof Error)throw l;return[2,l]}}))}))).catch((function(e){return e}))];case 1:return(e=n.sent())instanceof Error||(t=e.linksets,C(!1),g(t)),[2]}var r}))})),J&&(Be(),Ne()),d?p&&pe((function(e){return _G(_G([],kG(e),!1),kG($.filter((function(e){return"enableReactions"===e.value}))),!1)})):Z((function(e){return e.filter((function(e){return"enableReactions"!==e.value}))}))}),[]),(0,E.useEffect)((function(){Me([0,Re])}),[Re]),(0,E.useEffect)((function(){if(Q!==FG){if(Q||(ee(!1),W((function(e){return SG(SG({},e),{vin:""})}))),!Q&&!ne.length)return Be(),void Ne();if(!Q&&ne.length)return ae(ne),void W((function(e){return SG(SG({},e),{templateId:le})}));ae([ue]),W((function(e){return SG(SG({},e),{templateId:0})}))}}),[Q]),(0,E.useEffect)((function(){!J||G.templateId||_||ne.length>0&&W((function(e){return SG(SG({},e),{templateId:ne[0].id})}))}),[G,ne,_]),(0,E.useEffect)((function(){""!==G.overlayId||I||T.length>0&&W((function(e){return SG(SG({},e),{overlayId:T[0].id})}))}),[G,T,I]),(0,E.useEffect)((function(){""!==G.linksetId||w||v.forEach((function(e){e.defaultLinks&&W((function(t){return SG(SG({},t),{linksetId:e.id})}))}))}),[G,v,w]),(0,E.useEffect)((function(){var e=kt({trimStart:Ie[0],trimEnd:Ie[1],videoDuration:Re});return xe(e),function(){xe(!1)}}),[Ie,Re]);var Ve=(0,E.createRef)();if(R)return(0,t.jsx)(Eo,{isLoading:R});var Ue=_||w||I||ye||-1===G.templateId&&!G.overlayId;return(0,t.jsxs)(OG,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return y.push("/")}}),center:(0,t.jsx)(PG,{children:"Insert Video"}),right:e&&(0,t.jsx)(yo,{onClick:function(){return CG(void 0,void 0,void 0,(function(){var e;return EG(this,(function(t){switch(t.label){case 0:return _e===aF?(Ae({videoActivityType:pu.QUICKSHARE,type:"quickshare"}),[2]):[4,ze()];case 1:return e=t.sent(),Ae(SG(SG({videoActivityType:pu.QUICKSHARE,type:"quickshare"},e.videoShareSetData),{useAutomotive:e.useAutomotive})),[2]}}))}))},text:"Insert",textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px",disabled:Ue,icon:ye?(0,t.jsx)(go,{size:12,color:di}):(0,t.jsx)(tT,{size:18,color:di})})}),(0,t.jsx)(so,{children:(0,t.jsxs)(TG,{children:[(0,t.jsxs)(AG,{children:[(0,t.jsxs)(IG,{children:[(0,t.jsx)(FU,{videoId:h,videoRef:Ve,autoplay:!1,height:"247px",FullscreenVideoWrapperBackgroundColor:Ai,borderBottomRadius:"0px",videoSource:V.videoSource||"",playerBackgroundColor:V.playerBackgroundColor||"",setVideoDuration:Fe,setIsVideoLoading:ke}),(0,t.jsxs)(MG,{children:[(0,t.jsx)(DG,{children:V.title}),(0,t.jsxs)(RG,{children:[(0,t.jsx)(iT,{size:16,color:ki,style:{marginRight:6}}),V.recordDate]})]})]}),r&&(0,t.jsx)(aG,{isVideoTrimmed:ge,setValue:Me,value:Ie,videoDuration:Re,videoRef:Ve,videoSource:(null==V?void 0:V.videoSource)||"",valueRef:Le,isVideoLoading:Ee})]}),(o||i||a)&&(0,t.jsxs)(jG,{children:[(0,t.jsx)(Rz,{insertVideoData:G,setInsertVideoData:W,overlaysData:T,templatesData:oe,linksetsData:v,templatesLoading:_,linksetsLoading:w,overlaysLoading:I,checkboxes:$,selectedCheckboxes:de,setSelectedCheckboxes:pe}),f&&(0,t.jsx)(oV,{onChangeVehicle:function(e){K((null==e?void 0:e.vin)||""),N(!1)},selectedVin:Q,fetchSold:!1,addingVehicle:B,handleChangeVehicleButtonPress:function(){K(""),N(!0)},handleRemoveVehicleButtonPress:function(){return K("")},setAddingVehicle:N})]})]})}),we&&(0,t.jsx)(Tf,{markAsSentPayload:{type:"quickshare"},isQuickShareLoading:Te,quickShareMarkAsSentHandler:Pe,handleModalClose:function(){return CG(void 0,void 0,void 0,(function(){return EG(this,(function(e){return Se(!1),[2]}))}))},getMarkAsSentPayload:ze})]})};function NG(){return NG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NG.apply(this,arguments)}const zG=tt((function(e){return E.createElement("svg",NG({xmlns:"http://www.w3.org/2000/svg",width:73,height:72,viewBox:"0 0 73 72"},e),bG||(bG=E.createElement("g",{fill:"#4E5461"},E.createElement("path",{id:"h3dd7yfnea",d:"M60 54c3.3 0 5.97-2.7 5.97-6L66 18c0-3.3-2.7-6-6-6H12c-3.3 0-6 2.7-6 6v30c0 3.3 2.7 6 6 6H3c-1.65 0-3 1.35-3 3s1.35 3 3 3h66c1.65 0 3-1.35 3-3s-1.35-3-3-3h-9zM15 18h42c1.65 0 3 1.35 3 3v24c0 1.65-1.35 3-3 3H15c-1.65 0-3-1.35-3-3V21c0-1.65 1.35-3 3-3z"}))))}))(VG||(VG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var VG,UG;function HG(){return HG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HG.apply(this,arguments)}const GG=tt((function(e){return E.createElement("svg",HG({xmlns:"http://www.w3.org/2000/svg",width:73,height:72,viewBox:"0 0 73 72"},e),UG||(UG=E.createElement("g",{fill:"#4E5461"},E.createElement("path",{d:"M36 36c6.63 0 12-5.37 12-12s-5.37-12-12-12-12 5.37-12 12 5.37 12 12 12zm0 6c-8.01 0-24 4.02-24 12v3c0 1.65 1.35 3 3 3h42c1.65 0 3-1.35 3-3v-3c0-7.98-15.99-12-24-12z"}))))}))(WG||(WG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var WG,qG;function $G(){return $G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$G.apply(this,arguments)}const ZG=tt((function(e){return E.createElement("svg",$G({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),qG||(qG=E.createElement("g",{fill:"#272A32"},E.createElement("path",{d:"M19.432 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65c-.03-.24-.24-.42-.49-.42h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-7.43 2.52c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"}))))}))(YG||(YG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var YG,QG,KG,XG,JG,eW,tW,nW,rW,iW,oW,aW,sW,lW,cW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},uW=function(){return uW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},uW.apply(this,arguments)},fW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},dW=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,pW="undefined"!=typeof InstallTrigger,hW=tt.div(QG||(QG=cW(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),yW=tt.div(KG||(KG=cW(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),mW=tt.span(XG||(XG=cW(["\n ","\n font-size: 24px;\n line-height: 40px;\n text-align: center;\n color: ",";\n display: flex;\n justify-content: center;\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 800;\n margin-top: 10%;\n margin-bottom: 6%;\n"],["\n ","\n font-size: 24px;\n line-height: 40px;\n text-align: center;\n color: ",";\n display: flex;\n justify-content: center;\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 800;\n margin-top: 10%;\n margin-bottom: 6%;\n"])),ci,Si),vW=tt.div(eW||(eW=cW(["\n display: flex;\n flex-direction: row;\n max-width: 100%;\n justify-content: center;\n gap: 8px;\n margin-left: auto;\n margin-right: auto;\n ","\n"],["\n display: flex;\n flex-direction: row;\n max-width: 100%;\n justify-content: center;\n gap: 8px;\n margin-left: auto;\n margin-right: auto;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(JG||(JG=cW(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),gW=tt.div(nW||(nW=cW(["\n display: flex;\n flex-direction: column;\n width: 176px;\n height: 176px;\n padding: 32px;\n border-radius: 6px;\n border: solid 2px rgba(0, 27, 83, 0.1);\n background-color: ",";\n justify-content: space-between;\n align-items: center;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: #4e5461;\n box-shadow: 0 0 2px rgba(66, 79, 104, 0.08), 0 4px 8px rgba(66, 79, 104, 0.03);\n span {\n color: ",";\n }\n &:hover {\n cursor: pointer;\n border: solid 2px transparent;\n background-color: ",";\n }\n ","\n"],["\n display: flex;\n flex-direction: column;\n width: 176px;\n height: 176px;\n padding: 32px;\n border-radius: 6px;\n border: solid 2px rgba(0, 27, 83, 0.1);\n background-color: ",";\n justify-content: space-between;\n align-items: center;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: #4e5461;\n box-shadow: 0 0 2px rgba(66, 79, 104, 0.08), 0 4px 8px rgba(66, 79, 104, 0.03);\n span {\n color: ",";\n }\n &:hover {\n cursor: pointer;\n border: solid 2px transparent;\n background-color: ",";\n }\n ","\n"])),(function(e){return e.isDisabled?"gray":"white"}),pi,(function(e){return e.isDisabled?"":"whitesmoke"}),(function(e){return e.theme.containerWidth<ni&&Ne(tW||(tW=cW(["\n margin-left: auto;\n margin-right: auto;\n "],["\n margin-left: auto;\n margin-right: auto;\n "])))})),xW=tt.div(rW||(rW=cW(["\n .account {\n background-color: #4e5461;\n border-radius: 50px;\n position: absolute;\n margin-left: -80px;\n margin-top: 42.5px;\n border: 2px solid white;\n }\n"],["\n .account {\n background-color: #4e5461;\n border-radius: 50px;\n position: absolute;\n margin-left: -80px;\n margin-top: 42.5px;\n border: 2px solid white;\n }\n"]))),bW=tt.div(iW||(iW=cW(["\n display: flex;\n margin-top: 32px;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n margin-top: 32px;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"]))),wW=tt.div(oW||(oW=cW(["\n margin-top: 48px;\n font-weight: 600;\n"],["\n margin-top: 48px;\n font-weight: 600;\n"]))),SW=tt.div(aW||(aW=cW(["\n display: flex;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"]))),CW=function(){var e=dn(),n=Mt(),r=n.showRecordBothFeature,i=n.showRecordCamFeature,o=n.showRecordScreenFeature,a=fW((0,E.useState)(!1),2),s=a[0],l=a[1],c=fW((0,E.useState)({videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}}),2),u=c[0],f=c[1],d=fW((0,E.useState)(""),2),p=d[0],h=d[1];return(0,E.useEffect)((function(){if(!_t){var e=JSON.parse(localStorage.getItem(m.recordSettings)||"{}"),t=[],n=[];return new Promise((function(e,t){return n=void 0,r=void 0,o=function(){var n,r,i;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:if(n=o.sent(),!ku().some(n,{label:""}))return[3,6];o.label=2;case 2:return o.trys.push([2,5,,6]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!0})];case 3:return r=o.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 4:return n=o.sent(),r.getTracks().forEach((function(e){return e.stop()})),[3,6];case 5:return i=o.sent(),t(i),[3,6];case 6:return e(n),[2]}}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o})).then((function(r){if(!ku().some(r,{kind:"videoinput"}))throw new Error("No camera detected");r.forEach((function(e){e&&e.label&&("audioinput"==e.kind&&t.push({label:e.label,value:e.deviceId}),"videoinput"==e.kind&&n.push({label:e.label,value:e.deviceId}))})),t.push({label:"No Audio",value:!1}),e.videoSource&&n.find((function(t){return t.value===e.videoSource.value}))||(e.videoSource=n[0]),e.audioSource&&t.find((function(t){return t.value===e.audioSource.value}))||(e.audioSource=t[0]),localStorage.setItem(m.recordSettings,JSON.stringify(e)),(""+localStorage.getItem(m.recordError)).indexOf("No camera detected")>-1&&localStorage.setItem(m.recordError,""),f(uW(uW({},u),e))})).catch((function(n){t.push({label:"No Audio",value:!1}),e.audioSource&&t.find((function(t){return t.value===e.audioSource.value}))||(e.audioSource=t[0]),localStorage.setItem(m.recordSettings,JSON.stringify(e)),f(uW(uW({},u),e)),n.message.indexOf("No camera detected")>-1||n.message.indexOf("device not found")>-1?localStorage.setItem(m.recordError,"No camera detected. Please check your recording settings and make sure the camera is plugged in."):h(n)})),function(){localStorage.setItem(m.recordError,"");try{window.stream.getTracks().forEach((function(e){return e.stop()}))}catch(e){}}}}),[]),(0,t.jsxs)(hW,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return e.push("/")}}),center:(0,t.jsx)(yW,{children:"Record Video"})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(mW,{children:"Select a recording option"}),(0,t.jsxs)(vW,{children:[r&&!dW&&!pW&&(0,t.jsxs)(gW,uW({onClick:function(){return!p&&e.push("/record/both")},isDisabled:!!p},{children:[(0,t.jsxs)(xW,{children:[(0,t.jsx)(zG,{className:"laptop",height:72,width:72}),(0,t.jsx)(GG,{className:"account",height:24,width:24,color:"#fff"})]}),(0,t.jsx)("span",{children:"Screen+Cam"})]})),o&&(0,t.jsxs)(gW,uW({onClick:function(){return!p&&e.push("/record/screen")},isDisabled:!!p},{children:[(0,t.jsx)(xW,{children:(0,t.jsx)(zG,{height:72,width:72})}),(0,t.jsx)("span",{children:"Screen Only"})]})),i&&(0,t.jsxs)(gW,uW({onClick:function(){return!p&&e.push("/record/cam")},isDisabled:!!p},{children:[(0,t.jsx)(xW,{children:(0,t.jsx)(GG,{height:72,width:72})}),(0,t.jsx)("span",{children:"Cam Only"})]}))]}),(0,t.jsx)(bW,{children:(0,t.jsx)(yo,{icon:(0,t.jsx)(ZG,{opacity:1}),backgroundColor:"#eeeff2",text:"Recording settings",textColor:"#000",onClick:function(){return l(!0)}})}),(0,t.jsxs)(SW,{children:[!!p&&(0,t.jsx)(wW,{children:"Please allow access to your camera and/or mic then try again."}),!p&&localStorage.getItem(m.recordError)&&(0,t.jsx)(wW,{children:localStorage.getItem(m.recordError)})]})]}),s&&(0,t.jsx)(Uu,{initialSettings:u,handleModalClose:function(){return l(!1)},handleSubmit:function(e){f(e),l(!1)}})]})};function EW(){return EW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EW.apply(this,arguments)}const kW=tt((function(e){return E.createElement("svg",EW({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),sW||(sW=E.createElement("defs",null,E.createElement("path",{id:"ndf93hp4na",d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l2.29 2.29c.63.63 1.71.18 1.71-.71V8.91c0-.89-1.08-1.34-1.71-.71L17 10.5z"}))),lW||(lW=E.createElement("g",{fill:"none",fillRule:"evenodd"},E.createElement("g",null,E.createElement("g",null,E.createElement("g",{transform:"translate(-1040 -20) translate(1032 12) translate(8 8)"},E.createElement("mask",{id:"tbkfdbvv7b",fill:"#fff"},E.createElement("use",{xlinkHref:"#ndf93hp4na"})),E.createElement("g",{fill:"#FFF",mask:"url(#tbkfdbvv7b)"},E.createElement("path",{d:"M0 0H32V32H0z",transform:"translate(-4 -4)"}))))))))}))(_W||(_W=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"16px"}),(function(e){return e.height||"16px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var _W,OW;function PW(){return PW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PW.apply(this,arguments)}const TW=tt((function(e){return E.createElement("svg",PW({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"3 3 18 18"},e),OW||(OW=E.createElement("path",{fill:"#001B53",fillRule:"evenodd",d:"M17 3H3v18h18V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"})))}))(AW||(AW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var AW,jW;function IW(){return IW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IW.apply(this,arguments)}const MW=tt((function(e){return E.createElement("svg",IW({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),jW||(jW=E.createElement("g",{fill:"#E84C3D"},E.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zm3.17-7.83c.39-.39 1.02-.39 1.41 0L12 12.59l1.42-1.42c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 14l1.42 1.42c.39.39.39 1.02 0 1.41-.39.39-1.02.39-1.41 0L12 15.41l-1.42 1.42c-.39.39-1.02.39-1.41 0-.187-.187-.293-.44-.293-.705 0-.265.106-.518.293-.705L10.59 14l-1.42-1.42c-.39-.38-.39-1.02 0-1.41zM15.5 4l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z"}))))}))(DW||(DW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var DW,RW,FW,LW,BW,NW,zW,VW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UW=function(){return UW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UW.apply(this,arguments)},HW=tt.label(RW||(RW=VW(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),Vi),GW=tt.div(FW||(FW=VW(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n"])),di),WW=tt.div(LW||(LW=VW(["\n display: flex;\n flex-direction: column;\n padding: 32px;\n"],["\n display: flex;\n flex-direction: column;\n padding: 32px;\n"]))),qW=tt.div(BW||(BW=VW(["\n display: flex;\n flex-direction: row;\n font-size: 18px;\n font-weight: bold;\n color: ",";\n justify-content: space-between;\n margin-bottom: 32px;\n p {\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: row;\n font-size: 18px;\n font-weight: bold;\n color: ",";\n justify-content: space-between;\n margin-bottom: 32px;\n p {\n margin: 0;\n }\n"])),pi),$W=tt.p(NW||(NW=VW(["\n font-size: 14px;\n line-height: 1.43;\n color: ",";\n"],["\n font-size: 14px;\n line-height: 1.43;\n color: ",";\n"])),pi),ZW=tt.section(zW||(zW=VW(["\n display: flex;\n flex-direction: row;\n width: 528px;\n max-width: 100%;\n justify-content: flex-end;\n align-items: right;\n padding: 0 32px 32px;\n"],["\n display: flex;\n flex-direction: row;\n width: 528px;\n max-width: 100%;\n justify-content: flex-end;\n align-items: right;\n padding: 0 32px 32px;\n"]))),YW=function(e){var n=e.open,r=void 0!==n&&n,i=(e.disabled,e.title),o=void 0===i?"":i,a=e.text,s=void 0===a?"":a,l=e.discardButtonText,c=void 0===l?"Keep video":l,u=e.confirmButtonText,f=void 0===u?"Delete video":u,d=e.onClickDiscardButton,p=e.onClickConfirmButton,h=e.showDiscardIcon,y=void 0===h||h,m=e.showSaveIcon,v=void 0===m||m,g=e.handleModalClose,x=void 0===g?function(){}:g;return r?(0,t.jsx)(kL,UW({disableFullScreen:!0,style:{position:"fixed",zIndex:999}},{children:(0,t.jsxs)(GW,{children:[(0,t.jsxs)(WW,{children:[(0,t.jsxs)(qW,{children:[(0,t.jsx)("p",{children:o}),(0,t.jsx)(HW,{children:(0,t.jsx)(rf,{width:"24px",height:"24px",onClick:x})})]}),(0,t.jsx)($W,{children:s})]}),(0,t.jsxs)(ZW,{children:[(0,t.jsx)(yo,UW({},!!y&&{icon:(0,t.jsx)(MW,{height:24,width:24})},{text:c,onClick:d,backgroundColor:Di,textColor:Ri,borderColor:Mi,fontSize:"15px"})),(0,t.jsx)(yo,UW({},!!v&&{icon:(0,t.jsx)(TW,{height:16,width:16})},{text:f,onClick:p,backgroundColor:Hi,borderColor:bi,fontSize:"15px",margin:"0 0 0 12px"}))]})]})})):null},QW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};const KW=function(e){var n=e.when,r=e.navigate,i=void 0===r?function(){}:r,o=e.shouldBlockNavigation,a=e.onConfirm,s=void 0===a?function(){}:a,l=e.onDiscard,c=void 0===l?function(){}:l,u=e.onStay,f=void 0===u?function(){}:u,d=e.stay,p=void 0!==d&&d,h=e.title,y=void 0===h?"Leave without saving changes?":h,m=e.text,v=void 0===m?"Your updates will not be saved. This action can’t be undone.":m,g=e.discardButtonText,x=void 0===g?"Discard Changes":g,b=e.confirmButtonText,w=void 0===b?"Save Changes":b,S=e.showDiscardIcon,C=void 0===S||S,k=e.showSaveIcon,_=void 0===k||k,O=QW((0,E.useState)(!1),2),P=O[0],T=O[1],A=QW((0,E.useState)(null),2),j=A[0],I=A[1],M=QW((0,E.useState)(!1),2),D=M[0],R=M[1],F=function(){T(!1)};return(0,E.useEffect)((function(){D&&j&&i(j.pathname)}),[D,j]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(on,{when:n,message:function(e){return!(!D&&o(e)&&(T(!0),I(e),1))}}),(0,t.jsx)(YW,{open:P,title:y,text:v,discardButtonText:x,confirmButtonText:w,showDiscardIcon:C,showSaveIcon:_,handleModalClose:F,onClickDiscardButton:function(){c(),T(!1),R(!0)},onClickConfirmButton:p?function(){F(),f()}:function(){s(),T(!1),R(!0)}})]})};var XW,JW=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},eq=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},tq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},nq="video/webm;codecs=vp8,opus",rq="video/webm",iq="webm",oq=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}};!function(e){e.AbortError="media_aborted",e.NotAllowedError="permission_denied",e.NotFoundError="no_specified_media_found",e.NotReadableError="media_in_use",e.OverconstrainedError="invalid_media_constraints",e.TypeError="no_constraints",e.NONE="",e.NO_RECORDER="recorder_error"}(XW||(XW={}));var aq={low:1e6,standard:25e5,high:5e6,ultra:8e6};function sq(e){var t=this,n=e.audio,r=void 0===n||n,i=e.video,o=void 0!==i&&i,a=e.onStop,s=void 0===a?function(){return null}:a,l=e.blobPropertyBag,c=e.screen,u=void 0!==c&&c,f=e.mediaRecorderOptions,d=void 0===f?null:f,p=e.mimeType,h=void 0===p?"":p,y=e.quality,m=void 0===y?"low":y,v=(0,E.useRef)(null),g=(0,E.useRef)([]),x=(0,E.useRef)(null),b=tq((0,E.useState)("idle"),2),w=b[0],S=b[1],C=tq((0,E.useState)(!1),2),k=C[0],_=C[1],O=tq((0,E.useState)(null),2),P=O[0],T=O[1],A=tq((0,E.useState)("NONE"),2),j=A[0],I=A[1],M=(0,E.useRef)(!1),D=aq[m]||aq.low;window.streams||(window.streams=[]),window.streams=window.streams.filter(Boolean);var R=(0,E.useCallback)((function(){return JW(t,void 0,void 0,(function(){var e,t,n,i;return eq(this,(function(a){switch(a.label){case 0:S("acquiring_media"),e={audio:"boolean"==typeof r?!!r:r,video:"boolean"==typeof o?!!o:o},a.label=1;case 1:return a.trys.push([1,8,,9]),u?[4,window.navigator.mediaDevices.getDisplayMedia({video:o||!0})]:[3,5];case 2:return t=a.sent(),window.streams.push(t),t&&r?[4,window.navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})]:[3,4];case 3:n=a.sent(),window.streams.push(n),n.getAudioTracks().forEach((function(e){return t.addTrack(e)})),a.label=4;case 4:return x.current=t,[3,7];case 5:return[4,window.navigator.mediaDevices.getUserMedia(e)];case 6:t=a.sent(),window.streams.push(t),x.current=t,a.label=7;case 7:return M.current?(t&&S("idle"),[3,9]):(oq(t),[2]);case 8:return i=a.sent(),oq(t),oq(n),I(i.name),S("idle"),[3,9];case 9:return[2]}}))}))}),[r,o,u]);(0,E.useEffect)((function(){return M.current=!0,function(){M.current=!1}}),[]),(0,E.useEffect)((function(){if(!window.MediaRecorder)throw new Error("Unsupported Browser");if(u&&!window.navigator.mediaDevices.getDisplayMedia)throw new Error("This browser doesn't support screen capturing");var e=function(e){var t=navigator.mediaDevices.getSupportedConstraints(),n=Object.keys(e).filter((function(e){return!t[e]}));n.length>0&&console.error("The constraints ".concat(n.join(",")," doesn't support on this browser. Please check your ReactMediaRecorder component."))};"object"==typeof r&&e(r),"object"==typeof o&&e(o),d&&d.mimeType&&(MediaRecorder.isTypeSupported(d.mimeType)||console.error("The specified MIME type you supplied for MediaRecorder doesn't support this browser")),x.current||R()}),[r,u,o,R,d]);var F=function(e){var t=e.data;g.current.push(t)},L=function(){var e=tq(g.current,1)[0],t=Object.assign({type:e.type},l||(o?{type:"video/mp4"}:{type:"audio/wav"})),n=new Blob(g.current,t),r=URL.createObjectURL(n);S("stopped"),T(r),s(r,n)},B=function(e){_(e),x.current&&x.current.getAudioTracks().forEach((function(t){return t.enabled=!e}))},N=x.current?new MediaStream(x.current.getVideoTracks()):null;window.streams.push(N);var z=x.current?new MediaStream(x.current.getAudioTracks()):null;return window.streams.push(z),{error:XW[j],muteAudio:function(){return B(!0)},unMuteAudio:function(){return B(!1)},startRecording:function(){return JW(t,void 0,void 0,(function(){return eq(this,(function(e){switch(e.label){case 0:return I("NONE"),x.current?[3,2]:[4,R()];case 1:e.sent(),e.label=2;case 2:return x.current?x.current.getTracks().some((function(e){return"ended"===e.readyState}))?[4,R()]:[3,4]:[3,5];case 3:e.sent(),e.label=4;case 4:v.current=new MediaRecorder(x.current,{mimeType:h,videoBitsPerSecond:D}),v.current.ondataavailable=F,v.current.onstop=L,v.current.onerror=function(){I("NO_RECORDER"),S("idle")},v.current.start(),S("recording"),e.label=5;case 5:return[2]}}))}))},startRecordingForCanvas:function(e){return JW(t,void 0,void 0,(function(){var t;return eq(this,(function(n){switch(n.label){case 0:return e?r?[4,window.navigator.mediaDevices.getUserMedia({audio:r})]:[3,2]:(I("NO_RECORDER"),[2]);case 1:t=n.sent(),window.streams.push(t),t.getAudioTracks().forEach((function(t){return e.addTrack(t)})),n.label=2;case 2:return v.current=new MediaRecorder(e,{mimeType:h,videoBitsPerSecond:D}),v.current.ondataavailable=F,v.current.onstop=L,v.current.onerror=function(){I("NO_RECORDER"),S("idle")},v.current.start(),S("recording"),[2]}}))}))},pauseRecording:function(){v.current&&"recording"===v.current.state&&v.current.pause()},resumeRecording:function(){v.current&&"paused"===v.current.state&&v.current.resume()},stopRecording:function(){v.current&&"inactive"!==v.current.state&&(S("stopping"),v.current.stop(),x.current&&x.current.getTracks().forEach((function(e){return e.stop()})),g.current=[])},mediaBlobUrl:P,status:w,isAudioMuted:k,previewStream:N,previewAudioStream:z,clearBlobUrl:function(){return T(null)}}}var lq=__webpack_require__(6650);let cq=null;const uq=()=>{if(null!==cq)return cq;const e=new Blob(['!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t,timerType:r}}):e.set(t,setTimeout(c,n-o,e,t,n,r))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o,"interval"))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r,"timeout"))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",e=>{let{data:t}=e;try{if("clear"===t.method){const{id:e,params:{timerId:n,timerType:o}}=t;if("interval"===o)Object(r.a)(n),postMessage({error:null,id:e});else{if("timeout"!==o)throw new Error(\'The given type "\'.concat(o,\'" is not supported\'));Object(r.b)(n),postMessage({error:null,id:e})}}else{if("set"!==t.method)throw new Error(\'The given method "\'.concat(t.method,\'" is not supported\'));{const{params:{delay:e,now:n,timerId:o,timerType:i}}=t;if("interval"===i)Object(r.c)(e,o,n);else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));Object(r.d)(e,o,n)}}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}})}]);'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return cq=(e=>{const t=new Map,n=new Map,r=new Map,i=new Worker(e);return i.addEventListener("message",(({data:e})=>{if(void 0!==(i=e).method&&"call"===i.method){const{params:{timerId:i,timerType:o}}=e;if("interval"===o){const e=t.get(i);if("number"==typeof e){const t=r.get(e);if(void 0===t||t.timerId!==i||t.timerType!==o)throw new Error("The timer is in an undefined state.")}else{if(void 0===e)throw new Error("The timer is in an undefined state.");e()}}else if("timeout"===o){const e=n.get(i);if("number"==typeof e){const t=r.get(e);if(void 0===t||t.timerId!==i||t.timerType!==o)throw new Error("The timer is in an undefined state.")}else{if(void 0===e)throw new Error("The timer is in an undefined state.");e(),n.delete(i)}}}else{if(!(e=>null===e.error&&"number"==typeof e.id)(e)){const{error:{message:t}}=e;throw new Error(t)}{const{id:i}=e,o=r.get(i);if(void 0===o)throw new Error("The timer is in an undefined state.");const{timerId:a,timerType:s}=o;r.delete(i),"interval"===s?t.delete(a):n.delete(a)}}var i})),{clearInterval:e=>{const n=(0,lq.generateUniqueNumber)(r);r.set(n,{timerId:e,timerType:"interval"}),t.set(e,n),i.postMessage({id:n,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:e=>{const t=(0,lq.generateUniqueNumber)(r);r.set(t,{timerId:e,timerType:"timeout"}),n.set(e,t),i.postMessage({id:t,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:(e,n)=>{const r=(0,lq.generateUniqueNumber)(t);return t.set(r,(()=>{e(),"function"==typeof t.get(r)&&i.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:r,timerType:"interval"}})})),i.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:r,timerType:"interval"}}),r},setTimeout:(e,t)=>{const r=(0,lq.generateUniqueNumber)(n);return n.set(r,e),i.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:r,timerType:"timeout"}}),r}}})(t),cq.setTimeout((()=>URL.revokeObjectURL(t)),0),cq},fq=e=>uq().clearInterval(e),dq=(e,t)=>uq().setInterval(e,t);var pq,hq,yq,mq,vq,gq,xq,bq,wq,Sq,Cq,Eq,kq,_q,Oq,Pq=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Tq=function(){return Tq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tq.apply(this,arguments)},Aq=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},jq=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Iq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Mq=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Dq=tt.div(hq||(hq=Pq(["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"],["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"])),qi,di,$i),Rq=tt.div(yq||(yq=Pq(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"])),(function(e){return e.theme.primaryColor}),di,(function(e){return e.theme.primaryColor})),Fq=tt.div(mq||(mq=Pq(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),(function(e){return e.theme.primaryColor}),di,(function(e){return e.theme.primaryColor})),Lq=tt.div(vq||(vq=Pq(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),Wi,pi,Zi),Bq=tt.div(gq||(gq=Pq(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-right: auto;\n margin-left: auto;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-right: auto;\n margin-left: auto;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),Nq=tt.div(xq||(xq=Pq(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),zq=tt.div(bq||(bq=Pq(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),qi,di,$i),Vq=tt.div(Sq||(Sq=Pq(["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"],["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(wq||(wq=Pq(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),Uq=tt.div(Cq||(Cq=Pq(["\n width: 150px;\n display: flex;\n flex-direction: row;\n"],["\n width: 150px;\n display: flex;\n flex-direction: row;\n"]))),Hq=tt.div(Eq||(Eq=Pq(["\n margin-left: 5%;\n margin-top: 5%;\n"],["\n margin-left: 5%;\n margin-top: 5%;\n"]))),Gq=tt.div(kq||(kq=Pq(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"]))),Wq=tt.div(_q||(_q=Pq(["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"],["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"]))),qq=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}},$q=null,Zq={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},Yq={videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}},Qq=0,Kq=navigator.mediaDevices.getDisplayMedia,Xq=function(e){var n=e.onRecordingStart,r=e.onRecordingEnd,i=e.onUpload,o=e.uploadDisabled,a=e.onRecordingUrlGeneration;Qq++;var s,l=dn(),c=(0,E.useRef)(null),u=Iq((0,E.useState)(3),2),f=u[0],d=u[1],p=Iq((0,E.useState)(!1),2),h=p[0],y=p[1],v=Iq((0,E.useState)(!1),2),g=v[0],x=v[1],b=Iq((0,E.useState)(!1),2),w=b[0],S=b[1],C=Iq((0,E.useState)(!1),2),k=C[0],_=C[1],O=Iq((0,E.useState)(0),2),P=O[0],T=O[1],A={videoSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(Yq)).videoSource,videoQuality:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(Yq)).videoQuality,audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(Yq)).audioSource},j=Nl().userData;(0,E.useEffect)((function(){if("permission_denied"!==V&&!document.pictureInPictureElement){var e={audio:!1,video:{deviceId:A.videoSource?A.videoSource.value:void 0,width:{ideal:640},height:{ideal:360},frameRate:24}};navigator.mediaDevices.getUserMedia(e).then((function(e){pq=e,window.streams.push(pq),c.current&&(c.current.srcObject=e,c.current.oncanplaythrough=function(){return Aq(void 0,void 0,void 0,(function(){var e;return jq(this,(function(t){switch(t.label){case 0:if(!c.current)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),c.current.play(),[4,c.current.requestPictureInPicture()];case 2:return t.sent(),c.current.oncanplaythrough=null,[3,4];case 3:return e=t.sent(),console.log(e),[3,4];case 4:return[2]}}))}))})})).catch((function(e){console.log("The following error occurred: "+e)}))}}),[]);try{s={deviceId:A.audioSource.value}}catch(e){}A&&A.audioSource&&A.audioSource.value||(s=!1),Qq>1&&(navigator.mediaDevices.getDisplayMedia=function(){});var I=A&&A.videoQuality&&A.videoQuality.value?Zq[A.videoQuality]:Zq.standard,M=sq({screen:!0,video:Tq(Tq({},I),{frameRate:24}),audio:s,quality:A.videoQuality,blobPropertyBag:{type:nq},mimeType:nq}),D=M.status,R=M.startRecording,F=M.stopRecording,L=M.pauseRecording,B=M.resumeRecording,N=M.mediaBlobUrl,z=M.previewStream,V=M.error;z&&(z.getVideoTracks()[0].onended=function(){"recording"===D?G():l.push("/record/home")}),(0,E.useEffect)((function(){return localStorage.setItem(m.recordError,""),A.videoSource&&A.videoSource.value||(localStorage.setItem(m.recordError,"No camera detected. Please check your recording settings and make sure the camera is plugged in."),Qq=0,l.push("/record/home")),function(){Qq=0,navigator.mediaDevices.getDisplayMedia=Kq,Z()}}),[]),(0,E.useEffect)((function(){"permission_denied"===V&&(localStorage.setItem(m.recordError,"Please allow access to share your screen then try again."),Z(),Qq=0,navigator.mediaDevices.getDisplayMedia=Kq,l.push("/record/home"))}),[V]),(0,E.useEffect)((function(){k||w||!z||N||h||H()}),[z]),(0,E.useEffect)((function(){N&&a(N)}),[N]),(0,E.useEffect)((function(){var e=dq((function(){!h||g||f||T(P+1)}),1e3);return function(){fq(e)}})),(0,E.useEffect)((function(){var e,t,n,r,i;j&&j.authCalled&&(null===(e=j.user)||void 0===e?void 0:e.packageDetails)&&(null===(n=null===(t=j.user)||void 0===t?void 0:t.packageDetails)||void 0===n?void 0:n.maxLength)&&P>=(null===(i=null===(r=j.user)||void 0===r?void 0:r.packageDetails)||void 0===i?void 0:i.maxLength)&&G()}),[P,j,j.authCalled]);var U=function(){h&&f>0&&(S(!0),clearTimeout($q),y(!1),d(3))},H=function(){S(!1),y(!0)},G=function(){_(!0),r&&r(),y(!1),document.pictureInPictureElement&&document.exitPictureInPicture();try{Mq([],Iq(window.streams),!1).filter(Boolean).forEach((function(e){return qq(e)})),window.streams=[]}catch(e){}F()},W=function(){L(),x(!0)},q=function(){B(),x(!1)},$=function(){return Aq(void 0,void 0,void 0,(function(){var e;return jq(this,(function(t){switch(t.label){case 0:return[4,fetch(N||"").then((function(e){return e.blob()}))];case 1:return e=t.sent(),Z(),i({file:e,fileUrl:N}),[2]}}))}))};(0,E.useEffect)((function(){f>0&&h?$q=setTimeout((function(){return d(f-1)}),1e3):h&&(n&&n(),R())}),[h,f]);var Z=function(){Mq([],Iq(window.streams),!1).filter(Boolean).forEach((function(e){return qq(e)})),window.streams=[],y(!1),$q&&clearTimeout($q),Y()},Y=function(){document.pictureInPictureElement&&document.exitPictureInPicture()},Q=(0,E.useMemo)((function(){return(0,t.jsxs)(t.Fragment,{children:[!N&&(0,t.jsx)("iframe",Tq({title:"videoFrame",style:{display:"none"}},{children:(0,t.jsx)("video",{muted:!0,style:{display:"none"},ref:c,width:0,height:0,autoPlay:!0})})),(0,t.jsxs)(Vq,{children:["recording"===D&&(0,t.jsxs)(Uq,{children:[!g&&(0,t.jsx)(Nq,Tq({onClick:W},{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(AV,{}),textColor:"#000",text:"Pause",onClick:W})})),g&&(0,t.jsx)(zq,Tq({onClick:q},{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(Rc,{color:di,size:34}),textColor:"#fff",text:"Resume",onClick:q})})),(0,t.jsx)(Hq,{children:St(P,0)})]}),"recording"===D&&(0,t.jsx)(Rq,{children:(0,t.jsx)(yo,{backgroundColor:Qi,icon:(0,t.jsx)(NV,{}),textColor:"#fff",text:"Finish",onClick:G})}),h&&"recording"!==D&&(0,t.jsx)(Bq,Tq({onClick:U},{children:(0,t.jsx)(yo,{backgroundColor:Wi,textColor:"#000",text:"Cancel",onClick:U})})),!h&&"idle"===D&&(0,t.jsx)(Dq,{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(kW,{width:24,height:24,opacity:1}),text:"Start recording",textColor:"#fff",onClick:H})}),"stopped"===D&&(0,t.jsx)(Lq,{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(MW,{height:20,width:20,color:pi}),textColor:"#000",text:"Discard",onClick:function(){return l.push("/record/home")}})}),"stopped"===D&&(0,t.jsx)(Fq,{children:(0,t.jsx)(yo,{disabled:o,backgroundColor:"var(--secondary)",icon:(0,t.jsx)(TW,{height:20,width:20,color:di}),textColor:"#fff",text:"Save Recording",onClick:$})})]})]})}),[D,P,h,g,N,o]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){return l.push(e)},shouldBlockNavigation:function(e){return"recording"===D},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,t.jsxs)(Gq,{children:[(0,t.jsx)(Wq,{children:(0,t.jsx)(Cu,{counter:f,willStart:f>0&&h,onClick:function(){},hide:!f})}),Q]})]})},Jq=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},e$=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},t$=_n,n$=Pn,r$={all:[],user:[]},i$=function(e){var t=e.page,n=void 0===t?0:t,r=e.size,i=void 0===r?50:r,o=e.search,a=void 0===o?"":o,s=e.all,l=void 0!==s&&s,c=e.sort,u=e.refresh,f=void 0===u||u;return Jq(void 0,void 0,void 0,(function(){var e,t,r,o,s,u;return e$(this,(function(d){switch(d.label){case 0:if(e=S.bearerToken,t={start:n*i,limit:i,search:a,sort:c,all:""},l&&(t.all="true"),!f){if(l&&(null===(s=null==r$?void 0:r$.all)||void 0===s?void 0:s.length))return[2,r$.all];if(!l&&(null===(u=null==r$?void 0:r$.user)||void 0===u?void 0:u.length))return[2,r$.user]}return[4,Tn({url:"/video-tags",baseURL:b,method:t$,headers:e,params:t}).catch((function(e){return console.log(e)}))];case 1:if((r=d.sent())instanceof Error)throw o=r.message,new Error(o);return l?r$.all=r:r$.user=r,[2,r]}}))}))},o$=function(e,t){return Jq(void 0,void 0,void 0,(function(){var n,r,i,o,a;return e$(this,(function(s){switch(s.label){case 0:return n=S.bearerToken,r={url:"/videos/".concat(e,"/video-tags"),baseURL:b,method:n$,headers:n,data:t},[4,Tn(r).catch((function(e){return e}))];case 1:if((i=s.sent())instanceof Error)throw o=JSON.parse(i.message),a=o.message,new Error(a);return[2,{videoTags:i}]}}))}))};function a$(){return a$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a$.apply(this,arguments)}const s$=tt((function(e){return E.createElement("svg",a$({width:16,height:14,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Oq||(Oq=E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5833 0.333252C13.1333 0.333252 13.6 0.683252 13.7667 1.17492L15.4083 5.89992C15.4667 6.07492 15.5 6.26659 15.5 6.44992V12.4166C15.5 13.1083 14.9333 13.6666 14.25 13.6666C13.5583 13.6666 13 13.0999 13 12.4166V11.9999H3V12.4166C3 13.1083 2.44167 13.6666 1.75 13.6666C1.05833 13.6666 0.5 13.1083 0.5 12.4166V6.44992C0.5 6.25825 0.533333 6.07492 0.591667 5.89992L2.23333 1.17492C2.40833 0.683252 2.86667 0.333252 3.41667 0.333252H12.5833ZM2.16667 8.24992C2.16667 8.94159 2.725 9.49992 3.41667 9.49992C4.10833 9.49992 4.66667 8.94159 4.66667 8.24992C4.66667 7.55825 4.10833 6.99992 3.41667 6.99992C2.725 6.99992 2.16667 7.55825 2.16667 8.24992ZM12.5833 9.49992C11.8917 9.49992 11.3333 8.94159 11.3333 8.24992C11.3333 7.55825 11.8917 6.99992 12.5833 6.99992C13.275 6.99992 13.8333 7.55825 13.8333 8.24992C13.8333 8.94159 13.275 9.49992 12.5833 9.49992ZM3.225 2.14992L2.16667 5.33325H13.8333L12.775 2.14992C12.6583 1.81659 12.3417 1.58325 11.9833 1.58325H4.01667C3.65833 1.58325 3.34167 1.81659 3.225 2.14992Z",fill:"#001B53",fillOpacity:.4})))}))(l$||(l$=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var l$,c$;function u$(){return u$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u$.apply(this,arguments)}const f$=tt((function(e){return E.createElement("svg",u$({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c$||(c$=E.createElement("g",null,E.createElement("path",{d:"M11.3327 3.99935C11.3327 3.63268 11.0327 3.33268 10.666 3.33268H8.66602V1.33268C8.66602 0.966016 8.36602 0.666016 7.99935 0.666016C7.63268 0.666016 7.33268 0.966016 7.33268 1.33268V3.33268H4.66602V1.33268C4.66602 0.966016 4.36602 0.666016 3.99935 0.666016C3.63268 0.666016 3.33268 0.966016 3.33268 1.33268V3.33268H1.33268C0.966016 3.33268 0.666016 3.63268 0.666016 3.99935C0.666016 4.36602 0.966016 4.66602 1.33268 4.66602H3.33268V7.33268H1.33268C0.966016 7.33268 0.666016 7.63268 0.666016 7.99935C0.666016 8.36602 0.966016 8.66602 1.33268 8.66602H3.33268V10.666C3.33268 11.0327 3.63268 11.3327 3.99935 11.3327C4.36602 11.3327 4.66602 11.0327 4.66602 10.666V8.66602H7.33268V10.666C7.33268 11.0327 7.63268 11.3327 7.99935 11.3327C8.36602 11.3327 8.66602 11.0327 8.66602 10.666V8.66602H10.666C11.0327 8.66602 11.3327 8.36602 11.3327 7.99935C11.3327 7.63268 11.0327 7.33268 10.666 7.33268H8.66602V4.66602H10.666C11.0327 4.66602 11.3327 4.36602 11.3327 3.99935ZM7.33268 7.33268H4.66602V4.66602H7.33268V7.33268Z",fill:"#001B53"}))))}))(d$||(d$=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n fill-opacity: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n fill-opacity: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"14px"}),(function(e){return e.height||"14px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"currentColor"}),(function(e){return e.opacity||"inherit"}));var d$,p$={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function h$(e){if("number"==typeof e)return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();t=n.includes(".")?parseFloat(n):parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return p$[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function y$(e){var t=h$(e);return"".concat(t.value).concat(t.unit)}var m$=function(){return m$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},m$.apply(this,arguments)},v$=function(e,t,n){var r="react-spinners-".concat("MoonLoader","-").concat("moon");if("undefined"==typeof window||!window.document)return r;var i=document.createElement("style");document.head.appendChild(i);var o=i.sheet,a="\n @keyframes ".concat(r," {\n ").concat("100% {transform: rotate(360deg)}","\n }\n ");return o&&o.insertRule(a,0),r}();const g$=function(e){var t=e.loading,n=void 0===t||t,r=e.color,i=void 0===r?"#000000":r,o=e.speedMultiplier,a=void 0===o?1:o,s=e.cssOverride,l=void 0===s?{}:s,c=e.size,u=void 0===c?60:c,f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["loading","color","speedMultiplier","cssOverride","size"]),d=h$(u),p=d.value,h=d.unit,y=p/7,m=m$({display:"inherit",position:"relative",width:"".concat("".concat(p+2*y).concat(h)),height:"".concat("".concat(p+2*y).concat(h)),animation:"".concat(v$," ").concat(.6/a,"s 0s infinite linear"),animationFillMode:"forwards"},l),v=function(e){return{width:y$(e),height:y$(e),borderRadius:"100%"}},g=m$(m$({},v(y)),{backgroundColor:"".concat(i),opacity:"0.8",position:"absolute",top:"".concat("".concat(p/2-y/2).concat(h)),animation:"".concat(v$," ").concat(.6/a,"s 0s infinite linear"),animationFillMode:"forwards"}),x=m$(m$({},v(p)),{border:"".concat(y,"px solid ").concat(i),opacity:"0.1",boxSizing:"content-box",position:"absolute"});return n?E.createElement("span",m$({style:m},f),E.createElement("span",{style:g}),E.createElement("span",{style:x})):null};var x$,b$=__webpack_require__(1394),w$=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},S$=function(){return S$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},S$.apply(this,arguments)},C$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},E$=tt.div(M$||(M$=w$(["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"],["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"]))),k$=tt.div(D$||(D$=w$(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),_$=tt.div(R$||(R$=w$(["\n display: flex;\n flex-direction: column;\n position: relative;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n span {\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ",";\n margin-bottom: 8px;\n }\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n background-color: ",";\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n background-color: #f6f7f9;\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n }\n"],["\n display: flex;\n flex-direction: column;\n position: relative;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n span {\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ",";\n margin-bottom: 8px;\n }\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n background-color: ",";\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n background-color: #f6f7f9;\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n }\n"])),(function(e){return e.isActive?pi:"rgba(39, 42, 50, 0.4)"}),(function(e){return e.theme.primaryColor})),O$=tt.div(F$||(F$=w$(["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"],["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"])),ai,"15px",Yi),P$=tt.progress(L$||(L$=w$(["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"],["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"])),Wi,Wi,(function(e){return e.color}),(function(e){return e.color})),T$=tt.div(B$||(B$=w$(["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"],["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"]))),A$=tt.div(N$||(N$=w$(["\n position: absolute;\n top: 30px;\n"],["\n position: absolute;\n top: 30px;\n"]))),j$={width:"24px",zIndex:2,backgroundColor:"f6f7f9"};!function(e){e[e.UPLOADING=1]="UPLOADING",e[e.CREATE=2]="CREATE",e[e.ENCODE=3]="ENCODE"}(x$||(x$={}));const I$=function(e){var n=e.title,r=e.beginUploadProcess,i=e.afterUpload,o=e.setSavedVideoId,a=e.file,s=e.fileName,l=Nl().userData,c=C$((0,E.useState)(x$.UPLOADING),2),u=c[0],f=c[1],d=C$((0,E.useState)({loaded:0,total:0,percentage:0}),2),p=d[0],h=d[1],y=ML(),m=y.presignedUrl,v=y.fetch,g=y.loading,x=y.error,b=HL(),w=b.uploadVideo,S=b.loading,C=b.data,k=b.error,_=jL(),O=_.fetch,P=_.loading,T=_.videoData,A=_.error,j=_.progress,I=IL(),M=I.fetch,D=I.loading,R=I.encodeData,F=I.error,L=I.progress;(0,E.useEffect)((function(){if(r){if(m&&m.url||!n)return;e=void 0,t=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){return a&&v({fileName:s,type:rq}),[2]}))},new((i=void 0)||(i=Promise))((function(n,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}var e,t,i,o}),[r]),(0,E.useEffect)((function(){m&&(g||x||!a||(f(x$.UPLOADING),w({url:m.url,file:a,contentType:rq,onUploadProgress:B})))}),[m]),(0,E.useEffect)((function(){!S&&!k&&C&&a&&(f(x$.CREATE),O({filename:s,title:n}))}),[S,C]),(0,E.useEffect)((function(){!P&&!A&&T&&a&&(f(x$.ENCODE),o(T.video_id),M({videoId:T.video_id,customerId:l.customerId}))}),[P,T]),(0,E.useEffect)((function(){!D&&!F&&R&&a&&i&&i()}),[D,R]);var B=function(e){var t=Math.round(100*e.loaded/e.total);h({loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:t})},N=function(e){return(e/1e3).toFixed(2)};return(0,t.jsx)(O$,{children:(0,t.jsxs)(E$,{children:[(0,t.jsxs)(k$,{children:[(0,t.jsxs)(_$,S$({isActive:S},{children:[(0,t.jsx)("span",{children:S?"Uploading":"Uploaded"}),p.percentage<100&&(0,t.jsx)(A$,{children:(0,t.jsx)(g$,{size:19.5,color:Ti,loading:!0})}),(!p.percentage||100===p.percentage)&&(0,t.jsx)(b$.Cd,{style:j$,percent:0,trailWidth:10,strokeWidth:10,strokeColor:Ti})]})),(0,t.jsxs)(_$,S$({isActive:P},{children:[(0,t.jsx)("span",{children:P?"Creating":"Created"}),j<100&&(0,t.jsx)(A$,{children:(0,t.jsx)(g$,{size:19.5,color:Ti,loading:!0})}),(!j||100===j)&&(0,t.jsx)(b$.Cd,{style:j$,percent:0,trailWidth:10,strokeWidth:10,strokeColor:Ti})]})),(0,t.jsxs)(_$,S$({isActive:D},{children:[(0,t.jsx)("span",{children:D?"Encoding":"Encoded"}),L<100&&(0,t.jsx)(A$,{children:(0,t.jsx)(g$,{size:19.5,color:Ti,loading:!0})}),(!L||100===L)&&(0,t.jsx)(b$.Cd,{style:j$,percent:0,trailWidth:10,strokeWidth:10,strokeColor:Ti})]}))]}),(0,t.jsx)(P$,{value:u?u==x$.UPLOADING?50*p.percentage/100:u==x$.CREATE?50+(j||0):100:0,max:100,color:Ti}),(0,t.jsx)(T$,{children:N(p.loaded)+" MB/"+N(p.total)+" MB"})]})})};var M$,D$,R$,F$,L$,B$,N$,z$=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===V$}(e)}(e)},V$="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function U$(e,t){return!1!==t.clone&&t.isMergeableObject(e)?G$((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function H$(e,t,n){return e.concat(t).map((function(e){return U$(e,n)}))}function G$(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||H$,n.isMergeableObject=n.isMergeableObject||z$;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=U$(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=G$(e[i],t[i],n):r[i]=U$(t[i],n)})),r}(e,t,n):U$(t,n)}G$.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return G$(e,n,t)}),{})};const W$=G$;var q$=__webpack_require__(9590),$$=__webpack_require__.n(q$);const Z$=function(e,t){};function Y$(){return Y$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y$.apply(this,arguments)}function Q$(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function K$(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var X$=(0,E.createContext)(void 0);X$.displayName="FormikContext";var J$=X$.Provider;function eZ(){var e=(0,E.useContext)(X$);return e||Z$(!1),e}X$.Consumer;var tZ=function(e){return Array.isArray(e)&&0===e.length},nZ=function(e){return"function"==typeof e},rZ=function(e){return null!==e&&"object"==typeof e},iZ=function(e){return String(Math.floor(Number(e)))===e},oZ=function(e){return"[object String]"===Object.prototype.toString.call(e)},aZ=function(e){return 0===E.Children.count(e)},sZ=function(e){return rZ(e)&&nZ(e.then)};function lZ(e,t,n,r){void 0===r&&(r=0);for(var i=l_(t);e&&r<i.length;)e=e[i[r++]];return r===i.length||e?void 0===e?n:e:n}function cZ(e,t,n){for(var r=sS(e),i=r,o=0,a=l_(t);o<a.length-1;o++){var s=a[o],l=lZ(e,a.slice(0,o+1));if(l&&(rZ(l)||Array.isArray(l)))i=i[s]=sS(l);else{var c=a[o+1];i=i[s]=iZ(c)&&Number(c)>=0?[]:{}}}return(0===o?e:i)[a[o]]===n?e:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function uZ(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],s=e[a];rZ(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},uZ(s,t,n,r[a])):r[a]=t}return r}var fZ={},dZ={};function pZ(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,o=e.validateOnMount,a=void 0!==o&&o,s=e.isInitialValid,l=e.enableReinitialize,c=void 0!==l&&l,u=e.onSubmit,f=Q$(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),d=Y$({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:u},f),p=(0,E.useRef)(d.initialValues),h=(0,E.useRef)(d.initialErrors||fZ),y=(0,E.useRef)(d.initialTouched||dZ),m=(0,E.useRef)(d.initialStatus),v=(0,E.useRef)(!1),g=(0,E.useRef)({});(0,E.useEffect)((function(){return v.current=!0,function(){v.current=!1}}),[]);var x=(0,E.useState)(0)[1],b=(0,E.useRef)({values:d.initialValues,errors:d.initialErrors||fZ,touched:d.initialTouched||dZ,status:d.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),w=b.current,S=(0,E.useCallback)((function(e){var t=b.current;b.current=function(e,t){switch(t.type){case"SET_VALUES":return Y$({},e,{values:t.payload});case"SET_TOUCHED":return Y$({},e,{touched:t.payload});case"SET_ERRORS":return $$()(e.errors,t.payload)?e:Y$({},e,{errors:t.payload});case"SET_STATUS":return Y$({},e,{status:t.payload});case"SET_ISSUBMITTING":return Y$({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Y$({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Y$({},e,{values:cZ(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Y$({},e,{touched:cZ(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Y$({},e,{errors:cZ(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Y$({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Y$({},e,{touched:uZ(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Y$({},e,{isSubmitting:!1});default:return e}}(t,e),t!==b.current&&x((function(e){return e+1}))}),[]),C=(0,E.useCallback)((function(e,t){return new Promise((function(n,r){var i=d.validate(e,t);null==i?n(fZ):sZ(i)?i.then((function(e){n(e||fZ)}),(function(e){r(e)})):n(i)}))}),[d.validate]),k=(0,E.useCallback)((function(e,t){var n=d.validationSchema,r=nZ(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);var i=yZ(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}(e,r);return new Promise((function(e,t){i.then((function(){e(fZ)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return cZ(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;lZ(t,a.path)||(t=cZ(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[d.validationSchema]),_=(0,E.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),O=(0,E.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return nZ(g.current[e].validate)})),n=t.length>0?t.map((function(t){return _(t,lZ(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=cZ(e,t[r],n)),e}),{})}))}),[_]),P=(0,E.useCallback)((function(e){return Promise.all([O(e),d.validationSchema?k(e):{},d.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return W$.all([t,n,r],{arrayMerge:mZ})}))}),[d.validate,d.validationSchema,O,C,k]),T=gZ((function(e){return void 0===e&&(e=w.values),S({type:"SET_ISVALIDATING",payload:!0}),P(e).then((function(e){return v.current&&(S({type:"SET_ISVALIDATING",payload:!1}),S({type:"SET_ERRORS",payload:e})),e}))}));(0,E.useEffect)((function(){a&&!0===v.current&&$$()(p.current,d.initialValues)&&T(p.current)}),[a,T]);var A=(0,E.useCallback)((function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:h.current?h.current:d.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:d.initialTouched||{},i=e&&e.status?e.status:m.current?m.current:d.initialStatus;p.current=t,h.current=n,y.current=r,m.current=i;var o=function(){S({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(d.onReset){var a=d.onReset(w.values,Y);sZ(a)?a.then(o):o()}else o()}),[d.initialErrors,d.initialStatus,d.initialTouched,d.onReset]);(0,E.useEffect)((function(){!0!==v.current||$$()(p.current,d.initialValues)||c&&(p.current=d.initialValues,A(),a&&T(p.current))}),[c,d.initialValues,A,a,T]),(0,E.useEffect)((function(){c&&!0===v.current&&!$$()(h.current,d.initialErrors)&&(h.current=d.initialErrors||fZ,S({type:"SET_ERRORS",payload:d.initialErrors||fZ}))}),[c,d.initialErrors]),(0,E.useEffect)((function(){c&&!0===v.current&&!$$()(y.current,d.initialTouched)&&(y.current=d.initialTouched||dZ,S({type:"SET_TOUCHED",payload:d.initialTouched||dZ}))}),[c,d.initialTouched]),(0,E.useEffect)((function(){c&&!0===v.current&&!$$()(m.current,d.initialStatus)&&(m.current=d.initialStatus,S({type:"SET_STATUS",payload:d.initialStatus}))}),[c,d.initialStatus,d.initialTouched]);var j=gZ((function(e){if(g.current[e]&&nZ(g.current[e].validate)){var t=lZ(w.values,e),n=g.current[e].validate(t);return sZ(n)?(S({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){S({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),S({type:"SET_ISVALIDATING",payload:!1})}))):(S({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return d.validationSchema?(S({type:"SET_ISVALIDATING",payload:!0}),k(w.values,e).then((function(e){return e})).then((function(t){S({type:"SET_FIELD_ERROR",payload:{field:e,value:lZ(t,e)}}),S({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),I=(0,E.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),M=(0,E.useCallback)((function(e){delete g.current[e]}),[]),D=gZ((function(e,t){return S({type:"SET_TOUCHED",payload:e}),(void 0===t?i:t)?T(w.values):Promise.resolve()})),R=(0,E.useCallback)((function(e){S({type:"SET_ERRORS",payload:e})}),[]),F=gZ((function(e,t){var r=nZ(e)?e(w.values):e;return S({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?T(r):Promise.resolve()})),L=(0,E.useCallback)((function(e,t){S({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),B=gZ((function(e,t,r){return S({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?T(cZ(w.values,e,t)):Promise.resolve()})),N=(0,E.useCallback)((function(e,t){var n,r=t,i=e;if(!oZ(e)){e.persist&&e.persist();var o=e.target?e.target:e.currentTarget,a=o.type,s=o.name,l=o.id,c=o.value,u=o.checked,f=(o.outerHTML,o.options),d=o.multiple;r=t||s||l,i=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,i=(o=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}(lZ(w.values,r),u,c):f&&d?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):c}r&&B(r,i)}),[B,w.values]),z=gZ((function(e){if(oZ(e))return function(t){return N(t,e)};N(e)})),V=gZ((function(e,t,n){return void 0===t&&(t=!0),S({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?i:n)?T(w.values):Promise.resolve()})),U=(0,E.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,o=(n.outerHTML,t||r||i);V(o,!0)}),[V]),H=gZ((function(e){if(oZ(e))return function(t){return U(t,e)};U(e)})),G=(0,E.useCallback)((function(e){nZ(e)?S({type:"SET_FORMIK_STATE",payload:e}):S({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),W=(0,E.useCallback)((function(e){S({type:"SET_STATUS",payload:e})}),[]),q=(0,E.useCallback)((function(e){S({type:"SET_ISSUBMITTING",payload:e})}),[]),$=gZ((function(){return S({type:"SUBMIT_ATTEMPT"}),T().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Q()))return}catch(e){throw e}return Promise.resolve(n).then((function(e){return v.current&&S({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(v.current)throw S({type:"SUBMIT_FAILURE"}),e}))}if(v.current&&(S({type:"SUBMIT_FAILURE"}),t))throw e}))})),Z=gZ((function(e){e&&e.preventDefault&&nZ(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&nZ(e.stopPropagation)&&e.stopPropagation(),$().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:A,validateForm:T,validateField:j,setErrors:R,setFieldError:L,setFieldTouched:V,setFieldValue:B,setStatus:W,setSubmitting:q,setTouched:D,setValues:F,setFormikState:G,submitForm:$},Q=gZ((function(){return u(w.values,Y)})),K=gZ((function(e){e&&e.preventDefault&&nZ(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&nZ(e.stopPropagation)&&e.stopPropagation(),A()})),X=(0,E.useCallback)((function(e){return{value:lZ(w.values,e),error:lZ(w.errors,e),touched:!!lZ(w.touched,e),initialValue:lZ(p.current,e),initialTouched:!!lZ(y.current,e),initialError:lZ(h.current,e)}}),[w.errors,w.touched,w.values]),J=(0,E.useCallback)((function(e){return{setValue:function(t,n){return B(e,t,n)},setTouched:function(t,n){return V(e,t,n)},setError:function(t){return L(e,t)}}}),[B,V,L]),ee=(0,E.useCallback)((function(e){var t=rZ(e),n=t?e.name:e,r=lZ(w.values,n),i={name:n,value:r,onChange:z,onBlur:H};if(t){var o=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===s&&l&&(i.value=i.value||[],i.multiple=!0)}return i}),[H,z,w.values]),te=(0,E.useMemo)((function(){return!$$()(p.current,w.values)}),[p.current,w.values]),ne=(0,E.useMemo)((function(){return void 0!==s?te?w.errors&&0===Object.keys(w.errors).length:!1!==s&&nZ(s)?s(d):s:w.errors&&0===Object.keys(w.errors).length}),[s,te,w.errors,d]);return Y$({},w,{initialValues:p.current,initialErrors:h.current,initialTouched:y.current,initialStatus:m.current,handleBlur:H,handleChange:z,handleReset:K,handleSubmit:Z,resetForm:A,setErrors:R,setFormikState:G,setFieldTouched:V,setFieldValue:B,setFieldError:L,setStatus:W,setSubmitting:q,setTouched:D,setValues:F,submitForm:$,validateForm:T,validateField:j,isValid:ne,dirty:te,unregisterField:M,registerField:I,getFieldProps:ee,getFieldMeta:X,getFieldHelpers:J,validateOnBlur:i,validateOnChange:n,validateOnMount:a})}function hZ(e){var t=pZ(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return(0,E.useImperativeHandle)(o,(function(){return t})),(0,E.createElement)(J$,{value:t},n?(0,E.createElement)(n,t):i?i(t):r?nZ(r)?r(t):aZ(r)?null:E.Children.only(r):null)}function yZ(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||CS(e)?yZ(e):""!==e?e:void 0})):CS(e[r])?t[r]=yZ(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function mZ(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var o=!1!==n.clone&&n.isMergeableObject(t);r[i]=o?W$(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=W$(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var vZ="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect;function gZ(e){var t=(0,E.useRef)(e);return vZ((function(){t.current=e})),(0,E.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function xZ(e){var t=e.validate,n=e.name,r=e.render,i=e.children,o=e.as,a=e.component,s=e.className,l=Q$(e,["validate","name","render","children","as","component","className"]),c=Q$(eZ(),["validate","validationSchema"]),u=c.registerField,f=c.unregisterField;(0,E.useEffect)((function(){return u(n,{validate:t}),function(){f(n)}}),[u,f,n,t]);var d=c.getFieldProps(Y$({name:n},l)),p=c.getFieldMeta(n),h={field:d,form:c};if(r)return r(Y$({},h,{meta:p}));if(nZ(i))return i(Y$({},h,{meta:p}));if(a){if("string"==typeof a){var y=l.innerRef,m=Q$(l,["innerRef"]);return(0,E.createElement)(a,Y$({ref:y},d,m,{className:s}),i)}return(0,E.createElement)(a,Y$({field:d,form:c},l,{className:s}),i)}var v=o||"input";if("string"==typeof v){var g=l.innerRef,x=Q$(l,["innerRef"]);return(0,E.createElement)(v,Y$({ref:g},d,x,{className:s}),i)}return(0,E.createElement)(v,Y$({},d,l,{className:s}),i)}var bZ=(0,E.forwardRef)((function(e,t){var n=e.action,r=Q$(e,["action"]),i=null!=n?n:"#",o=eZ(),a=o.handleReset,s=o.handleSubmit;return(0,E.createElement)("form",Y$({onSubmit:s,ref:t,onReset:a,action:i},r))}));bZ.displayName="Form";var wZ=function(e,t,n){var r=SZ(e);return r.splice(t,0,n),r},SZ=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Y$({},e,{length:t+1}))}return[]},CZ=function(e,t){var n="function"==typeof e?e:t;return function(e){if(Array.isArray(e)||rZ(e)){var t=SZ(e);return n(t)}return e}},EZ=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,o=i.name;(0,i.formik.setFormikState)((function(n){var i=CZ(r,e),a=CZ(t,e),s=cZ(n.values,o,e(lZ(n.values,o))),l=r?i(lZ(n.errors,o)):void 0,c=t?a(lZ(n.touched,o)):void 0;return tZ(l)&&(l=void 0),tZ(c)&&(c=void 0),Y$({},n,{values:s,errors:r?cZ(n.errors,o,l):n.errors,touched:t?cZ(n.touched,o,c):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(SZ(t),[lS(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=SZ(e),i=r[t];return r[t]=r[n],r[n]=i,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=SZ(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return wZ(n,e,t)}),(function(t){return wZ(t,e,null)}),(function(t){return wZ(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=SZ(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t=r.length,r}),(function(e){return e?[null].concat(e):[null]}),(function(e){return e?[null].concat(e):[null]})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(K$(n)),n.pop=n.pop.bind(K$(n)),n}var n,r;r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var i=t.prototype;return i.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!$$()(lZ(e.formik.values,e.name),lZ(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},i.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?SZ(n):[];return t||(t=r[e]),nZ(r.splice)&&r.splice(e,1),nZ(r.every)&&r.every((function(e){return void 0===e}))?[]:r}),!0,!0),t},i.pop=function(){var e;return this.updateArrayField((function(t){var n=t.slice();return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},i.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,o=t.name,a=Y$({},e,{form:Q$(t.formik,["validate","validationSchema"]),name:o});return n?(0,E.createElement)(n,a):r?r(a):i?"function"==typeof i?i(a):aZ(i)?null:E.Children.only(i):null},t}(E.Component);EZ.defaultProps={validateOnChange:!0};var kZ,_Z,OZ,PZ,TZ,AZ,jZ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},IZ=function(){return IZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},IZ.apply(this,arguments)},MZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},DZ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},RZ=tt.div(kZ||(kZ=jZ(["\n width: auto;\n margin-top: 8px;\n .error {\n border-color: #e84c3d;\n }\n .disabled {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n\n .disabled > div {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n"],["\n width: auto;\n margin-top: 8px;\n .error {\n border-color: #e84c3d;\n }\n .disabled {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n\n .disabled > div {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n"]))),FZ=tt.div(_Z||(_Z=jZ(["\n margin: 24px 0;\n display: flex;\n flex-direction: column;\n"],["\n margin: 24px 0;\n display: flex;\n flex-direction: column;\n"]))),LZ=tt.div(OZ||(OZ=jZ(["\n height: 20px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: normal;\n color: ",";\n margin-bottom: 8px;\n"],["\n height: 20px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: normal;\n color: ",";\n margin-bottom: 8px;\n"])),Gi),BZ=tt.input(PZ||(PZ=jZ(["\n padding-left: 8px;\n height: 40px;\n width: 100%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n margin-right: 8px;\n box-sizing: border-box;\n &:focus {\n outline: 0;\n }\n"],["\n padding-left: 8px;\n height: 40px;\n width: 100%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n margin-right: 8px;\n box-sizing: border-box;\n &:focus {\n outline: 0;\n }\n"])),pi),NZ=tt.textarea(AZ||(AZ=jZ(["\n padding-left: 8px;\n width: 242px;\n min-width: 242px;\n max-width: 242px;\n height: 100px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: 0;\n }\n ","\n"],["\n padding-left: 8px;\n width: 242px;\n min-width: 242px;\n max-width: 242px;\n height: 100px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: 0;\n }\n ","\n"])),(function(e){return e.theme.containerWidth>=ii&&Ne(TZ||(TZ=jZ(["\n width: 368px;\n min-width: 368px;\n max-width: 368px;\n "],["\n width: 368px;\n min-width: 368px;\n max-width: 368px;\n "])))})),zZ=function(e){var n=e.attributes,r=e.initValues,i=e.setIsSaveDisabled,o=Nl().userData,a=Xl(o),s=Jl(o),l=ec(o),c=function(e){var t=e.customer,n=e.automotiveRole;return"1"===t.automotiveAccess&&n===Dl.TECHNICIAN}(o),u=MZ(E.useState(),2),f=u[0],d=u[1],p=eZ(),h=p.errors,y=p.validateForm,m=p.setFieldValue;E.useEffect((function(){y(),v()}),[n]),E.useEffect((function(){0!==(null==f?void 0:f.length)?i(!0):i(!1)}),[f]);var v=function(){var e=0,t=[];return n.forEach((function(n){n&&n.isRequired&&(""===n.default||null===n.default)&&(++e,t.push(n))})),d(t),l&&c&&(e+=1),s&&c&&(e+=2),e},g=function(e,t){if(""!==e&&t.isRequired){var n=f.find((function(e){return e.attributeId===t.attributeId}));n&&d(f.filter((function(e){return e.attributeId!==t.attributeId})))}""===e&&t.isRequired&&!(n=f.find((function(e){return e.attributeId===t.attributeId})))&&d(DZ(DZ([],MZ(f),!1),[t],!1))};return a||n.length?(0,t.jsx)(RZ,{children:n.map((function(e,n){var i=!(!e.isReadOnly&&!e.isLocked||!r[n]),o=!!h["attributes".concat(n)],a=!!e.isRequired,s="";return i&&(s="disabled"),o&&(s+=" error"),(0,t.jsxs)(FZ,{children:[(0,t.jsxs)(LZ,{children:[e.title,a&&(0,t.jsx)("span",IZ({style:{color:Qi}},{children:"*"}))]}),"text"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(xZ,{name:"attributes".concat(n),disabled:i,as:BZ,type:"text",required:a,className:s,defaultValue:e.default,onChange:function(t){g(t.target.value,e),m("attributes".concat(n),t.target.value)},onFocus:function(){y()}}),o?(0,t.jsx)("div",IZ({style:{color:"#E84C3D",marginTop:"3px"}},{children:h["attributes".concat(n)]})):(0,t.jsx)(t.Fragment,{})]}),"textarea"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(xZ,{disabled:i,name:"attributes".concat(n),as:NZ,defaultValue:e.default,className:s,required:a,type:"text",onChange:function(t){g(t.target.value,e),m("attributes".concat(n),t.target.value)}}),o?(0,t.jsx)("div",IZ({style:{color:"#E84C3D",marginTop:"3px"}},{children:h["attributes".concat(n)]})):(0,t.jsx)(t.Fragment,{})]}),"dropdown"===e.type&&(0,t.jsx)(xZ,IZ({name:"attributes".concat(n),disabled:i,required:a,className:s},{children:function(o){var a=o.field,s=o.form,l=a.value,c=e.dropdownValues.map((function(e){return{value:e.value,label:e.value}}));return(0,t.jsx)(bl,{isSearchable:!0,disabled:i,maxMenuHeight:100,options:c,defaultValue:c.find((function(t){return t.value===e.default}))||"",value:c.find((function(e){return e.value==l})),onChange:function(t){g(t.value,e),(e.isReadOnly||e.isLocked)&&r[n]?s.setFieldValue("attributes".concat(n),r[n]):s.setFieldValue("attributes".concat(n),t.value)}})}}))]},n)}))}):null},VZ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UZ=function(){return UZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UZ.apply(this,arguments)},HZ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},GZ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},WZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},qZ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},$Z=tt.div(lY||(lY=VZ(["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n ","\n"],["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(sY||(sY=VZ(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),ZZ=tt.div(fY||(fY=VZ(["\n box-sizing: border-box;\n width: 100%;\n ","\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n ","\n"])),(function(e){return e.theme.containerWidth>=ni&&Ne(cY||(cY=VZ(["\n width: 50%;\n "],["\n width: 50%;\n "])))}),(function(e){return e.theme.containerWidth<ni&&Ne(uY||(uY=VZ(["\n margin-top: 8px;\n "],["\n margin-top: 8px;\n "])))})),YZ=tt.div(pY||(pY=VZ(["\n box-sizing: border-box;\n width: 100%;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n"])),(function(e){return e.theme.containerWidth>=ni&&Ne(dY||(dY=VZ(["\n padding-right: 52px;\n width: 50%;\n "],["\n padding-right: 52px;\n width: 50%;\n "])))})),QZ=tt.div(hY||(hY=VZ(["\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n margin-bottom: 32px;\n"],["\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n margin-bottom: 32px;\n"]))),KZ=tt.div(yY||(yY=VZ(["\n margin-bottom: ",";\n display: grid;\n gap: 8px;\n"],["\n margin-bottom: ",";\n display: grid;\n gap: 8px;\n"])),(function(e){return e.marginBottom||"16px"})),XZ=tt.div(mY||(mY=VZ(["\n background-color: ",";\n padding: 18px;\n display: flex;\n align-items: center;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n margin-top: -7px;\n"],["\n background-color: ",";\n padding: 18px;\n display: flex;\n align-items: center;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n margin-top: -7px;\n"])),di),JZ=tt.div(vY||(vY=VZ(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),eY=tt.div(gY||(gY=VZ(["\n color: ",";\n"],["\n color: ",";\n"])),Ni),tY=tt.div(xY||(xY=VZ(["\n font-weight: 600;\n color: ",";\n display: flex;\n align-items: center;\n"],["\n font-weight: 600;\n color: ",";\n display: flex;\n align-items: center;\n"])),Bi),nY=tt.div(bY||(bY=VZ(["\n display: flex;\n flex-wrap: wrap;\n"],["\n display: flex;\n flex-wrap: wrap;\n"]))),rY="Search tags or create new...",iY=[0,0],oY=function(e){e.children;var n,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]),i=r.data.label,o=!(null===(n=r.data)||void 0===n?void 0:n.__isNew__);return(0,t.jsx)(Ss.Option,UZ({},r,{children:(0,t.jsxs)(tY,{children:[o&&(0,t.jsx)(f$,{style:{marginRight:"8px"},width:15,height:15,color:Ni}),i]})}))};const aY=function(e){var n=e.recordingBlobUrl,r=e.recordDate,i=e.setSaveFunction,o=e.insertAfterSave,a=void 0!==o&&o,s=e.setIsSaveDisabled,l=e.skipUploadProcess,c=void 0!==l&&l,u=e.videoId,f=e.initialTitle,d=e.updateUploadLoading,p=Nl().userData,h=(Mt().showTrimFeature,(0,E.useMemo)((function(){return Ct(p,iq)}),[p,iq])),y=ec(p),m=Jl(p),v=(0,E.createRef)(),g=WZ((0,E.useState)(f||r),2),x=g[0],b=g[1],w=WZ((0,E.useState)([]),2),S=w[0],C=w[1],k=WZ((0,E.useState)({value:"",label:"Select vehicle"}),2),_=k[0],O=k[1],P=WZ((0,E.useState)({value:"",label:"Select video type"}),2),T=P[0],A=P[1],j=WZ((0,E.useState)([]),2),I=j[0],M=j[1],D=WZ((0,E.useState)(),2),R=D[0],F=D[1],L=WZ((0,E.useState)([]),2),B=L[0],N=L[1],z=WZ((0,E.useState)([]),2),V=z[0],U=z[1],H=WZ((0,E.useState)({value:"",label:rY}),2),G=H[0],W=H[1],q=WZ((0,E.useState)(!1),2),$=q[0],Z=q[1],Y=WZ((0,E.useState)(!1),2),Q=Y[0],K=Y[1],X=WZ((0,E.useState)({title:"",tags:""}),2),J=X[0],ee=X[1],te=WZ((0,E.useState)(),2),ne=te[0],re=te[1],ie=WZ((0,E.useState)(0),2),oe=ie[0],ae=ie[1],se=WZ((0,E.useState)({}),2),le=se[0],ce=se[1],ue=WZ((0,E.useState)(!0),2),fe=(ue[0],ue[1]),de=((0,E.useRef)([0,0]),WZ((0,E.useState)(iY),2)),pe=de[0],he=de[1],ye=WZ((0,E.useState)(!1),2),me=ye[0],ve=ye[1],ge=WZ((0,E.useState)(u||""),2),xe=ge[0],be=ge[1],we=WZ((0,E.useState)(),2),Se=we[0],Ce=we[1],Ee=dn(),ke=(0,E.useRef)(null),_e=Ju().toast,Oe=Object.values(y?rF:iF).map((function(e){return{value:e,label:e||"No video type"}})),Pe={};Pe.covideoName=x,Pe.saveToCompanyFolder=!1;var Te=function(){var e,t=ke.current.values;ce(t),Z(!1),e={title:"",tags:""},x&&x.length||(e.title="Title cannot be empty."),ee(e),Object.values(e).every((function(e){return""===e}))&&(null==d||d(!0),c?Ie(t):K(!0))},Ae=function(e){return e.sort((function(e,t){var n;return null===(n=e.labelField)||void 0===n?void 0:n.localeCompare(t.labelField)}))},je=function(e){return HZ(void 0,void 0,void 0,(function(){var t,n;return GZ(this,(function(r){switch(r.label){case 0:return t=e||le,(n=I.map((function(e,n){return{attributeId:e.attributeId,value:t["attributes".concat(n)]||"",videoId:parseInt(xe)}})))&&n.length?[4,Cr(xe,n).catch((function(e){return e}))]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},Ie=function(e){return HZ(void 0,void 0,void 0,(function(){var t;return GZ(this,(function(n){switch(n.label){case 0:return n.trys.push([0,9,,10]),V.length?[4,HZ(void 0,void 0,void 0,(function(){var e;return GZ(this,(function(t){switch(t.label){case 0:return e=V.map((function(e){return{value:e.value,label:e.labelField,__isNew__:e.__isNew__}})),[4,o$(xe,e)];case 1:return t.sent(),[2]}}))}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,je(e)];case 3:return n.sent(),[4,HZ(void 0,void 0,void 0,(function(){var e;return GZ(this,(function(t){switch(t.label){case 0:return Xl(p)?(e=UZ({videoId:parseInt(xe),videoType:(null==T?void 0:T.value)||""},!!y&&{vin:(null==_?void 0:_.value)||""}),[4,or({data:e})]):[2,0];case 1:return[2,t.sent().videoRequestId]}}))}))];case 4:return n.sent(),me?[4,Me(xe)]:[3,6];case 5:(t=n.sent())&&be(t.id),n.label=6;case 6:return f&&u&&f!==x?[4,$n({videoId:u,videoBody:{title:x}})]:[3,8];case 7:n.sent(),n.label=8;case 8:return Z(!0),_e({message:"Successfully saved video!"}),[3,10];case 9:return n.sent(),_e({message:"There was an error while creating your video request. Please try again."}),[3,10];case 10:return[2]}}))}))},Me=function(e){return HZ(void 0,void 0,void 0,(function(){var t,n;return GZ(this,(function(r){switch(r.label){case 0:t=Math.floor(100*pe[0])/100,n=Math.floor(100*pe[1])/100,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Zn(e,{duration:n,start:t})];case 2:return[2,r.sent()];case 3:return r.sent(),_e({message:"Something went wrong while trimming the video, try again later!"}),[3,4];case 4:return[2]}}))}))};return(0,E.useEffect)((function(){HZ(void 0,void 0,void 0,(function(){return GZ(this,(function(e){switch(e.label){case 0:return[4,HZ(void 0,void 0,void 0,(function(){var e,t,n;return GZ(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Sr({})];case 1:return e=r.sent(),M(e.attributes||[]),t=e.attributes.map((function(e,t){if("dropdown"===e.type){var n=e.dropdownValues.find((function(e){return e.default}));return n&&n.value?(Pe["attributes".concat(t)]=n.value,n.value):(Pe["attributes".concat(t)]="","")}return Pe["attributes".concat(t)]=e.default||"",e.default||""})),ke.current.values=Pe,Ce(Pe),F(t),[3,3];case 2:return n=r.sent(),console.log(n),[3,3];case 3:return[2]}}))}))];case 1:return e.sent(),[4,HZ(void 0,void 0,void 0,(function(){var e,t,n,r;return GZ(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,i$({})];case 1:return e=i.sent(),t=[],e.forEach((function(e){t.push({label:e.tag,value:e.tagId,labelField:e.tag})})),n=Ae(t),N(n),[3,3];case 2:return r=i.sent(),console.log(r),[3,3];case 3:return[2]}}))}))];case 2:return e.sent(),[4,HZ(void 0,void 0,void 0,(function(){var e,n,r;return GZ(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,er({})];case 1:return(e=i.sent()).items&&(n=[],e.items.forEach((function(e){n.push({label:(0,t.jsxs)(JZ,{children:[(0,t.jsxs)(tY,{children:[(0,t.jsx)(s$,{style:{marginRight:"8px"},width:15,height:15,color:Ni}),e.title]}),(0,t.jsx)(eY,{children:e.vin})]}),value:e.vin,labelField:e.vin})})),C(n)),[3,3];case 2:return r=i.sent(),console.log(r),[3,3];case 3:return[2]}}))}))];case 3:return e.sent(),[2]}}))}))}),[]),(0,E.useEffect)((function(){var e;n&&(e=n,HZ(void 0,void 0,void 0,(function(){var t,n;return GZ(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,fetch(e||"").then((function(e){return e.blob()}))];case 1:return t=r.sent(),re(t),[3,3];case 2:return n=r.sent(),console.log(n),[3,3];case 3:return[2]}}))})))}),[n]),(0,E.useEffect)((function(){$&&setTimeout((function(){null==d||d(!1),a&&xe?Ee.push("/insert-video/".concat(xe)):Ee.push("/")}),400)}),[$,xe]),(0,E.useEffect)((function(){he([0,oe])}),[oe]),(0,E.useEffect)((function(){var e=kt({trimStart:pe[0],trimEnd:pe[1],videoDuration:oe});return ve(e),function(){ve(!1)}}),[pe,oe]),(0,E.useEffect)((function(){s(""===x)}),[x]),(0,E.useEffect)((function(){i&&i((function(){return Te}))}),[x,pe,oe,_,me]),(0,t.jsxs)("div",{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){u&&HZ(void 0,void 0,void 0,(function(){return GZ(this,(function(e){switch(e.label){case 0:return u?[4,qn({videoIds:[u],deleteMultiple:!1})]:[2];case 1:return e.sent(),[2]}}))})),Ee.push(e)},shouldBlockNavigation:function(){return!$},title:"Delete Current Video?",text:"Do you want to go back? The current video will be deleted.",confirmButtonText:"No, Keep Video",discardButtonText:"Yes, Delete Video",showDiscardIcon:!1,showSaveIcon:!1}),Q?(0,t.jsx)(I$,{title:x,beginUploadProcess:Q,afterUpload:Ie,setSavedVideoId:be,file:ne,fileName:h}):(0,t.jsxs)($Z,{children:[(0,t.jsxs)(YZ,{children:[(0,t.jsxs)(QZ,{children:[(0,t.jsx)(FU,{id:"",videoSource:n,videoRef:v,preventWideSize:!0,borderBottomRadius:"0px",setVideoDuration:ae,setIsVideoLoading:fe}),(0,t.jsxs)(XZ,{children:[(0,t.jsx)(iT,{size:16,color:ki,style:{marginRight:6}}),(0,t.jsx)("div",{children:Et()})]})]}),!1]}),(0,t.jsx)(ZZ,{children:(0,t.jsx)(hZ,UZ({enableReinitialize:!0,innerRef:ke,initialValues:Se,validateOnMount:!0,onSubmit:function(){}},{children:function(e){return e.errors,e.isValid,e.values,e.setFieldValue,(0,t.jsxs)(bZ,{children:[(0,t.jsxs)(KZ,{children:[(0,t.jsx)(sz,{text:"Title"}),!!J.title&&(0,t.jsx)(sz,{text:J.title,color:Ri}),(0,t.jsx)(lo,UZ({type:"text",onChange:function(e){return b(e.target.value)},value:x},J.title&&{borderColor:Ri}))]}),(0,t.jsxs)(KZ,UZ({marginBottom:"8px"},{children:[(0,t.jsx)(sz,{text:"Tags"}),!!J.tags&&(0,t.jsx)(sz,{text:J.tags,color:Ri}),(0,t.jsx)(bl,{options:B.filter((function(e){return!e||!V.length||!V.some((function(t){return t.value===e.value}))})),placeholder:rY,controlShouldRenderValue:!1,value:G,onChange:function(e){return function(e){if(e&&e.value){var t=B.some((function(t){return t.value==e.value})),n=t?e:{value:e.value,label:e.label,labelField:e.label,__isNew__:!0},r=V.find((function(e){return e.value===n.value}));r||U(qZ(qZ([],WZ(V),!1),[n],!1)),t||N(Ae(qZ(qZ([],WZ(B),!1),[n],!1))),W(n)}}(e)},isSearchable:!0,creatable:!0,extraStyles:UZ({},J.tags&&{borderColor:Ri}),customComponents:{Option:oY}}),(0,t.jsx)(nY,{children:V.map((function(e,n){return(0,t.jsx)(yo,{icon:(0,t.jsx)(f$,{width:15,height:15,color:Ni}),text:e.label,padding:"5px",height:"24px",onClick:function(){return function(e,t){var n=qZ([],WZ(V),!1);if(n.splice(t,1),U(n),W({value:"",label:rY}),G.__isNew__){var r=qZ([],WZ(B),!1),i=B.findIndex((function(t){return t.value===e.value}));i>-1&&(r.splice(i,1),N(r))}}(e,n)}},e.value)}))})]})),y&&(0,t.jsxs)(KZ,{children:[(0,t.jsx)(sz,{text:"VIN / search vehicle"}),(0,t.jsx)(bl,{options:S,value:_,onChange:function(e){return O(e)},isSearchable:!0,isClearable:!!(null==_?void 0:_.value)})]}),(m||y)&&(0,t.jsxs)(KZ,UZ({marginBottom:"8px"},{children:[(0,t.jsx)(sz,{text:"Video Type"}),(0,t.jsx)(bl,{options:Oe,value:T,onChange:function(e){return A(e)},isSearchable:!0,isClearable:!!(null==T?void 0:T.value)})]})),(0,t.jsx)(zZ,{attributes:I||[],initValues:R,setIsSaveDisabled:s})]})}}))})]})]})};var sY,lY,cY,uY,fY,dY,pY,hY,yY,mY,vY,gY,xY,bY,wY,SY,CY,EY,kY,_Y,OY,PY,TY,AY,jY,IY,MY,DY,RY,FY,LY,BY,NY,zY,VY,UY,HY,GY,WY,qY,$Y,ZY,YY,QY,KY,XY,JY=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},eQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},tQ=tt.div(wY||(wY=JY(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),nQ=tt.div(SY||(SY=JY(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),rQ=function(e){var n=e.loading,r=void 0!==n&&n,i=Mt().showInsertFeature,o=dn(),a=eQ((0,E.useState)(Et()),2),s=a[0],l=a[1],c=eQ((0,E.useState)(!1),2),u=c[0],f=c[1],d=eQ(E.useState(""),2),p=d[0],h=d[1],y=eQ((0,E.useState)(),2),m=y[0],v=y[1],g=eQ((0,E.useState)(!1),2),x=g[0],b=g[1],w=eQ((0,E.useState)(!1),2),S=w[0],C=w[1],k=eQ((0,E.useState)(!1),2),_=k[0],O=k[1],P=!r&&!!p;return(0,t.jsxs)(tQ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return o.push("/record/home")}}),center:(0,t.jsx)(nQ,{children:P?"":"Record Video"}),right:P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){return null==m?void 0:m()},text:"Save",disabled:S||_,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:_?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),i&&(0,t.jsx)(yo,{onClick:function(){b(!0),null==m||m()},text:"Continue to Insert",disabled:S||_,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(Eo,{isLoading:r}),P&&(0,t.jsx)(aY,{recordingBlobUrl:p,recordDate:s,setSaveFunction:v,insertAfterSave:x,setIsSaveDisabled:C,updateUploadLoading:function(e){return O(e)}}),!r&&!p&&(0,t.jsx)(so,{children:!u&&(0,t.jsx)(Xq,{onUpload:function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){return l(e.covideoName),f(!0),h(""),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},uploadDisabled:!s,onRecordingUrlGeneration:function(e){h(e)}})})]})]})},iQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},oQ=function(){return oQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oQ.apply(this,arguments)},aQ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},sQ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},lQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},cQ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},uQ=tt.div(CY||(CY=iQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: auto;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n margin-left: auto;\n margin-right: auto;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: auto;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n margin-left: auto;\n margin-right: auto;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"])),qi,di,$i),fQ=tt.div(EY||(EY=iQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"])),(function(e){return e.theme.primaryColor}),di,(function(e){return e.theme.primaryColor})),dQ=tt.div(kY||(kY=iQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),pQ=tt.div(_Y||(_Y=iQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),hQ=tt.div(OY||(OY=iQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),qi,di,$i),yQ=tt.div(PY||(PY=iQ(["\n margin-left: 5%;\n margin-top: 5%;\n"],["\n margin-left: 5%;\n margin-top: 5%;\n"]))),mQ=tt.div(AY||(AY=iQ(["\n display: flex;\n flex-direction: row;\n width: 770px;\n max-width: 100%;\n z-index: 9;\n margin-top: 32px;\n ","\n"],["\n display: flex;\n flex-direction: row;\n width: 770px;\n max-width: 100%;\n z-index: 9;\n margin-top: 32px;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(TY||(TY=iQ(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),vQ=tt.div(jY||(jY=iQ(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n"]))),gQ=tt.div(IY||(IY=iQ(["\n width: 150px;\n display: flex;\n flex-direction: row;\n"],["\n width: 150px;\n display: flex;\n flex-direction: row;\n"]))),xQ=tt.div(MY||(MY=iQ(["\n position: absolute;\n top: 0;\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: ",";\n justify-content: center;\n"],["\n position: absolute;\n top: 0;\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: ",";\n justify-content: center;\n"])),(function(e){return e.show?"flex":"none"})),bQ={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},wQ={videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}},SQ="undefined"!=typeof InstallTrigger,CQ=null,EQ=function(e){var n,r=e.onRecordingStart,i=e.onRecordingEnd,o=e.uploadDisabled,a=e.virtualBackgroundUrl,s=void 0===a?null:a,l=e.showRecordingButton,c=void 0===l||l,u=e.onRecordingUrlGeneration,f=dn(),d=E.useRef(null),p=(0,E.useRef)(null),h=(0,E.useRef)(null),y=lQ((0,E.useState)(3),2),v=y[0],g=y[1],x=lQ((0,E.useState)(!1),2),b=x[0],w=x[1],S=lQ((0,E.useState)(!1),2),C=S[0],k=S[1],_=lQ((0,E.useState)(0),2),O=_[0],P=_[1],T={videoSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(wQ)).videoSource,videoQuality:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(wQ)).videoQuality,audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(wQ)).audioSource},A=lQ(E.useState(!!s),2),j=A[0],I=A[1],M=Nl().userData,D=lQ(E.useState(!1),2),R=D[0],F=D[1];try{n={deviceId:T.audioSource.value}}catch(e){}T&&T.audioSource&&T.audioSource.value||(n=!1);var L=T&&T.videoQuality&&T.videoQuality.value?bQ[T.videoQuality]:bQ.standard,B=sq({video:oQ(oQ({},L),{frameRate:24,deviceId:T.videoSource&&T.videoSource.value}),audio:n,quality:T.videoQuality,blobPropertyBag:{type:nq},mimeType:nq}),N=B.status,z=B.startRecording,V=B.startRecordingForCanvas,U=B.stopRecording,H=B.pauseRecording,G=B.resumeRecording,W=B.mediaBlobUrl,q=B.previewStream,$=B.error;E.useEffect((function(){return localStorage.setItem(m.recordError,""),T.videoSource&&T.videoSource.value||(localStorage.setItem(m.recordError,"No camera detected. Please check your recording settings and make sure the camera is plugged in."),f.push("/record/home")),function(){ee()}}),[]),(0,E.useEffect)((function(){b||p&&p.current&&q&&(p.current.srcObject=q)}),[q,p]),(0,E.useEffect)((function(){b||(q&&""!==s&&null!=s&&!W?I(!0):s&&!W||(I(!1),h.current=null))}),[s,q,W]),(0,E.useEffect)((function(){var e=dq((function(){!b||C||v||P(O+1)}),1e3);return function(){fq(e)}})),(0,E.useEffect)((function(){var e,t,n,r,i;M&&M.authCalled&&(null===(e=M.user)||void 0===e?void 0:e.packageDetails)&&(null===(n=null===(t=M.user)||void 0===t?void 0:t.packageDetails)||void 0===n?void 0:n.maxLength)&&O>=(null===(i=null===(r=M.user)||void 0===r?void 0:r.packageDetails)||void 0===i?void 0:i.maxLength)&&Q()}),[O,M,M.authCalled]);var Z=function(){b&&v>0&&(clearTimeout(CQ),w(!1),g(3))},Y=function(){w(!0)},Q=function(){i&&i(),w(!1),U();try{cQ([],lQ(window.streams),!1).filter(Boolean).forEach((function(e){return te(e)})),window.streams=[]}catch(e){}},K=function(){H(),k(!0)},X=function(){G(),k(!1)};E.useEffect((function(){("permission_denied"===$||SQ&&void 0===$)&&f.push("/record/home")}),[$]),E.useEffect((function(){if(v>0&&b)CQ=setTimeout((function(){return g(v-1)}),1e3);else if(b)if(r&&r(),s&&j)try{V(d.current.captureStream(30)),window.Intercom&&window.Intercom("trackEvent","virtual-background-used")}catch(e){console.log("EXCEPTION :: ",e),z()}else z()}),[b,v]),E.useEffect((function(){s&&!R&&p.current&&q&&(p.current.srcObject=q,J())}),[s,R,p,q]),E.useEffect((function(){W&&u(W)}),[W]);var J=function(){return aQ(void 0,void 0,void 0,(function(){var e;return sQ(this,(function(t){return F(!0),(e=null==q?void 0:q.getVideoTracks()[0])&&e.getSettings().width&&"live"===e.readyState?(setTimeout((function(){return aQ(void 0,void 0,void 0,(function(){return sQ(this,(function(e){try{p.current.requestVideoFrameCallback(ne)}catch(e){p.current.requestVideoFrameCallback(ne)}return[2]}))}))}),250),[2]):(J(),[2])}))}))};E.useEffect((function(){return function(){ee()}}),[]);var ee=function(){cQ([],lQ(window.streams),!1).filter(Boolean).forEach((function(e){return te(e)})),window.streams=[],w(!1),CQ&&clearTimeout(CQ)},te=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}},ne=function(e,t){return aQ(void 0,void 0,void 0,(function(){return sQ(this,(function(e){return p&&p.current?(p.current.requestVideoFrameCallback(ne),[2,!0]):[2]}))}))},re=E.useMemo((function(){return(0,t.jsxs)(t.Fragment,{children:[!W&&q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{hidden:j,ref:p,width:770,style:{maxWidth:"100%"},height:434,autoPlay:!0}),(0,t.jsx)("canvas",{ref:d,hidden:!j,width:770,style:{maxWidth:"100%"},height:434})]}),c?(0,t.jsxs)(mQ,{children:["recording"===N&&(0,t.jsxs)(gQ,{children:[!C&&(0,t.jsx)(pQ,oQ({onClick:K},{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(AV,{}),textColor:"#000",text:"Pause",onClick:K})})),C&&(0,t.jsx)(hQ,oQ({onClick:X},{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(Rc,{color:di,size:34}),textColor:"#fff",text:"Resume",onClick:X})})),(0,t.jsx)(yQ,{children:St(O,0)})]}),"recording"===N&&(0,t.jsx)(fQ,{children:(0,t.jsx)(yo,{icon:(0,t.jsx)(NV,{color:di}),backgroundColor:Qi,textColor:di,text:"Finish",onClick:Q})}),b&&"recording"!==N&&(0,t.jsx)(dQ,oQ({onClick:Z},{children:(0,t.jsx)(yo,{backgroundColor:Wi,textColor:"#000",text:"Cancel",onClick:Z})})),!b&&"idle"===N&&(0,t.jsx)(uQ,{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(kW,{width:24,height:24,opacity:1}),text:"Start recording",textColor:"#fff",onClick:Y})}),"stopped"===N&&(0,t.jsx)(t.Fragment,{}),"stopped"===N&&(0,t.jsx)(t.Fragment,{})]}):null]})}),[N,O,b,C,W,T,o]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){return f.push(e)},shouldBlockNavigation:function(e){return"recording"===N},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,t.jsxs)(vQ,{children:[(0,t.jsx)(xQ,oQ({show:v>0&&b},{children:(0,t.jsx)(Cu,{height:"434px",width:"770px",counter:v,willStart:v>0&&b,onClick:function(){},hide:!v})})),re]})]})},kQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},_Q=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},OQ=tt.div(DY||(DY=kQ(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),PQ=tt.div(RY||(RY=kQ(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),TQ=function(e){var n=e.loading,r=void 0!==n&&n,i=Mt().showInsertFeature,o=dn(),a=_Q((0,E.useState)(Et()),2),s=a[0],l=a[1],c=_Q((0,E.useState)(!1),2),u=c[0],f=c[1],d=_Q(E.useState(""),2),p=d[0],h=d[1],y=_Q((0,E.useState)(),2),m=y[0],v=y[1],g=_Q((0,E.useState)(!1),2),x=g[0],b=g[1],w=_Q((0,E.useState)(!1),2),S=w[0],C=w[1],k=_Q((0,E.useState)(!1),2),_=k[0],O=k[1],P=!r&&!!p;return(0,t.jsxs)(OQ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return o.push("/record/home")}}),center:(0,t.jsx)(PQ,{children:P?"":"Record Video"}),right:P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){return null==m?void 0:m()},text:"Save",disabled:S||_,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:_?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),i&&(0,t.jsx)(yo,{onClick:function(){b(!0),null==m||m()},text:"Continue to Insert",disabled:S||_,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(Eo,{isLoading:r}),P&&(0,t.jsx)(aY,{recordingBlobUrl:p,recordDate:s,setSaveFunction:v,insertAfterSave:x,setIsSaveDisabled:C,updateUploadLoading:function(e){return O(e)}}),!r&&!p&&(0,t.jsxs)("div",{children:[(0,t.jsx)(so,{children:!u&&(0,t.jsx)(EQ,{onUpload:function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){return l(e.covideoName),f(!0),h(""),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},uploadDisabled:!s,onRecordingUrlGeneration:function(e){h(e)}})}),(0,t.jsx)("div",{style:{position:"absolute",bottom:"25px",right:"20px",height:"auto",width:"auto",zIndex:150,cursor:"pointer"}})]})]})]})},AQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},jQ=function(){return jQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jQ.apply(this,arguments)},IQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},MQ=tt.div(FY||(FY=AQ(["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"],["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"])),qi,di,$i),DQ=tt.div(LY||(LY=AQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"])),di,(function(e){return e.theme.primaryColor})),RQ=tt.div(BY||(BY=AQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),di,(function(e){return e.theme.primaryColor})),FQ=tt.div(NY||(NY=AQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),Wi,pi,Zi),LQ=tt.div(zY||(zY=AQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),BQ=tt.div(VY||(VY=AQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),NQ=tt.div(UY||(UY=AQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),qi,di,$i),zQ=tt.div(GY||(GY=AQ(["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"],["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(HY||(HY=AQ(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),VQ=tt.div(WY||(WY=AQ(["\n width: 150px;\n display: flex;\n flex-direction: row;\n"],["\n width: 150px;\n display: flex;\n flex-direction: row;\n"]))),UQ=tt.div(qY||(qY=AQ(["\n margin-left: 5%;\n margin-top: 5%;\n"],["\n margin-left: 5%;\n margin-top: 5%;\n"]))),HQ=tt.div($Y||($Y=AQ(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"]))),GQ=tt.div(ZY||(ZY=AQ(["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"],["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"]))),WQ="undefined"!=typeof InstallTrigger,qQ=null,$Q={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},ZQ={videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}},YQ=0,QQ=navigator.mediaDevices.getDisplayMedia,KQ=E.memo((function(e){var n=e.onRecordingStart,r=e.onRecordingEnd,i=e.onUpload,o=e.uploadDisabled,a=e.onRecordingUrlGeneration;YQ++;var s,l=dn(),c=IQ((0,E.useState)(3),2),u=c[0],f=c[1],d=IQ((0,E.useState)(!1),2),p=d[0],h=d[1],y=IQ((0,E.useState)(!1),2),v=y[0],g=y[1],x=IQ((0,E.useState)(!1),2),b=x[0],w=x[1],S=IQ((0,E.useState)(!1),2),C=S[0],k=S[1],_=IQ((0,E.useState)(0),2),O=_[0],P=_[1],T={videoSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(ZQ)).videoSource,videoQuality:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(ZQ)).videoQuality,audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(ZQ)).audioSource};try{s={deviceId:T.audioSource.value}}catch(e){}T&&T.audioSource&&T.audioSource.value||(s=!1),YQ>1&&(navigator.mediaDevices.getDisplayMedia=function(){});var A=T&&T.videoQuality?$Q[T.videoQuality]:$Q.standard,j=Nl().userData,I=sq({screen:!0,video:jQ(jQ({},A),{frameRate:24}),audio:s,quality:T.videoQuality,blobPropertyBag:{type:nq},mimeType:nq}),M=I.status,D=I.startRecording,R=I.stopRecording,F=I.pauseRecording,L=I.resumeRecording,B=I.mediaBlobUrl,N=I.previewStream,z=I.error;N&&(N.getVideoTracks()[0].onended=function(){"recording"===M?H():l.push("/record/home")}),E.useEffect((function(){B&&a(B)}),[B]),E.useEffect((function(){return localStorage.setItem(m.recordError,""),function(){YQ=0,navigator.mediaDevices.getDisplayMedia=QQ,$()}}),[]),E.useEffect((function(){("permission_denied"===z||WQ&&void 0===z)&&(localStorage.setItem(m.recordError,"Please allow access to share your screen then try again."),YQ=0,navigator.mediaDevices.getDisplayMedia=QQ,l.push("/record/home"))}),[z]),E.useEffect((function(){C||b||!N||B||p||U()}),[N]),E.useEffect((function(){var e=dq((function(){!p||v||u||P(O+1)}),1e3);return function(){fq(e)}})),E.useEffect((function(){var e,t,n,r,i;j&&j.authCalled&&(null===(e=j.user)||void 0===e?void 0:e.packageDetails)&&(null===(n=null===(t=j.user)||void 0===t?void 0:t.packageDetails)||void 0===n?void 0:n.maxLength)&&O>=(null===(i=null===(r=j.user)||void 0===r?void 0:r.packageDetails)||void 0===i?void 0:i.maxLength)&&H()}),[O,j,j.authCalled]);var V=function(){p&&u>0&&(w(!0),clearTimeout(qQ),h(!1),f(3))},U=function(){w(!1),h(!0)},H=function(){k(!0),r&&r(),h(!1),R()},G=function(){F(),g(!0)},W=function(){L(),g(!1)},q=function(){return e=void 0,t=void 0,r=function(){var e;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,fetch(B||"").then((function(e){return e.blob()}))];case 1:return e=t.sent(),$(),i({file:e,fileUrl:B}),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r};E.useEffect((function(){u>0&&p?qQ=setTimeout((function(){return f(u-1)}),1e3):p&&(n&&n(),D())}),[p,u]);var $=function(){(function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([],IQ(window.streams),!1).filter(Boolean).forEach((function(e){return Z(e)})),window.streams=[],h(!1),qQ&&clearTimeout(qQ)},Z=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}},Y=E.useMemo((function(){return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(zQ,{children:["recording"===M&&(0,t.jsxs)(VQ,{children:[!v&&(0,t.jsx)(BQ,jQ({onClick:G},{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(AV,{}),textColor:"#000",text:"Pause",onClick:G})})),v&&(0,t.jsx)(NQ,jQ({onClick:W},{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(Rc,{color:di,size:34}),textColor:"#fff",text:"Resume",onClick:W})})),(0,t.jsx)(UQ,{children:St(O,0)})]}),"recording"===M&&(0,t.jsx)(DQ,{children:(0,t.jsx)(yo,{backgroundColor:Qi,icon:(0,t.jsx)(NV,{color:di}),textColor:"#fff",text:"Finish",onClick:H})}),p&&"recording"!==M&&(0,t.jsx)(LQ,jQ({onClick:V},{children:(0,t.jsx)(yo,{backgroundColor:Wi,textColor:"#000",text:"Cancel",onClick:V})})),!p&&"idle"===M&&(0,t.jsx)(MQ,{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(kW,{width:24,height:24,opacity:1}),text:"Start recording",textColor:"#fff",onClick:U})}),"stopped"===M&&(0,t.jsx)(FQ,{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(MW,{height:20,width:20,color:pi}),textColor:"#000",text:"Discard",onClick:function(){return l.push("/record/home")}})}),"stopped"===M&&(0,t.jsx)(RQ,{children:(0,t.jsx)(yo,{disabled:o,backgroundColor:Qi,icon:(0,t.jsx)(TW,{height:20,width:20,color:di}),textColor:"#fff",text:"Save Recording",onClick:q})})]})})}),[M,O,p,v,B,o]);return(0,t.jsxs)("div",{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){return l.push(e)},shouldBlockNavigation:function(e){return"recording"===M},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,t.jsxs)(HQ,{children:[(0,t.jsx)(GQ,{children:(0,t.jsx)(Cu,{counter:u,willStart:u>0&&p,onClick:function(){},hide:!u})}),Y]})]})})),XQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},JQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},eK=tt.div(YY||(YY=XQ(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),tK=tt.div(QY||(QY=XQ(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),nK=function(e){var n=e.loading,r=void 0!==n&&n,i=Mt().showInsertFeature,o=dn(),a=JQ((0,E.useState)(Et()),2),s=a[0],l=a[1],c=JQ((0,E.useState)(!1),2),u=c[0],f=c[1],d=JQ(E.useState(""),2),p=d[0],h=d[1],y=JQ((0,E.useState)(),2),m=y[0],v=y[1],g=JQ((0,E.useState)(!1),2),x=g[0],b=g[1],w=JQ((0,E.useState)(!1),2),S=w[0],C=w[1],k=JQ((0,E.useState)(!1),2),_=k[0],O=k[1],P=!r&&!!p;return(0,t.jsxs)(eK,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return o.push("/record/home")}}),center:(0,t.jsx)(tK,{children:P?"":"Record Video"}),right:P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){return null==m?void 0:m()},text:"Save",disabled:S||_,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:_?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),i&&(0,t.jsx)(yo,{onClick:function(){b(!0),null==m||m()},text:"Continue to Insert",disabled:S||_,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(Eo,{isLoading:r}),P&&(0,t.jsx)(aY,{recordingBlobUrl:p,recordDate:s,setSaveFunction:v,insertAfterSave:x,setIsSaveDisabled:C,updateUploadLoading:function(e){return O(e)}}),!r&&!p&&(0,t.jsx)(so,{children:!u&&(0,t.jsx)(KQ,{onUpload:function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){return l(e.covideoName),f(!0),h(""),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},uploadDisabled:!s,onRecordingUrlGeneration:function(e){h(e)}})})]})]})},rK=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},iK=function(){return iK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},iK.apply(this,arguments)},oK=tt.div(KY||(KY=rK(["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n gap: 32px;\n margin: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n gap: 32px;\n margin: ",";\n"])),(function(e){return e.margin})),aK=tt.div(XY||(XY=rK(["\n width: ",";\n > video {\n display: block;\n width: 100%;\n border-radius: 4px;\n height: ",";\n object-fit: contain;\n background: ",";\n }\n"],["\n width: ",";\n > video {\n display: block;\n width: 100%;\n border-radius: 4px;\n height: ",";\n object-fit: contain;\n background: ",";\n }\n"])),(function(e){var t=e.width;return"".concat(t,"px")}),(function(e){var t=e.width;return"".concat(.5625*t,"px")}),Si),sK=function(e){var n=e.video,r=e.videoRef,i=e.width,o=void 0===i?696:i,a=e.margin,s=void 0===a?"0":a,l=e.useCovideoPlayer,c=void 0!==l&&l;return(0,t.jsxs)(oK,iK({margin:s},{children:[!c&&(0,t.jsx)(aK,iK({width:o},{children:(0,t.jsx)("video",iK({ref:r,preload:"metadata",width:o},{children:(0,t.jsx)("source",{src:n.videoSource,type:"video/mp4"})}))})),c&&(0,t.jsx)(FU,{width:"".concat(o,"px"),playerBackgroundColor:n.playerBackgroundColor||"",videoSource:n.videoSource,videoId:n.id,playButtonPosition:n.playButtonPosition||"",playerIconsColor:n.playerIconsAndTextColor||"",videoRef:r,autoplay:!1,disableControls:!0,startWithControls:!1})]}))};function lK(e){return Oc({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}},{tag:"path",attr:{d:"M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"}}]})(e)}var cK,uK,fK,dK,pK,hK,yK,mK=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},vK=tt.div(cK||(cK=mK(["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"],["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"])),di),gK=tt.div(uK||(uK=mK(["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"],["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"])),pi),xK=tt.label(fK||(fK=mK(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),Vi),bK=tt.div(dK||(dK=mK(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),wK=tt.section(pK||(pK=mK(["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"],["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"]))),SK=function(e){var n=e.title,r=e.content,i=e.primaryButtonText,o=e.secondaryButtonText,a=e.handleModalClose,s=e.handleSubmit,l=e.primaryButtonType,c=void 0===l?"default":l,u=(0,E.useContext)(Ye);return(0,t.jsx)(wc,{children:(0,t.jsxs)(vK,{children:[(0,t.jsxs)(gK,{children:[n,(0,t.jsx)(xK,{children:(0,t.jsx)(rf,{width:"24px",height:"24px",onClick:a})})]}),(0,t.jsxs)(bK,{children:[r,(0,t.jsxs)(wK,{children:[(0,t.jsx)(yo,{text:i,backgroundColor:"danger"===c?Di:u.colors.primaryColor,textColor:"danger"===c?Ri:di,onClick:s}),(0,t.jsx)(yo,{text:o,onClick:a})]})]})]})})},CK=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},EK=function(){return EK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},EK.apply(this,arguments)},kK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_K=tt.div(NK||(NK=CK(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 11px;\n width: ",";\n max-width: 100%;\n margin: ",";\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 11px;\n width: ",";\n max-width: 100%;\n margin: ",";\n ","\n"])),(function(e){var t=e.width;return"".concat(t,"px")}),(function(e){return e.margin}),(function(e){return e.disabled&&Ne(BK||(BK=CK(["\n pointer-events: none;\n opacity: 0.4;\n "],["\n pointer-events: none;\n opacity: 0.4;\n "])))})),OK=tt.div(zK||(zK=CK(["\n display: flex;\n justify-content: center;\n gap: 8px;\n flex-shrink: 0;\n"],["\n display: flex;\n justify-content: center;\n gap: 8px;\n flex-shrink: 0;\n"]))),PK=tt.div(UK||(UK=CK(["\n position: relative;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n border-radius: 6px;\n display: flex;\n align-items: center;\n background: ",";\n border: 1px solid ",";\n border-radius: 6px;\n ","\n"],["\n position: relative;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n border-radius: 6px;\n display: flex;\n align-items: center;\n background: ",";\n border: 1px solid ",";\n border-radius: 6px;\n ","\n"])),wi,bi,(function(e){return e.disabled&&Ne(VK||(VK=CK(["\n cursor: not-allowed;\n "],["\n cursor: not-allowed;\n "])))})),TK=tt.div(HK||(HK=CK(["\n position: relative;\n height: 12px;\n width: 100%;\n margin-right: 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 8px;\n"],["\n position: relative;\n height: 12px;\n width: 100%;\n margin-right: 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 8px;\n"]))),AK=tt.div(GK||(GK=CK(["\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n width: ",";\n background: ",";\n border-radius: 8px;\n"],["\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n width: ",";\n background: ",";\n border-radius: 8px;\n"])),(function(e){var t=e.position;return"".concat(t,"%")}),(function(e){return e.background})),jK=tt.div(WK||(WK=CK(["\n box-sizing: border-box;\n width: 100px;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 13px;\n"],["\n box-sizing: border-box;\n width: 100px;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 13px;\n"]))),IK=tt.div(qK||(qK=CK(["\n flex-grow: 0;\n flex-shrink: 0;\n margin-right: 17px;\n padding-top: 4px;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n margin-right: 17px;\n padding-top: 4px;\n"]))),MK=tt.div($K||($K=CK(["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n"])),Pi),DK=tt.div(ZK||(ZK=CK(["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 60px;\n padding-left: 12px;\n margin-right: 12px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 60px;\n padding-left: 12px;\n margin-right: 12px;\n color: ",";\n"])),_i),RK=tt.input(QK||(QK=CK(["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 3;\n cursor: pointer;\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-moz-range-thumb {\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-ms-thumb {\n width: 4px;\n height: 40px;\n z-index: 3;\n }\n ",";\n &:focus {\n outline: none;\n }\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"],["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 3;\n cursor: pointer;\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-moz-range-thumb {\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-ms-thumb {\n width: 4px;\n height: 40px;\n z-index: 3;\n }\n ",";\n &:focus {\n outline: none;\n }\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"])),(function(e){return e.disabled&&Ne(YK||(YK=CK(["\n pointer-events: none;\n &::-webkit-slider-thumb {\n display: none;\n }\n &::-moz-range-thumb {\n display: none;\n }\n &::-ms-thumb {\n display: none;\n }\n "],["\n pointer-events: none;\n &::-webkit-slider-thumb {\n display: none;\n }\n &::-moz-range-thumb {\n display: none;\n }\n &::-ms-thumb {\n display: none;\n }\n "])))})),FK=tt.audio(KK||(KK=CK(["\n display: none;\n"],["\n display: none;\n"]))),LK={audioSource:{value:"default"}};!function(e){e.NotRecording="NotRecording",e.Recording="Recording",e.RecordingPaused="RecordingPaused",e.Finished="Finished"}(hK||(hK={})),function(e){e.NotPreviewing="NotPreviewing",e.Previewing="Previewing",e.PreviewingPaused="PreviewingPaused"}(yK||(yK={}));var BK,NK,zK,VK,UK,HK,GK,WK,qK,$K,ZK,YK,QK,KK,XK,JK,eX,tX,nX,rX,iX,oX,aX,sX,lX,cX,uX,fX,dX,pX,hX,yX,mX,vX,gX,xX,bX,wX,SX,CX,EX,kX,_X,OX,PX,TX,AX,jX,IX,MX,DX,RX,FX,LX,BX,NX,zX,VX,UX,HX,GX=function(e){var n,r,i=e.video,o=e.videoRef,a=e.onChangeVoiceoverValid,s=e.onRecordingUrlGeneration,l=e.handleShowCard,c=e.margin,u=void 0===c?"0":c,f=e.width,d=void 0===f?696:f,p=e.disabled,h=void 0!==p&&p,y=Mt().containerWidth,v=Ju().toast,g=(0,E.createRef)(),x=kK((0,E.useState)(hK.NotRecording),2),b=x[0],w=x[1],S=kK((0,E.useState)(yK.NotPreviewing),2),C=S[0],k=S[1],_=kK((0,E.useState)(0),2),O=_[0],P=_[1],T=kK((0,E.useState)(),2),A=T[0],j=T[1],I=kK((0,E.useState)(!1),2),M=I[0],D=I[1],R=dn(),F={audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(LK)).audioSource};try{r={deviceId:F.audioSource.value}}catch(e){}F&&F.audioSource&&F.audioSource.value||(r=!1);var L=sq({audio:r}),B=L.error,N=L.startRecording,z=L.stopRecording,V=L.pauseRecording,U=L.resumeRecording,H=L.mediaBlobUrl;r&&!B||(v({message:"Please enable audio in your recording settings and try again!"}),R.push("/record/home"));(0,E.useEffect)((function(){return function(){(function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([],kK(window.streams),!1).filter(Boolean).forEach((function(e){return function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}}(e)})),window.streams=[],w(hK.NotRecording),k(yK.NotPreviewing)}}),[]),(0,E.useEffect)((function(){var e=function(){var e,t=0;o.current&&(t=(null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.currentTime)||0,o.current.currentTime>=o.current.duration&&(t=o.current.duration)),P(t)},t=function(){z(),w(hK.Finished),k(yK.NotPreviewing)},n=function(){w((function(e){return e===hK.Finished?e:hK.Recording})),k((function(e){return e===yK.PreviewingPaused?yK.Previewing:e}))},r=function(){w((function(e){return e===hK.Finished?e:hK.RecordingPaused})),k((function(e){return e===yK.Previewing?yK.PreviewingPaused:e}))},i=function(){o.current&&A&&(A.currentTime=o.current.currentTime)};return o.current&&(o.current.addEventListener("timeupdate",e,!0),o.current.addEventListener("ended",t,!0),o.current.addEventListener("pause",r,!0),o.current.addEventListener("play",n,!0),o.current.addEventListener("seeked",i,!0)),function(){o.current&&(o.current.removeEventListener("timeupdate",e,!0),o.current.removeEventListener("ended",t,!0),o.current.removeEventListener("pause",r,!0),o.current.removeEventListener("play",n,!0),o.current.removeEventListener("seeked",i,!0))}}),[o]),(0,E.useEffect)((function(){a(b===hK.Finished)}),[b]),(0,E.useEffect)((function(){s(H||""),H&&g.current&&g.current.load()}),[H]),(0,E.useEffect)((function(){g.current&&j(g.current)}),[g.current]);var G=b===hK.Finished,W=b===hK.Recording,q=(null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.duration)||((null==i?void 0:i.videoLength)?(null==i?void 0:i.videoLength)/1e3:0),$=q?O?parseFloat(O.toString())/parseFloat(q.toString())*100:0:100,Z=new Date(1e3*O).toISOString().substring(14,19);return(0,t.jsxs)(_K,EK({margin:u,width:d,disabled:h},{children:[(0,t.jsx)(FK,EK({ref:g},{children:(0,t.jsx)("source",{src:H||""})})),(0,t.jsxs)(OK,{children:[b===hK.NotRecording&&(0,t.jsx)(yo,{backgroundColor:Ri,textColor:di,icon:(0,t.jsx)(lK,{color:di,size:12}),text:"Record",onClick:function(){return e=void 0,t=void 0,r=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){return o.current?(null==l||l(!1),o.current.volume=0,o.current.play(),N(),w(hK.Recording),[2]):[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r},margin:"0"}),b===hK.Recording&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(yo,{icon:(0,t.jsx)(Mc,{color:Si}),text:"Pause",onClick:function(){o.current&&(V(),o.current.pause(),w(hK.RecordingPaused))},margin:"0"})}),b===hK.RecordingPaused&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Dc,{color:Si}),text:"Resume",onClick:function(){return function(){var e;o.current&&(U(),null===(e=o.current)||void 0===e||e.play(),w(hK.Recording))}()},margin:"0"}),b===hK.Finished&&C===yK.NotPreviewing&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Dc,{color:Si}),onClick:function(){o.current&&A&&(k(yK.Previewing),o.current.currentTime=0,o.current.play(),A.play())},margin:"0"}),C===yK.Previewing&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Mc,{color:Si}),onClick:function(){o.current&&A&&(A.pause(),o.current.pause(),k(yK.PreviewingPaused))},margin:"0"}),C===yK.PreviewingPaused&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Dc,{color:Si}),onClick:function(){o.current&&A&&(A.play(),o.current.play(),k(yK.Previewing))},margin:"0"})]}),(0,t.jsxs)(PK,EK({disabled:!G,title:G?"":"Controls disabled before preview."},{children:[(0,t.jsxs)(jK,{children:[(0,t.jsx)(IK,{children:(0,t.jsx)(Ic,{size:22,color:W?Ri:_i})}),(0,t.jsx)(MK,{children:Z})]}),(0,t.jsxs)(TK,{children:[(0,t.jsx)(RK,{disabled:!G,type:"range",min:"0",max:"100",value:$,onChange:function(e){return function(e){var t,n=e.target.value.toString();t=(q*(n/100)).toString(),o.current&&A&&(o.current.currentTime=parseFloat(t),A.currentTime=parseFloat(t),A.play(),o.current.play(),k(yK.Previewing))}(e)},step:"1"}),(0,t.jsx)(AK,{background:W?Ri:Si,position:$})]}),(0,t.jsx)(DK,{children:St(q,0)})]})),[hK.RecordingPaused,hK.Finished].includes(b)&&(0,t.jsx)(OK,{children:(0,t.jsx)(yo,{backgroundColor:"rgba(232, 76, 61, 0.02)",textColor:Ri,icon:(0,t.jsx)($c,{color:Ri}),text:y>ti?"Start Over":"",onClick:function(){o.current&&A&&(A.pause(),o.current.pause(),C!==yK.NotPreviewing&&k(yK.PreviewingPaused),b!==hK.Finished&&w(hK.RecordingPaused),D(!0))},margin:"0"})}),M&&(0,t.jsx)(SK,{title:"Start Over?",content:(0,t.jsx)(t.Fragment,{children:"Your voiceover recording will be erased."}),secondaryButtonText:"Go Back",primaryButtonText:"Start Over",primaryButtonType:"danger",handleSubmit:function(){o.current&&A&&(D(!1),z(),o.current.pause(),o.current.currentTime=0,A.pause(),A.currentTime=0,w(hK.NotRecording),k(yK.NotPreviewing))},handleModalClose:function(){return D(!1)}})]}))},WX=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},qX=tt.div(XK||(XK=WX(["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"],["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"])),di),$X=tt.div(JK||(JK=WX(["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"],["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"])),pi),ZX=tt.label(eX||(eX=WX(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),Vi),YX=tt.div(tX||(tX=WX(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),QX=tt.div(nX||(nX=WX(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"])),Oi),KX=tt.section(rX||(rX=WX(["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"],["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"]))),XX=function(e){var n=e.title,r=e.label,i=e.defaultValue,o=e.primaryButtonText,a=e.secondaryButtonText,s=e.handleModalClose,l=e.handleSubmit,c=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(i),2),u=c[0],f=c[1];return(0,t.jsx)(wc,{children:(0,t.jsxs)(qX,{children:[(0,t.jsxs)($X,{children:[n,(0,t.jsx)(ZX,{children:(0,t.jsx)(rf,{width:"24px",height:"24px",onClick:s})})]}),(0,t.jsxs)(YX,{children:[(0,t.jsx)(QX,{children:r}),(0,t.jsx)(lo,{autoFocus:!0,value:u,onChange:function(e){return f(e.currentTarget.value)},width:"100%"}),(0,t.jsxs)(KX,{children:[(0,t.jsx)(yo,{text:o,backgroundColor:Qi,textColor:di,onClick:function(){return l(u)},disabled:""===u}),(0,t.jsx)(yo,{text:a,onClick:s})]})]})]})})},JX=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},eJ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},tJ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},nJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},rJ=tt.div(iX||(iX=JX(["\n background: ",";\n"],["\n background: ",";\n"])),di),iJ=tt.div(oX||(oX=JX(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),oJ=tt.div(sX||(sX=JX(["\n width: 78%;\n margin-left: auto;\n margin-right: auto;\n height: 40%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 12px;\n gap: 12px;\n background: #f2f4f6;\n border: 1px solid rgba(39, 42, 50, 0.05);\n border-radius: 6px;\n ","\n"],["\n width: 78%;\n margin-left: auto;\n margin-right: auto;\n height: 40%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 12px;\n gap: 12px;\n background: #f2f4f6;\n border: 1px solid rgba(39, 42, 50, 0.05);\n border-radius: 6px;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(aX||(aX=JX(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),aJ=tt.div(lX||(lX=JX(["\n width: 20px;\n flex-grow: 0;\n flex-shrink: 0;\n"],["\n width: 20px;\n flex-grow: 0;\n flex-shrink: 0;\n"]))),sJ=tt.div(cX||(cX=JX(["\n width: auto;\n"],["\n width: auto;\n"]))),lJ=tt.div(uX||(uX=JX(["\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),Si),cJ=tt.div(fX||(fX=JX(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-top: 2%;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-top: 2%;\n"])),hi),uJ=function(){var e=Ju().toast,n=pn().videoId,r=dn(),i=nJ((0,E.useState)({}),2),o=i[0],a=i[1],s=nJ((0,E.useState)(!0),2),l=s[0],c=s[1],u=nJ((0,E.useState)(!1),2),f=u[0],d=u[1],p=nJ((0,E.useState)(!1),2),h=p[0],y=p[1],m=nJ((0,E.useState)(!1),2),v=m[0],g=m[1],x=nJ((0,E.useState)(""),2),b=x[0],w=x[1],S=(0,E.createRef)();return(0,E.useEffect)((function(){eJ(void 0,void 0,void 0,(function(){var e;return tJ(this,(function(t){switch(t.label){case 0:return c(!0),[4,Wn(n)];case 1:return(e=t.sent())&&a(e),c(!1),[2]}}))}))}),[]),l?(0,t.jsx)(Eo,{isLoading:l}):(0,t.jsxs)(rJ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return r.push("/")}}),center:(0,t.jsx)(iJ,{children:"Voiceover"}),right:(0,t.jsx)(yo,{onClick:function(){g(!0)},text:"Save Video",textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px",disabled:!h||f})}),(0,t.jsx)(so,{children:!f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(oJ,{children:[(0,t.jsx)(aJ,{children:(0,t.jsx)(Tc,{size:22,color:"rgba(0, 27, 83, 0.6)"})}),(0,t.jsxs)(sJ,{children:[(0,t.jsx)(lJ,{children:"Duplicated video ready for voiceover"}),(0,t.jsx)(cJ,{children:"The video won’t be available in the Library until you save it. A new voiceover will replace the original audio of duplicated video."})]})]}),(0,t.jsx)(sK,{video:o,videoRef:S,margin:"32px 0 0"}),(0,t.jsx)(GX,{videoRef:S,video:o,onChangeVoiceoverValid:y,onRecordingUrlGeneration:function(e){w(e)},margin:"32px auto 0"})]})}),f&&(0,t.jsx)(Eo,{isLoading:!0}),v&&(0,t.jsx)(XX,{title:"Name new video",label:"Give your new video a name",defaultValue:o.title,secondaryButtonText:"Go Back",primaryButtonText:"Save Video",handleSubmit:function(t){return eJ(void 0,void 0,void 0,(function(){var n,i,a,s,l,c;return tJ(this,(function(u){switch(u.label){case 0:return g(!1),d(!0),[4,fetch(b||"").then((function(e){return e.blob()}))];case 1:return n=u.sent(),i=function(e,t){return e+"_"+(Math.random()+1).toString(36).substring(2)+"."+t}(o.id,iq),a=new File([n],i),s={fileName:a.name,mimeType:"audio/webm",folder:""},[4,ur(s)];case 2:if(!(l=u.sent())||l instanceof Error)return d(!1),e({message:"Server is currently unavailable, try again later!"}),[2];c={file:a,uploadURL:l.uploadUrl,mimeType:s.mimeType},u.label=3;case 3:return u.trys.push([3,6,,7]),[4,fr({data:c})];case 4:return u.sent(),[4,dr({videoId:o.id,newVideoTitle:t,audioFileName:i})];case 5:return u.sent(),[3,7];case 6:return u.sent(),d(!1),e({message:"Creating voiceover failed, try again later!"}),[2];case 7:return e({message:"Voiceover successfully created!"}),d(!1),y(!1),r.push("/"),[2]}}))}))},handleModalClose:function(){return g(!1)}})]})},fJ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},dJ=tt.div(pX||(pX=fJ(["\n position: relative;\n width: 216px;\n ","\n"],["\n position: relative;\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(dX||(dX=fJ(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),pJ=tt.div(hX||(hX=fJ(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),hJ=tt.div(yX||(yX=fJ(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),yJ=function(e){var n=e.prevSearch,r=e.handleSearch,i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(n||""),2),o=i[0],a=i[1];return(0,t.jsxs)(dJ,{children:[(0,t.jsx)(pJ,{children:(0,t.jsx)(fT,{onClick:function(){return r(o)},size:17})}),(0,t.jsx)(lo,{width:"100%",type:"text",padding:"8px 40px 8px 40px",value:o,placeholder:"Search videos...",onKeyUp:function(e){"Enter"===e.key&&r(o)},onChange:function(e){a(e.currentTarget.value)}}),""!==o&&(0,t.jsx)(hJ,{children:(0,t.jsx)(Fc,{onClick:function(){return a(""),void r("")},size:17})})]})},mJ=tt.div(mX||(mX=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),Oi),vJ=function(e){var n=e.page,r=e.size,i=e.count,o=n*r+1,a=n*r+r;return a>i&&(a=i),(0,t.jsxs)(mJ,{children:[o,"-",a," of ",i]})},gJ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},xJ=function(){return xJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xJ.apply(this,arguments)},bJ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},wJ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},SJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},CJ=tt.div(vX||(vX=gJ(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),EJ=tt.div(gX||(gX=gJ(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),kJ=tt.div(bX||(bX=gJ(["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"],["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(xX||(xX=gJ(["\n flex-direction: column;\n width: 100%;\n "],["\n flex-direction: column;\n width: 100%;\n "])))})),_J=tt.div(SX||(SX=gJ(["\n width: 216px;\n ","\n"],["\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(wX||(wX=gJ(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),OJ=tt.div(CX||(CX=gJ(["\n background: ",";\n"],["\n background: ",";\n"])),di),PJ=tt.div(EX||(EX=gJ(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"]))),TJ=tt.div(kX||(kX=gJ(["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),AJ=tt.div(_X||(_X=gJ(["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),jJ=tt.div(OX||(OX=gJ(["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"],["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"])),_i),IJ=tt.div(PX||(PX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"])),Pi),MJ=tt.div(TX||(TX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"])),Pi),DJ=tt.div(AX||(AX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"])),Pi),RJ=tt.div(jX||(jX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"])),Pi),FJ=tt.div(IX||(IX=gJ(["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"],["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"])),Pi),LJ=tt.div(MX||(MX=gJ(["\n margin-top: 100px;\n"],["\n margin-top: 100px;\n"]))),BJ=tt.div(DX||(DX=gJ(["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"],["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"]))),NJ=tt.button(RX||(RX=gJ(["\n ","\n box-sizing: border-box;\n width: auto;\n height: 40px;\n font-size: 15px;\n align-items: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n overflow: hidden;\n padding: 8px;\n transition: 0.1s all;\n color: ",";\n margin: 0 4px;\n border-radius: 5px;\n vertical-align: top;\n"],["\n ","\n box-sizing: border-box;\n width: auto;\n height: 40px;\n font-size: 15px;\n align-items: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n overflow: hidden;\n padding: 8px;\n transition: 0.1s all;\n color: ",";\n margin: 0 4px;\n border-radius: 5px;\n vertical-align: top;\n"])),li,wi,bi,Si),zJ=tt.div(FX||(FX=gJ(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"],["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"]))),VJ=tt.span(LX||(LX=gJ(["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"],["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"])),Oi),UJ=tt.input(BX||(BX=gJ(["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"],["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"])),xi),HJ=tt.div(zX||(zX=gJ(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(NX||(NX=gJ(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),GJ=(new Date).getFullYear(),WJ=function(){var e=Nl().userData,n=(Xl(e),dn()),r=Mt().containerWidth,i=SJ((0,E.useState)(""),2),o=i[0],a=i[1],s=SJ((0,E.useState)(1),2),l=s[0],c=s[1],u=SJ((0,E.useState)(1),2),f=u[0],d=u[1],p=SJ((0,E.useState)(GJ),2),h=p[0],y=p[1],m=SJ((0,E.useState)(1),2),v=m[0],g=m[1],x=SJ((0,E.useState)(1),2),w=x[0],C=x[1],k=SJ((0,E.useState)([]),2),_=k[0],O=k[1],P=Ju().toast,T=10,A=SJ((0,E.useState)(!0),2),j=A[0],I=A[1],M=function(){return n.push("/")},D=function(){};(0,E.useEffect)((function(){bJ(void 0,void 0,void 0,(function(){var e,t;return wJ(this,(function(n){switch(n.label){case 0:I(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,vr({limit:T,page:l,year:h})];case 2:return e=n.sent(),g(e.count),O(e.videos),t=e.count<T?e.count:T,C(Math.ceil(e.count/t)),I(!1),[3,4];case 3:return n.sent(),I(!1),[3,4];case 4:return[2]}}))}))}),[T,l,h]);for(var R=function(e,t,n,r){return void 0===e&&(e=""),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=!0),bJ(void 0,void 0,void 0,(function(){return wJ(this,(function(i){return e.length<2&&""!==e||(e!==o&&(a(e),t=1,c(1)),f>0&&clearTimeout(f),D(),new Promise((function(t,n){D=n,d(setTimeout(t,e!==o?500:0))})).then((function(){return bJ(void 0,void 0,void 0,(function(){var i;return wJ(this,(function(o){switch(o.label){case 0:I(!0),0===n&&(n=h),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,vr({limit:T,search:e,page:t,year:n,ascOrder:r})];case 2:return i=o.sent(),g(i.count),O(i.videos),C(Math.ceil(i.count/T)),I(!1),[3,4];case 3:return o.sent(),I(!1),[3,4];case 4:return[2]}}))}))}))),[2]}))}))},F=function(e){"left"===e&&(R(o,l-1,h),c((function(e){return e-1}))),"right"===e&&(R(o,l+1,h),c((function(e){return e+1})))},L=[],B=GJ+1;B>2007;B--)L.push({value:B.toString(),label:B.toString()});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(CJ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return M()}}),center:(0,t.jsx)(EJ,{children:"Wheels TV Import"})}),(0,t.jsx)(so,{children:(0,t.jsxs)(kJ,{children:[(0,t.jsx)(yJ,{handleSearch:R,prevSearch:o}),(0,t.jsx)(_J,{children:(0,t.jsx)(bl,{value:{value:h.toString()||"",label:h.toString()||""},onChange:function(e){y(e.value),c(1),R(o,1,e.value)},options:L,isSearchable:!1})})]})})]}),(0,t.jsx)(OJ,{children:(0,t.jsx)(so,xJ({extendStyle:{wrapper:{padding:r>=ni?"32px 16px":"16px 0px"}}},{children:j?(0,t.jsx)(LJ,{children:(0,t.jsx)(Eo,{isLoading:j})}):!_.length&&o?(0,t.jsxs)(BJ,{children:[(0,t.jsxs)("p",{children:["There are no videos with “",o,"” in the title"]}),(0,t.jsx)("p",{children:"Try using a different search term"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(AJ,{children:[r>=ni&&(0,t.jsx)(MJ,{children:(0,t.jsx)(jJ,{children:"Year"})}),(0,t.jsx)(DJ,{children:(0,t.jsx)(jJ,{children:"Make"})}),(0,t.jsx)(RJ,{children:(0,t.jsx)(jJ,{children:"Model"})}),(0,t.jsx)(IJ,{children:(0,t.jsx)(jJ,{children:"Title"})})]}),(0,t.jsx)(PJ,{children:_.map((function(e){return(0,t.jsxs)(TJ,xJ({onClick:function(){}},{children:[r>=ni&&(0,t.jsx)(MJ,{children:e.year}),(0,t.jsx)(DJ,{children:e.make}),(0,t.jsx)(RJ,{children:e.model}),(0,t.jsx)(IJ,{children:e.title}),(0,t.jsx)(FJ,{children:(0,t.jsx)(NJ,xJ({onClick:function(){return bJ(void 0,void 0,void 0,(function(){return wJ(this,(function(t){return function(e){bJ(void 0,void 0,void 0,(function(){return wJ(this,(function(t){switch(t.label){case 0:I(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(n={title:e.year+" "+e.make+" "+e.model,flvName:e.videoURL,animatedGifPath:e.animatedGifPath,year:e.year,make:e.make,model:e.model,wtvId:e.videoId},pr(void 0,void 0,void 0,(function(){var e,t,r;return hr(this,(function(i){switch(i.label){case 0:return e=S.bearerToken,t={title:n.title,flvName:n.flvName,wtvId:parseInt(n.wtvId.toString(),10),animatedGifPath:n.animatedGifPath,notes:n.year+";"+n.make+";"+n.model+";"+n.title},[4,Tn({url:"/wtv/videos",baseURL:b,method:mr,headers:e,data:t}).catch((function(e){return e}))];case 1:if((r=i.sent())instanceof Error)throw r;return[2,r]}}))})))];case 2:return t.sent(),I(!1),P({message:"Video has been added!"}),M(),[3,4];case 3:return t.sent(),I(!1),P({message:"An error occured while trying to add the video!"}),[3,4];case 4:return[2]}var n}))}))}(e),[2]}))}))}},{children:"Add"}))})]}),e.videoId)}))}),(0,t.jsx)(zJ,{children:(0,t.jsxs)(HJ,{children:[(0,t.jsx)(VJ,{children:"Go to:"}),(0,t.jsx)(UJ,{type:"number",min:1,value:l,onChange:function(e){if(e.currentTarget&&e.currentTarget.value){var t=e.currentTarget.value;t>w&&(t=w),c(t),R(o,t,h)}}}),(0,t.jsx)(vJ,{page:l-1,size:T,count:v}),(0,t.jsx)(yo,{onClick:function(){return F("left")},icon:(0,t.jsx)(Hc,{size:20}),disabled:1===l,backgroundColor:wi,borderColor:bi,padding:"0 8px",margin:"0 0 0 16px"}),(0,t.jsx)(yo,{onClick:function(){return F("right")},icon:(0,t.jsx)(Gc,{size:20}),disabled:l===w,backgroundColor:wi,borderColor:bi,padding:"0 8px"})]})})]})}))})]})},qJ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$J=function(){return $J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$J.apply(this,arguments)},ZJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},YJ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},QJ=tt.div(VX||(VX=qJ(["\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 2px;\n display: flex;\n flex-direction: column;\n margin-left: 20px;\n height: 85px;\n"],["\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 2px;\n display: flex;\n flex-direction: column;\n margin-left: 20px;\n height: 85px;\n"]))),KJ=tt.div(UX||(UX=qJ(["\n position: relative;\n left: ",";\n width: ",";\n max-width: 100%;\n"],["\n position: relative;\n left: ",";\n width: ",";\n max-width: 100%;\n"])),(function(e){return e.offset}),(function(e){return e.width})),XJ=function(e){var n=e.index,r=e.totalDuration,i=e.offset,o=e.width,a=e.video,s=void 0===a?{}:a,l=e.setVideos,c=void 0===l?function(){}:l,u=E.useRef([0,0]),f=ZJ((0,E.useState)([0,s.duration]),2),d=f[0],p=f[1];(0,E.useEffect)((function(){c((function(e){var t=YJ([],ZJ(e),!1),r=d[0],i=d[1],o="#t=".concat(r||0).concat(i?","+i:"");return t[n]=$J($J({},t[n]),{start:wt(d[0]),end:wt(d[1]),startSec:r,endSec:i,source:(""+s.source).split("#t=")[0]+o}),t}))}),[d]);var h=function(e){var t=e[1]-e[0];c((function(e){var i=YJ([],ZJ(e),!1);return i[n]=$J($J({},i[n]),{width:100*t/r,trimDuration:t}),i}))};return(0,E.useEffect)((function(){r&&c((function(e){var t=YJ([],ZJ(e),!1);return t[n]=$J($J({},t[n]),{width:100*s.trimDuration/r}),t}))}),[r]),(0,E.useMemo)((function(){return(0,t.jsx)(QJ,{children:(0,t.jsx)(KJ,$J({offset:"".concat(i||0,"px"),width:"".concat(o||0,"px")},{children:!!s.duration&&s.ref&&(0,t.jsx)(tG,{videoRef:s.ref,videoDuration:s.duration,videoSource:s.videoSource,setValue:p,showTickTime:!1,value:d,valueRef:u,width:"100%",onSlideEnd:h})}))},s.id)}),[s.width,s.ref,d,i,o])};function JJ(){return JJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JJ.apply(this,arguments)}const e0=tt((function(e){return E.createElement("svg",JJ({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),HX||(HX=E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 17C21.5523 17 22 16.5523 22 16C22 15.4477 21.5523 15 21 15H3C2.44772 15 2 15.4477 2 16C2 16.5523 2.44772 17 3 17H21ZM21 13C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11H3C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13H21ZM2 8C2 8.55228 2.44772 9 3 9H21C21.5523 9 22 8.55228 22 8C22 7.44772 21.5523 7 21 7H3C2.44772 7 2 7.44772 2 8Z",fill:"#001B53",fillOpacity:.4})))}))(t0||(t0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var t0,n0,r0,i0,o0,a0,s0,l0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},c0=function(){return c0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c0.apply(this,arguments)},u0=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},f0=tt.div(n0||(n0=l0(["\n background-color: ",";\n max-height: 80px;\n align-self: center;\n border-radius: 6px;\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n aspect-ratio: 16 / 9;\n div {\n display: contents;\n opacity: 0;\n div {\n display: none;\n opacity: 0;\n }\n svg {\n display: none;\n opacity: 0;\n }\n path {\n display: none;\n opacity: 0;\n }\n figure {\n display: contents;\n opacity: 0;\n }\n video {\n display: contents;\n opacity: 0;\n }\n img {\n display: contents;\n opacity: 0;\n }\n }\n"],["\n background-color: ",";\n max-height: 80px;\n align-self: center;\n border-radius: 6px;\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n aspect-ratio: 16 / 9;\n div {\n display: contents;\n opacity: 0;\n div {\n display: none;\n opacity: 0;\n }\n svg {\n display: none;\n opacity: 0;\n }\n path {\n display: none;\n opacity: 0;\n }\n figure {\n display: contents;\n opacity: 0;\n }\n video {\n display: contents;\n opacity: 0;\n }\n img {\n display: contents;\n opacity: 0;\n }\n }\n"])),mi),d0=tt.img(r0||(r0=l0(["\n background-color: ",";\n display: block;\n height: 100%;\n margin: auto;\n border-radius: 6px;\n"],["\n background-color: ",";\n display: block;\n height: 100%;\n margin: auto;\n border-radius: 6px;\n"])),mi),p0=tt.div(i0||(i0=l0(["\n padding-right: 32px;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n background-color: #fff;\n height: 80px;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n"],["\n padding-right: 32px;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n background-color: #fff;\n height: 80px;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n"]))),h0=tt.div(o0||(o0=l0(["\n display: flex;\n justify-content: center;\n height: 80px;\n width: 48px;\n align-items: center;\n opacity: 0.8;\n &:hover {\n cursor: pointer;\n opacity: 1;\n }\n"],["\n display: flex;\n justify-content: center;\n height: 80px;\n width: 48px;\n align-items: center;\n opacity: 0.8;\n &:hover {\n cursor: pointer;\n opacity: 1;\n }\n"]))),y0=function(e){var n=e.video,r=void 0===n?{}:n,i=e.setVideos,o=void 0===i?function(){}:i,a=e.setVideoRef,s=e.index,l=E.createRef(),c=u0((0,E.useState)(0),2),u=c[0],f=c[1];return(0,E.useEffect)((function(){u&&o((function(e){var t=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],u0(e),!1);return t[s]=c0(c0({},t[s]),{duration:u,trimDuration:u}),t}))}),[u]),(0,E.useEffect)((function(){l&&l.current&&(l.current.onloadedmetadata=function(){return function(){if(l.current){var e=l.current.duration;f(e)}}()},a(s,l))}),[l]),(0,E.useMemo)((function(){return(0,t.jsxs)(p0,{children:[(0,t.jsx)(h0,{children:(0,t.jsx)(e0,{})}),(0,t.jsxs)(f0,{children:[(0,t.jsx)(d0,{src:r.autogeneratedThumbnail}),(0,t.jsx)(FU,{videoSource:r.videoSource,videoId:r.id,thumbnail:r.autogeneratedThumbnail,videoRef:l,autoplay:!1})]})]},r.id)}),[r.videoSource])};function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m0.apply(this,arguments)}const v0=tt((function(e){return E.createElement("svg",m0({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),a0||(a0=E.createElement("defs",null,E.createElement("path",{id:"p1bfbm3cda",d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.26 4.25c.41.41 1.07.41 1.48 0l.01-.01c.41-.41.41-1.07 0-1.48L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-2-5h4c.28 0 .5.22.5.5s-.22.5-.5.5h-4c-.28 0-.5-.22-.5-.5s.22-.5.5-.5z"}))),s0||(s0=E.createElement("g",{fill:"none",fillRule:"evenodd",opacity:.2},E.createElement("g",null,E.createElement("g",null,E.createElement("g",{transform:"translate(-1112 -640) translate(1104 632) translate(8 8)"},E.createElement("mask",{id:"98kq0pmrgb",fill:"#fff"},E.createElement("use",{xlinkHref:"#p1bfbm3cda"})),E.createElement("use",{fill:"#000",fillRule:"nonzero",xlinkHref:"#p1bfbm3cda"}),E.createElement("g",{fill:"#272A32",mask:"url(#98kq0pmrgb)"},E.createElement("path",{d:"M0 0H24V24H0z"}))))))))}))(g0||(g0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var g0,x0,b0;function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w0.apply(this,arguments)}const S0=tt((function(e){return E.createElement("svg",w0({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),x0||(x0=E.createElement("defs",null,E.createElement("path",{id:"eekoyvk17a",d:"M15.499 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.78 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.26 4.25c.41.41 1.07.41 1.48 0l.01-.01c.41-.41.41-1.07 0-1.48L15.499 14zm-6 0c-2.49 0-4.5-2.01-4.5-4.5S7.009 5 9.499 5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-7c-.28 0-.5.22-.5.5V9h-1.5c-.28 0-.5.22-.5.5s.22.5.5.5h1.5v1.5c0 .28.22.5.5.5s.5-.22.5-.5V10h1.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1.5V7.5c0-.28-.22-.5-.5-.5z"}))),b0||(b0=E.createElement("g",{fill:"none",fillRule:"evenodd"},E.createElement("g",null,E.createElement("g",null,E.createElement("g",null,E.createElement("g",{transform:"translate(-1376 -640) translate(1104 632) translate(264) translate(8 8)"},E.createElement("mask",{id:"4qknrgzsbb",fill:"#fff"},E.createElement("use",{xlinkHref:"#eekoyvk17a"})),E.createElement("g",{fill:"#272A32",mask:"url(#4qknrgzsbb)"},E.createElement("path",{d:"M0 0H24V24H0z"})))))))))}))(C0||(C0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var C0,E0,k0,_0,O0,P0,T0,A0,j0,I0,M0,D0,R0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},F0=function(){return F0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},F0.apply(this,arguments)},L0=tt.div(A0||(A0=R0(["\n display: ",";\n justify-content: center;\n align-items: center;\n background-color: ",";\n opacity: 0.5;\n font-size: ",";\n cursor: pointer;\n width: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n height: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n position: absolute;\n\n z-index: 9;\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"],["\n display: ",";\n justify-content: center;\n align-items: center;\n background-color: ",";\n opacity: 0.5;\n font-size: ",";\n cursor: pointer;\n width: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n height: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n position: absolute;\n\n z-index: 9;\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"])),(function(e){return e.isVideoPaused?"flex":"none"}),(function(e){return e.hex}),(function(e){return e.small?"10px":"40px"}),(function(e){return"".concat(e.small?"30px":"54px")}),(function(e){return"".concat(e.small?"30px":"54px")}),(function(e){return"center"===e.playButtonPosition&&Ne(E0||(E0=R0(["\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n "],["\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n "])))}),(function(e){return"top-left"===e.playButtonPosition&&Ne(k0||(k0=R0(["\n top: 5%;\n left: 5%;\n "],["\n top: 5%;\n left: 5%;\n "])))}),(function(e){return"top-right"===e.playButtonPosition&&Ne(_0||(_0=R0(["\n top: 5%;\n right: 5%;\n "],["\n top: 5%;\n right: 5%;\n "])))}),(function(e){return"bottom-left"===e.playButtonPosition&&Ne(O0||(O0=R0(["\n bottom: 23%;\n left: 5%;\n "],["\n bottom: 23%;\n left: 5%;\n "])))}),(function(e){return"bottom-right"===e.playButtonPosition&&Ne(P0||(P0=R0(["\n bottom: 23%;\n right: 5%;\n "],["\n bottom: 23%;\n right: 5%;\n "])))}),(function(e){return"none"===e.playButtonPosition&&Ne(T0||(T0=R0(["\n display: none;\n "],["\n display: none;\n "])))})),B0=function(e){var n=e.playerBackgroundColor,r=e.playButtonPosition,i=e.isVideoPaused,o=e.togglePlay,a=e.playerIconsColor,s=e.small,l=aV.hex.rgb(n);return(0,t.jsx)(L0,F0({isVideoPaused:i,onClick:o,r:l[0],g:l[1],b:l[2],hex:n,playButtonPosition:r,small:s},{children:(0,t.jsx)(Dc,{color:a})}))},N0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},z0=function(){return z0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z0.apply(this,arguments)},V0=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},U0=tt.div(I0||(I0=N0(["\n position: relative;\n background-color: ",";\n border-radius: 6px;\n width: ","px;\n height: ","px;\n max-width: 100%;\n ","\n"],["\n position: relative;\n background-color: ",";\n border-radius: 6px;\n width: ","px;\n height: ","px;\n max-width: 100%;\n ","\n"])),Ui,(function(e){return e.width||600}),(function(e){return e.height||300}),(function(e){return e.theme.containerWidth<=ti&&Ne(j0||(j0=N0(["\n border-radius: 0;\n "],["\n border-radius: 0;\n "])))})),H0=tt.div(M0||(M0=N0(["\n width: 100%;\n justify-content: center;\n display: flex;\n"],["\n width: 100%;\n justify-content: center;\n display: flex;\n"]))),G0=tt.input(D0||(D0=N0(["\n width: 100%;\n margin-top: -25px;\n z-index: 2;\n"],["\n width: 100%;\n margin-top: -25px;\n z-index: 2;\n"]))),W0=function(e){var n=e.width,r=e.height,i=e.displayVideos,o=k().useRef(null),a=k().useRef(0),s=V0(k().useState(!0),2),l=(s[0],s[1]),c=V0(k().useState(!1),2),u=c[0],f=c[1],d=V0(k().useState(0),2),p=d[0],h=d[1],y=V0(k().useState(0),2),m=y[0],v=y[1];k().useEffect((function(){a.current=0;for(var e=0,t=0;t<i.length;t++){var n=i[t].startSec?i[t].startSec:0;e+=(i[t].endSec?i[t].endSec:i[t].duration)-n}h(e||1)}),[i]);var g=function(){if(o.current){var e=o.current;l(!0);var t=++a.current;if(i.length>t){e.src=i[t].source;var n=i[t].startSec?i[t].startSec:0;e.currentTime=n}else a.current=0,e.src=i[0].source,e.pause(),f(!1)}},x=function(){var e=o.current;e&&(u?e.pause():e.play(),f(!u))};return(0,t.jsxs)(U0,z0({width:n,height:r},{children:[(0,t.jsx)("video",{preload:"metadata",width:n,height:r,ref:o,onTimeUpdate:function(){if(o.current){var e=a.current,t=o.current,n=t.currentTime;n=(n-=i[e].startSec?i[e].startSec:0)<0?0:n;for(var r=0;r<e;r++){var s=i[r].startSec?i[r].startSec:0;n+=(i[r].endSec?i[r].endSec:i[r].duration)-s}i[e].endSec<=t.currentTime&&g(),v(n)}},onLoadedMetadata:function(){l(!1)},onEnded:g,onCanPlayThrough:function(){o.current&&a.current>0&&u&&o.current.play()},src:"".concat(i[a.current].source),onClick:x,style:{maxWidth:"100%"}}),(0,t.jsx)(B0,{playerBackgroundColor:"#fff",playButtonPosition:"center",isVideoPaused:!u,togglePlay:x,playerIconsColor:Ui}),(0,t.jsx)(H0,{children:(0,t.jsx)(G0,{onChange:function(e){!function(e){var t=parseFloat(e.currentTarget.value);if(o.current)for(var n=o.current,r=a.current,s=0,c=0,u=0;u<i.length;u++){var f=i[u].startSec?i[u].startSec:0;if(c+=(i[u].endSec?i[u].endSec:i[u].duration)-f,t>=s&&t<c){r!==u&&(l(!0),a.current=u,n.src=i[u].source),n.currentTime=t-s+f;break}s=c}}(e)},value:m,max:p,min:"0",type:"range",step:"0.01"})})]}))};function q0(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var $0="function"==typeof Symbol&&Symbol.observable||"@@observable",Z0=function(){return Math.random().toString(36).substring(7).split("").join(".")},Y0={INIT:"@@redux/INIT"+Z0(),REPLACE:"@@redux/REPLACE"+Z0(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Z0()}};function Q0(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(q0(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(q0(1));return n(Q0)(e,t)}if("function"!=typeof e)throw new Error(q0(2));var i=e,o=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(q0(3));return o}function f(e){if("function"!=typeof e)throw new Error(q0(4));if(l)throw new Error(q0(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(q0(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(q0(7));if(void 0===e.type)throw new Error(q0(8));if(l)throw new Error(q0(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++)(0,t[n])();return e}return d({type:Y0.INIT}),(r={dispatch:d,subscribe:f,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(q0(10));i=e,d({type:Y0.REPLACE})}})[$0]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(q0(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[$0]=function(){return this},e},r}function K0(e,t){return function(){return t(e.apply(this,arguments))}}function X0(e,t){if("function"==typeof e)return K0(e,t);if("object"!=typeof e||null===e)throw new Error(q0(16));var n={};for(var r in e){var i=e[r];"function"==typeof i&&(n[r]=K0(i,t))}return n}function J0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var e1=k().createContext(null),t1=function(e){e()},n1=function(){return t1},r1={notify:function(){},get:function(){return[]}};function i1(e,t){var n,r=r1;function i(){a.onStateChange&&a.onStateChange()}function o(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){var e=n1(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}())}var a={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=r1)},getListeners:function(){return r}};return a}var o1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect;const a1=function(e){var t=e.store,n=e.context,r=e.children,i=(0,E.useMemo)((function(){var e=i1(t);return{store:t,subscription:e}}),[t]),o=(0,E.useMemo)((function(){return t.getState()}),[t]);o1((function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[i,o]);var a=n||e1;return k().createElement(a.Provider,{value:i},r)};var s1=__webpack_require__(2973),l1=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],c1=["reactReduxForwardedRef"],u1=[],f1=[null,null];function d1(e,t){var n=e[1];return[t.payload,n+1]}function p1(e,t,n){o1((function(){return e.apply(void 0,t)}),n)}function h1(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function y1(e,t,n,r,i,o,a,s,l,c){if(e){var u=!1,f=null,d=function(){if(!u){var e,n,d=t.getState();try{e=r(d,i.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?a.current||l():(o.current=e,s.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=d,n.trySubscribe(),d(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var m1=function(){return[null,0]};function v1(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,i=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,o=n.methodName,a=void 0===o?"connectAdvanced":o,s=n.renderCountProp,l=void 0===s?void 0:s,c=n.shouldHandleStateChanges,u=void 0===c||c,f=n.storeKey,d=void 0===f?"store":f,p=(n.withRef,n.forwardRef),h=void 0!==p&&p,y=n.context,m=void 0===y?e1:y,v=Zt(n,l1),g=m;return function(t){var n=t.displayName||t.name||"Component",r=i(n),o=(0,Lt.Z)({},v,{getDisplayName:i,methodName:a,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:r,wrappedComponentName:n,WrappedComponent:t}),s=v.pure,c=s?E.useMemo:function(e){return e()};function f(n){var r=(0,E.useMemo)((function(){var e=n.reactReduxForwardedRef,t=Zt(n,c1);return[n.context,e,t]}),[n]),i=r[0],a=r[1],s=r[2],l=(0,E.useMemo)((function(){return i&&i.Consumer&&(0,s1.isContextConsumer)(k().createElement(i.Consumer,null))?i:g}),[i,g]),f=(0,E.useContext)(l),d=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var p=d?n.store:f.store,h=(0,E.useMemo)((function(){return function(t){return e(t.dispatch,o)}(p)}),[p]),y=(0,E.useMemo)((function(){if(!u)return f1;var e=i1(p,d?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,d,f]),m=y[0],v=y[1],x=(0,E.useMemo)((function(){return d?f:(0,Lt.Z)({},f,{subscription:m})}),[d,f,m]),b=(0,E.useReducer)(d1,u1,m1),w=b[0][0],S=b[1];if(w&&w.error)throw w.error;var C=(0,E.useRef)(),_=(0,E.useRef)(s),O=(0,E.useRef)(),P=(0,E.useRef)(!1),T=c((function(){return O.current&&s===_.current?O.current:h(p.getState(),s)}),[p,w,s]);p1(h1,[_,C,P,s,T,O,v]),p1(y1,[u,p,m,h,_,C,P,O,v,S],[p,m,h]);var A=(0,E.useMemo)((function(){return k().createElement(t,(0,Lt.Z)({},T,{ref:a}))}),[a,t,T]);return(0,E.useMemo)((function(){return u?k().createElement(l.Provider,{value:x},A):A}),[l,A,x])}var p=s?k().memo(f):f;if(p.WrappedComponent=t,p.displayName=f.displayName=r,h){var y=k().forwardRef((function(e,t){return k().createElement(p,(0,Lt.Z)({},e,{reactReduxForwardedRef:t}))}));return y.displayName=r,y.WrappedComponent=t,R()(y,t)}return R()(p,t)}}function g1(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function x1(e,t){if(g1(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!g1(e[n[i]],t[n[i]]))return!1;return!0}function b1(e){return function(t,n){var r=e(t,n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function w1(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function S1(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=w1(e);var i=r(t,n);return"function"==typeof i&&(r.mapToProps=i,r.dependsOnOwnProps=w1(i),i=r(t,n)),i},r}}const C1=[function(e){return"function"==typeof e?S1(e):void 0},function(e){return e?void 0:b1((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?b1((function(t){return function(e,t){var n={},r=function(r){var i=e[r];"function"==typeof i&&(n[r]=function(){return t(i.apply(void 0,arguments))})};for(var i in e)r(i);return n}(e,t)})):void 0}],E1=[function(e){return"function"==typeof e?S1(e):void 0},function(e){return e?void 0:b1((function(){return{}}))}];function k1(e,t,n){return(0,Lt.Z)({},n,e,t)}const _1=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,i=n.pure,o=n.areMergedPropsEqual,a=!1;return function(t,n,s){var l=e(t,n,s);return a?i&&o(l,r)||(r=l):(a=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return k1}}];var O1=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function P1(e,t,n,r){return function(i,o){return n(e(i,o),t(r,o),o)}}function T1(e,t,n,r,i){var o,a,s,l,c,u=i.areStatesEqual,f=i.areOwnPropsEqual,d=i.areStatePropsEqual,p=!1;return function(i,h){return p?function(i,p){var h,y,m=!f(p,a),v=!u(i,o,p,a);return o=i,a=p,m&&v?(s=e(o,a),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):m?(e.dependsOnOwnProps&&(s=e(o,a)),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):v?(h=e(o,a),y=!d(h,s),s=h,y&&(c=n(s,l,a)),c):c}(i,h):(s=e(o=i,a=h),l=t(r,a),c=n(s,l,a),p=!0,c)}}function A1(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,o=Zt(t,O1),a=n(e,o),s=r(e,o),l=i(e,o);return(o.pure?T1:P1)(a,s,l,e,o)}var j1=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function I1(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function M1(e,t){return e===t}function D1(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?v1:n,i=t.mapStateToPropsFactories,o=void 0===i?E1:i,a=t.mapDispatchToPropsFactories,s=void 0===a?C1:a,l=t.mergePropsFactories,c=void 0===l?_1:l,u=t.selectorFactory,f=void 0===u?A1:u;return function(e,t,n,i){void 0===i&&(i={});var a=i,l=a.pure,u=void 0===l||l,d=a.areStatesEqual,p=void 0===d?M1:d,h=a.areOwnPropsEqual,y=void 0===h?x1:h,m=a.areStatePropsEqual,v=void 0===m?x1:m,g=a.areMergedPropsEqual,x=void 0===g?x1:g,b=Zt(a,j1),w=I1(e,o,"mapStateToProps"),S=I1(t,s,"mapDispatchToProps"),C=I1(n,c,"mergeProps");return r(f,(0,Lt.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:w,initMapDispatchToProps:S,initMergeProps:C,pure:u,areStatesEqual:p,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:x},b))}}const R1=D1();var F1;function L1(e,t){var n=(0,E.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,E.useRef)(!0),i=(0,E.useRef)(n),o=r.current||Boolean(t&&i.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.current.inputs)),a=o?i.current:{inputs:t,result:e()};return(0,E.useEffect)((function(){r.current=!1,i.current=a}),[a]),a.result}F1=nt.unstable_batchedUpdates,t1=F1;var B1=L1,N1=function(e,t){return L1((function(){return e}),t)},z1=function(e){var t=e.top,n=e.right,r=e.bottom,i=e.left;return{top:t,right:n,bottom:r,left:i,width:n-i,height:r-t,x:i,y:t,center:{x:(n+i)/2,y:(r+t)/2}}},V1=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},U1=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},H1={top:0,right:0,bottom:0,left:0},G1=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?H1:n,i=e.border,o=void 0===i?H1:i,a=e.padding,s=void 0===a?H1:a,l=z1(V1(t,r)),c=z1(U1(t,o)),u=z1(U1(c,s));return{marginBox:l,borderBox:z1(t),paddingBox:c,contentBox:u,margin:r,border:o,padding:s}},W1=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&Wt(!1),n},q1=function(e,t){var n,r,i=e.borderBox,o=e.border,a=e.margin,s=e.padding,l=(r=t,{top:(n=i).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return G1({borderBox:l,border:o,margin:a,padding:s})},$1=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),q1(e,t)},Z1=function(e,t){var n={top:W1(t.marginTop),right:W1(t.marginRight),bottom:W1(t.marginBottom),left:W1(t.marginLeft)},r={top:W1(t.paddingTop),right:W1(t.paddingRight),bottom:W1(t.paddingBottom),left:W1(t.paddingLeft)},i={top:W1(t.borderTopWidth),right:W1(t.borderRightWidth),bottom:W1(t.borderBottomWidth),left:W1(t.borderLeftWidth)};return G1({borderBox:e,margin:n,padding:r,border:i})},Y1=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return Z1(t,n)};const Q1=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t=i,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function K1(e,t){}function X1(){}function J1(e,t,n){var r=t.map((function(t){var r,i,o=(r=n,i=t.options,(0,Lt.Z)({},r,{},i));return e.addEventListener(t.eventName,t.fn,o),function(){e.removeEventListener(t.eventName,t.fn,o)}}));return function(){r.forEach((function(e){e()}))}}K1.bind(null,"warn"),K1.bind(null,"error");var e2=!0,t2="Invariant failed";function n2(e){this.message=e}function r2(e,t){if(!e)throw new n2(e2?t2:t2+": "+(t||""))}n2.prototype.toString=function(){return this.message};var i2=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).callbacks=null,t.unbind=X1,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof n2&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}(0,Dt.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=J1(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof n2))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(k().Component),o2=function(e){return e+1},a2=function(e,t){var n=e.droppableId===t.droppableId,r=o2(e.index),i=o2(t.index);return n?"\n You have moved the item from position "+r+"\n to position "+i+"\n ":"\n You have moved the item from position "+r+"\n in list "+e.droppableId+"\n to list "+t.droppableId+"\n in position "+i+"\n "},s2=function(e,t,n){return t.droppableId===n.droppableId?"\n The item "+e+"\n has been combined with "+n.draggableId:"\n The item "+e+"\n in list "+t.droppableId+"\n has been combined with "+n.draggableId+"\n in list "+n.droppableId+"\n "},l2=function(e){return"\n The item has returned to its starting position\n of "+o2(e.index)+"\n"},c2=function(e){return"\n You have lifted an item in position "+o2(e.source.index)+"\n"},u2=function(e){var t=e.destination;if(t)return a2(e.source,t);var n=e.combine;return n?s2(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},f2=function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+l2(e.source)+"\n ";var t=e.destination,n=e.combine;return t?"\n You have dropped the item.\n "+a2(e.source,t)+"\n ":n?"\n You have dropped the item.\n "+s2(e.draggableId,e.source,n)+"\n ":"\n The item has been dropped while not over a drop area.\n "+l2(e.source)+"\n "},d2={x:0,y:0},p2=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},h2=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},y2=function(e,t){return e.x===t.x&&e.y===t.y},m2=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},v2=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},g2=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},x2=function(e,t){return Math.min.apply(Math,t.map((function(t){return g2(e,t)})))},b2=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},w2=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},S2=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},C2=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=z1({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):z1(e)},E2=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,i=e.frame,o=function(e,t){return t?w2(e,t.scroll.diff.displacement):e}(t.marginBox,i),a=function(e,t,n){var r;return n&&n.increasedBy?(0,Lt.Z)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(o,r,n);return{page:t,withPlaceholder:n,active:C2(a,i)}},k2=function(e,t){e.frame||r2(!1);var n=e.frame,r=h2(t,n.scroll.initial),i=m2(r),o=(0,Lt.Z)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}}),a=E2({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return(0,Lt.Z)({},e,{frame:o,subject:a})};function _2(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function O2(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function P2(e,t){if(e.find)return e.find(t);var n=O2(e,t);return-1!==n?e[n]:void 0}function T2(e){return Array.prototype.slice.call(e)}var A2=Ca((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),j2=Ca((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),I2=Ca((function(e){return _2(e)})),M2=Ca((function(e){return _2(e)})),D2=Ca((function(e,t){var n=M2(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}));return n}));function R2(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function F2(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var L2=Ca((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),B2=function(e,t){return e.descriptor.droppableId===t.descriptor.id},N2={point:d2,value:0},z2={invisible:{},visible:{},all:[]},V2={displaced:z2,displacedBy:N2,at:null},U2=function(e,t){return function(n){return e<=n&&n<=t}},H2=function(e){var t=U2(e.top,e.bottom),n=U2(e.left,e.right);return function(r){if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;var i=t(r.top)||t(r.bottom),o=n(r.left)||n(r.right);if(i&&o)return!0;var a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||a&&o||s&&i}},G2=function(e){var t=U2(e.top,e.bottom),n=U2(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},W2={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},q2={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},$2=function(e){var t=e.target,n=e.destination,r=e.viewport,i=e.withDroppableDisplacement,o=e.isVisibleThroughFrameFn,a=i?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:d2;return w2(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(a,n,o)&&function(e,t,n){return n(t)(e)}(a,r,o)},Z2=function(e){return $2((0,Lt.Z)({},e,{isVisibleThroughFrameFn:H2}))},Y2=function(e){return $2((0,Lt.Z)({},e,{isVisibleThroughFrameFn:G2}))},Q2=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,i=t.visible;if(r[e])return!1;var o=i[e];return!o||o.shouldAnimate};function K2(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,i=e.viewport,o=e.forceShouldAnimate,a=e.last;return t.reduce((function(e,t){var s=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return z1(V1(n,r))}(t,r),l=t.descriptor.id;if(e.all.push(l),!Z2({target:s,destination:n,viewport:i,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:l,shouldAnimate:Q2(l,a,o)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function X2(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,i=e.destination,o=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:z2,displacedBy:r,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function J2(e){var t=e.draggable,n=e.insideDestination,r=e.destination,i=e.viewport,o=e.displacedBy,a=e.last,s=e.index,l=e.forceShouldAnimate,c=B2(t,r);if(null==s)return X2({insideDestination:n,inHomeList:c,displacedBy:o,destination:r});var u=P2(n,(function(e){return e.descriptor.index===s}));if(!u)return X2({insideDestination:n,inHomeList:c,displacedBy:o,destination:r});var f=L2(t,n),d=n.indexOf(u);return{displaced:K2({afterDragging:f.slice(d),destination:r,displacedBy:o,last:a,viewport:i.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function e5(e,t){return Boolean(t.effected[e])}var t5=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},n5=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},r5=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return v2(t.line,n.marginBox[t.end]+t5(t,r),n5(t,n.marginBox,r))},i5=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return v2(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),n5(t,n.marginBox,r))},o5=function(e,t){var n=e.frame;return n?p2(t,n.scroll.diff.displacement):t},a5=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,o=e.afterCritical,a=n.page.borderBox.center,s=t.at;return r&&s?"REORDER"===s.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,i=e.droppable,o=e.afterCritical,a=D2(i.descriptor.id,r),s=n.page,l=i.axis;if(!a.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return v2(t.line,n.contentBox[t.start]+t5(t,r),n5(t,n.contentBox,r))}({axis:l,moveInto:i.page,isMoving:s});var c=t.displaced,u=t.displacedBy,f=c.all[0];if(f){var d=r[f];if(e5(f,o))return i5({axis:l,moveRelativeTo:d.page,isMoving:s});var p=q1(d.page,u.point);return i5({axis:l,moveRelativeTo:p,isMoving:s})}var h=a[a.length-1];if(h.descriptor.id===n.descriptor.id)return s.borderBox.center;if(e5(h.descriptor.id,o)){var y=q1(h.page,m2(o.displacedBy.point));return r5({axis:l,moveRelativeTo:y,isMoving:s})}return r5({axis:l,moveRelativeTo:h.page,isMoving:s})}({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:o}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,i=F2(n);i||r2(!1);var o=i.draggableId,a=r[o].page.borderBox.center,s=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,i=e.displacedBy,o=Boolean(t.visible[r]||t.invisible[r]);return e5(r,n)?o?d2:m2(i.point):o?i.point:d2}({displaced:n.displaced,afterCritical:t,combineWith:o,displacedBy:n.displacedBy});return p2(a,s)}({impact:t,draggables:i,afterCritical:o}):a}(e),n=e.droppable;return n?o5(n,t):t},s5=function(e,t){var n=h2(t,e.scroll.initial),r=m2(n);return{frame:z1({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function l5(e,t){return e.map((function(e){return t[e]}))}var c5=function(e){var t,n,r=e.pageBorderBoxCenter,i=e.draggable,o=(t=e.viewport,n=r,p2(t.scroll.diff.displacement,n)),a=h2(o,i.page.borderBox.center);return p2(i.client.borderBox.center,a)},u5=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,i=e.viewport,o=e.withDroppableDisplacement,a=e.onlyOnMainAxis,s=void 0!==a&&a,l=h2(r,t.page.borderBox.center),c={target:w2(t.page.borderBox,l),destination:n,withDroppableDisplacement:o,viewport:i};return s?function(e){return $2((0,Lt.Z)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=U2(e.top,e.bottom),r=U2(e.left,e.right);return function(e){return t===W2?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):Y2(c)},f5=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.draggables,o=e.previousImpact,a=e.viewport,s=e.previousPageBorderBoxCenter,l=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=D2(r.descriptor.id,i),f=B2(n,r),d=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.previousImpact;if(!r.isCombineEnabled)return null;if(!R2(o))return null;function a(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,Lt.Z)({},o,{at:t})}var s=o.displaced.all,l=s.length?s[0]:null;if(t)return l?a(l):null;var c=L2(n,i);if(!l)return c.length?a(c[c.length-1].descriptor.id):null;var u=O2(c,(function(e){return e.descriptor.id===l}));-1===u&&r2(!1);var f=u-1;return f<0?null:a(c[f].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:u,previousImpact:o})||function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,i=e.draggables,o=e.destination,a=e.insideDestination,s=e.previousImpact,l=e.viewport,c=e.afterCritical,u=s.at;if(u||r2(!1),"REORDER"===u.type){var f=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,i=e.location;if(!r.length)return null;var o=i.index,a=t?o+1:o-1,s=r[0].descriptor.index,l=r[r.length-1].descriptor.index;return a<s||a>(n?l:l+1)?null:a}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:a});return null==f?null:J2({draggable:r,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:f})}var d=function(e){var t=e.isMovingForward,n=e.draggables,r=e.combine,i=e.afterCritical;if(!e.destination.isCombineEnabled)return null;var o=r.draggableId,a=n[o].descriptor.index;return e5(o,i)?t?a:a-1:t?a+1:a}({isMovingForward:t,destination:o,displaced:s.displaced,draggables:i,combine:u.combine,afterCritical:c});return null==d?null:J2({draggable:r,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:d})}({isMovingForward:t,isInHomeList:f,draggable:n,draggables:i,destination:r,insideDestination:u,previousImpact:o,viewport:a,afterCritical:c});if(!d)return null;var p=a5({impact:d,draggable:n,droppable:r,draggables:i,afterCritical:c});if(u5({draggable:n,destination:r,newPageBorderBoxCenter:p,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:c5({pageBorderBoxCenter:p,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null};var h=h2(p,s),y=function(e){var t=e.impact,n=e.viewport,r=e.destination,i=e.draggables,o=e.maxScrollChange,a=s5(n,p2(n.scroll.current,o)),s=r.frame?k2(r,p2(r.frame.scroll.current,o)):r,l=t.displaced,c=K2({afterDragging:l5(l.all,i),destination:r,displacedBy:t.displacedBy,viewport:a.frame,last:l,forceShouldAnimate:!1}),u=K2({afterDragging:l5(l.all,i),destination:s,displacedBy:t.displacedBy,viewport:n.frame,last:l,forceShouldAnimate:!1}),f={},d={},p=[l,c,u];return l.all.forEach((function(e){var t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n].visible[e];if(r)return r}return null}(e,p);t?d[e]=t:f[e]=!0})),(0,Lt.Z)({},t,{displaced:{all:l.all,invisible:f,visible:d}})}({impact:d,viewport:a,destination:r,draggables:i,maxScrollChange:h});return{clientSelection:l,impact:y,scrollJumpRequest:h}},d5=function(e){var t=e.subject.active;return t||r2(!1),t},p5=function(e,t){var n=e.page.borderBox.center;return e5(e.descriptor.id,t)?h2(n,t.displacedBy.point):n},h5=function(e,t){var n=e.page.borderBox;return e5(e.descriptor.id,t)?w2(n,m2(t.displacedBy.point)):n},y5=Ca((function(e,t){var n=t[e.line];return{value:n,point:v2(e.line,n)}})),m5=function(e,t){return(0,Lt.Z)({},e,{scroll:(0,Lt.Z)({},e.scroll,{max:t})})},v5=function(e,t,n){var r=e.frame;B2(t,e)&&r2(!1),e.subject.withPlaceholder&&r2(!1);var i=y5(e.axis,t.displaceBy).point,o=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return v2(r.line,t[r.line]);var i=e.subject.page.contentBox[r.size],o=D2(e.descriptor.id,n).reduce((function(e,t){return e+t.client.marginBox[r.size]}),0)+t[r.line]-i;return o<=0?null:v2(r.line,o)}(e,i,n),a={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var s=E2({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return(0,Lt.Z)({},e,{subject:s})}var l=o?p2(r.scroll.max,o):r.scroll.max,c=m5(r,l),u=E2({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:c});return(0,Lt.Z)({},e,{subject:u,frame:c})},g5=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},x5=function(e){var t=e.state,n=e.type,r=function(e,t){var n=g5(e);return n?t[n]:null}(t.impact,t.dimensions.droppables),i=Boolean(r),o=t.dimensions.droppables[t.critical.droppable.id],a=r||o,s=a.axis.direction,l="vertical"===s&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===s&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(l&&!i)return null;var c="MOVE_DOWN"===n||"MOVE_RIGHT"===n,u=t.dimensions.draggables[t.critical.draggable.id],f=t.current.page.borderBoxCenter,d=t.dimensions,p=d.draggables,h=d.droppables;return l?f5({isMovingForward:c,previousPageBorderBoxCenter:f,draggable:u,destination:a,draggables:p,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,r=e.draggable,i=e.isOver,o=e.draggables,a=e.droppables,s=e.viewport,l=e.afterCritical,c=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,i=e.droppables,o=e.viewport,a=r.subject.active;if(!a)return null;var s=r.axis,l=U2(a[s.start],a[s.end]),c=I2(i).filter((function(e){return e!==r})).filter((function(e){return e.isEnabled})).filter((function(e){return Boolean(e.subject.active)})).filter((function(e){return H2(o.frame)(d5(e))})).filter((function(e){var n=d5(e);return t?a[s.crossAxisEnd]<n[s.crossAxisEnd]:n[s.crossAxisStart]<a[s.crossAxisStart]})).filter((function(e){var t=d5(e),n=U2(t[s.start],t[s.end]);return l(t[s.start])||l(t[s.end])||n(a[s.start])||n(a[s.end])})).sort((function(e,n){var r=d5(e)[s.crossAxisStart],i=d5(n)[s.crossAxisStart];return t?r-i:i-r})).filter((function(e,t,n){return d5(e)[s.crossAxisStart]===d5(n[0])[s.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return U2(d5(e)[s.start],d5(e)[s.end])(n[s.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return d5(e)[s.start]-d5(t)[s.start]}))[0]:c.sort((function(e,t){var r=x2(n,S2(d5(e))),i=x2(n,S2(d5(t)));return r!==i?r-i:d5(e)[s.start]-d5(t)[s.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:i,droppables:a,viewport:s});if(!c)return null;var u=D2(c.descriptor.id,o),f=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,i=e.afterCritical,o=e.insideDestination.filter((function(e){return Y2({target:h5(e,i),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var o=g2(t,o5(r,p5(e,i))),a=g2(t,o5(r,p5(n,i)));return o<a?-1:a<o?1:e.descriptor.index-n.descriptor.index}));return o[0]||null}({pageBorderBoxCenter:n,viewport:s,destination:c,insideDestination:u,afterCritical:l}),d=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,i=e.draggable,o=e.draggables,a=e.destination,s=e.viewport,l=e.afterCritical;if(!n){if(r.length)return null;var c={displaced:z2,displacedBy:N2,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:0}}},u=a5({impact:c,draggable:i,droppable:a,draggables:o,afterCritical:l}),f=B2(i,a)?a:v5(a,i,o);return u5({draggable:i,destination:f,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var d,p=Boolean(t[a.axis.line]<=n.page.borderBox.center[a.axis.line]),h=(d=n.descriptor.index,n.descriptor.id===i.descriptor.id||p?d:d+1);return J2({draggable:i,insideDestination:r,destination:a,viewport:s,displacedBy:y5(a.axis,i.displaceBy),last:z2,index:h})}({previousPageBorderBoxCenter:n,destination:c,draggable:r,draggables:o,moveRelativeTo:f,insideDestination:u,viewport:s,afterCritical:l});if(!d)return null;var p=a5({impact:d,draggable:r,droppable:c,draggables:o,afterCritical:l});return{clientSelection:c5({pageBorderBoxCenter:p,draggable:r,viewport:s}),impact:d,scrollJumpRequest:null}}({isMovingForward:c,previousPageBorderBoxCenter:f,draggable:u,isOver:a,draggables:p,droppables:h,viewport:t.viewport,afterCritical:t.afterCritical})};function b5(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function w5(e){var t=U2(e.top,e.bottom),n=U2(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var S5=function(e,t){return z1(w2(e,t))};function C5(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var E5=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,i=e.droppables,o=e.previousImpact,a=e.viewport,s=e.afterCritical,l=S5(n.page.borderBox,t),c=function(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,i=I2(r).filter((function(e){if(!e.isEnabled)return!1;var n,r,i=e.subject.active;if(!i)return!1;if(r=i,!((n=t).left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top))return!1;if(w5(i)(t.center))return!0;var o=e.axis,a=i.center[o.crossAxisLine],s=t[o.crossAxisStart],l=t[o.crossAxisEnd],c=U2(i[o.crossAxisStart],i[o.crossAxisEnd]),u=c(s),f=c(l);return!u&&!f||(u?s<a:l>a)}));return i.length?1===i.length?i[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.candidates,r=e.draggable.page.borderBox.center,i=n.map((function(e){var n=e.axis,i=v2(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:g2(r,i)}})).sort((function(e,t){return t.distance-e.distance}));return i[0]?i[0].id:null}({pageBorderBox:t,draggable:n,candidates:i}):null}({pageBorderBox:l,draggable:n,droppables:i});if(!c)return V2;var u=i[c],f=D2(u.descriptor.id,r),d=function(e,t){var n=e.frame;return n?S5(t,n.scroll.diff.value):t}(u,l);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,i=e.destination,o=e.insideDestination,a=e.afterCritical;if(!i.isCombineEnabled)return null;var s=i.axis,l=y5(i.axis,t.displaceBy),c=l.value,u=n[s.start],f=n[s.end],d=P2(L2(t,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox,i=n[s.size]/4,o=e5(t,a),l=C5({displaced:r.displaced,id:t});return o?l?f>n[s.start]+i&&f<n[s.end]-i:u>n[s.start]-c+i&&u<n[s.end]-c-i:l?f>n[s.start]+c+i&&f<n[s.end]+c-i:u>n[s.start]+i&&u<n[s.end]-i}));return d?{displacedBy:l,displaced:r.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:i.descriptor.id}}}:null}({pageBorderBoxWithDroppableScroll:d,draggable:n,previousImpact:o,destination:u,insideDestination:f,afterCritical:s})||function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.last,a=e.viewport,s=e.afterCritical,l=r.axis,c=y5(r.axis,n.displaceBy),u=c.value,f=t[l.start],d=t[l.end],p=function(e){var t=e.draggable,n=e.closest;return n?e.inHomeList&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:P2(L2(n,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[l.line],r=e5(t,s),i=C5({displaced:o,id:t});return r?i?d<=n:f<n-u:i?d<=n+u:f<n})),inHomeList:B2(n,r)});return J2({draggable:n,insideDestination:i,destination:r,viewport:a,last:o,displacedBy:c,index:p})}({pageBorderBoxWithDroppableScroll:d,draggable:n,destination:u,insideDestination:f,last:o.displaced,viewport:a,afterCritical:s})},k5=function(e,t){var n;return(0,Lt.Z)({},e,((n={})[t.descriptor.id]=t,n))},_5=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,i=e.viewport,o=e.impact,a=e.scrollJumpRequest,s=i||t.viewport,l=r||t.dimensions,c=n||t.current.client.selection,u=h2(c,t.initial.client.selection),f={offset:u,selection:c,borderBoxCenter:p2(t.initial.client.borderBoxCenter,u)},d={selection:p2(f.selection,s.scroll.current),borderBoxCenter:p2(f.borderBoxCenter,s.scroll.current),offset:p2(f.offset,s.scroll.diff.value)},p={client:f,page:d};if("COLLECTING"===t.phase)return(0,Lt.Z)({phase:"COLLECTING"},t,{dimensions:l,viewport:s,current:p});var h=l.draggables[t.critical.draggable.id],y=o||E5({pageOffset:d.offset,draggable:h,draggables:l.draggables,droppables:l.droppables,previousImpact:t.impact,viewport:s,afterCritical:t.afterCritical}),m=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,i=e.impact,o=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,i=g5(t),o=g5(n);if(!i)return r;if(i===o)return r;var a=r[i];if(!a.subject.withPlaceholder)return r;var s=function(e){var t=e.subject.withPlaceholder;t||r2(!1);var n=e.frame;if(!n){var r=E2({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,Lt.Z)({},e,{subject:r})}var i=t.oldFrameMaxScroll;i||r2(!1);var o=m5(n,i),a=E2({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return(0,Lt.Z)({},e,{subject:a,frame:o})}(a);return k5(r,s)}({previousImpact:e.previousImpact,impact:i,droppables:r}),a=g5(i);if(!a)return o;var s=r[a];if(B2(t,s))return o;if(s.subject.withPlaceholder)return o;var l=v5(s,t,n);return k5(o,l)}({draggable:h,impact:y,previousImpact:t.impact,draggables:l.draggables,droppables:l.droppables});return(0,Lt.Z)({},t,{current:p,dimensions:{draggables:l.draggables,droppables:m},impact:y,viewport:s,scrollJumpRequest:a||null,forceShouldAnimate:!a&&null})},O5=function(e){var t=e.impact,n=e.viewport,r=e.draggables,i=e.destination,o=e.forceShouldAnimate,a=t.displaced,s=function(e,t){return e.map((function(e){return t[e]}))}(a.all,r),l=K2({afterDragging:s,destination:i,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:o,last:a});return(0,Lt.Z)({},t,{displaced:l})},P5=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,o=e.viewport,a=e.afterCritical,s=a5({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:a});return c5({pageBorderBoxCenter:s,draggable:n,viewport:o})},T5=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&r2(!1);var i=t.impact,o=r||t.viewport,a=n||t.dimensions,s=a.draggables,l=a.droppables,c=s[t.critical.draggable.id],u=g5(i);u||r2(!1);var f=l[u],d=O5({impact:i,viewport:o,destination:f,draggables:s}),p=P5({impact:d,draggable:c,droppable:f,draggables:s,viewport:o,afterCritical:t.afterCritical});return _5({impact:d,clientSelection:p,state:t,dimensions:a,viewport:o})},A5=function(e){var t=e.draggable,n=e.home,r=e.draggables,i=e.viewport,o=y5(n.axis,t.displaceBy),a=D2(n.descriptor.id,r),s=a.indexOf(t);-1===s&&r2(!1);var l,c=a.slice(s+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),f={inVirtualList:"virtual"===n.descriptor.mode,displacedBy:o,effected:u};return{impact:{displaced:K2({afterDragging:c,destination:n,displacedBy:o,last:null,viewport:i.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(l=t.descriptor,{index:l.index,droppableId:l.droppableId})}},afterCritical:f}},j5=function(e){return"SNAP"===e.movementMode},I5=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:k5(e.droppables,t)}}(e.dimensions,t);return!j5(e)||n?_5({state:e,dimensions:r}):T5({state:e,dimensions:r})};function M5(e){return e.isDragging&&"SNAP"===e.movementMode?(0,Lt.Z)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var D5={phase:"IDLE",completed:null,shouldFlush:!1},R5=function(e,t){if(void 0===e&&(e=D5),"FLUSH"===t.type)return(0,Lt.Z)({},D5,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&r2(!1);var n=t.payload,r=n.critical,i=n.clientSelection,o=n.viewport,a=n.dimensions,s=n.movementMode,l=a.draggables[r.draggable.id],c=a.droppables[r.droppable.id],u={selection:i,borderBoxCenter:l.client.borderBox.center,offset:d2},f={client:u,page:{selection:p2(u.selection,o.scroll.initial),borderBoxCenter:p2(u.selection,o.scroll.initial),offset:p2(u.selection,o.scroll.diff.value)}},d=I2(a.droppables).every((function(e){return!e.isFixedOnPage})),p=A5({draggable:l,home:c,draggables:a.draggables,viewport:o}),h=p.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:s,dimensions:a,initial:f,current:f,isWindowScrollAllowed:d,impact:h,afterCritical:p.afterCritical,onLiftImpact:h,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&r2(!1),(0,Lt.Z)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&r2(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return k2(n,e.scroll)})),i=(0,Lt.Z)({},t.dimensions.droppables,{},A2(r)),o=j2(function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,i=r.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,o=function(e){var t=e.frame;return t||r2(!1),t}(n[t]),a=o.scroll.diff.value,s=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,i=q1(t.client,n),o=$1(i,r);return(0,Lt.Z)({},t,{placeholder:(0,Lt.Z)({},t.placeholder,{client:i}),client:i,page:o})}({draggable:e,offset:p2(i,a),initialWindowScroll:r.scroll.initial});return s}))}({additions:n.additions,updatedDroppables:i,viewport:t.viewport})),a=(0,Lt.Z)({},t.dimensions.draggables,{},o);n.removals.forEach((function(e){delete a[e]}));var s={droppables:i,draggables:a},l=g5(t.impact),c=l?s.droppables[l]:null,u=s.draggables[t.critical.draggable.id],f=s.droppables[t.critical.droppable.id],d=A5({draggable:u,home:f,draggables:a,viewport:t.viewport}),p=d.impact,h=d.afterCritical,y=c&&c.isCombineEnabled?t.impact:p,m=E5({pageOffset:t.current.page.offset,draggable:s.draggables[t.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:y,viewport:t.viewport,afterCritical:h}),v=(0,Lt.Z)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:m,onLiftImpact:p,dimensions:s,afterCritical:h,forceShouldAnimate:!1});return"COLLECTING"===t.phase?v:(0,Lt.Z)({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;b5(e)||r2(!1);var y=t.payload.client;return y2(y,e.current.client.selection)?e:_5({state:e,clientSelection:y,impact:j5(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return M5(e);if("COLLECTING"===e.phase)return M5(e);b5(e)||r2(!1);var m=t.payload,v=m.id,g=m.newScroll,x=e.dimensions.droppables[v];if(!x)return e;var b=k2(x,g);return I5(e,b,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;b5(e)||r2(!1);var w=t.payload,S=w.id,C=w.isEnabled,E=e.dimensions.droppables[S];E||r2(!1),E.isEnabled===C&&r2(!1);var k=(0,Lt.Z)({},E,{isEnabled:C});return I5(e,k,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;b5(e)||r2(!1);var _=t.payload,O=_.id,P=_.isCombineEnabled,T=e.dimensions.droppables[O];T||r2(!1),T.isCombineEnabled===P&&r2(!1);var A=(0,Lt.Z)({},T,{isCombineEnabled:P});return I5(e,A,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;b5(e)||r2(!1),e.isWindowScrollAllowed||r2(!1);var j=t.payload.newScroll;if(y2(e.viewport.scroll.current,j))return M5(e);var I=s5(e.viewport,j);return j5(e)?T5({state:e,viewport:I}):_5({state:e,viewport:I})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!b5(e))return e;var M=t.payload.maxScroll;if(y2(M,e.viewport.scroll.max))return e;var D=(0,Lt.Z)({},e.viewport,{scroll:(0,Lt.Z)({},e.viewport.scroll,{max:M})});return(0,Lt.Z)({phase:"DRAGGING"},e,{viewport:D})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&r2(!1);var R=x5({state:e,type:t.type});return R?_5({state:e,impact:R.impact,clientSelection:R.clientSelection,scrollJumpRequest:R.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var F=t.payload.reason;return"COLLECTING"!==e.phase&&r2(!1),(0,Lt.Z)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:F})}if("DROP_ANIMATE"===t.type){var L=t.payload,B=L.completed,N=L.dropDuration,z=L.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&r2(!1),{phase:"DROP_ANIMATING",completed:B,dropDuration:N,newHomeClientOffset:z,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},F5=function(e){return{type:"LIFT",payload:e}},L5=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},B5=function(){return{type:"COLLECTION_STARTING",payload:null}},N5=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},z5=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},V5=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},U5=function(e){return{type:"MOVE",payload:e}},H5=function(){return{type:"MOVE_UP",payload:null}},G5=function(){return{type:"MOVE_DOWN",payload:null}},W5=function(){return{type:"MOVE_RIGHT",payload:null}},q5=function(){return{type:"MOVE_LEFT",payload:null}},$5=function(){return{type:"FLUSH",payload:null}},Z5=function(e){return{type:"DROP_COMPLETE",payload:e}},Y5=function(e){return{type:"DROP",payload:e}},Q5="cubic-bezier(.2,1,.1,1)",K5=0,X5=.7,J5=.75,e3="0.2s cubic-bezier(0.2, 0, 0, 1)",t3={fluid:"opacity "+e3,snap:"transform "+e3+", opacity "+e3,drop:function(e){var t=e+"s "+Q5;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+e3,placeholder:"height "+e3+", width "+e3+", margin "+e3},n3=function(e){return y2(e,d2)?null:"translate("+e.x+"px, "+e.y+"px)"},r3=n3,i3=function(e,t){var n=n3(e);return n?t?n+" scale("+J5+")":n:null},o3=.33,a3=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"===r.type){var i=t(),o=r.payload.reason;if("COLLECTING"!==i.phase){if("IDLE"!==i.phase){"DROP_PENDING"===i.phase&&i.isWaiting&&r2(!1),"DRAGGING"!==i.phase&&"DROP_PENDING"!==i.phase&&r2(!1);var a=i.critical,s=i.dimensions,l=s.draggables[i.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,i=e.home,o=e.viewport,a=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,Lt.Z)({},r,{displaced:z2}),didDropInsideDroppable:!0}:{impact:O5({draggables:t,impact:a,destination:i,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:o,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.id],viewport:i.viewport,draggables:i.dimensions.draggables}),u=c.impact,f=c.didDropInsideDroppable,d=f?R2(u):null,p=f?F2(u):null,h={index:a.draggable.index,droppableId:a.droppable.id},y={draggableId:l.descriptor.id,type:l.descriptor.type,source:h,reason:o,mode:i.movementMode,destination:d,combine:p},m=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,i=e.viewport,o=e.afterCritical,a=r.draggables,s=r.droppables,l=g5(t),c=l?s[l]:null,u=s[n.descriptor.droppableId],f=P5({impact:t,draggable:n,draggables:a,afterCritical:o,droppable:c||u,viewport:i});return h2(f,n.client.borderBox.center)}({impact:u,draggable:l,dimensions:s,viewport:i.viewport,afterCritical:i.afterCritical}),v={critical:i.critical,afterCritical:i.afterCritical,result:y,impact:u};if(!y2(i.current.client.offset,m)||Boolean(y.combine)){var g=function(e){var t=e.reason,n=g2(e.current,e.destination);if(n<=0)return o3;if(n>=1500)return.55;var r=o3+n/1500*.22000000000000003;return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:i.current.client.offset,destination:m,reason:o});n({type:"DROP_ANIMATE",payload:{newHomeClientOffset:m,dropDuration:g,completed:v}})}else n(Z5({completed:v}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:o}))}else e(r)}}},s3=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var l3=function(e){var t=function(e){var t,n=e.onWindowScroll,r=Q1((function(){n(s3())})),i=(t=r,{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(e){e.target!==window&&e.target!==window.document||t()}}),o=X1;function a(){return o!==X1}return{start:function(){a()&&r2(!1),o=J1(window,[i])},stop:function(){a()||r2(!1),r.cancel(),o(),o=X1},isActive:a}}({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},c3=function(e,t){t()},u3=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},f3=function(e,t,n,r){if(e){var i=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),i=function(i){t||n||(t=!0,e(i),clearTimeout(r))};return i.wasCalled=function(){return t},i}(n);e(t,{announce:i}),i.wasCalled()||n(r(t))}else n(r(t))},d3=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=O2(n,(function(t){return t.timerId===e}));-1===t&&r2(!1),n.splice(t,1)[0].callback()}(t)})),r={timerId:t,callback:e};n.push(r)},flush:function(){if(n.length){var e=[].concat(n);n.length=0,e.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}),i=null,o=function(n){i||r2(!1),i=null,c3(0,(function(){return f3(e().onDragEnd,n,t,f2)}))};return{beforeCapture:function(t,n){i&&r2(!1),c3(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){i&&r2(!1),c3(0,(function(){var r=e().onBeforeDragStart;r&&r(u3(t,n))}))},start:function(n,o){i&&r2(!1);var a=u3(n,o);i={mode:o,lastCritical:n,lastLocation:a.source,lastCombine:null},r.add((function(){c3(0,(function(){return f3(e().onDragStart,a,t,c2)}))}))},update:function(n,o){var a=R2(o),s=F2(o);i||r2(!1);var l=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(n,i.lastCritical);l&&(i.lastCritical=n);var c,u,f=(u=a,!(null==(c=i.lastLocation)&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));f&&(i.lastLocation=a);var d=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(i.lastCombine,s);if(d&&(i.lastCombine=s),l||f||d){var p=(0,Lt.Z)({},u3(n,i.mode),{combine:s,destination:a});r.add((function(){c3(0,(function(){return f3(e().onDragUpdate,p,t,u2)}))}))}},flush:function(){i||r2(!1),r.flush()},drop:o,abort:function(){if(i){var e=(0,Lt.Z)({},u3(i.lastCritical,i.mode),{combine:null,destination:null,reason:"CANCEL"});o(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var i=r.payload.critical;return n.beforeStart(i,r.payload.movementMode),t(r),void n.start(i,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var o=r.payload.completed.result;return n.flush(),t(r),void n.drop(o)}if(t(r),"FLUSH"!==r.type){var a=e.getState();"DRAGGING"===a.phase&&n.update(a.critical,a.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},p3=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&r2(!1),e.dispatch(Z5({completed:r.completed}))}else t(n)}}},h3=function(e){var t=null,n=null;return function(r){return function(i){if("FLUSH"!==i.type&&"DROP_COMPLETE"!==i.type&&"DROP_ANIMATION_FINISHED"!==i.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(i),"DROP_ANIMATE"===i.type){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=J1(window,[o])}))}}}},y3=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(Y5({reason:r.reason})))}}}},m3=J0,v3=function(e){var t,n=e.dimensionMarshal,r=e.focusMarshal,i=e.styleMarshal,o=e.getResponders,a=e.announce,s=e.autoScroller;return Q0(R5,m3(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(q0(15))},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=t.map((function(e){return e(i)}));return r=J0.apply(void 0,o)(n.dispatch),hT(hT({},n),{},{dispatch:r})}}}((t=i,function(){return function(e){return function(n){"INITIAL_PUBLISH"===n.type&&t.dragging(),"DROP_ANIMATE"===n.type&&t.dropping(n.payload.completed.result.reason),"FLUSH"!==n.type&&"DROP_COMPLETE"!==n.type||t.resting(),e(n)}}}),function(e){return function(){return function(t){return function(n){"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)}}}}(n),function(e){return function(t){var n=t.getState,r=t.dispatch;return function(t){return function(i){if("LIFT"===i.type){var o=i.payload,a=o.id,s=o.clientSelection,l=o.movementMode,c=n();"DROP_ANIMATING"===c.phase&&r(Z5({completed:c.completed})),"IDLE"!==n().phase&&r2(!1),r($5()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:a,movementMode:l}});var u={draggableId:a,scrollOptions:{shouldPublishImmediately:"SNAP"===l}},f=e.startPublishing(u),d=f.critical,p=f.dimensions,h=f.viewport;r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:p,clientSelection:s,movementMode:l,viewport:h}})}else t(i)}}}}(n),a3,p3,h3,y3,function(e){return function(t){return function(n){return function(r){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);var i=t.getState();return"DRAGGING"!==i.phase&&r2(!1),void e.start(i)}n(r),e.scroll(t.getState())}}}}(s),l3,function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;var i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(r),d3(o,a))))},g3=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,i=e.width,o=h2({x:n,y:t},{x:i,y:r});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},x3=function(){var e=document.documentElement;return e||r2(!1),e},b3=function(){var e=x3();return g3({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function w3(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var S3,C3,E3=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},i=null,o=function(){i||(n.collectionStarting(),i=requestAnimationFrame((function(){i=null;var e=r,o=e.additions,a=e.removals,s=e.modified,l=Object.keys(o).map((function(e){return t.draggable.getById(e).getDimension(d2)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(s).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:l,removals:Object.keys(a),modified:c};r={additions:{},removals:{},modified:{}},n.publish(u)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],o()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],o()},stop:function(){i&&(cancelAnimationFrame(i),i=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(t){n||r2(!1);var i=n.critical.draggable;"ADDITION"===t.type&&w3(e,i,t.value)&&r.add(t.value),"REMOVAL"===t.type&&w3(e,i,t.value)&&r.remove(t.value)},o={updateDroppableIsEnabled:function(r,i){e.droppable.exists(r)||r2(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:i})},updateDroppableIsCombineEnabled:function(r,i){n&&(e.droppable.exists(r)||r2(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:i}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,i){n&&(e.droppable.exists(r)||r2(!1),t.updateDroppableScroll({id:r,newScroll:i}))},startPublishing:function(t){n&&r2(!1);var r=e.draggable.getById(t.draggableId),o=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:o.descriptor},s=e.subscribe(i);return n={critical:a,unsubscribe:s},function(e){var t,n,r,i,o,a,s,l=e.critical,c=e.scrollOptions,u=e.registry,f=(t=s3(),n=b3(),r=t.y,i=t.x,a=(o=x3()).clientWidth,s=o.clientHeight,{frame:z1({top:r,left:i,right:i+a,bottom:r+s}),scroll:{initial:t,current:t,max:n,diff:{value:d2,displacement:d2}}}),d=f.scroll.current,p=l.droppable,h=u.droppable.getAllByType(p.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(d,c)})),y=u.draggable.getAllByType(l.draggable.type).map((function(e){return e.getDimension(d)}));return{dimensions:{draggables:j2(y),droppables:A2(h)},critical:l,viewport:f}}({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}};return o},k3=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},_3=function(e){window.scrollBy(e.x,e.y)},O3=Ca((function(e){return I2(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),P3=function(e){return Math.pow(e,2)},T3=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,i=n-t;return 0===i?0:(r-t)/i},A3=360,j3=1200,I3=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,i=e.shouldUseTimeDampening,o=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return 28;if(e===t.startScrollingFrom)return 1;var n=T3({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*P3(1-n);return Math.ceil(r)}(t,n);return 0===o?0:i?Math.max(function(e,t){var n=t,r=j3,i=Date.now()-n;if(i>=j3)return e;if(i<A3)return 1;var o=T3({startOfRange:A3,endOfRange:r,current:i}),a=e*P3(o);return Math.ceil(a)}(o,r),1):o},M3=function(e){var t=e.container,n=e.distanceToEdges,r=e.dragStartTime,i=e.axis,o=e.shouldUseTimeDampening,a=function(e,t){return{startScrollingFrom:.25*e[t.size],maxScrollValueAt:.05*e[t.size]}}(t,i);return n[i.end]<n[i.start]?I3({distanceToEdge:n[i.end],thresholds:a,dragStartTime:r,shouldUseTimeDampening:o}):-1*I3({distanceToEdge:n[i.start],thresholds:a,dragStartTime:r,shouldUseTimeDampening:o})},D3=b2((function(e){return 0===e?0:e})),R3=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,i=e.center,o=e.shouldUseTimeDampening,a={top:i.y-n.top,right:n.right-i.x,bottom:n.bottom-i.y,left:i.x-n.left},s=M3({container:n,distanceToEdges:a,dragStartTime:t,axis:W2,shouldUseTimeDampening:o}),l=M3({container:n,distanceToEdges:a,dragStartTime:t,axis:q2,shouldUseTimeDampening:o}),c=D3({x:l,y:s});if(y2(c,d2))return null;var u=function(e){var t=e.container,n=e.subject,r=e.proposedScroll,i=n.height>t.height,o=n.width>t.width;return o||i?o&&i?null:{x:o?0:r.x,y:i?0:r.y}:r}({container:n,subject:r,proposedScroll:c});return u?y2(u,d2)?null:u:null},F3=b2((function(e){return 0===e?0:e>0?1:-1})),L3=(S3=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,i=p2(t,r),o={x:S3(i.x,n.x),y:S3(i.y,n.y)};return y2(o,d2)?null:o}),B3=function(e){var t=e.max,n=e.current,r=e.change,i={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},o=F3(r),a=L3({max:i,current:n,change:o});return!a||0!==o.x&&0===a.x||0!==o.y&&0===a.y},N3=function(e,t){return B3({current:e.scroll.current,max:e.scroll.max,change:t})},z3=function(e,t){var n=e.frame;return!!n&&B3({current:n.scroll.current,max:n.scroll.max,change:t})},V3=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,i=e.scrollWindow,o=e.scrollDroppable,a=t.current.page.borderBoxCenter,s=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var l=function(e){var t=e.viewport,n=e.subject,r=e.center,i=e.shouldUseTimeDampening,o=R3({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:i});return o&&N3(t,o)?o:null}({dragStartTime:n,viewport:t.viewport,subject:s,center:a,shouldUseTimeDampening:r});if(l)return void i(l)}var c=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var i=r[n];return i.frame?i:null}var o=function(e,t){var n=P2(O3(t),(function(t){return t.frame||r2(!1),w5(t.frame.pageMarginBox)(e)}));return n}(t,r);return o}({center:a,destination:g5(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=t.frame;if(!a)return null;var s=R3({dragStartTime:i,container:a.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:o});return s&&z3(t,s)?s:null}({dragStartTime:n,droppable:c,subject:s,center:a,shouldUseTimeDampening:r});u&&o(c.descriptor.id,u)}},U3=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var i=e.scrollJumpRequest;if(i){var o=g5(e.impact);o||r2(!1);var a=function(e,t){if(!z3(e,t))return t;var r=function(e,t){var n=e.frame;return n&&z3(e,t)?L3({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var i=h2(t,r);return n(e.descriptor.id,i),h2(t,i)}(e.dimensions.droppables[o],i);if(a){var s=e.viewport,l=function(e,t,n){if(!e)return n;if(!N3(t,n))return n;var i=function(e,t){if(!N3(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return L3({current:r,max:n,change:t})}(t,n);if(!i)return r(n),null;var o=h2(n,i);return r(o),h2(n,o)}(e.isWindowScrollAllowed,s,a);l&&function(e,n){var r=p2(e.current.client.selection,n);t({client:r})}(e,l)}}}},H3=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,i=function(e){var t=e.scrollDroppable,n=Q1(e.scrollWindow),r=Q1(t),i=null,o=function(e){i||r2(!1);var t=i,o=t.shouldUseTimeDampening,a=t.dragStartTime;V3({state:e,scrollWindow:n,scrollDroppable:r,dragStartTime:a,shouldUseTimeDampening:o})};return{start:function(e){i&&r2(!1);var t=Date.now(),n=!1,r=function(){n=!0};V3({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),i={dragStartTime:t,shouldUseTimeDampening:n},n&&o(e)},stop:function(){i&&(n.cancel(),r.cancel(),i=null)},scroll:o}}({scrollWindow:n,scrollDroppable:t}),o=U3({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&o(e):i.scroll(e))},start:i.start,stop:i.stop}},G3="data-rbd",W3={base:C3=G3+"-drag-handle",draggableId:C3+"-draggable-id",contextId:C3+"-context-id"},q3=function(){var e=G3+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),$3=function(){var e=G3+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),Z3={contextId:G3+"-scroll-container-context-id"},Y3=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},Q3=function(e){var t,n,r=function(e){return function(t){return"["+t+'="'+e+'"]'}}(e),i=(t="\n cursor: -webkit-grab;\n cursor: grab;\n ",{selector:r(W3.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:t,dragging:"pointer-events: none;",dropAnimating:t}}),o=[(n="\n transition: "+t3.outOfTheWay+";\n ",{selector:r(q3.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),i,{selector:r($3.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:Y3(o,"always"),resting:Y3(o,"resting"),dragging:Y3(o,"dragging"),dropAnimating:Y3(o,"dropAnimating"),userCancel:Y3(o,"userCancel")}},K3="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect,X3=function(){var e=document.querySelector("head");return e||r2(!1),e},J3=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},e6=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function t6(e){return e instanceof e6(e).HTMLElement}function n6(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}function i(t){return e.droppables[t]||null}return{draggable:{register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var i=t.descriptor.id,o=r(i);o&&t.uniqueId===o.uniqueId&&(delete e.draggables[i],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||r2(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return _2(e.draggables).filter((function(e){return e.descriptor.type===t}))}},droppable:{register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||r2(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return _2(e.droppables).filter((function(e){return e.descriptor.type===t}))}},subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var r6=k().createContext(null),i6=function(){var e=document.body;return e||r2(!1),e},o6={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},a6=function(e){return"rbd-announcement-"+e},s6=0,l6={separator:"::"};function c6(e,t){return void 0===t&&(t=l6),B1((function(){return""+e+t.separator+s6++}),[t.separator,e])}var u6=k().createContext(null);function f6(e){var t=(0,E.useRef)(e);return(0,E.useEffect)((function(){t.current=e})),t}var d6,p6,h6=((d6={})[13]=!0,d6[9]=!0,d6),y6=function(e){h6[e.keyCode]&&e.preventDefault()},m6=function(){var e="visibilitychange";return"undefined"==typeof document?e:P2([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),v6={type:"IDLE"};function g6(){}var x6=((p6={})[34]=!0,p6[33]=!0,p6[36]=!0,p6[35]=!0,p6);var b6={type:"IDLE"},w6={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function S6(e,t){if(null==t)return!1;if(Boolean(w6[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&S6(e,t.parentElement)}function C6(e,t){var n=t.target;return!!t6(n)&&S6(e,n)}var E6=function(e){return z1(e.getBoundingClientRect()).center},k6=function(){var e="matches";return"undefined"==typeof document?e:P2([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||e}();function _6(e,t){return null==e?null:e[k6](t)?e:_6(e.parentElement,t)}function O6(e,t){return e.closest?e.closest(t):_6(e,t)}function P6(e){e.preventDefault()}function T6(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function A6(e){var t=e.lockAPI,n=e.store,r=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var o=r.draggable.findById(i);return!!o&&!!o.options.isEnabled&&!!k3(n.getState(),i)}var j6=[function(e){var t=(0,E.useRef)(v6),n=(0,E.useRef)(X1),r=B1((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,a,{sourceEvent:t});if(i){t.preventDefault();var o={x:t.clientX,y:t.clientY};n.current(),c(i,o)}}}}}}),[e]),i=B1((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),o=N1((function(){n.current=J1(window,[i,r],{passive:!1,capture:!0})}),[i,r]),a=N1((function(){"IDLE"!==t.current.type&&(t.current=v6,n.current(),o())}),[o]),s=N1((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),l=N1((function(){var e=function(e){var t=e.cancel,n=e.completed,r=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,o=e.clientY;if(0===t){var a={x:n,y:o},s=r();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);if("PENDING"!==s.type&&r2(!1),l=s.point,c=a,Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5){var l,c;e.preventDefault();var u=s.actions.fluidLift(a);i({type:"DRAGGING",actions:u})}}}},{eventName:"mouseup",fn:function(e){var i=r();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return 27===e.keyCode?(e.preventDefault(),void t()):void y6(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&r2(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:m6,fn:t}]}({cancel:s,completed:a,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=J1(window,e,{capture:!0,passive:!1})}),[s,a]),c=N1((function(e,n){"IDLE"!==t.current.type&&r2(!1),t.current={type:"PENDING",point:n,actions:e},l()}),[l]);K3((function(){return o(),function(){n.current()}}),[o])},function(e){var t=(0,E.useRef)(g6),n=B1((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var i=e.findClosestDraggableId(n);if(i){var o=e.tryGetLock(i,l,{sourceEvent:n});if(o){n.preventDefault();var a=!0,s=o.snapLift();t.current(),t.current=J1(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return 27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(x6[r.keyCode]?r.preventDefault():y6(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:m6,fn:n}]}(s,l),{capture:!0,passive:!1})}}}function l(){a||r2(!1),a=!1,t.current(),r()}}}}),[e]),r=N1((function(){t.current=J1(window,[n],{passive:!1,capture:!0})}),[n]);K3((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,E.useRef)(b6),n=(0,E.useRef)(X1),r=N1((function(){return t.current}),[]),i=N1((function(e){t.current=e}),[]),o=B1((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,s,{sourceEvent:t});if(i){var o=t.touches[0],a={x:o.clientX,y:o.clientY};n.current(),f(i,a)}}}}}}),[e]),a=N1((function(){n.current=J1(window,[o],{capture:!0,passive:!1})}),[o]),s=N1((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(b6),n.current(),a())}),[a,i]),l=N1((function(){var e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),c=N1((function(){var e={capture:!0,passive:!1},t={cancel:l,completed:s,getPhase:r},i=J1(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var i=e.touches[0],o={x:i.clientX,y:i.clientY};e.preventDefault(),n.actions.move(o)}else t()}},{eventName:"touchend",fn:function(e){var i=r();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&r2(!1);var i=e.touches[0];if(i&&i.force>=.15){var o=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return o?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();o&&t()}}},{eventName:m6,fn:t}]}(t),e),o=J1(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:m6,fn:t}]}(t),e);n.current=function(){i(),o()}}),[l,r,s]),u=N1((function(){var e=r();"PENDING"!==e.type&&r2(!1);var t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,i]),f=N1((function(e,t){"IDLE"!==r().type&&r2(!1);var n=setTimeout(u,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,i,u]);K3((function(){return a(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(b6))}}),[r,a,i]),K3((function(){return J1(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function I6(e){var t=e.contextId,n=e.store,r=e.registry,i=e.customSensors,o=e.enableDefaultSensors,a=[].concat(o?j6:[],i||[]),s=(0,E.useState)((function(){return function(){var e=null;function t(){e||r2(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&r2(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],l=N1((function(e,t){e.isDragging&&!t.isDragging&&s.tryAbandon()}),[s]);K3((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();l(e,t),e=t}))}),[s,n,l]),K3((function(){return s.tryAbandon}),[s.tryAbandon]);for(var c=N1((function(e){return A6({lockAPI:s,registry:r,store:n,draggableId:e})}),[s,r,n]),u=N1((function(e,i,o){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,i=e.registry,o=e.draggableId,a=e.forceSensorStop,s=e.sourceEvent;if(!A6({lockAPI:t,store:r,registry:i,draggableId:o}))return null;var l=i.draggable.getById(o),c=function(e,t){var n="["+q3.contextId+'="'+e+'"]',r=P2(T2(document.querySelectorAll(n)),(function(e){return e.getAttribute(q3.id)===t}));return r&&t6(r)?r:null}(n,l.descriptor.id);if(!c)return null;if(s&&!l.options.canDragInteractiveElements&&C6(c,s))return null;var u=t.claim(a||X1),f="PRE_DRAG";function d(){return l.options.shouldRespectForcePress}function p(){return t.isActive(u)}var h=function(e,t){T6({expected:e,phase:f,isLockActive:p,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function y(e){function n(){t.release(),f="COMPLETED"}function i(t,i){if(void 0===i&&(i={shouldBlockNextClick:!1}),e.cleanup(),i.shouldBlockNextClick){var o=J1(window,[{eventName:"click",fn:P6,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(o)}n(),r.dispatch(Y5({reason:t}))}return"PRE_DRAG"!==f&&(n(),"PRE_DRAG"!==f&&r2(!1)),r.dispatch(F5(e.liftActionArgs)),f="DRAGGING",(0,Lt.Z)({isActive:function(){return T6({expected:"DRAGGING",phase:f,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:d,drop:function(e){return i("DROP",e)},cancel:function(e){return i("CANCEL",e)}},e.actions)}return{isActive:function(){return T6({expected:"PRE_DRAG",phase:f,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:d,fluidLift:function(e){var t=Q1((function(e){h((function(){return U5({client:e})}))})),n=y({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,Lt.Z)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return h(H5)},moveRight:function(){return h(W5)},moveDown:function(){return h(G5)},moveLeft:function(){return h(q5)}};return y({liftActionArgs:{id:o,clientSelection:E6(c),movementMode:"SNAP"},cleanup:X1,actions:e})},abort:function(){T6({expected:"PRE_DRAG",phase:f,isLockActive:p,shouldWarn:!0})&&t.release()}}}({lockAPI:s,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:i,sourceEvent:o&&o.sourceEvent?o.sourceEvent:null})}),[t,s,r,n]),f=N1((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof e6(n).Element))return null;var i=function(e){return"["+W3.contextId+'="'+e+'"]'}(e),o=O6(r,i);return o&&t6(o)?o:null}(e,t);return n?n.getAttribute(W3.draggableId):null}(t,e)}),[t]),d=N1((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),p=N1((function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch($5()))}),[s,n]),h=N1(s.isClaimed,[s]),y=B1((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:f,findOptionsForDraggable:d,tryReleaseLock:p,isLockClaimed:h}}),[c,u,f,d,p,h]),m=0;m<a.length;m++)a[m](y)}var M6=function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}};function D6(e){return e.current||r2(!1),e.current}function R6(e){var t=e.contextId,n=e.setCallbacks,r=e.sensors,i=e.nonce,o=e.dragHandleUsageInstructions,a=(0,E.useRef)(null),s=f6(e),l=N1((function(){return M6(s.current)}),[s]),c=function(e){var t=B1((function(){return a6(e)}),[e]),n=(0,E.useRef)(null);return(0,E.useEffect)((function(){var e=document.createElement("div");return n.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),(0,Lt.Z)(e.style,o6),i6().appendChild(e),function(){setTimeout((function(){var t=i6();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),N1((function(e){var t=n.current;t&&(t.textContent=e)}),[])}(t),u=function(e){var t=e.contextId,n=e.text,r=c6("hidden-text",{separator:"-"}),i=B1((function(){return function(e){return"rbd-hidden-text-"+e.contextId+"-"+e.uniqueId}({contextId:t,uniqueId:r})}),[r,t]);return(0,E.useEffect)((function(){var e=document.createElement("div");return e.id=i,e.textContent=n,e.style.display="none",i6().appendChild(e),function(){var t=i6();t.contains(e)&&t.removeChild(e)}}),[i,n]),i}({contextId:t,text:o}),f=function(e,t){var n=B1((function(){return Q3(e)}),[e]),r=(0,E.useRef)(null),i=(0,E.useRef)(null),o=N1(Ca((function(e){var t=i.current;t||r2(!1),t.textContent=e})),[]),a=N1((function(e){var t=r.current;t||r2(!1),t.textContent=e}),[]);K3((function(){(r.current||i.current)&&r2(!1);var s=J3(t),l=J3(t);return r.current=s,i.current=l,s.setAttribute(G3+"-always",e),l.setAttribute(G3+"-dynamic",e),X3().appendChild(s),X3().appendChild(l),a(n.always),o(n.resting),function(){var e=function(e){var t=e.current;t||r2(!1),X3().removeChild(t),e.current=null};e(r),e(i)}}),[t,a,o,n.always,n.resting,e]);var s=N1((function(){return o(n.dragging)}),[o,n.dragging]),l=N1((function(e){o("DROP"!==e?n.userCancel:n.dropAnimating)}),[o,n.dropAnimating,n.userCancel]),c=N1((function(){i.current&&o(n.resting)}),[o,n.resting]);return B1((function(){return{dragging:s,dropping:l,resting:c}}),[s,l,c])}(t,i),d=N1((function(e){D6(a).dispatch(e)}),[]),p=B1((function(){return X0({publishWhileDragging:L5,updateDroppableScroll:N5,updateDroppableIsEnabled:z5,updateDroppableIsCombineEnabled:V5,collectionStarting:B5},d)}),[d]),h=function(){var e=B1(n6,[]);return(0,E.useEffect)((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),y=B1((function(){return E3(h,p)}),[h,p]),m=B1((function(){return H3((0,Lt.Z)({scrollWindow:_3,scrollDroppable:y.scrollDroppable},X0({move:U5},d)))}),[y.scrollDroppable,d]),v=function(e){var t=(0,E.useRef)({}),n=(0,E.useRef)(null),r=(0,E.useRef)(null),i=(0,E.useRef)(!1),o=N1((function(e,n){var r={id:e,focus:n};return t.current[e]=r,function(){var n=t.current;n[e]!==r&&delete n[e]}}),[]),a=N1((function(t){var n=function(e,t){var n="["+W3.contextId+'="'+e+'"]',r=T2(document.querySelectorAll(n));if(!r.length)return null;var i=P2(r,(function(e){return e.getAttribute(W3.draggableId)===t}));return i&&t6(i)?i:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),s=N1((function(e,t){n.current===e&&(n.current=t)}),[]),l=N1((function(){r.current||i.current&&(r.current=requestAnimationFrame((function(){r.current=null;var e=n.current;e&&a(e)})))}),[a]),c=N1((function(e){n.current=null;var t=document.activeElement;t&&t.getAttribute(W3.draggableId)===e&&(n.current=e)}),[]);return K3((function(){return i.current=!0,function(){i.current=!1;var e=r.current;e&&cancelAnimationFrame(e)}}),[]),B1((function(){return{register:o,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:s}}),[o,c,l,s])}(t),g=B1((function(){return v3({announce:c,autoScroller:m,dimensionMarshal:y,focusMarshal:v,getResponders:l,styleMarshal:f})}),[c,m,y,v,l,f]);a.current=g;var x=N1((function(){var e=D6(a);"IDLE"!==e.getState().phase&&e.dispatch($5())}),[]),b=N1((function(){var e=D6(a).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);n(B1((function(){return{isDragging:b,tryAbort:x}}),[b,x]));var w=N1((function(e){return k3(D6(a).getState(),e)}),[]),S=N1((function(){return b5(D6(a).getState())}),[]),C=B1((function(){return{marshal:y,focus:v,contextId:t,canLift:w,isMovementAllowed:S,dragHandleUsageInstructionsId:u,registry:h}}),[t,y,u,v,w,S,h]);return I6({contextId:t,store:g,registry:h,customSensors:r,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,E.useEffect)((function(){return x}),[x]),k().createElement(u6.Provider,{value:C},k().createElement(a1,{context:r6,store:g},e.children))}var F6=0;function L6(e){var t=B1((function(){return""+F6++}),[]),n=e.dragHandleUsageInstructions||"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n";return k().createElement(i2,null,(function(r){return k().createElement(R6,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)}))}var B6=function(e){return function(t){return e===t}},N6=B6("scroll"),z6=B6("auto"),V6=(B6("visible"),function(e,t){return t(e.overflowX)||t(e.overflowY)}),U6=function e(t){return null==t||t===document.body||t===document.documentElement?null:function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return V6(n,N6)||V6(n,z6)}(t)?t:e(t.parentElement)},H6=function(e){return{x:e.scrollLeft,y:e.scrollTop}},G6=function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))},W6={passive:!1},q6={passive:!0},$6=function(e){return e.shouldPublishImmediately?W6:q6};function Z6(e){var t=(0,E.useContext)(e);return t||r2(!1),t}var Y6=function(e){return e&&e.env.closestScrollable||null};function Q6(){}var K6={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},X6=k().memo((function(e){var t=(0,E.useRef)(null),n=N1((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),r=e.animate,i=e.onTransitionEnd,o=e.onClose,a=e.contextId,s=(0,E.useState)("open"===e.animate),l=s[0],c=s[1];(0,E.useEffect)((function(){return l?"open"!==r?(n(),c(!1),Q6):t.current?Q6:(t.current=setTimeout((function(){t.current=null,c(!1)})),n):Q6}),[r,l,n]);var u=N1((function(e){"height"===e.propertyName&&(i(),"close"===r&&o())}),[r,o,i]),f=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,i=function(e){var t=e.placeholder;return e.isAnimatingOpenOnMount||"close"===e.animate?K6:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}}({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:i.width,height:i.height,marginTop:i.margin.top,marginRight:i.margin.right,marginBottom:i.margin.bottom,marginLeft:i.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?t3.placeholder:null}}({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return k().createElement(e.placeholder.tagName,{style:f,"data-rbd-placeholder-context-id":a,onTransitionEnd:u,ref:e.innerRef})})),J6=k().createContext(null),e4=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state={isVisible:Boolean(t.props.on),data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return(0,Dt.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(k().PureComponent),t4=5e3,n4=4500,r4=function(e,t){return t?t3.drop(t.duration):e?t3.snap:t3.fluid},i4=function(e,t){return e?t?K5:X5:null};function o4(e){e.preventDefault()}var a4=function(e,t){return e===t},s4=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function l4(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var c4={mapped:{type:"SECONDARY",offset:d2,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:l4(null)}},u4=R1((function(){var e,t,n,r=(e=Ca((function(e,t){return{x:e,y:t}})),t=Ca((function(e,t,n,r,i){return{isDragging:!0,isClone:t,isDropAnimating:Boolean(i),dropAnimation:i,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}})),n=Ca((function(e,n,r,i,o,a,s){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:o,combineWith:a,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,i,o,a,null)}}})),function(r,i){if(r.isDragging){if(r.critical.draggable.id!==i.draggableId)return null;var o=r.current.client.offset,a=r.dimensions.draggables[i.draggableId],s=g5(r.impact),l=(u=r.impact).at&&"COMBINE"===u.at.type?u.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(o.x,o.y),r.movementMode,a,i.isClone,s,l,c)}var u;if("DROP_ANIMATING"===r.phase){var f=r.completed;if(f.result.draggableId!==i.draggableId)return null;var d=i.isClone,p=r.dimensions.draggables[i.draggableId],h=f.result,y=h.mode,m=s4(h),v=function(e){return e.combine?e.combine.draggableId:null}(h),g={duration:r.dropDuration,curve:Q5,moveTo:r.newHomeClientOffset,opacity:v?K5:null,scale:v?J5:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:p,dropping:g,draggingOver:m,combineWith:v,mode:y,forceShouldAnimate:null,snapshot:t(y,d,m,v,g)}}}return null}),i=function(){var e=Ca((function(e,t){return{x:e,y:t}})),t=Ca(l4),n=Ca((function(e,n,r){return void 0===n&&(n=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}})),r=function(e){return e?n(d2,e,!0):null},i=function(t,i,o,a){var s=o.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=F2(o),u=c&&c.draggableId===t?i:null;if(!s){if(!l)return r(u);if(o.displaced.invisible[t])return null;var f=m2(a.displacedBy.point),d=e(f.x,f.y);return n(d,u,!0)}if(l)return r(u);var p=o.displacedBy.point,h=e(p.x,p.y);return n(h,u,s.shouldAnimate)};return function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:i(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var n=e.completed;return n.result.draggableId===t.draggableId?null:i(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return function(e,t){return r(e,t)||i(e,t)||c4}}),{dropAnimationFinished:function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}}},null,{context:r6,pure:!0,areStatePropsEqual:a4})((function(e){var t=(0,E.useRef)(null),n=N1((function(e){t.current=e}),[]),r=N1((function(){return t.current}),[]),i=Z6(u6),o=i.contextId,a=i.dragHandleUsageInstructionsId,s=i.registry,l=Z6(J6),c=l.type,u=l.droppableId,f=B1((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:u}}),[e.draggableId,e.index,c,u]),d=e.children,p=e.draggableId,h=e.isEnabled,y=e.shouldRespectForcePress,m=e.canDragInteractiveElements,v=e.isClone,g=e.mapped,x=e.dropAnimationFinished;v||function(e){var t=c6("draggable"),n=e.descriptor,r=e.registry,i=e.getDraggableRef,o=e.canDragInteractiveElements,a=e.shouldRespectForcePress,s=e.isEnabled,l=B1((function(){return{canDragInteractiveElements:o,shouldRespectForcePress:a,isEnabled:s}}),[o,s,a]),c=N1((function(e){var t=i();return t||r2(!1),function(e,t,n){void 0===n&&(n=d2);var r=window.getComputedStyle(t),i=t.getBoundingClientRect(),o=Z1(i,r),a=$1(o,n);return{descriptor:e,placeholder:{client:o,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:o.marginBox.width,y:o.marginBox.height},client:o,page:a}}(n,t,e)}),[n,i]),u=B1((function(){return{uniqueId:t,descriptor:n,options:l,getDimension:c}}),[n,c,l,t]),f=(0,E.useRef)(u),d=(0,E.useRef)(!0);K3((function(){return r.draggable.register(f.current),function(){return r.draggable.unregister(f.current)}}),[r.draggable]),K3((function(){if(d.current)d.current=!1;else{var e=f.current;f.current=u,r.draggable.update(u,e)}}),[u,r.draggable])}(B1((function(){return{descriptor:f,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:y,isEnabled:h}}),[f,s,r,m,y,h]));var b=B1((function(){return h?{tabIndex:0,role:"button","aria-describedby":a,"data-rbd-drag-handle-draggable-id":p,"data-rbd-drag-handle-context-id":o,draggable:!1,onDragStart:o4}:null}),[o,a,p,h]),w=N1((function(e){"DRAGGING"===g.type&&g.dropping&&"transform"===e.propertyName&&x()}),[x,g]),S=B1((function(){var e=function(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,n=e.offset,r=e.combineWith,i=e.dropping,o=Boolean(r),a=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),s=Boolean(i),l=s?i3(n,o):r3(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:r4(a,i),transform:l,opacity:i4(o,s),zIndex:s?n4:t4,pointerEvents:"none"}}(e):{transform:r3((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}(g),t="DRAGGING"===g.type&&g.dropping?w:null;return{innerRef:n,draggableProps:{"data-rbd-draggable-context-id":o,"data-rbd-draggable-id":p,style:e,onTransitionEnd:t},dragHandleProps:b}}),[o,b,p,g,w,n]),C=B1((function(){return{draggableId:f.id,type:f.type,source:{index:f.index,droppableId:f.droppableId}}}),[f.droppableId,f.id,f.index,f.type]);return d(S,g.snapshot,C)}));function f4(e){return Z6(J6).isUsingCloneFor!==e.draggableId||e.isClone?k().createElement(u4,e):null}function d4(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return k().createElement(f4,(0,Lt.Z)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var p4,h4=function(e,t){return e===t.droppable.type},y4=function(e,t){return t.draggables[e.draggable.id]},m4={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||r2(!1),document.body}},v4=R1((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=(0,Lt.Z)({},e,{shouldAnimatePlaceholder:!1}),n=Ca((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),r=Ca((function(r,i,o,a,s,l){var c=s.descriptor.id;if(s.descriptor.droppableId===r){var u=l?{render:l,dragging:n(s.descriptor)}:null,f={isDraggingOver:o,draggingOverWith:o?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:f,useClone:u}}if(!i)return t;if(!a)return e;var d={isDraggingOver:o,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:d,useClone:null}}));return function(n,i){var o=i.droppableId,a=i.type,s=!i.isDropDisabled,l=i.renderClone;if(n.isDragging){var c=n.critical;if(!h4(a,c))return t;var u=y4(c,n.dimensions),f=g5(n.impact)===o;return r(o,s,f,f,u,l)}if("DROP_ANIMATING"===n.phase){var d=n.completed;if(!h4(a,d.critical))return t;var p=y4(d.critical,n.dimensions);return r(o,s,s4(d.result)===o,g5(d.impact)===o,p,l)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var h=n.completed;if(!h4(a,h.critical))return t;var y=g5(h.impact)===o,m=Boolean(h.impact.at&&"COMBINE"===h.impact.at.type),v=h.critical.droppable.id===o;return y?m?e:t:v?e:t}return t}}),{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:r6,pure:!0,areStatePropsEqual:a4})((function(e){var t=(0,E.useContext)(u6);t||r2(!1);var n=t.contextId,r=t.isMovementAllowed,i=(0,E.useRef)(null),o=(0,E.useRef)(null),a=e.children,s=e.droppableId,l=e.type,c=e.mode,u=e.direction,f=e.ignoreContainerClipping,d=e.isDropDisabled,p=e.isCombineEnabled,h=e.snapshot,y=e.useClone,m=e.updateViewportMaxScroll,v=e.getContainerForClone,g=N1((function(){return i.current}),[]),x=N1((function(e){i.current=e}),[]),b=(N1((function(){return o.current}),[]),N1((function(e){o.current=e}),[])),w=N1((function(){r()&&m({maxScroll:b3()})}),[r,m]);!function(e){var t=(0,E.useRef)(null),n=Z6(u6),r=c6("droppable"),i=n.registry,o=n.marshal,a=f6(e),s=B1((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),l=(0,E.useRef)(s),c=B1((function(){return Ca((function(e,n){t.current||r2(!1);var r={x:e,y:n};o.updateDroppableScroll(s.id,r)}))}),[s.id,o]),u=N1((function(){var e=t.current;return e&&e.env.closestScrollable?H6(e.env.closestScrollable):d2}),[]),f=N1((function(){var e=u();c(e.x,e.y)}),[u,c]),d=B1((function(){return Q1(f)}),[f]),p=N1((function(){var e=t.current,n=Y6(e);e&&n||r2(!1),e.scrollOptions.shouldPublishImmediately?f():d()}),[d,f]),h=N1((function(e,r){t.current&&r2(!1);var i=a.current,o=i.getDroppableRef();o||r2(!1);var l=function(e){return{closestScrollable:U6(e),isFixedOnPage:G6(e)}}(o),c={ref:o,descriptor:s,env:l,scrollOptions:r};t.current=c;var u=function(e){var t=e.ref,n=e.descriptor,r=e.env,i=e.windowScroll,o=e.direction,a=e.isDropDisabled,s=e.isCombineEnabled,l=e.shouldClipSubject,c=r.closestScrollable,u=function(e,t){var n=Y1(e);if(!t)return n;if(e!==t)return n;var r=n.paddingBox.top-t.scrollTop,i=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,a=i+t.scrollWidth,s=V1({top:r,right:a,bottom:o,left:i},n.border);return G1({borderBox:s,margin:n.margin,border:n.border,padding:n.padding})}(t,c),f=$1(u,i),d=function(){if(!c)return null;var e=Y1(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:$1(e,i),scroll:H6(c),scrollSize:t,shouldClipSubject:l}}(),p=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,i=e.isFixedOnPage,o=e.direction,a=e.client,s=e.page,l=e.closest,c=function(){if(!l)return null;var e=l.scrollSize,t=l.client,n=g3({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:n,diff:{value:d2,displacement:d2}}}}(),u="vertical"===o?W2:q2;return{descriptor:t,isCombineEnabled:r,isFixedOnPage:i,axis:u,isEnabled:n,client:a,page:s,frame:c,subject:E2({page:s,withPlaceholder:null,axis:u,frame:c})}}({descriptor:n,isEnabled:!a,isCombineEnabled:s,isFixedOnPage:r.isFixedOnPage,direction:o,client:u,page:f,closest:d});return p}({ref:o,descriptor:s,env:l,windowScroll:e,direction:i.direction,isDropDisabled:i.isDropDisabled,isCombineEnabled:i.isCombineEnabled,shouldClipSubject:!i.ignoreContainerClipping}),f=l.closestScrollable;return f&&(f.setAttribute(Z3.contextId,n.contextId),f.addEventListener("scroll",p,$6(c.scrollOptions))),u}),[n.contextId,s,p,a]),y=N1((function(){var e=t.current,n=Y6(e);return e&&n||r2(!1),H6(n)}),[]),m=N1((function(){var e=t.current;e||r2(!1);var n=Y6(e);t.current=null,n&&(d.cancel(),n.removeAttribute(Z3.contextId),n.removeEventListener("scroll",p,$6(e.scrollOptions)))}),[p,d]),v=N1((function(e){var n=t.current;n||r2(!1);var r=Y6(n);r||r2(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),g=B1((function(){return{getDimensionAndWatchScroll:h,getScrollWhileDragging:y,dragStopped:m,scroll:v}}),[m,h,y,v]),x=B1((function(){return{uniqueId:r,descriptor:s,callbacks:g}}),[g,s,r]);K3((function(){return l.current=x.descriptor,i.droppable.register(x),function(){t.current&&m(),i.droppable.unregister(x)}}),[g,s,m,x,o,i.droppable]),K3((function(){t.current&&o.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)}),[e.isDropDisabled,o]),K3((function(){t.current&&o.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,o])}({droppableId:s,type:l,mode:c,direction:u,isDropDisabled:d,isCombineEnabled:p,ignoreContainerClipping:f,getDroppableRef:g});var S=k().createElement(e4,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,r=e.data,i=e.animate;return k().createElement(X6,{placeholder:r,onClose:t,innerRef:b,animate:i,contextId:n,onTransitionEnd:w})})),C=B1((function(){return{innerRef:x,placeholder:S,droppableProps:{"data-rbd-droppable-id":s,"data-rbd-droppable-context-id":n}}}),[n,s,S,x]),_=y?y.dragging.draggableId:null,O=B1((function(){return{droppableId:s,type:l,isUsingCloneFor:_}}),[s,_,l]);return k().createElement(J6.Provider,{value:O},a(C,h),function(){if(!y)return null;var e=y.dragging,t=y.render,n=k().createElement(f4,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(n,r){return t(n,r,e)}));return rt().createPortal(n,v())}())}));function g4(){return g4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g4.apply(this,arguments)}v4.defaultProps=m4;const x4=tt((function(e){return E.createElement("svg",g4({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),p4||(p4=E.createElement("g",{fill:"#E84C3D"},E.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0-.187-.187-.292-.44-.292-.705 0-.265.105-.518.292-.705L10.59 12 7.7 9.11c-.187-.187-.292-.44-.292-.705 0-.265.105-.518.292-.705.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41z"}))))}))(b4||(b4=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"16px"}),(function(e){return e.height||"16px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var b4,w4,S4,C4,E4,k4,_4,O4,P4,T4,A4,j4,I4,M4,D4,R4,F4,L4,B4,N4,z4,V4,U4,H4,G4,W4,q4=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$4=function(){return $4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$4.apply(this,arguments)},Z4=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Y4=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Q4=tt.div(w4||(w4=q4(["\n background-color: ",";\n height: 100%;\n width: auto;\n"],["\n background-color: ",";\n height: 100%;\n width: auto;\n"])),Ci),K4=tt.div(S4||(S4=q4(["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: column;\n margin-bottom: -36px;\n min-height: 400px;\n width: 100%;\n margin-top: 15px;\n"],["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: column;\n margin-bottom: -36px;\n min-height: 400px;\n width: 100%;\n margin-top: 15px;\n"]))),X4=tt.div(C4||(C4=q4(["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: row;\n width: 100%;\n padding-bottom: 115px;\n padding-left: 8px;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin-top: 10px;\n"],["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: row;\n width: 100%;\n padding-bottom: 115px;\n padding-left: 8px;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin-top: 10px;\n"]))),J4=tt.div(k4||(k4=q4(["\n padding-top: 67px; /* SUS-905 changes */\n margin-top: ","px;\n display: flex;\n flex-direction: column;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n margin-top: 8px;\n ","\n"],["\n padding-top: 67px; /* SUS-905 changes */\n margin-top: ","px;\n display: flex;\n flex-direction: column;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n margin-top: 8px;\n ","\n"])),(function(e){return e.marginTop||0}),(function(e){return e.theme.containerWidth<=ti&&Ne(E4||(E4=q4(["\n padding-top: 0;\n margin-top: 16px;\n "],["\n padding-top: 0;\n margin-top: 16px;\n "])))})),e9=tt.div(_4||(_4=q4(["\n float: left;\n flex-direction: column;\n width: ",";\n div {\n margin-top: 3.5px;\n }\n"],["\n float: left;\n flex-direction: column;\n width: ",";\n div {\n margin-top: 3.5px;\n }\n"])),(function(e){return e.width?"".concat(e.width,"px"):"100%"})),t9=tt.div(O4||(O4=q4(["\n display: flex;\n flex-direction: column;\n width: ",";\n max-width: calc(100% - 48px);\n margin-bottom: 8px;\n"],["\n display: flex;\n flex-direction: column;\n width: ",";\n max-width: calc(100% - 48px);\n margin-bottom: 8px;\n"])),(function(e){return e.width?"".concat(e.width,"px"):"100%"})),n9=tt.div(T4||(T4=q4(["\n position: relative;\n height: ",";\n min-height: ","; /* SUS-905 changes */\n overflow-x: auto;\n overflow-y: hidden;\n width: 80%;\n padding-top: 39px; /* SUS-905 changes */\n ","\n padding-bottom: 10px;\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: none; /* Firefox */\n ::-webkit-scrollbar {\n display: none;\n }\n\n -ms-overflow-style: scrollbar;\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n height: 4px; /* SUS-905 changes */\n }\n ::-webkit-scrollbar-track {\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 27, 83, 0.2);\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: rgba(0, 27, 83, 0.4);\n }\n"],["\n position: relative;\n height: ",";\n min-height: ","; /* SUS-905 changes */\n overflow-x: auto;\n overflow-y: hidden;\n width: 80%;\n padding-top: 39px; /* SUS-905 changes */\n ","\n padding-bottom: 10px;\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: none; /* Firefox */\n ::-webkit-scrollbar {\n display: none;\n }\n\n -ms-overflow-style: scrollbar;\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n height: 4px; /* SUS-905 changes */\n }\n ::-webkit-scrollbar-track {\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 27, 83, 0.2);\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: rgba(0, 27, 83, 0.4);\n }\n"])),(function(e){return e.height?"".concat(e.height,"px"):""}),(function(e){return e.height?"".concat(e.height+7,"px"):""}),(function(e){return e.theme.containerWidth<=ti&&Ne(P4||(P4=q4(["\n padding-top: 0;\n margin-top: 16px;\n "],["\n padding-top: 0;\n margin-top: 16px;\n "])))}),Ci),r9=tt.div(A4||(A4=q4(["\n position: absolute;\n width: 100%;\n"],["\n position: absolute;\n width: 100%;\n"]))),i9=tt.div(j4||(j4=q4(["\n padding: 32px;\n height: 10px; /* SUS-905 changes */\n width: calc(100%- 64px);\n display: flex;\n justify-content: space-between;\n"],["\n padding: 32px;\n height: 10px; /* SUS-905 changes */\n width: calc(100%- 64px);\n display: flex;\n justify-content: space-between;\n"]))),o9=tt.div(M4||(M4=q4(["\n display: flex;\n justify-content: center;\n margin-bottom: 32px;\n border-radius: 6px;\n margin-top: 5%;\n ","\n"],["\n display: flex;\n justify-content: center;\n margin-bottom: 32px;\n border-radius: 6px;\n margin-top: 5%;\n ","\n"])),(function(e){return e.theme.containerWidth<=ti&&Ne(I4||(I4=q4(["\n margin-top: 0;\n border-radius: 0;\n margin-bottom: 0;\n "],["\n margin-top: 0;\n border-radius: 0;\n margin-bottom: 0;\n "])))})),a9=tt.div(D4||(D4=q4(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 20px;\n"],["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 20px;\n"]))),s9=tt.div(R4||(R4=q4(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 8px;\n"],["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 8px;\n"]))),l9=tt.div(F4||(F4=q4(["\n width: ","px;\n height: ","px;\n border-left: 1px solid rgba(0, 27, 83, 0.2);\n border-right: ",";\n"],["\n width: ","px;\n height: ","px;\n border-left: 1px solid rgba(0, 27, 83, 0.2);\n border-right: ",";\n"])),(function(e){return e.width||20}),(function(e){return e.inside?6:8}),(function(e){return e.rightBorder&&"1px solid rgba(0, 27, 83, 0.2)"})),c9=tt.div(L4||(L4=q4(["\n font-size: 12px;\n line-height: 1.43;\n color: #001b53;\n width: ","px;\n height: 20px;\n display: flex;\n justify-content: space-between;\n"],["\n font-size: 12px;\n line-height: 1.43;\n color: #001b53;\n width: ","px;\n height: 20px;\n display: flex;\n justify-content: space-between;\n"])),(function(e){return e.width||220})),u9=tt.div(B4||(B4=q4(["\n background: #ffffff;\n border-top-right-radius: 16px;\n border-bottom-right-radius: 16px;\n padding-left: 2px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n height: 80px;\n margin-bottom: 8px;\n position: relative;\n"],["\n background: #ffffff;\n border-top-right-radius: 16px;\n border-bottom-right-radius: 16px;\n padding-left: 2px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n height: 80px;\n margin-bottom: 8px;\n position: relative;\n"]))),f9=tt.div(N4||(N4=q4(["\n min-width: 20px;\n margin-left: 0;\n margin-right: 12px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: ",";\n opacity: ",";\n height: 40px;\n width: 46px;\n border-radius: 4px;\n transition: width 0.2s ease;\n overflow: hidden;\n"],["\n min-width: 20px;\n margin-left: 0;\n margin-right: 12px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: ",";\n opacity: ",";\n height: 40px;\n width: 46px;\n border-radius: 4px;\n transition: width 0.2s ease;\n overflow: hidden;\n"])),(function(e){return e.disabled?"default":"pointer"}),(function(e){return e.disabled?"0.5":"1"})),d9=tt.div(z4||(z4=q4(["\n display: block;\n height: 40px;\n border-radius: 4px;\n color: white;\n button {\n border-radius: 4px;\n }\n"],["\n display: block;\n height: 40px;\n border-radius: 4px;\n color: white;\n button {\n border-radius: 4px;\n }\n"]))),p9=tt.div(V4||(V4=q4(["\n width: 221px;\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n display: flex;\n gap: 13px;\n align-items: center;\n background: #ffffff;\n border: 1px solid rgba(0, 27, 83, 0.1);\n border-radius: 6px;\n margin-bottom: 20px;\n"],["\n width: 221px;\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n display: flex;\n gap: 13px;\n align-items: center;\n background: #ffffff;\n border: 1px solid rgba(0, 27, 83, 0.1);\n border-radius: 6px;\n margin-bottom: 20px;\n"]))),h9=tt.div(U4||(U4=q4(["\n position: absolute;\n right: 15px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"],["\n position: absolute;\n right: 15px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]))),y9=function(e){var n=e.videos,r=void 0===n?[]:n,i=e.setVideos,o=void 0===i?function(){}:i,a=Mt().containerWidth,s=dn(),l=Z4((0,E.useState)(0),2),c=l[0],u=l[1],f=Z4((0,E.useState)(0),2),d=f[0],p=f[1],h=Z4((0,E.useState)(0),2),y=h[0],v=h[1],g=Z4((0,E.useState)(0),2),x=g[0],b=g[1],w=Z4((0,E.useState)(10),2),S=w[0],C=w[1],k=Z4((0,E.useState)(20),2),_=k[0],O=k[1];(0,E.useEffect)((function(){u(r.reduce((function(e,t){return e+t.duration}),0)||0),p(r.reduce((function(e,t){return e+t.trimDuration}),0)||0)}),[r]),(0,E.useEffect)((function(){b(60+100*r.length)}),[r]),(0,E.useEffect)((function(){!function(){var e=Math.max(function(e,t){return e>0?Math.ceil(e/t)*t:t}(c*S,S),a-223);v(e),O(Math.round(e/S))}()}),[c,S,a]);var P=function(e){if(1===r.length)return s.push("/"),void window.localStorage.removeItem(m.merge);try{var t=localStorage.getItem(m.merge),n=r[e],i=(JSON.parse(t||"")||[]).filter((function(e){return e.id.toString()!==n.id.toString()}));localStorage.setItem(m.merge,JSON.stringify(i))}catch(e){console.log(e)}o((function(t){var n=Y4([],Z4(t),!1);return n.splice(e,1),n}))},T=function(e,t){o((function(n){var r=Y4([],Z4(n),!1);return r[e].ref=t,r}))},A=function(e){if(0===e)return 0;var t=r[e-1],n=r[e];return 1===e?t.endSec*S-n.startSec*S:t.trimDuration*S+t.startSec*S-n.startSec*S+A(e-1)};return(0,t.jsxs)(Q4,{children:[(0,t.jsx)(o9,{children:r&&!!r.length&&(0,t.jsx)(W0,{width:592,height:332,displayVideos:r})}),(0,t.jsxs)(K4,{children:[(0,t.jsxs)(i9,{children:[(0,t.jsx)(d9,{children:(0,t.jsx)(yo,{backgroundColor:di,textColor:Si,fontSize:"15px",padding:"8px 16px 8px 10px",icon:(0,t.jsx)(YL,{color:Bi,height:21,width:21}),text:"Add More Videos",onClick:function(){s.push("/?add-more")}})}),a>ti&&(0,t.jsxs)(p9,{children:[(0,t.jsx)(f9,$4({onClick:function(){return S>10&&C(S-5)},disabled:10===S},{children:(0,t.jsx)(v0,{width:24,height:24,color:Bi})})),(0,t.jsx)("input",{type:"range",onChange:function(e){return C(e.target.value)},min:10,max:200,value:S,style:{width:"200px",height:"4px",backgroundColor:"#d0d3d9",boxShadow:"0px 0px 4px rgba(66, 79, 104, 0.08),0px 6px 12px rgba(66, 79, 104, 0.06)"}}),(0,t.jsx)(f9,$4({onClick:function(){return S<200&&C(S+5)},disabled:200===S},{children:(0,t.jsx)(S0,{width:24,height:24,color:Bi})}))]})]}),(0,t.jsxs)(X4,{children:[(0,t.jsx)(J4,{children:(0,t.jsx)(L6,$4({onDragEnd:function(e){return t=void 0,n=void 0,a=function(){var t;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(n){return e.destination?(t=function(e,t,n){var r=Array.from(e),i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(r.splice(t,1),1)[0];return r.splice(n,0,i),r}(r,e.source.index,e.destination.index),o(t),[2]):[2]}))},new((i=void 0)||(i=Promise))((function(e,r){function o(e){try{l(a.next(e))}catch(e){r(e)}}function s(e){try{l(a.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,s)}l((a=a.apply(t,n||[])).next())}));var t,n,i,a}},{children:(0,t.jsx)(v4,$4({droppableId:"videos"},{children:function(e){return(0,t.jsxs)("div",$4({ref:e.innerRef},e.droppableProps,{children:[r.map((function(e,n){return(0,t.jsx)(d4,$4({draggableId:e.id,index:n},{children:function(r){return(0,t.jsx)("div",$4({ref:r.innerRef},r.draggableProps,r.dragHandleProps,{children:(0,t.jsx)(y0,{index:n,video:e,setVideos:o,removeVideo:P,setVideoRef:T},"".concat(e.id).concat(n,"thumb"))}))}}),e.id)})),e.placeholder]}))}}))}))}),(0,t.jsxs)(n9,$4({height:x,id:"row-container"},{children:[a>ti&&(0,t.jsxs)(t9,$4({width:y},{children:[(0,t.jsx)(a9,{children:Y4([],Z4(Array(Math.round(_/12)).keys()),!1).map((function(e){return(0,t.jsxs)(c9,$4({width:12*S},{children:[(0,t.jsx)("span",{children:St(12*e,0)}),e+1===Math.round(_/12)&&(0,t.jsx)("span",{children:St(12*(e+1),0)})]}),e)}))}),(0,t.jsx)(s9,{children:Y4([],Z4(Array(_).keys()),!1).map((function(e){return(0,t.jsx)(l9,{width:S-1,rightBorder:e+1===_,inside:e>=r[0].startSec&&e<=r[0].startSec+d},e)}))})]})),(0,t.jsx)(r9,{children:r.map((function(e,n){return(0,t.jsx)(u9,{children:(0,t.jsx)(h9,{children:(0,t.jsx)(x4,{onClick:function(){return P(n)},height:24,width:24,color:"rgba(232, 76, 61, 0.6)"})})},"".concat(e.id).concat(n))}))}),a>ti&&(0,t.jsx)(e9,{children:r.map((function(e,n){return(0,t.jsx)(XJ,{index:n,totalDuration:c,offset:A(n),width:e.duration*S,video:e,setVideos:o},"".concat(e.id).concat(n,"row"))}))})]}))]})]})]})},m9=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},v9=function(){return v9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},v9.apply(this,arguments)},g9=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},x9=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},b9=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},w9=tt.main(H4||(H4=m9(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),S9=tt.div(G4||(G4=m9(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),C9=function(){var e=localStorage.getItem(m.merge),n=JSON.parse(e),r={};null==n||n.forEach((function(e){r[e.id]=e}));var i=fn(en).location,o=(new URLSearchParams(i.search).get("videos")||"").split(",").filter(Boolean),a=b9((0,E.useState)(o.map((function(e){return{id:e}}))),2),s=a[0],l=a[1],c=dn(),u=b9(E.useState(!1),2),f=u[0],d=u[1],p=b9(E.useState(!1),2),h=p[0],y=p[1],v=b9(E.useState(!0),2),g=v[0],x=v[1];return(0,E.useEffect)((function(){x(!0),Object.values(r).forEach((function(e){return g9(void 0,void 0,void 0,(function(){var t;return x9(this,(function(n){switch(n.label){case 0:return[4,Wn(e.id)];case 1:return t=n.sent(),l((function(n){return function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],b9(n),!1).map((function(n){return n.id.toString()===e.id.toString()?v9(v9(v9({},e),n),{source:t.videoSource,flvName:t.flvName+".mp4",start:"00:00:00:00"}):n}))})),[2]}}))}))})),x(!1)}),[]),g?(0,t.jsx)(Eo,{isLoading:g}):(0,t.jsxs)(w9,{children:[s.length>=2&&(0,t.jsx)(KW,{when:!0,navigate:function(e){c.push(e)},stay:!0,onStay:function(){return d(!0)},onConfirm:function(){},shouldBlockNavigation:function(e){return function(e){return("/"!==e.pathname||"?add-more"!==e.search&&"?merged"!==e.search)&&!h}(e)}}),(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){window.localStorage.removeItem(m.merge),c.push("/")}}),center:(0,t.jsx)(S9,{children:"Merge Videos"}),right:(0,t.jsx)(yo,{onClick:function(){return d(!0)},text:"Save",disabled:(null==s?void 0:s.length)<2,textColor:di,backgroundColor:Qi,fontSize:"15px"})}),(0,t.jsx)(y9,{videos:s,setVideos:l}),f&&(0,t.jsx)(XX,{title:"Name new video",label:"Give your new video a name",defaultValue:"",secondaryButtonText:"Go Back",primaryButtonText:"Save Video",handleSubmit:function(e){return t=e,g9(void 0,void 0,void 0,(function(){var e;return x9(this,(function(n){switch(n.label){case 0:return window.localStorage.removeItem(m.merge),e=1e3*s.reduce((function(e,t){return e+t.trimDuration}),0),[4,(r={videos:s.map((function(e){return{start:e.start,end:e.end,id:e.id,flvName:e.flvName}})),videoName:t,duration:e},Ln(void 0,void 0,void 0,(function(){var e,t,n;return Bn(this,(function(i){switch(i.label){case 0:return e=S.headers,t={url:"/videos/merge",baseURL:b,method:Vn,data:r,headers:{Authorization:"Bearer ".concat(e.Authorization)}},[4,Tn(t).catch((function(e){return e}))];case 1:if((n=i.sent())instanceof Error)throw n;return[2,n]}}))})))];case 1:return n.sent(),y(!0),c.push("/?merged"),[2]}var r}))}));var t},handleModalClose:function(){return d(!1)}})]})},E9=tt.div(W4||(W4=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),k9=function(e){var n=e.onSaveVideo,r=e.isSaveDisabled,i=e.setInsertAfterSave,o=e.uploadLoading,a=dn(),s=Mt().showInsertFeature;return(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){a.push("/")}}),center:(0,t.jsx)(E9,{children:""}),right:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){n()},text:"Save",disabled:r||o,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:o?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),s&&(0,t.jsx)(yo,{onClick:function(){i(!0),n()},text:"Continue to Insert",disabled:r||o,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})})},_9=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},O9={id:"",title:"",recordDate:"",views:"0",videoLength:0,thumbnail:"",videoSource:"",tags:[],videoRequest:{videoRequestId:"0"},folder:""};const P9=function(){var e=pn().videoId,n=_9((0,E.useState)(O9),2),r=n[0],i=n[1],o=_9((0,E.useState)(!0),2),a=o[0],s=o[1],l=_9((0,E.useState)(),2),c=l[0],u=l[1],f=_9((0,E.useState)(!1),2),d=f[0],p=f[1],h=_9((0,E.useState)(!1),2),y=h[0],m=h[1],v=_9((0,E.useState)(!1),2),g=v[0],x=v[1];return(0,E.useEffect)((function(){var t,n,o,a;r.id||(t=void 0,n=void 0,a=function(){var t;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(n){switch(n.label){case 0:return e?[4,Wn(e)]:[2];case 1:return(t=n.sent())&&(i(t),s(!1)),[2]}}))},new((o=void 0)||(o=Promise))((function(e,r){function i(e){try{l(a.next(e))}catch(e){r(e)}}function s(e){try{l(a.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}l((a=a.apply(t,n||[])).next())})))}),[]),a?(0,t.jsx)(Eo,{isLoading:a}):(0,t.jsxs)("div",{children:[(0,t.jsx)(k9,{onSaveVideo:c||function(){},setInsertAfterSave:p,isSaveDisabled:y,uploadLoading:g}),(0,t.jsx)(so,{children:(0,t.jsx)(aY,{recordingBlobUrl:r.videoSource,recordDate:r.recordDate,insertAfterSave:d,setSaveFunction:u,setIsSaveDisabled:m,skipUploadProcess:!0,videoId:e,initialTitle:r.title,updateUploadLoading:function(e){return x(e)}})})]})};var T9=function(){return T9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T9.apply(this,arguments)},A9=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},j9=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},I9=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},M9={id:"",verified:0,access:0,customerId:0,customer:{automotiveAccess:0}};const D9=function(){var e=this,n=I9((0,E.useState)(!0),2),r=n[0],i=n[1],o=I9((0,E.useState)(M9),2),a=o[0],s=o[1],l=function(){return A9(e,void 0,void 0,(function(){var e;return j9(this,(function(t){switch(t.label){case 0:if(!x)return s(M9),i(!1),[2];i(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,An(void 0,void 0,void 0,(function(){var e,t;return jn(this,(function(n){switch(n.label){case 0:return e=(C()||S).bearerToken,[4,Tn({url:"/auth/user",baseURL:b,method:In,headers:e}).catch((function(e){return e}))];case 1:if((t=n.sent())instanceof Error)throw t;return t.authCalled=!0,[2,t]}}))}))];case 2:return e=t.sent(),s(e),[3,4];case 3:return t.sent(),[3,4];case 4:return i(!1),[2]}}))}))},c=function(t){return A9(e,void 0,void 0,(function(){return j9(this,(function(e){switch(e.label){case 0:return w(t),[4,l()];case 1:return e.sent(),[2]}}))}))};(0,E.useEffect)((function(){l()}),[]);var u=!!(null==a?void 0:a.id);return r?(0,t.jsx)(tf,{children:(0,t.jsx)(Eo,{height:400,isLoading:!0})}):(0,t.jsx)(Bl,T9({initialUser:a},{children:(0,t.jsx)(FL,{children:(0,t.jsx)(Xu,{children:(0,t.jsx)(tf,{children:(0,t.jsxs)(nn,{children:[u&&(0,t.jsxs)(un,{children:[(0,t.jsx)(cn,{path:"/merge",component:C9,exact:!0}),(0,t.jsx)(cn,{path:"/voiceover/:videoId",component:uJ,exact:!0}),(0,t.jsx)(cn,{path:"/insert-video/:videoId",component:BG,exact:!0}),(0,t.jsx)(cn,{path:"/wheels-tv",component:WJ}),(0,t.jsx)(cn,{exact:!0,path:"/record/home",component:CW}),(0,t.jsx)(cn,{exact:!0,path:"/record/both",component:rQ}),(0,t.jsx)(cn,{exact:!0,path:"/record/cam",component:TQ}),(0,t.jsx)(cn,{exact:!0,path:"/record/screen",component:nK}),(0,t.jsx)(cn,{exact:!0,path:"/preview-upload/:videoId",component:P9}),(0,t.jsx)(cn,{exact:!0,path:"/",component:function(){return(0,t.jsx)(iz,{handleUpdateToken:c})}})]}),!u&&(0,t.jsx)(un,{children:(0,t.jsx)(cn,{exact:!0,path:"/",component:function(){return(0,t.jsx)(Sz,{handleUpdateToken:c})}})})]})})})})}))};var R9,F9,L9=function(){return L9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L9.apply(this,arguments)},B9=new v.QueryClient({defaultOptions:{queries:{retry:0},mutations:{retry:0}}});function N9(){w(""),Pt()}!function(e){e.UPLOAD="upload",e.FOLDER="folder",e.RECORD_SCREEN="recordScreen",e.MERGE="merge",e.RECORD_CAM="recordCam",e.WHEELS_TV="wheelsTV",e.RECORD_BOTH="recordBoth",e.TRIM="trim",e.INSERT="insert",e.LANDING_PAGE="landingPage",e.QUICKSHARE="quickshare",e.CTA="CTA",e.VOICEOVER="voiceover",e.REACTIONS="reactions",e.AI_ASSIST="aiAssist",e.UPGRADE_MESSAGE="upgradeMessage"}(R9||(R9={})),function(e){e.DEVELOPMENT="development",e.SANDBOX="sandbox",e.PRODUCTION="production"}(F9||(F9={}));var z9=function(e){return(0,t.jsx)(v.QueryClientProvider,L9({client:B9},{children:(0,t.jsx)(It,L9({},e,{children:(0,t.jsx)(D9,{},"".concat(null==e?void 0:e.env).concat(null==e?void 0:e.token))}))}))}})(),module.exports=__webpack_exports__})();
576
+ `,AR=e=>{let{handleSubmitGeneratedContent:t,handleOnCopySuccess:n,defaultPromptType:r,defaultPromptUseCase:i=PM.INITIAL_REACH_OUT,defaultRecipient:o="",defaultVin:a="",userInput:s="",autoGenerate:l=!1,margin:c="0",height:u="auto",iconPadding:f="12px 2px 12px 10px",backgroundcolor:d="#8D31D6",border:p,iconColor:h=wM.white,videoId:y,btnLabel:m="",hoverPopup:g,hoverPosition:x="above",disabled:b,title:w}=e;const{userData:S,currentAiTheme:C}=sD(),{customer:_}=S,O=S.isAutomotiveServiceRole,[P,T]=(0,E.useState)(!1),A=()=>T(!0);if(O||!Number(_.hasCovideoMagic))return null;const j=()=>k().createElement(TR,{onClick:A,iconPadding:f,title:w,text:m,backgroundcolor:d,border:"gradient"===d?"0":p,icon:"gradient"===h?k().createElement(fD,null):k().createElement(dD,{color:h}),textColor:wM.white,margin:"0",height:u,currentAiTheme:C,disabled:b}),I=!!g;return k().createElement(v.QueryClientProvider,{client:PR},k().createElement("div",{style:{margin:c},className:"ai-assist"},I&&k().createElement(_M,{showtriangle:!0,position:x,padding:"0",width:"auto",hoverable:k().createElement(j,null),popup:g}),!I&&k().createElement(j,null),P&&k().createElement(cD,{defaultPromptType:r,defaultPromptUseCase:i,defaultRecipient:o,defaultVin:a,userInput:s,videoId:y,autoGenerate:l},k().createElement(OR,{closeModal:()=>T(!1),handleSubmitGeneratedContent:t,handleOnCopySuccess:n}))))},jR=e=>{let{children:t}=e;return k().createElement(nh,{theme:{color:"blue"}},t)},IR=e=>{let{...t}=e;return k().createElement(aD,{userData:t.userData,token:t.token,aiAssistTheme:t.aiAssistTheme,env:t.env},k().createElement(jR,null,k().createElement(AR,{userInput:t.userInput,defaultPromptType:t.defaultPromptType,handleSubmitGeneratedContent:t.handleSubmitGeneratedContent,margin:t.margin,hoverPopup:t.hoverPopup,hoverPosition:t.hoverPosition,btnLabel:t.btnLabel,height:t.height,backgroundcolor:t.backgroundcolor,iconPadding:t.iconPadding,videoId:t.videoId,defaultVin:t.defaultVin,iconColor:t.iconColor,border:t.border,autoGenerate:t.autoGenerate,title:t.title,handleOnCopySuccess:t.handleOnCopySuccess,defaultRecipient:t.defaultRecipient,defaultPromptUseCase:t.defaultPromptUseCase,disabled:t.disabled})))};var MR;!function(e){e.TELEPROPTER_SCRIPT="Teleprompter Script",e.EMAIL="Email",e.SMS="SMS",e.CRM_MESSAGE="CRM Message"}(MR||(MR={}));var DR,RR,FR,LR,BR,NR,zR,VR,UR,HR,GR,WR,qR,$R,ZR,YR,QR,KR,XR,JR,eF,tF,nF,rF,iF,oF,aF=2,sF=0,lF=1,cF=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},uF=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},fF=function(){return fF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fF.apply(this,arguments)},dF=function(e){return t=void 0,n=void 0,i=function(){var t,n,r,i,o;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(a){switch(a.label){case 0:return t=S.bearerToken,n=e.videoId,e.type,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["videoId","type"]),i=fF({},r),o=fF(fF({},t),{"Content-Type":"application/json"}),[4,kn().post("".concat(b,"share/quickshare/").concat(n,"/mark-as-sent"),i,{headers:o})];case 1:return[2,a.sent().data]}}))},new((r=void 0)||(r=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i},pF=function(){return pF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pF.apply(this,arguments)},hF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},yF=function(e){var t=e.video,n=e.videoRequest,r=e.setShowModalQuickShareMarkAsSent,i=e.handleOnMarkAsSentSuccessCallback,o=Nl().userData,a=function(e){var t,n,r=Nl().userData,i=Xl(r),o=Ju().toast,a=(t=function(e,t){return cF(void 0,void 0,void 0,(function(){var n;return uF(this,(function(r){return n=function(n){n.clipboardData&&(n.clipboardData.setData("text/html",t||""),n.clipboardData.setData("text/plain",e)),n.preventDefault()},document.addEventListener("copy",(function(e){return n(e)}),{once:!0}),document.execCommand("copy"),[2]}))}))},n=function(e,t){return cF(void 0,void 0,void 0,(function(){var n,r,i;return uF(this,(function(o){switch(o.label){case 0:return n=document.createElement("textArea"),i=(r=navigator.clipboard).write,[4,new ClipboardItem({"text/plain":new Promise((function(t){return cF(void 0,void 0,void 0,(function(){return uF(this,(function(n){return t(new Blob([e],{type:"text/plain"})),[2]}))}))})),"text/html":new Promise((function(e){return cF(void 0,void 0,void 0,(function(){var r,i;return uF(this,(function(o){return n.style.visibility="hidden",n.setAttribute("contenteditable","true"),n.value=t||"",document.body.appendChild(n),(r=document.createRange()).selectNodeContents(n),null==(i=window.getSelection())||i.removeAllRanges(),null==i||i.addRange(r),null==n||n.setSelectionRange(0,999999),e(new Blob([n.value],{type:"text/html"})),[2]}))}))}))})];case 1:return[4,i.apply(r,[[o.sent()]])];case 2:return o.sent(),n&&n.remove&&n.remove(),[2]}}))}))},{copyClipboard:function(e,r){return cF(void 0,void 0,void 0,(function(){var i;return uF(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),_t?[4,n(e,r)]:[3,2];case 1:return o.sent(),[3,4];case 2:return[4,t(e,r)];case 3:o.sent(),o.label=4;case 4:return[3,6];case 5:return i=o.sent(),console.log(i),[3,6];case 6:return[2]}}))}))}}).copyClipboard,s=Mt(),l=s.onVideoInsert,c=s.onVideoInsertError,u=i?null===r.customer.markVideosAsSent?aF:parseInt(r.customer.markVideosAsSent.toString(),10):sF;return(0,v.useMutation)(dF,{onSuccess:function(t,n){var r=function(e,t){switch(t.type){case"crm_code":return{title:"CRM Code Copied!",clipboardText:e.url,clipboardHtml:e.html};case"url":return{title:"URL Copied!",clipboardText:e.url};case"html_code":return{title:"Raw HTML Copied!",clipboardText:e.legacyHtml};case"quickshare":return{title:"Link copied to clipboard!",clipboardText:e.url,clipboardHtml:e.html};case"insert":return{title:"Inserting video..."}}}(t,n);if(u===lF&&o({message:"Video marked as Sent"}),u===aF&&n.markAsSentConfirmed&&o({message:"Video marked as Sent"}),r){if(r.clipboardText)try{a(r.clipboardText,null==r?void 0:r.clipboardHtml)}catch(e){console.log("Failed to copy to clipboard...",e)}r.title&&setTimeout((function(){o({message:r.title})}),100)}null==l||l({url:t.url,thumbnail:t.thumbnail,html:t.html,token:x}),e()},onError:function(e){null==c||c(e)}})}((function(){null==i||i(),r(!1)})),s=a.isLoading,l=a.mutateAsync,c=function(e){return r=void 0,i=void 0,a=function(){var r,i=e.markAsSentConfirmed,o=e.videoActivityType,a=hF(e,["markAsSentConfirmed","videoActivityType"]);return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){switch(e.label){case 0:return r=pF(pF(pF({videoId:"number"==typeof t?t.toString():(null==t?void 0:t.id)||"",vin:(null==n?void 0:n.vin)||"",useAutomotive:!!(null==n?void 0:n.vin)},o?{videoActivityType:o}:{}),void 0!==i?{markAsSentConfirmed:i}:{}),a),[4,l(r)];case 1:return[2,e.sent()]}}))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}));var r,i,o,a};return{onQuickShareButtonClick:function(e){var t=e.videoActivityType,n=hF(e,["videoActivityType"]),i=Xl(o)?null===o.customer.markVideosAsSent?aF:parseInt(o.customer.markVideosAsSent.toString(),10):sF;return i===sF?c(pF({videoActivityType:t},n)):i===aF?r(!0):i===lF?c(pF({videoActivityType:t},n)):void 0},isQuickshareLoading:s,onQuickShareMutationHandler:c}},mF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},vF=function(){return vF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vF.apply(this,arguments)},gF=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},xF=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},bF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},wF=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},SF=tt.div(DR||(DR=mF(["\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n opacity: ",";\n &:hover {\n .small-insert-video-button {\n display: none;\n }\n .large-insert-video-button {\n display: flex;\n }\n }\n"],["\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n opacity: ",";\n &:hover {\n .small-insert-video-button {\n display: none;\n }\n .large-insert-video-button {\n display: flex;\n }\n }\n"])),di,(function(e){var t=e.opacity;return null!=t?t:"1"})),CF=tt.div(RR||(RR=mF(["\n position: relative;\n aspect-ratio: 16 / 9;\n min-height: 100px;\n background-color: ",";\n"],["\n position: relative;\n aspect-ratio: 16 / 9;\n min-height: 100px;\n background-color: ",";\n"])),(function(e){return e.backgroundColor||"transparent"})),EF=tt.div(FR||(FR=mF(["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n"],["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n"])),di),kF=tt.div(LR||(LR=mF(["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n min-height: 40px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"],["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n min-height: 40px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"])),Pi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),_F=tt.div(BR||(BR=mF(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"])),Oi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),OF=tt.div(NR||(NR=mF(["\n position: absolute;\n left: 12px;\n bottom: 12px;\n background-color: ",";\n border-radius: 24px;\n color: ",";\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n padding: 4px 8px;\n min-width: 50px;\n"],["\n position: absolute;\n left: 12px;\n bottom: 12px;\n background-color: ",";\n border-radius: 24px;\n color: ",";\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n padding: 4px 8px;\n min-width: 50px;\n"])),"rgba(39, 42, 50, 0.4)",di),PF=tt.img(zR||(zR=mF(["\n position: absolute;\n top: 0;\n height: 100%;\n left: 50%;\n transform: translateX(-50%);\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n height: 100%;\n left: 50%;\n transform: translateX(-50%);\n opacity: ",";\n"])),(function(e){return e.visible?1:0})),TF=tt.div(VR||(VR=mF(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n"])),xi),AF=tt.div(UR||(UR=mF(["\n display: flex;\n justify-content: space-between;\n position: relative;\n z-index: 1;\n padding: 8px;\n"],["\n display: flex;\n justify-content: space-between;\n position: relative;\n z-index: 1;\n padding: 8px;\n"]))),jF=tt.div(HR||(HR=mF(["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"],["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"]))),IF=function(e){var n,r,i,o,a=e.video,s=e.isMerge,l=e.selectedVideosData,c=e.setSelectedVideosData,u=(null==a?void 0:a.folder)===Fn,f=Mt(),d=f.showQuickshareFeature,p=f.showVoiceoverFeature,h=f.showInsertFeature,y=f.showAiAssistFeature,m=f.env,v=Nl().userData,g=Jl(v),x=ec(v),w=function(e,t){return e&&(!!(null==t?void 0:t.customer.vAutoDealerId)||!!(null==t?void 0:t.customer.eDealerId)||!!(null==t?void 0:t.customer.homeNetId)||!!(null==t?void 0:t.customer.maxDigitalId)||!!(null==t?void 0:t.customer.dealersLinkId)||!!(null==t?void 0:t.customer.dealerCueId)||!!(null==t?void 0:t.customer.autoRevolutionId)||!!(null==t?void 0:t.customer.vinsolutionsIMSDealerId)||!!(null==t?void 0:t.customer.dealerDotComIMS)||!!(null==t?void 0:t.customer.dealerCenterDealerId)||function(e){var t;return"64604"===(null===(t=null==e?void 0:e.customerId)||void 0===t?void 0:t.toString())}(t))}(x,v),k=Xl(v),_=dn(),O=bF((0,E.useState)(0),2),P=O[0],T=O[1],A=bF((0,E.useState)(!1),2),j=A[0],I=A[1],M=bF((0,E.useState)(!1),2),D=M[0],R=M[1],F=bF((0,E.useState)(!1),2),L=F[0],B=F[1],N=bF((0,E.useState)(!1),2),z=N[0],V=N[1],U=bF((0,E.useState)(),2),H=U[0],G=U[1],W=Ju().toast,q=(0,E.createRef)(),$=C().headers.Authorization,Z=function(){V(!1),clearTimeout(H)},Y=function(e){q.current&&!z&&V(!0)},Q=yF({video:a,videoRequest:null==a?void 0:a.videoRequest,setShowModalQuickShareMarkAsSent:B}),K=Q.onQuickShareMutationHandler,X=Q.isQuickshareLoading,J=Q.onQuickShareButtonClick,ee=a?function(e,t,n){void 0===n&&(n="YYYY-MM-DD HH:mm:ss");var r=t.timeZone||Intl.DateTimeFormat().resolvedOptions().timeZone||yt().tz.guess(),i=yt()(e,["M/DD/YYYY h:mm:ss A","M/DD/YYYY, h:mm:ss A","M/D/YYYY h:mm:ss A","M/D/YYYY, h:mm:ss A","MM/DD/YYYY"]),o=-yt()().tz("America/New_York").utcOffset(),a=yt()().tz(r).utcOffset(),s=i.add(o,"minute");return yt()(s).add(a,"minute").format(n)}(a.recordDate,v,"MM/DD/YYYY hh:mm:ss A"):"";return(0,E.useEffect)((function(){z&&T(P+1)}),[z]),(0,E.useEffect)((function(){if(P>0&&z){clearTimeout(H);var e=setTimeout(T,1e3,P+1);G(e)}}),[P]),(0,E.useEffect)((function(){return q.current&&(q.current.addEventListener("load",Z,!0),q.current.addEventListener("error",Y,!0)),function(){q.current&&(q.current.removeEventListener("loadedmetadata",Z,!0),q.current.removeEventListener("error",Y,!0))}}),[q]),a?(0,t.jsxs)(SF,{children:[(0,t.jsxs)(CF,vF({backgroundColor:Ai},{children:[(0,t.jsx)(PF,{src:a.thumbnail,ref:q,visible:!z},a.id+P),!s&&(0,t.jsxs)(AF,{children:[(0,t.jsxs)(jF,{children:[!u&&(0,t.jsxs)(t.Fragment,{children:[h&&(0,t.jsx)(yo,{padding:"0 8px",height:"32px",onClick:function(){return _.push("/insert-video/".concat(null==a?void 0:a.id))},textColor:Si,backgroundColor:di,icon:(0,t.jsx)(tT,{size:18,color:Si}),hoverBorderColor:gi,title:"Insert"}),d&&(0,t.jsx)(yo,{padding:"0 8px",title:"QuickShare",height:"32px",onClick:function(){return J({videoActivityType:pu.QUICKSHARE,type:"quickshare"})},textColor:Si,backgroundColor:di,icon:X?(0,t.jsx)(go,{size:12,color:Si}):(0,t.jsx)(JP,{size:18,color:Si}),hoverBorderColor:gi,disabled:X}),y&&(0,t.jsx)(IR,{defaultPromptType:MR.CRM_MESSAGE,handleSubmitGeneratedContent:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){return J({videoActivityType:pu.CRM_SHARE,type:"quickshare"}),[2]}))}))},handleOnCopySuccess:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){return J({videoActivityType:pu.CRM_SHARE,type:"quickshare"}),[2]}))}))},margin:"0 12px 0 0",height:"40px",backgroundcolor:di,iconColor:"gradient",iconPadding:"9px 11px",videoId:a?a.id:"",defaultVin:(null===(n=null==a?void 0:a.videoRequest)||void 0===n?void 0:n.vin)||"",token:$,userData:{customer:{business:v.customer.business,hasCovideoMagic:"1"===(null===(i=null===(r=null==v?void 0:v.customer)||void 0===r?void 0:r.hasCovideoMagic)||void 0===i?void 0:i.toString())},firstName:v.firstName,isAutomotiveSalesRole:x,isAutomotiveServiceRole:g,isIMSEnabled:w},aiAssistTheme:k?"automotive":"covideo",title:"AI assist",env:m})]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{padding:"0 8px",title:"Copy to Primary",height:"32px",onClick:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){switch(e.label){case 0:if(!a)return[2];I(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,(t=a.id,Ln(void 0,void 0,void 0,(function(){var e,n,r;return Bn(this,(function(i){switch(i.label){case 0:return e=S.bearerToken,n={url:"/videos/".concat(t,"/move"),baseURL:b,method:zn,headers:e,data:{videoId:t,copy:!0,videoFolder:"Primary"}},[4,Tn(n).catch((function(e){return e}))];case 1:if((r=i.sent())instanceof Error)throw r;return[2,r]}}))})))];case 2:return e.sent(),W({message:"Video copied successfully."}),[3,4];case 3:return e.sent(),W({message:"Copy failed, please try again later."}),[3,4];case 4:return I(!1),[2]}var t}))}))},textColor:Si,backgroundColor:di,icon:j?(0,t.jsx)(go,{size:12,color:Si}):(0,t.jsx)(Lc,{size:18,color:Si}),hoverBorderColor:gi,disabled:j}),(0,t.jsx)(yo,{padding:"0 8px",title:"Download",height:"32px",onClick:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){switch(e.label){case 0:if(!a)return[2];R(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,(t=a.id,n="".concat(a.title,".mp4"),Ln(void 0,void 0,void 0,(function(){var e,r,i;return Bn(this,(function(o){switch(o.label){case 0:return e=S.bearerToken,r={url:"/videos/".concat(t,"/download"),baseURL:b,method:Nn,headers:e,responseType:"blob"},[4,Tn(r).catch((function(e){return e}))];case 1:if((i=o.sent())instanceof Error)throw i;return[2,(0,Rn.saveAs)(new Blob([i],{type:"video/mp4"}),n)]}}))})))];case 2:return e.sent(),[3,4];case 3:return e.sent(),W({message:"Download failed, please try again later."}),[3,4];case 4:return R(!1),[2]}var t,n}))}))},textColor:Si,backgroundColor:di,icon:D?(0,t.jsx)(go,{size:12,color:Si}):(0,t.jsx)(Bc,{size:18,color:Si}),hoverBorderColor:gi,disabled:D})]})]}),p&&!u&&(0,t.jsx)(yo,{padding:"0 8px",title:"Voiceover",height:"32px",onClick:function(){return _.push("/voiceover/".concat(a.id))},textColor:Si,backgroundColor:di,icon:(0,t.jsx)(XP,{size:18,color:Si}),hoverBorderColor:gi})]}),s&&(0,t.jsx)(lc,{width:"24px",blueCheck:!0,style:{marginLeft:10,marginTop:10},checked:l.find((function(e){return e.id===a.id})),onChange:function(e){return function(e){var t=e.target.checked;c(t?wF(wF([],bF(l),!1),[a],!1):l.filter((function(e){return e.id!=a.id})))}(e)}}),z&&(0,t.jsx)(TF,{children:(0,t.jsx)(go,{})}),!!(null==a?void 0:a.videoLength)&&(0,t.jsx)(OF,{children:(o=a.videoLength,new Date(o).toISOString().substring(14,19))})]})),(0,t.jsxs)(EF,{children:[(0,t.jsx)(kF,{children:a.title}),(0,t.jsxs)(_F,{children:[(0,t.jsx)(iT,{size:16,color:ki,style:{marginRight:6}}),ee]})]}),L&&(0,t.jsx)(Tf,{markAsSentPayload:{type:"quickshare"},isQuickShareLoading:X,quickShareMarkAsSentHandler:K,handleModalClose:function(){return gF(void 0,void 0,void 0,(function(){return xF(this,(function(e){return B(!1),[2]}))}))}})]}):(0,t.jsxs)(SF,vF({opacity:".3"},{children:[(0,t.jsx)(CF,vF({backgroundColor:Ei},{children:(0,t.jsx)(OF,{children:" "})})),(0,t.jsxs)(EF,{children:[(0,t.jsx)(kF,vF({backgroundColor:Ei,width:"100%"},{children:" "})),(0,t.jsx)(_F,vF({backgroundColor:Ei,width:"70%"},{children:" "}))]})]}))},MF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},DF=tt.div(WR||(WR=MF(["\n position: relative;\n width: 216px;\n ","\n"],["\n position: relative;\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(GR||(GR=MF(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),RF=tt.div(qR||(qR=MF(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),FF=tt.div($R||($R=MF(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),LF=function(e){var n=e.prevSearch,r=e.handleSearch,i=Mt().containerWidth,o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(n||""),2),a=o[0],s=o[1];return(0,t.jsxs)(DF,{children:[(0,t.jsx)(RF,{children:(0,t.jsx)(fT,{onClick:function(){return r(a)},size:17})}),(0,t.jsx)(lo,{width:"100%",type:"text",padding:"8px 8px 8px 40px",value:a,placeholder:i>=ti?"Search videos...":"Search...",onKeyUp:function(e){"Enter"===e.key&&r(a)},onChange:function(e){s(e.currentTarget.value)}}),""!==a&&(0,t.jsx)(FF,{children:(0,t.jsx)(Fc,{onClick:function(){return s(""),void r("")},size:17})})]})},BF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},NF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},zF=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},VF=tt.div(YR||(YR=BF(["\n position: relative;\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n z-index: 0;\n ","\n"],["\n position: relative;\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n z-index: 0;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(ZR||(ZR=BF(["\n grid-template-columns: 1fr;\n "],["\n grid-template-columns: 1fr;\n "])))})),UF=tt.div(KR||(KR=BF(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n ","\n"],["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n ","\n"])),_i,(function(e){return e.theme.containerWidth<ni&&Ne(QR||(QR=BF(["\n top: 32px;\n width: 100%;\n text-align: center;\n "],["\n top: 32px;\n width: 100%;\n text-align: center;\n "])))})),HF=function(e){var n=e.size,r=e.message;return(0,t.jsxs)(VF,{children:[(0,t.jsx)(UF,{children:r}),zF([],NF(Array(n)),!1).map((function(e,n){return(0,t.jsx)(IF,{},n)}))]})},GF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},WF=function(){return WF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},WF.apply(this,arguments)},qF=tt.div(XR||(XR=GF(["\n position: relative;\n"],["\n position: relative;\n"]))),$F=tt.div(JR||(JR=GF(["\n position: absolute;\n cursor: pointer;\n top: 40px;\n min-height: 20px;\n background: pink;\n width: 100%;\n box-shadow: 0px 0px 4px rgba(66, 79, 104, 0.08),\n 0px 6px 12px rgba(66, 79, 104, 0.06);\n border-radius: 8px;\n background: ",";\n"],["\n position: absolute;\n cursor: pointer;\n top: 40px;\n min-height: 20px;\n background: pink;\n width: 100%;\n box-shadow: 0px 0px 4px rgba(66, 79, 104, 0.08),\n 0px 6px 12px rgba(66, 79, 104, 0.06);\n border-radius: 8px;\n background: ",";\n"])),di),ZF=function(e){var n=e.name,r=e.handleUpdateToken,i=Mt().hasExternalJwt,o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(!1),2),a=o[0],s=o[1],l=function(e){var t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(E.useState(null),2),n=t[0],r=t[1];E.useEffect((function(){if(n){var e=function(e){n.contains(e.target)||s(!1)};return document.addEventListener("click",e,!0),function(){return document.removeEventListener("click",e,!0)}}}),[n]);var i=E.useCallback((function(e){return r(e)}),[]);return{ref:i}}().ref,c=dn();return i?null:(0,t.jsxs)(qF,WF({ref:l},{children:[(0,t.jsx)(yo,{text:n,backgroundColor:a?Ci:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(uT,{size:18,color:_i}),iconOther:a?(0,t.jsx)(rT,{}):(0,t.jsx)(nT,{}),onClick:function(){s((function(e){return!e}))}}),a&&(0,t.jsx)($F,WF({onClick:function(){return r(""),Pt(),void c.go(0)}},{children:(0,t.jsx)(yo,{text:"Log Out",textColor:Ri,backgroundColor:"transparent",borderColor:"transparent",icon:(0,t.jsx)(Ac,{size:18,color:Mi})})}))]}))},YF=tt.div(eF||(eF=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),Oi),QF=function(e){var n=e.page,r=e.size,i=e.count,o=n*r+1,a=n*r+r;return a>i&&(a=i),(0,t.jsxs)(YF,{children:[o,"-",a," of ",i]})};!function(e){e.NoStatus="",e.Pending="pending",e.Denied="denied",e.Approved="approved"}(tF||(tF={})),function(e){e.NoStatus="",e.NotSent="not_sent",e.Sent="sent",e.Watched="watched",e.Deleted="deleted"}(nF||(nF={})),function(e){e.NoType="",e.Marketing="Marketing",e.Prospecting="Prospecting",e.RespondToInquiry="Respond to Inquiry",e.ThanksForYourBusiness="Thanks For Your Business"}(rF||(rF={})),function(e){e.NoType="",e.AdditionalRepair="Additional Repair",e.RepairInquiry="Repair inquiry",e.RegularService="Regular service",e.ServiceReminder="Service reminder",e.QuoteRequest="Quote request"}(iF||(iF={})),function(e){e[e.LEGACY=0]="LEGACY",e[e.FREE=1]="FREE",e[e.PRO=2]="PRO",e[e.TEAMS=3]="TEAMS",e[e.ENTERPRISE=4]="ENTERPRISE"}(oF||(oF={}));var KF,XF,JF,eL,tL,nL,rL,iL,oL,aL,sL,lL,cL,uL,fL,dL,pL,hL,yL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},mL=function(){return mL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mL.apply(this,arguments)},vL=tt.div(lL||(lL=yL(["\n visibility: hidden;\n opacity: 0;\n position: absolute;\n ","\n height: auto;\n width: ",";\n max-width: ",";\n padding: ",";\n background: ",";\n border: 1px solid ",";\n box-shadow: 0px 8px 32px rgba(29, 30, 36, 0.08);\n border-radius: 5px;\n z-index: 99;\n cursor: initial;\n ","\n // TODO: add support for other triangle positions when needed\n ","\n ","\n"],["\n visibility: hidden;\n opacity: 0;\n position: absolute;\n ","\n height: auto;\n width: ",";\n max-width: ",";\n padding: ",";\n background: ",";\n border: 1px solid ",";\n box-shadow: 0px 8px 32px rgba(29, 30, 36, 0.08);\n border-radius: 5px;\n z-index: 99;\n cursor: initial;\n ","\n // TODO: add support for other triangle positions when needed\n ","\n ","\n"])),(function(e){return"bottom"===e.position?Ne(KF||(KF=yL(["\n top: 100%;\n left: 50%;\n transform: translate(-50%);\n "],["\n top: 100%;\n left: 50%;\n transform: translate(-50%);\n "]))):"below"===e.position?Ne(XF||(XF=yL(["\n top: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "],["\n top: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "]))):"bottom-left"===e.position?Ne(JF||(JF=yL(["\n top: 100%;\n left: 0%;\n "],["\n top: 100%;\n left: 0%;\n "]))):"right"===e.position?Ne(eL||(eL=yL(["\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n "],["\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n "]))):"top-left"===e.position?Ne(tL||(tL=yL(["\n bottom: 100%;\n left: 0%;\n "],["\n bottom: 100%;\n left: 0%;\n "]))):"top-right"===e.position?Ne(nL||(nL=yL(["\n bottom: 100%;\n right: 0%;\n "],["\n bottom: 100%;\n right: 0%;\n "]))):"top"===e.position?Ne(rL||(rL=yL(["\n bottom: 100%;\n left: 50%;\n transform: translate(-50%);\n "],["\n bottom: 100%;\n left: 50%;\n transform: translate(-50%);\n "]))):"above"===e.position?Ne(iL||(iL=yL(["\n bottom: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "],["\n bottom: calc(100% + 12px);\n left: 50%;\n transform: translate(-50%);\n "]))):null}),(function(e){return e.width}),(function(e){return e.maxWidth}),(function(e){return e.padding}),di,"#f7f8fa",(function(e){return e.showTriangle&&Ne(oL||(oL=yL(["\n &:after {\n content: '';\n display: block;\n position: absolute;\n }\n "],["\n &:after {\n content: '';\n display: block;\n position: absolute;\n }\n "])))}),(function(e){var t=e.showTriangle,n=e.position;return t&&("above"===n||"top"===n)&&Ne(aL||(aL=yL(["\n &:after {\n border-bottom: 0;\n border-top: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "],["\n &:after {\n border-bottom: 0;\n border-top: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "])),di)}),(function(e){var t=e.showTriangle,n=e.position;return t&&"below"===n&&Ne(sL||(sL=yL(["\n &:after {\n border-top: 0;\n border-bottom: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "],["\n &:after {\n border-top: 0;\n border-bottom: 8px solid ",";\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -8px;\n left: 50%;\n transform: translateX(-50%);\n }\n "])),di)})),gL=tt.div(uL||(uL=yL(["\n position: relative;\n ","\n"],["\n position: relative;\n ","\n"])),(function(e){var t=e.disableHover,n=e.cursor;return t?null:Ne(cL||(cL=yL(["\n cursor: ",";\n &:hover "," {\n visibility: visible;\n opacity: 1;\n transition-delay: 300ms;\n }\n "],["\n cursor: ",";\n &:hover "," {\n visibility: visible;\n opacity: 1;\n transition-delay: 300ms;\n }\n "])),n,vL)})),xL=function(e){var n=e.hoverable,r=e.className,i=e.popup,o=e.position,a=void 0===o?"bottom":o,s=e.padding,l=void 0===s?"24px":s,c=e.width,u=void 0===c?"267px":c,f=e.maxWidth,d=void 0===f?"":f,p=e.disableHover,h=void 0!==p&&p,y=e.showTriangle,m=void 0!==y&&y,v=e.cursor,g=void 0===v?"pointer":v;return(0,t.jsxs)(gL,mL({disableHover:h,className:r,cursor:g},{children:[(0,t.jsx)(vL,mL({width:u,position:a,padding:l,showTriangle:m,maxWidth:d||u},{children:i})),n]}))},bL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},wL=function(){return wL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wL.apply(this,arguments)},SL=tt.div(fL||(fL=bL(["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"],["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"])),yi),CL=tt.div(pL||(pL=bL(["\n width: auto;\n height: 100vh;\n ","\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"],["\n width: auto;\n height: 100vh;\n ","\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"])),(function(e){return e.theme.containerWidth>=ti&&Ne(dL||(dL=bL(["\n width: 100vw;\n "],["\n width: 100vw;\n "])))})),EL=tt.div(hL||(hL=bL(["\n height: ",";\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n"],["\n height: ",";\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n"])),(function(e){return e.maxHeight?e.maxHeight:"100vh"}),(function(e){return e.overflowY}),(function(e){return e.overflowX}),(function(e){if(e.disableFullScreen)return"\n height: ".concat(e.overrideBodyHeight&&e.maxHeight?e.maxHeight:"auto",";\n width: ").concat(e.widthOnDesktop?e.widthOnDesktop:"auto",";\n ")})),kL=function(e){var n=e.style,r=void 0===n?{}:n,i=e.children,o=e.widthOnDesktop,a=e.disableFullScreen,s=e.maxHeight,l=e.overrideBodyHeight,c=void 0!==l&&l,u=e.bodyOverflowY,f=void 0===u?"auto":u,d=e.bodyOverflowX,p=void 0===d?"hidden":d;return(0,E.useEffect)((function(){if(document&&document.body){var e=document.body.className;document.body.className=e+(e?" ":"")+"modal-open"}return function(){document&&document.body&&(document.body.className=document.body.className.replace(/ ?modal-open/,""))}}),[]),(0,t.jsx)(SL,wL({style:r},{children:(0,t.jsx)(CL,{children:(0,t.jsx)(EL,wL({disableFullScreen:a,widthOnDesktop:o,maxHeight:s,overrideBodyHeight:c,overflowX:p,overflowY:f},{children:i}))})}))},_L=function(){return _L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_L.apply(this,arguments)},OL={data:null,error:null,loading:!0,progress:0},PL=function(e,t){switch(t.type){case"REQUEST":return _L(_L({},e),{loading:!0,error:null});case"PROGRESS":return _L(_L({},e),{progress:Math.min(e.progress+(n=25,Math.floor(Math.random()*Math.floor(n))),100)});case"SUCCESS":return _L(_L({},e),{data:t.data,loading:!1,error:null,progress:100});case"FAILURE":return _L(_L({},e),{data:null,loading:!1,error:t.error,progress:100});default:return e}var n},TL=function(){return TL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},TL.apply(this,arguments)},AL=function(e){var t=e.method,n=e.pathname,r=e.origin,i=e.params,o=e.autoFetch,a=void 0!==o&&o,s=e.showToastMessage,l=void 0===s||s,c=function(e){var t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useReducer)(PL,{data:null,error:"",loading:!1}||OL),2);return{state:t[0],dispatch:t[1]}}(),u=c.state,f=c.dispatch,d=u.data,p=u.error,h=u.loading,y=u.progress,m=Ju().toast,v=function(e,o){return a=void 0,s=void 0,u=function(){var a,s,c,u;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(d){return f({type:"REQUEST"}),a=setInterval((function(){f({type:"PROGRESS"})}),200),(s=null==e?void 0:e.baseURL)||(s=r||"https://www.covideo.com/api/v2.0"),c=s===b?S.bearerToken:S.headers,u={url:n,baseURL:s,method:void 0!==t?t:"get",params:i},kn()(TL(TL(TL({},u),{headers:c}),e)).then((function(e){var n=e.data,r=e.success;n&&n.message&&l&&m({title:n.message}),n.id&&(n.video_id=n.id),"patch"===t&&(Array.isArray(n)&&(n=n.length>0?"SUCCESS":r),n=!0===n?"SUCCESS":"ERROR"),o>=0&&(n.id=o,n.data&&(n.data.id=o)),f({type:"SUCCESS",data:n}),clearInterval(a)})).catch((function(e){f({type:"FAILURE",error:e.message}),l&&m({title:e.message}),clearInterval(a)})),[2]}))},new((c=void 0)||(c=Promise))((function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function r(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c((function(e){e(i)}))).then(n,r)}i((u=u.apply(a,s||[])).next())}));var a,s,c,u};return a&&null==d&&!1===h&&!p&&v(),{data:d,loading:h,error:p,fetchData:v,progress:y}},jL=function(){var e=AL({pathname:"",origin:b}),t=e.data,n=e.error,r=e.loading,i=e.fetchData;return{videoData:t||null,loading:r,error:n,fetch:function(e){i({method:"post",url:"/videos",baseURL:b,data:{filename:e.filename,title:e.title}},e.hasOwnProperty("id")?e.id:void 0)},progress:e.progress}},IL=function(){var e=AL({pathname:""}),t=e.data,n=e.error,r=e.loading,i=e.fetchData,o=e.progress;return{encodeData:t&&(t.data||t.jobId)||null,loading:r,error:n,fetch:function(e){var t=e.videoId;return i({method:"post",url:"videos/".concat(t,"/encode"),baseURL:b})},progress:o}},ML=function(){var e=AL({origin:b}),t=e.data,n=e.error,r=e.loading,i=e.fetchData;return{presignedUrl:t,loading:r,error:n,fetch:function(e){i({method:"get",url:"aws/signedurl?filename=".concat(e.fileName,"&filetype=").concat(e.type),baseURL:b},e.hasOwnProperty("id")?e.id:void 0)}}},DL=function(){return DL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},DL.apply(this,arguments)},RL=(0,E.createContext)({}),FL=function(e){var n=e.children,r=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)({}),2),i={action:r[0],setAction:r[1]};return(0,t.jsx)(RL.Provider,DL({value:i},{children:n}))},LL=(RL.Consumer,function(e){return{type:e.type,meta:e.meta}}),BL=function(e){return{type:e.type,payload:e.payload,meta:e.meta}},NL=function(e){var t=e.type,n=e.payload,r=e.meta,i=e.error;return{type:t,payload:n,meta:r,error:void 0===i||i}},zL=function(){return zL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zL.apply(this,arguments)};function VL(e,t){switch(t.type){case"FETCH_REQUEST":return zL(zL({},e),{loading:!0,error:null});case"FETCH_SUCCESS":return zL(zL({},e),{data:t.payload,loading:!1,error:null});case"FETCH_FAILURE":return zL(zL({},e),{loading:!1,error:t.payload});default:return e}}var UL={data:void 0,loading:!1,error:null},HL=function(){var e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useReducer)(VL,UL),2),t=e[0],n=e[1],r=t.error,i=t.loading,o=t.data,a=Ju().toast;!function(e){var t=(0,E.useContext)(RL).action;(0,E.useEffect)((function(){e(t)}),[t,e])}(n);var s=(0,E.useCallback)((function(e){return t=void 0,r=void 0,o=function(){var t,r,i;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(o){switch(o.label){case 0:n(LL({type:"FETCH_REQUEST"})),t=function(t){e.onUploadProgress(t,e.hasOwnProperty("id")?e.id:void 0)},o.label=1;case 1:return o.trys.push([1,3,,4]),r=function(){var e;return-1!==(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.indexOf("Firefox"))}(),[4,kn().put(e.url,e.file,{headers:{"content-type":!r&&e.contentType?e.contentType:e.file.type},onUploadProgress:t})];case 2:return o.sent(),n(BL({type:"FETCH_SUCCESS",payload:{success:!0,id:e.hasOwnProperty("id")?e.id:void 0}})),[2];case 3:if((i=o.sent())instanceof Error)throw a({message:null==i?void 0:i.message}),n(NL({type:"FETCH_FAILURE",payload:"Something wen wrong"})),new Error(i.message);return[3,4];case 4:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(t,r||[])).next())}));var t,r,i,o}),[]);return{data:o,loading:i,error:r,uploadVideo:s}},GL=function(){return GL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},GL.apply(this,arguments)};function WL(e,t){switch(t.type){case"FETCH_REQUEST":return GL(GL({},e),{loading:!0,error:null});case"FETCH_SUCCESS":return GL(GL({},e),{data:t.payload,loading:!1,error:null});case"FETCH_FAILURE":return GL(GL({},e),{data:void 0,loading:!1,error:t.payload});default:return e}}var qL,$L=function(){var e=(0,E.useContext)(RL).setAction,t=Ju().toast,n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useReducer)(WL,{data:void 0,loading:!1,error:null,isValid:!1}),2),r=n[0],i=n[1],o=r.data,a=r.error,s=r.loading;return{start:function(n){return r=void 0,a=void 0,l=function(){var r,a;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(s){switch(s.label){case 0:i(LL({type:"FETCH_REQUEST"})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Yn(n)];case 2:return r=s.sent(),i(BL({type:"FETCH_SUCCESS",payload:r})),t({title:"Transcription Started"}),[2,{data:o,loading:!1,error:null}];case 3:return a=s.sent(),t({message:a}),i(NL({type:"FETCH_FAILURE",payload:"Something went wrong"})),e({type:"START_VIDEO_TRANSCRIPTION"}),[2,Promise.reject({loading:!1,error:"Something went wrong"})];case 4:return[2]}}))},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,i)}o((l=l.apply(r,a||[])).next())}));var r,a,s,l},data:o,loading:s,error:a}};function ZL(){return ZL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZL.apply(this,arguments)}const YL=tt((function(e){return E.createElement("svg",ZL({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),qL||(qL=E.createElement("g",{fill:"#272A32"},E.createElement("path",{id:"bqn2hmlmqa",d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))))}))(QL||(QL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"1"}));var QL,KL=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},XL=function(){return XL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},XL.apply(this,arguments)},JL=tt.div(iB||(iB=KL(["\n margin-top: ","px;\n text-align: center;\n width: ","px;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n height: ","px;\n background-color: ",";\n\n .file-exists {\n text-align: left;\n color: red;\n }\n\n .drag-drop-zone {\n display: block;\n width: ","px;\n max-width: 100%;\n height: ","px;\n border: 1px dashed ",";\n border-radius: 5px;\n color: ",";\n font-size: 16px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n box-sizing: border-box;\n\n input {\n background: none !important;\n border: none;\n padding: 0 !important;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n color: ",";\n }\n }\n }\n\n .drag-drop-zone.inside-drag-area {\n svg {\n opacity: 0.7;\n }\n }\n\n .drag-drop-zone.outside-drag-area {\n svg {\n opacity: 0.3;\n }\n }\n\n .dropped-files li {\n color: #07f;\n padding: 3px;\n text-align: left;\n font-weight: bold;\n }\n\n .file {\n display: none;\n }\n"],["\n margin-top: ","px;\n text-align: center;\n width: ","px;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n height: ","px;\n background-color: ",";\n\n .file-exists {\n text-align: left;\n color: red;\n }\n\n .drag-drop-zone {\n display: block;\n width: ","px;\n max-width: 100%;\n height: ","px;\n border: 1px dashed ",";\n border-radius: 5px;\n color: ",";\n font-size: 16px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n box-sizing: border-box;\n\n input {\n background: none !important;\n border: none;\n padding: 0 !important;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n color: ",";\n }\n }\n }\n\n .drag-drop-zone.inside-drag-area {\n svg {\n opacity: 0.7;\n }\n }\n\n .drag-drop-zone.outside-drag-area {\n svg {\n opacity: 0.3;\n }\n }\n\n .dropped-files li {\n color: #07f;\n padding: 3px;\n text-align: left;\n font-weight: bold;\n }\n\n .file {\n display: none;\n }\n"])),(function(e){return e.marginTop}),(function(e){return e.width}),(function(e){return e.height}),(function(e){return e.backgroundColor||di}),(function(e){return e.width-2}),(function(e){return e.height}),Wi,Fi,"#007BFF"),eB=tt.div(oB||(oB=KL(["\n height: 100%;\n width: 100%;\n float: left;\n line-height: 0.2;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n z-index: -1;\n background-color: ",";\n"],["\n height: 100%;\n width: 100%;\n float: left;\n line-height: 0.2;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n z-index: -1;\n background-color: ",";\n"])),(function(e){return e.backgroundColor?e.backgroundColor:e.isActive?"#f6f7f9":"#fff"})),tB=tt.div(aB||(aB=KL(["\n svg {\n opacity: 1 !important;\n }\n"],["\n svg {\n opacity: 1 !important;\n }\n"]))),nB=tt.p(sB||(sB=KL(["\n width: 317px;\n margin: 0 0 21px;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: ",";\n"],["\n width: 317px;\n margin: 0 0 21px;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: ",";\n"])),pi);const rB=function(e){var n=e.accept,r=void 0===n?".csv, text/csv":n,i=e.inputStyle,o=void 0===i?{}:i,a=e.onDrop,s=e.text,l=void 0===s?"Drag and drop your files here or":s,c=e.width,u=void 0===c?528:c,f=e.height,d=void 0===f?100:f,p=e.marginTop,h=void 0===p?0:p,y=e.disabled,m=void 0!==y&&y,v=e.textStyle,g=e.backgroundColor,x=e.placeholder,b=void 0===x?"Browse files...":x,w=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(k().useReducer((function(e,t){var n,i;switch(t.type){case"SET_DROP_DEPTH":return XL(XL({},e),{dropDepth:t.dropDepth});case"SET_IN_DROP_ZONE":return XL(XL({},e),{inDropZone:t.inDropZone});case"ADD_FILE_TO_LIST":var o=!0;try{for(var a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.files),s=a.next();!s.done;s=a.next()){var l=s.value;o=r.includes(l.name.substr(-4))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o?XL(XL({},e),{fileList:e.fileList.concat(t.files)}):e;default:return e}}),{dropDepth:0,inDropZone:!1,fileList:[]}),2),S=w[0],C=w[1],E=function(){var e=document.getElementById("file");e&&e.click&&e.click()};return(0,t.jsx)(JL,XL({width:u,height:d,marginTop:h,backgroundColor:g},{children:(0,t.jsx)("div",XL({className:S.inDropZone?"drag-drop-zone inside-drag-area":"drag-drop-zone outside-drag-area",onDrop:function(e){return a(e)},onDragOver:function(e){return function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",C({type:"SET_IN_DROP_ZONE",inDropZone:!0})}(e)},onDragEnter:function(e){return function(e){e.preventDefault(),e.stopPropagation(),C({type:"SET_DROP_DEPTH",dropDepth:S.dropDepth+1})}(e)},onDragLeave:function(e){return function(e){e.preventDefault(),e.stopPropagation(),e.target&&e.target.id.includes("text-")||(C({type:"SET_DROP_DEPTH",dropDepth:S.dropDepth-1}),C({type:"SET_IN_DROP_ZONE",inDropZone:!1}))}(e)}},{children:(0,t.jsxs)(eB,XL({id:"text-browse",isActive:S.inDropZone,backgroundColor:g},{children:[!S.inDropZone&&0===S.fileList.length&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nB,XL({style:v},{children:l})),S.inDropZone?(0,t.jsx)("input",{type:"button",value:"browse your files...",onClick:E}):(0,t.jsx)(tB,{children:(0,t.jsx)(yo,{text:b,textColor:"#fff",backgroundColor:Qi,icon:(0,t.jsx)(YL,{color:"#fff"}),disabled:m,onClick:E,fontSize:"15px"})})]}),S.inDropZone&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)("p",XL({id:"text-drop"},{children:"Drop file here"}))]}),S.fileList[0]&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsxs)("p",{children:[S.fileList[0][0].name," is ready"]})]}),(0,t.jsx)("input",{className:"file",id:"file",type:"file",style:o,accept:r,onChange:function(e){return a(e)},disabled:m})]}))}))}))};var iB,oB,aB,sB,lB,cB,uB,fB,dB,pB,hB,yB,mB,vB,gB,xB,bB,wB,SB,CB,EB,kB,_B,OB=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},PB=tt.div(lB||(lB=OB(["\n min-height: 400px;\n position: relative;\n"],["\n min-height: 400px;\n position: relative;\n"]))),TB=tt.div(cB||(cB=OB(["\n font-size: 15px;\n color: ",";\n background-color: ",";\n\n display: flex;\n flex-direction: column;\n\n margin-top: 18px;\n padding: 20px 30px;\n\n min-height: 340px;\n max-height: 340px;\n overflow-y: auto;\n overflow-x: hidden !important;\n width: 500px;\n max-width: 100%;\n"],["\n font-size: 15px;\n color: ",";\n background-color: ",";\n\n display: flex;\n flex-direction: column;\n\n margin-top: 18px;\n padding: 20px 30px;\n\n min-height: 340px;\n max-height: 340px;\n overflow-y: auto;\n overflow-x: hidden !important;\n width: 500px;\n max-width: 100%;\n"])),Yi,Ci),AB=tt.div(fB||(fB=OB(["\n display: flex;\n justify-content: right;\n align-items: center;\n\n padding: 10px 20px;\n\n ","\n"],["\n display: flex;\n justify-content: right;\n align-items: center;\n\n padding: 10px 20px;\n\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(uB||(uB=OB(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),jB=(tt.label(pB||(pB=OB(["\n padding: ",";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: flex;\n align-items: center;\n cursor: ",";\n height: 40px;\n font-size: 15px;\n color: ",";\n background-color: ",";\n border-radius: 6px;\n border: 1px solid ",";\n font-weight: 600;\n\n ","\n"],["\n padding: ",";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: flex;\n align-items: center;\n cursor: ",";\n height: 40px;\n font-size: 15px;\n color: ",";\n background-color: ",";\n border-radius: 6px;\n border: 1px solid ",";\n font-weight: 600;\n\n ","\n"])),(function(e){return e.disabled?"8px 16px 8px 35px":"8px 16px 8px 12px"}),(function(e){return e.isAddMoreEnabled?"pointer":"not-allowed"}),Bi,Hi,ji,(function(e){return e.disabled&&Ne(dB||(dB=OB(["\n cursor: ",";\n "],["\n cursor: ",";\n "])),e.isAddMoreEnabled?"pointer":"not-allowed")})),tt.div(hB||(hB=OB(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"])))),IB=tt.div(yB||(yB=OB(["\n display: flex;\n"],["\n display: flex;\n"]))),MB=tt.div(mB||(mB=OB(["\n width: 0%;\n color: white;\n background-color: transparent;\n height: 4px;\n text-align: right;\n font-size: 1px;\n border-radius: 15px;\n"],["\n width: 0%;\n color: white;\n background-color: transparent;\n height: 4px;\n text-align: right;\n font-size: 1px;\n border-radius: 15px;\n"]))),DB=tt.div(gB||(gB=OB(["\n width: 50%;\n color: black;\n padding: 1%;\n text-align: left;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"],["\n width: 50%;\n color: black;\n padding: 1%;\n text-align: left;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(vB||(vB=OB(["\n font-size: 15px;\n "],["\n font-size: 15px;\n "])))})),RB=tt.div(xB||(xB=OB(["\n display: flex;\n background: ",";\n"],["\n display: flex;\n background: ",";\n"])),Ci),FB=tt.div(wB||(wB=OB(["\n flex-grow: 1;\n color: black;\n padding: 1%;\n text-align: right;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"],["\n flex-grow: 1;\n color: black;\n padding: 1%;\n text-align: right;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(bB||(bB=OB(["\n font-size: 15px;\n "],["\n font-size: 15px;\n "])))})),LB=tt.div(CB||(CB=OB(["\n position: absolute;\n top: -47px;\n left: 0;\n padding: 0 32px;\n height: 30px;\n font-size: 18px;\n color: ",";\n background-color: white;\n\n ","\n"],["\n position: absolute;\n top: -47px;\n left: 0;\n padding: 0 32px;\n height: 30px;\n font-size: 18px;\n color: ",";\n background-color: white;\n\n ","\n"])),Pi,(function(e){return e.theme.containerWidth<ti&&Ne(SB||(SB=OB(["\n font-size: 16px;\n "],["\n font-size: 16px;\n "])))})),BB=tt.div(EB||(EB=OB(["\n display: flex;\n height: 249px;\n padding: 32px;\n align-items: center;\n"],["\n display: flex;\n height: 249px;\n padding: 32px;\n align-items: center;\n"]))),NB=function(){return NB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},NB.apply(this,arguments)},zB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},VB=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},UB=tt.div(kB||(kB=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-size: 14px;\n color: ",";\n height: 20px;\n margin-top: 15px;\n"],["\n font-size: 14px;\n color: ",";\n height: 20px;\n margin-top: 15px;\n"])),Ri),HB=function(e){var n=e.progress,r=e.uploadingData,i=e.setUploadingData,o=[],a=[],s=[],l=[],c=zB(k().useState([{elementId:0,isTitleNotEmpty:!0}]),2),u=c[0],f=c[1];for(var d in r)o.push(r[d]),a=(l=o.filter((function(e){return 1===e.showActiveVideo}))).filter((function(e){return 1===e.status})),s=l.reduce((function(e,t){return t.progressEvent.total+e}),0);var p=function(e){return e.status>=1};return(0,t.jsxs)("div",{children:[!!n&&(0,t.jsxs)(LB,{children:[(0,t.jsx)("span",{children:(0,t.jsxs)("b",{children:[a.length," of ",l.length]})})," videos uploading (",Ot(s)," MB)"]}),o.map((function(e){return(0,t.jsxs)(jB,{children:[" ",e.showActiveVideo?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(IB,NB({style:NB({},p(e)&&{flexDirection:"column"})},{children:[(0,t.jsx)(lo,{maxLength:100,type:"text",value:e.title,readOnly:!!n,width:"100%",onChange:function(t){return function(e,t){u.filter((function(t){return t.elementId===e})).forEach((function(e){var t=u.indexOf(e);t>=0&&f(u.splice(t,1))})),f(VB(VB([],zB(u),!1),[{elementId:e,isTitleNotEmpty:!!t.trimStart()}],!1)),i((function(n){var r;return NB(NB({},n),((r={})[e]=NB(NB({},n[e]),{title:t}),r))}))}(e.id,t.target.value)}}),p(e)&&(0,t.jsxs)("div",NB({style:{width:"100%",marginTop:"18px",backgroundColor:"white"}},{children:[(0,t.jsx)(MB,{style:{width:e.progressEvent.percentage+"%",backgroundColor:Qi}}),(0,t.jsxs)(RB,{children:[(0,t.jsx)(DB,{children:(r=e.status,0===r?"Waiting...":1===r?"Uploading...":"Encoding...")}),(0,t.jsx)(FB,{children:Ot(e.progressEvent.loaded)+" MB/"+Ot(e.progressEvent.total)+" MB"})]})]}))]})),u.map((function(n){return n.elementId!==e.id||n.isTitleNotEmpty?(0,t.jsx)("div",{},"el-".concat(n.elementId)):(0,t.jsx)(UB,{children:"Video title is required!"},"error-".concat(n.elementId))}))]}):""]},"Video-list-".concat(e.id));var r}))]})},GB=function(){return GB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},GB.apply(this,arguments)},WB=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},qB=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},$B=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};!function(e){e[e.FORM=0]="FORM",e[e.UPLOADING=1]="UPLOADING",e[e.CREATE=2]="CREATE",e[e.ENCODE=3]="ENCODE"}(_B||(_B={}));const ZB=function(e){var n=e.handleModalClose,r=e.onSuccess,i=Ju().toast,o=Nl().userData,a=$L().start,s=$B((0,E.useState)(_B.FORM),2),l=s[0],c=s[1],u=$B((0,E.useState)({}),2),f=u[0],d=u[1],p=$B((0,E.useState)(!1),2),h=p[0],y=p[1],m=$B((0,E.useState)(!1),2),v=m[0],g=m[1],x=$B((0,E.useState)(!1),2),b=x[0],w=x[1],S=$B((0,E.useState)(_B.FORM),2),C=S[0],k=S[1],_=$B((0,E.useState)([]),2),O=_[0],P=_[1],T=$B((0,E.useState)({loaded:0,total:0,percentage:0}),2),A=(T[0],T[1]),j=ML(),I=j.presignedUrl,M=j.fetch,D=j.loading,R=j.error,F=HL(),L=F.uploadVideo,B=F.loading,N=F.data,z=F.error,V=jL(),U=V.fetch,H=V.loading,G=V.videoData,W=V.error,q=IL(),$=q.fetch,Z=q.loading,Y=q.encodeData;(0,E.useEffect)((function(){if(!D&&!R&&Object.keys(f).length){c(_B.UPLOADING),k(_B.UPLOADING);var e=(I||{id:-1}).id;if(void 0===e)return;Object.keys(f).length&&(f[e].status=1,d(f)),L({url:I.url,file:f[e].file,onUploadProgress:X,id:I.id})}}),[I]),(0,E.useEffect)((function(){if(!B&&!z&&N&&Object.keys(f).length){var e=(N||{id:-1}).id;if(void 0===e)return;Object.keys(f).length&&(f[e].status=2,d(f));var t=f[e];k(_B.CREATE),U({filename:t.file.name,title:t.title,id:N.id})}}),[B,N]),(0,E.useEffect)((function(){l===_B.FORM||f&&Object.keys(f).length||c(_B.FORM);var e=[],t=[];Object.keys(f).forEach((function(n){e.push(!(!f[n].title||!f[n].title.trimStart())),t.push(f[n].title.length>100)})),e.includes(!1)?y(!0):t.includes(!0)?(i({title:"Video title can not be more than 100 characters!"}),y(!0)):y(!1)}),[f]),(0,E.useEffect)((function(){if(!H&&!W&&G&&Object.keys(f).length){k(_B.ENCODE);var e=(G||{id:-1}).id;if(void 0===e)return;Object.keys(f).length&&(f[e].status=3,d(f)),P([Number(G.video_id)]),$({videoId:G.video_id,customerId:o.customerId})}}),[H,G]),(0,E.useEffect)((function(){Z||!Y||O.length!==Object.keys(f).length||Object.values(f).some((function(e){return e.status<3}))||(J(),r(O),n())}),[H,Y,O]);var Q=function(){if(C===_B.FORM)return n();w(!0)},K=function(){g(!0),Object.keys(f).forEach((function(e){var t=f[e].file;M({fileName:t.name,type:t.type,id:parseInt(e,10)})}))},X=function(e,t){var n=Math.round(100*e.loaded/e.total);if(void 0!==t&&f[t]){var r=GB({},f);r[t].progressEvent={loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:n},d(r),A({loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:n})}},J=function(){if(o.autoTranscribe&&G&&G.id)try{setTimeout((function(){a(G.id)}),5e3)}catch(e){console.log(e)}},ee=!!Object.keys(f).length,te=function(e){var n=e.disabled,r=void 0!==n&&n,i=e.title,o=void 0===i?"Upload":i,a=e.onClick,s=void 0===a?K:a;return(0,t.jsx)(yo,{text:o,backgroundColor:Qi,textColor:di,onClick:s,margin:"0",padding:"8px 16px",fontSize:"15px",disabled:r})},ne=(0,t.jsxs)(PB,{children:[(0,t.jsx)(TB,GB({style:GB({},!ee&&{backgroundColor:"transparent",marginTop:0,maxHeight:"400px"})},{children:ee?(0,t.jsx)(HB,{uploadingData:f,setUploadingData:d,progress:C}):(0,t.jsx)(rB,{onDrop:function(e){return WB(void 0,void 0,void 0,(function(){var t;return qB(this,(function(n){switch(n.label){case 0:return e.preventDefault(),e.stopPropagation(),(t=e.dataTransfer||e.target)&&t.files&&t.files.length?[4,(r=t.files,WB(void 0,void 0,void 0,(function(){var e,t;return qB(this,(function(n){for(e=function(e){if(!/.*\.(avchd|swf|flv|mov|qt|wmv|mkv|m4v|m4p|mpv|mp2|mpe|mpg|ogg|mp4|avi|webm|mpeg)/i.test(r[e].name))return i({title:"".concat(r[e].name," is of invalid type and won't be uploaded.")}),"continue";var t=r[e].name.split("."),n="mkv"===t[1]?"video/x-matroska":r[e].type,a=new File([r[e]],Ct(o,t[t.length-1]),{type:n,lastModified:r[e].lastModified});d((function(e){var n=GB({},e),r=0;if(Object.keys(e).length){var i=Object.keys(e);r=parseInt(i[i.length-1],10)+1}return n[r]={id:r,file:a,title:t[0],progressEvent:{loaded:0,total:0,percentage:0},status:0,showActiveVideo:1},n}))},t=0;t<r.length;t++)e(t);return[2]}))})))]:[3,2];case 1:return n.sent(),[3,3];case 2:i({title:"Oops! Something went wrong, try again in a few moments"}),n.label=3;case 3:return[2]}var r}))}))},marginTop:0,height:350,width:440,accept:"video/*,.mkv"})})),ee&&(0,t.jsxs)(AB,{children:[(0,t.jsx)(yo,{text:"Cancel",backgroundColor:Hi,textColor:Fi,onClick:Q,margin:"0 12px 0 0",padding:"8px 16px",fontSize:"15px"}),(0,t.jsx)(te,{disabled:h||v})]})]}),re=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(TB,{children:(0,t.jsx)(HB,{uploadingData:f,setUploadingData:d,progress:C})}),(0,t.jsxs)(AB,GB({style:{justifyContent:"right"}},{children:[(0,t.jsx)(yo,{text:"Cancel",backgroundColor:Hi,textColor:Fi,onClick:Q,margin:"0 12px 0 0",padding:"8px 16px",fontSize:"15px"}),(0,t.jsx)(te,{disabled:!0})]}))]}),ie=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(TB,{children:(0,t.jsx)(BB,{children:"You will have to restart your video upload from the beginning if you cancel now. Are you sure you want to cancel this upload?"})}),(0,t.jsxs)(AB,{children:[(0,t.jsx)(yo,{text:"Cancel Upload",backgroundColor:Hi,textColor:Fi,onClick:n,margin:"0 12px 0 0",padding:"8px 16px",fontSize:"15px"}),(0,t.jsx)(te,{title:"Continue Upload",onClick:function(){return w(!1)}})]})]});return[ne,(0,t.jsx)(PB,{children:b?ie:re})][l]};var YB,QB,KB,XB,JB,eN,tN,nN,rN,iN,oN,aN,sN,lN,cN,uN,fN,dN,pN,hN,yN,mN,vN,gN,xN,bN,wN,SN,CN,EN,kN,_N,ON,PN,TN,AN,jN,IN,MN,DN,RN,FN,LN,BN,NN,zN,VN=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UN=function(){return UN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UN.apply(this,arguments)},HN=tt.div(YB||(YB=VN(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 25px 30px 5px 30px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 25px 30px 5px 30px;\n"]))),GN=tt.div(QB||(QB=VN(["\n font-weight: bold;\n font-size: 18px;\n"],["\n font-weight: bold;\n font-size: 18px;\n"]))),WN=function(e){var n=e.handleModalClose,r=e.disabled,i=e.onSuccess;return(0,t.jsxs)(kL,UN({disableFullScreen:!0},{children:[(0,t.jsxs)(HN,{children:[(0,t.jsx)(GN,{children:"Upload new video"}),(0,t.jsx)(vu,{style:{position:"static",padding:0,height:"fit-content",width:"fit-content"},disabled:r,onClick:n})]}),(0,t.jsx)(ZB,{handleModalClose:n,onSuccess:i})]}))},qN=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$N=function(){return $N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$N.apply(this,arguments)},ZN=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},YN=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},QN=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},KN=tt.div(KB||(KB=qN(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),XN=tt.div(JB||(JB=qN(["\n display: flex;\n justify-content: space-between;\n gap: 16px;\n ","\n"],["\n display: flex;\n justify-content: space-between;\n gap: 16px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(XB||(XB=qN(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),JN=tt.div(tN||(tN=qN(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(eN||(eN=qN(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])))})),ez=tt.div(rN||(rN=qN(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(nN||(nN=qN(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),tz=tt.div(oN||(oN=qN(["\n width: 216px;\n ","\n"],["\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ri&&Ne(iN||(iN=qN(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),nz=tt.div(lN||(lN=qN(["\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n ","\n ","\n"],["\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n ","\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(aN||(aN=qN(["\n grid-template-columns: 1fr 1fr;\n "],["\n grid-template-columns: 1fr 1fr;\n "])))}),(function(e){return e.theme.containerWidth<ti&&Ne(sN||(sN=qN(["\n grid-template-columns: 1fr;\n "],["\n grid-template-columns: 1fr;\n "])))})),rz={folderId:-2,name:"Primary",isDeletable:!1},iz=function(e){var n=e.handleUpdateToken,r=Nl().userData,i=Ju().toast,o=Mt(),a=o.hasExternalJwt,s=o.showMergeFeature,l=o.showWheelsTVFeature,c=o.showRecordFeature,u=o.showUploadFeature,f=o.showFolderFeature,d=o.containerWidth,p=QN((0,E.useState)(!1),2),h=p[0],y=p[1],g=QN((0,E.useState)([]),2),x=g[0],w=g[1],C=QN((0,E.useState)(!1),2),k=C[0],_=C[1],O=Xl(r),P=ec(r),T=QN((0,E.useState)(0),2),A=T[0],j=T[1],I=dn(),M=QN((0,E.useState)({page:0,size:6,folderId:rz.folderId,searchQuery:""}),2),D=M[0],R=M[1],F=(0,v.useQuery)("cds-folders",Gn,{refetchOnWindowFocus:!1,staleTime:5e8,select:function(e){var t=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],QN(e),!1);return r.automotiveRole===Dl.TECHNICIAN&&(t=e.filter((function(e){return"Vault"!==e.name&&"Private"!==e.name}))),t}}).data,L=F?(0,Eu.keyBy)(F,"folderId"):{},B=L[D.folderId]||rz,N=L[D.folderId]?L[D.folderId].name:rz.name;N=N===Hn?Un:N;var z=(0,v.useQuery)(["cds-videos",D],(function(){return ZN(void 0,void 0,void 0,(function(){return YN(this,(function(e){return[2,(t={folder:N,search:D.searchQuery,size:D.size,page:D.page},Ln(void 0,void 0,void 0,(function(){var e,n,r,i,o;return Bn(this,(function(a){switch(a.label){case 0:return e=S.bearerToken,[4,Tn({url:"/videos",baseURL:b,method:Nn,headers:e,params:{start:(t.page||0)*(t.size||10),limit:t.size,search:t.search,folder:t.folder}}).catch((function(e){return e}))];case 1:if((n=a.sent())instanceof Error)throw n;return r=(null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.videos)||(null==n?void 0:n.videos)||[],[2,{count:(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.count)||(null==n?void 0:n.count)||0,videos:r}]}}))})))];var t}))}))}),{refetchOnWindowFocus:!1,enabled:!!(null==F?void 0:F.length)}),V=z.data,U=z.isLoading,H=V||{count:0,videos:[]},G=H.count,W=H.videos,q=(null==F?void 0:F.filter(Boolean).filter((function(e){return e.folderId!==Un})).map((function(e){return{value:e.folderId,label:e.name}})).concat([{value:Un,label:Hn}]))||[],$=function(){y(!1),localStorage.removeItem(m.merge),w([])},Z=function(e){"left"===e&&R((function(e){return $N($N({},e),{page:e.page-1})})),"right"===e&&R((function(e){return $N($N({},e),{page:e.page+1})}))};(0,E.useEffect)((function(){var e,t=null===(e=r.customer)||void 0===e?void 0:e.packageId;Number(t)!==oF.FREE&&Number(t)!==oF.PRO||(i({message:"Please upgrade you account to use eLead integration."}),n(""),I.go(0))}),[]),(0,E.useEffect)((function(){var e=localStorage.getItem(m.merge);if(e)try{var t=JSON.parse(e)||[];w(t),y(!!t.length)}catch(e){localStorage.removeItem(m.merge)}}),[]),(0,E.useEffect)((function(){A&&I.push("/preview-upload/".concat(A))}),[A]);var Y=(null==B?void 0:B.name)===Fn;return(0,t.jsxs)(KN,{children:[(0,t.jsx)(io,{left:a?(0,t.jsx)(Jr,{isAutomotive:O}):(0,t.jsx)(ZF,{name:r.firstName||r.lastName||"Welcome",handleUpdateToken:n}),center:!a&&(0,t.jsx)(Jr,{isAutomotive:O}),right:(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsx)(yo,{onClick:function(){return _(!0)},text:d>ri?"Upload":"",textColor:Bi,backgroundColor:Hi,borderColor:ji,fontSize:"15px",icon:(0,t.jsx)(Nc,{size:22})}),c&&(0,t.jsx)(yo,{onClick:function(){return I.push("/record/home")},text:d>ri?"Record":"",icon:(0,t.jsx)(Rc,{size:22}),textColor:di,backgroundColor:Ri,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsxs)(XN,{children:[(0,t.jsxs)(JN,{children:[(0,t.jsx)(LF,{handleSearch:function(e){var t=e.toLowerCase();R((function(e){return $N($N({},e),{page:0,searchQuery:t})}))},prevSearch:D.searchQuery}),f&&(0,t.jsx)(tz,{children:(0,t.jsx)(bl,{options:q,value:{value:(null==B?void 0:B.folderId)||rz.folderId,label:(null==B?void 0:B.name)||rz.name},onChange:function(e){var t,n;return(n=null!==(t=null==e?void 0:e.value)&&void 0!==t?t:rz.folderId).toString()===(-1).toString()&&$(),void R((function(e){return $N($N({},e),{page:0,folderId:n})}))},isSearchable:!1})})]}),(l||s)&&(0,t.jsxs)(t.Fragment,{children:[!h&&(0,t.jsxs)(JN,{children:[l&&r.wheelsTV&&(!O||P)&&(0,t.jsx)(yo,{onClick:function(){return I.push("/wheels-tv")},icon:(0,t.jsx)(oT,{size:18,color:Si}),text:"WheelsTV",textColor:Si,backgroundColor:di,borderColor:bi,fontSize:"15px"}),s&&(0,t.jsx)(yo,{onClick:function(){return Y?{}:y(!0)},text:"Merge Videos",textColor:Si,backgroundColor:di,borderColor:bi,fontSize:"15px",disabled:Y})]}),h&&(0,t.jsxs)(JN,{children:[(0,t.jsx)(yo,{onClick:$,text:"Cancel",textColor:Si,backgroundColor:di,borderColor:bi,fontSize:"15px"}),(0,t.jsx)(xL,{width:"250px",position:"top-right",popup:(0,t.jsxs)(t.Fragment,{children:[x.length<2&&"Select 2+ videos to merge",x.length>9&&"Select maximum 9 videos"]}),cursor:"initial",showTriangle:!0,disableHover:x.length>=2&&x.length<=9,hoverable:(0,t.jsx)(yo,{onClick:function(){localStorage.setItem(m.merge,JSON.stringify(x));var e=x.map((function(e){return e.id})).filter(Boolean).join(",");I.push("/merge/?videos=".concat(e))},text:"Merge Videos",textColor:di,disabled:Y||x.length<2||x.length>9,backgroundColor:Qi,fontSize:"15px"})})]})]})]}),(0,t.jsxs)(t.Fragment,{children:[!U&&!!W.length&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nz,{children:W.map((function(e,n){return(0,t.jsx)(IF,{video:e,isMerge:h,selectedVideosData:x,setSelectedVideosData:w},n)}))}),(0,t.jsxs)(ez,{children:[(0,t.jsx)(QF,{page:D.page,size:D.size,count:G}),(0,t.jsx)(yo,{onClick:function(){return Z("left")},icon:(0,t.jsx)(Hc,{size:22}),disabled:0===D.page}),(0,t.jsx)(yo,{onClick:function(){return Z("right")},icon:(0,t.jsx)(Gc,{size:22}),disabled:W.length<D.size||(D.page+1)*D.size>=G})]})]}),U&&(0,t.jsx)(HF,{message:"Loading...",size:D.size}),!U&&!W.length&&(0,t.jsx)(HF,{message:"No videos match your query",size:D.size})]})]}),k&&(0,t.jsx)(WN,{handleModalClose:function(){return _(!1)},onSuccess:function(e){return ZN(void 0,void 0,void 0,(function(){return YN(this,(function(t){return e.length?(j(e[0]),[2]):[2]}))}))}})]})},oz=function(){return oz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oz.apply(this,arguments)},az=tt.div(cN||(cN=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),(function(e){return e.color||_i})),sz=function(e){var n=e.text,r=e.color;return(0,t.jsx)(az,oz({color:r},{children:n}))},lz=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},cz=function(){return cz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cz.apply(this,arguments)},uz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},fz=tt.div(uN||(uN=lz(["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n padding: 50px 0;\n"],["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n padding: 50px 0;\n"]))),dz=tt.div(fN||(fN=lz(["\n width: 400px;\n max-width: calc(100% - 32px);\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 16px;\n padding: 32px;\n"],["\n width: 400px;\n max-width: calc(100% - 32px);\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 16px;\n padding: 32px;\n"])),di),pz=tt.form(dN||(dN=lz(["\n margin-top: 24px;\n display: block;\n"],["\n margin-top: 24px;\n display: block;\n"]))),hz=tt.div(pN||(pN=lz(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-bottom: 24px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-bottom: 24px;\n"]))),yz=tt.div(hN||(hN=lz(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),mz=tt.a(yN||(yN=lz(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),Si),vz=tt.div(mN||(mN=lz(["\n text-align: center;\n color: ",";\n font-weight: 600;\n font-size: 18px;\n line-height: 24px;\n"],["\n text-align: center;\n color: ",";\n font-weight: 600;\n font-size: 18px;\n line-height: 24px;\n"])),Si),gz=tt.div(vN||(vN=lz(["\n text-align: center;\n color: ",";\n font-size: 12px;\n margin-top: 12px;\n"],["\n text-align: center;\n color: ",";\n font-size: 12px;\n margin-top: 12px;\n"])),Si),xz=tt.div(gN||(gN=lz(["\n border-radius: 6px;\n color: #721c24;\n background-color: #f8d7da;\n border: 1px solid #f5c6cb;\n padding: 12px 20px;\n margin-bottom: 16px;\n"],["\n border-radius: 6px;\n color: #721c24;\n background-color: #f8d7da;\n border: 1px solid #f5c6cb;\n padding: 12px 20px;\n margin-bottom: 16px;\n"]))),bz=tt.div(xN||(xN=lz(["\n position: relative;\n"],["\n position: relative;\n"]))),wz=tt.div(bN||(bN=lz(["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),Sz=function(e){var n=e.handleUpdateToken,r=Mt().hasExternalJwt,i=uz((0,E.useState)(""),2),o=i[0],a=i[1],s=uz((0,E.useState)(""),2),l=s[0],c=s[1],u=uz((0,E.useState)(""),2),f=u[0],d=u[1],p=uz((0,E.useState)(!1),2),h=p[0],y=p[1],m=dn();return r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(io,{center:(0,t.jsx)(Jr,{})}),(0,t.jsx)(fz,{children:(0,t.jsxs)(dz,{children:[(0,t.jsx)(vz,{children:"Login failed"}),(0,t.jsx)(gz,{children:"External token invalid."})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(io,{center:(0,t.jsx)(Jr,{})}),(0,t.jsx)(fz,{children:(0,t.jsxs)(dz,{children:[(0,t.jsx)(vz,{children:"Login to your Covideo account"}),(0,t.jsxs)(pz,cz({onSubmit:function(e){return t=void 0,r=void 0,a=function(){var t,r;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(i){switch(i.label){case 0:e.preventDefault(),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,Dn({username:o,password:l})];case 2:return t=i.sent(),r=t.accessToken,[4,n(r)];case 3:return i.sent(),m.go(0),[3,5];case 4:return i.sent(),d("Incorrect Login"),[3,5];case 5:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,s)}l((a=a.apply(t,r||[])).next())}));var t,r,i,a}},{children:[(0,t.jsxs)(hz,{children:[(0,t.jsx)(sz,{text:"Username"}),(0,t.jsx)(lo,{width:"100%",type:"text",value:o,placeholder:"Username",required:!0,onChange:function(e){return a(e.target.value)}})]}),(0,t.jsxs)(hz,{children:[(0,t.jsx)(sz,{text:"Password"}),(0,t.jsxs)(bz,{children:[(0,t.jsx)(lo,{width:"100%",type:h?"text":"password",value:l,placeholder:"Password",required:!0,padding:"8px 40px 8px 8px",onChange:function(e){return c(e.target.value)}}),(0,t.jsxs)(wz,cz({onClick:function(){y((function(e){return!e}))}},{children:[!h&&(0,t.jsx)(lT,{size:22}),h&&(0,t.jsx)(sT,{size:22})]}))]})]}),f&&(0,t.jsx)(xz,{children:f}),(0,t.jsxs)(yz,{children:[(0,t.jsx)(yo,{backgroundColor:"rgba(255, 139, 34, 1)",textColor:di,text:"Login",type:"submit",fontSize:"15px",disabled:""===o||""===l}),(0,t.jsx)(mz,cz({target:"_blank",href:"https://www.covideo.com/reset-password/"},{children:"Forgot password?"}))]})]}))]})})]})},Cz=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ez=function(){return Ez=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ez.apply(this,arguments)},kz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_z=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Oz=tt.div(wN||(wN=Cz(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ",";\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ",";\n"])),(function(e){return e.marginBottom?e.marginBottom:"0"})),Pz=tt.div(SN||(SN=Cz(["\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n"]))),Tz=tt.div(CN||(CN=Cz(["\n margin-bottom: ",";\n width: ",";\n"],["\n margin-bottom: ",";\n width: ",";\n"])),(function(e){return e.marginBottom?e.marginBottom:"16px"}),(function(e){return e.width?e.width:"auto"})),Az=tt.p(EN||(EN=Cz(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0 0 8px 0;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0 0 8px 0;\n"])),_i),jz=tt.label(kN||(kN=Cz(["\n margin-left: 12px;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n margin-left: 12px;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),Pi),Iz=tt.a(_N||(_N=Cz(["\n max-height: 24px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n text-align: right;\n color: ",";\n text-decoration: underline;\n &:hover {\n cursor: pointer;\n }\n"],["\n max-height: 24px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n text-align: right;\n color: ",";\n text-decoration: underline;\n &:hover {\n cursor: pointer;\n }\n"])),vi),Mz=tt.input(ON||(ON=Cz(["\n width: 100%;\n border-radius: 4px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n border: solid 1px ",";\n outline: none;\n padding: 8px 12px;\n"],["\n width: 100%;\n border-radius: 4px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n border: solid 1px ",";\n outline: none;\n padding: 8px 12px;\n"])),Ci),Dz={control:function(e){return Ez(Ez({},e),{height:"40px"})},indicatorSeparator:function(){return{display:"none"}}},Rz=function(e){var n=e.linksetsData,r=e.linksetsLoading,i=e.templatesData,o=e.templatesLoading,a=e.overlaysData,s=e.overlaysLoading,l=e.checkboxes,c=e.selectedCheckboxes,u=e.setSelectedCheckboxes,f=e.insertVideoData,d=e.setInsertVideoData,p=Mt(),h=p.showCTAFeature,y=p.showLandingPageFeature,m=p.showReactionsFeature,v=kz((0,E.useState)([]),2),g=v[0],x=v[1],b=kz((0,E.useState)([]),2),w=b[0],S=b[1],C=kz((0,E.useState)([]),2),_=C[0],O=C[1],P=kz((0,E.useState)(!1),2),T=P[0],A=P[1],j=-1===f.templateId;(0,E.useEffect)((function(){!T&&w.length&&d(Ez(Ez({},f),{overlayId:w[0].value}))}),[T]),(0,E.useEffect)((function(){x((i||[]).map((function(e){return{value:e.id,label:e.title}})))}),[i]),(0,E.useEffect)((function(){S((a||[]).map((function(e){var t=e.id,n=e.title;return{value:t.toString(),label:n}})))}),[a]);var I=ku().debounce((function(e){d(Ez(Ez({},f),j?{overlayId:e}:{linksetId:e}))}),1e3);return(0,E.useEffect)((function(){var e=[{value:"-1",label:"None"}];e=n.every((function(e){return"-1"!==e.id}))?e.concat((n||[]).map((function(e){var t=e.id,n=e.title;return{value:t.toString(),label:n}}))):(n||[]).map((function(e){var t=e.id,n=e.title;return{value:t.toString(),label:n}})),O(e)}),[n]),k().useEffect((function(){-1!==f.templateId&&A(!1),w.length<=0&&S([{value:"",label:""}])}),[j]),(0,t.jsxs)(t.Fragment,{children:[y&&(0,t.jsx)(Oz,{children:(0,t.jsxs)(Tz,Ez({width:"100%"},{children:[(0,t.jsx)(Az,{children:"Landing Page"}),(0,t.jsx)(cl,{value:g.find((function(e){return e.value===f.templateId})),styles:Dz,options:g,onChange:function(e){return null!==e&&d(Ez(Ez({},f),{templateId:parseInt(e.value)}))},isLoading:o})]}))}),(h||j)&&(0,t.jsx)(Oz,{children:(0,t.jsxs)(Tz,Ez({width:"100%",marginBottom:"35px"},{children:[(0,t.jsxs)(Oz,{children:[(0,t.jsx)(Az,{children:j?"Websites":"CTAs"}),j&&(0,t.jsx)(Iz,Ez({onClick:function(){return A((function(e){return!e}))}},{children:T?"Use Existing":"Add New"}))]}),!T&&(0,t.jsx)(cl,{"aria-label":"CTA",id:"select-cta-dropdown",className:"dropdown",value:j?w.find((function(e){return e.value==f.overlayId})):_.find((function(e){return e.value==f.linksetId})),isClearable:j,placeholder:j?"No Websites":"No CTAs",options:j?w:_,onChange:function(e){if(e)return d(Ez(Ez({},f),j?{overlayId:e.value}:{linksetId:e.value}))},isLoading:j?s:r}),T&&(0,t.jsx)(Mz,{type:"text",placeholder:"Enter website",onChange:function(e){I(e.target.value)}})]}))}),!!l.length&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(Tz,Ez({width:"100%",marginBottom:"15px"},{children:l.filter((function(e){return m||"enableReactions"!==e.value})).map((function(e,n){return(0,t.jsx)(Oz,{children:(0,t.jsxs)(Pz,{children:[(0,t.jsx)(lc,{id:"check-".concat(n),width:"24px",blueCheck:!0,checked:c.some((function(t){return t.value===e.value})),onChange:function(t){var n=t.target.checked;u(n?_z(_z([],kz(c),!1),[e],!1):c.filter((function(t){return t.value!==e.value})))}}),(0,t.jsx)(jz,Ez({htmlFor:"check-".concat(n)},{children:e.label}))]})},"check-".concat(n))}))}))})]})},Fz=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Lz=function(){return Lz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lz.apply(this,arguments)},Bz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Nz=tt.div(PN||(PN=Fz(["\n display: flex;\n align-items: center;\n padding-left: 12px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 12px;\n"]))),zz=tt.div(TN||(TN=Fz(["\n margin-left: 0px;\n width: 100%;\n"],["\n margin-left: 0px;\n width: 100%;\n"]))),Vz=tt.div(AN||(AN=Fz(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"],["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),Uz=tt.div(jN||(jN=Fz(["\n max-width: 100%;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 256px;\n margin-right: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ",";\n"],["\n max-width: 100%;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 256px;\n margin-right: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ",";\n"])),Pi),Hz=tt.div(IN||(IN=Fz(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n text-align: right;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n text-align: right;\n"])),_i),Gz=tt.div(MN||(MN=Fz(["\n padding-left: 6px;\n"],["\n padding-left: 6px;\n"]))),Wz=tt.div(DN||(DN=Fz(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 6px;\n height: 72px;\n border: 1px dashed ",";\n border-radius: 6px;\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 6px;\n height: 72px;\n border: 1px dashed ",";\n border-radius: 6px;\n &:hover {\n cursor: pointer;\n }\n"])),vi),qz=tt.div(RN||(RN=Fz(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n padding: 16px;\n gap: 8px;\n height: 108px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"],["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n padding: 16px;\n gap: 8px;\n height: 108px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"])),di),$z=tt.div(FN||(FN=Fz(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 36px;\n margin-bottom: 5px;\n padding: 0 8px;\n"],["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 36px;\n margin-bottom: 5px;\n padding: 0 8px;\n"]))),Zz=tt.div(LN||(LN=Fz(["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 50%;\n"],["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 50%;\n"]))),Yz=tt.div(BN||(BN=Fz(["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n gap: 4px;\n"],["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n gap: 4px;\n"]))),Qz=tt.div(NN||(NN=Fz(["\n padding: 16px;\n height: 72px;\n background-color: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"],["\n padding: 16px;\n height: 72px;\n background-color: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"])),di),Kz=tt.div(zN||(zN=Fz(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"])),(function(e){return e.fontWeight||"500"}),(function(e){return e.color||Si})),Xz={control:function(e,t){return Lz(Lz({},e),{height:"40px",boxShadow:"none",borderColor:t.isFocused?Si:ki,":hover":{borderColor:Si},":focus":{borderColor:Si},":active":{borderColor:Si}})},option:function(e){return Lz(Lz({},e),{backgroundColor:"transparent",color:Pi,padding:"8px",cursor:"pointer",":hover":{backgroundColor:"transparent",opacity:".8"},":focus":{backgroundColor:"transparent",opacity:".8"}})},indicatorSeparator:function(){return{display:"none"}},valueContainer:function(e){return Lz(Lz({},e),{padding:4,overflow:"show"})}},Jz=function(e){return(0,t.jsx)(t.Fragment,{})},eV=function(e,t){if("0"===e.value)return!0;var n=e.label.toLowerCase(),r=e.data.vin?e.data.vin.toLowerCase():"";return"".concat(n," ").concat(r).includes(t.toLowerCase())},tV=function(e){return(0,t.jsx)(Nz,{children:(0,t.jsx)(zz,{children:(0,t.jsx)(Ss.Option,Lz({},e))})})},nV=function(e){var n=e.label,r=e.vin;return(0,t.jsxs)(Vz,{children:[(0,t.jsx)(Uz,{children:n}),(0,t.jsxs)(Hz,{children:[" ",r]})]})},rV=function(e){e.children;var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]);return(0,t.jsx)(Gz,{children:n.data.label})},iV=function(e){return(0,t.jsx)(Ss.NoOptionsMessage,Lz({},e,{children:"No vehicles found, try entering a different name or VIN."}))},oV=function(e){var n=e.onChangeVehicle,r=e.handleChangeVehicleButtonPress,i=e.handleRemoveVehicleButtonPress,o=e.setAddingVehicle,a=e.selectedVin,s=void 0===a?"":a,l=e.placeholder,c=void 0===l?"Search vehicle by name or VIN...":l,u=e.fetchSold,f=void 0===u||u,d=e.addingVehicle,p=void 0===d||d,h=function(e){var t,n,r,i,o,a,s,l,c,u,f;return ec(e)&&(!!(null===(t=null==e?void 0:e.customer)||void 0===t?void 0:t.vAutoDealerId)||!!(null===(n=null==e?void 0:e.customer)||void 0===n?void 0:n.eDealerId)||!!(null===(r=null==e?void 0:e.customer)||void 0===r?void 0:r.homeNetId)||!!(null===(i=null==e?void 0:e.customer)||void 0===i?void 0:i.maxDigitalId)||!!(null===(o=null==e?void 0:e.customer)||void 0===o?void 0:o.dealersLinkId)||!!(null===(a=null==e?void 0:e.customer)||void 0===a?void 0:a.dealerCueId)||!!(null===(s=null==e?void 0:e.customer)||void 0===s?void 0:s.autoRevolutionId)||!!(null===(l=null==e?void 0:e.customer)||void 0===l?void 0:l.vinsolutionsIMSDealerId)||!!(null===(c=null==e?void 0:e.customer)||void 0===c?void 0:c.dealerDotComIMS)||!!(null===(u=null==e?void 0:e.customer)||void 0===u?void 0:u.dealerCenterDealerId)||!!(null===(f=null==e?void 0:e.customer)||void 0===f?void 0:f.dealrCloudId))}(Nl().userData),y=Bz((0,E.useState)(""),2),m=y[0],g=y[1],x=Bz((0,E.useState)(s),2),b=x[0],w=x[1],S=Mt().showUpgradeMessageFeature,C=function(e){var t=e.size,n=void 0===t?10:t,r=e.page,i=void 0===r?0:r,o=e.sort,a=void 0===o?"":o,s=e.searchQuery,l=void 0===s?"":s,c=e.soldFilter,u=void 0===c?"":c,f=e.videosRecordedFilter,d=void 0===f?"":f,p=e.countRecorded,h=void 0!==p&&p,y=e.enabled,m=void 0===y||y;return(0,v.useQuery)(["inventoryItems",n,i,a,l,u,d,m,h],(function(){return e=void 0,t=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){return[2,er({limit:n,start:i*n,sort:a,search:l||"",soldFilter:u,videosRecordedFilter:d,countRecorded:h})]}))},new((r=void 0)||(r=Promise))((function(n,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}));var e,t,r,o}),{refetchOnWindowFocus:!1,staleTime:h?0:36e5,enabled:m})}({searchQuery:b,countRecorded:!1,enabled:h,soldFilter:f?"2":"0"}).data,k=C?C.items:[];(0,E.useEffect)((function(){w(s)}),[s]),(0,E.useEffect)((function(){if(C&&""!==s&&k){var e=k.filter((function(e){return e.vin===s}));if(!e.length)return i(),void g("");g(e[0].title)}}),[k,s]);var _=k.map((function(e){return Lz(Lz({},e),{value:e.vin,label:e.title})}));return h?p?(0,t.jsx)(Qz,{children:(0,t.jsx)(cl,{components:{Option:tV,DropdownIndicator:Jz,SingleValue:rV,NoOptionsMessage:iV},styles:Xz,options:_,value:_.find((function(e){return e.value===s})),onChange:function(e){n(e||void 0),g((null==e?void 0:e.title)||"")},autoFocus:!0,isSearchable:!0,isClearable:!0,placeholder:c,filterOption:eV,formatOptionLabel:nV,onInputChange:function(e){e.length<2||w(e)}})}):s?(0,t.jsxs)(qz,{children:[(0,t.jsxs)($z,{children:[(0,t.jsxs)(Zz,{children:[(0,t.jsx)(oT,{size:20,color:gi}),(0,t.jsx)(Kz,{children:m})]}),(0,t.jsx)(Kz,Lz({color:gi,fontWeight:"400"},{children:s}))]}),(0,t.jsxs)(Yz,{children:[(0,t.jsx)(yo,{onClick:function(){r(),g("")},text:"Change",textColor:Si,backgroundColor:bi,borderColor:bi,fontSize:"13px"}),(0,t.jsx)(yo,{onClick:function(){i(),g("")},text:"Remove",textColor:Ri,backgroundColor:Di,borderColor:Di,fontSize:"13px"})]})]}):(0,t.jsxs)(Wz,Lz({onClick:function(){return o(!0)}},{children:[(0,t.jsx)(oT,{size:20,color:Si}),"Add Vehicle"]})):S?(0,t.jsxs)(t.Fragment,{children:["To enable the integration with your Inventory Management System, please call us at",(0,t.jsx)("br",{}),(0,t.jsx)("a",Lz({href:"tel:8003061445"},{children:"800-306-1445"}))]}):null},aV=__webpack_require__(2085),sV={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},lV=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],cV=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],uV=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],fV="undefined"!=typeof window&&void 0!==window.document?window.document:{},dV="fullscreenEnabled"in fV&&Object.keys(sV)||lV[0]in fV&&lV||cV[0]in fV&&cV||uV[0]in fV&&uV||[],pV={requestFullscreen:function(e){return e[dV[sV.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[dV[sV.requestFullscreen]]},get exitFullscreen(){return fV[dV[sV.exitFullscreen]].bind(fV)},get fullscreenPseudoClass(){return":"+dV[sV.fullscreen]},addEventListener:function(e,t,n){return fV.addEventListener(dV[sV[e]],t,n)},removeEventListener:function(e,t,n){return fV.removeEventListener(dV[sV[e]],t,n)},get fullscreenEnabled(){return Boolean(fV[dV[sV.fullscreenEnabled]])},set fullscreenEnabled(e){},get fullscreenElement(){return fV[dV[sV.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return fV[("on"+dV[sV.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return fV[("on"+dV[sV.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return fV[("on"+dV[sV.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return fV[("on"+dV[sV.fullscreenerror]).toLowerCase()]=e}};const hV=pV;var yV,mV,vV,gV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},xV=function(){return xV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xV.apply(this,arguments)},bV=tt.div(yV||(yV=gV(["\n width: 100%;\n display: flex;\n cursor: pointer;\n flex: 1;\n padding-bottom: ",";\n"],["\n width: 100%;\n display: flex;\n cursor: pointer;\n flex: 1;\n padding-bottom: ",";\n"])),(function(e){return"".concat(e.small?"0px":" 0px 12px")})),wV=tt.progress(mV||(mV=gV(["\n width: 100%;\n color: white;\n opacity: 1;\n height: ","; /* TODO: it's 4px in design */\n border-radius: ",";\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &::-webkit-progress-bar {\n border-radius: 4px;\n }\n &::-webkit-progress-value {\n background-color: white;\n border-radius: 4px;\n }\n"],["\n width: 100%;\n color: white;\n opacity: 1;\n height: ","; /* TODO: it's 4px in design */\n border-radius: ",";\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &::-webkit-progress-bar {\n border-radius: 4px;\n }\n &::-webkit-progress-value {\n background-color: white;\n border-radius: 4px;\n }\n"])),(function(e){return"".concat((e.small,"4px"))}),(function(e){return"".concat(e.small?"1px":"4px")})),SV=function(e){var n=e.duration,r=void 0===n?.1:n,i=e.currentTime,o=void 0===i?0:i,a=e.scrub,s=e.color,l=e.small,c=E.createRef();return(0,t.jsx)(bV,xV({small:l},{children:(0,t.jsx)(wV,{ref:c,onClick:function(e){return a(e,c)},value:o.toString(),min:"0",max:r.toString(),color:s,small:l})}))},CV=function(){return CV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},CV.apply(this,arguments)},EV=function(e){return(0,t.jsxs)("svg",CV({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},{children:[(0,t.jsx)("defs",{children:(0,t.jsx)("path",{id:"volumeOff-a",d:"M3.63 3.635a.996.996 0 0 0 0 1.41l3.66 3.66-.29.3H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 1 0 1.41-1.41L5.05 3.635c-.39-.39-1.02-.39-1.42 0zM19 12.005c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85 2.57 1.04 4.39 3.56 4.39 6.5zm-8.71-6.29l-.17.17L12 7.765v-1.35c0-.89-1.08-1.33-1.71-.7zm6.21 6.29a4.5 4.5 0 0 0-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"})}),(0,t.jsxs)("g",CV({fill:"none",fillRule:"evenodd"},{children:[(0,t.jsx)("mask",CV({id:"volumeOff-b",fill:"#fff"},{children:(0,t.jsx)("use",{xlinkHref:"#volumeOff-a"})})),(0,t.jsx)("g",CV({fill:"#fff",fillOpacity:"1",mask:"url(#volumeOff-b)"},{children:(0,t.jsx)("path",{d:"M0 0h24v24H0z"})}))]}))]}))};function kV(){return kV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kV.apply(this,arguments)}const _V=tt((function(e){return E.createElement("svg",kV({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),vV||(vV=E.createElement("g",{fill:"#FFF"},E.createElement("path",{d:"M7.928 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69l-8.14-5.17c-.67-.43-1.54.05-1.54.84z"}))))}))(OV||(OV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n opacity: ",";\n }\n"])),(function(e){return e.width||"40px"}),(function(e){return e.height||"40px"}),(function(e){return e.opacity||"inherit"}));var OV,PV;function TV(){return TV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TV.apply(this,arguments)}const AV=tt((function(e){return E.createElement("svg",TV({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),PV||(PV=E.createElement("g",{fill:"#272A32"},E.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))))}))(jV||(jV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var jV,IV,MV;function DV(){return DV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DV.apply(this,arguments)}const RV=tt((function(e){return E.createElement("svg",DV({width:20,height:17,viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),IV||(IV=E.createElement("path",{d:"M17.2907 7.4906C17.3029 7.31501 17.3614 7.14578 17.46 7C17.5559 6.84858 17.6907 6.72571 17.8504 6.64426C18.0101 6.56281 18.1887 6.52577 18.3676 6.53701C18.5464 6.54826 18.719 6.60738 18.8672 6.70818C19.0154 6.80898 19.1338 6.94776 19.21 7.11C19.8115 8.53356 20.0749 10.0772 19.9794 11.6196C19.884 13.1621 19.4324 14.6614 18.66 16C18.4838 16.3052 18.2301 16.5584 17.9245 16.734C17.619 16.9097 17.2724 17.0014 16.92 17H3.07C2.72098 16.9979 2.37858 16.9045 2.07683 16.7291C1.77509 16.5536 1.52451 16.3023 1.35 16C0.294996 14.182 -0.160348 12.0779 0.0486524 9.98638C0.257653 7.89489 1.12037 5.92243 2.51426 4.34919C3.90815 2.77594 5.76232 1.68191 7.81341 1.2225C9.8645 0.763091 12.0082 0.961661 13.94 1.79C14.1082 1.85914 14.2544 1.97285 14.3628 2.11888C14.4712 2.26492 14.5377 2.43776 14.5552 2.61879C14.5727 2.79982 14.5405 2.98219 14.462 3.14628C14.3836 3.31036 14.2619 3.44995 14.11 3.55C13.9642 3.64865 13.795 3.70707 13.6194 3.71936C13.4438 3.73165 13.2681 3.69738 13.11 3.62C12.4369 3.33395 11.7264 3.14538 11 3.06C9.56439 2.8728 8.10489 3.07868 6.77709 3.6557C5.44928 4.23271 4.30294 5.15924 3.46028 6.3365C2.61762 7.51376 2.11023 8.89763 1.99219 10.3406C1.87414 11.7835 2.14988 13.2314 2.79 14.53C2.87447 14.6931 3.0022 14.8297 3.1592 14.9249C3.31619 15.0202 3.49638 15.0704 3.68 15.07H16.33C16.5126 15.0713 16.6921 15.0227 16.849 14.9292C17.0059 14.8358 17.1342 14.7012 17.22 14.54C17.9267 13.0705 18.1674 11.4201 17.91 9.81C17.8129 9.18733 17.6382 8.57927 17.39 8C17.3126 7.84191 17.2784 7.66618 17.2907 7.4906Z",fill:"#001B53"})),MV||(MV=E.createElement("path",{d:"M8.00391 11.005C8.00391 10.4743 8.21474 9.96527 8.59002 9.58999L17.08 3.92999L11.42 12.42C11.0447 12.7953 10.5357 13.0061 10.005 13.0061C9.74223 13.0061 9.48201 12.9543 9.23923 12.8538C8.99644 12.7532 8.77584 12.6058 8.59002 12.42C8.4042 12.2342 8.2568 12.0136 8.15623 11.7708C8.05567 11.528 8.00391 11.2678 8.00391 11.005Z",fill:"#001B53"})))}))(FV||(FV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"16px"}),(function(e){return e.height||"16px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var FV,LV;function BV(){return BV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BV.apply(this,arguments)}const NV=tt((function(e){return E.createElement("svg",BV({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16"},e),LV||(LV=E.createElement("g",{fill:"#FFF"},E.createElement("path",{id:"1i74dgfm6a",d:"M5.867 10.603L3.533 8.27c-.123-.125-.291-.195-.466-.195-.176 0-.344.07-.467.195-.26.26-.26.673 0 .933l2.793 2.794c.26.26.68.26.94 0l7.067-7.06c.26-.26.26-.674 0-.934-.123-.124-.291-.195-.467-.195-.175 0-.343.07-.466.195l-6.6 6.6z"}))))}))(zV||(zV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"21px"}),(function(e){return e.height||"21px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var zV,VV,UV,HV;function GV(){return GV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GV.apply(this,arguments)}const WV=tt((function(e){return E.createElement("svg",GV({width:17,height:16,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),VV||(VV=E.createElement("path",{d:"M8.74879 15.5C9.98351 14.5267 10.9932 13.3025 11.7099 11.9101C12.6346 10.2752 12.8809 8.34818 12.3967 6.53663C11.7134 4.27231 9.38853 2.90737 7.05456 3.40021C6.94008 3.40021 6.81798 3.40021 6.66534 3.44556C6.90886 2.37277 7.46631 1.39487 8.268 0.634113C8.41309 0.529008 8.59337 0.483023 8.77169 0.505633C12.8205 0.691686 16.0048 3.99977 15.9987 8.01366C15.9925 12.0275 12.7982 15.3261 8.74879 15.5Z",fill:"white",fillOpacity:.6})),UV||(UV=E.createElement("path",{d:"M8.88889 12.6667C8.65533 13.6898 8.14446 14.629 7.41224 15.3814C7.29627 15.4733 7.14802 15.5145 7.00121 15.4955C3.12899 15.2168 0.100864 12.0474 0.00246105 8.17019C-0.0959416 4.29297 2.76752 0.974331 6.62063 0.5C6.44556 0.652084 6.32378 0.758542 6.2096 0.872605C3.96458 2.91166 2.91204 5.9516 3.41614 8.94065C3.59752 10.118 4.24244 11.1741 5.20739 11.8739C6.17234 12.5737 7.37725 12.8591 8.55398 12.6667C8.66548 12.659 8.77739 12.659 8.88889 12.6667Z",fill:"white",fillOpacity:.6})),HV||(HV=E.createElement("path",{d:"M6.23576 8.24597C6.23576 7.57717 6.23576 6.91572 6.23576 6.25427C6.23576 5.59282 6.49402 5.51932 6.98959 5.79125C8.10637 6.44535 9.22315 7.10681 10.326 7.77561C10.7797 8.04754 10.7797 8.36357 10.326 8.6355C9.19523 9.32635 8.06449 10.0025 6.91979 10.6713C6.50798 10.9138 6.2218 10.7668 6.2218 10.2744C6.2218 9.59828 6.2218 8.92212 6.2218 8.24597",fill:"white"})))}))(qV||(qV=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"21px"}),(function(e){return e.height||"21px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var qV,$V,ZV,YV,QV,KV,XV,JV,eU,tU,nU,rU,iU,oU,aU,sU,lU,cU,uU,fU=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},dU=function(){return dU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dU.apply(this,arguments)},pU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},hU=tt.div($V||($V=fU(["\n display: flex;\n align-items: center;\n color: white;\n font-size: 14px;\n flex-direction: column;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n color: white;\n font-size: 14px;\n flex-direction: column;\n justify-content: space-between;\n"]))),yU=tt.div(ZV||(ZV=fU(["\n margin-top: 6px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: white;\n font-size: 14px;\n"],["\n margin-top: 6px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: white;\n font-size: 14px;\n"]))),mU=tt.div(YV||(YV=fU(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: max-content;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: max-content;\n"]))),vU=tt.div(QV||(QV=fU(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),gU=tt.div(KV||(KV=fU(["\n width: ",";\n height: ",";\n cursor: pointer;\n margin-right: ",";\n transition: all 0.3s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"],["\n width: ",";\n height: ",";\n cursor: pointer;\n margin-right: ",";\n transition: all 0.3s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"])),(function(e){return"".concat(e.small?"16px":"20px")}),(function(e){return"".concat(e.small?"16px":"20px")}),(function(e){return"".concat(e.small?"6px":"8px")})),xU=tt.input(XV||(XV=fU(["\n /* RESET */\n width: 74px;\n opacity: 1;\n visibility: visible;\n transition: all 0.4s;\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n background: transparent; /* Otherwise white in Chrome */\n\n &:focus {\n outline: none; /* Removes the blue border. We should probably do some kind of focus styling for accessibility reasons though. */\n }\n &::-ms-track {\n width: 96px;\n cursor: pointer;\n /* Hides the slider so custom styles can be added */\n background: transparent;\n border-color: transparent;\n color: transparent;\n height: ",";\n }\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: pointer;\n opacity: 0.75;\n background: ",";\n border-radius: ",";\n border: 0.2px solid transparent;\n }\n\n &::-webkit-slider-thumb {\n border: 1px solid transparent;\n height: ",";\n width: ",";\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n -webkit-appearance: none;\n margin-top: -3px;\n }\n"],["\n /* RESET */\n width: 74px;\n opacity: 1;\n visibility: visible;\n transition: all 0.4s;\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n background: transparent; /* Otherwise white in Chrome */\n\n &:focus {\n outline: none; /* Removes the blue border. We should probably do some kind of focus styling for accessibility reasons though. */\n }\n &::-ms-track {\n width: 96px;\n cursor: pointer;\n /* Hides the slider so custom styles can be added */\n background: transparent;\n border-color: transparent;\n color: transparent;\n height: ",";\n }\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: pointer;\n opacity: 0.75;\n background: ",";\n border-radius: ",";\n border: 0.2px solid transparent;\n }\n\n &::-webkit-slider-thumb {\n border: 1px solid transparent;\n height: ",";\n width: ",";\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n -webkit-appearance: none;\n margin-top: -3px;\n }\n"])),(function(e){return"".concat((e.small,"2px"))}),(function(e){return"".concat((e.small,"2px"))}),(function(e){return e.color}),(function(e){return"".concat((e.small,"2px"))}),(function(e){return"".concat((e.small,"6px"))}),(function(e){return"".concat((e.small,"6px"))}),(function(e){return e.color})),bU=tt.div(JV||(JV=fU(["\n display: flex;\n width: 100px;\n align-items: center;\n overflow: hidden;\n transition: all 0.4s;\n margin-right: 8px;\n"],["\n display: flex;\n width: 100px;\n align-items: center;\n overflow: hidden;\n transition: all 0.4s;\n margin-right: 8px;\n"]))),wU=tt.div(eU||(eU=fU(["\n height: ",";\n width: ",";\n cursor: pointer;\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"],["\n height: ",";\n width: ",";\n cursor: pointer;\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"])),(function(e){return"".concat(e.small?"15px":"20px")}),(function(e){return"".concat(e.small?"15px":"20px")})),SU=tt.div(tU||(tU=fU(["\n margin-right: 16px;\n color: ",";\n\n ","\n"],["\n margin-right: 16px;\n color: ",";\n\n ","\n"])),(function(e){return e.color}),(function(e){if(e.width&&e.width<330)return"font-size: 11px;"})),CU=tt.div(nU||(nU=fU(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 3px;\n border-radius: 5px;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n ","\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 3px;\n border-radius: 5px;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n ","\n"])),(function(e){if(e.active&&"#000000"===e.color)return"\n background-color: white;\n &:hover {\n background: white;\n }\n path {\n fill: ".concat(e.color,";\n }")})),EU=tt.div(rU||(rU=fU(["\n z-index: 200;\n overflow-y: auto;\n margin-top: -340px;\n margin-left: -140px;\n min-width: 110px;\n max-width: 160px;\n max-height: 292px;\n cursor: pointer;\n position: absolute;\n background-color: white;\n border: 1px solid #f7f8fa;\n box-sizing: border-box;\n box-shadow: 0px 6px 16px rgba(29, 30, 36, 0.06);\n border-radius: 5px;\n color: ",";\n display: flex;\n flex-direction: column;\n ","\n\n p {\n padding: 8px 24px;\n height: 24px;\n color: #9297a2;\n font-size: 14px;\n line-height: 20px;\n margin: 0;\n ","\n }\n\n div {\n display: flex;\n justify-content: space-between;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n padding: 8px 24px;\n height: 24px;\n ","\n path {\n fill: #272a32;\n }\n\n &:hover {\n background-color: ",";\n }\n }\n"],["\n z-index: 200;\n overflow-y: auto;\n margin-top: -340px;\n margin-left: -140px;\n min-width: 110px;\n max-width: 160px;\n max-height: 292px;\n cursor: pointer;\n position: absolute;\n background-color: white;\n border: 1px solid #f7f8fa;\n box-sizing: border-box;\n box-shadow: 0px 6px 16px rgba(29, 30, 36, 0.06);\n border-radius: 5px;\n color: ",";\n display: flex;\n flex-direction: column;\n ","\n\n p {\n padding: 8px 24px;\n height: 24px;\n color: #9297a2;\n font-size: 14px;\n line-height: 20px;\n margin: 0;\n ","\n }\n\n div {\n display: flex;\n justify-content: space-between;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n padding: 8px 24px;\n height: 24px;\n ","\n path {\n fill: #272a32;\n }\n\n &:hover {\n background-color: ",";\n }\n }\n"])),Fi,(function(e){return e.width&&e.width<330?"max-width: 120px;\n max-height: 142px;\n margin-top: -198px;\n margin-left: -105px;":e.width&&e.width<500?"max-width: 150px;\n max-height: 192px;\n margin-top: -250px;\n margin-left: -135px;":void 0}),(function(e){return e.width&&e.width<330?"font-size: 9px;\n line-height: 12px;\n padding: 8px 16px;":e.width&&e.width<500?"font-size: 11px;\n line-height: 15px;":void 0}),(function(e){return e.width&&e.width<330?"font-size: 10px;\n line-height: 13px;\n height: 13px;":e.width&&e.width<500?"font-size: 12px;\n line-height: 16px;\n height: 18px;":void 0}),Li),kU=[{value:2,label:"2.0x"},{value:1.5,label:"1.5x"},{value:1.25,label:"1.25x"},{value:1,label:"1.0x"},{value:.75,label:"0.75x"},{value:.5,label:"0.5x"}],_U=function(e){var n=e.isVideoPaused,r=e.isVideoMuted,i=e.togglePlay,o=e.handleMute,a=e.handleFullScreen,s=e.duration,l=void 0===s?0:s,c=e.currentTime,u=void 0===c?0:c,f=e.handleVolumeControl,d=e.volumeRange,p=e.playerIconsColor,h=e.playerBackgroundColor,y=e.setPlayBack,m=e.isVisible,v=e.small,g=e.videoRef,x=e.scrub,b=pU(E.useState(!1),2),w=b[0],S=b[1],C=pU(E.useState(1),2),k=C[0],_=C[1],O=function(e){var t=Math.floor(e/60),n=t.toString(),r="".concat(Math.floor(e-60*t));return 1===n.length&&(n="0".concat(t)),1===r.length&&(r="0".concat(r)),"".concat(t,":").concat(r)},P=O(u),T=E.createRef(),A=100*d;return E.useEffect((function(){m||S(!1)}),[m]),(0,t.jsxs)(hU,dU({small:v},{children:[(0,t.jsx)(SV,{duration:l,currentTime:u,scrub:x,color:p,small:v}),(0,t.jsxs)(yU,{children:[(0,t.jsxs)(mU,{children:[(0,t.jsx)(gU,dU({small:v,onClick:i},{children:n?(0,t.jsx)(_V,{color:p,width:20,height:20}):(0,t.jsx)(AV,{color:p,width:20,height:20})})),!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(bU,{children:[(0,t.jsx)(wU,dU({small:v,onClick:o},{children:r?(0,t.jsx)(EV,{color:p}):(0,t.jsx)(eT,{style:{color:p,fontSize:20}})})),(0,t.jsx)(xU,{ref:T,"aria-label":"Volume Range",type:"range",min:"0",value:A.toString(),onChange:function(e){return f(e,T)},max:"100",step:"1",color:p,small:v})]}),(0,t.jsxs)(SU,dU({width:g.current&&g.current.clientWidth,color:p},{children:[P," / ",O(l)]}))]})]}),!v&&(0,t.jsxs)(vU,{children:[(0,t.jsx)(CU,dU({active:w,color:h,onClick:function(){S(!w)}},{children:(0,t.jsx)(RV,{color:p})})),w&&(0,t.jsxs)(EU,dU({width:g.current&&g.current.clientWidth},{children:[(0,t.jsx)("p",{children:"Playback Speed"}),kU.map((function(e){return(0,t.jsxs)("div",dU({onClick:function(){return t=e.value,y&&y(t),void _(t);var t}},{children:[(0,t.jsx)("span",{children:e.label})," ",k==e.value&&(0,t.jsx)(NV,{width:g.current&&g.current.clientWidth<500?"16px":"20px",height:g.current&&g.current.clientWidth<500?"16px":"20px"})]}),e.value)}))]})),(0,t.jsx)(CU,dU({onClick:a},{children:(0,t.jsx)(qc,{style:{color:p,fontSize:20}})})),(0,t.jsx)(WV,{style:{marginLeft:4},height:17,fill:di})]})]})]}))},OU=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},PU=function(){return PU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},PU.apply(this,arguments)},TU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},AU=tt.div(oU||(oU=OU(["\n box-sizing: border-box;\n overflow: overlay;\n display: flex;\n justify-content: center;\n padding-right: 0px;\n height: ",";\n width: ",";\n margin: ",";\n ","\n"],["\n box-sizing: border-box;\n overflow: overlay;\n display: flex;\n justify-content: center;\n padding-right: 0px;\n height: ",";\n width: ",";\n margin: ",";\n ","\n"])),(function(e){return e.height?e.height:"100%"}),(function(e){return e.width?e.width:""}),(function(e){return e.margin?e.margin:""}),(function(e){return e.disablePointerEvents&&Ne(iU||(iU=OU(["\n pointer-events: none;\n "],["\n pointer-events: none;\n "])))})),jU=tt.figure(aU||(aU=OU(["\n border-radius: 4px;\n ","\n margin: 0;\n position: relative;\n height: 100%;\n /* TODO - check if this is ok */\n max-width: 800px;\n overflow: hidden;\n\n ","\n"],["\n border-radius: 4px;\n ","\n margin: 0;\n position: relative;\n height: 100%;\n /* TODO - check if this is ok */\n max-width: 800px;\n overflow: hidden;\n\n ","\n"])),(function(e){return e.borderBottomRadius?"\n border-bottom-left-radius: ".concat(e.borderBottomRadius,";\n border-bottom-right-radius: ").concat(e.borderBottomRadius,";\n "):""}),(function(e){return e.preventWideSize?"width: auto;":"\n ".concat(fi.lg," {\n width: 720px;\n }\n ")})),IU=tt((function(e){var t=e.handle,n=e.onChange,r=e.children,i=e.className,o=[];return i&&o.push(i),o.push("fullscreen"),t.active&&o.push("fullscreen-enabled"),(0,E.useEffect)((function(){n&&n(t.active,t)}),[t.active]),k().createElement("div",{className:o.join(" "),ref:t.node,style:t.active?{height:"100%",width:"100%"}:void 0},r)}))(sU||(sU=OU(["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n background-color: ",";\n"],["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n background-color: ",";\n"])),(function(e){return e.backgroundColor?e.backgroundColor:""})),MU=tt.video(lU||(lU=OU(["\n border-radius: ",";\n position: relative;\n width: 100%;\n height: ",";\n object-fit: contain; /*object-fit: contain to fix the issue of vertical video SUS-687*/\n max-height: ",";\n"],["\n border-radius: ",";\n position: relative;\n width: 100%;\n height: ",";\n object-fit: contain; /*object-fit: contain to fix the issue of vertical video SUS-687*/\n max-height: ",";\n"])),(function(e){return e.borderBottomRadius||"4px"}),(function(e){return e.isFullScreen?"100%":e.height}),(function(e){return e.isFullScreen?"100%":"unset"})),DU=tt.div(cU||(cU=OU(["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n z-index: 4;\n"],["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n z-index: 4;\n"])),"rgba(255,255,255, .85)"),RU=tt.div(uU||(uU=OU(["\n transition: all 0.15s;\n position: absolute;\n opacity: ",";\n left: 0;\n right: 0;\n bottom: ",";\n background-color: ",";\n padding: ",";\n"],["\n transition: all 0.15s;\n position: absolute;\n opacity: ",";\n left: 0;\n right: 0;\n bottom: ",";\n background-color: ",";\n padding: ",";\n"])),(function(e){return e.isVisible?1:0}),(function(e){return e.isFullScreen?"0px":"7px"}),(function(e){return e.hex}),(function(e){return"".concat(e.small?"0px 2px 1px":"8px")})),FU=function(e){var n=e.videoSource,r=e.thumbnail,i=e.small,o=e.videoRef,a=e.autoplay,s=e.playlist,l=e.preventWideSize,c=e.hideContext,u=void 0!==c&&c,f=e.startWithControls,d=void 0===f||f,p=e.height,h=e.width,y=e.margin,m=e.disableControls,v=void 0!==m&&m,g=e.borderBottomRadius,x=e.FullscreenVideoWrapperBackgroundColor,b=e.setIsVideoLoading,w=e.setVideoDuration,S="rgba(28, 106, 207, 0.8)",C=di,k=TU(E.useState(!0),2),_=k[0],O=k[1],P=TU(E.useState(!1),2),T=P[0],A=P[1],j=TU(E.useState(1),2),I=j[0],M=j[1],D=TU(E.useState(0),2),R=D[0],F=D[1],L=TU(E.useState(0),2),B=L[0],N=L[1],z=TU(E.useState(d),2),V=z[0],U=z[1],H=TU(E.useState(!1),2),G=H[0],W=H[1],q=TU(E.useState(0),2),$=q[0],Z=q[1],Y=Nl().userData,Q=Xl(Y),K=E.useRef(V),X=E.useRef(0),J=TU(E.useState(0),2),ee=J[0],te=J[1],ne=E.createRef(),re=function(){var e=o.current;e&&(_?e.play():e.pause())},ie=function(){var e=(0,E.useState)(!1),t=e[0],n=e[1],r=(0,E.useRef)(null);(0,E.useEffect)((function(){var e=function(){n(hV.fullscreenElement===r.current)};return hV.addEventListener("fullscreenchange",e),function(){return hV.removeEventListener("fullscreenchange",e)}}),[]);var i=(0,E.useCallback)((function(){return hV.fullscreenElement?hV.exitFullscreen().then((function(){return hV.requestFullscreen(r.current)})):r.current?hV.requestFullscreen(r.current):void 0}),[]),o=(0,E.useCallback)((function(){return hV.fullscreenElement===r.current?hV.exitFullscreen():Promise.resolve()}),[]);return(0,E.useMemo)((function(){return{active:t,enter:i,exit:o,node:r}}),[t,i,o])}();E.useEffect((function(){setTimeout((function(){return window.dispatchEvent(new Event("resize"))}),200)}),[ie.active]),E.useEffect((function(){var e=o.current;if(e.textTracks.length&&e.textTracks[0]){for(var t=V?-4:-1,n=e.textTracks[0].cues,r=0;r<n.length;r++)n[r].line=t;e.textTracks[0].activeCues[0]&&(e.textTracks[0].activeCues[0].line=t)}}),[V]);var oe=function(){o.current&&isFinite(o.current.duration)&&(F(o.current.duration),w&&w(o.current.duration))},ae=function(){o.current&&o.current.networkState==HTMLMediaElement.NETWORK_NO_SOURCE&&!G&&(console.log("error loading mp4"),W(!0))},se=function(){W(!1),clearTimeout($),o.current&&o.current.duration===1/0&&(o.current.currentTime=1e101,o.current.ontimeupdate=function(){this.ontimeupdate=function(){},o.current&&(o.current.currentTime=0)})};E.useEffect((function(){b&&b(G),G&&te(ee+1)}),[G]),E.useEffect((function(){var e;if(ee>0&&G){clearTimeout($);var t=setTimeout(te,1e3*ee,ee+1);Z(t),null===(e=o.current)||void 0===e||e.load()}}),[ee]),E.useEffect((function(){return o.current&&(o.current.addEventListener("durationchange",oe,!0),o.current.addEventListener("loadedmetadata",se,!0),o.current.addEventListener("error",ae,!0),o.current.addEventListener("pause",(function(){return O(!0)}),!0),o.current.addEventListener("play",(function(){return O(!1)}),!0),ne&&ne.current&&(o.current.addEventListener("mouseenter",ce),o.current.addEventListener("mouseleave",le),ne.current.addEventListener("mouseenter",ce),ne.current.addEventListener("mouseleave",le))),function(){o.current&&(o.current.removeEventListener("durationchange",oe,!0),o.current.removeEventListener("loadedmetadata",se,!0),o.current.removeEventListener("error",ae,!0))}}),[o]);var le=function(){o.current&&(o.current.paused||(U(!1),K.current=!1))},ce=function(){v||(U(!0),K.current=!0)};E.useEffect((function(){s&&s.length>0&&(X.current=0,N(0),O(!0))}),[s]),E.useEffect((function(){var e=function(){if(o.current&&(N(o.current.currentTime),X&&s&&s[X.current]&&o.current.currentTime>=s[X.current].endTime)){var e=new Event("ended");o.current.dispatchEvent(e)}},t=function(){if(o.current&&s&&(X.current++,X.current<s.length&&s[X.current].videoSource)){o.current.poster=s[X.current].autogeneratedThumbnail;var e="",t=s[X.current].startTime,n=s[X.current].endTime;(t||n)&&(e="#t=".concat(t||0).concat(n?","+n:""));var r=(""+s[X.current].videoSource).split("#t=")[0]+e;o.current.src=r,o.current.play()}};return o.current&&o.current.addEventListener("timeupdate",e,!0),o.current&&o.current.addEventListener("ended",t,!0),o.current&&a&&(o.current.play(),O(!1)),function(){o.current&&(o.current.removeEventListener("timeupdate",e,!0),o.current.removeEventListener("ended",t,!0))}}),[o]);var ue=aV.hex.rgb(S)||[];return(0,t.jsx)(AU,PU({small:i,height:p,width:h,margin:y,disablePointerEvents:v},{children:(0,t.jsx)(jU,PU({small:i,preventWideSize:l,borderBottomRadius:g},{children:(0,t.jsxs)(IU,PU({handle:ie,backgroundColor:x},{children:[(0,t.jsx)(MU,PU({onContextMenu:function(e){u&&e.preventDefault()},poster:G?"":r,preload:"metadata",ref:o,onClick:re,isFullScreen:ie.active,height:p||"auto",borderBottomRadius:g},{children:(0,t.jsx)("source",{src:n,type:"video/mp4"},ee+X.current+n)}),n),G&&(0,t.jsx)(DU,{children:(0,t.jsx)(Eo,{height:"100%",isLoading:G,text:"processing..."})}),!v&&(0,t.jsx)(RU,PU({ref:ne,r:ue[0],g:ue[1],b:ue[2],hex:S,small:i,isVisible:V,isFullScreen:ie.active},{children:(0,t.jsx)(_U,{isVideoPaused:_,togglePlay:re,isVideoMuted:T,handleMute:function(){var e=o.current;e&&(T?(M(1),A(!1),e.volume=1):(M(0),A(!0),e.volume=0))},handleFullScreen:function(){return ie.active?ie.exit():ie.enter()},setPlayBack:function(e){o.current.playbackRate=e},setTranslate:function(){},duration:R,currentTime:B,handleVolumeControl:function(e,t){var n=t.current&&t.current.offsetWidth,r=e.target.value;if(r>100&&(r=100),r<0&&(r=0),o.current&&n){var i=Number((r/n).toFixed(2));if(Math.floor(100*o.current.volume)==e.target.valueAsNumber)return;M(i),i<0&&(i=0,M(0)),i>1&&(M(1),i=1),0===i&&A(!0),1!==i&&A(!1),o.current.volume=i}},volumeRange:I,playerIconsColor:C,small:i,scrub:function(e,t){var n=t.current?t.current.offsetWidth:640;if(o.current){var r=e.nativeEvent.offsetX/n*o.current.duration;o.current.currentTime=r}},playerBackgroundColor:S,captionsEnabled:!1,captions:"",isVisible:V,videoRef:o,isAutomotive:Q})}))]}))}))}))},LU=__webpack_require__(2473),BU=__webpack_require__.n(LU),NU=Math.sqrt(50),zU=Math.sqrt(10),VU=Math.sqrt(2);function UU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function HU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UU(Object(n),!0).forEach((function(t){$U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function GU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qU(e,t,n){return t&&WU(e.prototype,t),n&&WU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QU(e,t)}function YU(e){return YU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YU(e)}function QU(e,t){return QU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QU(e,t)}function KU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XU(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=YU(e);if(t){var i=YU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return KU(e)}(this,n)}}function JU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||tH(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eH(e){return function(e){if(Array.isArray(e))return nH(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tH(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tH(e,t){if(e){if("string"==typeof e)return nH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nH(e,t):void 0}}function nH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rH="react-compound-slider:";function iH(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t,n){return t.val>n.val?e?-1:1:n.val>t.val?e?1:-1:0}}function oH(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.findIndex((function(e){return e.key===t}));if(-1!==i){var o=e[i],a=o.key;return o.val===n?e:[].concat(eH(e.slice(0,i)),[{key:a,val:n}],eH(e.slice(i+1))).sort(iH(r))}return e}function aH(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function sH(e){var t=e.type,n=void 0===t?"":t,r=e.touches;return!r||r.length>1||"touchend"===n.toLowerCase()&&r.length>0}function lH(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function cH(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=0,i=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var i=t.getValue(e);return e!==i&&(r+=1,BU()(!n,"".concat(rH," Invalid value encountered. Changing ").concat(e," to ").concat(i,"."))),i})).map((function(e,t){return{key:"$$-".concat(t),val:e}})).sort(iH(e));return{handles:i,changes:r}}function uH(e,t,n,r,i){for(var o=-1,a=!0,s=0;s<e.length;s++){var l=e[s],c=t[s];if(!c||c.key!==l.key)return e;c.val!==l.val&&(o=s,a=c.val-l.val>0)}if(-1===o)return e;for(var u=a?n:-n,f=0;f<t.length;f++){var d=t[f],p=t[f+1];if(p&&d.val===p.val){if(f===o){var h=p.val+u;if(i(h)===h){var y=uH(t,oH(t,p.key,p.val+u,r),n,r,i);return y===t?e:y}return e}var m=d.val+u;if(i(m)===m){var v=uH(t,oH(t,d.key,d.val+u,r),n,r,i);return v===t?e:v}return e}}return t}function fH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.forEach((function(t){return t&&t(e)}))}}var dH=function(){return{value:0,percent:0}},pH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).getRailProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.props,r=n.emitMouse,i=n.emitTouch;return HU(HU({},t),{},{onMouseDown:fH(t&&t.onMouseDown,r),onTouchStart:fH(t&&t.onTouchStart,i)})},e}return qU(n,[{key:"render",value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,r=t.activeHandleID,i=void 0===r?"":r,o=(0,t.children)({getEventData:n||dH,activeHandleID:i,getRailProps:e});return o&&k().Children.only(o)}}]),n}(E.Component),hH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).autofocus=function(e){e.target instanceof HTMLElement&&e.target.focus()},e.getHandleProps=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.props,i=r.emitKeyboard,o=r.emitMouse,a=r.emitTouch;return HU(HU({},n),{},{onKeyDown:fH(n&&n.onKeyDown,(function(e){return i&&i(e,t)})),onMouseDown:fH(n&&n.onMouseDown,e.autofocus,(function(e){return o&&o(e,t)})),onTouchStart:fH(n&&n.onTouchStart,(function(e){return a&&a(e,t)}))})},e}return qU(n,[{key:"render",value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,r=void 0===n?"":n,i=t.children,o=t.handles,a=i({handles:void 0===o?[]:o,activeHandleID:r,getHandleProps:e});return a&&k().Children.only(a)}}]),n}(E.Component),yH=function(){function e(){GU(this,e),this.interpolator=void 0,this.domain=[0,1],this.range=[0,1],this.domain=[0,1],this.range=[0,1],this.interpolator=null}return qU(e,[{key:"createInterpolator",value:function(e,t){var n=this,r=e[0],i=e[1],o=t[0],a=t[1];return i<r?function(e){return n.interpolateValue(a,o)(n.deinterpolateValue(i,r)(e))}:function(e){return n.interpolateValue(o,a)(n.deinterpolateValue(r,i)(e))}}},{key:"interpolateValue",value:function(e,t){return t-=e=+e,function(n){return e+t*n}}},{key:"deinterpolateValue",value:function(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(){return t}}},{key:"rescale",value:function(){return this.interpolator=null,this}},{key:"getValue",value:function(e){var t=this.domain,n=this.range;return(this.interpolator||(this.interpolator=this.createInterpolator(t,n)))(+e)}},{key:"setDomain",value:function(e){return this.domain=[e[0],e[1]],this.rescale(),this}},{key:"getDomain",value:function(){return this.domain}},{key:"setRange",value:function(e){return this.range=[e[0],e[1]],this}},{key:"getRange",value:function(){return this.range}},{key:"getTicks",value:function(e){var t=this.domain;return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=function(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=NU?10:o>=zU?5:o>=VU?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=NU?10:o>=zU?5:o>=VU?2:1)}(e,t,n))||!isFinite(a))return[];if(a>0){let n=Math.round(e/a),r=Math.round(t/a);for(n*a<e&&++n,r*a>t&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)*a}else{a=-a;let n=Math.round(e*a),r=Math.round(t*a);for(n/a<e&&++n,r/a>t&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)/a}return r&&o.reverse(),o}(t[0],t[t.length-1],e||10)}}]),e}(),mH=function(){return{value:0,percent:0}},vH=function(e){ZU(n,e);var t=XU(n);function n(){return GU(this,n),t.apply(this,arguments)}return qU(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.values,r=e.scale,i=void 0===r?new yH:r,o=e.count,a=void 0===o?10:o,s=e.getEventData,l=void 0===s?mH:s,c=e.activeHandleID,u=t({getEventData:l,activeHandleID:void 0===c?"":c,ticks:(n||i.getTicks(a)).map((function(e){return{id:"$$-".concat(e),value:e,percent:i.getValue(e)}}))});return u&&k().Children.only(u)}}]),n}(E.Component),gH=function(){return{value:0,percent:0}},xH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).getTrackProps=function(t){var n=e.props,r=n.emitMouse,i=n.emitTouch;return HU(HU({},t||{}),{},{onMouseDown:fH(t&&t.onMouseDown,r),onTouchStart:fH(t&&t.onTouchStart,i)})},e}return qU(n,[{key:"render",value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,r=t.left,i=void 0===r||r,o=t.right,a=void 0===o||o,s=t.scale,l=void 0===s?new yH:s,c=t.handles,u=void 0===c?[]:c,f=t.getEventData,d=void 0===f?gH:f,p=t.activeHandleID,h=void 0===p?"":p,y=l.getDomain(),m=[],v=0;v<u.length+1;v++){var g=u[v-1],x=u[v];0===v&&!0===i?g={id:"$",value:y[0],percent:0}:v===u.length&&!0===a&&(x={id:"$",value:y[1],percent:100}),g&&x&&m.push({id:"".concat(g.id,"-").concat(x.id),source:g,target:x})}var b=n({getEventData:d,activeHandleID:h,tracks:m,getTrackProps:e});return b&&k().Children.only(b)}}]),n}(E.Component);function bH(e,t,n){return Math.min(Math.max(e,t),n)}var wH,SH,CH,EH,kH,_H,OH,PH=qU((function e(){var t=this;GU(this,e),this.step=1,this.domain=[0,1],this.range=[0,1],this.setDomain=function(e){return t.domain=[e[0],e[1]],t},this.setRange=function(e){return t.range=[e[0],e[1]],t},this.setStep=function(e){return t.step=e,t},this.getValue=function(e){var n=JU(t.domain,2),r=n[0],i=n[1],o=JU(t.range,2),a=o[0],s=o[1],l=t.step,c=(bH(e,r,i)-r)/(i-r);return bH(l*Math.round(c*(s-a)/l)+a,a<s?a:s,s>a?s:a)}})),TH="undefined"!=typeof window&&"undefined"!=typeof document,AH=function(){},jH=[0,100],IH=function(e){ZU(n,e);var t=XU(n);function n(){var e;GU(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).state={step:.1,values:[],domain:jH,handles:[],reversed:!1,activeHandleID:"",valueToPerc:null,valueToStep:null,pixelToStep:null},e.slider=k().createRef(),e.onKeyDown=function(t,n){var r=["ArrowRight","ArrowUp"],i=["ArrowDown","ArrowLeft"],o=KU(e),a=o.state.handles,s=o.props,l=s.step,c=void 0===l?.1:l,u=s.reversed,f=void 0!==u&&u,d=s.vertical,p=void 0!==d&&d,h=s.domain,y=void 0===h?[0,100]:h,m=t.key||"".concat(t.keyCode);if(r.concat(i).includes(m)){if(p){var v=[i,r];r=v[0],i=v[1]}t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault();var g=a.find((function(e){return e.key===n}));if(g){var x=g.val,b=x;r.includes(m)?b=function(e,t,n,r){var i=r?e-t:e+t;return r?Math.max(n[0],i):Math.min(n[1],i)}(x,c,y,f):i.includes(m)&&(b=function(e,t,n,r){var i=r?e+t:e-t;return r?Math.min(n[1],i):Math.max(n[0],i)}(x,c,y,f));var w=a.map((function(e){return e.key===n?{key:e.key,val:b}:e}));e.submitUpdate(w,!0)}}},e.onMouseDown=function(t,n){e.onStart(t,n,!1)},e.onTouchStart=function(t,n){sH(t)||e.onStart(t,n,!0)},e.getEventData=function(t,n){var r,i=KU(e),o=i.state,a=o.pixelToStep,s=o.valueToPerc,l=i.props.vertical;return a.setDomain(aH(e.slider.current,l)),n&&t instanceof TouchEvent?r=a.getValue(lH(l,t)):t instanceof MouseEvent&&(r=a.getValue(l?t.clientY:t.pageX)),{value:r,percent:s.getValue(r)}},e.onMouseMove=function(t){var n=KU(e),r=n.state,i=r.handles,o=r.pixelToStep,a=r.activeHandleID,s=void 0===a?"":a,l=n.props,c=l.vertical,u=l.reversed,f=void 0!==u&&u;o.setDomain(aH(e.slider.current,c));var d=oH(i,s,o.getValue(c?t.clientY:t.pageX),f);e.submitUpdate(d)},e.onTouchMove=function(t){var n=KU(e),r=n.state,i=r.handles,o=r.pixelToStep,a=r.activeHandleID,s=n.props,l=s.vertical,c=s.reversed;if(null!==o&&!sH(t)){o.setDomain(aH(e.slider.current,l));var u=oH(i,a,o.getValue(lH(l,t)),c);e.submitUpdate(u)}},e.onMouseUp=function(){var t=KU(e),n=t.state,r=n.handles,i=void 0===r?[]:r,o=n.activeHandleID,a=t.props,s=a.onChange,l=void 0===s?AH:s,c=a.onSlideEnd,u=void 0===c?AH:c;l(i.map((function(e){return e.val}))),u(i.map((function(e){return e.val})),{activeHandleID:o}),e.setState({activeHandleID:""}),TH&&(document.removeEventListener("mousemove",e.onMouseMove),document.removeEventListener("mouseup",e.onMouseUp))},e.onTouchEnd=function(){var t=KU(e),n=t.state,r=n.handles,i=n.activeHandleID,o=t.props,a=o.onChange,s=void 0===a?AH:a,l=o.onSlideEnd,c=void 0===l?AH:l;s(r.map((function(e){return e.val}))),c(r.map((function(e){return e.val})),{activeHandleID:i}),e.setState({activeHandleID:""}),TH&&(document.removeEventListener("touchmove",e.onTouchMove),document.removeEventListener("touchend",e.onTouchEnd))},e}return qU(n,[{key:"componentDidMount",value:function(){var e=this.state.pixelToStep,t=this.props.vertical;e.setDomain(aH(this.slider.current,t))}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"removeListeners",value:function(){TH&&(document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"onStart",value:function(e,t,n){var r=this.state.handles,i=this.props.onSlideStart,o=void 0===i?AH:i;n||e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),r.find((function(e){return e.key===t}))?(this.setState({activeHandleID:t}),o(r.map((function(e){return e.val})),{activeHandleID:t}),n?this.addTouchEvents():this.addMouseEvents()):(this.setState({activeHandleID:""}),this.handleRailAndTrackClicks(e,n))}},{key:"handleRailAndTrackClicks",value:function(e,t){var n,r=this,i=this.state,o=i.handles,a=i.pixelToStep,s=this.props,l=s.vertical,c=s.reversed,u=void 0!==c&&c,f=this.slider;a.setDomain(aH(f.current,l)),n=t?a.getValue(lH(l,e)):a.getValue(l?e.clientY:e.pageX);for(var d="",p=1/0,h=0;h<o.length;h++){var y=o[h],m=y.key,v=y.val,g=Math.abs(v-n);g<p&&(d=m,p=g)}var x=oH(o,d,n,u);this.setState({activeHandleID:d},(function(){r.submitUpdate(x,!0),t?r.addTouchEvents():r.addMouseEvents()}))}},{key:"addMouseEvents",value:function(){TH&&(document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp))}},{key:"addTouchEvents",value:function(){TH&&(document.addEventListener("touchmove",this.onTouchMove),document.addEventListener("touchend",this.onTouchEnd))}},{key:"submitUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.mode,i=void 0===r?1:r,o=n.step,a=void 0===o?.1:o,s=n.onUpdate,l=void 0===s?AH:s,c=n.onChange,u=void 0===c?AH:c,f=n.reversed,d=void 0!==f&&f,p=this.state.valueToStep.getValue;this.setState((function(n){var r=n.handles,o=[];if("function"==typeof i)o=i(r,e,a,d,p),BU()(Array.isArray(o),"Custom mode function did not return an array.");else switch(i){case 1:o=function(e,t){return t}(0,e);break;case 2:o=function(e,t){for(var n=0;n<e.length;n++){if(e[n].key!==t[n].key)return e;if(t[n+1]&&t[n].val===t[n+1].val)return e}return t}(r,e);break;case 3:o=uH(r,e,a,d,p);break;default:o=e,BU()(!1,"".concat(rH," Invalid mode value."))}return l(o.map((function(e){return e.val}))),t&&u(o.map((function(e){return e.val}))),{handles:o}}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.handles,r=t.valueToPerc,i=t.activeHandleID,o=this.props,a=o.className,s=o.rootStyle,l=void 0===s?{}:s,c=o.rootProps,u=void 0===c?{}:c,f=o.component,d=void 0===f?"div":f,p=o.disabled,h=void 0!==p&&p,y=o.flatten,m=void 0!==y&&y,v=n.map((function(e){var t=e.key,n=e.val;return{id:t,value:n,percent:r.getValue(n)}})),g=k().Children.map(this.props.children,(function(t){return!0===function(e){if(!(0,E.isValidElement)(e))return!1;var t=e.type,n=t?t.name:"";return n===hH.name||n===pH.name||n===vH.name||n===xH.name}(t)?k().cloneElement(t,{scale:r,handles:v,activeHandleID:i,getEventData:e.getEventData,emitKeyboard:h?AH:e.onKeyDown,emitMouse:h?AH:e.onMouseDown,emitTouch:h?AH:e.onTouchStart}):t}));return m?k().createElement(k().Fragment,null,k().createElement(d,HU(HU({},u),{},{style:l,className:a,ref:this.slider})),g):k().createElement(k().Fragment,null,k().createElement(d,HU(HU({},u),{},{style:l,className:a,ref:this.slider}),g))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.step,r=void 0===n?.1:n,i=e.values,o=e.domain,a=void 0===o?jH:o,s=e.reversed,l=void 0!==s&&s,c=e.onUpdate,u=void 0===c?AH:c,f=e.onChange,d=void 0===f?AH:f,p=e.warnOnChanges,h=void 0!==p&&p,y=t.valueToPerc,m=t.valueToStep,v=t.pixelToStep,g={};if(y&&m&&v||(y=new yH,m=new PH,v=new PH,g.valueToPerc=y,g.valueToStep=m,g.pixelToStep=v),t.domain===jH||null===t.step||null===t.domain||null===t.reversed||r!==t.step||a[0]!==t.domain[0]||a[1]!==t.domain[1]||l!==t.reversed){var x=JU(a,2),b=x[0],w=x[1];m.setStep(r).setRange([b,w]).setDomain([b,w]),!0===l?(y.setDomain([b,w]).setRange([100,0]),v.setStep(r).setRange([w,b])):(y.setDomain([b,w]).setRange([0,100]),v.setStep(r).setRange([b,w])),BU()(w>b,"".concat(rH," Max must be greater than min (even if reversed). Max is ").concat(w,". Min is ").concat(b,"."));var S=cH(i||t.values,l,m,h),C=S.handles;(S.changes||void 0===i||i===t.values)&&(u(C.map((function(e){return e.val}))),d(C.map((function(e){return e.val})))),g.step=r,g.values=i,g.domain=a===jH?eH(a):a,g.handles=C,g.reversed=l}else if(!function(e,t){return e===t||e.length===t.length&&e.reduce(function(e){return function(t,n,r){return t&&e[r]===n}}(t),!0)}(i,t.values)){var E=cH(i,l,m,h),k=E.handles;E.changes&&(u(k.map((function(e){return e.val}))),d(k.map((function(e){return e.val})))),g.values=i,g.handles=k}return Object.keys(g).length?g:null}}]),n}(E.PureComponent),MH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},DH=tt.video(wH||(wH=MH(["\n height: auto;\n width: ",";\n object-fit: cover;\n object-position: center;\n &:nth-child(1) {\n border-radius: 6px 0 0 6px;\n }\n &:nth-child(",") {\n border-radius: 0 6px 6px 0;\n }\n"],["\n height: auto;\n width: ",";\n object-fit: cover;\n object-position: center;\n &:nth-child(1) {\n border-radius: 6px 0 0 6px;\n }\n &:nth-child(",") {\n border-radius: 0 6px 6px 0;\n }\n"])),(function(e){return e.width}),(function(e){return e.numberOfStills})),RH=tt.div(SH||(SH=MH(["\n position: absolute;\n left: 0;\n right: 0;\n height: 48px;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap;\n"],["\n position: absolute;\n left: 0;\n right: 0;\n height: 48px;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap;\n"]))),FH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},LH=function(){return LH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},LH.apply(this,arguments)},BH=tt.div(CH||(CH=FH(["\n position: absolute;\n width: 100%;\n height: 48px;\n cursor: pointer;\n"],["\n position: absolute;\n width: 100%;\n height: 48px;\n cursor: pointer;\n"]))),NH=tt.div(EH||(EH=FH(["\n position: absolute;\n width: 100%;\n height: 48px;\n pointer-events: none;\n background-color: rgba(0, 27, 83, 0.15);\n border-radius: 6px;\n"],["\n position: absolute;\n width: 100%;\n height: 48px;\n pointer-events: none;\n background-color: rgba(0, 27, 83, 0.15);\n border-radius: 6px;\n"]))),zH=function(e){var n=e.getRailProps;return(0,t.jsxs)(E.Fragment,{children:[(0,t.jsx)(BH,LH({},n())),(0,t.jsx)(NH,{})]})},VH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UH=function(){return UH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UH.apply(this,arguments)},HH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},GH=tt.div(kH||(kH=VH(["\n left: ",";\n position: absolute;\n transform: ",";\n z-index: 400;\n width: 24px;\n height: 48px;\n cursor: pointer;\n"],["\n left: ",";\n position: absolute;\n transform: ",";\n z-index: 400;\n width: 24px;\n height: 48px;\n cursor: pointer;\n"])),(function(e){return e.percent}),(function(e){return e.transform})),WH=tt.div(_H||(_H=VH(["\n left: ",";\n background-color: ",";\n position: absolute;\n transform: ",";\n z-index: 2;\n width: 24px;\n height: 48px;\n border-radius: ",";\n &:before {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 12px;\n background: ",";\n border-radius: 4px;\n }\n"],["\n left: ",";\n background-color: ",";\n position: absolute;\n transform: ",";\n z-index: 2;\n width: 24px;\n height: 48px;\n border-radius: ",";\n &:before {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 12px;\n background: ",";\n border-radius: 4px;\n }\n"])),(function(e){return e.percent}),(function(e){return e.isDisabled?"#666":Ti}),(function(e){return e.transform}),(function(e){return e.borderRadius}),di),qH=function(e){var n=HH(e.domain,2),r=n[0],i=n[1],o=e.handle,a=o.id,s=o.value,l=o.percent,c=e.showFloatingPreview,u=void 0===c||c,f=e.isActive,d=e.disabled,p=e.getHandleProps,h=e.videoRef,y=e.changeVideoPosition,m=void 0===y||y,v=e.nChild,g=HH(k().useState(!1),2),x=g[0],b=g[1],w=k().createRef();k().useEffect((function(){f&&(u&&(w.current.currentTime=s||0),m&&(h.current.currentTime=s||0))}),[s,w,m,h]);var S=St(s).split(".")[0],C=St(s).split(".")[1];return(0,t.jsxs)(E.Fragment,{children:[u&&(0,t.jsxs)(t.Fragment,{children:[!x&&!f||d?null:(0,t.jsxs)("div",UH({style:{left:"".concat(l,"%"),position:"absolute",marginLeft:"-15px",marginTop:"52px",zIndex:1}},{children:[(0,t.jsx)("div",{style:{width:0,height:0,marginLeft:21,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderBottom:"6px solid "}}),(0,t.jsxs)("div",UH({style:{width:"auto",padding:4,fontSize:12,fontWeight:500,letterSpacing:.34,backgroundColor:Ti,color:"#fff",textAlign:"center",position:"fixed",zIndex:99999}},{children:[S,(0,t.jsx)("span",UH({style:{fontSize:9,fontWeight:400,letterSpacing:.34,color:"#fff",opacity:.7}},{children:"."+C}))]}))]})),(0,t.jsx)("div",UH({style:{left:"".concat(l,"%"),position:"absolute",marginLeft:"-38px",marginTop:"-92px",zIndex:3,visibility:!x&&!f||d?"hidden":"visible"}},{children:(0,t.jsx)("div",UH({style:{width:141,height:80,border:"solid 2px ".concat(Ti),backgroundColor:Ui,display:"flex",justifyContent:"center"}},{children:(0,t.jsx)("video",{ref:w,height:"100%",src:e.videoSource},"previewvideoRef")}))}))]}),(0,t.jsx)(GH,UH({percent:"".concat(l,"%")},p(a),{onMouseEnter:function(){b(!0)},onMouseLeave:function(){b(!1)},transform:0===v?"translate(0px,0%)":"translate(-15px,0%)"})),(0,t.jsx)(WH,{role:"slider","aria-valuemin":r,"aria-valuemax":i,"aria-valuenow":s,percent:"".concat(l,"%"),borderRadius:0===v?"5px 0px 0px 5px;":"0px 5px 5px 0px",isDisabled:d,transform:0===v?"translate(0px,0%)":"translate(-15px,0%)"})]})},$H=function(){return $H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$H.apply(this,arguments)},ZH=function(e){var n=e.source,r=e.target,i=e.getTrackProps,o=e.disabled;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",$H({style:{position:"absolute",height:48,zIndex:1,backgroundColor:o?"#999":"rgba(0,0,0,.7)",cursor:"pointer",left:"0",width:"".concat(n.percent+1,"%"),borderRadius:"6px 0 0 6px"}},i())),(0,t.jsx)("div",$H({style:{position:"absolute",height:48,zIndex:1,backgroundColor:o?"#999":"transparent",cursor:"pointer",left:"".concat(n.percent,"%"),width:"".concat(r.percent-n.percent,"%"),borderRadius:6}},i())),(0,t.jsx)("div",$H({style:{position:"absolute",height:48,zIndex:1,backgroundColor:o?"#999":"rgba(0,0,0,.7)",cursor:"pointer",left:"".concat(r.percent,"%"),width:"".concat(100-r.percent,"%"),borderRadius:"0 6px 6px 0"}},i()))]})},YH=function(){return YH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},YH.apply(this,arguments)},QH=function(e){var n=e.tick,r=e.count;return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{position:"absolute",width:2,height:48,opacity:.4,backgroundColor:hi,left:"".concat(n.percent,"%"),zIndex:1}}),(0,t.jsx)("div",YH({style:{position:"absolute",marginTop:52,fontSize:10,textAlign:"center",marginLeft:"".concat(-100/r/2,"%"),width:"".concat(100/r,"%"),left:"".concat(n.percent,"%")}},{children:St(n.value).split(".")[0]}))]})},KH=function(){return KH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},KH.apply(this,arguments)},XH=tt.div(OH||(OH=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n position: relative;\n width: ",";\n height: 48px;\n"],["\n position: relative;\n width: ",";\n height: 48px;\n"])),(function(e){return e.width})),JH={position:"relative",width:"100%",backgroundColor:"rgba(0, 27, 83, 0.4)"},eG=E.memo((function(e){for(var n=e.videoSource,r=e.videoDuration,i=e.numberOfStills,o=[],a=100/i,s=0;s<i;s++)o.push(k().createRef());return(0,E.useEffect)((function(){o.forEach((function(e,t){e.current&&(e.current.currentTime=r*(t/i))}))}),[o]),(0,t.jsx)(RH,{children:o.map((function(e,r){return(0,t.jsx)(DH,{ref:e,src:n,width:"".concat(a,"%"),numberOfStills:i},"previewvideoRef-".concat(r))}))})})),tG=function(e){var n=e.videoDuration,r=e.videoSource,i=e.setTrimDuration,o=void 0===i?function(){}:i,a=e.setStart,s=void 0===a?function(){}:a,l=e.value,c=e.setValue,u=e.addHistory,f=void 0===u?function(){}:u,d=e.onSlideEnd,p=void 0===d?function(){}:d,h=e.valueRef,y=e.videoRef,m=e.showTickTime,v=void 0===m||m,g=e.changeVideoPosition,x=void 0===g||g,b=e.showFloatingPreview,w=void 0===b||b,S=e.width,C=[0,n];E.useEffect((function(){var e=[0,n||0];l[1]||c(e)}),[n]),E.useEffect((function(){return y&&y.current&&(y.current.addEventListener("play",(function(e){return _(e)})),y.current.addEventListener("timeupdate",(function(e){return k(e)}))),function(){y&&y.current&&(y.current.removeEventListener("play",(function(e){return _(e)})),y.current.removeEventListener("timeupdate",(function(e){return k(e)})))}}),[y]);var k=function(e){var t=e.target;t.currentTime>h.current[1]&&0!=h.current[1]&&t.pause()},_=function(e){var t=e.target;(t.currentTime>=h.current[1]||t.currentTime<h.current[0])&&(t.currentTime=h.current[0])},O=E.useMemo((function(){return n}),[n]);return(0,t.jsx)(XH,KH({width:S},{children:(0,t.jsxs)(IH,KH({rootStyle:JH,mode:1,step:1e-7,domain:C,reversed:!1,onChange:function(e){if(!isNaN(e[0])&&!isNaN(e[1])){var t=e.slice();f(t),c(t),h.current=t}},onUpdate:function(e){o(e[1]-e[0]),s(e[0])},values:l,onSlideEnd:function(e){p(e)}},{children:[(0,t.jsx)(eG,{numberOfStills:14,videoSource:r,videoDuration:O}),(0,t.jsx)(pH,{children:function(e){return(0,t.jsx)(zH,KH({},e))}}),(0,t.jsx)(hH,{children:function(e){var n=e.handles,i=e.activeHandleID,o=e.getHandleProps;return(0,t.jsx)("div",KH({className:"slider-handles"},{children:n.map((function(e,n){return(0,t.jsx)(qH,{showFloatingPreview:w,nChild:n,handle:e,domain:C,isActive:e.id===i,getHandleProps:o,videoSource:r,videoRef:y,changeVideoPosition:x},e.id)}))}))}}),(0,t.jsx)(xH,KH({left:!1,right:!1},{children:function(e){var n=e.tracks,r=e.getTrackProps;return(0,t.jsx)("div",KH({className:"slider-tracks"},{children:n.map((function(e){var n=e.id,i=e.source,o=e.target;return(0,t.jsx)(ZH,{source:i,target:o,getTrackProps:r},n)}))}))}})),v&&(0,t.jsx)(vH,KH({count:10},{children:function(e){var n=e.ticks;return(0,t.jsx)("div",KH({className:"slider-ticks"},{children:n.map((function(e){return(0,t.jsx)(QH,{tick:e,count:n.length},e.id)}))}))}}))]}))}))},nG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},rG=function(){return rG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rG.apply(this,arguments)},iG=tt.div(sG||(sG=nG(["\n margin-top: 8px;\n font-weight: 400;\n color: ",";\n\n span {\n text-decoration: underline;\n cursor: pointer;\n }\n"],["\n margin-top: 8px;\n font-weight: 400;\n color: ",";\n\n span {\n text-decoration: underline;\n cursor: pointer;\n }\n"])),"rgba(78, 84, 97, 1)"),oG=tt(tG)(lG||(lG=nG(["\n height: 48px;\n width: 100%;\n background-color: ",";\n"],["\n height: 48px;\n width: 100%;\n background-color: ",";\n"])),Ci);const aG=function(e){var n=e.videoRef,r=e.videoDuration,i=e.videoSource,o=e.setValue,a=e.value,s=e.isVideoTrimmed,l=e.valueRef,c=e.isVideoLoading,u=void 0===c||c;return(0,t.jsxs)(t.Fragment,{children:[u?(0,t.jsx)(oG,{width:"100%",videoRef:null,videoDuration:0,videoSource:"",setValue:o,value:[0,0],valueRef:l,showTickTime:!1,showFloatingPreview:!1}):(0,t.jsx)(tG,{width:"100%",videoRef:n,videoDuration:r,videoSource:i,setValue:o,value:a,valueRef:l,showTickTime:!1,showFloatingPreview:!1}),s&&(0,t.jsxs)(iG,{children:["Trimmed.",(0,t.jsx)("span",rG({style:{marginLeft:8},onClick:function(){o([0,r]),l.current&&(l.current=[0,r]),n.current&&(n.current.currentTime=0)}},{children:"Revert to Original"}))]})]})};var sG,lG,cG,uG,fG,dG,pG,hG,yG,mG,vG,gG,xG,bG,wG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},SG=function(){return SG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},SG.apply(this,arguments)},CG=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},EG=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},kG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_G=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},OG=tt.div(cG||(cG=wG(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),PG=tt.div(uG||(uG=wG(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),TG=tt.div(fG||(fG=wG(["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n flex-wrap: wrap;\n gap: 16px;\n"],["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n flex-wrap: wrap;\n gap: 16px;\n"]))),AG=tt.div(pG||(pG=wG(["\n box-sizing: border-box;\n width: 100%;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n"])),(function(e){return e.theme.containerWidth>=ri&&Ne(dG||(dG=wG(["\n width: calc(50% - 8px);\n "],["\n width: calc(50% - 8px);\n "])))})),jG=tt.div(yG||(yG=wG(["\n box-sizing: border-box;\n width: 100%;\n margin-top: 16px;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n margin-top: 16px;\n ","\n"])),(function(e){return e.theme.containerWidth>=ri&&Ne(hG||(hG=wG(["\n margin-top: 0;\n width: calc(50% - 8px);\n "],["\n margin-top: 0;\n width: calc(50% - 8px);\n "])))})),IG=tt.div(mG||(mG=wG(["\n margin-bottom: 24px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n .fullscreen {\n height: auto;\n }\n"],["\n margin-bottom: 24px;\n background: ",";\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n .fullscreen {\n height: auto;\n }\n"])),di),MG=tt.div(vG||(vG=wG(["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n border-radius: 6px;\n"],["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n border-radius: 6px;\n"])),di),DG=tt.div(gG||(gG=wG(["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"],["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"])),Pi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),RG=tt.div(xG||(xG=wG(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"])),Oi,(function(e){return e.backgroundColor||"transparent"}),(function(e){return e.width||"auto"})),FG="pending",LG=[{label:"Enable video reactions & comments",value:"enableReactions"}],BG=function(){var e=Mt().showInsertFeature,n=Mt(),r=n.showTrimFeature,i=n.showCTAFeature,o=n.showLandingPageFeature,a=n.showReactionsFeature,s=Ju().toast,l=Nl().userData,c=Xl(l),u=Jl(l),f=ec(l),d=function(e){var t;return!(!(null===(t=e.customer)||void 0===t?void 0:t.reactionsPreference)||"0"===e.customer.reactionsPreference.toString())}(l),p=function(e){var t;return!!(e.reactionsPreference&&"1"===e.reactionsPreference.toString()||null===e.reactionsPreference&&(null===(t=e.customer)||void 0===t?void 0:t.reactionsPreference)&&"1"===e.customer.reactionsPreference.toString())}(l),h=pn().videoId,y=dn(),m=kG((0,E.useState)([]),2),v=m[0],g=m[1],x=kG((0,E.useState)(!1),2),w=x[0],C=x[1],k=kG((0,E.useState)(!1),2),_=k[0],O=k[1],P=kG((0,E.useState)([]),2),T=P[0],A=P[1],j=kG((0,E.useState)(!1),2),I=j[0],M=j[1],D=kG((0,E.useState)(!0),2),R=D[0],F=D[1],L=kG((0,E.useState)(!1),2),B=L[0],N=L[1],z=kG((0,E.useState)({}),2),V=z[0],U=z[1],H=kG((0,E.useState)({videoId:h,templateId:0,linksetId:"",overlayId:"",vin:""}),2),G=H[0],W=H[1],q=kG((0,E.useState)(LG),2),$=q[0],Z=q[1],Y=kG((0,E.useState)(FG),2),Q=Y[0],K=Y[1],X=kG((0,E.useState)(!c||u),2),J=X[0],ee=X[1],te=kG((0,E.useState)([]),2),ne=te[0],re=te[1],ie=kG((0,E.useState)([]),2),oe=ie[0],ae=ie[1],se=kG((0,E.useState)(0),2),le=se[0],ce=se[1],ue={id:0,title:"".concat(u?"Service":"Sales"," page")},fe=kG((0,E.useState)([]),2),de=fe[0],pe=fe[1],he=kG((0,E.useState)(!1),2),ye=he[0],me=he[1],ve=kG((0,E.useState)(!1),2),ge=ve[0],xe=ve[1],be=kG((0,E.useState)(!1),2),we=be[0],Se=be[1],Ce=kG((0,E.useState)(!0),2),Ee=Ce[0],ke=Ce[1],_e=c?null===l.customer.markVideosAsSent?aF:parseInt(l.customer.markVideosAsSent.toString(),10):sF,Oe=yF({video:V,videoRequest:null==V?void 0:V.videoRequest,setShowModalQuickShareMarkAsSent:Se,handleOnMarkAsSentSuccessCallback:function(){me(!1)}}),Pe=Oe.onQuickShareMutationHandler,Te=Oe.isQuickshareLoading,Ae=Oe.onQuickShareButtonClick,je=kG((0,E.useState)([0,0]),2),Ie=je[0],Me=je[1],De=kG((0,E.useState)(0),2),Re=De[0],Fe=De[1],Le=(0,E.useRef)([0,0]),Be=function(){return CG(void 0,void 0,void 0,(function(){var e,t,n;return EG(this,(function(r){switch(r.label){case 0:return O(!0),[4,(i={start:0,limit:100,search:""},Qn(void 0,void 0,void 0,(function(){var e,t;return Kn(this,(function(n){switch(n.label){case 0:return e=S.bearerToken,[4,Tn({url:"/templates",baseURL:b,method:Xn,params:i,headers:e}).catch((function(e){return e}))];case 1:if((t=n.sent())instanceof Error)throw t;return[2,t]}}))}))).catch((function(e){return e}))];case 1:return(e=r.sent())instanceof Error||(t=e.templates,(n=null==e?void 0:e.default)?(ce(parseInt(n.id)),W((function(e){return SG(SG({},e),{templateId:parseInt(n.id)})})),t.find((function(e){return e.id===n.id}))||(t=_G([n],kG(t),!1))):W((function(e){return SG(SG({},e),{templateId:0})})),(0,Eu.keyBy)(t,"id")[-1]||t.push({id:-1,title:"Website Overlay",thumbnailURL:"https://www.covideo.com/SampleTemplates/WebsiteOverlay_small.jpg",typeId:18}),O(!1),re(t),ae(t)),[2]}var i}))}))},Ne=function(){return CG(void 0,void 0,void 0,(function(){var e,t;return EG(this,(function(n){switch(n.label){case 0:return M(!0),[4,(r={start:0,limit:100,search:""},Qn(void 0,void 0,void 0,(function(){var e,t;return Kn(this,(function(n){switch(n.label){case 0:return e=S.bearerToken,[4,Tn({url:"/overlays",baseURL:b,method:Xn,params:r,headers:e}).catch((function(e){return e}))];case 1:if((t=n.sent())instanceof Error)throw t;return[2,t]}}))}))).catch((function(e){return e}))];case 1:return(e=n.sent())instanceof Error||(t=e.websiteUrls,M(!1),A(t)),[2]}var r}))}))},ze=function(){return CG(void 0,void 0,void 0,(function(){var e,t,n,r;return EG(this,(function(i){switch(i.label){case 0:return me(!0),e=f&&0===G.templateId,t=!!de.some((function(e){return"enableReactions"===e.value})),n=h,ge?[4,CG(void 0,void 0,void 0,(function(){return EG(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Zn(h,{duration:Ie[1],start:Ie[0],title:V.title})];case 1:return[2,e.sent()];case 2:return e.sent(),s({message:"Something went wrong while trimming the video, try again later!"}),[3,3];case 3:return[2]}}))}))]:[3,2];case 1:(r=i.sent())&&(n=r.id),i.label=2;case 2:return[2,{videoShareSetData:{videoId:n,vin:Q!==FG?Q:"",templateId:G.templateId||0,linksetId:G.linksetId||0,overlayId:G.overlayId||0,allowReactions:t},useAutomotive:e}]}}))}))};(0,E.useEffect)((function(){CG(void 0,void 0,void 0,(function(){var e;return EG(this,(function(t){switch(t.label){case 0:return F(!0),[4,Wn(h)];case 1:return(e=t.sent())&&U(e),F(!1),[2]}}))})),c&&CG(void 0,void 0,void 0,(function(){var e;return EG(this,(function(t){switch(t.label){case 0:return F(!0),[4,(n=h,tr(void 0,void 0,void 0,(function(){var e,t,r;return nr(this,(function(i){switch(i.label){case 0:return e=S.bearerToken,t={url:"/video-requests/".concat(n,"/get-by-videoid"),baseURL:b,method:rr,headers:e},[4,Tn(t).catch((function(e){return e}))];case 1:if((r=i.sent())instanceof Error)throw r;return[2,r]}}))})))];case 1:return(e=t.sent())&&K(e.vin||""),F(!1),[2]}var n}))})),CG(void 0,void 0,void 0,(function(){var e,t;return EG(this,(function(n){switch(n.label){case 0:return C(!0),[4,(r={start:0,limit:100,search:""},Qn(void 0,void 0,void 0,(function(){var e,t,n,i,o,a,s,l;return Kn(this,(function(c){switch(c.label){case 0:return t=void 0===(e=r.search)?"":e,i=void 0===(n=r.start)?0:n,a=void 0===(o=r.limit)?0:o,s=S.bearerToken,[4,Tn({url:"/exitlinksets",baseURL:b,method:Xn,headers:s,params:{search:t,start:i,limit:a}}).catch((function(e){return e}))];case 1:if((l=c.sent())instanceof Error)throw l;return[2,l]}}))}))).catch((function(e){return e}))];case 1:return(e=n.sent())instanceof Error||(t=e.linksets,C(!1),g(t)),[2]}var r}))})),J&&(Be(),Ne()),d?p&&pe((function(e){return _G(_G([],kG(e),!1),kG($.filter((function(e){return"enableReactions"===e.value}))),!1)})):Z((function(e){return e.filter((function(e){return"enableReactions"!==e.value}))}))}),[]),(0,E.useEffect)((function(){Me([0,Re])}),[Re]),(0,E.useEffect)((function(){if(Q!==FG){if(Q||(ee(!1),W((function(e){return SG(SG({},e),{vin:""})}))),!Q&&!ne.length)return Be(),void Ne();if(!Q&&ne.length)return ae(ne),void W((function(e){return SG(SG({},e),{templateId:le})}));ae([ue]),W((function(e){return SG(SG({},e),{templateId:0})}))}}),[Q]),(0,E.useEffect)((function(){!J||G.templateId||_||ne.length>0&&W((function(e){return SG(SG({},e),{templateId:ne[0].id})}))}),[G,ne,_]),(0,E.useEffect)((function(){""!==G.overlayId||I||T.length>0&&W((function(e){return SG(SG({},e),{overlayId:T[0].id})}))}),[G,T,I]),(0,E.useEffect)((function(){""!==G.linksetId||w||v.forEach((function(e){e.defaultLinks&&W((function(t){return SG(SG({},t),{linksetId:e.id})}))}))}),[G,v,w]),(0,E.useEffect)((function(){var e=kt({trimStart:Ie[0],trimEnd:Ie[1],videoDuration:Re});return xe(e),function(){xe(!1)}}),[Ie,Re]);var Ve=(0,E.createRef)();if(R)return(0,t.jsx)(Eo,{isLoading:R});var Ue=_||w||I||ye||-1===G.templateId&&!G.overlayId;return(0,t.jsxs)(OG,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return y.push("/")}}),center:(0,t.jsx)(PG,{children:"Insert Video"}),right:e&&(0,t.jsx)(yo,{onClick:function(){return CG(void 0,void 0,void 0,(function(){var e;return EG(this,(function(t){switch(t.label){case 0:return _e===aF?(Ae({videoActivityType:pu.QUICKSHARE,type:"insert"}),[2]):[4,ze()];case 1:return e=t.sent(),Ae(SG(SG({videoActivityType:pu.QUICKSHARE,type:"insert"},e.videoShareSetData),{useAutomotive:e.useAutomotive})),[2]}}))}))},text:"Insert",textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px",disabled:Ue,icon:ye?(0,t.jsx)(go,{size:12,color:di}):(0,t.jsx)(tT,{size:18,color:di})})}),(0,t.jsx)(so,{children:(0,t.jsxs)(TG,{children:[(0,t.jsxs)(AG,{children:[(0,t.jsxs)(IG,{children:[(0,t.jsx)(FU,{videoId:h,videoRef:Ve,autoplay:!1,height:"247px",FullscreenVideoWrapperBackgroundColor:Ai,borderBottomRadius:"0px",videoSource:V.videoSource||"",playerBackgroundColor:V.playerBackgroundColor||"",setVideoDuration:Fe,setIsVideoLoading:ke}),(0,t.jsxs)(MG,{children:[(0,t.jsx)(DG,{children:V.title}),(0,t.jsxs)(RG,{children:[(0,t.jsx)(iT,{size:16,color:ki,style:{marginRight:6}}),V.recordDate]})]})]}),r&&(0,t.jsx)(aG,{isVideoTrimmed:ge,setValue:Me,value:Ie,videoDuration:Re,videoRef:Ve,videoSource:(null==V?void 0:V.videoSource)||"",valueRef:Le,isVideoLoading:Ee})]}),(o||i||a)&&(0,t.jsxs)(jG,{children:[(0,t.jsx)(Rz,{insertVideoData:G,setInsertVideoData:W,overlaysData:T,templatesData:oe,linksetsData:v,templatesLoading:_,linksetsLoading:w,overlaysLoading:I,checkboxes:$,selectedCheckboxes:de,setSelectedCheckboxes:pe}),f&&(0,t.jsx)(oV,{onChangeVehicle:function(e){K((null==e?void 0:e.vin)||""),N(!1)},selectedVin:Q,fetchSold:!1,addingVehicle:B,handleChangeVehicleButtonPress:function(){K(""),N(!0)},handleRemoveVehicleButtonPress:function(){return K("")},setAddingVehicle:N})]})]})}),we&&(0,t.jsx)(Tf,{markAsSentPayload:{type:"insert"},isQuickShareLoading:Te,quickShareMarkAsSentHandler:Pe,handleModalClose:function(){return CG(void 0,void 0,void 0,(function(){return EG(this,(function(e){return Se(!1),[2]}))}))},getMarkAsSentPayload:ze})]})};function NG(){return NG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NG.apply(this,arguments)}const zG=tt((function(e){return E.createElement("svg",NG({xmlns:"http://www.w3.org/2000/svg",width:73,height:72,viewBox:"0 0 73 72"},e),bG||(bG=E.createElement("g",{fill:"#4E5461"},E.createElement("path",{id:"h3dd7yfnea",d:"M60 54c3.3 0 5.97-2.7 5.97-6L66 18c0-3.3-2.7-6-6-6H12c-3.3 0-6 2.7-6 6v30c0 3.3 2.7 6 6 6H3c-1.65 0-3 1.35-3 3s1.35 3 3 3h66c1.65 0 3-1.35 3-3s-1.35-3-3-3h-9zM15 18h42c1.65 0 3 1.35 3 3v24c0 1.65-1.35 3-3 3H15c-1.65 0-3-1.35-3-3V21c0-1.65 1.35-3 3-3z"}))))}))(VG||(VG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var VG,UG;function HG(){return HG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HG.apply(this,arguments)}const GG=tt((function(e){return E.createElement("svg",HG({xmlns:"http://www.w3.org/2000/svg",width:73,height:72,viewBox:"0 0 73 72"},e),UG||(UG=E.createElement("g",{fill:"#4E5461"},E.createElement("path",{d:"M36 36c6.63 0 12-5.37 12-12s-5.37-12-12-12-12 5.37-12 12 5.37 12 12 12zm0 6c-8.01 0-24 4.02-24 12v3c0 1.65 1.35 3 3 3h42c1.65 0 3-1.35 3-3v-3c0-7.98-15.99-12-24-12z"}))))}))(WG||(WG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var WG,qG;function $G(){return $G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$G.apply(this,arguments)}const ZG=tt((function(e){return E.createElement("svg",$G({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),qG||(qG=E.createElement("g",{fill:"#272A32"},E.createElement("path",{d:"M19.432 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65c-.03-.24-.24-.42-.49-.42h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-7.43 2.52c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"}))))}))(YG||(YG=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var YG,QG,KG,XG,JG,eW,tW,nW,rW,iW,oW,aW,sW,lW,cW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},uW=function(){return uW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},uW.apply(this,arguments)},fW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},dW=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,pW="undefined"!=typeof InstallTrigger,hW=tt.div(QG||(QG=cW(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),yW=tt.div(KG||(KG=cW(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),mW=tt.span(XG||(XG=cW(["\n ","\n font-size: 24px;\n line-height: 40px;\n text-align: center;\n color: ",";\n display: flex;\n justify-content: center;\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 800;\n margin-top: 10%;\n margin-bottom: 6%;\n"],["\n ","\n font-size: 24px;\n line-height: 40px;\n text-align: center;\n color: ",";\n display: flex;\n justify-content: center;\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 800;\n margin-top: 10%;\n margin-bottom: 6%;\n"])),ci,Si),vW=tt.div(eW||(eW=cW(["\n display: flex;\n flex-direction: row;\n max-width: 100%;\n justify-content: center;\n gap: 8px;\n margin-left: auto;\n margin-right: auto;\n ","\n"],["\n display: flex;\n flex-direction: row;\n max-width: 100%;\n justify-content: center;\n gap: 8px;\n margin-left: auto;\n margin-right: auto;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(JG||(JG=cW(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),gW=tt.div(nW||(nW=cW(["\n display: flex;\n flex-direction: column;\n width: 176px;\n height: 176px;\n padding: 32px;\n border-radius: 6px;\n border: solid 2px rgba(0, 27, 83, 0.1);\n background-color: ",";\n justify-content: space-between;\n align-items: center;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: #4e5461;\n box-shadow: 0 0 2px rgba(66, 79, 104, 0.08), 0 4px 8px rgba(66, 79, 104, 0.03);\n span {\n color: ",";\n }\n &:hover {\n cursor: pointer;\n border: solid 2px transparent;\n background-color: ",";\n }\n ","\n"],["\n display: flex;\n flex-direction: column;\n width: 176px;\n height: 176px;\n padding: 32px;\n border-radius: 6px;\n border: solid 2px rgba(0, 27, 83, 0.1);\n background-color: ",";\n justify-content: space-between;\n align-items: center;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: #4e5461;\n box-shadow: 0 0 2px rgba(66, 79, 104, 0.08), 0 4px 8px rgba(66, 79, 104, 0.03);\n span {\n color: ",";\n }\n &:hover {\n cursor: pointer;\n border: solid 2px transparent;\n background-color: ",";\n }\n ","\n"])),(function(e){return e.isDisabled?"gray":"white"}),pi,(function(e){return e.isDisabled?"":"whitesmoke"}),(function(e){return e.theme.containerWidth<ni&&Ne(tW||(tW=cW(["\n margin-left: auto;\n margin-right: auto;\n "],["\n margin-left: auto;\n margin-right: auto;\n "])))})),xW=tt.div(rW||(rW=cW(["\n .account {\n background-color: #4e5461;\n border-radius: 50px;\n position: absolute;\n margin-left: -80px;\n margin-top: 42.5px;\n border: 2px solid white;\n }\n"],["\n .account {\n background-color: #4e5461;\n border-radius: 50px;\n position: absolute;\n margin-left: -80px;\n margin-top: 42.5px;\n border: 2px solid white;\n }\n"]))),bW=tt.div(iW||(iW=cW(["\n display: flex;\n margin-top: 32px;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n margin-top: 32px;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"]))),wW=tt.div(oW||(oW=cW(["\n margin-top: 48px;\n font-weight: 600;\n"],["\n margin-top: 48px;\n font-weight: 600;\n"]))),SW=tt.div(aW||(aW=cW(["\n display: flex;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n"]))),CW=function(){var e=dn(),n=Mt(),r=n.showRecordBothFeature,i=n.showRecordCamFeature,o=n.showRecordScreenFeature,a=fW((0,E.useState)(!1),2),s=a[0],l=a[1],c=fW((0,E.useState)({videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}}),2),u=c[0],f=c[1],d=fW((0,E.useState)(""),2),p=d[0],h=d[1];return(0,E.useEffect)((function(){if(!_t){var e=JSON.parse(localStorage.getItem(m.recordSettings)||"{}"),t=[],n=[];return new Promise((function(e,t){return n=void 0,r=void 0,o=function(){var n,r,i;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:if(n=o.sent(),!ku().some(n,{label:""}))return[3,6];o.label=2;case 2:return o.trys.push([2,5,,6]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!0})];case 3:return r=o.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 4:return n=o.sent(),r.getTracks().forEach((function(e){return e.stop()})),[3,6];case 5:return i=o.sent(),t(i),[3,6];case 6:return e(n),[2]}}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o})).then((function(r){if(!ku().some(r,{kind:"videoinput"}))throw new Error("No camera detected");r.forEach((function(e){e&&e.label&&("audioinput"==e.kind&&t.push({label:e.label,value:e.deviceId}),"videoinput"==e.kind&&n.push({label:e.label,value:e.deviceId}))})),t.push({label:"No Audio",value:!1}),e.videoSource&&n.find((function(t){return t.value===e.videoSource.value}))||(e.videoSource=n[0]),e.audioSource&&t.find((function(t){return t.value===e.audioSource.value}))||(e.audioSource=t[0]),localStorage.setItem(m.recordSettings,JSON.stringify(e)),(""+localStorage.getItem(m.recordError)).indexOf("No camera detected")>-1&&localStorage.setItem(m.recordError,""),f(uW(uW({},u),e))})).catch((function(n){t.push({label:"No Audio",value:!1}),e.audioSource&&t.find((function(t){return t.value===e.audioSource.value}))||(e.audioSource=t[0]),localStorage.setItem(m.recordSettings,JSON.stringify(e)),f(uW(uW({},u),e)),n.message.indexOf("No camera detected")>-1||n.message.indexOf("device not found")>-1?localStorage.setItem(m.recordError,"No camera detected. Please check your recording settings and make sure the camera is plugged in."):h(n)})),function(){localStorage.setItem(m.recordError,"");try{window.stream.getTracks().forEach((function(e){return e.stop()}))}catch(e){}}}}),[]),(0,t.jsxs)(hW,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return e.push("/")}}),center:(0,t.jsx)(yW,{children:"Record Video"})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(mW,{children:"Select a recording option"}),(0,t.jsxs)(vW,{children:[r&&!dW&&!pW&&(0,t.jsxs)(gW,uW({onClick:function(){return!p&&e.push("/record/both")},isDisabled:!!p},{children:[(0,t.jsxs)(xW,{children:[(0,t.jsx)(zG,{className:"laptop",height:72,width:72}),(0,t.jsx)(GG,{className:"account",height:24,width:24,color:"#fff"})]}),(0,t.jsx)("span",{children:"Screen+Cam"})]})),o&&(0,t.jsxs)(gW,uW({onClick:function(){return!p&&e.push("/record/screen")},isDisabled:!!p},{children:[(0,t.jsx)(xW,{children:(0,t.jsx)(zG,{height:72,width:72})}),(0,t.jsx)("span",{children:"Screen Only"})]})),i&&(0,t.jsxs)(gW,uW({onClick:function(){return!p&&e.push("/record/cam")},isDisabled:!!p},{children:[(0,t.jsx)(xW,{children:(0,t.jsx)(GG,{height:72,width:72})}),(0,t.jsx)("span",{children:"Cam Only"})]}))]}),(0,t.jsx)(bW,{children:(0,t.jsx)(yo,{icon:(0,t.jsx)(ZG,{opacity:1}),backgroundColor:"#eeeff2",text:"Recording settings",textColor:"#000",onClick:function(){return l(!0)}})}),(0,t.jsxs)(SW,{children:[!!p&&(0,t.jsx)(wW,{children:"Please allow access to your camera and/or mic then try again."}),!p&&localStorage.getItem(m.recordError)&&(0,t.jsx)(wW,{children:localStorage.getItem(m.recordError)})]})]}),s&&(0,t.jsx)(Uu,{initialSettings:u,handleModalClose:function(){return l(!1)},handleSubmit:function(e){f(e),l(!1)}})]})};function EW(){return EW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EW.apply(this,arguments)}const kW=tt((function(e){return E.createElement("svg",EW({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),sW||(sW=E.createElement("defs",null,E.createElement("path",{id:"ndf93hp4na",d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l2.29 2.29c.63.63 1.71.18 1.71-.71V8.91c0-.89-1.08-1.34-1.71-.71L17 10.5z"}))),lW||(lW=E.createElement("g",{fill:"none",fillRule:"evenodd"},E.createElement("g",null,E.createElement("g",null,E.createElement("g",{transform:"translate(-1040 -20) translate(1032 12) translate(8 8)"},E.createElement("mask",{id:"tbkfdbvv7b",fill:"#fff"},E.createElement("use",{xlinkHref:"#ndf93hp4na"})),E.createElement("g",{fill:"#FFF",mask:"url(#tbkfdbvv7b)"},E.createElement("path",{d:"M0 0H32V32H0z",transform:"translate(-4 -4)"}))))))))}))(_W||(_W=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"16px"}),(function(e){return e.height||"16px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var _W,OW;function PW(){return PW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PW.apply(this,arguments)}const TW=tt((function(e){return E.createElement("svg",PW({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"3 3 18 18"},e),OW||(OW=E.createElement("path",{fill:"#001B53",fillRule:"evenodd",d:"M17 3H3v18h18V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"})))}))(AW||(AW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var AW,jW;function IW(){return IW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IW.apply(this,arguments)}const MW=tt((function(e){return E.createElement("svg",IW({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),jW||(jW=E.createElement("g",{fill:"#E84C3D"},E.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zm3.17-7.83c.39-.39 1.02-.39 1.41 0L12 12.59l1.42-1.42c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 14l1.42 1.42c.39.39.39 1.02 0 1.41-.39.39-1.02.39-1.41 0L12 15.41l-1.42 1.42c-.39.39-1.02.39-1.41 0-.187-.187-.293-.44-.293-.705 0-.265.106-.518.293-.705L10.59 14l-1.42-1.42c-.39-.38-.39-1.02 0-1.41zM15.5 4l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z"}))))}))(DW||(DW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var DW,RW,FW,LW,BW,NW,zW,VW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UW=function(){return UW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UW.apply(this,arguments)},HW=tt.label(RW||(RW=VW(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),Vi),GW=tt.div(FW||(FW=VW(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n"])),di),WW=tt.div(LW||(LW=VW(["\n display: flex;\n flex-direction: column;\n padding: 32px;\n"],["\n display: flex;\n flex-direction: column;\n padding: 32px;\n"]))),qW=tt.div(BW||(BW=VW(["\n display: flex;\n flex-direction: row;\n font-size: 18px;\n font-weight: bold;\n color: ",";\n justify-content: space-between;\n margin-bottom: 32px;\n p {\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: row;\n font-size: 18px;\n font-weight: bold;\n color: ",";\n justify-content: space-between;\n margin-bottom: 32px;\n p {\n margin: 0;\n }\n"])),pi),$W=tt.p(NW||(NW=VW(["\n font-size: 14px;\n line-height: 1.43;\n color: ",";\n"],["\n font-size: 14px;\n line-height: 1.43;\n color: ",";\n"])),pi),ZW=tt.section(zW||(zW=VW(["\n display: flex;\n flex-direction: row;\n width: 528px;\n max-width: 100%;\n justify-content: flex-end;\n align-items: right;\n padding: 0 32px 32px;\n"],["\n display: flex;\n flex-direction: row;\n width: 528px;\n max-width: 100%;\n justify-content: flex-end;\n align-items: right;\n padding: 0 32px 32px;\n"]))),YW=function(e){var n=e.open,r=void 0!==n&&n,i=(e.disabled,e.title),o=void 0===i?"":i,a=e.text,s=void 0===a?"":a,l=e.discardButtonText,c=void 0===l?"Keep video":l,u=e.confirmButtonText,f=void 0===u?"Delete video":u,d=e.onClickDiscardButton,p=e.onClickConfirmButton,h=e.showDiscardIcon,y=void 0===h||h,m=e.showSaveIcon,v=void 0===m||m,g=e.handleModalClose,x=void 0===g?function(){}:g;return r?(0,t.jsx)(kL,UW({disableFullScreen:!0,style:{position:"fixed",zIndex:999}},{children:(0,t.jsxs)(GW,{children:[(0,t.jsxs)(WW,{children:[(0,t.jsxs)(qW,{children:[(0,t.jsx)("p",{children:o}),(0,t.jsx)(HW,{children:(0,t.jsx)(rf,{width:"24px",height:"24px",onClick:x})})]}),(0,t.jsx)($W,{children:s})]}),(0,t.jsxs)(ZW,{children:[(0,t.jsx)(yo,UW({},!!y&&{icon:(0,t.jsx)(MW,{height:24,width:24})},{text:c,onClick:d,backgroundColor:Di,textColor:Ri,borderColor:Mi,fontSize:"15px"})),(0,t.jsx)(yo,UW({},!!v&&{icon:(0,t.jsx)(TW,{height:16,width:16})},{text:f,onClick:p,backgroundColor:Hi,borderColor:bi,fontSize:"15px",margin:"0 0 0 12px"}))]})]})})):null},QW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};const KW=function(e){var n=e.when,r=e.navigate,i=void 0===r?function(){}:r,o=e.shouldBlockNavigation,a=e.onConfirm,s=void 0===a?function(){}:a,l=e.onDiscard,c=void 0===l?function(){}:l,u=e.onStay,f=void 0===u?function(){}:u,d=e.stay,p=void 0!==d&&d,h=e.title,y=void 0===h?"Leave without saving changes?":h,m=e.text,v=void 0===m?"Your updates will not be saved. This action can’t be undone.":m,g=e.discardButtonText,x=void 0===g?"Discard Changes":g,b=e.confirmButtonText,w=void 0===b?"Save Changes":b,S=e.showDiscardIcon,C=void 0===S||S,k=e.showSaveIcon,_=void 0===k||k,O=QW((0,E.useState)(!1),2),P=O[0],T=O[1],A=QW((0,E.useState)(null),2),j=A[0],I=A[1],M=QW((0,E.useState)(!1),2),D=M[0],R=M[1],F=function(){T(!1)};return(0,E.useEffect)((function(){D&&j&&i(j.pathname)}),[D,j]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(on,{when:n,message:function(e){return!(!D&&o(e)&&(T(!0),I(e),1))}}),(0,t.jsx)(YW,{open:P,title:y,text:v,discardButtonText:x,confirmButtonText:w,showDiscardIcon:C,showSaveIcon:_,handleModalClose:F,onClickDiscardButton:function(){c(),T(!1),R(!0)},onClickConfirmButton:p?function(){F(),f()}:function(){s(),T(!1),R(!0)}})]})};var XW,JW=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},eq=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},tq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},nq="video/webm;codecs=vp8,opus",rq="video/webm",iq="webm",oq=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}};!function(e){e.AbortError="media_aborted",e.NotAllowedError="permission_denied",e.NotFoundError="no_specified_media_found",e.NotReadableError="media_in_use",e.OverconstrainedError="invalid_media_constraints",e.TypeError="no_constraints",e.NONE="",e.NO_RECORDER="recorder_error"}(XW||(XW={}));var aq={low:1e6,standard:25e5,high:5e6,ultra:8e6};function sq(e){var t=this,n=e.audio,r=void 0===n||n,i=e.video,o=void 0!==i&&i,a=e.onStop,s=void 0===a?function(){return null}:a,l=e.blobPropertyBag,c=e.screen,u=void 0!==c&&c,f=e.mediaRecorderOptions,d=void 0===f?null:f,p=e.mimeType,h=void 0===p?"":p,y=e.quality,m=void 0===y?"low":y,v=(0,E.useRef)(null),g=(0,E.useRef)([]),x=(0,E.useRef)(null),b=tq((0,E.useState)("idle"),2),w=b[0],S=b[1],C=tq((0,E.useState)(!1),2),k=C[0],_=C[1],O=tq((0,E.useState)(null),2),P=O[0],T=O[1],A=tq((0,E.useState)("NONE"),2),j=A[0],I=A[1],M=(0,E.useRef)(!1),D=aq[m]||aq.low;window.streams||(window.streams=[]),window.streams=window.streams.filter(Boolean);var R=(0,E.useCallback)((function(){return JW(t,void 0,void 0,(function(){var e,t,n,i;return eq(this,(function(a){switch(a.label){case 0:S("acquiring_media"),e={audio:"boolean"==typeof r?!!r:r,video:"boolean"==typeof o?!!o:o},a.label=1;case 1:return a.trys.push([1,8,,9]),u?[4,window.navigator.mediaDevices.getDisplayMedia({video:o||!0})]:[3,5];case 2:return t=a.sent(),window.streams.push(t),t&&r?[4,window.navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})]:[3,4];case 3:n=a.sent(),window.streams.push(n),n.getAudioTracks().forEach((function(e){return t.addTrack(e)})),a.label=4;case 4:return x.current=t,[3,7];case 5:return[4,window.navigator.mediaDevices.getUserMedia(e)];case 6:t=a.sent(),window.streams.push(t),x.current=t,a.label=7;case 7:return M.current?(t&&S("idle"),[3,9]):(oq(t),[2]);case 8:return i=a.sent(),oq(t),oq(n),I(i.name),S("idle"),[3,9];case 9:return[2]}}))}))}),[r,o,u]);(0,E.useEffect)((function(){return M.current=!0,function(){M.current=!1}}),[]),(0,E.useEffect)((function(){if(!window.MediaRecorder)throw new Error("Unsupported Browser");if(u&&!window.navigator.mediaDevices.getDisplayMedia)throw new Error("This browser doesn't support screen capturing");var e=function(e){var t=navigator.mediaDevices.getSupportedConstraints(),n=Object.keys(e).filter((function(e){return!t[e]}));n.length>0&&console.error("The constraints ".concat(n.join(",")," doesn't support on this browser. Please check your ReactMediaRecorder component."))};"object"==typeof r&&e(r),"object"==typeof o&&e(o),d&&d.mimeType&&(MediaRecorder.isTypeSupported(d.mimeType)||console.error("The specified MIME type you supplied for MediaRecorder doesn't support this browser")),x.current||R()}),[r,u,o,R,d]);var F=function(e){var t=e.data;g.current.push(t)},L=function(){var e=tq(g.current,1)[0],t=Object.assign({type:e.type},l||(o?{type:"video/mp4"}:{type:"audio/wav"})),n=new Blob(g.current,t),r=URL.createObjectURL(n);S("stopped"),T(r),s(r,n)},B=function(e){_(e),x.current&&x.current.getAudioTracks().forEach((function(t){return t.enabled=!e}))},N=x.current?new MediaStream(x.current.getVideoTracks()):null;window.streams.push(N);var z=x.current?new MediaStream(x.current.getAudioTracks()):null;return window.streams.push(z),{error:XW[j],muteAudio:function(){return B(!0)},unMuteAudio:function(){return B(!1)},startRecording:function(){return JW(t,void 0,void 0,(function(){return eq(this,(function(e){switch(e.label){case 0:return I("NONE"),x.current?[3,2]:[4,R()];case 1:e.sent(),e.label=2;case 2:return x.current?x.current.getTracks().some((function(e){return"ended"===e.readyState}))?[4,R()]:[3,4]:[3,5];case 3:e.sent(),e.label=4;case 4:v.current=new MediaRecorder(x.current,{mimeType:h,videoBitsPerSecond:D}),v.current.ondataavailable=F,v.current.onstop=L,v.current.onerror=function(){I("NO_RECORDER"),S("idle")},v.current.start(),S("recording"),e.label=5;case 5:return[2]}}))}))},startRecordingForCanvas:function(e){return JW(t,void 0,void 0,(function(){var t;return eq(this,(function(n){switch(n.label){case 0:return e?r?[4,window.navigator.mediaDevices.getUserMedia({audio:r})]:[3,2]:(I("NO_RECORDER"),[2]);case 1:t=n.sent(),window.streams.push(t),t.getAudioTracks().forEach((function(t){return e.addTrack(t)})),n.label=2;case 2:return v.current=new MediaRecorder(e,{mimeType:h,videoBitsPerSecond:D}),v.current.ondataavailable=F,v.current.onstop=L,v.current.onerror=function(){I("NO_RECORDER"),S("idle")},v.current.start(),S("recording"),[2]}}))}))},pauseRecording:function(){v.current&&"recording"===v.current.state&&v.current.pause()},resumeRecording:function(){v.current&&"paused"===v.current.state&&v.current.resume()},stopRecording:function(){v.current&&"inactive"!==v.current.state&&(S("stopping"),v.current.stop(),x.current&&x.current.getTracks().forEach((function(e){return e.stop()})),g.current=[])},mediaBlobUrl:P,status:w,isAudioMuted:k,previewStream:N,previewAudioStream:z,clearBlobUrl:function(){return T(null)}}}var lq=__webpack_require__(6650);let cq=null;const uq=()=>{if(null!==cq)return cq;const e=new Blob(['!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t,timerType:r}}):e.set(t,setTimeout(c,n-o,e,t,n,r))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o,"interval"))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r,"timeout"))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",e=>{let{data:t}=e;try{if("clear"===t.method){const{id:e,params:{timerId:n,timerType:o}}=t;if("interval"===o)Object(r.a)(n),postMessage({error:null,id:e});else{if("timeout"!==o)throw new Error(\'The given type "\'.concat(o,\'" is not supported\'));Object(r.b)(n),postMessage({error:null,id:e})}}else{if("set"!==t.method)throw new Error(\'The given method "\'.concat(t.method,\'" is not supported\'));{const{params:{delay:e,now:n,timerId:o,timerType:i}}=t;if("interval"===i)Object(r.c)(e,o,n);else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));Object(r.d)(e,o,n)}}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}})}]);'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return cq=(e=>{const t=new Map,n=new Map,r=new Map,i=new Worker(e);return i.addEventListener("message",(({data:e})=>{if(void 0!==(i=e).method&&"call"===i.method){const{params:{timerId:i,timerType:o}}=e;if("interval"===o){const e=t.get(i);if("number"==typeof e){const t=r.get(e);if(void 0===t||t.timerId!==i||t.timerType!==o)throw new Error("The timer is in an undefined state.")}else{if(void 0===e)throw new Error("The timer is in an undefined state.");e()}}else if("timeout"===o){const e=n.get(i);if("number"==typeof e){const t=r.get(e);if(void 0===t||t.timerId!==i||t.timerType!==o)throw new Error("The timer is in an undefined state.")}else{if(void 0===e)throw new Error("The timer is in an undefined state.");e(),n.delete(i)}}}else{if(!(e=>null===e.error&&"number"==typeof e.id)(e)){const{error:{message:t}}=e;throw new Error(t)}{const{id:i}=e,o=r.get(i);if(void 0===o)throw new Error("The timer is in an undefined state.");const{timerId:a,timerType:s}=o;r.delete(i),"interval"===s?t.delete(a):n.delete(a)}}var i})),{clearInterval:e=>{const n=(0,lq.generateUniqueNumber)(r);r.set(n,{timerId:e,timerType:"interval"}),t.set(e,n),i.postMessage({id:n,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:e=>{const t=(0,lq.generateUniqueNumber)(r);r.set(t,{timerId:e,timerType:"timeout"}),n.set(e,t),i.postMessage({id:t,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:(e,n)=>{const r=(0,lq.generateUniqueNumber)(t);return t.set(r,(()=>{e(),"function"==typeof t.get(r)&&i.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:r,timerType:"interval"}})})),i.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:r,timerType:"interval"}}),r},setTimeout:(e,t)=>{const r=(0,lq.generateUniqueNumber)(n);return n.set(r,e),i.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:r,timerType:"timeout"}}),r}}})(t),cq.setTimeout((()=>URL.revokeObjectURL(t)),0),cq},fq=e=>uq().clearInterval(e),dq=(e,t)=>uq().setInterval(e,t);var pq,hq,yq,mq,vq,gq,xq,bq,wq,Sq,Cq,Eq,kq,_q,Oq,Pq=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Tq=function(){return Tq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tq.apply(this,arguments)},Aq=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},jq=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Iq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Mq=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Dq=tt.div(hq||(hq=Pq(["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"],["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"])),qi,di,$i),Rq=tt.div(yq||(yq=Pq(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"])),(function(e){return e.theme.primaryColor}),di,(function(e){return e.theme.primaryColor})),Fq=tt.div(mq||(mq=Pq(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),(function(e){return e.theme.primaryColor}),di,(function(e){return e.theme.primaryColor})),Lq=tt.div(vq||(vq=Pq(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),Wi,pi,Zi),Bq=tt.div(gq||(gq=Pq(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-right: auto;\n margin-left: auto;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-right: auto;\n margin-left: auto;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),Nq=tt.div(xq||(xq=Pq(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),zq=tt.div(bq||(bq=Pq(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),qi,di,$i),Vq=tt.div(Sq||(Sq=Pq(["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"],["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(wq||(wq=Pq(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),Uq=tt.div(Cq||(Cq=Pq(["\n width: 150px;\n display: flex;\n flex-direction: row;\n"],["\n width: 150px;\n display: flex;\n flex-direction: row;\n"]))),Hq=tt.div(Eq||(Eq=Pq(["\n margin-left: 5%;\n margin-top: 5%;\n"],["\n margin-left: 5%;\n margin-top: 5%;\n"]))),Gq=tt.div(kq||(kq=Pq(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"]))),Wq=tt.div(_q||(_q=Pq(["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"],["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"]))),qq=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}},$q=null,Zq={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},Yq={videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}},Qq=0,Kq=navigator.mediaDevices.getDisplayMedia,Xq=function(e){var n=e.onRecordingStart,r=e.onRecordingEnd,i=e.onUpload,o=e.uploadDisabled,a=e.onRecordingUrlGeneration;Qq++;var s,l=dn(),c=(0,E.useRef)(null),u=Iq((0,E.useState)(3),2),f=u[0],d=u[1],p=Iq((0,E.useState)(!1),2),h=p[0],y=p[1],v=Iq((0,E.useState)(!1),2),g=v[0],x=v[1],b=Iq((0,E.useState)(!1),2),w=b[0],S=b[1],C=Iq((0,E.useState)(!1),2),k=C[0],_=C[1],O=Iq((0,E.useState)(0),2),P=O[0],T=O[1],A={videoSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(Yq)).videoSource,videoQuality:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(Yq)).videoQuality,audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(Yq)).audioSource},j=Nl().userData;(0,E.useEffect)((function(){if("permission_denied"!==V&&!document.pictureInPictureElement){var e={audio:!1,video:{deviceId:A.videoSource?A.videoSource.value:void 0,width:{ideal:640},height:{ideal:360},frameRate:24}};navigator.mediaDevices.getUserMedia(e).then((function(e){pq=e,window.streams.push(pq),c.current&&(c.current.srcObject=e,c.current.oncanplaythrough=function(){return Aq(void 0,void 0,void 0,(function(){var e;return jq(this,(function(t){switch(t.label){case 0:if(!c.current)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),c.current.play(),[4,c.current.requestPictureInPicture()];case 2:return t.sent(),c.current.oncanplaythrough=null,[3,4];case 3:return e=t.sent(),console.log(e),[3,4];case 4:return[2]}}))}))})})).catch((function(e){console.log("The following error occurred: "+e)}))}}),[]);try{s={deviceId:A.audioSource.value}}catch(e){}A&&A.audioSource&&A.audioSource.value||(s=!1),Qq>1&&(navigator.mediaDevices.getDisplayMedia=function(){});var I=A&&A.videoQuality&&A.videoQuality.value?Zq[A.videoQuality]:Zq.standard,M=sq({screen:!0,video:Tq(Tq({},I),{frameRate:24}),audio:s,quality:A.videoQuality,blobPropertyBag:{type:nq},mimeType:nq}),D=M.status,R=M.startRecording,F=M.stopRecording,L=M.pauseRecording,B=M.resumeRecording,N=M.mediaBlobUrl,z=M.previewStream,V=M.error;z&&(z.getVideoTracks()[0].onended=function(){"recording"===D?G():l.push("/record/home")}),(0,E.useEffect)((function(){return localStorage.setItem(m.recordError,""),A.videoSource&&A.videoSource.value||(localStorage.setItem(m.recordError,"No camera detected. Please check your recording settings and make sure the camera is plugged in."),Qq=0,l.push("/record/home")),function(){Qq=0,navigator.mediaDevices.getDisplayMedia=Kq,Z()}}),[]),(0,E.useEffect)((function(){"permission_denied"===V&&(localStorage.setItem(m.recordError,"Please allow access to share your screen then try again."),Z(),Qq=0,navigator.mediaDevices.getDisplayMedia=Kq,l.push("/record/home"))}),[V]),(0,E.useEffect)((function(){k||w||!z||N||h||H()}),[z]),(0,E.useEffect)((function(){N&&a(N)}),[N]),(0,E.useEffect)((function(){var e=dq((function(){!h||g||f||T(P+1)}),1e3);return function(){fq(e)}})),(0,E.useEffect)((function(){var e,t,n,r,i;j&&j.authCalled&&(null===(e=j.user)||void 0===e?void 0:e.packageDetails)&&(null===(n=null===(t=j.user)||void 0===t?void 0:t.packageDetails)||void 0===n?void 0:n.maxLength)&&P>=(null===(i=null===(r=j.user)||void 0===r?void 0:r.packageDetails)||void 0===i?void 0:i.maxLength)&&G()}),[P,j,j.authCalled]);var U=function(){h&&f>0&&(S(!0),clearTimeout($q),y(!1),d(3))},H=function(){S(!1),y(!0)},G=function(){_(!0),r&&r(),y(!1),document.pictureInPictureElement&&document.exitPictureInPicture();try{Mq([],Iq(window.streams),!1).filter(Boolean).forEach((function(e){return qq(e)})),window.streams=[]}catch(e){}F()},W=function(){L(),x(!0)},q=function(){B(),x(!1)},$=function(){return Aq(void 0,void 0,void 0,(function(){var e;return jq(this,(function(t){switch(t.label){case 0:return[4,fetch(N||"").then((function(e){return e.blob()}))];case 1:return e=t.sent(),Z(),i({file:e,fileUrl:N}),[2]}}))}))};(0,E.useEffect)((function(){f>0&&h?$q=setTimeout((function(){return d(f-1)}),1e3):h&&(n&&n(),R())}),[h,f]);var Z=function(){Mq([],Iq(window.streams),!1).filter(Boolean).forEach((function(e){return qq(e)})),window.streams=[],y(!1),$q&&clearTimeout($q),Y()},Y=function(){document.pictureInPictureElement&&document.exitPictureInPicture()},Q=(0,E.useMemo)((function(){return(0,t.jsxs)(t.Fragment,{children:[!N&&(0,t.jsx)("iframe",Tq({title:"videoFrame",style:{display:"none"}},{children:(0,t.jsx)("video",{muted:!0,style:{display:"none"},ref:c,width:0,height:0,autoPlay:!0})})),(0,t.jsxs)(Vq,{children:["recording"===D&&(0,t.jsxs)(Uq,{children:[!g&&(0,t.jsx)(Nq,Tq({onClick:W},{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(AV,{}),textColor:"#000",text:"Pause",onClick:W})})),g&&(0,t.jsx)(zq,Tq({onClick:q},{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(Rc,{color:di,size:34}),textColor:"#fff",text:"Resume",onClick:q})})),(0,t.jsx)(Hq,{children:St(P,0)})]}),"recording"===D&&(0,t.jsx)(Rq,{children:(0,t.jsx)(yo,{backgroundColor:Qi,icon:(0,t.jsx)(NV,{}),textColor:"#fff",text:"Finish",onClick:G})}),h&&"recording"!==D&&(0,t.jsx)(Bq,Tq({onClick:U},{children:(0,t.jsx)(yo,{backgroundColor:Wi,textColor:"#000",text:"Cancel",onClick:U})})),!h&&"idle"===D&&(0,t.jsx)(Dq,{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(kW,{width:24,height:24,opacity:1}),text:"Start recording",textColor:"#fff",onClick:H})}),"stopped"===D&&(0,t.jsx)(Lq,{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(MW,{height:20,width:20,color:pi}),textColor:"#000",text:"Discard",onClick:function(){return l.push("/record/home")}})}),"stopped"===D&&(0,t.jsx)(Fq,{children:(0,t.jsx)(yo,{disabled:o,backgroundColor:"var(--secondary)",icon:(0,t.jsx)(TW,{height:20,width:20,color:di}),textColor:"#fff",text:"Save Recording",onClick:$})})]})]})}),[D,P,h,g,N,o]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){return l.push(e)},shouldBlockNavigation:function(e){return"recording"===D},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,t.jsxs)(Gq,{children:[(0,t.jsx)(Wq,{children:(0,t.jsx)(Cu,{counter:f,willStart:f>0&&h,onClick:function(){},hide:!f})}),Q]})]})},Jq=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},e$=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},t$=_n,n$=Pn,r$={all:[],user:[]},i$=function(e){var t=e.page,n=void 0===t?0:t,r=e.size,i=void 0===r?50:r,o=e.search,a=void 0===o?"":o,s=e.all,l=void 0!==s&&s,c=e.sort,u=e.refresh,f=void 0===u||u;return Jq(void 0,void 0,void 0,(function(){var e,t,r,o,s,u;return e$(this,(function(d){switch(d.label){case 0:if(e=S.bearerToken,t={start:n*i,limit:i,search:a,sort:c,all:""},l&&(t.all="true"),!f){if(l&&(null===(s=null==r$?void 0:r$.all)||void 0===s?void 0:s.length))return[2,r$.all];if(!l&&(null===(u=null==r$?void 0:r$.user)||void 0===u?void 0:u.length))return[2,r$.user]}return[4,Tn({url:"/video-tags",baseURL:b,method:t$,headers:e,params:t}).catch((function(e){return console.log(e)}))];case 1:if((r=d.sent())instanceof Error)throw o=r.message,new Error(o);return l?r$.all=r:r$.user=r,[2,r]}}))}))},o$=function(e,t){return Jq(void 0,void 0,void 0,(function(){var n,r,i,o,a;return e$(this,(function(s){switch(s.label){case 0:return n=S.bearerToken,r={url:"/videos/".concat(e,"/video-tags"),baseURL:b,method:n$,headers:n,data:t},[4,Tn(r).catch((function(e){return e}))];case 1:if((i=s.sent())instanceof Error)throw o=JSON.parse(i.message),a=o.message,new Error(a);return[2,{videoTags:i}]}}))}))};function a$(){return a$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a$.apply(this,arguments)}const s$=tt((function(e){return E.createElement("svg",a$({width:16,height:14,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Oq||(Oq=E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5833 0.333252C13.1333 0.333252 13.6 0.683252 13.7667 1.17492L15.4083 5.89992C15.4667 6.07492 15.5 6.26659 15.5 6.44992V12.4166C15.5 13.1083 14.9333 13.6666 14.25 13.6666C13.5583 13.6666 13 13.0999 13 12.4166V11.9999H3V12.4166C3 13.1083 2.44167 13.6666 1.75 13.6666C1.05833 13.6666 0.5 13.1083 0.5 12.4166V6.44992C0.5 6.25825 0.533333 6.07492 0.591667 5.89992L2.23333 1.17492C2.40833 0.683252 2.86667 0.333252 3.41667 0.333252H12.5833ZM2.16667 8.24992C2.16667 8.94159 2.725 9.49992 3.41667 9.49992C4.10833 9.49992 4.66667 8.94159 4.66667 8.24992C4.66667 7.55825 4.10833 6.99992 3.41667 6.99992C2.725 6.99992 2.16667 7.55825 2.16667 8.24992ZM12.5833 9.49992C11.8917 9.49992 11.3333 8.94159 11.3333 8.24992C11.3333 7.55825 11.8917 6.99992 12.5833 6.99992C13.275 6.99992 13.8333 7.55825 13.8333 8.24992C13.8333 8.94159 13.275 9.49992 12.5833 9.49992ZM3.225 2.14992L2.16667 5.33325H13.8333L12.775 2.14992C12.6583 1.81659 12.3417 1.58325 11.9833 1.58325H4.01667C3.65833 1.58325 3.34167 1.81659 3.225 2.14992Z",fill:"#001B53",fillOpacity:.4})))}))(l$||(l$=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var l$,c$;function u$(){return u$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u$.apply(this,arguments)}const f$=tt((function(e){return E.createElement("svg",u$({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c$||(c$=E.createElement("g",null,E.createElement("path",{d:"M11.3327 3.99935C11.3327 3.63268 11.0327 3.33268 10.666 3.33268H8.66602V1.33268C8.66602 0.966016 8.36602 0.666016 7.99935 0.666016C7.63268 0.666016 7.33268 0.966016 7.33268 1.33268V3.33268H4.66602V1.33268C4.66602 0.966016 4.36602 0.666016 3.99935 0.666016C3.63268 0.666016 3.33268 0.966016 3.33268 1.33268V3.33268H1.33268C0.966016 3.33268 0.666016 3.63268 0.666016 3.99935C0.666016 4.36602 0.966016 4.66602 1.33268 4.66602H3.33268V7.33268H1.33268C0.966016 7.33268 0.666016 7.63268 0.666016 7.99935C0.666016 8.36602 0.966016 8.66602 1.33268 8.66602H3.33268V10.666C3.33268 11.0327 3.63268 11.3327 3.99935 11.3327C4.36602 11.3327 4.66602 11.0327 4.66602 10.666V8.66602H7.33268V10.666C7.33268 11.0327 7.63268 11.3327 7.99935 11.3327C8.36602 11.3327 8.66602 11.0327 8.66602 10.666V8.66602H10.666C11.0327 8.66602 11.3327 8.36602 11.3327 7.99935C11.3327 7.63268 11.0327 7.33268 10.666 7.33268H8.66602V4.66602H10.666C11.0327 4.66602 11.3327 4.36602 11.3327 3.99935ZM7.33268 7.33268H4.66602V4.66602H7.33268V7.33268Z",fill:"#001B53"}))))}))(d$||(d$=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n fill-opacity: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n fill-opacity: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"14px"}),(function(e){return e.height||"14px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"currentColor"}),(function(e){return e.opacity||"inherit"}));var d$,p$={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function h$(e){if("number"==typeof e)return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();t=n.includes(".")?parseFloat(n):parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return p$[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function y$(e){var t=h$(e);return"".concat(t.value).concat(t.unit)}var m$=function(){return m$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},m$.apply(this,arguments)},v$=function(e,t,n){var r="react-spinners-".concat("MoonLoader","-").concat("moon");if("undefined"==typeof window||!window.document)return r;var i=document.createElement("style");document.head.appendChild(i);var o=i.sheet,a="\n @keyframes ".concat(r," {\n ").concat("100% {transform: rotate(360deg)}","\n }\n ");return o&&o.insertRule(a,0),r}();const g$=function(e){var t=e.loading,n=void 0===t||t,r=e.color,i=void 0===r?"#000000":r,o=e.speedMultiplier,a=void 0===o?1:o,s=e.cssOverride,l=void 0===s?{}:s,c=e.size,u=void 0===c?60:c,f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["loading","color","speedMultiplier","cssOverride","size"]),d=h$(u),p=d.value,h=d.unit,y=p/7,m=m$({display:"inherit",position:"relative",width:"".concat("".concat(p+2*y).concat(h)),height:"".concat("".concat(p+2*y).concat(h)),animation:"".concat(v$," ").concat(.6/a,"s 0s infinite linear"),animationFillMode:"forwards"},l),v=function(e){return{width:y$(e),height:y$(e),borderRadius:"100%"}},g=m$(m$({},v(y)),{backgroundColor:"".concat(i),opacity:"0.8",position:"absolute",top:"".concat("".concat(p/2-y/2).concat(h)),animation:"".concat(v$," ").concat(.6/a,"s 0s infinite linear"),animationFillMode:"forwards"}),x=m$(m$({},v(p)),{border:"".concat(y,"px solid ").concat(i),opacity:"0.1",boxSizing:"content-box",position:"absolute"});return n?E.createElement("span",m$({style:m},f),E.createElement("span",{style:g}),E.createElement("span",{style:x})):null};var x$,b$=__webpack_require__(1394),w$=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},S$=function(){return S$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},S$.apply(this,arguments)},C$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},E$=tt.div(M$||(M$=w$(["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"],["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"]))),k$=tt.div(D$||(D$=w$(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),_$=tt.div(R$||(R$=w$(["\n display: flex;\n flex-direction: column;\n position: relative;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n span {\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ",";\n margin-bottom: 8px;\n }\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n background-color: ",";\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n background-color: #f6f7f9;\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n }\n"],["\n display: flex;\n flex-direction: column;\n position: relative;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n span {\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ",";\n margin-bottom: 8px;\n }\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n background-color: ",";\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n background-color: #f6f7f9;\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n }\n"])),(function(e){return e.isActive?pi:"rgba(39, 42, 50, 0.4)"}),(function(e){return e.theme.primaryColor})),O$=tt.div(F$||(F$=w$(["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"],["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"])),ai,"15px",Yi),P$=tt.progress(L$||(L$=w$(["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"],["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"])),Wi,Wi,(function(e){return e.color}),(function(e){return e.color})),T$=tt.div(B$||(B$=w$(["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"],["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"]))),A$=tt.div(N$||(N$=w$(["\n position: absolute;\n top: 30px;\n"],["\n position: absolute;\n top: 30px;\n"]))),j$={width:"24px",zIndex:2,backgroundColor:"f6f7f9"};!function(e){e[e.UPLOADING=1]="UPLOADING",e[e.CREATE=2]="CREATE",e[e.ENCODE=3]="ENCODE"}(x$||(x$={}));const I$=function(e){var n=e.title,r=e.beginUploadProcess,i=e.afterUpload,o=e.setSavedVideoId,a=e.file,s=e.fileName,l=Nl().userData,c=C$((0,E.useState)(x$.UPLOADING),2),u=c[0],f=c[1],d=C$((0,E.useState)({loaded:0,total:0,percentage:0}),2),p=d[0],h=d[1],y=ML(),m=y.presignedUrl,v=y.fetch,g=y.loading,x=y.error,b=HL(),w=b.uploadVideo,S=b.loading,C=b.data,k=b.error,_=jL(),O=_.fetch,P=_.loading,T=_.videoData,A=_.error,j=_.progress,I=IL(),M=I.fetch,D=I.loading,R=I.encodeData,F=I.error,L=I.progress;(0,E.useEffect)((function(){if(r){if(m&&m.url||!n)return;e=void 0,t=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){return a&&v({fileName:s,type:rq}),[2]}))},new((i=void 0)||(i=Promise))((function(n,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}var e,t,i,o}),[r]),(0,E.useEffect)((function(){m&&(g||x||!a||(f(x$.UPLOADING),w({url:m.url,file:a,contentType:rq,onUploadProgress:B})))}),[m]),(0,E.useEffect)((function(){!S&&!k&&C&&a&&(f(x$.CREATE),O({filename:s,title:n}))}),[S,C]),(0,E.useEffect)((function(){!P&&!A&&T&&a&&(f(x$.ENCODE),o(T.video_id),M({videoId:T.video_id,customerId:l.customerId}))}),[P,T]),(0,E.useEffect)((function(){!D&&!F&&R&&a&&i&&i()}),[D,R]);var B=function(e){var t=Math.round(100*e.loaded/e.total);h({loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:t})},N=function(e){return(e/1e3).toFixed(2)};return(0,t.jsx)(O$,{children:(0,t.jsxs)(E$,{children:[(0,t.jsxs)(k$,{children:[(0,t.jsxs)(_$,S$({isActive:S},{children:[(0,t.jsx)("span",{children:S?"Uploading":"Uploaded"}),p.percentage<100&&(0,t.jsx)(A$,{children:(0,t.jsx)(g$,{size:19.5,color:Ti,loading:!0})}),(!p.percentage||100===p.percentage)&&(0,t.jsx)(b$.Cd,{style:j$,percent:0,trailWidth:10,strokeWidth:10,strokeColor:Ti})]})),(0,t.jsxs)(_$,S$({isActive:P},{children:[(0,t.jsx)("span",{children:P?"Creating":"Created"}),j<100&&(0,t.jsx)(A$,{children:(0,t.jsx)(g$,{size:19.5,color:Ti,loading:!0})}),(!j||100===j)&&(0,t.jsx)(b$.Cd,{style:j$,percent:0,trailWidth:10,strokeWidth:10,strokeColor:Ti})]})),(0,t.jsxs)(_$,S$({isActive:D},{children:[(0,t.jsx)("span",{children:D?"Encoding":"Encoded"}),L<100&&(0,t.jsx)(A$,{children:(0,t.jsx)(g$,{size:19.5,color:Ti,loading:!0})}),(!L||100===L)&&(0,t.jsx)(b$.Cd,{style:j$,percent:0,trailWidth:10,strokeWidth:10,strokeColor:Ti})]}))]}),(0,t.jsx)(P$,{value:u?u==x$.UPLOADING?50*p.percentage/100:u==x$.CREATE?50+(j||0):100:0,max:100,color:Ti}),(0,t.jsx)(T$,{children:N(p.loaded)+" MB/"+N(p.total)+" MB"})]})})};var M$,D$,R$,F$,L$,B$,N$,z$=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===V$}(e)}(e)},V$="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function U$(e,t){return!1!==t.clone&&t.isMergeableObject(e)?G$((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function H$(e,t,n){return e.concat(t).map((function(e){return U$(e,n)}))}function G$(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||H$,n.isMergeableObject=n.isMergeableObject||z$;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=U$(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=G$(e[i],t[i],n):r[i]=U$(t[i],n)})),r}(e,t,n):U$(t,n)}G$.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return G$(e,n,t)}),{})};const W$=G$;var q$=__webpack_require__(9590),$$=__webpack_require__.n(q$);const Z$=function(e,t){};function Y$(){return Y$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y$.apply(this,arguments)}function Q$(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function K$(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var X$=(0,E.createContext)(void 0);X$.displayName="FormikContext";var J$=X$.Provider;function eZ(){var e=(0,E.useContext)(X$);return e||Z$(!1),e}X$.Consumer;var tZ=function(e){return Array.isArray(e)&&0===e.length},nZ=function(e){return"function"==typeof e},rZ=function(e){return null!==e&&"object"==typeof e},iZ=function(e){return String(Math.floor(Number(e)))===e},oZ=function(e){return"[object String]"===Object.prototype.toString.call(e)},aZ=function(e){return 0===E.Children.count(e)},sZ=function(e){return rZ(e)&&nZ(e.then)};function lZ(e,t,n,r){void 0===r&&(r=0);for(var i=l_(t);e&&r<i.length;)e=e[i[r++]];return r===i.length||e?void 0===e?n:e:n}function cZ(e,t,n){for(var r=sS(e),i=r,o=0,a=l_(t);o<a.length-1;o++){var s=a[o],l=lZ(e,a.slice(0,o+1));if(l&&(rZ(l)||Array.isArray(l)))i=i[s]=sS(l);else{var c=a[o+1];i=i[s]=iZ(c)&&Number(c)>=0?[]:{}}}return(0===o?e:i)[a[o]]===n?e:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function uZ(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],s=e[a];rZ(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},uZ(s,t,n,r[a])):r[a]=t}return r}var fZ={},dZ={};function pZ(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,o=e.validateOnMount,a=void 0!==o&&o,s=e.isInitialValid,l=e.enableReinitialize,c=void 0!==l&&l,u=e.onSubmit,f=Q$(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),d=Y$({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:u},f),p=(0,E.useRef)(d.initialValues),h=(0,E.useRef)(d.initialErrors||fZ),y=(0,E.useRef)(d.initialTouched||dZ),m=(0,E.useRef)(d.initialStatus),v=(0,E.useRef)(!1),g=(0,E.useRef)({});(0,E.useEffect)((function(){return v.current=!0,function(){v.current=!1}}),[]);var x=(0,E.useState)(0)[1],b=(0,E.useRef)({values:d.initialValues,errors:d.initialErrors||fZ,touched:d.initialTouched||dZ,status:d.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),w=b.current,S=(0,E.useCallback)((function(e){var t=b.current;b.current=function(e,t){switch(t.type){case"SET_VALUES":return Y$({},e,{values:t.payload});case"SET_TOUCHED":return Y$({},e,{touched:t.payload});case"SET_ERRORS":return $$()(e.errors,t.payload)?e:Y$({},e,{errors:t.payload});case"SET_STATUS":return Y$({},e,{status:t.payload});case"SET_ISSUBMITTING":return Y$({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Y$({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Y$({},e,{values:cZ(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Y$({},e,{touched:cZ(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Y$({},e,{errors:cZ(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Y$({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Y$({},e,{touched:uZ(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Y$({},e,{isSubmitting:!1});default:return e}}(t,e),t!==b.current&&x((function(e){return e+1}))}),[]),C=(0,E.useCallback)((function(e,t){return new Promise((function(n,r){var i=d.validate(e,t);null==i?n(fZ):sZ(i)?i.then((function(e){n(e||fZ)}),(function(e){r(e)})):n(i)}))}),[d.validate]),k=(0,E.useCallback)((function(e,t){var n=d.validationSchema,r=nZ(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);var i=yZ(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}(e,r);return new Promise((function(e,t){i.then((function(){e(fZ)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return cZ(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;lZ(t,a.path)||(t=cZ(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[d.validationSchema]),_=(0,E.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),O=(0,E.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return nZ(g.current[e].validate)})),n=t.length>0?t.map((function(t){return _(t,lZ(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=cZ(e,t[r],n)),e}),{})}))}),[_]),P=(0,E.useCallback)((function(e){return Promise.all([O(e),d.validationSchema?k(e):{},d.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return W$.all([t,n,r],{arrayMerge:mZ})}))}),[d.validate,d.validationSchema,O,C,k]),T=gZ((function(e){return void 0===e&&(e=w.values),S({type:"SET_ISVALIDATING",payload:!0}),P(e).then((function(e){return v.current&&(S({type:"SET_ISVALIDATING",payload:!1}),S({type:"SET_ERRORS",payload:e})),e}))}));(0,E.useEffect)((function(){a&&!0===v.current&&$$()(p.current,d.initialValues)&&T(p.current)}),[a,T]);var A=(0,E.useCallback)((function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:h.current?h.current:d.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:d.initialTouched||{},i=e&&e.status?e.status:m.current?m.current:d.initialStatus;p.current=t,h.current=n,y.current=r,m.current=i;var o=function(){S({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(d.onReset){var a=d.onReset(w.values,Y);sZ(a)?a.then(o):o()}else o()}),[d.initialErrors,d.initialStatus,d.initialTouched,d.onReset]);(0,E.useEffect)((function(){!0!==v.current||$$()(p.current,d.initialValues)||c&&(p.current=d.initialValues,A(),a&&T(p.current))}),[c,d.initialValues,A,a,T]),(0,E.useEffect)((function(){c&&!0===v.current&&!$$()(h.current,d.initialErrors)&&(h.current=d.initialErrors||fZ,S({type:"SET_ERRORS",payload:d.initialErrors||fZ}))}),[c,d.initialErrors]),(0,E.useEffect)((function(){c&&!0===v.current&&!$$()(y.current,d.initialTouched)&&(y.current=d.initialTouched||dZ,S({type:"SET_TOUCHED",payload:d.initialTouched||dZ}))}),[c,d.initialTouched]),(0,E.useEffect)((function(){c&&!0===v.current&&!$$()(m.current,d.initialStatus)&&(m.current=d.initialStatus,S({type:"SET_STATUS",payload:d.initialStatus}))}),[c,d.initialStatus,d.initialTouched]);var j=gZ((function(e){if(g.current[e]&&nZ(g.current[e].validate)){var t=lZ(w.values,e),n=g.current[e].validate(t);return sZ(n)?(S({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){S({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),S({type:"SET_ISVALIDATING",payload:!1})}))):(S({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return d.validationSchema?(S({type:"SET_ISVALIDATING",payload:!0}),k(w.values,e).then((function(e){return e})).then((function(t){S({type:"SET_FIELD_ERROR",payload:{field:e,value:lZ(t,e)}}),S({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),I=(0,E.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),M=(0,E.useCallback)((function(e){delete g.current[e]}),[]),D=gZ((function(e,t){return S({type:"SET_TOUCHED",payload:e}),(void 0===t?i:t)?T(w.values):Promise.resolve()})),R=(0,E.useCallback)((function(e){S({type:"SET_ERRORS",payload:e})}),[]),F=gZ((function(e,t){var r=nZ(e)?e(w.values):e;return S({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?T(r):Promise.resolve()})),L=(0,E.useCallback)((function(e,t){S({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),B=gZ((function(e,t,r){return S({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?T(cZ(w.values,e,t)):Promise.resolve()})),N=(0,E.useCallback)((function(e,t){var n,r=t,i=e;if(!oZ(e)){e.persist&&e.persist();var o=e.target?e.target:e.currentTarget,a=o.type,s=o.name,l=o.id,c=o.value,u=o.checked,f=(o.outerHTML,o.options),d=o.multiple;r=t||s||l,i=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,i=(o=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}(lZ(w.values,r),u,c):f&&d?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):c}r&&B(r,i)}),[B,w.values]),z=gZ((function(e){if(oZ(e))return function(t){return N(t,e)};N(e)})),V=gZ((function(e,t,n){return void 0===t&&(t=!0),S({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?i:n)?T(w.values):Promise.resolve()})),U=(0,E.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,o=(n.outerHTML,t||r||i);V(o,!0)}),[V]),H=gZ((function(e){if(oZ(e))return function(t){return U(t,e)};U(e)})),G=(0,E.useCallback)((function(e){nZ(e)?S({type:"SET_FORMIK_STATE",payload:e}):S({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),W=(0,E.useCallback)((function(e){S({type:"SET_STATUS",payload:e})}),[]),q=(0,E.useCallback)((function(e){S({type:"SET_ISSUBMITTING",payload:e})}),[]),$=gZ((function(){return S({type:"SUBMIT_ATTEMPT"}),T().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Q()))return}catch(e){throw e}return Promise.resolve(n).then((function(e){return v.current&&S({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(v.current)throw S({type:"SUBMIT_FAILURE"}),e}))}if(v.current&&(S({type:"SUBMIT_FAILURE"}),t))throw e}))})),Z=gZ((function(e){e&&e.preventDefault&&nZ(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&nZ(e.stopPropagation)&&e.stopPropagation(),$().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:A,validateForm:T,validateField:j,setErrors:R,setFieldError:L,setFieldTouched:V,setFieldValue:B,setStatus:W,setSubmitting:q,setTouched:D,setValues:F,setFormikState:G,submitForm:$},Q=gZ((function(){return u(w.values,Y)})),K=gZ((function(e){e&&e.preventDefault&&nZ(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&nZ(e.stopPropagation)&&e.stopPropagation(),A()})),X=(0,E.useCallback)((function(e){return{value:lZ(w.values,e),error:lZ(w.errors,e),touched:!!lZ(w.touched,e),initialValue:lZ(p.current,e),initialTouched:!!lZ(y.current,e),initialError:lZ(h.current,e)}}),[w.errors,w.touched,w.values]),J=(0,E.useCallback)((function(e){return{setValue:function(t,n){return B(e,t,n)},setTouched:function(t,n){return V(e,t,n)},setError:function(t){return L(e,t)}}}),[B,V,L]),ee=(0,E.useCallback)((function(e){var t=rZ(e),n=t?e.name:e,r=lZ(w.values,n),i={name:n,value:r,onChange:z,onBlur:H};if(t){var o=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===s&&l&&(i.value=i.value||[],i.multiple=!0)}return i}),[H,z,w.values]),te=(0,E.useMemo)((function(){return!$$()(p.current,w.values)}),[p.current,w.values]),ne=(0,E.useMemo)((function(){return void 0!==s?te?w.errors&&0===Object.keys(w.errors).length:!1!==s&&nZ(s)?s(d):s:w.errors&&0===Object.keys(w.errors).length}),[s,te,w.errors,d]);return Y$({},w,{initialValues:p.current,initialErrors:h.current,initialTouched:y.current,initialStatus:m.current,handleBlur:H,handleChange:z,handleReset:K,handleSubmit:Z,resetForm:A,setErrors:R,setFormikState:G,setFieldTouched:V,setFieldValue:B,setFieldError:L,setStatus:W,setSubmitting:q,setTouched:D,setValues:F,submitForm:$,validateForm:T,validateField:j,isValid:ne,dirty:te,unregisterField:M,registerField:I,getFieldProps:ee,getFieldMeta:X,getFieldHelpers:J,validateOnBlur:i,validateOnChange:n,validateOnMount:a})}function hZ(e){var t=pZ(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return(0,E.useImperativeHandle)(o,(function(){return t})),(0,E.createElement)(J$,{value:t},n?(0,E.createElement)(n,t):i?i(t):r?nZ(r)?r(t):aZ(r)?null:E.Children.only(r):null)}function yZ(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||CS(e)?yZ(e):""!==e?e:void 0})):CS(e[r])?t[r]=yZ(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function mZ(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var o=!1!==n.clone&&n.isMergeableObject(t);r[i]=o?W$(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=W$(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var vZ="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect;function gZ(e){var t=(0,E.useRef)(e);return vZ((function(){t.current=e})),(0,E.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function xZ(e){var t=e.validate,n=e.name,r=e.render,i=e.children,o=e.as,a=e.component,s=e.className,l=Q$(e,["validate","name","render","children","as","component","className"]),c=Q$(eZ(),["validate","validationSchema"]),u=c.registerField,f=c.unregisterField;(0,E.useEffect)((function(){return u(n,{validate:t}),function(){f(n)}}),[u,f,n,t]);var d=c.getFieldProps(Y$({name:n},l)),p=c.getFieldMeta(n),h={field:d,form:c};if(r)return r(Y$({},h,{meta:p}));if(nZ(i))return i(Y$({},h,{meta:p}));if(a){if("string"==typeof a){var y=l.innerRef,m=Q$(l,["innerRef"]);return(0,E.createElement)(a,Y$({ref:y},d,m,{className:s}),i)}return(0,E.createElement)(a,Y$({field:d,form:c},l,{className:s}),i)}var v=o||"input";if("string"==typeof v){var g=l.innerRef,x=Q$(l,["innerRef"]);return(0,E.createElement)(v,Y$({ref:g},d,x,{className:s}),i)}return(0,E.createElement)(v,Y$({},d,l,{className:s}),i)}var bZ=(0,E.forwardRef)((function(e,t){var n=e.action,r=Q$(e,["action"]),i=null!=n?n:"#",o=eZ(),a=o.handleReset,s=o.handleSubmit;return(0,E.createElement)("form",Y$({onSubmit:s,ref:t,onReset:a,action:i},r))}));bZ.displayName="Form";var wZ=function(e,t,n){var r=SZ(e);return r.splice(t,0,n),r},SZ=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Y$({},e,{length:t+1}))}return[]},CZ=function(e,t){var n="function"==typeof e?e:t;return function(e){if(Array.isArray(e)||rZ(e)){var t=SZ(e);return n(t)}return e}},EZ=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,o=i.name;(0,i.formik.setFormikState)((function(n){var i=CZ(r,e),a=CZ(t,e),s=cZ(n.values,o,e(lZ(n.values,o))),l=r?i(lZ(n.errors,o)):void 0,c=t?a(lZ(n.touched,o)):void 0;return tZ(l)&&(l=void 0),tZ(c)&&(c=void 0),Y$({},n,{values:s,errors:r?cZ(n.errors,o,l):n.errors,touched:t?cZ(n.touched,o,c):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(SZ(t),[lS(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=SZ(e),i=r[t];return r[t]=r[n],r[n]=i,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=SZ(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return wZ(n,e,t)}),(function(t){return wZ(t,e,null)}),(function(t){return wZ(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=SZ(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t=r.length,r}),(function(e){return e?[null].concat(e):[null]}),(function(e){return e?[null].concat(e):[null]})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(K$(n)),n.pop=n.pop.bind(K$(n)),n}var n,r;r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var i=t.prototype;return i.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!$$()(lZ(e.formik.values,e.name),lZ(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},i.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?SZ(n):[];return t||(t=r[e]),nZ(r.splice)&&r.splice(e,1),nZ(r.every)&&r.every((function(e){return void 0===e}))?[]:r}),!0,!0),t},i.pop=function(){var e;return this.updateArrayField((function(t){var n=t.slice();return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},i.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,o=t.name,a=Y$({},e,{form:Q$(t.formik,["validate","validationSchema"]),name:o});return n?(0,E.createElement)(n,a):r?r(a):i?"function"==typeof i?i(a):aZ(i)?null:E.Children.only(i):null},t}(E.Component);EZ.defaultProps={validateOnChange:!0};var kZ,_Z,OZ,PZ,TZ,AZ,jZ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},IZ=function(){return IZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},IZ.apply(this,arguments)},MZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},DZ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},RZ=tt.div(kZ||(kZ=jZ(["\n width: auto;\n margin-top: 8px;\n .error {\n border-color: #e84c3d;\n }\n .disabled {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n\n .disabled > div {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n"],["\n width: auto;\n margin-top: 8px;\n .error {\n border-color: #e84c3d;\n }\n .disabled {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n\n .disabled > div {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n"]))),FZ=tt.div(_Z||(_Z=jZ(["\n margin: 24px 0;\n display: flex;\n flex-direction: column;\n"],["\n margin: 24px 0;\n display: flex;\n flex-direction: column;\n"]))),LZ=tt.div(OZ||(OZ=jZ(["\n height: 20px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: normal;\n color: ",";\n margin-bottom: 8px;\n"],["\n height: 20px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: normal;\n color: ",";\n margin-bottom: 8px;\n"])),Gi),BZ=tt.input(PZ||(PZ=jZ(["\n padding-left: 8px;\n height: 40px;\n width: 100%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n margin-right: 8px;\n box-sizing: border-box;\n &:focus {\n outline: 0;\n }\n"],["\n padding-left: 8px;\n height: 40px;\n width: 100%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n margin-right: 8px;\n box-sizing: border-box;\n &:focus {\n outline: 0;\n }\n"])),pi),NZ=tt.textarea(AZ||(AZ=jZ(["\n padding-left: 8px;\n width: 242px;\n min-width: 242px;\n max-width: 242px;\n height: 100px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: 0;\n }\n ","\n"],["\n padding-left: 8px;\n width: 242px;\n min-width: 242px;\n max-width: 242px;\n height: 100px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: 0;\n }\n ","\n"])),(function(e){return e.theme.containerWidth>=ii&&Ne(TZ||(TZ=jZ(["\n width: 368px;\n min-width: 368px;\n max-width: 368px;\n "],["\n width: 368px;\n min-width: 368px;\n max-width: 368px;\n "])))})),zZ=function(e){var n=e.attributes,r=e.initValues,i=e.setIsSaveDisabled,o=Nl().userData,a=Xl(o),s=Jl(o),l=ec(o),c=function(e){var t=e.customer,n=e.automotiveRole;return"1"===t.automotiveAccess&&n===Dl.TECHNICIAN}(o),u=MZ(E.useState(),2),f=u[0],d=u[1],p=eZ(),h=p.errors,y=p.validateForm,m=p.setFieldValue;E.useEffect((function(){y(),v()}),[n]),E.useEffect((function(){0!==(null==f?void 0:f.length)?i(!0):i(!1)}),[f]);var v=function(){var e=0,t=[];return n.forEach((function(n){n&&n.isRequired&&(""===n.default||null===n.default)&&(++e,t.push(n))})),d(t),l&&c&&(e+=1),s&&c&&(e+=2),e},g=function(e,t){if(""!==e&&t.isRequired){var n=f.find((function(e){return e.attributeId===t.attributeId}));n&&d(f.filter((function(e){return e.attributeId!==t.attributeId})))}""===e&&t.isRequired&&!(n=f.find((function(e){return e.attributeId===t.attributeId})))&&d(DZ(DZ([],MZ(f),!1),[t],!1))};return a||n.length?(0,t.jsx)(RZ,{children:n.map((function(e,n){var i=!(!e.isReadOnly&&!e.isLocked||!r[n]),o=!!h["attributes".concat(n)],a=!!e.isRequired,s="";return i&&(s="disabled"),o&&(s+=" error"),(0,t.jsxs)(FZ,{children:[(0,t.jsxs)(LZ,{children:[e.title,a&&(0,t.jsx)("span",IZ({style:{color:Qi}},{children:"*"}))]}),"text"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(xZ,{name:"attributes".concat(n),disabled:i,as:BZ,type:"text",required:a,className:s,defaultValue:e.default,onChange:function(t){g(t.target.value,e),m("attributes".concat(n),t.target.value)},onFocus:function(){y()}}),o?(0,t.jsx)("div",IZ({style:{color:"#E84C3D",marginTop:"3px"}},{children:h["attributes".concat(n)]})):(0,t.jsx)(t.Fragment,{})]}),"textarea"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(xZ,{disabled:i,name:"attributes".concat(n),as:NZ,defaultValue:e.default,className:s,required:a,type:"text",onChange:function(t){g(t.target.value,e),m("attributes".concat(n),t.target.value)}}),o?(0,t.jsx)("div",IZ({style:{color:"#E84C3D",marginTop:"3px"}},{children:h["attributes".concat(n)]})):(0,t.jsx)(t.Fragment,{})]}),"dropdown"===e.type&&(0,t.jsx)(xZ,IZ({name:"attributes".concat(n),disabled:i,required:a,className:s},{children:function(o){var a=o.field,s=o.form,l=a.value,c=e.dropdownValues.map((function(e){return{value:e.value,label:e.value}}));return(0,t.jsx)(bl,{isSearchable:!0,disabled:i,maxMenuHeight:100,options:c,defaultValue:c.find((function(t){return t.value===e.default}))||"",value:c.find((function(e){return e.value==l})),onChange:function(t){g(t.value,e),(e.isReadOnly||e.isLocked)&&r[n]?s.setFieldValue("attributes".concat(n),r[n]):s.setFieldValue("attributes".concat(n),t.value)}})}}))]},n)}))}):null},VZ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},UZ=function(){return UZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},UZ.apply(this,arguments)},HZ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},GZ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},WZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},qZ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},$Z=tt.div(lY||(lY=VZ(["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n ","\n"],["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(sY||(sY=VZ(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),ZZ=tt.div(fY||(fY=VZ(["\n box-sizing: border-box;\n width: 100%;\n ","\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n ","\n"])),(function(e){return e.theme.containerWidth>=ni&&Ne(cY||(cY=VZ(["\n width: 50%;\n "],["\n width: 50%;\n "])))}),(function(e){return e.theme.containerWidth<ni&&Ne(uY||(uY=VZ(["\n margin-top: 8px;\n "],["\n margin-top: 8px;\n "])))})),YZ=tt.div(pY||(pY=VZ(["\n box-sizing: border-box;\n width: 100%;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n"])),(function(e){return e.theme.containerWidth>=ni&&Ne(dY||(dY=VZ(["\n padding-right: 52px;\n width: 50%;\n "],["\n padding-right: 52px;\n width: 50%;\n "])))})),QZ=tt.div(hY||(hY=VZ(["\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n margin-bottom: 32px;\n"],["\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n margin-bottom: 32px;\n"]))),KZ=tt.div(yY||(yY=VZ(["\n margin-bottom: ",";\n display: grid;\n gap: 8px;\n"],["\n margin-bottom: ",";\n display: grid;\n gap: 8px;\n"])),(function(e){return e.marginBottom||"16px"})),XZ=tt.div(mY||(mY=VZ(["\n background-color: ",";\n padding: 18px;\n display: flex;\n align-items: center;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n margin-top: -7px;\n"],["\n background-color: ",";\n padding: 18px;\n display: flex;\n align-items: center;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n margin-top: -7px;\n"])),di),JZ=tt.div(vY||(vY=VZ(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),eY=tt.div(gY||(gY=VZ(["\n color: ",";\n"],["\n color: ",";\n"])),Ni),tY=tt.div(xY||(xY=VZ(["\n font-weight: 600;\n color: ",";\n display: flex;\n align-items: center;\n"],["\n font-weight: 600;\n color: ",";\n display: flex;\n align-items: center;\n"])),Bi),nY=tt.div(bY||(bY=VZ(["\n display: flex;\n flex-wrap: wrap;\n"],["\n display: flex;\n flex-wrap: wrap;\n"]))),rY="Search tags or create new...",iY=[0,0],oY=function(e){e.children;var n,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]),i=r.data.label,o=!(null===(n=r.data)||void 0===n?void 0:n.__isNew__);return(0,t.jsx)(Ss.Option,UZ({},r,{children:(0,t.jsxs)(tY,{children:[o&&(0,t.jsx)(f$,{style:{marginRight:"8px"},width:15,height:15,color:Ni}),i]})}))};const aY=function(e){var n=e.recordingBlobUrl,r=e.recordDate,i=e.setSaveFunction,o=e.insertAfterSave,a=void 0!==o&&o,s=e.setIsSaveDisabled,l=e.skipUploadProcess,c=void 0!==l&&l,u=e.videoId,f=e.initialTitle,d=e.updateUploadLoading,p=Nl().userData,h=(Mt().showTrimFeature,(0,E.useMemo)((function(){return Ct(p,iq)}),[p,iq])),y=ec(p),m=Jl(p),v=(0,E.createRef)(),g=WZ((0,E.useState)(f||r),2),x=g[0],b=g[1],w=WZ((0,E.useState)([]),2),S=w[0],C=w[1],k=WZ((0,E.useState)({value:"",label:"Select vehicle"}),2),_=k[0],O=k[1],P=WZ((0,E.useState)({value:"",label:"Select video type"}),2),T=P[0],A=P[1],j=WZ((0,E.useState)([]),2),I=j[0],M=j[1],D=WZ((0,E.useState)(),2),R=D[0],F=D[1],L=WZ((0,E.useState)([]),2),B=L[0],N=L[1],z=WZ((0,E.useState)([]),2),V=z[0],U=z[1],H=WZ((0,E.useState)({value:"",label:rY}),2),G=H[0],W=H[1],q=WZ((0,E.useState)(!1),2),$=q[0],Z=q[1],Y=WZ((0,E.useState)(!1),2),Q=Y[0],K=Y[1],X=WZ((0,E.useState)({title:"",tags:""}),2),J=X[0],ee=X[1],te=WZ((0,E.useState)(),2),ne=te[0],re=te[1],ie=WZ((0,E.useState)(0),2),oe=ie[0],ae=ie[1],se=WZ((0,E.useState)({}),2),le=se[0],ce=se[1],ue=WZ((0,E.useState)(!0),2),fe=(ue[0],ue[1]),de=((0,E.useRef)([0,0]),WZ((0,E.useState)(iY),2)),pe=de[0],he=de[1],ye=WZ((0,E.useState)(!1),2),me=ye[0],ve=ye[1],ge=WZ((0,E.useState)(u||""),2),xe=ge[0],be=ge[1],we=WZ((0,E.useState)(),2),Se=we[0],Ce=we[1],Ee=dn(),ke=(0,E.useRef)(null),_e=Ju().toast,Oe=Object.values(y?rF:iF).map((function(e){return{value:e,label:e||"No video type"}})),Pe={};Pe.covideoName=x,Pe.saveToCompanyFolder=!1;var Te=function(){var e,t=ke.current.values;ce(t),Z(!1),e={title:"",tags:""},x&&x.length||(e.title="Title cannot be empty."),ee(e),Object.values(e).every((function(e){return""===e}))&&(null==d||d(!0),c?Ie(t):K(!0))},Ae=function(e){return e.sort((function(e,t){var n;return null===(n=e.labelField)||void 0===n?void 0:n.localeCompare(t.labelField)}))},je=function(e){return HZ(void 0,void 0,void 0,(function(){var t,n;return GZ(this,(function(r){switch(r.label){case 0:return t=e||le,(n=I.map((function(e,n){return{attributeId:e.attributeId,value:t["attributes".concat(n)]||"",videoId:parseInt(xe)}})))&&n.length?[4,Cr(xe,n).catch((function(e){return e}))]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},Ie=function(e){return HZ(void 0,void 0,void 0,(function(){var t;return GZ(this,(function(n){switch(n.label){case 0:return n.trys.push([0,9,,10]),V.length?[4,HZ(void 0,void 0,void 0,(function(){var e;return GZ(this,(function(t){switch(t.label){case 0:return e=V.map((function(e){return{value:e.value,label:e.labelField,__isNew__:e.__isNew__}})),[4,o$(xe,e)];case 1:return t.sent(),[2]}}))}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,je(e)];case 3:return n.sent(),[4,HZ(void 0,void 0,void 0,(function(){var e;return GZ(this,(function(t){switch(t.label){case 0:return Xl(p)?(e=UZ({videoId:parseInt(xe),videoType:(null==T?void 0:T.value)||""},!!y&&{vin:(null==_?void 0:_.value)||""}),[4,or({data:e})]):[2,0];case 1:return[2,t.sent().videoRequestId]}}))}))];case 4:return n.sent(),me?[4,Me(xe)]:[3,6];case 5:(t=n.sent())&&be(t.id),n.label=6;case 6:return f&&u&&f!==x?[4,$n({videoId:u,videoBody:{title:x}})]:[3,8];case 7:n.sent(),n.label=8;case 8:return Z(!0),_e({message:"Successfully saved video!"}),[3,10];case 9:return n.sent(),_e({message:"There was an error while creating your video request. Please try again."}),[3,10];case 10:return[2]}}))}))},Me=function(e){return HZ(void 0,void 0,void 0,(function(){var t,n;return GZ(this,(function(r){switch(r.label){case 0:t=Math.floor(100*pe[0])/100,n=Math.floor(100*pe[1])/100,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Zn(e,{duration:n,start:t})];case 2:return[2,r.sent()];case 3:return r.sent(),_e({message:"Something went wrong while trimming the video, try again later!"}),[3,4];case 4:return[2]}}))}))};return(0,E.useEffect)((function(){HZ(void 0,void 0,void 0,(function(){return GZ(this,(function(e){switch(e.label){case 0:return[4,HZ(void 0,void 0,void 0,(function(){var e,t,n;return GZ(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Sr({})];case 1:return e=r.sent(),M(e.attributes||[]),t=e.attributes.map((function(e,t){if("dropdown"===e.type){var n=e.dropdownValues.find((function(e){return e.default}));return n&&n.value?(Pe["attributes".concat(t)]=n.value,n.value):(Pe["attributes".concat(t)]="","")}return Pe["attributes".concat(t)]=e.default||"",e.default||""})),ke.current.values=Pe,Ce(Pe),F(t),[3,3];case 2:return n=r.sent(),console.log(n),[3,3];case 3:return[2]}}))}))];case 1:return e.sent(),[4,HZ(void 0,void 0,void 0,(function(){var e,t,n,r;return GZ(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,i$({})];case 1:return e=i.sent(),t=[],e.forEach((function(e){t.push({label:e.tag,value:e.tagId,labelField:e.tag})})),n=Ae(t),N(n),[3,3];case 2:return r=i.sent(),console.log(r),[3,3];case 3:return[2]}}))}))];case 2:return e.sent(),[4,HZ(void 0,void 0,void 0,(function(){var e,n,r;return GZ(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,er({})];case 1:return(e=i.sent()).items&&(n=[],e.items.forEach((function(e){n.push({label:(0,t.jsxs)(JZ,{children:[(0,t.jsxs)(tY,{children:[(0,t.jsx)(s$,{style:{marginRight:"8px"},width:15,height:15,color:Ni}),e.title]}),(0,t.jsx)(eY,{children:e.vin})]}),value:e.vin,labelField:e.vin})})),C(n)),[3,3];case 2:return r=i.sent(),console.log(r),[3,3];case 3:return[2]}}))}))];case 3:return e.sent(),[2]}}))}))}),[]),(0,E.useEffect)((function(){var e;n&&(e=n,HZ(void 0,void 0,void 0,(function(){var t,n;return GZ(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,fetch(e||"").then((function(e){return e.blob()}))];case 1:return t=r.sent(),re(t),[3,3];case 2:return n=r.sent(),console.log(n),[3,3];case 3:return[2]}}))})))}),[n]),(0,E.useEffect)((function(){$&&setTimeout((function(){null==d||d(!1),a&&xe?Ee.push("/insert-video/".concat(xe)):Ee.push("/")}),400)}),[$,xe]),(0,E.useEffect)((function(){he([0,oe])}),[oe]),(0,E.useEffect)((function(){var e=kt({trimStart:pe[0],trimEnd:pe[1],videoDuration:oe});return ve(e),function(){ve(!1)}}),[pe,oe]),(0,E.useEffect)((function(){s(""===x)}),[x]),(0,E.useEffect)((function(){i&&i((function(){return Te}))}),[x,pe,oe,_,me]),(0,t.jsxs)("div",{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){u&&HZ(void 0,void 0,void 0,(function(){return GZ(this,(function(e){switch(e.label){case 0:return u?[4,qn({videoIds:[u],deleteMultiple:!1})]:[2];case 1:return e.sent(),[2]}}))})),Ee.push(e)},shouldBlockNavigation:function(){return!$},title:"Delete Current Video?",text:"Do you want to go back? The current video will be deleted.",confirmButtonText:"No, Keep Video",discardButtonText:"Yes, Delete Video",showDiscardIcon:!1,showSaveIcon:!1}),Q?(0,t.jsx)(I$,{title:x,beginUploadProcess:Q,afterUpload:Ie,setSavedVideoId:be,file:ne,fileName:h}):(0,t.jsxs)($Z,{children:[(0,t.jsxs)(YZ,{children:[(0,t.jsxs)(QZ,{children:[(0,t.jsx)(FU,{id:"",videoSource:n,videoRef:v,preventWideSize:!0,borderBottomRadius:"0px",setVideoDuration:ae,setIsVideoLoading:fe}),(0,t.jsxs)(XZ,{children:[(0,t.jsx)(iT,{size:16,color:ki,style:{marginRight:6}}),(0,t.jsx)("div",{children:Et()})]})]}),!1]}),(0,t.jsx)(ZZ,{children:(0,t.jsx)(hZ,UZ({enableReinitialize:!0,innerRef:ke,initialValues:Se,validateOnMount:!0,onSubmit:function(){}},{children:function(e){return e.errors,e.isValid,e.values,e.setFieldValue,(0,t.jsxs)(bZ,{children:[(0,t.jsxs)(KZ,{children:[(0,t.jsx)(sz,{text:"Title"}),!!J.title&&(0,t.jsx)(sz,{text:J.title,color:Ri}),(0,t.jsx)(lo,UZ({type:"text",onChange:function(e){return b(e.target.value)},value:x},J.title&&{borderColor:Ri}))]}),(0,t.jsxs)(KZ,UZ({marginBottom:"8px"},{children:[(0,t.jsx)(sz,{text:"Tags"}),!!J.tags&&(0,t.jsx)(sz,{text:J.tags,color:Ri}),(0,t.jsx)(bl,{options:B.filter((function(e){return!e||!V.length||!V.some((function(t){return t.value===e.value}))})),placeholder:rY,controlShouldRenderValue:!1,value:G,onChange:function(e){return function(e){if(e&&e.value){var t=B.some((function(t){return t.value==e.value})),n=t?e:{value:e.value,label:e.label,labelField:e.label,__isNew__:!0},r=V.find((function(e){return e.value===n.value}));r||U(qZ(qZ([],WZ(V),!1),[n],!1)),t||N(Ae(qZ(qZ([],WZ(B),!1),[n],!1))),W(n)}}(e)},isSearchable:!0,creatable:!0,extraStyles:UZ({},J.tags&&{borderColor:Ri}),customComponents:{Option:oY}}),(0,t.jsx)(nY,{children:V.map((function(e,n){return(0,t.jsx)(yo,{icon:(0,t.jsx)(f$,{width:15,height:15,color:Ni}),text:e.label,padding:"5px",height:"24px",onClick:function(){return function(e,t){var n=qZ([],WZ(V),!1);if(n.splice(t,1),U(n),W({value:"",label:rY}),G.__isNew__){var r=qZ([],WZ(B),!1),i=B.findIndex((function(t){return t.value===e.value}));i>-1&&(r.splice(i,1),N(r))}}(e,n)}},e.value)}))})]})),y&&(0,t.jsxs)(KZ,{children:[(0,t.jsx)(sz,{text:"VIN / search vehicle"}),(0,t.jsx)(bl,{options:S,value:_,onChange:function(e){return O(e)},isSearchable:!0,isClearable:!!(null==_?void 0:_.value)})]}),(m||y)&&(0,t.jsxs)(KZ,UZ({marginBottom:"8px"},{children:[(0,t.jsx)(sz,{text:"Video Type"}),(0,t.jsx)(bl,{options:Oe,value:T,onChange:function(e){return A(e)},isSearchable:!0,isClearable:!!(null==T?void 0:T.value)})]})),(0,t.jsx)(zZ,{attributes:I||[],initValues:R,setIsSaveDisabled:s})]})}}))})]})]})};var sY,lY,cY,uY,fY,dY,pY,hY,yY,mY,vY,gY,xY,bY,wY,SY,CY,EY,kY,_Y,OY,PY,TY,AY,jY,IY,MY,DY,RY,FY,LY,BY,NY,zY,VY,UY,HY,GY,WY,qY,$Y,ZY,YY,QY,KY,XY,JY=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},eQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},tQ=tt.div(wY||(wY=JY(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),nQ=tt.div(SY||(SY=JY(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),rQ=function(e){var n=e.loading,r=void 0!==n&&n,i=Mt().showInsertFeature,o=dn(),a=eQ((0,E.useState)(Et()),2),s=a[0],l=a[1],c=eQ((0,E.useState)(!1),2),u=c[0],f=c[1],d=eQ(E.useState(""),2),p=d[0],h=d[1],y=eQ((0,E.useState)(),2),m=y[0],v=y[1],g=eQ((0,E.useState)(!1),2),x=g[0],b=g[1],w=eQ((0,E.useState)(!1),2),S=w[0],C=w[1],k=eQ((0,E.useState)(!1),2),_=k[0],O=k[1],P=!r&&!!p;return(0,t.jsxs)(tQ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return o.push("/record/home")}}),center:(0,t.jsx)(nQ,{children:P?"":"Record Video"}),right:P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){return null==m?void 0:m()},text:"Save",disabled:S||_,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:_?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),i&&(0,t.jsx)(yo,{onClick:function(){b(!0),null==m||m()},text:"Continue to Insert",disabled:S||_,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(Eo,{isLoading:r}),P&&(0,t.jsx)(aY,{recordingBlobUrl:p,recordDate:s,setSaveFunction:v,insertAfterSave:x,setIsSaveDisabled:C,updateUploadLoading:function(e){return O(e)}}),!r&&!p&&(0,t.jsx)(so,{children:!u&&(0,t.jsx)(Xq,{onUpload:function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){return l(e.covideoName),f(!0),h(""),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},uploadDisabled:!s,onRecordingUrlGeneration:function(e){h(e)}})})]})]})},iQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},oQ=function(){return oQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oQ.apply(this,arguments)},aQ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},sQ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},lQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},cQ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},uQ=tt.div(CY||(CY=iQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: auto;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n margin-left: auto;\n margin-right: auto;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: auto;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n margin-left: auto;\n margin-right: auto;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"])),qi,di,$i),fQ=tt.div(EY||(EY=iQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"])),(function(e){return e.theme.primaryColor}),di,(function(e){return e.theme.primaryColor})),dQ=tt.div(kY||(kY=iQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),pQ=tt.div(_Y||(_Y=iQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),hQ=tt.div(OY||(OY=iQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),qi,di,$i),yQ=tt.div(PY||(PY=iQ(["\n margin-left: 5%;\n margin-top: 5%;\n"],["\n margin-left: 5%;\n margin-top: 5%;\n"]))),mQ=tt.div(AY||(AY=iQ(["\n display: flex;\n flex-direction: row;\n width: 770px;\n max-width: 100%;\n z-index: 9;\n margin-top: 32px;\n ","\n"],["\n display: flex;\n flex-direction: row;\n width: 770px;\n max-width: 100%;\n z-index: 9;\n margin-top: 32px;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(TY||(TY=iQ(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),vQ=tt.div(jY||(jY=iQ(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n"]))),gQ=tt.div(IY||(IY=iQ(["\n width: 150px;\n display: flex;\n flex-direction: row;\n"],["\n width: 150px;\n display: flex;\n flex-direction: row;\n"]))),xQ=tt.div(MY||(MY=iQ(["\n position: absolute;\n top: 0;\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: ",";\n justify-content: center;\n"],["\n position: absolute;\n top: 0;\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: ",";\n justify-content: center;\n"])),(function(e){return e.show?"flex":"none"})),bQ={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},wQ={videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}},SQ="undefined"!=typeof InstallTrigger,CQ=null,EQ=function(e){var n,r=e.onRecordingStart,i=e.onRecordingEnd,o=e.uploadDisabled,a=e.virtualBackgroundUrl,s=void 0===a?null:a,l=e.showRecordingButton,c=void 0===l||l,u=e.onRecordingUrlGeneration,f=dn(),d=E.useRef(null),p=(0,E.useRef)(null),h=(0,E.useRef)(null),y=lQ((0,E.useState)(3),2),v=y[0],g=y[1],x=lQ((0,E.useState)(!1),2),b=x[0],w=x[1],S=lQ((0,E.useState)(!1),2),C=S[0],k=S[1],_=lQ((0,E.useState)(0),2),O=_[0],P=_[1],T={videoSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(wQ)).videoSource,videoQuality:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(wQ)).videoQuality,audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(wQ)).audioSource},A=lQ(E.useState(!!s),2),j=A[0],I=A[1],M=Nl().userData,D=lQ(E.useState(!1),2),R=D[0],F=D[1];try{n={deviceId:T.audioSource.value}}catch(e){}T&&T.audioSource&&T.audioSource.value||(n=!1);var L=T&&T.videoQuality&&T.videoQuality.value?bQ[T.videoQuality]:bQ.standard,B=sq({video:oQ(oQ({},L),{frameRate:24,deviceId:T.videoSource&&T.videoSource.value}),audio:n,quality:T.videoQuality,blobPropertyBag:{type:nq},mimeType:nq}),N=B.status,z=B.startRecording,V=B.startRecordingForCanvas,U=B.stopRecording,H=B.pauseRecording,G=B.resumeRecording,W=B.mediaBlobUrl,q=B.previewStream,$=B.error;E.useEffect((function(){return localStorage.setItem(m.recordError,""),T.videoSource&&T.videoSource.value||(localStorage.setItem(m.recordError,"No camera detected. Please check your recording settings and make sure the camera is plugged in."),f.push("/record/home")),function(){ee()}}),[]),(0,E.useEffect)((function(){b||p&&p.current&&q&&(p.current.srcObject=q)}),[q,p]),(0,E.useEffect)((function(){b||(q&&""!==s&&null!=s&&!W?I(!0):s&&!W||(I(!1),h.current=null))}),[s,q,W]),(0,E.useEffect)((function(){var e=dq((function(){!b||C||v||P(O+1)}),1e3);return function(){fq(e)}})),(0,E.useEffect)((function(){var e,t,n,r,i;M&&M.authCalled&&(null===(e=M.user)||void 0===e?void 0:e.packageDetails)&&(null===(n=null===(t=M.user)||void 0===t?void 0:t.packageDetails)||void 0===n?void 0:n.maxLength)&&O>=(null===(i=null===(r=M.user)||void 0===r?void 0:r.packageDetails)||void 0===i?void 0:i.maxLength)&&Q()}),[O,M,M.authCalled]);var Z=function(){b&&v>0&&(clearTimeout(CQ),w(!1),g(3))},Y=function(){w(!0)},Q=function(){i&&i(),w(!1),U();try{cQ([],lQ(window.streams),!1).filter(Boolean).forEach((function(e){return te(e)})),window.streams=[]}catch(e){}},K=function(){H(),k(!0)},X=function(){G(),k(!1)};E.useEffect((function(){("permission_denied"===$||SQ&&void 0===$)&&f.push("/record/home")}),[$]),E.useEffect((function(){if(v>0&&b)CQ=setTimeout((function(){return g(v-1)}),1e3);else if(b)if(r&&r(),s&&j)try{V(d.current.captureStream(30)),window.Intercom&&window.Intercom("trackEvent","virtual-background-used")}catch(e){console.log("EXCEPTION :: ",e),z()}else z()}),[b,v]),E.useEffect((function(){s&&!R&&p.current&&q&&(p.current.srcObject=q,J())}),[s,R,p,q]),E.useEffect((function(){W&&u(W)}),[W]);var J=function(){return aQ(void 0,void 0,void 0,(function(){var e;return sQ(this,(function(t){return F(!0),(e=null==q?void 0:q.getVideoTracks()[0])&&e.getSettings().width&&"live"===e.readyState?(setTimeout((function(){return aQ(void 0,void 0,void 0,(function(){return sQ(this,(function(e){try{p.current.requestVideoFrameCallback(ne)}catch(e){p.current.requestVideoFrameCallback(ne)}return[2]}))}))}),250),[2]):(J(),[2])}))}))};E.useEffect((function(){return function(){ee()}}),[]);var ee=function(){cQ([],lQ(window.streams),!1).filter(Boolean).forEach((function(e){return te(e)})),window.streams=[],w(!1),CQ&&clearTimeout(CQ)},te=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}},ne=function(e,t){return aQ(void 0,void 0,void 0,(function(){return sQ(this,(function(e){return p&&p.current?(p.current.requestVideoFrameCallback(ne),[2,!0]):[2]}))}))},re=E.useMemo((function(){return(0,t.jsxs)(t.Fragment,{children:[!W&&q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{hidden:j,ref:p,width:770,style:{maxWidth:"100%"},height:434,autoPlay:!0}),(0,t.jsx)("canvas",{ref:d,hidden:!j,width:770,style:{maxWidth:"100%"},height:434})]}),c?(0,t.jsxs)(mQ,{children:["recording"===N&&(0,t.jsxs)(gQ,{children:[!C&&(0,t.jsx)(pQ,oQ({onClick:K},{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(AV,{}),textColor:"#000",text:"Pause",onClick:K})})),C&&(0,t.jsx)(hQ,oQ({onClick:X},{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(Rc,{color:di,size:34}),textColor:"#fff",text:"Resume",onClick:X})})),(0,t.jsx)(yQ,{children:St(O,0)})]}),"recording"===N&&(0,t.jsx)(fQ,{children:(0,t.jsx)(yo,{icon:(0,t.jsx)(NV,{color:di}),backgroundColor:Qi,textColor:di,text:"Finish",onClick:Q})}),b&&"recording"!==N&&(0,t.jsx)(dQ,oQ({onClick:Z},{children:(0,t.jsx)(yo,{backgroundColor:Wi,textColor:"#000",text:"Cancel",onClick:Z})})),!b&&"idle"===N&&(0,t.jsx)(uQ,{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(kW,{width:24,height:24,opacity:1}),text:"Start recording",textColor:"#fff",onClick:Y})}),"stopped"===N&&(0,t.jsx)(t.Fragment,{}),"stopped"===N&&(0,t.jsx)(t.Fragment,{})]}):null]})}),[N,O,b,C,W,T,o]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){return f.push(e)},shouldBlockNavigation:function(e){return"recording"===N},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,t.jsxs)(vQ,{children:[(0,t.jsx)(xQ,oQ({show:v>0&&b},{children:(0,t.jsx)(Cu,{height:"434px",width:"770px",counter:v,willStart:v>0&&b,onClick:function(){},hide:!v})})),re]})]})},kQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},_Q=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},OQ=tt.div(DY||(DY=kQ(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),PQ=tt.div(RY||(RY=kQ(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),TQ=function(e){var n=e.loading,r=void 0!==n&&n,i=Mt().showInsertFeature,o=dn(),a=_Q((0,E.useState)(Et()),2),s=a[0],l=a[1],c=_Q((0,E.useState)(!1),2),u=c[0],f=c[1],d=_Q(E.useState(""),2),p=d[0],h=d[1],y=_Q((0,E.useState)(),2),m=y[0],v=y[1],g=_Q((0,E.useState)(!1),2),x=g[0],b=g[1],w=_Q((0,E.useState)(!1),2),S=w[0],C=w[1],k=_Q((0,E.useState)(!1),2),_=k[0],O=k[1],P=!r&&!!p;return(0,t.jsxs)(OQ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return o.push("/record/home")}}),center:(0,t.jsx)(PQ,{children:P?"":"Record Video"}),right:P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){return null==m?void 0:m()},text:"Save",disabled:S||_,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:_?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),i&&(0,t.jsx)(yo,{onClick:function(){b(!0),null==m||m()},text:"Continue to Insert",disabled:S||_,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(Eo,{isLoading:r}),P&&(0,t.jsx)(aY,{recordingBlobUrl:p,recordDate:s,setSaveFunction:v,insertAfterSave:x,setIsSaveDisabled:C,updateUploadLoading:function(e){return O(e)}}),!r&&!p&&(0,t.jsxs)("div",{children:[(0,t.jsx)(so,{children:!u&&(0,t.jsx)(EQ,{onUpload:function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){return l(e.covideoName),f(!0),h(""),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},uploadDisabled:!s,onRecordingUrlGeneration:function(e){h(e)}})}),(0,t.jsx)("div",{style:{position:"absolute",bottom:"25px",right:"20px",height:"auto",width:"auto",zIndex:150,cursor:"pointer"}})]})]})]})},AQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},jQ=function(){return jQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jQ.apply(this,arguments)},IQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},MQ=tt.div(FY||(FY=AQ(["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"],["\n margin-left: calc(50% - 82.5px);\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 165px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n padding-left: 0;\n }\n"])),qi,di,$i),DQ=tt.div(LY||(LY=AQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(50% - 48.5px - 150px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n width: 25px;\n opacity: 1;\n }\n .text {\n font-size: 15px;\n }\n"])),di,(function(e){return e.theme.primaryColor})),RQ=tt.div(BY||(BY=AQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n height: 40px;\n width: 166px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n margin-left: calc(100% - 274px);\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),di,(function(e){return e.theme.primaryColor})),FQ=tt.div(NY||(NY=AQ(["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"],["\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 108px;\n border-radius: 4px;\n cursor: pointer;\n opacity: 1;\n transition: width 0.2s ease;\n overflow: hidden;\n font-size: 14px !important;\n font-weight: 600;\n line-height: 1.6;\n &:hover {\n background-color: ",";\n }\n .icon-wrapper {\n margin-right: 0;\n }\n .text {\n font-size: 15px;\n }\n"])),Wi,pi,Zi),LQ=tt.div(zY||(zY=AQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 70px;\n margin-left: calc(50% - 35px);\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),BQ=tt.div(VY||(VY=AQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 97px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),Li,pi,Wi),NQ=tt.div(UY||(UY=AQ(["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"],["\n min-width: 20px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n color: ",";\n height: 40px;\n width: 112px;\n border-radius: 4px;\n cursor: pointer;\n transition: width 0.2s ease;\n overflow: hidden;\n &:hover {\n background-color: ",";\n }\n"])),qi,di,$i),zQ=tt.div(GY||(GY=AQ(["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"],["\n display: flex;\n width: 710px;\n max-width: 100%;\n flex-direction: row;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(HY||(HY=AQ(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),VQ=tt.div(WY||(WY=AQ(["\n width: 150px;\n display: flex;\n flex-direction: row;\n"],["\n width: 150px;\n display: flex;\n flex-direction: row;\n"]))),UQ=tt.div(qY||(qY=AQ(["\n margin-left: 5%;\n margin-top: 5%;\n"],["\n margin-left: 5%;\n margin-top: 5%;\n"]))),HQ=tt.div($Y||($Y=AQ(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n"]))),GQ=tt.div(ZY||(ZY=AQ(["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"],["\n width: 770px;\n height: 434px;\n max-width: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n"]))),WQ="undefined"!=typeof InstallTrigger,qQ=null,$Q={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},ZQ={videoSource:{value:""},videoQuality:"standard",audioSource:{value:"default"}},YQ=0,QQ=navigator.mediaDevices.getDisplayMedia,KQ=E.memo((function(e){var n=e.onRecordingStart,r=e.onRecordingEnd,i=e.onUpload,o=e.uploadDisabled,a=e.onRecordingUrlGeneration;YQ++;var s,l=dn(),c=IQ((0,E.useState)(3),2),u=c[0],f=c[1],d=IQ((0,E.useState)(!1),2),p=d[0],h=d[1],y=IQ((0,E.useState)(!1),2),v=y[0],g=y[1],x=IQ((0,E.useState)(!1),2),b=x[0],w=x[1],S=IQ((0,E.useState)(!1),2),C=S[0],k=S[1],_=IQ((0,E.useState)(0),2),O=_[0],P=_[1],T={videoSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(ZQ)).videoSource,videoQuality:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(ZQ)).videoQuality,audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(ZQ)).audioSource};try{s={deviceId:T.audioSource.value}}catch(e){}T&&T.audioSource&&T.audioSource.value||(s=!1),YQ>1&&(navigator.mediaDevices.getDisplayMedia=function(){});var A=T&&T.videoQuality?$Q[T.videoQuality]:$Q.standard,j=Nl().userData,I=sq({screen:!0,video:jQ(jQ({},A),{frameRate:24}),audio:s,quality:T.videoQuality,blobPropertyBag:{type:nq},mimeType:nq}),M=I.status,D=I.startRecording,R=I.stopRecording,F=I.pauseRecording,L=I.resumeRecording,B=I.mediaBlobUrl,N=I.previewStream,z=I.error;N&&(N.getVideoTracks()[0].onended=function(){"recording"===M?H():l.push("/record/home")}),E.useEffect((function(){B&&a(B)}),[B]),E.useEffect((function(){return localStorage.setItem(m.recordError,""),function(){YQ=0,navigator.mediaDevices.getDisplayMedia=QQ,$()}}),[]),E.useEffect((function(){("permission_denied"===z||WQ&&void 0===z)&&(localStorage.setItem(m.recordError,"Please allow access to share your screen then try again."),YQ=0,navigator.mediaDevices.getDisplayMedia=QQ,l.push("/record/home"))}),[z]),E.useEffect((function(){C||b||!N||B||p||U()}),[N]),E.useEffect((function(){var e=dq((function(){!p||v||u||P(O+1)}),1e3);return function(){fq(e)}})),E.useEffect((function(){var e,t,n,r,i;j&&j.authCalled&&(null===(e=j.user)||void 0===e?void 0:e.packageDetails)&&(null===(n=null===(t=j.user)||void 0===t?void 0:t.packageDetails)||void 0===n?void 0:n.maxLength)&&O>=(null===(i=null===(r=j.user)||void 0===r?void 0:r.packageDetails)||void 0===i?void 0:i.maxLength)&&H()}),[O,j,j.authCalled]);var V=function(){p&&u>0&&(w(!0),clearTimeout(qQ),h(!1),f(3))},U=function(){w(!1),h(!0)},H=function(){k(!0),r&&r(),h(!1),R()},G=function(){F(),g(!0)},W=function(){L(),g(!1)},q=function(){return e=void 0,t=void 0,r=function(){var e;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,fetch(B||"").then((function(e){return e.blob()}))];case 1:return e=t.sent(),$(),i({file:e,fileUrl:B}),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r};E.useEffect((function(){u>0&&p?qQ=setTimeout((function(){return f(u-1)}),1e3):p&&(n&&n(),D())}),[p,u]);var $=function(){(function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([],IQ(window.streams),!1).filter(Boolean).forEach((function(e){return Z(e)})),window.streams=[],h(!1),qQ&&clearTimeout(qQ)},Z=function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}},Y=E.useMemo((function(){return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(zQ,{children:["recording"===M&&(0,t.jsxs)(VQ,{children:[!v&&(0,t.jsx)(BQ,jQ({onClick:G},{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(AV,{}),textColor:"#000",text:"Pause",onClick:G})})),v&&(0,t.jsx)(NQ,jQ({onClick:W},{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(Rc,{color:di,size:34}),textColor:"#fff",text:"Resume",onClick:W})})),(0,t.jsx)(UQ,{children:St(O,0)})]}),"recording"===M&&(0,t.jsx)(DQ,{children:(0,t.jsx)(yo,{backgroundColor:Qi,icon:(0,t.jsx)(NV,{color:di}),textColor:"#fff",text:"Finish",onClick:H})}),p&&"recording"!==M&&(0,t.jsx)(LQ,jQ({onClick:V},{children:(0,t.jsx)(yo,{backgroundColor:Wi,textColor:"#000",text:"Cancel",onClick:V})})),!p&&"idle"===M&&(0,t.jsx)(MQ,{children:(0,t.jsx)(yo,{backgroundColor:qi,icon:(0,t.jsx)(kW,{width:24,height:24,opacity:1}),text:"Start recording",textColor:"#fff",onClick:U})}),"stopped"===M&&(0,t.jsx)(FQ,{children:(0,t.jsx)(yo,{backgroundColor:Wi,icon:(0,t.jsx)(MW,{height:20,width:20,color:pi}),textColor:"#000",text:"Discard",onClick:function(){return l.push("/record/home")}})}),"stopped"===M&&(0,t.jsx)(RQ,{children:(0,t.jsx)(yo,{disabled:o,backgroundColor:Qi,icon:(0,t.jsx)(TW,{height:20,width:20,color:di}),textColor:"#fff",text:"Save Recording",onClick:q})})]})})}),[M,O,p,v,B,o]);return(0,t.jsxs)("div",{children:[(0,t.jsx)(KW,{when:!0,stay:!0,onConfirm:function(){},navigate:function(e){return l.push(e)},shouldBlockNavigation:function(e){return"recording"===M},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,t.jsxs)(HQ,{children:[(0,t.jsx)(GQ,{children:(0,t.jsx)(Cu,{counter:u,willStart:u>0&&p,onClick:function(){},hide:!u})}),Y]})]})})),XQ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},JQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},eK=tt.div(YY||(YY=XQ(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),tK=tt.div(QY||(QY=XQ(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),nK=function(e){var n=e.loading,r=void 0!==n&&n,i=Mt().showInsertFeature,o=dn(),a=JQ((0,E.useState)(Et()),2),s=a[0],l=a[1],c=JQ((0,E.useState)(!1),2),u=c[0],f=c[1],d=JQ(E.useState(""),2),p=d[0],h=d[1],y=JQ((0,E.useState)(),2),m=y[0],v=y[1],g=JQ((0,E.useState)(!1),2),x=g[0],b=g[1],w=JQ((0,E.useState)(!1),2),S=w[0],C=w[1],k=JQ((0,E.useState)(!1),2),_=k[0],O=k[1],P=!r&&!!p;return(0,t.jsxs)(eK,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return o.push("/record/home")}}),center:(0,t.jsx)(tK,{children:P?"":"Record Video"}),right:P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){return null==m?void 0:m()},text:"Save",disabled:S||_,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:_?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),i&&(0,t.jsx)(yo,{onClick:function(){b(!0),null==m||m()},text:"Continue to Insert",disabled:S||_,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})}),(0,t.jsxs)(so,{children:[(0,t.jsx)(Eo,{isLoading:r}),P&&(0,t.jsx)(aY,{recordingBlobUrl:p,recordDate:s,setSaveFunction:v,insertAfterSave:x,setIsSaveDisabled:C,updateUploadLoading:function(e){return O(e)}}),!r&&!p&&(0,t.jsx)(so,{children:!u&&(0,t.jsx)(KQ,{onUpload:function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){return l(e.covideoName),f(!0),h(""),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},uploadDisabled:!s,onRecordingUrlGeneration:function(e){h(e)}})})]})]})},rK=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},iK=function(){return iK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},iK.apply(this,arguments)},oK=tt.div(KY||(KY=rK(["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n gap: 32px;\n margin: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n gap: 32px;\n margin: ",";\n"])),(function(e){return e.margin})),aK=tt.div(XY||(XY=rK(["\n width: ",";\n > video {\n display: block;\n width: 100%;\n border-radius: 4px;\n height: ",";\n object-fit: contain;\n background: ",";\n }\n"],["\n width: ",";\n > video {\n display: block;\n width: 100%;\n border-radius: 4px;\n height: ",";\n object-fit: contain;\n background: ",";\n }\n"])),(function(e){var t=e.width;return"".concat(t,"px")}),(function(e){var t=e.width;return"".concat(.5625*t,"px")}),Si),sK=function(e){var n=e.video,r=e.videoRef,i=e.width,o=void 0===i?696:i,a=e.margin,s=void 0===a?"0":a,l=e.useCovideoPlayer,c=void 0!==l&&l;return(0,t.jsxs)(oK,iK({margin:s},{children:[!c&&(0,t.jsx)(aK,iK({width:o},{children:(0,t.jsx)("video",iK({ref:r,preload:"metadata",width:o},{children:(0,t.jsx)("source",{src:n.videoSource,type:"video/mp4"})}))})),c&&(0,t.jsx)(FU,{width:"".concat(o,"px"),playerBackgroundColor:n.playerBackgroundColor||"",videoSource:n.videoSource,videoId:n.id,playButtonPosition:n.playButtonPosition||"",playerIconsColor:n.playerIconsAndTextColor||"",videoRef:r,autoplay:!1,disableControls:!0,startWithControls:!1})]}))};function lK(e){return Oc({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}},{tag:"path",attr:{d:"M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"}}]})(e)}var cK,uK,fK,dK,pK,hK,yK,mK=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},vK=tt.div(cK||(cK=mK(["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"],["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"])),di),gK=tt.div(uK||(uK=mK(["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"],["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"])),pi),xK=tt.label(fK||(fK=mK(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),Vi),bK=tt.div(dK||(dK=mK(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),wK=tt.section(pK||(pK=mK(["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"],["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"]))),SK=function(e){var n=e.title,r=e.content,i=e.primaryButtonText,o=e.secondaryButtonText,a=e.handleModalClose,s=e.handleSubmit,l=e.primaryButtonType,c=void 0===l?"default":l,u=(0,E.useContext)(Ye);return(0,t.jsx)(wc,{children:(0,t.jsxs)(vK,{children:[(0,t.jsxs)(gK,{children:[n,(0,t.jsx)(xK,{children:(0,t.jsx)(rf,{width:"24px",height:"24px",onClick:a})})]}),(0,t.jsxs)(bK,{children:[r,(0,t.jsxs)(wK,{children:[(0,t.jsx)(yo,{text:i,backgroundColor:"danger"===c?Di:u.colors.primaryColor,textColor:"danger"===c?Ri:di,onClick:s}),(0,t.jsx)(yo,{text:o,onClick:a})]})]})]})})},CK=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},EK=function(){return EK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},EK.apply(this,arguments)},kK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_K=tt.div(NK||(NK=CK(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 11px;\n width: ",";\n max-width: 100%;\n margin: ",";\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 11px;\n width: ",";\n max-width: 100%;\n margin: ",";\n ","\n"])),(function(e){var t=e.width;return"".concat(t,"px")}),(function(e){return e.margin}),(function(e){return e.disabled&&Ne(BK||(BK=CK(["\n pointer-events: none;\n opacity: 0.4;\n "],["\n pointer-events: none;\n opacity: 0.4;\n "])))})),OK=tt.div(zK||(zK=CK(["\n display: flex;\n justify-content: center;\n gap: 8px;\n flex-shrink: 0;\n"],["\n display: flex;\n justify-content: center;\n gap: 8px;\n flex-shrink: 0;\n"]))),PK=tt.div(UK||(UK=CK(["\n position: relative;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n border-radius: 6px;\n display: flex;\n align-items: center;\n background: ",";\n border: 1px solid ",";\n border-radius: 6px;\n ","\n"],["\n position: relative;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n border-radius: 6px;\n display: flex;\n align-items: center;\n background: ",";\n border: 1px solid ",";\n border-radius: 6px;\n ","\n"])),wi,bi,(function(e){return e.disabled&&Ne(VK||(VK=CK(["\n cursor: not-allowed;\n "],["\n cursor: not-allowed;\n "])))})),TK=tt.div(HK||(HK=CK(["\n position: relative;\n height: 12px;\n width: 100%;\n margin-right: 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 8px;\n"],["\n position: relative;\n height: 12px;\n width: 100%;\n margin-right: 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 8px;\n"]))),AK=tt.div(GK||(GK=CK(["\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n width: ",";\n background: ",";\n border-radius: 8px;\n"],["\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n width: ",";\n background: ",";\n border-radius: 8px;\n"])),(function(e){var t=e.position;return"".concat(t,"%")}),(function(e){return e.background})),jK=tt.div(WK||(WK=CK(["\n box-sizing: border-box;\n width: 100px;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 13px;\n"],["\n box-sizing: border-box;\n width: 100px;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 13px;\n"]))),IK=tt.div(qK||(qK=CK(["\n flex-grow: 0;\n flex-shrink: 0;\n margin-right: 17px;\n padding-top: 4px;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n margin-right: 17px;\n padding-top: 4px;\n"]))),MK=tt.div($K||($K=CK(["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n"])),Pi),DK=tt.div(ZK||(ZK=CK(["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 60px;\n padding-left: 12px;\n margin-right: 12px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 60px;\n padding-left: 12px;\n margin-right: 12px;\n color: ",";\n"])),_i),RK=tt.input(QK||(QK=CK(["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 3;\n cursor: pointer;\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-moz-range-thumb {\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-ms-thumb {\n width: 4px;\n height: 40px;\n z-index: 3;\n }\n ",";\n &:focus {\n outline: none;\n }\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"],["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 3;\n cursor: pointer;\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-moz-range-thumb {\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-ms-thumb {\n width: 4px;\n height: 40px;\n z-index: 3;\n }\n ",";\n &:focus {\n outline: none;\n }\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"])),(function(e){return e.disabled&&Ne(YK||(YK=CK(["\n pointer-events: none;\n &::-webkit-slider-thumb {\n display: none;\n }\n &::-moz-range-thumb {\n display: none;\n }\n &::-ms-thumb {\n display: none;\n }\n "],["\n pointer-events: none;\n &::-webkit-slider-thumb {\n display: none;\n }\n &::-moz-range-thumb {\n display: none;\n }\n &::-ms-thumb {\n display: none;\n }\n "])))})),FK=tt.audio(KK||(KK=CK(["\n display: none;\n"],["\n display: none;\n"]))),LK={audioSource:{value:"default"}};!function(e){e.NotRecording="NotRecording",e.Recording="Recording",e.RecordingPaused="RecordingPaused",e.Finished="Finished"}(hK||(hK={})),function(e){e.NotPreviewing="NotPreviewing",e.Previewing="Previewing",e.PreviewingPaused="PreviewingPaused"}(yK||(yK={}));var BK,NK,zK,VK,UK,HK,GK,WK,qK,$K,ZK,YK,QK,KK,XK,JK,eX,tX,nX,rX,iX,oX,aX,sX,lX,cX,uX,fX,dX,pX,hX,yX,mX,vX,gX,xX,bX,wX,SX,CX,EX,kX,_X,OX,PX,TX,AX,jX,IX,MX,DX,RX,FX,LX,BX,NX,zX,VX,UX,HX,GX=function(e){var n,r,i=e.video,o=e.videoRef,a=e.onChangeVoiceoverValid,s=e.onRecordingUrlGeneration,l=e.handleShowCard,c=e.margin,u=void 0===c?"0":c,f=e.width,d=void 0===f?696:f,p=e.disabled,h=void 0!==p&&p,y=Mt().containerWidth,v=Ju().toast,g=(0,E.createRef)(),x=kK((0,E.useState)(hK.NotRecording),2),b=x[0],w=x[1],S=kK((0,E.useState)(yK.NotPreviewing),2),C=S[0],k=S[1],_=kK((0,E.useState)(0),2),O=_[0],P=_[1],T=kK((0,E.useState)(),2),A=T[0],j=T[1],I=kK((0,E.useState)(!1),2),M=I[0],D=I[1],R=dn(),F={audioSource:JSON.parse(localStorage.getItem(m.recordSettings)||JSON.stringify(LK)).audioSource};try{r={deviceId:F.audioSource.value}}catch(e){}F&&F.audioSource&&F.audioSource.value||(r=!1);var L=sq({audio:r}),B=L.error,N=L.startRecording,z=L.stopRecording,V=L.pauseRecording,U=L.resumeRecording,H=L.mediaBlobUrl;r&&!B||(v({message:"Please enable audio in your recording settings and try again!"}),R.push("/record/home"));(0,E.useEffect)((function(){return function(){(function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([],kK(window.streams),!1).filter(Boolean).forEach((function(e){return function(e){try{e.getTracks().forEach((function(e){return e.stop()}))}catch(e){}}(e)})),window.streams=[],w(hK.NotRecording),k(yK.NotPreviewing)}}),[]),(0,E.useEffect)((function(){var e=function(){var e,t=0;o.current&&(t=(null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.currentTime)||0,o.current.currentTime>=o.current.duration&&(t=o.current.duration)),P(t)},t=function(){z(),w(hK.Finished),k(yK.NotPreviewing)},n=function(){w((function(e){return e===hK.Finished?e:hK.Recording})),k((function(e){return e===yK.PreviewingPaused?yK.Previewing:e}))},r=function(){w((function(e){return e===hK.Finished?e:hK.RecordingPaused})),k((function(e){return e===yK.Previewing?yK.PreviewingPaused:e}))},i=function(){o.current&&A&&(A.currentTime=o.current.currentTime)};return o.current&&(o.current.addEventListener("timeupdate",e,!0),o.current.addEventListener("ended",t,!0),o.current.addEventListener("pause",r,!0),o.current.addEventListener("play",n,!0),o.current.addEventListener("seeked",i,!0)),function(){o.current&&(o.current.removeEventListener("timeupdate",e,!0),o.current.removeEventListener("ended",t,!0),o.current.removeEventListener("pause",r,!0),o.current.removeEventListener("play",n,!0),o.current.removeEventListener("seeked",i,!0))}}),[o]),(0,E.useEffect)((function(){a(b===hK.Finished)}),[b]),(0,E.useEffect)((function(){s(H||""),H&&g.current&&g.current.load()}),[H]),(0,E.useEffect)((function(){g.current&&j(g.current)}),[g.current]);var G=b===hK.Finished,W=b===hK.Recording,q=(null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.duration)||((null==i?void 0:i.videoLength)?(null==i?void 0:i.videoLength)/1e3:0),$=q?O?parseFloat(O.toString())/parseFloat(q.toString())*100:0:100,Z=new Date(1e3*O).toISOString().substring(14,19);return(0,t.jsxs)(_K,EK({margin:u,width:d,disabled:h},{children:[(0,t.jsx)(FK,EK({ref:g},{children:(0,t.jsx)("source",{src:H||""})})),(0,t.jsxs)(OK,{children:[b===hK.NotRecording&&(0,t.jsx)(yo,{backgroundColor:Ri,textColor:di,icon:(0,t.jsx)(lK,{color:di,size:12}),text:"Record",onClick:function(){return e=void 0,t=void 0,r=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(e){return o.current?(null==l||l(!1),o.current.volume=0,o.current.play(),N(),w(hK.Recording),[2]):[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r},margin:"0"}),b===hK.Recording&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(yo,{icon:(0,t.jsx)(Mc,{color:Si}),text:"Pause",onClick:function(){o.current&&(V(),o.current.pause(),w(hK.RecordingPaused))},margin:"0"})}),b===hK.RecordingPaused&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Dc,{color:Si}),text:"Resume",onClick:function(){return function(){var e;o.current&&(U(),null===(e=o.current)||void 0===e||e.play(),w(hK.Recording))}()},margin:"0"}),b===hK.Finished&&C===yK.NotPreviewing&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Dc,{color:Si}),onClick:function(){o.current&&A&&(k(yK.Previewing),o.current.currentTime=0,o.current.play(),A.play())},margin:"0"}),C===yK.Previewing&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Mc,{color:Si}),onClick:function(){o.current&&A&&(A.pause(),o.current.pause(),k(yK.PreviewingPaused))},margin:"0"}),C===yK.PreviewingPaused&&(0,t.jsx)(yo,{icon:(0,t.jsx)(Dc,{color:Si}),onClick:function(){o.current&&A&&(A.play(),o.current.play(),k(yK.Previewing))},margin:"0"})]}),(0,t.jsxs)(PK,EK({disabled:!G,title:G?"":"Controls disabled before preview."},{children:[(0,t.jsxs)(jK,{children:[(0,t.jsx)(IK,{children:(0,t.jsx)(Ic,{size:22,color:W?Ri:_i})}),(0,t.jsx)(MK,{children:Z})]}),(0,t.jsxs)(TK,{children:[(0,t.jsx)(RK,{disabled:!G,type:"range",min:"0",max:"100",value:$,onChange:function(e){return function(e){var t,n=e.target.value.toString();t=(q*(n/100)).toString(),o.current&&A&&(o.current.currentTime=parseFloat(t),A.currentTime=parseFloat(t),A.play(),o.current.play(),k(yK.Previewing))}(e)},step:"1"}),(0,t.jsx)(AK,{background:W?Ri:Si,position:$})]}),(0,t.jsx)(DK,{children:St(q,0)})]})),[hK.RecordingPaused,hK.Finished].includes(b)&&(0,t.jsx)(OK,{children:(0,t.jsx)(yo,{backgroundColor:"rgba(232, 76, 61, 0.02)",textColor:Ri,icon:(0,t.jsx)($c,{color:Ri}),text:y>ti?"Start Over":"",onClick:function(){o.current&&A&&(A.pause(),o.current.pause(),C!==yK.NotPreviewing&&k(yK.PreviewingPaused),b!==hK.Finished&&w(hK.RecordingPaused),D(!0))},margin:"0"})}),M&&(0,t.jsx)(SK,{title:"Start Over?",content:(0,t.jsx)(t.Fragment,{children:"Your voiceover recording will be erased."}),secondaryButtonText:"Go Back",primaryButtonText:"Start Over",primaryButtonType:"danger",handleSubmit:function(){o.current&&A&&(D(!1),z(),o.current.pause(),o.current.currentTime=0,A.pause(),A.currentTime=0,w(hK.NotRecording),k(yK.NotPreviewing))},handleModalClose:function(){return D(!1)}})]}))},WX=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},qX=tt.div(XK||(XK=WX(["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"],["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"])),di),$X=tt.div(JK||(JK=WX(["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"],["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"])),pi),ZX=tt.label(eX||(eX=WX(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),Vi),YX=tt.div(tX||(tX=WX(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),QX=tt.div(nX||(nX=WX(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"])),Oi),KX=tt.section(rX||(rX=WX(["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"],["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"]))),XX=function(e){var n=e.title,r=e.label,i=e.defaultValue,o=e.primaryButtonText,a=e.secondaryButtonText,s=e.handleModalClose,l=e.handleSubmit,c=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(i),2),u=c[0],f=c[1];return(0,t.jsx)(wc,{children:(0,t.jsxs)(qX,{children:[(0,t.jsxs)($X,{children:[n,(0,t.jsx)(ZX,{children:(0,t.jsx)(rf,{width:"24px",height:"24px",onClick:s})})]}),(0,t.jsxs)(YX,{children:[(0,t.jsx)(QX,{children:r}),(0,t.jsx)(lo,{autoFocus:!0,value:u,onChange:function(e){return f(e.currentTarget.value)},width:"100%"}),(0,t.jsxs)(KX,{children:[(0,t.jsx)(yo,{text:o,backgroundColor:Qi,textColor:di,onClick:function(){return l(u)},disabled:""===u}),(0,t.jsx)(yo,{text:a,onClick:s})]})]})]})})},JX=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},eJ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},tJ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},nJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},rJ=tt.div(iX||(iX=JX(["\n background: ",";\n"],["\n background: ",";\n"])),di),iJ=tt.div(oX||(oX=JX(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),oJ=tt.div(sX||(sX=JX(["\n width: 78%;\n margin-left: auto;\n margin-right: auto;\n height: 40%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 12px;\n gap: 12px;\n background: #f2f4f6;\n border: 1px solid rgba(39, 42, 50, 0.05);\n border-radius: 6px;\n ","\n"],["\n width: 78%;\n margin-left: auto;\n margin-right: auto;\n height: 40%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 12px;\n gap: 12px;\n background: #f2f4f6;\n border: 1px solid rgba(39, 42, 50, 0.05);\n border-radius: 6px;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(aX||(aX=JX(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),aJ=tt.div(lX||(lX=JX(["\n width: 20px;\n flex-grow: 0;\n flex-shrink: 0;\n"],["\n width: 20px;\n flex-grow: 0;\n flex-shrink: 0;\n"]))),sJ=tt.div(cX||(cX=JX(["\n width: auto;\n"],["\n width: auto;\n"]))),lJ=tt.div(uX||(uX=JX(["\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),Si),cJ=tt.div(fX||(fX=JX(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-top: 2%;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-top: 2%;\n"])),hi),uJ=function(){var e=Ju().toast,n=pn().videoId,r=dn(),i=nJ((0,E.useState)({}),2),o=i[0],a=i[1],s=nJ((0,E.useState)(!0),2),l=s[0],c=s[1],u=nJ((0,E.useState)(!1),2),f=u[0],d=u[1],p=nJ((0,E.useState)(!1),2),h=p[0],y=p[1],m=nJ((0,E.useState)(!1),2),v=m[0],g=m[1],x=nJ((0,E.useState)(""),2),b=x[0],w=x[1],S=(0,E.createRef)();return(0,E.useEffect)((function(){eJ(void 0,void 0,void 0,(function(){var e;return tJ(this,(function(t){switch(t.label){case 0:return c(!0),[4,Wn(n)];case 1:return(e=t.sent())&&a(e),c(!1),[2]}}))}))}),[]),l?(0,t.jsx)(Eo,{isLoading:l}):(0,t.jsxs)(rJ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return r.push("/")}}),center:(0,t.jsx)(iJ,{children:"Voiceover"}),right:(0,t.jsx)(yo,{onClick:function(){g(!0)},text:"Save Video",textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px",disabled:!h||f})}),(0,t.jsx)(so,{children:!f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(oJ,{children:[(0,t.jsx)(aJ,{children:(0,t.jsx)(Tc,{size:22,color:"rgba(0, 27, 83, 0.6)"})}),(0,t.jsxs)(sJ,{children:[(0,t.jsx)(lJ,{children:"Duplicated video ready for voiceover"}),(0,t.jsx)(cJ,{children:"The video won’t be available in the Library until you save it. A new voiceover will replace the original audio of duplicated video."})]})]}),(0,t.jsx)(sK,{video:o,videoRef:S,margin:"32px 0 0"}),(0,t.jsx)(GX,{videoRef:S,video:o,onChangeVoiceoverValid:y,onRecordingUrlGeneration:function(e){w(e)},margin:"32px auto 0"})]})}),f&&(0,t.jsx)(Eo,{isLoading:!0}),v&&(0,t.jsx)(XX,{title:"Name new video",label:"Give your new video a name",defaultValue:o.title,secondaryButtonText:"Go Back",primaryButtonText:"Save Video",handleSubmit:function(t){return eJ(void 0,void 0,void 0,(function(){var n,i,a,s,l,c;return tJ(this,(function(u){switch(u.label){case 0:return g(!1),d(!0),[4,fetch(b||"").then((function(e){return e.blob()}))];case 1:return n=u.sent(),i=function(e,t){return e+"_"+(Math.random()+1).toString(36).substring(2)+"."+t}(o.id,iq),a=new File([n],i),s={fileName:a.name,mimeType:"audio/webm",folder:""},[4,ur(s)];case 2:if(!(l=u.sent())||l instanceof Error)return d(!1),e({message:"Server is currently unavailable, try again later!"}),[2];c={file:a,uploadURL:l.uploadUrl,mimeType:s.mimeType},u.label=3;case 3:return u.trys.push([3,6,,7]),[4,fr({data:c})];case 4:return u.sent(),[4,dr({videoId:o.id,newVideoTitle:t,audioFileName:i})];case 5:return u.sent(),[3,7];case 6:return u.sent(),d(!1),e({message:"Creating voiceover failed, try again later!"}),[2];case 7:return e({message:"Voiceover successfully created!"}),d(!1),y(!1),r.push("/"),[2]}}))}))},handleModalClose:function(){return g(!1)}})]})},fJ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},dJ=tt.div(pX||(pX=fJ(["\n position: relative;\n width: 216px;\n ","\n"],["\n position: relative;\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ni&&Ne(dX||(dX=fJ(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),pJ=tt.div(hX||(hX=fJ(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),hJ=tt.div(yX||(yX=fJ(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),_i,Pi),yJ=function(e){var n=e.prevSearch,r=e.handleSearch,i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,E.useState)(n||""),2),o=i[0],a=i[1];return(0,t.jsxs)(dJ,{children:[(0,t.jsx)(pJ,{children:(0,t.jsx)(fT,{onClick:function(){return r(o)},size:17})}),(0,t.jsx)(lo,{width:"100%",type:"text",padding:"8px 40px 8px 40px",value:o,placeholder:"Search videos...",onKeyUp:function(e){"Enter"===e.key&&r(o)},onChange:function(e){a(e.currentTarget.value)}}),""!==o&&(0,t.jsx)(hJ,{children:(0,t.jsx)(Fc,{onClick:function(){return a(""),void r("")},size:17})})]})},mJ=tt.div(mX||(mX=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),Oi),vJ=function(e){var n=e.page,r=e.size,i=e.count,o=n*r+1,a=n*r+r;return a>i&&(a=i),(0,t.jsxs)(mJ,{children:[o,"-",a," of ",i]})},gJ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},xJ=function(){return xJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xJ.apply(this,arguments)},bJ=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},wJ=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},SJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},CJ=tt.div(vX||(vX=gJ(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),EJ=tt.div(gX||(gX=gJ(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),kJ=tt.div(bX||(bX=gJ(["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"],["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(xX||(xX=gJ(["\n flex-direction: column;\n width: 100%;\n "],["\n flex-direction: column;\n width: 100%;\n "])))})),_J=tt.div(SX||(SX=gJ(["\n width: 216px;\n ","\n"],["\n width: 216px;\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(wX||(wX=gJ(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),OJ=tt.div(CX||(CX=gJ(["\n background: ",";\n"],["\n background: ",";\n"])),di),PJ=tt.div(EX||(EX=gJ(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"]))),TJ=tt.div(kX||(kX=gJ(["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),AJ=tt.div(_X||(_X=gJ(["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),jJ=tt.div(OX||(OX=gJ(["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"],["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"])),_i),IJ=tt.div(PX||(PX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"])),Pi),MJ=tt.div(TX||(TX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"])),Pi),DJ=tt.div(AX||(AX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"])),Pi),RJ=tt.div(jX||(jX=gJ(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"])),Pi),FJ=tt.div(IX||(IX=gJ(["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"],["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"])),Pi),LJ=tt.div(MX||(MX=gJ(["\n margin-top: 100px;\n"],["\n margin-top: 100px;\n"]))),BJ=tt.div(DX||(DX=gJ(["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"],["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"]))),NJ=tt.button(RX||(RX=gJ(["\n ","\n box-sizing: border-box;\n width: auto;\n height: 40px;\n font-size: 15px;\n align-items: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n overflow: hidden;\n padding: 8px;\n transition: 0.1s all;\n color: ",";\n margin: 0 4px;\n border-radius: 5px;\n vertical-align: top;\n"],["\n ","\n box-sizing: border-box;\n width: auto;\n height: 40px;\n font-size: 15px;\n align-items: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n overflow: hidden;\n padding: 8px;\n transition: 0.1s all;\n color: ",";\n margin: 0 4px;\n border-radius: 5px;\n vertical-align: top;\n"])),li,wi,bi,Si),zJ=tt.div(FX||(FX=gJ(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"],["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"]))),VJ=tt.span(LX||(LX=gJ(["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"],["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"])),Oi),UJ=tt.input(BX||(BX=gJ(["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"],["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"])),xi),HJ=tt.div(zX||(zX=gJ(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(e){return e.theme.containerWidth<ti&&Ne(NX||(NX=gJ(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),GJ=(new Date).getFullYear(),WJ=function(){var e=Nl().userData,n=(Xl(e),dn()),r=Mt().containerWidth,i=SJ((0,E.useState)(""),2),o=i[0],a=i[1],s=SJ((0,E.useState)(1),2),l=s[0],c=s[1],u=SJ((0,E.useState)(1),2),f=u[0],d=u[1],p=SJ((0,E.useState)(GJ),2),h=p[0],y=p[1],m=SJ((0,E.useState)(1),2),v=m[0],g=m[1],x=SJ((0,E.useState)(1),2),w=x[0],C=x[1],k=SJ((0,E.useState)([]),2),_=k[0],O=k[1],P=Ju().toast,T=10,A=SJ((0,E.useState)(!0),2),j=A[0],I=A[1],M=function(){return n.push("/")},D=function(){};(0,E.useEffect)((function(){bJ(void 0,void 0,void 0,(function(){var e,t;return wJ(this,(function(n){switch(n.label){case 0:I(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,vr({limit:T,page:l,year:h})];case 2:return e=n.sent(),g(e.count),O(e.videos),t=e.count<T?e.count:T,C(Math.ceil(e.count/t)),I(!1),[3,4];case 3:return n.sent(),I(!1),[3,4];case 4:return[2]}}))}))}),[T,l,h]);for(var R=function(e,t,n,r){return void 0===e&&(e=""),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=!0),bJ(void 0,void 0,void 0,(function(){return wJ(this,(function(i){return e.length<2&&""!==e||(e!==o&&(a(e),t=1,c(1)),f>0&&clearTimeout(f),D(),new Promise((function(t,n){D=n,d(setTimeout(t,e!==o?500:0))})).then((function(){return bJ(void 0,void 0,void 0,(function(){var i;return wJ(this,(function(o){switch(o.label){case 0:I(!0),0===n&&(n=h),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,vr({limit:T,search:e,page:t,year:n,ascOrder:r})];case 2:return i=o.sent(),g(i.count),O(i.videos),C(Math.ceil(i.count/T)),I(!1),[3,4];case 3:return o.sent(),I(!1),[3,4];case 4:return[2]}}))}))}))),[2]}))}))},F=function(e){"left"===e&&(R(o,l-1,h),c((function(e){return e-1}))),"right"===e&&(R(o,l+1,h),c((function(e){return e+1})))},L=[],B=GJ+1;B>2007;B--)L.push({value:B.toString(),label:B.toString()});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(CJ,{children:[(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){return M()}}),center:(0,t.jsx)(EJ,{children:"Wheels TV Import"})}),(0,t.jsx)(so,{children:(0,t.jsxs)(kJ,{children:[(0,t.jsx)(yJ,{handleSearch:R,prevSearch:o}),(0,t.jsx)(_J,{children:(0,t.jsx)(bl,{value:{value:h.toString()||"",label:h.toString()||""},onChange:function(e){y(e.value),c(1),R(o,1,e.value)},options:L,isSearchable:!1})})]})})]}),(0,t.jsx)(OJ,{children:(0,t.jsx)(so,xJ({extendStyle:{wrapper:{padding:r>=ni?"32px 16px":"16px 0px"}}},{children:j?(0,t.jsx)(LJ,{children:(0,t.jsx)(Eo,{isLoading:j})}):!_.length&&o?(0,t.jsxs)(BJ,{children:[(0,t.jsxs)("p",{children:["There are no videos with “",o,"” in the title"]}),(0,t.jsx)("p",{children:"Try using a different search term"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(AJ,{children:[r>=ni&&(0,t.jsx)(MJ,{children:(0,t.jsx)(jJ,{children:"Year"})}),(0,t.jsx)(DJ,{children:(0,t.jsx)(jJ,{children:"Make"})}),(0,t.jsx)(RJ,{children:(0,t.jsx)(jJ,{children:"Model"})}),(0,t.jsx)(IJ,{children:(0,t.jsx)(jJ,{children:"Title"})})]}),(0,t.jsx)(PJ,{children:_.map((function(e){return(0,t.jsxs)(TJ,xJ({onClick:function(){}},{children:[r>=ni&&(0,t.jsx)(MJ,{children:e.year}),(0,t.jsx)(DJ,{children:e.make}),(0,t.jsx)(RJ,{children:e.model}),(0,t.jsx)(IJ,{children:e.title}),(0,t.jsx)(FJ,{children:(0,t.jsx)(NJ,xJ({onClick:function(){return bJ(void 0,void 0,void 0,(function(){return wJ(this,(function(t){return function(e){bJ(void 0,void 0,void 0,(function(){return wJ(this,(function(t){switch(t.label){case 0:I(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(n={title:e.year+" "+e.make+" "+e.model,flvName:e.videoURL,animatedGifPath:e.animatedGifPath,year:e.year,make:e.make,model:e.model,wtvId:e.videoId},pr(void 0,void 0,void 0,(function(){var e,t,r;return hr(this,(function(i){switch(i.label){case 0:return e=S.bearerToken,t={title:n.title,flvName:n.flvName,wtvId:parseInt(n.wtvId.toString(),10),animatedGifPath:n.animatedGifPath,notes:n.year+";"+n.make+";"+n.model+";"+n.title},[4,Tn({url:"/wtv/videos",baseURL:b,method:mr,headers:e,data:t}).catch((function(e){return e}))];case 1:if((r=i.sent())instanceof Error)throw r;return[2,r]}}))})))];case 2:return t.sent(),I(!1),P({message:"Video has been added!"}),M(),[3,4];case 3:return t.sent(),I(!1),P({message:"An error occured while trying to add the video!"}),[3,4];case 4:return[2]}var n}))}))}(e),[2]}))}))}},{children:"Add"}))})]}),e.videoId)}))}),(0,t.jsx)(zJ,{children:(0,t.jsxs)(HJ,{children:[(0,t.jsx)(VJ,{children:"Go to:"}),(0,t.jsx)(UJ,{type:"number",min:1,value:l,onChange:function(e){if(e.currentTarget&&e.currentTarget.value){var t=e.currentTarget.value;t>w&&(t=w),c(t),R(o,t,h)}}}),(0,t.jsx)(vJ,{page:l-1,size:T,count:v}),(0,t.jsx)(yo,{onClick:function(){return F("left")},icon:(0,t.jsx)(Hc,{size:20}),disabled:1===l,backgroundColor:wi,borderColor:bi,padding:"0 8px",margin:"0 0 0 16px"}),(0,t.jsx)(yo,{onClick:function(){return F("right")},icon:(0,t.jsx)(Gc,{size:20}),disabled:l===w,backgroundColor:wi,borderColor:bi,padding:"0 8px"})]})})]})}))})]})},qJ=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$J=function(){return $J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$J.apply(this,arguments)},ZJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},YJ=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},QJ=tt.div(VX||(VX=qJ(["\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 2px;\n display: flex;\n flex-direction: column;\n margin-left: 20px;\n height: 85px;\n"],["\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 2px;\n display: flex;\n flex-direction: column;\n margin-left: 20px;\n height: 85px;\n"]))),KJ=tt.div(UX||(UX=qJ(["\n position: relative;\n left: ",";\n width: ",";\n max-width: 100%;\n"],["\n position: relative;\n left: ",";\n width: ",";\n max-width: 100%;\n"])),(function(e){return e.offset}),(function(e){return e.width})),XJ=function(e){var n=e.index,r=e.totalDuration,i=e.offset,o=e.width,a=e.video,s=void 0===a?{}:a,l=e.setVideos,c=void 0===l?function(){}:l,u=E.useRef([0,0]),f=ZJ((0,E.useState)([0,s.duration]),2),d=f[0],p=f[1];(0,E.useEffect)((function(){c((function(e){var t=YJ([],ZJ(e),!1),r=d[0],i=d[1],o="#t=".concat(r||0).concat(i?","+i:"");return t[n]=$J($J({},t[n]),{start:wt(d[0]),end:wt(d[1]),startSec:r,endSec:i,source:(""+s.source).split("#t=")[0]+o}),t}))}),[d]);var h=function(e){var t=e[1]-e[0];c((function(e){var i=YJ([],ZJ(e),!1);return i[n]=$J($J({},i[n]),{width:100*t/r,trimDuration:t}),i}))};return(0,E.useEffect)((function(){r&&c((function(e){var t=YJ([],ZJ(e),!1);return t[n]=$J($J({},t[n]),{width:100*s.trimDuration/r}),t}))}),[r]),(0,E.useMemo)((function(){return(0,t.jsx)(QJ,{children:(0,t.jsx)(KJ,$J({offset:"".concat(i||0,"px"),width:"".concat(o||0,"px")},{children:!!s.duration&&s.ref&&(0,t.jsx)(tG,{videoRef:s.ref,videoDuration:s.duration,videoSource:s.videoSource,setValue:p,showTickTime:!1,value:d,valueRef:u,width:"100%",onSlideEnd:h})}))},s.id)}),[s.width,s.ref,d,i,o])};function JJ(){return JJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JJ.apply(this,arguments)}const e0=tt((function(e){return E.createElement("svg",JJ({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),HX||(HX=E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 17C21.5523 17 22 16.5523 22 16C22 15.4477 21.5523 15 21 15H3C2.44772 15 2 15.4477 2 16C2 16.5523 2.44772 17 3 17H21ZM21 13C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11H3C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13H21ZM2 8C2 8.55228 2.44772 9 3 9H21C21.5523 9 22 8.55228 22 8C22 7.44772 21.5523 7 21 7H3C2.44772 7 2 7.44772 2 8Z",fill:"#001B53",fillOpacity:.4})))}))(t0||(t0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var t0,n0,r0,i0,o0,a0,s0,l0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},c0=function(){return c0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c0.apply(this,arguments)},u0=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},f0=tt.div(n0||(n0=l0(["\n background-color: ",";\n max-height: 80px;\n align-self: center;\n border-radius: 6px;\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n aspect-ratio: 16 / 9;\n div {\n display: contents;\n opacity: 0;\n div {\n display: none;\n opacity: 0;\n }\n svg {\n display: none;\n opacity: 0;\n }\n path {\n display: none;\n opacity: 0;\n }\n figure {\n display: contents;\n opacity: 0;\n }\n video {\n display: contents;\n opacity: 0;\n }\n img {\n display: contents;\n opacity: 0;\n }\n }\n"],["\n background-color: ",";\n max-height: 80px;\n align-self: center;\n border-radius: 6px;\n box-shadow: 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n aspect-ratio: 16 / 9;\n div {\n display: contents;\n opacity: 0;\n div {\n display: none;\n opacity: 0;\n }\n svg {\n display: none;\n opacity: 0;\n }\n path {\n display: none;\n opacity: 0;\n }\n figure {\n display: contents;\n opacity: 0;\n }\n video {\n display: contents;\n opacity: 0;\n }\n img {\n display: contents;\n opacity: 0;\n }\n }\n"])),mi),d0=tt.img(r0||(r0=l0(["\n background-color: ",";\n display: block;\n height: 100%;\n margin: auto;\n border-radius: 6px;\n"],["\n background-color: ",";\n display: block;\n height: 100%;\n margin: auto;\n border-radius: 6px;\n"])),mi),p0=tt.div(i0||(i0=l0(["\n padding-right: 32px;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n background-color: #fff;\n height: 80px;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n"],["\n padding-right: 32px;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n background-color: #fff;\n height: 80px;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n"]))),h0=tt.div(o0||(o0=l0(["\n display: flex;\n justify-content: center;\n height: 80px;\n width: 48px;\n align-items: center;\n opacity: 0.8;\n &:hover {\n cursor: pointer;\n opacity: 1;\n }\n"],["\n display: flex;\n justify-content: center;\n height: 80px;\n width: 48px;\n align-items: center;\n opacity: 0.8;\n &:hover {\n cursor: pointer;\n opacity: 1;\n }\n"]))),y0=function(e){var n=e.video,r=void 0===n?{}:n,i=e.setVideos,o=void 0===i?function(){}:i,a=e.setVideoRef,s=e.index,l=E.createRef(),c=u0((0,E.useState)(0),2),u=c[0],f=c[1];return(0,E.useEffect)((function(){u&&o((function(e){var t=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],u0(e),!1);return t[s]=c0(c0({},t[s]),{duration:u,trimDuration:u}),t}))}),[u]),(0,E.useEffect)((function(){l&&l.current&&(l.current.onloadedmetadata=function(){return function(){if(l.current){var e=l.current.duration;f(e)}}()},a(s,l))}),[l]),(0,E.useMemo)((function(){return(0,t.jsxs)(p0,{children:[(0,t.jsx)(h0,{children:(0,t.jsx)(e0,{})}),(0,t.jsxs)(f0,{children:[(0,t.jsx)(d0,{src:r.autogeneratedThumbnail}),(0,t.jsx)(FU,{videoSource:r.videoSource,videoId:r.id,thumbnail:r.autogeneratedThumbnail,videoRef:l,autoplay:!1})]})]},r.id)}),[r.videoSource])};function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m0.apply(this,arguments)}const v0=tt((function(e){return E.createElement("svg",m0({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),a0||(a0=E.createElement("defs",null,E.createElement("path",{id:"p1bfbm3cda",d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.26 4.25c.41.41 1.07.41 1.48 0l.01-.01c.41-.41.41-1.07 0-1.48L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-2-5h4c.28 0 .5.22.5.5s-.22.5-.5.5h-4c-.28 0-.5-.22-.5-.5s.22-.5.5-.5z"}))),s0||(s0=E.createElement("g",{fill:"none",fillRule:"evenodd",opacity:.2},E.createElement("g",null,E.createElement("g",null,E.createElement("g",{transform:"translate(-1112 -640) translate(1104 632) translate(8 8)"},E.createElement("mask",{id:"98kq0pmrgb",fill:"#fff"},E.createElement("use",{xlinkHref:"#p1bfbm3cda"})),E.createElement("use",{fill:"#000",fillRule:"nonzero",xlinkHref:"#p1bfbm3cda"}),E.createElement("g",{fill:"#272A32",mask:"url(#98kq0pmrgb)"},E.createElement("path",{d:"M0 0H24V24H0z"}))))))))}))(g0||(g0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var g0,x0,b0;function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w0.apply(this,arguments)}const S0=tt((function(e){return E.createElement("svg",w0({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},e),x0||(x0=E.createElement("defs",null,E.createElement("path",{id:"eekoyvk17a",d:"M15.499 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.78 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.26 4.25c.41.41 1.07.41 1.48 0l.01-.01c.41-.41.41-1.07 0-1.48L15.499 14zm-6 0c-2.49 0-4.5-2.01-4.5-4.5S7.009 5 9.499 5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-7c-.28 0-.5.22-.5.5V9h-1.5c-.28 0-.5.22-.5.5s.22.5.5.5h1.5v1.5c0 .28.22.5.5.5s.5-.22.5-.5V10h1.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1.5V7.5c0-.28-.22-.5-.5-.5z"}))),b0||(b0=E.createElement("g",{fill:"none",fillRule:"evenodd"},E.createElement("g",null,E.createElement("g",null,E.createElement("g",null,E.createElement("g",{transform:"translate(-1376 -640) translate(1104 632) translate(264) translate(8 8)"},E.createElement("mask",{id:"4qknrgzsbb",fill:"#fff"},E.createElement("use",{xlinkHref:"#eekoyvk17a"})),E.createElement("g",{fill:"#272A32",mask:"url(#4qknrgzsbb)"},E.createElement("path",{d:"M0 0H24V24H0z"})))))))))}))(C0||(C0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"24px"}),(function(e){return e.height||"24px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var C0,E0,k0,_0,O0,P0,T0,A0,j0,I0,M0,D0,R0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},F0=function(){return F0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},F0.apply(this,arguments)},L0=tt.div(A0||(A0=R0(["\n display: ",";\n justify-content: center;\n align-items: center;\n background-color: ",";\n opacity: 0.5;\n font-size: ",";\n cursor: pointer;\n width: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n height: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n position: absolute;\n\n z-index: 9;\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"],["\n display: ",";\n justify-content: center;\n align-items: center;\n background-color: ",";\n opacity: 0.5;\n font-size: ",";\n cursor: pointer;\n width: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n height: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n position: absolute;\n\n z-index: 9;\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"])),(function(e){return e.isVideoPaused?"flex":"none"}),(function(e){return e.hex}),(function(e){return e.small?"10px":"40px"}),(function(e){return"".concat(e.small?"30px":"54px")}),(function(e){return"".concat(e.small?"30px":"54px")}),(function(e){return"center"===e.playButtonPosition&&Ne(E0||(E0=R0(["\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n "],["\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n "])))}),(function(e){return"top-left"===e.playButtonPosition&&Ne(k0||(k0=R0(["\n top: 5%;\n left: 5%;\n "],["\n top: 5%;\n left: 5%;\n "])))}),(function(e){return"top-right"===e.playButtonPosition&&Ne(_0||(_0=R0(["\n top: 5%;\n right: 5%;\n "],["\n top: 5%;\n right: 5%;\n "])))}),(function(e){return"bottom-left"===e.playButtonPosition&&Ne(O0||(O0=R0(["\n bottom: 23%;\n left: 5%;\n "],["\n bottom: 23%;\n left: 5%;\n "])))}),(function(e){return"bottom-right"===e.playButtonPosition&&Ne(P0||(P0=R0(["\n bottom: 23%;\n right: 5%;\n "],["\n bottom: 23%;\n right: 5%;\n "])))}),(function(e){return"none"===e.playButtonPosition&&Ne(T0||(T0=R0(["\n display: none;\n "],["\n display: none;\n "])))})),B0=function(e){var n=e.playerBackgroundColor,r=e.playButtonPosition,i=e.isVideoPaused,o=e.togglePlay,a=e.playerIconsColor,s=e.small,l=aV.hex.rgb(n);return(0,t.jsx)(L0,F0({isVideoPaused:i,onClick:o,r:l[0],g:l[1],b:l[2],hex:n,playButtonPosition:r,small:s},{children:(0,t.jsx)(Dc,{color:a})}))},N0=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},z0=function(){return z0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z0.apply(this,arguments)},V0=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},U0=tt.div(I0||(I0=N0(["\n position: relative;\n background-color: ",";\n border-radius: 6px;\n width: ","px;\n height: ","px;\n max-width: 100%;\n ","\n"],["\n position: relative;\n background-color: ",";\n border-radius: 6px;\n width: ","px;\n height: ","px;\n max-width: 100%;\n ","\n"])),Ui,(function(e){return e.width||600}),(function(e){return e.height||300}),(function(e){return e.theme.containerWidth<=ti&&Ne(j0||(j0=N0(["\n border-radius: 0;\n "],["\n border-radius: 0;\n "])))})),H0=tt.div(M0||(M0=N0(["\n width: 100%;\n justify-content: center;\n display: flex;\n"],["\n width: 100%;\n justify-content: center;\n display: flex;\n"]))),G0=tt.input(D0||(D0=N0(["\n width: 100%;\n margin-top: -25px;\n z-index: 2;\n"],["\n width: 100%;\n margin-top: -25px;\n z-index: 2;\n"]))),W0=function(e){var n=e.width,r=e.height,i=e.displayVideos,o=k().useRef(null),a=k().useRef(0),s=V0(k().useState(!0),2),l=(s[0],s[1]),c=V0(k().useState(!1),2),u=c[0],f=c[1],d=V0(k().useState(0),2),p=d[0],h=d[1],y=V0(k().useState(0),2),m=y[0],v=y[1];k().useEffect((function(){a.current=0;for(var e=0,t=0;t<i.length;t++){var n=i[t].startSec?i[t].startSec:0;e+=(i[t].endSec?i[t].endSec:i[t].duration)-n}h(e||1)}),[i]);var g=function(){if(o.current){var e=o.current;l(!0);var t=++a.current;if(i.length>t){e.src=i[t].source;var n=i[t].startSec?i[t].startSec:0;e.currentTime=n}else a.current=0,e.src=i[0].source,e.pause(),f(!1)}},x=function(){var e=o.current;e&&(u?e.pause():e.play(),f(!u))};return(0,t.jsxs)(U0,z0({width:n,height:r},{children:[(0,t.jsx)("video",{preload:"metadata",width:n,height:r,ref:o,onTimeUpdate:function(){if(o.current){var e=a.current,t=o.current,n=t.currentTime;n=(n-=i[e].startSec?i[e].startSec:0)<0?0:n;for(var r=0;r<e;r++){var s=i[r].startSec?i[r].startSec:0;n+=(i[r].endSec?i[r].endSec:i[r].duration)-s}i[e].endSec<=t.currentTime&&g(),v(n)}},onLoadedMetadata:function(){l(!1)},onEnded:g,onCanPlayThrough:function(){o.current&&a.current>0&&u&&o.current.play()},src:"".concat(i[a.current].source),onClick:x,style:{maxWidth:"100%"}}),(0,t.jsx)(B0,{playerBackgroundColor:"#fff",playButtonPosition:"center",isVideoPaused:!u,togglePlay:x,playerIconsColor:Ui}),(0,t.jsx)(H0,{children:(0,t.jsx)(G0,{onChange:function(e){!function(e){var t=parseFloat(e.currentTarget.value);if(o.current)for(var n=o.current,r=a.current,s=0,c=0,u=0;u<i.length;u++){var f=i[u].startSec?i[u].startSec:0;if(c+=(i[u].endSec?i[u].endSec:i[u].duration)-f,t>=s&&t<c){r!==u&&(l(!0),a.current=u,n.src=i[u].source),n.currentTime=t-s+f;break}s=c}}(e)},value:m,max:p,min:"0",type:"range",step:"0.01"})})]}))};function q0(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var $0="function"==typeof Symbol&&Symbol.observable||"@@observable",Z0=function(){return Math.random().toString(36).substring(7).split("").join(".")},Y0={INIT:"@@redux/INIT"+Z0(),REPLACE:"@@redux/REPLACE"+Z0(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Z0()}};function Q0(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(q0(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(q0(1));return n(Q0)(e,t)}if("function"!=typeof e)throw new Error(q0(2));var i=e,o=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(q0(3));return o}function f(e){if("function"!=typeof e)throw new Error(q0(4));if(l)throw new Error(q0(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(q0(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(q0(7));if(void 0===e.type)throw new Error(q0(8));if(l)throw new Error(q0(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++)(0,t[n])();return e}return d({type:Y0.INIT}),(r={dispatch:d,subscribe:f,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(q0(10));i=e,d({type:Y0.REPLACE})}})[$0]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(q0(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[$0]=function(){return this},e},r}function K0(e,t){return function(){return t(e.apply(this,arguments))}}function X0(e,t){if("function"==typeof e)return K0(e,t);if("object"!=typeof e||null===e)throw new Error(q0(16));var n={};for(var r in e){var i=e[r];"function"==typeof i&&(n[r]=K0(i,t))}return n}function J0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var e1=k().createContext(null),t1=function(e){e()},n1=function(){return t1},r1={notify:function(){},get:function(){return[]}};function i1(e,t){var n,r=r1;function i(){a.onStateChange&&a.onStateChange()}function o(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){var e=n1(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}())}var a={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=r1)},getListeners:function(){return r}};return a}var o1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect;const a1=function(e){var t=e.store,n=e.context,r=e.children,i=(0,E.useMemo)((function(){var e=i1(t);return{store:t,subscription:e}}),[t]),o=(0,E.useMemo)((function(){return t.getState()}),[t]);o1((function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[i,o]);var a=n||e1;return k().createElement(a.Provider,{value:i},r)};var s1=__webpack_require__(2973),l1=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],c1=["reactReduxForwardedRef"],u1=[],f1=[null,null];function d1(e,t){var n=e[1];return[t.payload,n+1]}function p1(e,t,n){o1((function(){return e.apply(void 0,t)}),n)}function h1(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function y1(e,t,n,r,i,o,a,s,l,c){if(e){var u=!1,f=null,d=function(){if(!u){var e,n,d=t.getState();try{e=r(d,i.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?a.current||l():(o.current=e,s.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=d,n.trySubscribe(),d(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var m1=function(){return[null,0]};function v1(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,i=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,o=n.methodName,a=void 0===o?"connectAdvanced":o,s=n.renderCountProp,l=void 0===s?void 0:s,c=n.shouldHandleStateChanges,u=void 0===c||c,f=n.storeKey,d=void 0===f?"store":f,p=(n.withRef,n.forwardRef),h=void 0!==p&&p,y=n.context,m=void 0===y?e1:y,v=Zt(n,l1),g=m;return function(t){var n=t.displayName||t.name||"Component",r=i(n),o=(0,Lt.Z)({},v,{getDisplayName:i,methodName:a,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:r,wrappedComponentName:n,WrappedComponent:t}),s=v.pure,c=s?E.useMemo:function(e){return e()};function f(n){var r=(0,E.useMemo)((function(){var e=n.reactReduxForwardedRef,t=Zt(n,c1);return[n.context,e,t]}),[n]),i=r[0],a=r[1],s=r[2],l=(0,E.useMemo)((function(){return i&&i.Consumer&&(0,s1.isContextConsumer)(k().createElement(i.Consumer,null))?i:g}),[i,g]),f=(0,E.useContext)(l),d=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var p=d?n.store:f.store,h=(0,E.useMemo)((function(){return function(t){return e(t.dispatch,o)}(p)}),[p]),y=(0,E.useMemo)((function(){if(!u)return f1;var e=i1(p,d?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,d,f]),m=y[0],v=y[1],x=(0,E.useMemo)((function(){return d?f:(0,Lt.Z)({},f,{subscription:m})}),[d,f,m]),b=(0,E.useReducer)(d1,u1,m1),w=b[0][0],S=b[1];if(w&&w.error)throw w.error;var C=(0,E.useRef)(),_=(0,E.useRef)(s),O=(0,E.useRef)(),P=(0,E.useRef)(!1),T=c((function(){return O.current&&s===_.current?O.current:h(p.getState(),s)}),[p,w,s]);p1(h1,[_,C,P,s,T,O,v]),p1(y1,[u,p,m,h,_,C,P,O,v,S],[p,m,h]);var A=(0,E.useMemo)((function(){return k().createElement(t,(0,Lt.Z)({},T,{ref:a}))}),[a,t,T]);return(0,E.useMemo)((function(){return u?k().createElement(l.Provider,{value:x},A):A}),[l,A,x])}var p=s?k().memo(f):f;if(p.WrappedComponent=t,p.displayName=f.displayName=r,h){var y=k().forwardRef((function(e,t){return k().createElement(p,(0,Lt.Z)({},e,{reactReduxForwardedRef:t}))}));return y.displayName=r,y.WrappedComponent=t,R()(y,t)}return R()(p,t)}}function g1(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function x1(e,t){if(g1(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!g1(e[n[i]],t[n[i]]))return!1;return!0}function b1(e){return function(t,n){var r=e(t,n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function w1(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function S1(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=w1(e);var i=r(t,n);return"function"==typeof i&&(r.mapToProps=i,r.dependsOnOwnProps=w1(i),i=r(t,n)),i},r}}const C1=[function(e){return"function"==typeof e?S1(e):void 0},function(e){return e?void 0:b1((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?b1((function(t){return function(e,t){var n={},r=function(r){var i=e[r];"function"==typeof i&&(n[r]=function(){return t(i.apply(void 0,arguments))})};for(var i in e)r(i);return n}(e,t)})):void 0}],E1=[function(e){return"function"==typeof e?S1(e):void 0},function(e){return e?void 0:b1((function(){return{}}))}];function k1(e,t,n){return(0,Lt.Z)({},n,e,t)}const _1=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,i=n.pure,o=n.areMergedPropsEqual,a=!1;return function(t,n,s){var l=e(t,n,s);return a?i&&o(l,r)||(r=l):(a=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return k1}}];var O1=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function P1(e,t,n,r){return function(i,o){return n(e(i,o),t(r,o),o)}}function T1(e,t,n,r,i){var o,a,s,l,c,u=i.areStatesEqual,f=i.areOwnPropsEqual,d=i.areStatePropsEqual,p=!1;return function(i,h){return p?function(i,p){var h,y,m=!f(p,a),v=!u(i,o,p,a);return o=i,a=p,m&&v?(s=e(o,a),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):m?(e.dependsOnOwnProps&&(s=e(o,a)),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):v?(h=e(o,a),y=!d(h,s),s=h,y&&(c=n(s,l,a)),c):c}(i,h):(s=e(o=i,a=h),l=t(r,a),c=n(s,l,a),p=!0,c)}}function A1(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,o=Zt(t,O1),a=n(e,o),s=r(e,o),l=i(e,o);return(o.pure?T1:P1)(a,s,l,e,o)}var j1=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function I1(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function M1(e,t){return e===t}function D1(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?v1:n,i=t.mapStateToPropsFactories,o=void 0===i?E1:i,a=t.mapDispatchToPropsFactories,s=void 0===a?C1:a,l=t.mergePropsFactories,c=void 0===l?_1:l,u=t.selectorFactory,f=void 0===u?A1:u;return function(e,t,n,i){void 0===i&&(i={});var a=i,l=a.pure,u=void 0===l||l,d=a.areStatesEqual,p=void 0===d?M1:d,h=a.areOwnPropsEqual,y=void 0===h?x1:h,m=a.areStatePropsEqual,v=void 0===m?x1:m,g=a.areMergedPropsEqual,x=void 0===g?x1:g,b=Zt(a,j1),w=I1(e,o,"mapStateToProps"),S=I1(t,s,"mapDispatchToProps"),C=I1(n,c,"mergeProps");return r(f,(0,Lt.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:w,initMapDispatchToProps:S,initMergeProps:C,pure:u,areStatesEqual:p,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:x},b))}}const R1=D1();var F1;function L1(e,t){var n=(0,E.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,E.useRef)(!0),i=(0,E.useRef)(n),o=r.current||Boolean(t&&i.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.current.inputs)),a=o?i.current:{inputs:t,result:e()};return(0,E.useEffect)((function(){r.current=!1,i.current=a}),[a]),a.result}F1=nt.unstable_batchedUpdates,t1=F1;var B1=L1,N1=function(e,t){return L1((function(){return e}),t)},z1=function(e){var t=e.top,n=e.right,r=e.bottom,i=e.left;return{top:t,right:n,bottom:r,left:i,width:n-i,height:r-t,x:i,y:t,center:{x:(n+i)/2,y:(r+t)/2}}},V1=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},U1=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},H1={top:0,right:0,bottom:0,left:0},G1=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?H1:n,i=e.border,o=void 0===i?H1:i,a=e.padding,s=void 0===a?H1:a,l=z1(V1(t,r)),c=z1(U1(t,o)),u=z1(U1(c,s));return{marginBox:l,borderBox:z1(t),paddingBox:c,contentBox:u,margin:r,border:o,padding:s}},W1=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&Wt(!1),n},q1=function(e,t){var n,r,i=e.borderBox,o=e.border,a=e.margin,s=e.padding,l=(r=t,{top:(n=i).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return G1({borderBox:l,border:o,margin:a,padding:s})},$1=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),q1(e,t)},Z1=function(e,t){var n={top:W1(t.marginTop),right:W1(t.marginRight),bottom:W1(t.marginBottom),left:W1(t.marginLeft)},r={top:W1(t.paddingTop),right:W1(t.paddingRight),bottom:W1(t.paddingBottom),left:W1(t.paddingLeft)},i={top:W1(t.borderTopWidth),right:W1(t.borderRightWidth),bottom:W1(t.borderBottomWidth),left:W1(t.borderLeftWidth)};return G1({borderBox:e,margin:n,padding:r,border:i})},Y1=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return Z1(t,n)};const Q1=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t=i,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function K1(e,t){}function X1(){}function J1(e,t,n){var r=t.map((function(t){var r,i,o=(r=n,i=t.options,(0,Lt.Z)({},r,{},i));return e.addEventListener(t.eventName,t.fn,o),function(){e.removeEventListener(t.eventName,t.fn,o)}}));return function(){r.forEach((function(e){e()}))}}K1.bind(null,"warn"),K1.bind(null,"error");var e2=!0,t2="Invariant failed";function n2(e){this.message=e}function r2(e,t){if(!e)throw new n2(e2?t2:t2+": "+(t||""))}n2.prototype.toString=function(){return this.message};var i2=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).callbacks=null,t.unbind=X1,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof n2&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}(0,Dt.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=J1(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof n2))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(k().Component),o2=function(e){return e+1},a2=function(e,t){var n=e.droppableId===t.droppableId,r=o2(e.index),i=o2(t.index);return n?"\n You have moved the item from position "+r+"\n to position "+i+"\n ":"\n You have moved the item from position "+r+"\n in list "+e.droppableId+"\n to list "+t.droppableId+"\n in position "+i+"\n "},s2=function(e,t,n){return t.droppableId===n.droppableId?"\n The item "+e+"\n has been combined with "+n.draggableId:"\n The item "+e+"\n in list "+t.droppableId+"\n has been combined with "+n.draggableId+"\n in list "+n.droppableId+"\n "},l2=function(e){return"\n The item has returned to its starting position\n of "+o2(e.index)+"\n"},c2=function(e){return"\n You have lifted an item in position "+o2(e.source.index)+"\n"},u2=function(e){var t=e.destination;if(t)return a2(e.source,t);var n=e.combine;return n?s2(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},f2=function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+l2(e.source)+"\n ";var t=e.destination,n=e.combine;return t?"\n You have dropped the item.\n "+a2(e.source,t)+"\n ":n?"\n You have dropped the item.\n "+s2(e.draggableId,e.source,n)+"\n ":"\n The item has been dropped while not over a drop area.\n "+l2(e.source)+"\n "},d2={x:0,y:0},p2=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},h2=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},y2=function(e,t){return e.x===t.x&&e.y===t.y},m2=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},v2=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},g2=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},x2=function(e,t){return Math.min.apply(Math,t.map((function(t){return g2(e,t)})))},b2=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},w2=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},S2=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},C2=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=z1({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):z1(e)},E2=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,i=e.frame,o=function(e,t){return t?w2(e,t.scroll.diff.displacement):e}(t.marginBox,i),a=function(e,t,n){var r;return n&&n.increasedBy?(0,Lt.Z)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(o,r,n);return{page:t,withPlaceholder:n,active:C2(a,i)}},k2=function(e,t){e.frame||r2(!1);var n=e.frame,r=h2(t,n.scroll.initial),i=m2(r),o=(0,Lt.Z)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}}),a=E2({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return(0,Lt.Z)({},e,{frame:o,subject:a})};function _2(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function O2(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function P2(e,t){if(e.find)return e.find(t);var n=O2(e,t);return-1!==n?e[n]:void 0}function T2(e){return Array.prototype.slice.call(e)}var A2=Ca((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),j2=Ca((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),I2=Ca((function(e){return _2(e)})),M2=Ca((function(e){return _2(e)})),D2=Ca((function(e,t){var n=M2(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}));return n}));function R2(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function F2(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var L2=Ca((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),B2=function(e,t){return e.descriptor.droppableId===t.descriptor.id},N2={point:d2,value:0},z2={invisible:{},visible:{},all:[]},V2={displaced:z2,displacedBy:N2,at:null},U2=function(e,t){return function(n){return e<=n&&n<=t}},H2=function(e){var t=U2(e.top,e.bottom),n=U2(e.left,e.right);return function(r){if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;var i=t(r.top)||t(r.bottom),o=n(r.left)||n(r.right);if(i&&o)return!0;var a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||a&&o||s&&i}},G2=function(e){var t=U2(e.top,e.bottom),n=U2(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},W2={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},q2={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},$2=function(e){var t=e.target,n=e.destination,r=e.viewport,i=e.withDroppableDisplacement,o=e.isVisibleThroughFrameFn,a=i?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:d2;return w2(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(a,n,o)&&function(e,t,n){return n(t)(e)}(a,r,o)},Z2=function(e){return $2((0,Lt.Z)({},e,{isVisibleThroughFrameFn:H2}))},Y2=function(e){return $2((0,Lt.Z)({},e,{isVisibleThroughFrameFn:G2}))},Q2=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,i=t.visible;if(r[e])return!1;var o=i[e];return!o||o.shouldAnimate};function K2(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,i=e.viewport,o=e.forceShouldAnimate,a=e.last;return t.reduce((function(e,t){var s=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return z1(V1(n,r))}(t,r),l=t.descriptor.id;if(e.all.push(l),!Z2({target:s,destination:n,viewport:i,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:l,shouldAnimate:Q2(l,a,o)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function X2(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,i=e.destination,o=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:z2,displacedBy:r,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function J2(e){var t=e.draggable,n=e.insideDestination,r=e.destination,i=e.viewport,o=e.displacedBy,a=e.last,s=e.index,l=e.forceShouldAnimate,c=B2(t,r);if(null==s)return X2({insideDestination:n,inHomeList:c,displacedBy:o,destination:r});var u=P2(n,(function(e){return e.descriptor.index===s}));if(!u)return X2({insideDestination:n,inHomeList:c,displacedBy:o,destination:r});var f=L2(t,n),d=n.indexOf(u);return{displaced:K2({afterDragging:f.slice(d),destination:r,displacedBy:o,last:a,viewport:i.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function e5(e,t){return Boolean(t.effected[e])}var t5=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},n5=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},r5=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return v2(t.line,n.marginBox[t.end]+t5(t,r),n5(t,n.marginBox,r))},i5=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return v2(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),n5(t,n.marginBox,r))},o5=function(e,t){var n=e.frame;return n?p2(t,n.scroll.diff.displacement):t},a5=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,o=e.afterCritical,a=n.page.borderBox.center,s=t.at;return r&&s?"REORDER"===s.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,i=e.droppable,o=e.afterCritical,a=D2(i.descriptor.id,r),s=n.page,l=i.axis;if(!a.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return v2(t.line,n.contentBox[t.start]+t5(t,r),n5(t,n.contentBox,r))}({axis:l,moveInto:i.page,isMoving:s});var c=t.displaced,u=t.displacedBy,f=c.all[0];if(f){var d=r[f];if(e5(f,o))return i5({axis:l,moveRelativeTo:d.page,isMoving:s});var p=q1(d.page,u.point);return i5({axis:l,moveRelativeTo:p,isMoving:s})}var h=a[a.length-1];if(h.descriptor.id===n.descriptor.id)return s.borderBox.center;if(e5(h.descriptor.id,o)){var y=q1(h.page,m2(o.displacedBy.point));return r5({axis:l,moveRelativeTo:y,isMoving:s})}return r5({axis:l,moveRelativeTo:h.page,isMoving:s})}({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:o}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,i=F2(n);i||r2(!1);var o=i.draggableId,a=r[o].page.borderBox.center,s=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,i=e.displacedBy,o=Boolean(t.visible[r]||t.invisible[r]);return e5(r,n)?o?d2:m2(i.point):o?i.point:d2}({displaced:n.displaced,afterCritical:t,combineWith:o,displacedBy:n.displacedBy});return p2(a,s)}({impact:t,draggables:i,afterCritical:o}):a}(e),n=e.droppable;return n?o5(n,t):t},s5=function(e,t){var n=h2(t,e.scroll.initial),r=m2(n);return{frame:z1({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function l5(e,t){return e.map((function(e){return t[e]}))}var c5=function(e){var t,n,r=e.pageBorderBoxCenter,i=e.draggable,o=(t=e.viewport,n=r,p2(t.scroll.diff.displacement,n)),a=h2(o,i.page.borderBox.center);return p2(i.client.borderBox.center,a)},u5=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,i=e.viewport,o=e.withDroppableDisplacement,a=e.onlyOnMainAxis,s=void 0!==a&&a,l=h2(r,t.page.borderBox.center),c={target:w2(t.page.borderBox,l),destination:n,withDroppableDisplacement:o,viewport:i};return s?function(e){return $2((0,Lt.Z)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=U2(e.top,e.bottom),r=U2(e.left,e.right);return function(e){return t===W2?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):Y2(c)},f5=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.draggables,o=e.previousImpact,a=e.viewport,s=e.previousPageBorderBoxCenter,l=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=D2(r.descriptor.id,i),f=B2(n,r),d=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.previousImpact;if(!r.isCombineEnabled)return null;if(!R2(o))return null;function a(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,Lt.Z)({},o,{at:t})}var s=o.displaced.all,l=s.length?s[0]:null;if(t)return l?a(l):null;var c=L2(n,i);if(!l)return c.length?a(c[c.length-1].descriptor.id):null;var u=O2(c,(function(e){return e.descriptor.id===l}));-1===u&&r2(!1);var f=u-1;return f<0?null:a(c[f].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:u,previousImpact:o})||function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,i=e.draggables,o=e.destination,a=e.insideDestination,s=e.previousImpact,l=e.viewport,c=e.afterCritical,u=s.at;if(u||r2(!1),"REORDER"===u.type){var f=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,i=e.location;if(!r.length)return null;var o=i.index,a=t?o+1:o-1,s=r[0].descriptor.index,l=r[r.length-1].descriptor.index;return a<s||a>(n?l:l+1)?null:a}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:a});return null==f?null:J2({draggable:r,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:f})}var d=function(e){var t=e.isMovingForward,n=e.draggables,r=e.combine,i=e.afterCritical;if(!e.destination.isCombineEnabled)return null;var o=r.draggableId,a=n[o].descriptor.index;return e5(o,i)?t?a:a-1:t?a+1:a}({isMovingForward:t,destination:o,displaced:s.displaced,draggables:i,combine:u.combine,afterCritical:c});return null==d?null:J2({draggable:r,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:d})}({isMovingForward:t,isInHomeList:f,draggable:n,draggables:i,destination:r,insideDestination:u,previousImpact:o,viewport:a,afterCritical:c});if(!d)return null;var p=a5({impact:d,draggable:n,droppable:r,draggables:i,afterCritical:c});if(u5({draggable:n,destination:r,newPageBorderBoxCenter:p,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:c5({pageBorderBoxCenter:p,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null};var h=h2(p,s),y=function(e){var t=e.impact,n=e.viewport,r=e.destination,i=e.draggables,o=e.maxScrollChange,a=s5(n,p2(n.scroll.current,o)),s=r.frame?k2(r,p2(r.frame.scroll.current,o)):r,l=t.displaced,c=K2({afterDragging:l5(l.all,i),destination:r,displacedBy:t.displacedBy,viewport:a.frame,last:l,forceShouldAnimate:!1}),u=K2({afterDragging:l5(l.all,i),destination:s,displacedBy:t.displacedBy,viewport:n.frame,last:l,forceShouldAnimate:!1}),f={},d={},p=[l,c,u];return l.all.forEach((function(e){var t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n].visible[e];if(r)return r}return null}(e,p);t?d[e]=t:f[e]=!0})),(0,Lt.Z)({},t,{displaced:{all:l.all,invisible:f,visible:d}})}({impact:d,viewport:a,destination:r,draggables:i,maxScrollChange:h});return{clientSelection:l,impact:y,scrollJumpRequest:h}},d5=function(e){var t=e.subject.active;return t||r2(!1),t},p5=function(e,t){var n=e.page.borderBox.center;return e5(e.descriptor.id,t)?h2(n,t.displacedBy.point):n},h5=function(e,t){var n=e.page.borderBox;return e5(e.descriptor.id,t)?w2(n,m2(t.displacedBy.point)):n},y5=Ca((function(e,t){var n=t[e.line];return{value:n,point:v2(e.line,n)}})),m5=function(e,t){return(0,Lt.Z)({},e,{scroll:(0,Lt.Z)({},e.scroll,{max:t})})},v5=function(e,t,n){var r=e.frame;B2(t,e)&&r2(!1),e.subject.withPlaceholder&&r2(!1);var i=y5(e.axis,t.displaceBy).point,o=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return v2(r.line,t[r.line]);var i=e.subject.page.contentBox[r.size],o=D2(e.descriptor.id,n).reduce((function(e,t){return e+t.client.marginBox[r.size]}),0)+t[r.line]-i;return o<=0?null:v2(r.line,o)}(e,i,n),a={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var s=E2({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return(0,Lt.Z)({},e,{subject:s})}var l=o?p2(r.scroll.max,o):r.scroll.max,c=m5(r,l),u=E2({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:c});return(0,Lt.Z)({},e,{subject:u,frame:c})},g5=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},x5=function(e){var t=e.state,n=e.type,r=function(e,t){var n=g5(e);return n?t[n]:null}(t.impact,t.dimensions.droppables),i=Boolean(r),o=t.dimensions.droppables[t.critical.droppable.id],a=r||o,s=a.axis.direction,l="vertical"===s&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===s&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(l&&!i)return null;var c="MOVE_DOWN"===n||"MOVE_RIGHT"===n,u=t.dimensions.draggables[t.critical.draggable.id],f=t.current.page.borderBoxCenter,d=t.dimensions,p=d.draggables,h=d.droppables;return l?f5({isMovingForward:c,previousPageBorderBoxCenter:f,draggable:u,destination:a,draggables:p,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,r=e.draggable,i=e.isOver,o=e.draggables,a=e.droppables,s=e.viewport,l=e.afterCritical,c=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,i=e.droppables,o=e.viewport,a=r.subject.active;if(!a)return null;var s=r.axis,l=U2(a[s.start],a[s.end]),c=I2(i).filter((function(e){return e!==r})).filter((function(e){return e.isEnabled})).filter((function(e){return Boolean(e.subject.active)})).filter((function(e){return H2(o.frame)(d5(e))})).filter((function(e){var n=d5(e);return t?a[s.crossAxisEnd]<n[s.crossAxisEnd]:n[s.crossAxisStart]<a[s.crossAxisStart]})).filter((function(e){var t=d5(e),n=U2(t[s.start],t[s.end]);return l(t[s.start])||l(t[s.end])||n(a[s.start])||n(a[s.end])})).sort((function(e,n){var r=d5(e)[s.crossAxisStart],i=d5(n)[s.crossAxisStart];return t?r-i:i-r})).filter((function(e,t,n){return d5(e)[s.crossAxisStart]===d5(n[0])[s.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return U2(d5(e)[s.start],d5(e)[s.end])(n[s.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return d5(e)[s.start]-d5(t)[s.start]}))[0]:c.sort((function(e,t){var r=x2(n,S2(d5(e))),i=x2(n,S2(d5(t)));return r!==i?r-i:d5(e)[s.start]-d5(t)[s.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:i,droppables:a,viewport:s});if(!c)return null;var u=D2(c.descriptor.id,o),f=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,i=e.afterCritical,o=e.insideDestination.filter((function(e){return Y2({target:h5(e,i),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var o=g2(t,o5(r,p5(e,i))),a=g2(t,o5(r,p5(n,i)));return o<a?-1:a<o?1:e.descriptor.index-n.descriptor.index}));return o[0]||null}({pageBorderBoxCenter:n,viewport:s,destination:c,insideDestination:u,afterCritical:l}),d=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,i=e.draggable,o=e.draggables,a=e.destination,s=e.viewport,l=e.afterCritical;if(!n){if(r.length)return null;var c={displaced:z2,displacedBy:N2,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:0}}},u=a5({impact:c,draggable:i,droppable:a,draggables:o,afterCritical:l}),f=B2(i,a)?a:v5(a,i,o);return u5({draggable:i,destination:f,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var d,p=Boolean(t[a.axis.line]<=n.page.borderBox.center[a.axis.line]),h=(d=n.descriptor.index,n.descriptor.id===i.descriptor.id||p?d:d+1);return J2({draggable:i,insideDestination:r,destination:a,viewport:s,displacedBy:y5(a.axis,i.displaceBy),last:z2,index:h})}({previousPageBorderBoxCenter:n,destination:c,draggable:r,draggables:o,moveRelativeTo:f,insideDestination:u,viewport:s,afterCritical:l});if(!d)return null;var p=a5({impact:d,draggable:r,droppable:c,draggables:o,afterCritical:l});return{clientSelection:c5({pageBorderBoxCenter:p,draggable:r,viewport:s}),impact:d,scrollJumpRequest:null}}({isMovingForward:c,previousPageBorderBoxCenter:f,draggable:u,isOver:a,draggables:p,droppables:h,viewport:t.viewport,afterCritical:t.afterCritical})};function b5(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function w5(e){var t=U2(e.top,e.bottom),n=U2(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var S5=function(e,t){return z1(w2(e,t))};function C5(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var E5=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,i=e.droppables,o=e.previousImpact,a=e.viewport,s=e.afterCritical,l=S5(n.page.borderBox,t),c=function(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,i=I2(r).filter((function(e){if(!e.isEnabled)return!1;var n,r,i=e.subject.active;if(!i)return!1;if(r=i,!((n=t).left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top))return!1;if(w5(i)(t.center))return!0;var o=e.axis,a=i.center[o.crossAxisLine],s=t[o.crossAxisStart],l=t[o.crossAxisEnd],c=U2(i[o.crossAxisStart],i[o.crossAxisEnd]),u=c(s),f=c(l);return!u&&!f||(u?s<a:l>a)}));return i.length?1===i.length?i[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.candidates,r=e.draggable.page.borderBox.center,i=n.map((function(e){var n=e.axis,i=v2(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:g2(r,i)}})).sort((function(e,t){return t.distance-e.distance}));return i[0]?i[0].id:null}({pageBorderBox:t,draggable:n,candidates:i}):null}({pageBorderBox:l,draggable:n,droppables:i});if(!c)return V2;var u=i[c],f=D2(u.descriptor.id,r),d=function(e,t){var n=e.frame;return n?S5(t,n.scroll.diff.value):t}(u,l);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,i=e.destination,o=e.insideDestination,a=e.afterCritical;if(!i.isCombineEnabled)return null;var s=i.axis,l=y5(i.axis,t.displaceBy),c=l.value,u=n[s.start],f=n[s.end],d=P2(L2(t,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox,i=n[s.size]/4,o=e5(t,a),l=C5({displaced:r.displaced,id:t});return o?l?f>n[s.start]+i&&f<n[s.end]-i:u>n[s.start]-c+i&&u<n[s.end]-c-i:l?f>n[s.start]+c+i&&f<n[s.end]+c-i:u>n[s.start]+i&&u<n[s.end]-i}));return d?{displacedBy:l,displaced:r.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:i.descriptor.id}}}:null}({pageBorderBoxWithDroppableScroll:d,draggable:n,previousImpact:o,destination:u,insideDestination:f,afterCritical:s})||function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.last,a=e.viewport,s=e.afterCritical,l=r.axis,c=y5(r.axis,n.displaceBy),u=c.value,f=t[l.start],d=t[l.end],p=function(e){var t=e.draggable,n=e.closest;return n?e.inHomeList&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:P2(L2(n,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[l.line],r=e5(t,s),i=C5({displaced:o,id:t});return r?i?d<=n:f<n-u:i?d<=n+u:f<n})),inHomeList:B2(n,r)});return J2({draggable:n,insideDestination:i,destination:r,viewport:a,last:o,displacedBy:c,index:p})}({pageBorderBoxWithDroppableScroll:d,draggable:n,destination:u,insideDestination:f,last:o.displaced,viewport:a,afterCritical:s})},k5=function(e,t){var n;return(0,Lt.Z)({},e,((n={})[t.descriptor.id]=t,n))},_5=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,i=e.viewport,o=e.impact,a=e.scrollJumpRequest,s=i||t.viewport,l=r||t.dimensions,c=n||t.current.client.selection,u=h2(c,t.initial.client.selection),f={offset:u,selection:c,borderBoxCenter:p2(t.initial.client.borderBoxCenter,u)},d={selection:p2(f.selection,s.scroll.current),borderBoxCenter:p2(f.borderBoxCenter,s.scroll.current),offset:p2(f.offset,s.scroll.diff.value)},p={client:f,page:d};if("COLLECTING"===t.phase)return(0,Lt.Z)({phase:"COLLECTING"},t,{dimensions:l,viewport:s,current:p});var h=l.draggables[t.critical.draggable.id],y=o||E5({pageOffset:d.offset,draggable:h,draggables:l.draggables,droppables:l.droppables,previousImpact:t.impact,viewport:s,afterCritical:t.afterCritical}),m=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,i=e.impact,o=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,i=g5(t),o=g5(n);if(!i)return r;if(i===o)return r;var a=r[i];if(!a.subject.withPlaceholder)return r;var s=function(e){var t=e.subject.withPlaceholder;t||r2(!1);var n=e.frame;if(!n){var r=E2({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,Lt.Z)({},e,{subject:r})}var i=t.oldFrameMaxScroll;i||r2(!1);var o=m5(n,i),a=E2({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return(0,Lt.Z)({},e,{subject:a,frame:o})}(a);return k5(r,s)}({previousImpact:e.previousImpact,impact:i,droppables:r}),a=g5(i);if(!a)return o;var s=r[a];if(B2(t,s))return o;if(s.subject.withPlaceholder)return o;var l=v5(s,t,n);return k5(o,l)}({draggable:h,impact:y,previousImpact:t.impact,draggables:l.draggables,droppables:l.droppables});return(0,Lt.Z)({},t,{current:p,dimensions:{draggables:l.draggables,droppables:m},impact:y,viewport:s,scrollJumpRequest:a||null,forceShouldAnimate:!a&&null})},O5=function(e){var t=e.impact,n=e.viewport,r=e.draggables,i=e.destination,o=e.forceShouldAnimate,a=t.displaced,s=function(e,t){return e.map((function(e){return t[e]}))}(a.all,r),l=K2({afterDragging:s,destination:i,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:o,last:a});return(0,Lt.Z)({},t,{displaced:l})},P5=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,o=e.viewport,a=e.afterCritical,s=a5({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:a});return c5({pageBorderBoxCenter:s,draggable:n,viewport:o})},T5=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&r2(!1);var i=t.impact,o=r||t.viewport,a=n||t.dimensions,s=a.draggables,l=a.droppables,c=s[t.critical.draggable.id],u=g5(i);u||r2(!1);var f=l[u],d=O5({impact:i,viewport:o,destination:f,draggables:s}),p=P5({impact:d,draggable:c,droppable:f,draggables:s,viewport:o,afterCritical:t.afterCritical});return _5({impact:d,clientSelection:p,state:t,dimensions:a,viewport:o})},A5=function(e){var t=e.draggable,n=e.home,r=e.draggables,i=e.viewport,o=y5(n.axis,t.displaceBy),a=D2(n.descriptor.id,r),s=a.indexOf(t);-1===s&&r2(!1);var l,c=a.slice(s+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),f={inVirtualList:"virtual"===n.descriptor.mode,displacedBy:o,effected:u};return{impact:{displaced:K2({afterDragging:c,destination:n,displacedBy:o,last:null,viewport:i.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(l=t.descriptor,{index:l.index,droppableId:l.droppableId})}},afterCritical:f}},j5=function(e){return"SNAP"===e.movementMode},I5=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:k5(e.droppables,t)}}(e.dimensions,t);return!j5(e)||n?_5({state:e,dimensions:r}):T5({state:e,dimensions:r})};function M5(e){return e.isDragging&&"SNAP"===e.movementMode?(0,Lt.Z)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var D5={phase:"IDLE",completed:null,shouldFlush:!1},R5=function(e,t){if(void 0===e&&(e=D5),"FLUSH"===t.type)return(0,Lt.Z)({},D5,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&r2(!1);var n=t.payload,r=n.critical,i=n.clientSelection,o=n.viewport,a=n.dimensions,s=n.movementMode,l=a.draggables[r.draggable.id],c=a.droppables[r.droppable.id],u={selection:i,borderBoxCenter:l.client.borderBox.center,offset:d2},f={client:u,page:{selection:p2(u.selection,o.scroll.initial),borderBoxCenter:p2(u.selection,o.scroll.initial),offset:p2(u.selection,o.scroll.diff.value)}},d=I2(a.droppables).every((function(e){return!e.isFixedOnPage})),p=A5({draggable:l,home:c,draggables:a.draggables,viewport:o}),h=p.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:s,dimensions:a,initial:f,current:f,isWindowScrollAllowed:d,impact:h,afterCritical:p.afterCritical,onLiftImpact:h,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&r2(!1),(0,Lt.Z)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&r2(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return k2(n,e.scroll)})),i=(0,Lt.Z)({},t.dimensions.droppables,{},A2(r)),o=j2(function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,i=r.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,o=function(e){var t=e.frame;return t||r2(!1),t}(n[t]),a=o.scroll.diff.value,s=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,i=q1(t.client,n),o=$1(i,r);return(0,Lt.Z)({},t,{placeholder:(0,Lt.Z)({},t.placeholder,{client:i}),client:i,page:o})}({draggable:e,offset:p2(i,a),initialWindowScroll:r.scroll.initial});return s}))}({additions:n.additions,updatedDroppables:i,viewport:t.viewport})),a=(0,Lt.Z)({},t.dimensions.draggables,{},o);n.removals.forEach((function(e){delete a[e]}));var s={droppables:i,draggables:a},l=g5(t.impact),c=l?s.droppables[l]:null,u=s.draggables[t.critical.draggable.id],f=s.droppables[t.critical.droppable.id],d=A5({draggable:u,home:f,draggables:a,viewport:t.viewport}),p=d.impact,h=d.afterCritical,y=c&&c.isCombineEnabled?t.impact:p,m=E5({pageOffset:t.current.page.offset,draggable:s.draggables[t.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:y,viewport:t.viewport,afterCritical:h}),v=(0,Lt.Z)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:m,onLiftImpact:p,dimensions:s,afterCritical:h,forceShouldAnimate:!1});return"COLLECTING"===t.phase?v:(0,Lt.Z)({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;b5(e)||r2(!1);var y=t.payload.client;return y2(y,e.current.client.selection)?e:_5({state:e,clientSelection:y,impact:j5(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return M5(e);if("COLLECTING"===e.phase)return M5(e);b5(e)||r2(!1);var m=t.payload,v=m.id,g=m.newScroll,x=e.dimensions.droppables[v];if(!x)return e;var b=k2(x,g);return I5(e,b,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;b5(e)||r2(!1);var w=t.payload,S=w.id,C=w.isEnabled,E=e.dimensions.droppables[S];E||r2(!1),E.isEnabled===C&&r2(!1);var k=(0,Lt.Z)({},E,{isEnabled:C});return I5(e,k,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;b5(e)||r2(!1);var _=t.payload,O=_.id,P=_.isCombineEnabled,T=e.dimensions.droppables[O];T||r2(!1),T.isCombineEnabled===P&&r2(!1);var A=(0,Lt.Z)({},T,{isCombineEnabled:P});return I5(e,A,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;b5(e)||r2(!1),e.isWindowScrollAllowed||r2(!1);var j=t.payload.newScroll;if(y2(e.viewport.scroll.current,j))return M5(e);var I=s5(e.viewport,j);return j5(e)?T5({state:e,viewport:I}):_5({state:e,viewport:I})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!b5(e))return e;var M=t.payload.maxScroll;if(y2(M,e.viewport.scroll.max))return e;var D=(0,Lt.Z)({},e.viewport,{scroll:(0,Lt.Z)({},e.viewport.scroll,{max:M})});return(0,Lt.Z)({phase:"DRAGGING"},e,{viewport:D})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&r2(!1);var R=x5({state:e,type:t.type});return R?_5({state:e,impact:R.impact,clientSelection:R.clientSelection,scrollJumpRequest:R.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var F=t.payload.reason;return"COLLECTING"!==e.phase&&r2(!1),(0,Lt.Z)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:F})}if("DROP_ANIMATE"===t.type){var L=t.payload,B=L.completed,N=L.dropDuration,z=L.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&r2(!1),{phase:"DROP_ANIMATING",completed:B,dropDuration:N,newHomeClientOffset:z,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},F5=function(e){return{type:"LIFT",payload:e}},L5=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},B5=function(){return{type:"COLLECTION_STARTING",payload:null}},N5=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},z5=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},V5=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},U5=function(e){return{type:"MOVE",payload:e}},H5=function(){return{type:"MOVE_UP",payload:null}},G5=function(){return{type:"MOVE_DOWN",payload:null}},W5=function(){return{type:"MOVE_RIGHT",payload:null}},q5=function(){return{type:"MOVE_LEFT",payload:null}},$5=function(){return{type:"FLUSH",payload:null}},Z5=function(e){return{type:"DROP_COMPLETE",payload:e}},Y5=function(e){return{type:"DROP",payload:e}},Q5="cubic-bezier(.2,1,.1,1)",K5=0,X5=.7,J5=.75,e3="0.2s cubic-bezier(0.2, 0, 0, 1)",t3={fluid:"opacity "+e3,snap:"transform "+e3+", opacity "+e3,drop:function(e){var t=e+"s "+Q5;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+e3,placeholder:"height "+e3+", width "+e3+", margin "+e3},n3=function(e){return y2(e,d2)?null:"translate("+e.x+"px, "+e.y+"px)"},r3=n3,i3=function(e,t){var n=n3(e);return n?t?n+" scale("+J5+")":n:null},o3=.33,a3=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"===r.type){var i=t(),o=r.payload.reason;if("COLLECTING"!==i.phase){if("IDLE"!==i.phase){"DROP_PENDING"===i.phase&&i.isWaiting&&r2(!1),"DRAGGING"!==i.phase&&"DROP_PENDING"!==i.phase&&r2(!1);var a=i.critical,s=i.dimensions,l=s.draggables[i.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,i=e.home,o=e.viewport,a=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,Lt.Z)({},r,{displaced:z2}),didDropInsideDroppable:!0}:{impact:O5({draggables:t,impact:a,destination:i,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:o,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.id],viewport:i.viewport,draggables:i.dimensions.draggables}),u=c.impact,f=c.didDropInsideDroppable,d=f?R2(u):null,p=f?F2(u):null,h={index:a.draggable.index,droppableId:a.droppable.id},y={draggableId:l.descriptor.id,type:l.descriptor.type,source:h,reason:o,mode:i.movementMode,destination:d,combine:p},m=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,i=e.viewport,o=e.afterCritical,a=r.draggables,s=r.droppables,l=g5(t),c=l?s[l]:null,u=s[n.descriptor.droppableId],f=P5({impact:t,draggable:n,draggables:a,afterCritical:o,droppable:c||u,viewport:i});return h2(f,n.client.borderBox.center)}({impact:u,draggable:l,dimensions:s,viewport:i.viewport,afterCritical:i.afterCritical}),v={critical:i.critical,afterCritical:i.afterCritical,result:y,impact:u};if(!y2(i.current.client.offset,m)||Boolean(y.combine)){var g=function(e){var t=e.reason,n=g2(e.current,e.destination);if(n<=0)return o3;if(n>=1500)return.55;var r=o3+n/1500*.22000000000000003;return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:i.current.client.offset,destination:m,reason:o});n({type:"DROP_ANIMATE",payload:{newHomeClientOffset:m,dropDuration:g,completed:v}})}else n(Z5({completed:v}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:o}))}else e(r)}}},s3=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var l3=function(e){var t=function(e){var t,n=e.onWindowScroll,r=Q1((function(){n(s3())})),i=(t=r,{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(e){e.target!==window&&e.target!==window.document||t()}}),o=X1;function a(){return o!==X1}return{start:function(){a()&&r2(!1),o=J1(window,[i])},stop:function(){a()||r2(!1),r.cancel(),o(),o=X1},isActive:a}}({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},c3=function(e,t){t()},u3=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},f3=function(e,t,n,r){if(e){var i=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),i=function(i){t||n||(t=!0,e(i),clearTimeout(r))};return i.wasCalled=function(){return t},i}(n);e(t,{announce:i}),i.wasCalled()||n(r(t))}else n(r(t))},d3=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=O2(n,(function(t){return t.timerId===e}));-1===t&&r2(!1),n.splice(t,1)[0].callback()}(t)})),r={timerId:t,callback:e};n.push(r)},flush:function(){if(n.length){var e=[].concat(n);n.length=0,e.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}),i=null,o=function(n){i||r2(!1),i=null,c3(0,(function(){return f3(e().onDragEnd,n,t,f2)}))};return{beforeCapture:function(t,n){i&&r2(!1),c3(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){i&&r2(!1),c3(0,(function(){var r=e().onBeforeDragStart;r&&r(u3(t,n))}))},start:function(n,o){i&&r2(!1);var a=u3(n,o);i={mode:o,lastCritical:n,lastLocation:a.source,lastCombine:null},r.add((function(){c3(0,(function(){return f3(e().onDragStart,a,t,c2)}))}))},update:function(n,o){var a=R2(o),s=F2(o);i||r2(!1);var l=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(n,i.lastCritical);l&&(i.lastCritical=n);var c,u,f=(u=a,!(null==(c=i.lastLocation)&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));f&&(i.lastLocation=a);var d=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(i.lastCombine,s);if(d&&(i.lastCombine=s),l||f||d){var p=(0,Lt.Z)({},u3(n,i.mode),{combine:s,destination:a});r.add((function(){c3(0,(function(){return f3(e().onDragUpdate,p,t,u2)}))}))}},flush:function(){i||r2(!1),r.flush()},drop:o,abort:function(){if(i){var e=(0,Lt.Z)({},u3(i.lastCritical,i.mode),{combine:null,destination:null,reason:"CANCEL"});o(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var i=r.payload.critical;return n.beforeStart(i,r.payload.movementMode),t(r),void n.start(i,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var o=r.payload.completed.result;return n.flush(),t(r),void n.drop(o)}if(t(r),"FLUSH"!==r.type){var a=e.getState();"DRAGGING"===a.phase&&n.update(a.critical,a.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},p3=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&r2(!1),e.dispatch(Z5({completed:r.completed}))}else t(n)}}},h3=function(e){var t=null,n=null;return function(r){return function(i){if("FLUSH"!==i.type&&"DROP_COMPLETE"!==i.type&&"DROP_ANIMATION_FINISHED"!==i.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(i),"DROP_ANIMATE"===i.type){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=J1(window,[o])}))}}}},y3=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(Y5({reason:r.reason})))}}}},m3=J0,v3=function(e){var t,n=e.dimensionMarshal,r=e.focusMarshal,i=e.styleMarshal,o=e.getResponders,a=e.announce,s=e.autoScroller;return Q0(R5,m3(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(q0(15))},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=t.map((function(e){return e(i)}));return r=J0.apply(void 0,o)(n.dispatch),hT(hT({},n),{},{dispatch:r})}}}((t=i,function(){return function(e){return function(n){"INITIAL_PUBLISH"===n.type&&t.dragging(),"DROP_ANIMATE"===n.type&&t.dropping(n.payload.completed.result.reason),"FLUSH"!==n.type&&"DROP_COMPLETE"!==n.type||t.resting(),e(n)}}}),function(e){return function(){return function(t){return function(n){"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)}}}}(n),function(e){return function(t){var n=t.getState,r=t.dispatch;return function(t){return function(i){if("LIFT"===i.type){var o=i.payload,a=o.id,s=o.clientSelection,l=o.movementMode,c=n();"DROP_ANIMATING"===c.phase&&r(Z5({completed:c.completed})),"IDLE"!==n().phase&&r2(!1),r($5()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:a,movementMode:l}});var u={draggableId:a,scrollOptions:{shouldPublishImmediately:"SNAP"===l}},f=e.startPublishing(u),d=f.critical,p=f.dimensions,h=f.viewport;r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:p,clientSelection:s,movementMode:l,viewport:h}})}else t(i)}}}}(n),a3,p3,h3,y3,function(e){return function(t){return function(n){return function(r){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);var i=t.getState();return"DRAGGING"!==i.phase&&r2(!1),void e.start(i)}n(r),e.scroll(t.getState())}}}}(s),l3,function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;var i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(r),d3(o,a))))},g3=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,i=e.width,o=h2({x:n,y:t},{x:i,y:r});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},x3=function(){var e=document.documentElement;return e||r2(!1),e},b3=function(){var e=x3();return g3({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function w3(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var S3,C3,E3=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},i=null,o=function(){i||(n.collectionStarting(),i=requestAnimationFrame((function(){i=null;var e=r,o=e.additions,a=e.removals,s=e.modified,l=Object.keys(o).map((function(e){return t.draggable.getById(e).getDimension(d2)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(s).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:l,removals:Object.keys(a),modified:c};r={additions:{},removals:{},modified:{}},n.publish(u)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],o()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],o()},stop:function(){i&&(cancelAnimationFrame(i),i=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(t){n||r2(!1);var i=n.critical.draggable;"ADDITION"===t.type&&w3(e,i,t.value)&&r.add(t.value),"REMOVAL"===t.type&&w3(e,i,t.value)&&r.remove(t.value)},o={updateDroppableIsEnabled:function(r,i){e.droppable.exists(r)||r2(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:i})},updateDroppableIsCombineEnabled:function(r,i){n&&(e.droppable.exists(r)||r2(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:i}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,i){n&&(e.droppable.exists(r)||r2(!1),t.updateDroppableScroll({id:r,newScroll:i}))},startPublishing:function(t){n&&r2(!1);var r=e.draggable.getById(t.draggableId),o=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:o.descriptor},s=e.subscribe(i);return n={critical:a,unsubscribe:s},function(e){var t,n,r,i,o,a,s,l=e.critical,c=e.scrollOptions,u=e.registry,f=(t=s3(),n=b3(),r=t.y,i=t.x,a=(o=x3()).clientWidth,s=o.clientHeight,{frame:z1({top:r,left:i,right:i+a,bottom:r+s}),scroll:{initial:t,current:t,max:n,diff:{value:d2,displacement:d2}}}),d=f.scroll.current,p=l.droppable,h=u.droppable.getAllByType(p.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(d,c)})),y=u.draggable.getAllByType(l.draggable.type).map((function(e){return e.getDimension(d)}));return{dimensions:{draggables:j2(y),droppables:A2(h)},critical:l,viewport:f}}({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}};return o},k3=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},_3=function(e){window.scrollBy(e.x,e.y)},O3=Ca((function(e){return I2(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),P3=function(e){return Math.pow(e,2)},T3=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,i=n-t;return 0===i?0:(r-t)/i},A3=360,j3=1200,I3=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,i=e.shouldUseTimeDampening,o=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return 28;if(e===t.startScrollingFrom)return 1;var n=T3({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*P3(1-n);return Math.ceil(r)}(t,n);return 0===o?0:i?Math.max(function(e,t){var n=t,r=j3,i=Date.now()-n;if(i>=j3)return e;if(i<A3)return 1;var o=T3({startOfRange:A3,endOfRange:r,current:i}),a=e*P3(o);return Math.ceil(a)}(o,r),1):o},M3=function(e){var t=e.container,n=e.distanceToEdges,r=e.dragStartTime,i=e.axis,o=e.shouldUseTimeDampening,a=function(e,t){return{startScrollingFrom:.25*e[t.size],maxScrollValueAt:.05*e[t.size]}}(t,i);return n[i.end]<n[i.start]?I3({distanceToEdge:n[i.end],thresholds:a,dragStartTime:r,shouldUseTimeDampening:o}):-1*I3({distanceToEdge:n[i.start],thresholds:a,dragStartTime:r,shouldUseTimeDampening:o})},D3=b2((function(e){return 0===e?0:e})),R3=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,i=e.center,o=e.shouldUseTimeDampening,a={top:i.y-n.top,right:n.right-i.x,bottom:n.bottom-i.y,left:i.x-n.left},s=M3({container:n,distanceToEdges:a,dragStartTime:t,axis:W2,shouldUseTimeDampening:o}),l=M3({container:n,distanceToEdges:a,dragStartTime:t,axis:q2,shouldUseTimeDampening:o}),c=D3({x:l,y:s});if(y2(c,d2))return null;var u=function(e){var t=e.container,n=e.subject,r=e.proposedScroll,i=n.height>t.height,o=n.width>t.width;return o||i?o&&i?null:{x:o?0:r.x,y:i?0:r.y}:r}({container:n,subject:r,proposedScroll:c});return u?y2(u,d2)?null:u:null},F3=b2((function(e){return 0===e?0:e>0?1:-1})),L3=(S3=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,i=p2(t,r),o={x:S3(i.x,n.x),y:S3(i.y,n.y)};return y2(o,d2)?null:o}),B3=function(e){var t=e.max,n=e.current,r=e.change,i={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},o=F3(r),a=L3({max:i,current:n,change:o});return!a||0!==o.x&&0===a.x||0!==o.y&&0===a.y},N3=function(e,t){return B3({current:e.scroll.current,max:e.scroll.max,change:t})},z3=function(e,t){var n=e.frame;return!!n&&B3({current:n.scroll.current,max:n.scroll.max,change:t})},V3=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,i=e.scrollWindow,o=e.scrollDroppable,a=t.current.page.borderBoxCenter,s=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var l=function(e){var t=e.viewport,n=e.subject,r=e.center,i=e.shouldUseTimeDampening,o=R3({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:i});return o&&N3(t,o)?o:null}({dragStartTime:n,viewport:t.viewport,subject:s,center:a,shouldUseTimeDampening:r});if(l)return void i(l)}var c=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var i=r[n];return i.frame?i:null}var o=function(e,t){var n=P2(O3(t),(function(t){return t.frame||r2(!1),w5(t.frame.pageMarginBox)(e)}));return n}(t,r);return o}({center:a,destination:g5(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=t.frame;if(!a)return null;var s=R3({dragStartTime:i,container:a.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:o});return s&&z3(t,s)?s:null}({dragStartTime:n,droppable:c,subject:s,center:a,shouldUseTimeDampening:r});u&&o(c.descriptor.id,u)}},U3=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var i=e.scrollJumpRequest;if(i){var o=g5(e.impact);o||r2(!1);var a=function(e,t){if(!z3(e,t))return t;var r=function(e,t){var n=e.frame;return n&&z3(e,t)?L3({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var i=h2(t,r);return n(e.descriptor.id,i),h2(t,i)}(e.dimensions.droppables[o],i);if(a){var s=e.viewport,l=function(e,t,n){if(!e)return n;if(!N3(t,n))return n;var i=function(e,t){if(!N3(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return L3({current:r,max:n,change:t})}(t,n);if(!i)return r(n),null;var o=h2(n,i);return r(o),h2(n,o)}(e.isWindowScrollAllowed,s,a);l&&function(e,n){var r=p2(e.current.client.selection,n);t({client:r})}(e,l)}}}},H3=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,i=function(e){var t=e.scrollDroppable,n=Q1(e.scrollWindow),r=Q1(t),i=null,o=function(e){i||r2(!1);var t=i,o=t.shouldUseTimeDampening,a=t.dragStartTime;V3({state:e,scrollWindow:n,scrollDroppable:r,dragStartTime:a,shouldUseTimeDampening:o})};return{start:function(e){i&&r2(!1);var t=Date.now(),n=!1,r=function(){n=!0};V3({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),i={dragStartTime:t,shouldUseTimeDampening:n},n&&o(e)},stop:function(){i&&(n.cancel(),r.cancel(),i=null)},scroll:o}}({scrollWindow:n,scrollDroppable:t}),o=U3({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&o(e):i.scroll(e))},start:i.start,stop:i.stop}},G3="data-rbd",W3={base:C3=G3+"-drag-handle",draggableId:C3+"-draggable-id",contextId:C3+"-context-id"},q3=function(){var e=G3+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),$3=function(){var e=G3+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),Z3={contextId:G3+"-scroll-container-context-id"},Y3=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},Q3=function(e){var t,n,r=function(e){return function(t){return"["+t+'="'+e+'"]'}}(e),i=(t="\n cursor: -webkit-grab;\n cursor: grab;\n ",{selector:r(W3.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:t,dragging:"pointer-events: none;",dropAnimating:t}}),o=[(n="\n transition: "+t3.outOfTheWay+";\n ",{selector:r(q3.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),i,{selector:r($3.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:Y3(o,"always"),resting:Y3(o,"resting"),dragging:Y3(o,"dragging"),dropAnimating:Y3(o,"dropAnimating"),userCancel:Y3(o,"userCancel")}},K3="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?E.useLayoutEffect:E.useEffect,X3=function(){var e=document.querySelector("head");return e||r2(!1),e},J3=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},e6=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function t6(e){return e instanceof e6(e).HTMLElement}function n6(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}function i(t){return e.droppables[t]||null}return{draggable:{register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var i=t.descriptor.id,o=r(i);o&&t.uniqueId===o.uniqueId&&(delete e.draggables[i],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||r2(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return _2(e.draggables).filter((function(e){return e.descriptor.type===t}))}},droppable:{register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||r2(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return _2(e.droppables).filter((function(e){return e.descriptor.type===t}))}},subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var r6=k().createContext(null),i6=function(){var e=document.body;return e||r2(!1),e},o6={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},a6=function(e){return"rbd-announcement-"+e},s6=0,l6={separator:"::"};function c6(e,t){return void 0===t&&(t=l6),B1((function(){return""+e+t.separator+s6++}),[t.separator,e])}var u6=k().createContext(null);function f6(e){var t=(0,E.useRef)(e);return(0,E.useEffect)((function(){t.current=e})),t}var d6,p6,h6=((d6={})[13]=!0,d6[9]=!0,d6),y6=function(e){h6[e.keyCode]&&e.preventDefault()},m6=function(){var e="visibilitychange";return"undefined"==typeof document?e:P2([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),v6={type:"IDLE"};function g6(){}var x6=((p6={})[34]=!0,p6[33]=!0,p6[36]=!0,p6[35]=!0,p6);var b6={type:"IDLE"},w6={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function S6(e,t){if(null==t)return!1;if(Boolean(w6[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&S6(e,t.parentElement)}function C6(e,t){var n=t.target;return!!t6(n)&&S6(e,n)}var E6=function(e){return z1(e.getBoundingClientRect()).center},k6=function(){var e="matches";return"undefined"==typeof document?e:P2([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||e}();function _6(e,t){return null==e?null:e[k6](t)?e:_6(e.parentElement,t)}function O6(e,t){return e.closest?e.closest(t):_6(e,t)}function P6(e){e.preventDefault()}function T6(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function A6(e){var t=e.lockAPI,n=e.store,r=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var o=r.draggable.findById(i);return!!o&&!!o.options.isEnabled&&!!k3(n.getState(),i)}var j6=[function(e){var t=(0,E.useRef)(v6),n=(0,E.useRef)(X1),r=B1((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,a,{sourceEvent:t});if(i){t.preventDefault();var o={x:t.clientX,y:t.clientY};n.current(),c(i,o)}}}}}}),[e]),i=B1((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),o=N1((function(){n.current=J1(window,[i,r],{passive:!1,capture:!0})}),[i,r]),a=N1((function(){"IDLE"!==t.current.type&&(t.current=v6,n.current(),o())}),[o]),s=N1((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),l=N1((function(){var e=function(e){var t=e.cancel,n=e.completed,r=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,o=e.clientY;if(0===t){var a={x:n,y:o},s=r();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);if("PENDING"!==s.type&&r2(!1),l=s.point,c=a,Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5){var l,c;e.preventDefault();var u=s.actions.fluidLift(a);i({type:"DRAGGING",actions:u})}}}},{eventName:"mouseup",fn:function(e){var i=r();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return 27===e.keyCode?(e.preventDefault(),void t()):void y6(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&r2(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:m6,fn:t}]}({cancel:s,completed:a,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=J1(window,e,{capture:!0,passive:!1})}),[s,a]),c=N1((function(e,n){"IDLE"!==t.current.type&&r2(!1),t.current={type:"PENDING",point:n,actions:e},l()}),[l]);K3((function(){return o(),function(){n.current()}}),[o])},function(e){var t=(0,E.useRef)(g6),n=B1((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var i=e.findClosestDraggableId(n);if(i){var o=e.tryGetLock(i,l,{sourceEvent:n});if(o){n.preventDefault();var a=!0,s=o.snapLift();t.current(),t.current=J1(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return 27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(x6[r.keyCode]?r.preventDefault():y6(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:m6,fn:n}]}(s,l),{capture:!0,passive:!1})}}}function l(){a||r2(!1),a=!1,t.current(),r()}}}}),[e]),r=N1((function(){t.current=J1(window,[n],{passive:!1,capture:!0})}),[n]);K3((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,E.useRef)(b6),n=(0,E.useRef)(X1),r=N1((function(){return t.current}),[]),i=N1((function(e){t.current=e}),[]),o=B1((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,s,{sourceEvent:t});if(i){var o=t.touches[0],a={x:o.clientX,y:o.clientY};n.current(),f(i,a)}}}}}}),[e]),a=N1((function(){n.current=J1(window,[o],{capture:!0,passive:!1})}),[o]),s=N1((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(b6),n.current(),a())}),[a,i]),l=N1((function(){var e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),c=N1((function(){var e={capture:!0,passive:!1},t={cancel:l,completed:s,getPhase:r},i=J1(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var i=e.touches[0],o={x:i.clientX,y:i.clientY};e.preventDefault(),n.actions.move(o)}else t()}},{eventName:"touchend",fn:function(e){var i=r();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&r2(!1);var i=e.touches[0];if(i&&i.force>=.15){var o=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return o?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();o&&t()}}},{eventName:m6,fn:t}]}(t),e),o=J1(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:m6,fn:t}]}(t),e);n.current=function(){i(),o()}}),[l,r,s]),u=N1((function(){var e=r();"PENDING"!==e.type&&r2(!1);var t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,i]),f=N1((function(e,t){"IDLE"!==r().type&&r2(!1);var n=setTimeout(u,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,i,u]);K3((function(){return a(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(b6))}}),[r,a,i]),K3((function(){return J1(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function I6(e){var t=e.contextId,n=e.store,r=e.registry,i=e.customSensors,o=e.enableDefaultSensors,a=[].concat(o?j6:[],i||[]),s=(0,E.useState)((function(){return function(){var e=null;function t(){e||r2(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&r2(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],l=N1((function(e,t){e.isDragging&&!t.isDragging&&s.tryAbandon()}),[s]);K3((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();l(e,t),e=t}))}),[s,n,l]),K3((function(){return s.tryAbandon}),[s.tryAbandon]);for(var c=N1((function(e){return A6({lockAPI:s,registry:r,store:n,draggableId:e})}),[s,r,n]),u=N1((function(e,i,o){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,i=e.registry,o=e.draggableId,a=e.forceSensorStop,s=e.sourceEvent;if(!A6({lockAPI:t,store:r,registry:i,draggableId:o}))return null;var l=i.draggable.getById(o),c=function(e,t){var n="["+q3.contextId+'="'+e+'"]',r=P2(T2(document.querySelectorAll(n)),(function(e){return e.getAttribute(q3.id)===t}));return r&&t6(r)?r:null}(n,l.descriptor.id);if(!c)return null;if(s&&!l.options.canDragInteractiveElements&&C6(c,s))return null;var u=t.claim(a||X1),f="PRE_DRAG";function d(){return l.options.shouldRespectForcePress}function p(){return t.isActive(u)}var h=function(e,t){T6({expected:e,phase:f,isLockActive:p,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function y(e){function n(){t.release(),f="COMPLETED"}function i(t,i){if(void 0===i&&(i={shouldBlockNextClick:!1}),e.cleanup(),i.shouldBlockNextClick){var o=J1(window,[{eventName:"click",fn:P6,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(o)}n(),r.dispatch(Y5({reason:t}))}return"PRE_DRAG"!==f&&(n(),"PRE_DRAG"!==f&&r2(!1)),r.dispatch(F5(e.liftActionArgs)),f="DRAGGING",(0,Lt.Z)({isActive:function(){return T6({expected:"DRAGGING",phase:f,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:d,drop:function(e){return i("DROP",e)},cancel:function(e){return i("CANCEL",e)}},e.actions)}return{isActive:function(){return T6({expected:"PRE_DRAG",phase:f,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:d,fluidLift:function(e){var t=Q1((function(e){h((function(){return U5({client:e})}))})),n=y({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,Lt.Z)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return h(H5)},moveRight:function(){return h(W5)},moveDown:function(){return h(G5)},moveLeft:function(){return h(q5)}};return y({liftActionArgs:{id:o,clientSelection:E6(c),movementMode:"SNAP"},cleanup:X1,actions:e})},abort:function(){T6({expected:"PRE_DRAG",phase:f,isLockActive:p,shouldWarn:!0})&&t.release()}}}({lockAPI:s,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:i,sourceEvent:o&&o.sourceEvent?o.sourceEvent:null})}),[t,s,r,n]),f=N1((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof e6(n).Element))return null;var i=function(e){return"["+W3.contextId+'="'+e+'"]'}(e),o=O6(r,i);return o&&t6(o)?o:null}(e,t);return n?n.getAttribute(W3.draggableId):null}(t,e)}),[t]),d=N1((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),p=N1((function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch($5()))}),[s,n]),h=N1(s.isClaimed,[s]),y=B1((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:f,findOptionsForDraggable:d,tryReleaseLock:p,isLockClaimed:h}}),[c,u,f,d,p,h]),m=0;m<a.length;m++)a[m](y)}var M6=function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}};function D6(e){return e.current||r2(!1),e.current}function R6(e){var t=e.contextId,n=e.setCallbacks,r=e.sensors,i=e.nonce,o=e.dragHandleUsageInstructions,a=(0,E.useRef)(null),s=f6(e),l=N1((function(){return M6(s.current)}),[s]),c=function(e){var t=B1((function(){return a6(e)}),[e]),n=(0,E.useRef)(null);return(0,E.useEffect)((function(){var e=document.createElement("div");return n.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),(0,Lt.Z)(e.style,o6),i6().appendChild(e),function(){setTimeout((function(){var t=i6();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),N1((function(e){var t=n.current;t&&(t.textContent=e)}),[])}(t),u=function(e){var t=e.contextId,n=e.text,r=c6("hidden-text",{separator:"-"}),i=B1((function(){return function(e){return"rbd-hidden-text-"+e.contextId+"-"+e.uniqueId}({contextId:t,uniqueId:r})}),[r,t]);return(0,E.useEffect)((function(){var e=document.createElement("div");return e.id=i,e.textContent=n,e.style.display="none",i6().appendChild(e),function(){var t=i6();t.contains(e)&&t.removeChild(e)}}),[i,n]),i}({contextId:t,text:o}),f=function(e,t){var n=B1((function(){return Q3(e)}),[e]),r=(0,E.useRef)(null),i=(0,E.useRef)(null),o=N1(Ca((function(e){var t=i.current;t||r2(!1),t.textContent=e})),[]),a=N1((function(e){var t=r.current;t||r2(!1),t.textContent=e}),[]);K3((function(){(r.current||i.current)&&r2(!1);var s=J3(t),l=J3(t);return r.current=s,i.current=l,s.setAttribute(G3+"-always",e),l.setAttribute(G3+"-dynamic",e),X3().appendChild(s),X3().appendChild(l),a(n.always),o(n.resting),function(){var e=function(e){var t=e.current;t||r2(!1),X3().removeChild(t),e.current=null};e(r),e(i)}}),[t,a,o,n.always,n.resting,e]);var s=N1((function(){return o(n.dragging)}),[o,n.dragging]),l=N1((function(e){o("DROP"!==e?n.userCancel:n.dropAnimating)}),[o,n.dropAnimating,n.userCancel]),c=N1((function(){i.current&&o(n.resting)}),[o,n.resting]);return B1((function(){return{dragging:s,dropping:l,resting:c}}),[s,l,c])}(t,i),d=N1((function(e){D6(a).dispatch(e)}),[]),p=B1((function(){return X0({publishWhileDragging:L5,updateDroppableScroll:N5,updateDroppableIsEnabled:z5,updateDroppableIsCombineEnabled:V5,collectionStarting:B5},d)}),[d]),h=function(){var e=B1(n6,[]);return(0,E.useEffect)((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),y=B1((function(){return E3(h,p)}),[h,p]),m=B1((function(){return H3((0,Lt.Z)({scrollWindow:_3,scrollDroppable:y.scrollDroppable},X0({move:U5},d)))}),[y.scrollDroppable,d]),v=function(e){var t=(0,E.useRef)({}),n=(0,E.useRef)(null),r=(0,E.useRef)(null),i=(0,E.useRef)(!1),o=N1((function(e,n){var r={id:e,focus:n};return t.current[e]=r,function(){var n=t.current;n[e]!==r&&delete n[e]}}),[]),a=N1((function(t){var n=function(e,t){var n="["+W3.contextId+'="'+e+'"]',r=T2(document.querySelectorAll(n));if(!r.length)return null;var i=P2(r,(function(e){return e.getAttribute(W3.draggableId)===t}));return i&&t6(i)?i:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),s=N1((function(e,t){n.current===e&&(n.current=t)}),[]),l=N1((function(){r.current||i.current&&(r.current=requestAnimationFrame((function(){r.current=null;var e=n.current;e&&a(e)})))}),[a]),c=N1((function(e){n.current=null;var t=document.activeElement;t&&t.getAttribute(W3.draggableId)===e&&(n.current=e)}),[]);return K3((function(){return i.current=!0,function(){i.current=!1;var e=r.current;e&&cancelAnimationFrame(e)}}),[]),B1((function(){return{register:o,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:s}}),[o,c,l,s])}(t),g=B1((function(){return v3({announce:c,autoScroller:m,dimensionMarshal:y,focusMarshal:v,getResponders:l,styleMarshal:f})}),[c,m,y,v,l,f]);a.current=g;var x=N1((function(){var e=D6(a);"IDLE"!==e.getState().phase&&e.dispatch($5())}),[]),b=N1((function(){var e=D6(a).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);n(B1((function(){return{isDragging:b,tryAbort:x}}),[b,x]));var w=N1((function(e){return k3(D6(a).getState(),e)}),[]),S=N1((function(){return b5(D6(a).getState())}),[]),C=B1((function(){return{marshal:y,focus:v,contextId:t,canLift:w,isMovementAllowed:S,dragHandleUsageInstructionsId:u,registry:h}}),[t,y,u,v,w,S,h]);return I6({contextId:t,store:g,registry:h,customSensors:r,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,E.useEffect)((function(){return x}),[x]),k().createElement(u6.Provider,{value:C},k().createElement(a1,{context:r6,store:g},e.children))}var F6=0;function L6(e){var t=B1((function(){return""+F6++}),[]),n=e.dragHandleUsageInstructions||"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n";return k().createElement(i2,null,(function(r){return k().createElement(R6,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)}))}var B6=function(e){return function(t){return e===t}},N6=B6("scroll"),z6=B6("auto"),V6=(B6("visible"),function(e,t){return t(e.overflowX)||t(e.overflowY)}),U6=function e(t){return null==t||t===document.body||t===document.documentElement?null:function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return V6(n,N6)||V6(n,z6)}(t)?t:e(t.parentElement)},H6=function(e){return{x:e.scrollLeft,y:e.scrollTop}},G6=function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))},W6={passive:!1},q6={passive:!0},$6=function(e){return e.shouldPublishImmediately?W6:q6};function Z6(e){var t=(0,E.useContext)(e);return t||r2(!1),t}var Y6=function(e){return e&&e.env.closestScrollable||null};function Q6(){}var K6={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},X6=k().memo((function(e){var t=(0,E.useRef)(null),n=N1((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),r=e.animate,i=e.onTransitionEnd,o=e.onClose,a=e.contextId,s=(0,E.useState)("open"===e.animate),l=s[0],c=s[1];(0,E.useEffect)((function(){return l?"open"!==r?(n(),c(!1),Q6):t.current?Q6:(t.current=setTimeout((function(){t.current=null,c(!1)})),n):Q6}),[r,l,n]);var u=N1((function(e){"height"===e.propertyName&&(i(),"close"===r&&o())}),[r,o,i]),f=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,i=function(e){var t=e.placeholder;return e.isAnimatingOpenOnMount||"close"===e.animate?K6:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}}({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:i.width,height:i.height,marginTop:i.margin.top,marginRight:i.margin.right,marginBottom:i.margin.bottom,marginLeft:i.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?t3.placeholder:null}}({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return k().createElement(e.placeholder.tagName,{style:f,"data-rbd-placeholder-context-id":a,onTransitionEnd:u,ref:e.innerRef})})),J6=k().createContext(null),e4=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state={isVisible:Boolean(t.props.on),data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return(0,Dt.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(k().PureComponent),t4=5e3,n4=4500,r4=function(e,t){return t?t3.drop(t.duration):e?t3.snap:t3.fluid},i4=function(e,t){return e?t?K5:X5:null};function o4(e){e.preventDefault()}var a4=function(e,t){return e===t},s4=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function l4(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var c4={mapped:{type:"SECONDARY",offset:d2,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:l4(null)}},u4=R1((function(){var e,t,n,r=(e=Ca((function(e,t){return{x:e,y:t}})),t=Ca((function(e,t,n,r,i){return{isDragging:!0,isClone:t,isDropAnimating:Boolean(i),dropAnimation:i,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}})),n=Ca((function(e,n,r,i,o,a,s){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:o,combineWith:a,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,i,o,a,null)}}})),function(r,i){if(r.isDragging){if(r.critical.draggable.id!==i.draggableId)return null;var o=r.current.client.offset,a=r.dimensions.draggables[i.draggableId],s=g5(r.impact),l=(u=r.impact).at&&"COMBINE"===u.at.type?u.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(o.x,o.y),r.movementMode,a,i.isClone,s,l,c)}var u;if("DROP_ANIMATING"===r.phase){var f=r.completed;if(f.result.draggableId!==i.draggableId)return null;var d=i.isClone,p=r.dimensions.draggables[i.draggableId],h=f.result,y=h.mode,m=s4(h),v=function(e){return e.combine?e.combine.draggableId:null}(h),g={duration:r.dropDuration,curve:Q5,moveTo:r.newHomeClientOffset,opacity:v?K5:null,scale:v?J5:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:p,dropping:g,draggingOver:m,combineWith:v,mode:y,forceShouldAnimate:null,snapshot:t(y,d,m,v,g)}}}return null}),i=function(){var e=Ca((function(e,t){return{x:e,y:t}})),t=Ca(l4),n=Ca((function(e,n,r){return void 0===n&&(n=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}})),r=function(e){return e?n(d2,e,!0):null},i=function(t,i,o,a){var s=o.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=F2(o),u=c&&c.draggableId===t?i:null;if(!s){if(!l)return r(u);if(o.displaced.invisible[t])return null;var f=m2(a.displacedBy.point),d=e(f.x,f.y);return n(d,u,!0)}if(l)return r(u);var p=o.displacedBy.point,h=e(p.x,p.y);return n(h,u,s.shouldAnimate)};return function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:i(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var n=e.completed;return n.result.draggableId===t.draggableId?null:i(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return function(e,t){return r(e,t)||i(e,t)||c4}}),{dropAnimationFinished:function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}}},null,{context:r6,pure:!0,areStatePropsEqual:a4})((function(e){var t=(0,E.useRef)(null),n=N1((function(e){t.current=e}),[]),r=N1((function(){return t.current}),[]),i=Z6(u6),o=i.contextId,a=i.dragHandleUsageInstructionsId,s=i.registry,l=Z6(J6),c=l.type,u=l.droppableId,f=B1((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:u}}),[e.draggableId,e.index,c,u]),d=e.children,p=e.draggableId,h=e.isEnabled,y=e.shouldRespectForcePress,m=e.canDragInteractiveElements,v=e.isClone,g=e.mapped,x=e.dropAnimationFinished;v||function(e){var t=c6("draggable"),n=e.descriptor,r=e.registry,i=e.getDraggableRef,o=e.canDragInteractiveElements,a=e.shouldRespectForcePress,s=e.isEnabled,l=B1((function(){return{canDragInteractiveElements:o,shouldRespectForcePress:a,isEnabled:s}}),[o,s,a]),c=N1((function(e){var t=i();return t||r2(!1),function(e,t,n){void 0===n&&(n=d2);var r=window.getComputedStyle(t),i=t.getBoundingClientRect(),o=Z1(i,r),a=$1(o,n);return{descriptor:e,placeholder:{client:o,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:o.marginBox.width,y:o.marginBox.height},client:o,page:a}}(n,t,e)}),[n,i]),u=B1((function(){return{uniqueId:t,descriptor:n,options:l,getDimension:c}}),[n,c,l,t]),f=(0,E.useRef)(u),d=(0,E.useRef)(!0);K3((function(){return r.draggable.register(f.current),function(){return r.draggable.unregister(f.current)}}),[r.draggable]),K3((function(){if(d.current)d.current=!1;else{var e=f.current;f.current=u,r.draggable.update(u,e)}}),[u,r.draggable])}(B1((function(){return{descriptor:f,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:y,isEnabled:h}}),[f,s,r,m,y,h]));var b=B1((function(){return h?{tabIndex:0,role:"button","aria-describedby":a,"data-rbd-drag-handle-draggable-id":p,"data-rbd-drag-handle-context-id":o,draggable:!1,onDragStart:o4}:null}),[o,a,p,h]),w=N1((function(e){"DRAGGING"===g.type&&g.dropping&&"transform"===e.propertyName&&x()}),[x,g]),S=B1((function(){var e=function(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,n=e.offset,r=e.combineWith,i=e.dropping,o=Boolean(r),a=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),s=Boolean(i),l=s?i3(n,o):r3(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:r4(a,i),transform:l,opacity:i4(o,s),zIndex:s?n4:t4,pointerEvents:"none"}}(e):{transform:r3((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}(g),t="DRAGGING"===g.type&&g.dropping?w:null;return{innerRef:n,draggableProps:{"data-rbd-draggable-context-id":o,"data-rbd-draggable-id":p,style:e,onTransitionEnd:t},dragHandleProps:b}}),[o,b,p,g,w,n]),C=B1((function(){return{draggableId:f.id,type:f.type,source:{index:f.index,droppableId:f.droppableId}}}),[f.droppableId,f.id,f.index,f.type]);return d(S,g.snapshot,C)}));function f4(e){return Z6(J6).isUsingCloneFor!==e.draggableId||e.isClone?k().createElement(u4,e):null}function d4(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return k().createElement(f4,(0,Lt.Z)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var p4,h4=function(e,t){return e===t.droppable.type},y4=function(e,t){return t.draggables[e.draggable.id]},m4={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||r2(!1),document.body}},v4=R1((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=(0,Lt.Z)({},e,{shouldAnimatePlaceholder:!1}),n=Ca((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),r=Ca((function(r,i,o,a,s,l){var c=s.descriptor.id;if(s.descriptor.droppableId===r){var u=l?{render:l,dragging:n(s.descriptor)}:null,f={isDraggingOver:o,draggingOverWith:o?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:f,useClone:u}}if(!i)return t;if(!a)return e;var d={isDraggingOver:o,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:d,useClone:null}}));return function(n,i){var o=i.droppableId,a=i.type,s=!i.isDropDisabled,l=i.renderClone;if(n.isDragging){var c=n.critical;if(!h4(a,c))return t;var u=y4(c,n.dimensions),f=g5(n.impact)===o;return r(o,s,f,f,u,l)}if("DROP_ANIMATING"===n.phase){var d=n.completed;if(!h4(a,d.critical))return t;var p=y4(d.critical,n.dimensions);return r(o,s,s4(d.result)===o,g5(d.impact)===o,p,l)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var h=n.completed;if(!h4(a,h.critical))return t;var y=g5(h.impact)===o,m=Boolean(h.impact.at&&"COMBINE"===h.impact.at.type),v=h.critical.droppable.id===o;return y?m?e:t:v?e:t}return t}}),{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:r6,pure:!0,areStatePropsEqual:a4})((function(e){var t=(0,E.useContext)(u6);t||r2(!1);var n=t.contextId,r=t.isMovementAllowed,i=(0,E.useRef)(null),o=(0,E.useRef)(null),a=e.children,s=e.droppableId,l=e.type,c=e.mode,u=e.direction,f=e.ignoreContainerClipping,d=e.isDropDisabled,p=e.isCombineEnabled,h=e.snapshot,y=e.useClone,m=e.updateViewportMaxScroll,v=e.getContainerForClone,g=N1((function(){return i.current}),[]),x=N1((function(e){i.current=e}),[]),b=(N1((function(){return o.current}),[]),N1((function(e){o.current=e}),[])),w=N1((function(){r()&&m({maxScroll:b3()})}),[r,m]);!function(e){var t=(0,E.useRef)(null),n=Z6(u6),r=c6("droppable"),i=n.registry,o=n.marshal,a=f6(e),s=B1((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),l=(0,E.useRef)(s),c=B1((function(){return Ca((function(e,n){t.current||r2(!1);var r={x:e,y:n};o.updateDroppableScroll(s.id,r)}))}),[s.id,o]),u=N1((function(){var e=t.current;return e&&e.env.closestScrollable?H6(e.env.closestScrollable):d2}),[]),f=N1((function(){var e=u();c(e.x,e.y)}),[u,c]),d=B1((function(){return Q1(f)}),[f]),p=N1((function(){var e=t.current,n=Y6(e);e&&n||r2(!1),e.scrollOptions.shouldPublishImmediately?f():d()}),[d,f]),h=N1((function(e,r){t.current&&r2(!1);var i=a.current,o=i.getDroppableRef();o||r2(!1);var l=function(e){return{closestScrollable:U6(e),isFixedOnPage:G6(e)}}(o),c={ref:o,descriptor:s,env:l,scrollOptions:r};t.current=c;var u=function(e){var t=e.ref,n=e.descriptor,r=e.env,i=e.windowScroll,o=e.direction,a=e.isDropDisabled,s=e.isCombineEnabled,l=e.shouldClipSubject,c=r.closestScrollable,u=function(e,t){var n=Y1(e);if(!t)return n;if(e!==t)return n;var r=n.paddingBox.top-t.scrollTop,i=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,a=i+t.scrollWidth,s=V1({top:r,right:a,bottom:o,left:i},n.border);return G1({borderBox:s,margin:n.margin,border:n.border,padding:n.padding})}(t,c),f=$1(u,i),d=function(){if(!c)return null;var e=Y1(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:$1(e,i),scroll:H6(c),scrollSize:t,shouldClipSubject:l}}(),p=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,i=e.isFixedOnPage,o=e.direction,a=e.client,s=e.page,l=e.closest,c=function(){if(!l)return null;var e=l.scrollSize,t=l.client,n=g3({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:n,diff:{value:d2,displacement:d2}}}}(),u="vertical"===o?W2:q2;return{descriptor:t,isCombineEnabled:r,isFixedOnPage:i,axis:u,isEnabled:n,client:a,page:s,frame:c,subject:E2({page:s,withPlaceholder:null,axis:u,frame:c})}}({descriptor:n,isEnabled:!a,isCombineEnabled:s,isFixedOnPage:r.isFixedOnPage,direction:o,client:u,page:f,closest:d});return p}({ref:o,descriptor:s,env:l,windowScroll:e,direction:i.direction,isDropDisabled:i.isDropDisabled,isCombineEnabled:i.isCombineEnabled,shouldClipSubject:!i.ignoreContainerClipping}),f=l.closestScrollable;return f&&(f.setAttribute(Z3.contextId,n.contextId),f.addEventListener("scroll",p,$6(c.scrollOptions))),u}),[n.contextId,s,p,a]),y=N1((function(){var e=t.current,n=Y6(e);return e&&n||r2(!1),H6(n)}),[]),m=N1((function(){var e=t.current;e||r2(!1);var n=Y6(e);t.current=null,n&&(d.cancel(),n.removeAttribute(Z3.contextId),n.removeEventListener("scroll",p,$6(e.scrollOptions)))}),[p,d]),v=N1((function(e){var n=t.current;n||r2(!1);var r=Y6(n);r||r2(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),g=B1((function(){return{getDimensionAndWatchScroll:h,getScrollWhileDragging:y,dragStopped:m,scroll:v}}),[m,h,y,v]),x=B1((function(){return{uniqueId:r,descriptor:s,callbacks:g}}),[g,s,r]);K3((function(){return l.current=x.descriptor,i.droppable.register(x),function(){t.current&&m(),i.droppable.unregister(x)}}),[g,s,m,x,o,i.droppable]),K3((function(){t.current&&o.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)}),[e.isDropDisabled,o]),K3((function(){t.current&&o.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,o])}({droppableId:s,type:l,mode:c,direction:u,isDropDisabled:d,isCombineEnabled:p,ignoreContainerClipping:f,getDroppableRef:g});var S=k().createElement(e4,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,r=e.data,i=e.animate;return k().createElement(X6,{placeholder:r,onClose:t,innerRef:b,animate:i,contextId:n,onTransitionEnd:w})})),C=B1((function(){return{innerRef:x,placeholder:S,droppableProps:{"data-rbd-droppable-id":s,"data-rbd-droppable-context-id":n}}}),[n,s,S,x]),_=y?y.dragging.draggableId:null,O=B1((function(){return{droppableId:s,type:l,isUsingCloneFor:_}}),[s,_,l]);return k().createElement(J6.Provider,{value:O},a(C,h),function(){if(!y)return null;var e=y.dragging,t=y.render,n=k().createElement(f4,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(n,r){return t(n,r,e)}));return rt().createPortal(n,v())}())}));function g4(){return g4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g4.apply(this,arguments)}v4.defaultProps=m4;const x4=tt((function(e){return E.createElement("svg",g4({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),p4||(p4=E.createElement("g",{fill:"#E84C3D"},E.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0-.187-.187-.292-.44-.292-.705 0-.265.105-.518.292-.705L10.59 12 7.7 9.11c-.187-.187-.292-.44-.292-.705 0-.265.105-.518.292-.705.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41z"}))))}))(b4||(b4=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(e){return e.width||"16px"}),(function(e){return e.height||"16px"}),(function(e){return e.color||"currentColor"}),(function(e){return e.color||"currentColor"}),(function(e){return e.opacity||"inherit"}));var b4,w4,S4,C4,E4,k4,_4,O4,P4,T4,A4,j4,I4,M4,D4,R4,F4,L4,B4,N4,z4,V4,U4,H4,G4,W4,q4=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$4=function(){return $4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$4.apply(this,arguments)},Z4=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Y4=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Q4=tt.div(w4||(w4=q4(["\n background-color: ",";\n height: 100%;\n width: auto;\n"],["\n background-color: ",";\n height: 100%;\n width: auto;\n"])),Ci),K4=tt.div(S4||(S4=q4(["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: column;\n margin-bottom: -36px;\n min-height: 400px;\n width: 100%;\n margin-top: 15px;\n"],["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: column;\n margin-bottom: -36px;\n min-height: 400px;\n width: 100%;\n margin-top: 15px;\n"]))),X4=tt.div(C4||(C4=q4(["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: row;\n width: 100%;\n padding-bottom: 115px;\n padding-left: 8px;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin-top: 10px;\n"],["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: row;\n width: 100%;\n padding-bottom: 115px;\n padding-left: 8px;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin-top: 10px;\n"]))),J4=tt.div(k4||(k4=q4(["\n padding-top: 67px; /* SUS-905 changes */\n margin-top: ","px;\n display: flex;\n flex-direction: column;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n margin-top: 8px;\n ","\n"],["\n padding-top: 67px; /* SUS-905 changes */\n margin-top: ","px;\n display: flex;\n flex-direction: column;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n margin-top: 8px;\n ","\n"])),(function(e){return e.marginTop||0}),(function(e){return e.theme.containerWidth<=ti&&Ne(E4||(E4=q4(["\n padding-top: 0;\n margin-top: 16px;\n "],["\n padding-top: 0;\n margin-top: 16px;\n "])))})),e9=tt.div(_4||(_4=q4(["\n float: left;\n flex-direction: column;\n width: ",";\n div {\n margin-top: 3.5px;\n }\n"],["\n float: left;\n flex-direction: column;\n width: ",";\n div {\n margin-top: 3.5px;\n }\n"])),(function(e){return e.width?"".concat(e.width,"px"):"100%"})),t9=tt.div(O4||(O4=q4(["\n display: flex;\n flex-direction: column;\n width: ",";\n max-width: calc(100% - 48px);\n margin-bottom: 8px;\n"],["\n display: flex;\n flex-direction: column;\n width: ",";\n max-width: calc(100% - 48px);\n margin-bottom: 8px;\n"])),(function(e){return e.width?"".concat(e.width,"px"):"100%"})),n9=tt.div(T4||(T4=q4(["\n position: relative;\n height: ",";\n min-height: ","; /* SUS-905 changes */\n overflow-x: auto;\n overflow-y: hidden;\n width: 80%;\n padding-top: 39px; /* SUS-905 changes */\n ","\n padding-bottom: 10px;\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: none; /* Firefox */\n ::-webkit-scrollbar {\n display: none;\n }\n\n -ms-overflow-style: scrollbar;\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n height: 4px; /* SUS-905 changes */\n }\n ::-webkit-scrollbar-track {\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 27, 83, 0.2);\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: rgba(0, 27, 83, 0.4);\n }\n"],["\n position: relative;\n height: ",";\n min-height: ","; /* SUS-905 changes */\n overflow-x: auto;\n overflow-y: hidden;\n width: 80%;\n padding-top: 39px; /* SUS-905 changes */\n ","\n padding-bottom: 10px;\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: none; /* Firefox */\n ::-webkit-scrollbar {\n display: none;\n }\n\n -ms-overflow-style: scrollbar;\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n height: 4px; /* SUS-905 changes */\n }\n ::-webkit-scrollbar-track {\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 27, 83, 0.2);\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: rgba(0, 27, 83, 0.4);\n }\n"])),(function(e){return e.height?"".concat(e.height,"px"):""}),(function(e){return e.height?"".concat(e.height+7,"px"):""}),(function(e){return e.theme.containerWidth<=ti&&Ne(P4||(P4=q4(["\n padding-top: 0;\n margin-top: 16px;\n "],["\n padding-top: 0;\n margin-top: 16px;\n "])))}),Ci),r9=tt.div(A4||(A4=q4(["\n position: absolute;\n width: 100%;\n"],["\n position: absolute;\n width: 100%;\n"]))),i9=tt.div(j4||(j4=q4(["\n padding: 32px;\n height: 10px; /* SUS-905 changes */\n width: calc(100%- 64px);\n display: flex;\n justify-content: space-between;\n"],["\n padding: 32px;\n height: 10px; /* SUS-905 changes */\n width: calc(100%- 64px);\n display: flex;\n justify-content: space-between;\n"]))),o9=tt.div(M4||(M4=q4(["\n display: flex;\n justify-content: center;\n margin-bottom: 32px;\n border-radius: 6px;\n margin-top: 5%;\n ","\n"],["\n display: flex;\n justify-content: center;\n margin-bottom: 32px;\n border-radius: 6px;\n margin-top: 5%;\n ","\n"])),(function(e){return e.theme.containerWidth<=ti&&Ne(I4||(I4=q4(["\n margin-top: 0;\n border-radius: 0;\n margin-bottom: 0;\n "],["\n margin-top: 0;\n border-radius: 0;\n margin-bottom: 0;\n "])))})),a9=tt.div(D4||(D4=q4(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 20px;\n"],["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 20px;\n"]))),s9=tt.div(R4||(R4=q4(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 8px;\n"],["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 8px;\n"]))),l9=tt.div(F4||(F4=q4(["\n width: ","px;\n height: ","px;\n border-left: 1px solid rgba(0, 27, 83, 0.2);\n border-right: ",";\n"],["\n width: ","px;\n height: ","px;\n border-left: 1px solid rgba(0, 27, 83, 0.2);\n border-right: ",";\n"])),(function(e){return e.width||20}),(function(e){return e.inside?6:8}),(function(e){return e.rightBorder&&"1px solid rgba(0, 27, 83, 0.2)"})),c9=tt.div(L4||(L4=q4(["\n font-size: 12px;\n line-height: 1.43;\n color: #001b53;\n width: ","px;\n height: 20px;\n display: flex;\n justify-content: space-between;\n"],["\n font-size: 12px;\n line-height: 1.43;\n color: #001b53;\n width: ","px;\n height: 20px;\n display: flex;\n justify-content: space-between;\n"])),(function(e){return e.width||220})),u9=tt.div(B4||(B4=q4(["\n background: #ffffff;\n border-top-right-radius: 16px;\n border-bottom-right-radius: 16px;\n padding-left: 2px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n height: 80px;\n margin-bottom: 8px;\n position: relative;\n"],["\n background: #ffffff;\n border-top-right-radius: 16px;\n border-bottom-right-radius: 16px;\n padding-left: 2px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n height: 80px;\n margin-bottom: 8px;\n position: relative;\n"]))),f9=tt.div(N4||(N4=q4(["\n min-width: 20px;\n margin-left: 0;\n margin-right: 12px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: ",";\n opacity: ",";\n height: 40px;\n width: 46px;\n border-radius: 4px;\n transition: width 0.2s ease;\n overflow: hidden;\n"],["\n min-width: 20px;\n margin-left: 0;\n margin-right: 12px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: ",";\n opacity: ",";\n height: 40px;\n width: 46px;\n border-radius: 4px;\n transition: width 0.2s ease;\n overflow: hidden;\n"])),(function(e){return e.disabled?"default":"pointer"}),(function(e){return e.disabled?"0.5":"1"})),d9=tt.div(z4||(z4=q4(["\n display: block;\n height: 40px;\n border-radius: 4px;\n color: white;\n button {\n border-radius: 4px;\n }\n"],["\n display: block;\n height: 40px;\n border-radius: 4px;\n color: white;\n button {\n border-radius: 4px;\n }\n"]))),p9=tt.div(V4||(V4=q4(["\n width: 221px;\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n display: flex;\n gap: 13px;\n align-items: center;\n background: #ffffff;\n border: 1px solid rgba(0, 27, 83, 0.1);\n border-radius: 6px;\n margin-bottom: 20px;\n"],["\n width: 221px;\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n display: flex;\n gap: 13px;\n align-items: center;\n background: #ffffff;\n border: 1px solid rgba(0, 27, 83, 0.1);\n border-radius: 6px;\n margin-bottom: 20px;\n"]))),h9=tt.div(U4||(U4=q4(["\n position: absolute;\n right: 15px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"],["\n position: absolute;\n right: 15px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]))),y9=function(e){var n=e.videos,r=void 0===n?[]:n,i=e.setVideos,o=void 0===i?function(){}:i,a=Mt().containerWidth,s=dn(),l=Z4((0,E.useState)(0),2),c=l[0],u=l[1],f=Z4((0,E.useState)(0),2),d=f[0],p=f[1],h=Z4((0,E.useState)(0),2),y=h[0],v=h[1],g=Z4((0,E.useState)(0),2),x=g[0],b=g[1],w=Z4((0,E.useState)(10),2),S=w[0],C=w[1],k=Z4((0,E.useState)(20),2),_=k[0],O=k[1];(0,E.useEffect)((function(){u(r.reduce((function(e,t){return e+t.duration}),0)||0),p(r.reduce((function(e,t){return e+t.trimDuration}),0)||0)}),[r]),(0,E.useEffect)((function(){b(60+100*r.length)}),[r]),(0,E.useEffect)((function(){!function(){var e=Math.max(function(e,t){return e>0?Math.ceil(e/t)*t:t}(c*S,S),a-223);v(e),O(Math.round(e/S))}()}),[c,S,a]);var P=function(e){if(1===r.length)return s.push("/"),void window.localStorage.removeItem(m.merge);try{var t=localStorage.getItem(m.merge),n=r[e],i=(JSON.parse(t||"")||[]).filter((function(e){return e.id.toString()!==n.id.toString()}));localStorage.setItem(m.merge,JSON.stringify(i))}catch(e){console.log(e)}o((function(t){var n=Y4([],Z4(t),!1);return n.splice(e,1),n}))},T=function(e,t){o((function(n){var r=Y4([],Z4(n),!1);return r[e].ref=t,r}))},A=function(e){if(0===e)return 0;var t=r[e-1],n=r[e];return 1===e?t.endSec*S-n.startSec*S:t.trimDuration*S+t.startSec*S-n.startSec*S+A(e-1)};return(0,t.jsxs)(Q4,{children:[(0,t.jsx)(o9,{children:r&&!!r.length&&(0,t.jsx)(W0,{width:592,height:332,displayVideos:r})}),(0,t.jsxs)(K4,{children:[(0,t.jsxs)(i9,{children:[(0,t.jsx)(d9,{children:(0,t.jsx)(yo,{backgroundColor:di,textColor:Si,fontSize:"15px",padding:"8px 16px 8px 10px",icon:(0,t.jsx)(YL,{color:Bi,height:21,width:21}),text:"Add More Videos",onClick:function(){s.push("/?add-more")}})}),a>ti&&(0,t.jsxs)(p9,{children:[(0,t.jsx)(f9,$4({onClick:function(){return S>10&&C(S-5)},disabled:10===S},{children:(0,t.jsx)(v0,{width:24,height:24,color:Bi})})),(0,t.jsx)("input",{type:"range",onChange:function(e){return C(e.target.value)},min:10,max:200,value:S,style:{width:"200px",height:"4px",backgroundColor:"#d0d3d9",boxShadow:"0px 0px 4px rgba(66, 79, 104, 0.08),0px 6px 12px rgba(66, 79, 104, 0.06)"}}),(0,t.jsx)(f9,$4({onClick:function(){return S<200&&C(S+5)},disabled:200===S},{children:(0,t.jsx)(S0,{width:24,height:24,color:Bi})}))]})]}),(0,t.jsxs)(X4,{children:[(0,t.jsx)(J4,{children:(0,t.jsx)(L6,$4({onDragEnd:function(e){return t=void 0,n=void 0,a=function(){var t;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(n){return e.destination?(t=function(e,t,n){var r=Array.from(e),i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(r.splice(t,1),1)[0];return r.splice(n,0,i),r}(r,e.source.index,e.destination.index),o(t),[2]):[2]}))},new((i=void 0)||(i=Promise))((function(e,r){function o(e){try{l(a.next(e))}catch(e){r(e)}}function s(e){try{l(a.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,s)}l((a=a.apply(t,n||[])).next())}));var t,n,i,a}},{children:(0,t.jsx)(v4,$4({droppableId:"videos"},{children:function(e){return(0,t.jsxs)("div",$4({ref:e.innerRef},e.droppableProps,{children:[r.map((function(e,n){return(0,t.jsx)(d4,$4({draggableId:e.id,index:n},{children:function(r){return(0,t.jsx)("div",$4({ref:r.innerRef},r.draggableProps,r.dragHandleProps,{children:(0,t.jsx)(y0,{index:n,video:e,setVideos:o,removeVideo:P,setVideoRef:T},"".concat(e.id).concat(n,"thumb"))}))}}),e.id)})),e.placeholder]}))}}))}))}),(0,t.jsxs)(n9,$4({height:x,id:"row-container"},{children:[a>ti&&(0,t.jsxs)(t9,$4({width:y},{children:[(0,t.jsx)(a9,{children:Y4([],Z4(Array(Math.round(_/12)).keys()),!1).map((function(e){return(0,t.jsxs)(c9,$4({width:12*S},{children:[(0,t.jsx)("span",{children:St(12*e,0)}),e+1===Math.round(_/12)&&(0,t.jsx)("span",{children:St(12*(e+1),0)})]}),e)}))}),(0,t.jsx)(s9,{children:Y4([],Z4(Array(_).keys()),!1).map((function(e){return(0,t.jsx)(l9,{width:S-1,rightBorder:e+1===_,inside:e>=r[0].startSec&&e<=r[0].startSec+d},e)}))})]})),(0,t.jsx)(r9,{children:r.map((function(e,n){return(0,t.jsx)(u9,{children:(0,t.jsx)(h9,{children:(0,t.jsx)(x4,{onClick:function(){return P(n)},height:24,width:24,color:"rgba(232, 76, 61, 0.6)"})})},"".concat(e.id).concat(n))}))}),a>ti&&(0,t.jsx)(e9,{children:r.map((function(e,n){return(0,t.jsx)(XJ,{index:n,totalDuration:c,offset:A(n),width:e.duration*S,video:e,setVideos:o},"".concat(e.id).concat(n,"row"))}))})]}))]})]})]})},m9=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},v9=function(){return v9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},v9.apply(this,arguments)},g9=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},x9=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},b9=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},w9=tt.main(H4||(H4=m9(["\n background: ",";\n"],["\n background: ",";\n"])),Ci),S9=tt.div(G4||(G4=m9(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: ",";\n"])),Si),C9=function(){var e=localStorage.getItem(m.merge),n=JSON.parse(e),r={};null==n||n.forEach((function(e){r[e.id]=e}));var i=fn(en).location,o=(new URLSearchParams(i.search).get("videos")||"").split(",").filter(Boolean),a=b9((0,E.useState)(o.map((function(e){return{id:e}}))),2),s=a[0],l=a[1],c=dn(),u=b9(E.useState(!1),2),f=u[0],d=u[1],p=b9(E.useState(!1),2),h=p[0],y=p[1],v=b9(E.useState(!0),2),g=v[0],x=v[1];return(0,E.useEffect)((function(){x(!0),Object.values(r).forEach((function(e){return g9(void 0,void 0,void 0,(function(){var t;return x9(this,(function(n){switch(n.label){case 0:return[4,Wn(e.id)];case 1:return t=n.sent(),l((function(n){return function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],b9(n),!1).map((function(n){return n.id.toString()===e.id.toString()?v9(v9(v9({},e),n),{source:t.videoSource,flvName:t.flvName+".mp4",start:"00:00:00:00"}):n}))})),[2]}}))}))})),x(!1)}),[]),g?(0,t.jsx)(Eo,{isLoading:g}):(0,t.jsxs)(w9,{children:[s.length>=2&&(0,t.jsx)(KW,{when:!0,navigate:function(e){c.push(e)},stay:!0,onStay:function(){return d(!0)},onConfirm:function(){},shouldBlockNavigation:function(e){return function(e){return("/"!==e.pathname||"?add-more"!==e.search&&"?merged"!==e.search)&&!h}(e)}}),(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){window.localStorage.removeItem(m.merge),c.push("/")}}),center:(0,t.jsx)(S9,{children:"Merge Videos"}),right:(0,t.jsx)(yo,{onClick:function(){return d(!0)},text:"Save",disabled:(null==s?void 0:s.length)<2,textColor:di,backgroundColor:Qi,fontSize:"15px"})}),(0,t.jsx)(y9,{videos:s,setVideos:l}),f&&(0,t.jsx)(XX,{title:"Name new video",label:"Give your new video a name",defaultValue:"",secondaryButtonText:"Go Back",primaryButtonText:"Save Video",handleSubmit:function(e){return t=e,g9(void 0,void 0,void 0,(function(){var e;return x9(this,(function(n){switch(n.label){case 0:return window.localStorage.removeItem(m.merge),e=1e3*s.reduce((function(e,t){return e+t.trimDuration}),0),[4,(r={videos:s.map((function(e){return{start:e.start,end:e.end,id:e.id,flvName:e.flvName}})),videoName:t,duration:e},Ln(void 0,void 0,void 0,(function(){var e,t,n;return Bn(this,(function(i){switch(i.label){case 0:return e=S.headers,t={url:"/videos/merge",baseURL:b,method:Vn,data:r,headers:{Authorization:"Bearer ".concat(e.Authorization)}},[4,Tn(t).catch((function(e){return e}))];case 1:if((n=i.sent())instanceof Error)throw n;return[2,n]}}))})))];case 1:return n.sent(),y(!0),c.push("/?merged"),[2]}var r}))}));var t},handleModalClose:function(){return d(!1)}})]})},E9=tt.div(W4||(W4=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"],["\n font-family: 'Work Sans', sans-serif;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: #1c6acf;\n"]))),k9=function(e){var n=e.onSaveVideo,r=e.isSaveDisabled,i=e.setInsertAfterSave,o=e.uploadLoading,a=dn(),s=Mt().showInsertFeature;return(0,t.jsx)(io,{left:(0,t.jsx)(yo,{text:"Back",backgroundColor:"transparent",borderColor:"transparent",textColor:Pi,icon:(0,t.jsx)(Vc,{size:"18"}),onClick:function(){a.push("/")}}),center:(0,t.jsx)(E9,{children:""}),right:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(yo,{onClick:function(){n()},text:"Save",disabled:r||o,textColor:Bi,backgroundColor:zi,borderColor:zi,fontSize:"15px",icon:o?(0,t.jsx)(go,{size:12,color:Bi}):(0,t.jsx)(TW,{height:"15px"})}),s&&(0,t.jsx)(yo,{onClick:function(){i(!0),n()},text:"Continue to Insert",disabled:r||o,textColor:di,backgroundColor:Ti,borderColor:ji,fontSize:"15px"})]})})},_9=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},O9={id:"",title:"",recordDate:"",views:"0",videoLength:0,thumbnail:"",videoSource:"",tags:[],videoRequest:{videoRequestId:"0"},folder:""};const P9=function(){var e=pn().videoId,n=_9((0,E.useState)(O9),2),r=n[0],i=n[1],o=_9((0,E.useState)(!0),2),a=o[0],s=o[1],l=_9((0,E.useState)(),2),c=l[0],u=l[1],f=_9((0,E.useState)(!1),2),d=f[0],p=f[1],h=_9((0,E.useState)(!1),2),y=h[0],m=h[1],v=_9((0,E.useState)(!1),2),g=v[0],x=v[1];return(0,E.useEffect)((function(){var t,n,o,a;r.id||(t=void 0,n=void 0,a=function(){var t;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(n){switch(n.label){case 0:return e?[4,Wn(e)]:[2];case 1:return(t=n.sent())&&(i(t),s(!1)),[2]}}))},new((o=void 0)||(o=Promise))((function(e,r){function i(e){try{l(a.next(e))}catch(e){r(e)}}function s(e){try{l(a.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}l((a=a.apply(t,n||[])).next())})))}),[]),a?(0,t.jsx)(Eo,{isLoading:a}):(0,t.jsxs)("div",{children:[(0,t.jsx)(k9,{onSaveVideo:c||function(){},setInsertAfterSave:p,isSaveDisabled:y,uploadLoading:g}),(0,t.jsx)(so,{children:(0,t.jsx)(aY,{recordingBlobUrl:r.videoSource,recordDate:r.recordDate,insertAfterSave:d,setSaveFunction:u,setIsSaveDisabled:m,skipUploadProcess:!0,videoId:e,initialTitle:r.title,updateUploadLoading:function(e){return x(e)}})})]})};var T9=function(){return T9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T9.apply(this,arguments)},A9=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},j9=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},I9=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},M9={id:"",verified:0,access:0,customerId:0,customer:{automotiveAccess:0}};const D9=function(){var e=this,n=I9((0,E.useState)(!0),2),r=n[0],i=n[1],o=I9((0,E.useState)(M9),2),a=o[0],s=o[1],l=function(){return A9(e,void 0,void 0,(function(){var e;return j9(this,(function(t){switch(t.label){case 0:if(!x)return s(M9),i(!1),[2];i(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,An(void 0,void 0,void 0,(function(){var e,t;return jn(this,(function(n){switch(n.label){case 0:return e=(C()||S).bearerToken,[4,Tn({url:"/auth/user",baseURL:b,method:In,headers:e}).catch((function(e){return e}))];case 1:if((t=n.sent())instanceof Error)throw t;return t.authCalled=!0,[2,t]}}))}))];case 2:return e=t.sent(),s(e),[3,4];case 3:return t.sent(),[3,4];case 4:return i(!1),[2]}}))}))},c=function(t){return A9(e,void 0,void 0,(function(){return j9(this,(function(e){switch(e.label){case 0:return w(t),[4,l()];case 1:return e.sent(),[2]}}))}))};(0,E.useEffect)((function(){l()}),[]);var u=!!(null==a?void 0:a.id);return r?(0,t.jsx)(tf,{children:(0,t.jsx)(Eo,{height:400,isLoading:!0})}):(0,t.jsx)(Bl,T9({initialUser:a},{children:(0,t.jsx)(FL,{children:(0,t.jsx)(Xu,{children:(0,t.jsx)(tf,{children:(0,t.jsxs)(nn,{children:[u&&(0,t.jsxs)(un,{children:[(0,t.jsx)(cn,{path:"/merge",component:C9,exact:!0}),(0,t.jsx)(cn,{path:"/voiceover/:videoId",component:uJ,exact:!0}),(0,t.jsx)(cn,{path:"/insert-video/:videoId",component:BG,exact:!0}),(0,t.jsx)(cn,{path:"/wheels-tv",component:WJ}),(0,t.jsx)(cn,{exact:!0,path:"/record/home",component:CW}),(0,t.jsx)(cn,{exact:!0,path:"/record/both",component:rQ}),(0,t.jsx)(cn,{exact:!0,path:"/record/cam",component:TQ}),(0,t.jsx)(cn,{exact:!0,path:"/record/screen",component:nK}),(0,t.jsx)(cn,{exact:!0,path:"/preview-upload/:videoId",component:P9}),(0,t.jsx)(cn,{exact:!0,path:"/",component:function(){return(0,t.jsx)(iz,{handleUpdateToken:c})}})]}),!u&&(0,t.jsx)(un,{children:(0,t.jsx)(cn,{exact:!0,path:"/",component:function(){return(0,t.jsx)(Sz,{handleUpdateToken:c})}})})]})})})})}))};var R9,F9,L9=function(){return L9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L9.apply(this,arguments)},B9=new v.QueryClient({defaultOptions:{queries:{retry:0},mutations:{retry:0}}});function N9(){w(""),Pt()}!function(e){e.UPLOAD="upload",e.FOLDER="folder",e.RECORD_SCREEN="recordScreen",e.MERGE="merge",e.RECORD_CAM="recordCam",e.WHEELS_TV="wheelsTV",e.RECORD_BOTH="recordBoth",e.TRIM="trim",e.INSERT="insert",e.LANDING_PAGE="landingPage",e.QUICKSHARE="quickshare",e.CTA="CTA",e.VOICEOVER="voiceover",e.REACTIONS="reactions",e.AI_ASSIST="aiAssist",e.UPGRADE_MESSAGE="upgradeMessage"}(R9||(R9={})),function(e){e.DEVELOPMENT="development",e.SANDBOX="sandbox",e.PRODUCTION="production"}(F9||(F9={}));var z9=function(e){return(0,t.jsx)(v.QueryClientProvider,L9({client:B9},{children:(0,t.jsx)(It,L9({},e,{children:(0,t.jsx)(D9,{},"".concat(null==e?void 0:e.env).concat(null==e?void 0:e.token))}))}))}})(),module.exports=__webpack_exports__})();