react-covideo-embed 1.0.82-test.2 → 1.0.83-flow.0
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/.eslintrc +56 -0
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/react-covideo-embed.esm.js +44 -38
- package/build/react-covideo-embed.esm.js.map +1 -1
- package/dist/app/pages/login/UsernameForm.d.ts +2 -1
- package/dist/app/pages/preview/PreviewVideoPlayer.d.ts +1 -0
- package/dist/app/pages/recordv1/ChooseRecordingOptions.d.ts +2 -1
- package/dist/app/pages/recordv1/ModalRecordingVideoSettings.d.ts +2 -1
- package/dist/app/pages/recordv1/RecordCam.d.ts +3 -1
- package/dist/app/pages/recordv1/RecordingHeadingWithRouteGuard.d.ts +2 -1
- package/dist/app/pages/recordv1/detailsPreview/DetailsPreview.d.ts +1 -1
- package/dist/app/pages/recordv1/detailsPreview/types.d.ts +2 -1
- package/dist/app/pages/video/components/videoPlayer/VideoPlayer.d.ts +2 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/api/analytics/analyticsKeys.d.ts +4 -0
- package/dist/lib/api/analytics/index.d.ts +4 -0
- package/dist/lib/api/analytics/types.d.ts +19 -0
- package/dist/lib/api/analytics/useUpdateStatsHotspotMutation.d.ts +3 -0
- package/dist/lib/api/analytics/useUpdateViewMutation.d.ts +3 -0
- package/dist/lib/api/analytics/useVideoShortUrlQuery.d.ts +5 -0
- package/dist/lib/api/analytics/utils.d.ts +1 -0
- package/dist/lib/api/index.d.ts +1 -0
- package/dist/lib/context/ConfigurationContext.d.ts +7 -1
- package/dist/react-covideo-embed.esm.js +2 -2
- package/package.json +42 -37
- package/.vscode/settings.json +0 -12
package/.eslintrc
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": true,
|
|
5
|
+
"es2020": true
|
|
6
|
+
},
|
|
7
|
+
"extends": [
|
|
8
|
+
/* "eslint:recommended",
|
|
9
|
+
"plugin:react/recommended",
|
|
10
|
+
"plugin:react-hooks/recommended",
|
|
11
|
+
"plugin:@typescript-eslint/recommended", */
|
|
12
|
+
"prettier"
|
|
13
|
+
],
|
|
14
|
+
"plugins": [
|
|
15
|
+
/* "react",
|
|
16
|
+
"react-hooks",
|
|
17
|
+
"@typescript-eslint", */
|
|
18
|
+
"unused-imports"
|
|
19
|
+
],
|
|
20
|
+
"parser": "@typescript-eslint/parser",
|
|
21
|
+
"parserOptions": {
|
|
22
|
+
"ecmaVersion": "latest",
|
|
23
|
+
"sourceType": "module",
|
|
24
|
+
"ecmaFeatures": { "jsx": true }
|
|
25
|
+
},
|
|
26
|
+
"settings": {
|
|
27
|
+
"react": { "version": "detect" }
|
|
28
|
+
},
|
|
29
|
+
"rules": {
|
|
30
|
+
"react/react-in-jsx-scope": "off",
|
|
31
|
+
"react/prop-types": "off",
|
|
32
|
+
"no-useless-escape": "warn",
|
|
33
|
+
"react-hooks/exhaustive-deps": "off",
|
|
34
|
+
"eqeqeq": "off",
|
|
35
|
+
"no-control-regex": "off",
|
|
36
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
37
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
38
|
+
"unused-imports/no-unused-imports": "warn",
|
|
39
|
+
"unused-imports/no-unused-vars": [
|
|
40
|
+
"warn",
|
|
41
|
+
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
"overrides": [
|
|
45
|
+
{
|
|
46
|
+
"files": ["**/*.ts?(x)"],
|
|
47
|
+
"rules": {
|
|
48
|
+
"no-useless-escape": "off",
|
|
49
|
+
"react-hooks/exhaustive-deps": "off",
|
|
50
|
+
"eqeqeq": "off",
|
|
51
|
+
"no-control-regex": "off",
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),we=require("react-query"),so=require("axios"),p=require("react"),Gs=require("react-resize-detector"),Ue=require("dayjs"),Ys=require("dayjs/plugin/utc"),Qs=require("dayjs/plugin/timezone"),ue=require("react-router-dom"),Zs=require("file-saver"),n=require("styled-components"),Ks=require("jwt-decode"),Y=require("react-icons/md"),F=require("react-covideo-common"),W=require("react-i18next"),Gt=require("lodash"),Ti=require("react-icons/ai"),ki=require("react-covideo-ai-assist"),be=require("react-icons/io"),rt=require("react-router"),Ii=require("react-icons/bs"),Ai=require("color-convert"),$i=require("react-full-screen"),Xs=require("react-select/creatable"),Qe=require("react-select"),ct=require("i18next"),Js=require("react-icons/bi"),Ri=require("react-icons/io5"),Ae=require("formik"),ea=require("yup"),Jt=require("react-compound-slider"),zo=require("react-beautiful-dnd"),Bo=require("react-spinners"),_o=require("rc-progress/lib"),ln=require("recordrtc"),jo=require("react-icons/fa"),ta=require("rc-progress"),oa=require("react-scroll"),dn=require("@mediapipe/tasks-vision"),ra=require("react-dropzone"),na=require("react-infinite-scroll-component"),ia=require("js-cookie"),un=require("droplr-api");function Vi(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const I=Vi(p),Le=Vi(ea),Li="React-Covideo-Embed-Version",br={default:"https://api-sandbox.covideo.com/",development:"https://localhost:3000/api/",sandbox:"https://api-sandbox.covideo.com/",staging:"https://api-staging.covideo.com/",production:"https://api.covideo.com/"};var Pe=(e=>(e.jwt="react-covideo-embed-jwt",e.merge="react-covideo-merge",e.recordSettings="record_settings",e.recordError="react-covideo-record-error",e))(Pe||{});let Be=localStorage.getItem("react-covideo-embed-jwt"),Mt=br.default,gt;const Eo=(e,o=!1)=>{o||localStorage.setItem("react-covideo-embed-jwt",e),Be=e,oe.defaults.headers.Authorization=`Bearer ${Be}`,Mr.headers.Authorization=`Bearer ${Be}`},sa=e=>{Mt=br[e]||br.default,oe.defaults.baseURL=Mt},aa=e=>{gt=e,oe.defaults.headers.ApiKey=gt,Mr.headers.ApiKey=gt};let Mr={headers:{Authorization:`Bearer ${Be}`,...gt!==void 0?{ApiKey:gt}:{},[Li]:"1.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),we=require("react-query"),so=require("axios"),p=require("react"),Gs=require("react-resize-detector"),Ue=require("dayjs"),Ys=require("dayjs/plugin/utc"),Qs=require("dayjs/plugin/timezone"),ue=require("react-router-dom"),Zs=require("file-saver"),n=require("styled-components"),Ks=require("jwt-decode"),Y=require("react-icons/md"),F=require("react-covideo-common"),W=require("react-i18next"),Gt=require("lodash"),Ti=require("react-icons/ai"),ki=require("react-covideo-ai-assist"),be=require("react-icons/io"),rt=require("react-router"),Ii=require("react-icons/bs"),Ai=require("color-convert"),$i=require("react-full-screen"),Xs=require("react-select/creatable"),Qe=require("react-select"),ct=require("i18next"),Js=require("react-icons/bi"),Ri=require("react-icons/io5"),Ae=require("formik"),ea=require("yup"),Jt=require("react-compound-slider"),zo=require("react-beautiful-dnd"),Bo=require("react-spinners"),_o=require("rc-progress/lib"),ln=require("recordrtc"),jo=require("react-icons/fa"),ta=require("rc-progress"),oa=require("react-scroll"),dn=require("@mediapipe/tasks-vision"),ra=require("react-dropzone"),na=require("react-infinite-scroll-component"),ia=require("js-cookie"),un=require("droplr-api");function Vi(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const I=Vi(p),Le=Vi(ea),Li="React-Covideo-Embed-Version",br={default:"https://api-sandbox.covideo.com/",development:"https://localhost:3000/api/",sandbox:"https://api-sandbox.covideo.com/",staging:"https://api-staging.covideo.com/",production:"https://api.covideo.com/"};var Pe=(e=>(e.jwt="react-covideo-embed-jwt",e.merge="react-covideo-merge",e.recordSettings="record_settings",e.recordError="react-covideo-record-error",e))(Pe||{});let Be=localStorage.getItem("react-covideo-embed-jwt"),Mt=br.default,gt;const Eo=(e,o=!1)=>{o||localStorage.setItem("react-covideo-embed-jwt",e),Be=e,oe.defaults.headers.Authorization=`Bearer ${Be}`,Mr.headers.Authorization=`Bearer ${Be}`},sa=e=>{Mt=br[e]||br.default,oe.defaults.baseURL=Mt},aa=e=>{gt=e,oe.defaults.headers.ApiKey=gt,Mr.headers.ApiKey=gt};let Mr={headers:{Authorization:`Bearer ${Be}`,...gt!==void 0?{ApiKey:gt}:{},[Li]:"1.0.83-flow.0"}};const oe=so.create({baseURL:Mt,headers:{"Content-Type":"application/json",Authorization:`Bearer ${Be}`,...gt!==void 0?{ApiKey:gt}:{},[Li]:"1.0.83-flow.0"}});Ue.extend(Ys);Ue.extend(Qs);const Mi=e=>e&&(Object.keys(e).forEach(o=>{if(typeof e[o]=="object")return Mi(e[o]);typeof e[o]!="boolean"&&(e[o]=""+e[o])}),e),pn=(e,o=30)=>{const r=Math.floor(e/3600),i=Math.floor((e-r*3600)/60);let s=e-r*3600-i*60;const c=parseInt((s%1).toFixed(3).substring(2));let a=parseInt(Math.floor(c/(1e3/o)).toFixed(0));if(s=parseInt(Math.floor(s).toFixed(0)),isNaN(i))return"00:00:00:00";let d="";return r<10&&(d="0"),d+=r+":",i<10&&(d+="0"),d+=i+":",s<10&&(d+="0"),d+=s+":",a<10&&(d+="0"),d+a},Dt=(e,o=1)=>{const r=Math.floor(e/3600),i=Math.floor((e-r*3600)/60),s=e-r*3600-i*60;if(isNaN(i))return"00:00.0";let c="";return i<10&&(c+="0"),c+=i+":",s<10&&(c+="0"),c+=s.toFixed(o),c},Di=(e,o)=>e.userId+"_"+e.customerId+"_"+(Math.random()+1).toString(36).substring(2)+"."+o,ca=()=>{const e=Ue(new Date).date();let o="th";return e===1||e===21||e===31?o="st":e===2||e===22?o="nd":(e===3||e===23)&&(o="rd"),Ue(new Date).format(`MMM D[${o}] YYYY @ h:mm A`)},la=(e,o,r="YYYY-MM-DD HH:mm:ss")=>{const i=o.timeZone||Intl.DateTimeFormat().resolvedOptions().timeZone||Ue.tz.guess(),s=Ue(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"]),c=-Ue().tz("America/New_York").utcOffset(),a=Ue().tz(i).utcOffset(),d=s.add(c,"minute");return Ue(d).add(a,"minute").format(r)},da=(e,o,r)=>{const i=Array.from(e),[s]=i.splice(o,1);return i.splice(r,0,s),i},Oi=({trimStart:e,trimEnd:o,videoDuration:r})=>r===0||o===0?!1:e!==0||r-o>.3,Pt=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Uo=e=>(e/1e3).toFixed(2);function ua(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ni(){for(let e in Pe)localStorage.removeItem(Pe[e])}const pa=(e,o=1)=>{const r=Math.floor(e/60),i=e-r*60;if(isNaN(r))return"00.0";let s="";return r<10&&(s+="0"),s+=r+":",i<10&&(s+="0"),s+=i.toFixed(o),s};function Yt(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}const Pi=p.createContext({}),ha=n.createGlobalStyle`
|
|
2
2
|
* {
|
|
3
3
|
font-family: ${e=>e.$isCdk?"'Roboto', sans-serif":"'Work Sans', sans-serif"};
|
|
4
4
|
}
|
|
@@ -1660,7 +1660,7 @@
|
|
|
1660
1660
|
color: ${({theme:e})=>e.colors.neutral[40]};
|
|
1661
1661
|
font-size: 16px;
|
|
1662
1662
|
}
|
|
1663
|
-
`,lt=p.forwardRef(({label:e,isRequired:o,extendStyles:r,info:i,...s},c)=>{const[a,d]=Ae.useField(s);return t.jsxs(Vn,{...r==null?void 0:r.mainWrapper,gap:"4px",children:[e&&t.jsx($o,{label:e,name:s.name,isRequired:o,disabled:!!s.disabled,info:i,labelStyles:r==null?void 0:r.labelStyles}),t.jsxs(Vn,{...r==null?void 0:r.inputWrapper,gap:"4px",children:[t.jsx(vs,{...a,...s,id:s.name,ref:c}),t.jsx(Zr,{meta:d,extendStyles:r})]})]})});lt.displayName="FormikInputField";const Gu=Le.object({username:Le.string().trim().required("Username is required")}),Yu=Le.object({username:Le.string().required(),password:Le.string().required("Password is required")}),Qu=(e,o)=>{const r=o?`?relayState=${encodeURIComponent(o)}`:"";return`${e}${r}`},Zu=async e=>(await oe.post("/auth/username-check-sso",e)).data,Ku=()=>we.useMutation({mutationFn:Zu,onError:e=>{console.error("Username check error",e)}}),Xu=({
|
|
1663
|
+
`,lt=p.forwardRef(({label:e,isRequired:o,extendStyles:r,info:i,...s},c)=>{const[a,d]=Ae.useField(s);return t.jsxs(Vn,{...r==null?void 0:r.mainWrapper,gap:"4px",children:[e&&t.jsx($o,{label:e,name:s.name,isRequired:o,disabled:!!s.disabled,info:i,labelStyles:r==null?void 0:r.labelStyles}),t.jsxs(Vn,{...r==null?void 0:r.inputWrapper,gap:"4px",children:[t.jsx(vs,{...a,...s,id:s.name,ref:c}),t.jsx(Zr,{meta:d,extendStyles:r})]})]})});lt.displayName="FormikInputField";const Gu=Le.object({username:Le.string().trim().required("Username is required")}),Yu=Le.object({username:Le.string().required(),password:Le.string().required("Password is required")}),Qu=(e,o)=>{const r=o?`?relayState=${encodeURIComponent(o)}`:"";return`${e}${r}`},Zu=async e=>(await oe.post("/auth/username-check-sso",e)).data,Ku=()=>we.useMutation({mutationFn:Zu,onError:e=>{console.error("Username check error",e)}}),Xu=({showSsoFeature:e,onVerified:o,onSso:r})=>{const{t:i}=W.useTranslation(),{mutateAsync:s}=Ku();return t.jsx(Ae.Formik,{initialValues:{username:""},validationSchema:Gu,onSubmit:async(c,{setFieldError:a})=>{const d=c.username.trim();if(!e){o(d);return}try{const{userExist:l,ssoLoginUrl:u}=await s({username:d});if(!l){a("username",i("Username not found. Please try again."));return}if(u){if(window.location.origin.includes("localhost:6006")){console.log("[SSO MOCK] Redirect to:",u);return}const g=window.location.href,h=Qu(u,g);r(d),setTimeout(()=>{window.location.assign(h)},1500)}else o(d)}catch{a("username",i("Could not verify username. Please try again."))}},children:({values:c,isSubmitting:a})=>t.jsx(Ae.Form,{children:t.jsxs(qr,{children:[t.jsxs(Gr,{children:[t.jsx(Yr,{htmlFor:"username",children:i("Username")}),t.jsx(Qr,{href:"https://www.covideo.com/forgot-username/",target:"_blank",children:i("Forgot username?")})]}),t.jsxs(ms,{children:[t.jsx(lt,{name:"username",isRequired:!0,placeholder:i("Username"),autoFocus:!0,type:"text",extendStyles:{mainWrapper:{flex:1}}}),t.jsx(F.Button,{type:"submit",disabled:!c.username.trim()||a,"aria-label":"Next",icon:a?t.jsx(xs,{}):t.jsx(Y.MdArrowForward,{size:18})})]})]})})})},Ju=n.keyframes`
|
|
1664
1664
|
from {
|
|
1665
1665
|
transform: rotate(0deg);
|
|
1666
1666
|
}
|
|
@@ -1670,7 +1670,7 @@
|
|
|
1670
1670
|
`,ep=n.svg`
|
|
1671
1671
|
animation: ${Ju} 2s linear infinite;
|
|
1672
1672
|
will-change: transform;
|
|
1673
|
-
`,tp=()=>t.jsx(ep,{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"spinner",children:t.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.83317 10.0003C5.83317 9.54033 5.45984 9.16699 4.99984 9.16699H2.49984C2.03984 9.16699 1.6665 9.54033 1.6665 10.0003C1.6665 10.4603 2.03984 10.8337 2.49984 10.8337H4.99984C5.45984 10.8337 5.83317 10.4603 5.83317 10.0003V10.0003ZM17.4998 9.16699H14.9998C14.5398 9.16699 14.1665 9.54033 14.1665 10.0003C14.1665 10.4603 14.5398 10.8337 14.9998 10.8337H17.4998C17.9598 10.8337 18.3332 10.4603 18.3332 10.0003C18.3332 9.54033 17.9598 9.16699 17.4998 9.16699V9.16699ZM9.99984 14.167C9.53984 14.167 9.1665 14.5403 9.1665 15.0003V17.5003C9.1665 17.9612 9.53984 18.3337 9.99984 18.3337C10.4598 18.3337 10.8332 17.9612 10.8332 17.5003V15.0003C10.8332 14.5403 10.4598 14.167 9.99984 14.167V14.167ZM9.99984 1.66699C9.53984 1.66699 9.1665 2.04033 9.1665 2.50033V5.00033C9.1665 5.46033 9.53984 5.83366 9.99984 5.83366C10.4598 5.83366 10.8332 5.46033 10.8332 5.00033V2.50033C10.8332 2.04033 10.4598 1.66699 9.99984 1.66699V1.66699ZM6.9715 3.08866C6.7415 2.69033 6.23234 2.55283 5.83317 2.78366C5.434 3.01366 5.29817 3.52366 5.52817 3.92199L6.77817 6.08699C7.00817 6.48533 7.51734 6.62199 7.9165 6.39199C8.31567 6.16199 8.4515 5.65199 8.2215 5.25366L6.9715 3.08866ZM13.2215 13.9137C12.9915 13.5153 12.4823 13.3787 12.0832 13.6087C11.684 13.8387 11.5482 14.3487 11.7782 14.747L13.0282 16.912C13.2582 17.3103 13.7673 17.4478 14.1665 17.217C14.5657 16.987 14.7015 16.477 14.4715 16.0787L13.2215 13.9137ZM6.3915 12.0837C6.1615 11.6845 5.6515 11.5487 5.25317 11.7787L3.08817 13.0287C2.68984 13.2587 2.55234 13.7678 2.78317 14.167C3.01317 14.5662 3.52317 14.702 3.9215 14.472L6.0865 13.222C6.48484 12.992 6.6215 12.4828 6.3915 12.0837V12.0837ZM13.6082 7.91699C13.8382 8.31616 14.3482 8.45199 14.7465 8.22199L16.9115 6.97199C17.3098 6.74199 17.4473 6.23283 17.2165 5.83366C16.9865 5.43449 16.4765 5.29866 16.0782 5.52866L13.9132 6.77866C13.5148 7.00866 13.3782 7.51783 13.6082 7.91699V7.91699ZM3.08817 6.97199L5.25317 8.22199C5.6515 8.45199 6.1615 8.31616 6.3915 7.91699C6.6215 7.51783 6.48484 7.00866 6.0865 6.77866L3.9215 5.52866C3.52317 5.29866 3.01317 5.43449 2.78317 5.83366C2.55234 6.23283 2.68984 6.74199 3.08817 6.97199V6.97199ZM16.9115 13.0287L14.7465 11.7787C14.3482 11.5487 13.8382 11.6845 13.6082 12.0837C13.3782 12.4828 13.5148 12.992 13.9132 13.222L16.0782 14.472C16.4765 14.702 16.9865 14.5662 17.2165 14.167C17.4473 13.7678 17.3098 13.2587 16.9115 13.0287V13.0287ZM7.9165 13.6087C7.51734 13.3787 7.00817 13.5153 6.77817 13.9137L5.52817 16.0787C5.29817 16.477 5.434 16.987 5.83317 17.217C6.23234 17.4478 6.7415 17.3103 6.9715 16.912L8.2215 14.747C8.4515 14.3487 8.31567 13.8387 7.9165 13.6087V13.6087ZM12.0832 6.39199C12.4823 6.62199 12.9915 6.48533 13.2215 6.08699L14.4715 3.92199C14.7015 3.52366 14.5657 3.01366 14.1665 2.78366C13.7673 2.55283 13.2582 2.69033 13.0282 3.08866L11.7782 5.25366C11.5482 5.65199 11.684 6.16199 12.0832 6.39199V6.39199Z",fill:"#9297A2"})}),op=({username:e})=>{const{t:o}=W.useTranslation();return t.jsxs(t.Fragment,{children:[t.jsxs(qr,{children:[t.jsxs(Gr,{children:[t.jsx(Yr,{children:o("Username")}),t.jsx(Qr,{href:"https://www.covideo.com/forgot-username/",target:"_blank",children:o("Forgot username?")})]}),t.jsxs(ms,{children:[t.jsx(vs,{value:e,disabled:!0,type:"text",readOnly:!0}),t.jsx(F.Button,{type:"button",disabled:!0,"aria-label":"Verifying",icon:t.jsx(xs,{})})]})]}),t.jsxs(Bu,{children:[t.jsx(tp,{}),o("Verifying SSO...")]})]})},rp=async e=>(await oe.post("/auth",e)).data,np=()=>we.useMutation(rp,{onError:e=>{console.log(e)}}),ip=({username:e,handleUpdateToken:o,onPreviousStepHandler:r})=>{const{colors:i}=n.useTheme(),{t:s}=W.useTranslation(),c=ue.useHistory(),[a,d]=p.useState(!1),{mutateAsync:l}=np();return t.jsxs(t.Fragment,{children:[t.jsx(Ae.Formik,{initialValues:{username:e,password:""},validationSchema:Yu,onSubmit:async(u,{setFieldError:g})=>{try{const{accessToken:h}=await l({username:u.username,password:u.password});await o(h),c.go(0)}catch{g("password",s("Incorrect login. Please try again."))}},children:({values:u,isSubmitting:g})=>t.jsxs(Ae.Form,{children:[t.jsx(lt,{name:"username",isRequired:!0,placeholder:s("Username"),type:"text",disabled:!0,extendStyles:{mainWrapper:{flex:1}}}),t.jsxs(qr,{children:[t.jsxs(Gr,{children:[t.jsx(Yr,{htmlFor:"password",children:s("Password")}),t.jsx(Qr,{href:"https://www.covideo.com/reset-password/",target:"_blank",children:s("Forgot Password?")})]}),t.jsxs(_u,{children:[t.jsx(lt,{name:"password",isRequired:!0,placeholder:s("Password"),autoFocus:!0,type:a?"text":"password",style:{paddingRight:40}}),t.jsx(Uu,{onClick:()=>d(h=>!h),children:a?t.jsx(be.IoMdEyeOff,{size:20}):t.jsx(be.IoMdEye,{size:20})})]})]}),t.jsx(F.Button,{style:{width:"100%"},type:"submit",disabled:!u.password||g,icon:t.jsx(Y.MdArrowForward,{size:16}),text:s("Log In"),iconPosition:"right"})]})}),t.jsx(F.Button,{text:s("Back to username"),variant:"text",onClick:r,icon:t.jsx(Y.MdArrowBack,{size:16}),style:{textDecoration:"underline",color:i.primary[100],marginTop:16}})]})},Ln=({handleUpdateToken:e})=>{const{t:o}=W.useTranslation(),{hasExternalJwt:r}=Ce(),[
|
|
1673
|
+
`,tp=()=>t.jsx(ep,{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"spinner",children:t.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.83317 10.0003C5.83317 9.54033 5.45984 9.16699 4.99984 9.16699H2.49984C2.03984 9.16699 1.6665 9.54033 1.6665 10.0003C1.6665 10.4603 2.03984 10.8337 2.49984 10.8337H4.99984C5.45984 10.8337 5.83317 10.4603 5.83317 10.0003V10.0003ZM17.4998 9.16699H14.9998C14.5398 9.16699 14.1665 9.54033 14.1665 10.0003C14.1665 10.4603 14.5398 10.8337 14.9998 10.8337H17.4998C17.9598 10.8337 18.3332 10.4603 18.3332 10.0003C18.3332 9.54033 17.9598 9.16699 17.4998 9.16699V9.16699ZM9.99984 14.167C9.53984 14.167 9.1665 14.5403 9.1665 15.0003V17.5003C9.1665 17.9612 9.53984 18.3337 9.99984 18.3337C10.4598 18.3337 10.8332 17.9612 10.8332 17.5003V15.0003C10.8332 14.5403 10.4598 14.167 9.99984 14.167V14.167ZM9.99984 1.66699C9.53984 1.66699 9.1665 2.04033 9.1665 2.50033V5.00033C9.1665 5.46033 9.53984 5.83366 9.99984 5.83366C10.4598 5.83366 10.8332 5.46033 10.8332 5.00033V2.50033C10.8332 2.04033 10.4598 1.66699 9.99984 1.66699V1.66699ZM6.9715 3.08866C6.7415 2.69033 6.23234 2.55283 5.83317 2.78366C5.434 3.01366 5.29817 3.52366 5.52817 3.92199L6.77817 6.08699C7.00817 6.48533 7.51734 6.62199 7.9165 6.39199C8.31567 6.16199 8.4515 5.65199 8.2215 5.25366L6.9715 3.08866ZM13.2215 13.9137C12.9915 13.5153 12.4823 13.3787 12.0832 13.6087C11.684 13.8387 11.5482 14.3487 11.7782 14.747L13.0282 16.912C13.2582 17.3103 13.7673 17.4478 14.1665 17.217C14.5657 16.987 14.7015 16.477 14.4715 16.0787L13.2215 13.9137ZM6.3915 12.0837C6.1615 11.6845 5.6515 11.5487 5.25317 11.7787L3.08817 13.0287C2.68984 13.2587 2.55234 13.7678 2.78317 14.167C3.01317 14.5662 3.52317 14.702 3.9215 14.472L6.0865 13.222C6.48484 12.992 6.6215 12.4828 6.3915 12.0837V12.0837ZM13.6082 7.91699C13.8382 8.31616 14.3482 8.45199 14.7465 8.22199L16.9115 6.97199C17.3098 6.74199 17.4473 6.23283 17.2165 5.83366C16.9865 5.43449 16.4765 5.29866 16.0782 5.52866L13.9132 6.77866C13.5148 7.00866 13.3782 7.51783 13.6082 7.91699V7.91699ZM3.08817 6.97199L5.25317 8.22199C5.6515 8.45199 6.1615 8.31616 6.3915 7.91699C6.6215 7.51783 6.48484 7.00866 6.0865 6.77866L3.9215 5.52866C3.52317 5.29866 3.01317 5.43449 2.78317 5.83366C2.55234 6.23283 2.68984 6.74199 3.08817 6.97199V6.97199ZM16.9115 13.0287L14.7465 11.7787C14.3482 11.5487 13.8382 11.6845 13.6082 12.0837C13.3782 12.4828 13.5148 12.992 13.9132 13.222L16.0782 14.472C16.4765 14.702 16.9865 14.5662 17.2165 14.167C17.4473 13.7678 17.3098 13.2587 16.9115 13.0287V13.0287ZM7.9165 13.6087C7.51734 13.3787 7.00817 13.5153 6.77817 13.9137L5.52817 16.0787C5.29817 16.477 5.434 16.987 5.83317 17.217C6.23234 17.4478 6.7415 17.3103 6.9715 16.912L8.2215 14.747C8.4515 14.3487 8.31567 13.8387 7.9165 13.6087V13.6087ZM12.0832 6.39199C12.4823 6.62199 12.9915 6.48533 13.2215 6.08699L14.4715 3.92199C14.7015 3.52366 14.5657 3.01366 14.1665 2.78366C13.7673 2.55283 13.2582 2.69033 13.0282 3.08866L11.7782 5.25366C11.5482 5.65199 11.684 6.16199 12.0832 6.39199V6.39199Z",fill:"#9297A2"})}),op=({username:e})=>{const{t:o}=W.useTranslation();return t.jsxs(t.Fragment,{children:[t.jsxs(qr,{children:[t.jsxs(Gr,{children:[t.jsx(Yr,{children:o("Username")}),t.jsx(Qr,{href:"https://www.covideo.com/forgot-username/",target:"_blank",children:o("Forgot username?")})]}),t.jsxs(ms,{children:[t.jsx(vs,{value:e,disabled:!0,type:"text",readOnly:!0}),t.jsx(F.Button,{type:"button",disabled:!0,"aria-label":"Verifying",icon:t.jsx(xs,{})})]})]}),t.jsxs(Bu,{children:[t.jsx(tp,{}),o("Verifying SSO...")]})]})},rp=async e=>(await oe.post("/auth",e)).data,np=()=>we.useMutation(rp,{onError:e=>{console.log(e)}}),ip=({username:e,handleUpdateToken:o,onPreviousStepHandler:r})=>{const{colors:i}=n.useTheme(),{t:s}=W.useTranslation(),c=ue.useHistory(),[a,d]=p.useState(!1),{mutateAsync:l}=np();return t.jsxs(t.Fragment,{children:[t.jsx(Ae.Formik,{initialValues:{username:e,password:""},validationSchema:Yu,onSubmit:async(u,{setFieldError:g})=>{try{const{accessToken:h}=await l({username:u.username,password:u.password});await o(h),c.go(0)}catch{g("password",s("Incorrect login. Please try again."))}},children:({values:u,isSubmitting:g})=>t.jsxs(Ae.Form,{children:[t.jsx(lt,{name:"username",isRequired:!0,placeholder:s("Username"),type:"text",disabled:!0,extendStyles:{mainWrapper:{flex:1}}}),t.jsxs(qr,{children:[t.jsxs(Gr,{children:[t.jsx(Yr,{htmlFor:"password",children:s("Password")}),t.jsx(Qr,{href:"https://www.covideo.com/reset-password/",target:"_blank",children:s("Forgot Password?")})]}),t.jsxs(_u,{children:[t.jsx(lt,{name:"password",isRequired:!0,placeholder:s("Password"),autoFocus:!0,type:a?"text":"password",style:{paddingRight:40}}),t.jsx(Uu,{onClick:()=>d(h=>!h),children:a?t.jsx(be.IoMdEyeOff,{size:20}):t.jsx(be.IoMdEye,{size:20})})]})]}),t.jsx(F.Button,{style:{width:"100%"},type:"submit",disabled:!u.password||g,icon:t.jsx(Y.MdArrowForward,{size:16}),text:s("Log In"),iconPosition:"right"})]})}),t.jsx(F.Button,{text:s("Back to username"),variant:"text",onClick:r,icon:t.jsx(Y.MdArrowBack,{size:16}),style:{textDecoration:"underline",color:i.primary[100],marginTop:16}})]})},Ln=({handleUpdateToken:e})=>{const{t:o}=W.useTranslation(),{hasExternalJwt:r,showSsoFeature:i}=Ce(),[s,c]=p.useState("username"),[a,d]=p.useState("");return r?t.jsxs(t.Fragment,{children:[t.jsx(Ze,{center:t.jsx(yo,{})}),t.jsx(In,{children:t.jsxs(An,{children:[t.jsx($n,{children:o("Login failed")}),t.jsx(zu,{children:o("External token invalid.")})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(Ze,{center:t.jsx(yo,{})}),t.jsx(In,{children:t.jsxs(An,{children:[t.jsxs($n,{children:[o("Welcome back")," 👋"]}),(s==="username"||s==="sso")&&t.jsx(Fu,{children:o("Enter username to continue")}),s==="username"&&t.jsx(Xu,{showSsoFeature:i,onVerified:l=>{d(l),c("password")},onSso:l=>{d(l),c("sso")}}),s==="sso"&&t.jsx(op,{username:a}),s==="password"&&t.jsx(ip,{username:a,handleUpdateToken:e,onPreviousStepHandler:()=>c("username")})]})})]})},Mn="-1",Wt=19,jr=20,bs=-2,Er=-1;var ws=(e=>(e.VIDMAILS="vidmails",e.AUTOMOTIVE="automotive",e))(ws||{});const ys={value:0,label:"",landingPageType:"vidmails",id:0},sp=e=>{const o=nt(e);return{value:bs,label:`${o?"Service":"Sales"} page`,landingPageType:"automotive",typeId:Wt}},ap=({userData:e,templatesResponse:o,sendVehicle:r,sendQuote:i})=>{var x,f;const{customer:s}=e,c=Ke(e);nt(e);const a=ut(e);if(s.isUsingLandingPageDesign.toString()==="1")return{autoSelectedOption:{...o.default,value:o.default.id,label:o.default.title,landingPageType:"automotive"},options:o.templates.map(w=>({...w,value:w.id,label:w.title,landingPageType:"automotive"}))};const d=!c,l=sp(e),u=a&&r;let g=d?ys:l;const h=o==null?void 0:o.default;let m=((o==null?void 0:o.templates)||[]).filter(w=>!u||w.typeId===Wt||w.typeId===jr).map(w=>({label:w.title,value:w.id,typeId:w.typeId,landingPageType:w.typeId!==Wt?"vidmails":"automotive"}));if(d||(m=[...m,l]),h!=null&&h.id&&(!u||(h==null?void 0:h.typeId)===Wt||(h==null?void 0:h.typeId)===jr)){const w={label:(x=o==null?void 0:o.default)==null?void 0:x.title,value:(f=o==null?void 0:o.default)==null?void 0:f.id,landingPageType:(h==null?void 0:h.typeId)===Wt?"automotive":"vidmails",typeId:h==null?void 0:h.typeId};g=w,m=[...m,w]}return m=Gt.uniqBy(m,"value"),{options:m,autoSelectedOption:g}},ho=n.div`
|
|
1674
1674
|
display: flex;
|
|
1675
1675
|
justify-content: space-between;
|
|
1676
1676
|
align-items: center;
|
|
@@ -1937,7 +1937,7 @@
|
|
|
1937
1937
|
background-color: ${({backgroundColor:e})=>e||"transparent"};
|
|
1938
1938
|
width: ${({width:e})=>e||"auto"};
|
|
1939
1939
|
border-radius: 6px;
|
|
1940
|
-
`,go="pending",hh=e=>e?String(e):void 0,gh=()=>{var _e,Ve;const{showInsertFeature:e,showQuickshareFeature:o,containerWidth:r,showTrimFeature:i,showCTAFeature:s,showLandingPageFeature:c,showReactionsFeature:a,showWebsiteOverlayFeature:d}=Ce(),{t:l}=W.useTranslation(),{colors:u,isCdkEnviroment:g}=n.useTheme(),{videoId:h}=rt.useParams(),{toast:m}=Ee(),{userData:x}=fe(),{isLoading:f,data:w}=Jp({start:0,limit:2e3,search:""}),{data:b,isLoading:y}=Ss(h),{data:S,isLoading:T}=nh({start:0,limit:100,search:""}),{data:$,isLoading:k}=oh({start:0,limit:100,search:""}),L=p.useRef(null),v=nt(x),j=ut(x),R=Vp(x),V=Lp(x),{trackGTMVideoMessageInteractionEvent:C}=He(),A=rt.useHistory(),[P,M]=p.useState(!1),[N,D]=p.useState(!1),[O,U]=p.useState({videoId:Number(h),templateId:ys.id,linksetId:"",overlayId:"",vin:go,allowReactions:V}),{trackVideoSpecificPagesManually:G,vehiceReady:se}=bt({vin:O.vin!==go?O.vin:""}),[Z,X]=p.useState([]),[q,re]=p.useState(!1),[z,ce]=p.useState(!1),[ae,pe]=p.useState([0,0]),[ve,Te]=p.useState(0),ke=p.useRef([0,0]),ee=($==null?void 0:$.linksets)??[],le=(S==null?void 0:S.websiteUrls)??[],K=()=>A.push("/");p.useEffect(()=>{pe([0,ve])},[ve]);const H=y||f||f||k||T,he=me=>{var it;if(f||!w)return;const{autoSelectedOption:Me,options:$e}=ap({userData:x,templatesResponse:w,sendVehicle:!!me,sendQuote:!1}),qe=$e.filter(Ge=>d?!0:Ge.id!==Er),wt=(it=qe.find(Ge=>Number(Ge.value)===O.templateId))==null?void 0:it.value,Ne=$e.some(Ge=>Ge.value===bs&&Ge.typeId===Wt);X(qe),U(Ge=>({...Ge,templateId:Ne?Number(Me.value)||w.default.id:Number(wt)||w.default.id,vin:me}))};p.useEffect(()=>{
|
|
1940
|
+
`,go="pending",hh=e=>e?String(e):void 0,gh=()=>{var _e,Ve;const{showInsertFeature:e,showQuickshareFeature:o,containerWidth:r,showTrimFeature:i,showCTAFeature:s,showLandingPageFeature:c,showReactionsFeature:a,showWebsiteOverlayFeature:d}=Ce(),{t:l}=W.useTranslation(),{colors:u,isCdkEnviroment:g}=n.useTheme(),{videoId:h}=rt.useParams(),{toast:m}=Ee(),{userData:x}=fe(),{isLoading:f,data:w}=Jp({start:0,limit:2e3,search:""}),{data:b,isLoading:y}=Ss(h),{data:S,isLoading:T}=nh({start:0,limit:100,search:""}),{data:$,isLoading:k}=oh({start:0,limit:100,search:""}),L=p.useRef(null),v=nt(x),j=ut(x),R=Vp(x),V=Lp(x),{trackGTMVideoMessageInteractionEvent:C}=He(),A=rt.useHistory(),[P,M]=p.useState(!1),[N,D]=p.useState(!1),[O,U]=p.useState({videoId:Number(h),templateId:ys.id,linksetId:"",overlayId:"",vin:go,allowReactions:V}),{trackVideoSpecificPagesManually:G,vehiceReady:se}=bt({vin:O.vin!==go?O.vin:""}),[Z,X]=p.useState([]),[q,re]=p.useState(!1),[z,ce]=p.useState(!1),[ae,pe]=p.useState([0,0]),[ve,Te]=p.useState(0),ke=p.useRef([0,0]),ee=($==null?void 0:$.linksets)??[],le=(S==null?void 0:S.websiteUrls)??[],K=()=>A.push("/");p.useEffect(()=>{pe([0,ve])},[ve]);const H=y||f||f||k||T,he=me=>{var it;if(f||!w)return;const{autoSelectedOption:Me,options:$e}=ap({userData:x,templatesResponse:w,sendVehicle:!!me,sendQuote:!1}),qe=$e.filter(Ge=>d?!0:Ge.id!==Er),wt=(it=qe.find(Ge=>Number(Ge.value)===O.templateId))==null?void 0:it.value,Ne=$e.some(Ge=>Ge.value===bs&&Ge.typeId===Wt);X(qe),U(Ge=>({...Ge,templateId:Ne?Number(Me.value)||w.default.id:Number(wt)||w.default.id,vin:me}))};p.useEffect(()=>{var me;!b&&!w||he(((me=b==null?void 0:b.videoRequest)==null?void 0:me.vin)||"")},[w,f,b]),p.useEffect(()=>{T||!le.length||le.length>0&&U(me=>({...me,overlayId:le[0].id}))},[S,T]),p.useEffect(()=>{if(k||!ee.length)return;const me=ee.find(Me=>Me.defaultLinks)??ee[0];me&&U(Me=>({...Me,linksetId:me.id}))},[$,k]),p.useEffect(()=>{!y&&!b||U(me=>{var Me;return{...me,vin:((Me=b==null?void 0:b.videoRequest)==null?void 0:Me.vin)||""}})},[b,y]),p.useEffect(()=>{const me=Oi({trimStart:ae[0],trimEnd:ae[1],videoDuration:ve});return re(me),()=>{re(!1)}},[ae,ve]),p.useEffect(()=>{se&&O.vin!==go&&(G==null||G({...vt.SEND_SHARE}))},[se]);const je=async()=>{try{return await Fi(h,{duration:ae[1],start:ae[0],title:b==null?void 0:b.title})}catch{m({message:l("Something went wrong while trimming the video, try again later!")})}},Ie=()=>{const me=Z.find(qe=>qe.value===O.templateId),Me=v||(me==null?void 0:me.landingPageType)===ws.AUTOMOTIVE||!1;return{videoShareSetData:{videoId:Number(h),vin:O.vin!==go?O.vin:"",templateId:Number(O.templateId)||0,overlayId:O.overlayId||0,linksetId:O.linksetId||0,allowReactions:O.allowReactions},useAutomotive:Me}},Q=async()=>{if(q){ce(!0);const me=await je();ce(!1),re(!1),A.replace(`/insert-video/${me.id}`)}},ne={videoId:Number(b==null?void 0:b.id),videoTitle:b==null?void 0:b.title,videoLength:b==null?void 0:b.videoLength,videoCustomerName:!!((_e=b==null?void 0:b.videoRequest)!=null&&_e.customerName),videoType:((Ve=b==null?void 0:b.videoRequest)==null?void 0:Ve.videoType)||void 0},ye=({action:me})=>{var qe,wt,Ne;const Me=Ie(),$e={notificationViewed:void 0,landingPage:(qe=Z.find(it=>it.value===Me.videoShareSetData.templateId))==null?void 0:qe.label,callToAction:((wt=ee.find(it=>it.id===Me.videoShareSetData.linksetId))==null?void 0:wt.title)??void 0,thumbnails:void 0,customerId:hh(x.customerId),sms:void 0,email:void 0};C==null||C({action:me,video:ne,videoMessageProperties:$e,vehicle:(Ne=b==null?void 0:b.videoRequest)==null?void 0:Ne.inventoryItem})},Re=f||k||T||O.templateId===-1&&!O.overlayId||P;return H||!b?t.jsx(Fe,{isLoading:y}):t.jsxs(ih,{children:[t.jsx(Ze,{left:t.jsx(F.Button,{text:l("Back"),icon:t.jsx(Y.MdArrowBack,{size:"18"}),onClick:()=>K(),variant:"transparent",style:{color:"white"}}),center:t.jsx(t.Fragment,{}),right:t.jsxs(t.Fragment,{children:[q&&t.jsx(F.Button,{variant:g?"white":"secondary",onClick:Q,text:r>_.sm?l("Trim Video"):l("Trim"),disabled:z,icon:z?t.jsx(tt,{size:12}):t.jsx(Y.MdContentCut,{size:18})}),o&&!q&&t.jsx(Kp,{video:b,disable:Re,getMarkAsSentPayload:Ie,onCRMClick:()=>{ye({action:Cr.COPY})}}),e&&!q&&t.jsx(Zp,{video:b,disable:Re,getMarkAsSentPayload:Ie,onCRMClick:async()=>{ye({action:Cr.INSERT})}})]})}),t.jsx(dt,{children:t.jsxs(sh,{children:[t.jsxs(ah,{children:[t.jsxs(lh,{children:[t.jsx(It,{videoId:h,videoRef:L,autoplay:!1,height:"247px",FullscreenVideoWrapperBackgroundColor:u.black[100],borderBottomRadius:"0px",videoSource:(b==null?void 0:b.videoSource)||"",playerBackgroundColor:(b==null?void 0:b.playerBackgroundColor)||"",setVideoDuration:Te,setVideoIsProcessing:M}),t.jsxs(dh,{children:[t.jsx(uh,{children:b==null?void 0:b.title}),t.jsxs(ph,{children:[t.jsx(be.IoMdCalendar,{size:16,color:u.neutral[40],style:{marginRight:6}}),b==null?void 0:b.recordDate]})]})]}),i&&t.jsx(Qp,{isVideoTrimmed:q,setValue:pe,value:ae,videoDuration:ve,videoRef:L,isVideoLoading:y,videoSource:(b==null?void 0:b.videoSource)||"",valueRef:ke})]}),(c||s||a)&&t.jsxs(ch,{children:[t.jsx(pp,{insertVideoData:O,setInsertVideoData:U,overlaysData:le,templatesOptions:Z,linksetsData:ee,reactionsCustomerEnabled:R}),j&&t.jsx(Cs,{onChangeVehicle:me=>{he(me==null?void 0:me.vin),D(!1)},placeholder:l("Search vehicle by name, VIN or stock number..."),selectedVin:O.vin,fetchSold:!1,addingVehicle:N,handleChangeVehicleButtonPress:()=>{he(""),D(!0)},handleRemoveVehicleButtonPress:()=>he(""),setAddingVehicle:D})]})]})})]})},mh=n.div`
|
|
1941
1941
|
display: flex;
|
|
1942
1942
|
justify-content: center;
|
|
1943
1943
|
align-items: flex-start;
|