https://bith.ai/_next/static/chunks/pages/ai-studio/text-to-video/…/ScriptFields-74b78f3fc92eaf5f.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[97684],{42505:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-studio/text-to-video/script/VideoSettings/ScriptFields",function(){return l(83459)}])},83345:function(e,t,l){"use strict";var i=l(85893);l(67294);var s=l(46321),o=l(20931);t.Z=e=>{let{isAtLeftEnd:t=!1,isAtRightEnd:l=!1,leftButtonId:a,rightButtonId:r,language:n="",customClassName:c="",arrowSize:d="12px",buttonSize:u="w-6 h-6",buttonBgColor:v="bg-shade-2",onLeftClick:x,onRightClick:f}=e;return(0,i.jsxs)("div",{className:"flex items-center gap-2 ".concat(n===o.H7.AR.value?"flex-row-reverse":""," ").concat(c),children:[(0,i.jsx)("div",{className:"cursor-pointer ".concat(u," rounded-md ").concat(v," flex items-center justify-center ").concat(t?"opacity-50":""),id:a,onClick:x,children:(0,i.jsx)(s.Z,{src:"/icons/arrow-left.svg",width:d,height:d,fill:"var(--white-80-color)"})}),(0,i.jsx)("div",{className:"cursor-pointer ".concat(u," rounded-md ").concat(v," flex items-center justify-center ").concat(l?"opacity-50":""),id:r,onClick:f,children:(0,i.jsx)(s.Z,{src:"/icons/arrow-right.svg",width:d,height:d,fill:"var(--white-80-color)"})})]})}},45492:function(e,t,l){"use strict";var i=l(85893);l(67294);let s=l(5405).ZP.div.withConfig({componentId:"sc-38866e4e-0"})(['background:var(--shade-2);border:2px solid var(--shade-2);position:relative;border-radius:8px;padding:12px 16px;cursor:pointer;transition:all 300ms;[data-theme="light"] &{background:var(--shade);border-color:rgba(0,0,0,0.08);}',""],e=>e.isActive&&"\n background: ".concat(e.activeBgColor||"var(--shade)",';\n border-color: var(--secondary-color);\n\n [data-theme="light"] & {\n background: ').concat(e.activeBgColor||"#f6f6f6",";\n border-color: var(--secondary-color);\n }\n "));t.Z=e=>{let{isActive:t,label:l,onClick:o,children:a,className:r,textClassName:n,style:c,activeBgColor:d}=e;return(0,i.jsx)(s,{isActive:t,onClick:o,className:r,style:c,tabIndex:0,activeBgColor:d,children:(0,i.jsx)("div",{className:"relative ".concat(n||"whitespace-nowrap"),children:a||(0,i.jsx)("span",{className:"relative ".concat(t?"text-secondary":""),children:l})})})}},42932:function(e,t,l){"use strict";l.d(t,{K7:function(){return a},PN:function(){return r}});var i=l(85893),s=l(67294),o=l(27524);let a=e=>(0,i.jsx)("div",{className:"flex items-center",children:e.children}),r=e=>{let{innerProps:t,innerRef:l}=e,{language:a}=s.useContext(o.AZ);return(0,i.jsx)("div",{ref:l,...t,className:"w-full",children:(0,i.jsx)("h4",{className:"text-white-65",children:e.data.label[a]||e.data.label})})};t.ZP=e=>{let{innerProps:t,innerRef:l}=e,{language:a}=s.useContext(o.AZ);return(0,i.jsx)("div",{ref:l,...t,className:"custom-option cursor-pointer flex items-center justify-between px-4 py-2 w-full ".concat((null==e?void 0:e.isSelected)?"text-secondary":(null==e?void 0:e.isDisabled)?"text-white-65 opacity-50":"text-white-65 hover:text-secondary"),children:(0,i.jsx)("h4",{className:"text-sm",children:e.data.label[a]||e.data.label})})}},60568:function(e,t,l){"use strict";var i=l(67294),s=l(20931);t.Z=function(e,t,l){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.mQ.LTR,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:300,[r,n]=(0,i.useState)(!1),[c,d]=(0,i.useState)(!0),[u,v]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),h=(0,i.useRef)(a),m=(0,i.useRef)(l),p=(0,i.useRef)(o);(0,i.useEffect)(()=>{h.current=a,m.current=l,p.current=o},[a,l,o]);let g=()=>{let e=document.querySelector("#".concat(m.current));e&&(e.scrollWidth>e.offsetWidth?f(!0):f(!1))},j=()=>{let e=document.querySelector("#".concat(m.current));e&&(p.current===s.mQ.LTR?(d(e.scrollLeft<=0),v(Math.abs(e.scrollLeft)+e.offsetWidth+1>=e.scrollWidth)):(d(Math.abs(e.scrollLeft)+e.offsetWidth+1>=e.scrollWidth),v(0===e.scrollLeft)))},b=(0,i.useCallback)(e=>{let t=document.querySelector("#".concat(m.current));t&&(t.scrollWidth>t.offsetWidth&&t.scrollTo({left:t.scrollLeft+h.current,behavior:"smooth"}),e.preventDefault())},[]),w=(0,i.useCallback)(e=>{let t=document.querySelector("#".concat(m.current));t&&(t.scrollWidth>t.offsetWidth&&t.scrollTo({left:t.scrollLeft-h.current,behavior:"smooth"}),e.preventDefault())},[]);return i.useLayoutEffect(()=>{let{rightBtn:l,leftBtn:i}=(()=>
1{let l=document.querySelector("#".concat(e)),i=document.querySelector("#".concat(t));return l&&(l.removeEventListener("click",b),l.addEventListener("click",b)),i&&(i.removeEventListener("click",w),i.addEventListener("click",w)),{rightBtn:l,leftBtn:i}})();return g(),requestAnimationFrame(()=>{j()}),()=>{l&&l.removeEventListener("click",b),i&&i.removeEventListener("click",w)}},[r]),i.useEffect(()=>{if(!x)return;let l=()=>{let l=document.querySelector("#".concat(e)),i=document.querySelector("#".concat(t));l&&(l.removeEventListener("click",b),l.addEventListener("click",b)),i&&(i.removeEventListener("click",w),i.addEventListener("click",w))};l();let i=setTimeout(()=>{l()},100);return requestAnimationFrame(()=>{l()}),()=>{clearTimeout(i);let l=document.querySelector("#".concat(e)),s=document.querySelector("#".concat(t));l&&l.removeEventListener("click",b),s&&s.removeEventListener("click",w)}},[x,r,b,w,e,t]),{isAtLeftEnd:c,isAtRightEnd:u,setIsAtRightEnd:v,setIsAtLeftEnd:d,isScrollable:x,handleScroll:j,checkScrollState:g,reinitializeSlider:()=>{n(!r)}}}},93116:function(e,t,l){"use strict";l.r(t);var i=l(85893),s=l(96946),o=l(45492),a=l(46321),r=l(58446),n=l(27524),c=l(87251),d=l(6627),u=l(67294),v=l(87536),x=l(10847);let f=e=>{let{aspectRatioOption:t}=e,{language:l}=u.useContext(n.AZ),s=(0,c.Z)();return(0,i.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("div",{className:"w-8 h-8 flex items-center justify-center bg-glass-fill-strong rounded-full gap-[2px]",children:(0,i.jsx)(a.Z,{src:t.icon,width:"16px",height:"16px",fill:x.theme.extend.colors["custom-white"]})}),(0,i.jsxs)("span",{className:"flex items-center text-custom-white text-sm gap-[2px]",children:[t.label[l]," ",(0,i.jsxs)("span",{className:"text-t-shade-3 text-xs",children:["(",null==t?void 0:t.value,")"]})]})]}),(null==t?void 0:t.isDisabled)&&(0,i.jsx)("div",{className:"rounded-full bg-[#C3BDED] px-1",children:(0,i.jsx)("span",{className:"text-[10px] text-[#4C4194]",children:s.global.comingSoon})})]})};t.default=e=>{let{control:t}=e,l=(0,c.Z)(),{trackToolConfiguration:n}=(0,d.G)("ai shorts");return(0,i.jsxs)("div",{className:"flex flex-col gap-2 md:gap-4",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(a.Z,{src:"/icons/maximize-2.svg",fill:"var(--white-80-color)",width:"16px",height:"16px"}),(0,i.jsxs)("span",{className:"small-text text-t-shade-1",children:[l.textToVideo.script.videoAspectRatioTitle," "]})]}),(0,i.jsx)(v.Qr,{control:t,name:"aspectRatio",rules:{required:l.validations.required},render:e=>{var t;let{field:l,formState:{errors:a}}=e,c=e=>{var t;(null==e?void 0:e.value)!==(null===(t=l.value)||void 0===t?void 0:t.value)&&(l.onChange(e),n({configuration_type:"aspect_ratio",aspect_ratio:null==e?void 0:e.value,value:null==e?void 0:e.value}))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"flex items-center gap-3",children:r.ZP.t2vAspectRatios.map((e,t)=>{var s;return(0,i.jsx)(o.Z,{className:"flex-1",isActive:(null===(s=l.value)||void 0===s?void 0:s.value)===e.value,onClick:()=>c(e),style:{padding:"7px 16px"},children:(0,i.jsx)(f,{aspectRatioOption:e})},t)})}),a&&(null==a?void 0:a.aspectRatio)&&(0,i.jsx)(s.Z,{rootClassName:"text-sm",errorMessage:null==a?void 0:null===(t=a.aspectRatio)||void 0===t?void 0:t.message})]})}})]})}},1332:function(e,t,l){"use strict";l.r(t);var i=l(85893),s=l(67294),o=l(27524),a=l(87251),r=l(87536),n=l(5405),c=l(58446),d=l(17679),u=l(60568),v=l(46321),x=l(83345),f=l(6627);let h=n.ZP.div.withConfig({componentId:"sc-ee689d86-0"})(["display:flex;gap:16px;"]),m=n.ZP.div.withConfig({componentId:"sc-ee689d86-1"})(['width:112px;aspect-ratio:1 / 1;border:3px solid transparent;position:relative;border-radius:6px;overflow:hidden;transition:all 0.3s;cursor:pointer;[data-selected="selected"]&{border-color:var(--secondary-color);}']),p=n.ZP.div.withConfig({componentId:"sc-ee689d86-2"})(["padding:8px 0px;position:absolute;"]),g=n.ZP.div.withConfig({componentId:"sc-ee689d86-3"})(["font-size:10px;color:#fff;"]),j=n.ZP.div.withConfig({componentId:"sc-ee689d86-4"})(["background:linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,0) 50%,rgb(21,21,21) 100%);position:absolute;top:0;right:0;bottom:0;left:0;"]);t.default=e=>{let{control:t}=e,{language:l,getDirection:n}
1=s.useContext(o.AZ),b=(0,a.Z)(),w=(0,r.qo)({name:"visualsSource",control:t}),{isAtLeftEnd:y,isAtRightEnd:N,handleScroll:Z}=(0,u.Z)("rightButtonVideos","leftButtonVideos","imageStylesContainer",n),{trackToolConfiguration:C}=(0,f.G)("ai shorts");return(s.useLayoutEffect(()=>{w!==c.NY.STOCK_VIDEOS&&Z()},[w]),w===c.NY.STOCK_VIDEOS)?null:(0,i.jsxs)("div",{className:"flex flex-col gap-2 md:gap-4",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(v.Z,{src:"/icons/gallery.svg",fill:"var(--white-80-color)",width:"16px",height:"16px"}),(0,i.jsx)("span",{className:"text-t-shade-1 small-text",children:b.textToVideo.script.imageStyle.title})]}),(0,i.jsx)(x.Z,{isAtLeftEnd:y,isAtRightEnd:N,leftButtonId:"leftButtonVideos",rightButtonId:"rightButtonVideos",language:l})]}),(0,i.jsx)(r.Qr,{control:t,name:"videoVisual",render:e=>{let{field:{value:t,onChange:o}}=e;return s.useEffect(()=>{let e=c.ZP.imagesStyles.find(e=>e.value===t);if(e){let t=document.getElementById("".concat(null==e?void 0:e.value));if(!t)return;t.scrollTo({left:t.offsetLeft-(t.offsetWidth-t.clientWidth)/2,behavior:"smooth"})}},[t]),(0,i.jsx)(d.Z,{className:"relative overflow-x-scroll hiddenScrollBar ",containerClassName:"hiddenScrollBar",onScroll:Z,id:"imageStylesContainer",direction:n,children:(0,i.jsx)(h,{children:c.ZP.imagesStyles.filter(e=>!(null==e?void 0:e.isDeleted)).map((e,s)=>(0,i.jsxs)(m,{"data-selected":t===(null==e?void 0:e.value)?"selected":"","data-name":"video-visual",onClick:l=>{l.preventDefault(),e.value!==t&&(o(e.value),C({configuration_type:"image_style",image_style:e.value,value:e.value}))},"data-test-id":e.value||"default",id:e.value,children:[(0,i.jsx)("img",{src:e.imageUrl,className:"w-full h-full object-cover"}),(0,i.jsx)(j,{}),(0,i.jsx)(p,{className:"left-3 right-3 bottom-2 flex items-center justify-between",children:(0,i.jsx)(g,{children:null==e?void 0:e.title[l]})})]},s))})})}})]})}},83459:function(e,t,l){"use strict";l.r(t);var i=l(85893);l(67294);var s=l(44878),o=l(93116),a=l(76239),r=l(1332);t.default=e=>{let{control:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:" gap-6 grid md:grid-cols-2",children:[(0,i.jsx)("div",{className:"flex flex-col gap-2 md:gap-4",children:(0,i.jsx)(o.default,{control:t})}),(0,i.jsx)("div",{className:"flex-1 col-span-1",children:(0,i.jsx)(s.default,{control:t})})]}),(0,i.jsx)(a.default,{control:t}),(0,i.jsx)(r.default,{control:t})]})}},44878:function(e,t,l){"use strict";l.r(t);var i=l(85893),s=l(67294),o=l(87251),a=l(87536),r=l(96946),n=l(27524),c=l(46321),d=l(58446),u=l(6627),v=l(24670),x=l(71819),f=l(42932);t.default=e=>{let{control:t}=e,l=(0,o.Z)(),{language:h}=s.useContext(n.AZ),{trackToolConfiguration:m}=(0,u.G)("ai shorts");return(0,i.jsxs)("div",{className:" flex flex-col relative gap-4 ","data-test-id":"videoTone",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(c.Z,{src:"/icons/user-speaking.svg",stroke:"var(--white-80-color)",fill:"var(--white-80-color)",width:"16px",height:"16px"}),(0,i.jsx)("span",{className:"small-text text-t-shade-1",children:l.textToVideo.script.videoToneTitle})]}),(0,i.jsx)(a.Qr,{control:t,name:"videoTone",render:e=>{var t;let{field:s,formState:{errors:o}}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"",children:(0,i.jsx)(v.ZP,{...s,onChange:e=>{var t,l;(null==e?void 0:e.value)!==(null===(t=s.value)||void 0===t?void 0:t.value)&&(s.onChange(e),m({configuration_type:"video_tone",video_tone:null==e?void 0:e.value,value:null!==(l=null==e?void 0:e.value)&&void 0!==l?l:null==e?void 0:e.label}))},styles:x.O_,isSearchable:!1,components:{Option:f.ZP,SingleValue:f.PN,ValueContainer:f.K7},placeholder:(0,i.jsx)("div",{className:"small-text",children:l.textToVideo.script.videoToneTitle}),options:d.ZP.videoTones.map(e=>({value:e.value,label:e.label})),menuPlacement:"auto"})}),o&&(null==o?void 0:o.videoTone)&&(0,i.jsx)(r.Z,{rootClassName:"text-sm",errorMessage:null==o?void 0:null===(t=o.videoTone)||void 0===t?void 0:t.message})]})}})]})}},76239:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return S}});var i=l(85893),s=l(67294),o=l(27524),a=l(87251),r=l(87536),n=l(5405),c=l(58446),d=l(46321),u=l(85242),v=l(31155),x=l(20333);let f=n.ZP.div.withConfig({componentId:"sc-cf31fe00-0"})(["",' width:100%;border-radius:1rem;box-shadow:0px 15px 35px 0px rgba(0,0,0,0.20);;background-color:var(--shade);padding:40px;
1display:grid;gap:24px;flex-direction:column;& [data-direction="row"]{}@media (max-width:768px){max-width:100%;min-width:100%;width:calc(100% - 32px);padding:24px;flex-direction:column;}'],e=>"16:9"===e.$aspectRatio?"\n max-width: 755px;\n min-width: 395px;":"\n max-width: 336px;\n min-width: 336px;\n & video {\n height: 456px;\n }\n ");var h=e=>{let{sampleVideo:t,aspectRatio:l}=e,{language:a}=s.useContext(o.AZ),r=s.useMemo(()=>null==t?void 0:t.video[l][a],[a,l,null==t?void 0:t.value]);return(0,i.jsxs)(f,{$aspectRatio:l,children:[(0,i.jsx)(x.Z,{src:r,controls:!0}),(0,i.jsx)("span",{className:"text-base text-custom-white",children:t.title[a]})]})},m=l(24556),p=l(63394),g=l(6627);let j=n.ZP.div.withConfig({componentId:"sc-6f365afb-0"})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(420px,1fr));gap:16px;flex-wrap:wrap;@media (max-width:430px){grid-template-columns:repeat(auto-fill,minmax(100%,1fr));}"]),b=n.ZP.div.withConfig({componentId:"sc-6f365afb-1"})(['border:3px solid transparent;position:relative;border-radius:8px;overflow:hidden;transition:all 0.3s;cursor:pointer;height:160px;position:relative;[data-selected="selected"]&{border-color:var(--secondary-color);}']),w=n.ZP.div.withConfig({componentId:"sc-6f365afb-2"})(["padding:16px 24px;position:absolute;display:flex;flex-direction:column;align-items:flex-start;gap:4px;"]),y=n.ZP.div.withConfig({componentId:"sc-6f365afb-3"})(["font-size:16px;color:#fff;"]),N=n.ZP.div.withConfig({componentId:"sc-6f365afb-4"})(["font-size:10px;color:rgba(255,255,255,0.85);"]),Z=n.ZP.div.withConfig({componentId:"sc-6f365afb-5"})(["background:linear-gradient(180deg,rgba(0,0,0,0) 44.69%,rgba(0,0,0,0.584808) 85.12%,rgba(0,0,0,0.8) 100%),linear-gradient(180deg,rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.584808) 7.65%,rgba(0,0,0,0) 28.44%);position:absolute;top:0;right:0;bottom:0;left:0;"]),C=n.ZP.span.withConfig({componentId:"sc-6f365afb-6"})(['color:var(--primary-color);[data-theme="light"] &{color:#000;}']);var S=e=>{let{control:t}=e,{language:l}=s.useContext(o.AZ),[,n]=s.useContext(v.kn),x=(0,a.Z)(),f=(0,r.qo)({control:t}),{trackToolConfiguration:S}=(0,g.G)("ai shorts"),E=(e,t)=>{var l;e.preventDefault(),e.stopPropagation(),n({type:v.BT.MODAL_STATE_CHANGED,payload:{isOpen:!0,closable:!0,children:(0,i.jsx)(h,{sampleVideo:t,aspectRatio:null==f?void 0:null===(l=f.aspectRatio)||void 0===l?void 0:l.value})}})},k=s.useCallback(e=>{var t,l,i;let s=(0,m.M_)(f.videoScript||""),o=((null===(t=f.videoScript)||void 0===t?void 0:t.length)||0)-(null==s?void 0:s.length),a=(0,p.bt)(o);return(null==f?void 0:f.textType)==="videoIdeaTab"?(null==e?void 0:e.value)===c.ZP.visualsSourcesValues.AI_GENERATED_IMAGES?null==f?void 0:null===(l=f.videoDuration)||void 0===l?void 0:l.aiImagesCredits:null==f?void 0:null===(i=f.videoDuration)||void 0===i?void 0:i.credits:(null==e?void 0:e.value)===c.ZP.visualsSourcesValues.AI_GENERATED_IMAGES?Math.max(60,Math.round((null==a?void 0:a.durationInSeconds)/60*((null==e?void 0:e.value)===c.ZP.visualsSourcesValues.AI_GENERATED_IMAGES?150:80))):Math.max(60,Math.round((null==a?void 0:a.durationInSeconds)/60*80))},[null==f?void 0:f.visualsSource,null==f?void 0:f.videoDuration]);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(d.Z,{src:"/icons/gallery.svg",fill:"var(--white-80-color)",width:"16px",height:"16px"}),(0,i.jsx)("span",{className:"text-t-shade-1 small-text",children:x.textToVideo.script.visuals.visualsSource.title})]}),(0,i.jsx)(r.Qr,{control:t,name:"visualsSource",render:e=>{let{field:{value:t,onChange:s}}=e;return(0,i.jsx)(j,{children:c.ZP.visualsSources.map((e,o)=>{var a;let r=k(e);return(0,i.jsxs)(b,{"data-selected":t===(null==e?void 0:e.value)?"selected":"","data-name":"video-visual",onClick:l=>{l.preventDefault(),e.value!==t&&(s(e.value),S({configuration_type:"visuals_source",visual_type:e.value,value:e.value}))},"data-test-id":e.value||"default",children:[(0,i.jsx)("img",{src:null==e?void 0:e.video["16:9"].thumbnail,className:"w-full h-full object-cover"}),(0,i.jsx)(Z,{}),(0,i.jsxs)(w,{className:"left-0 right-0 bottom-0 flex items-center justify-between",children:[(0,i.jsx)(d.Z,{src:null==e?void 0:e.icon,width:"24px",height:"24px",...(null==e?void 0:null===(a=e.svgProps)||void 0===a?void 0:a.isStroke)?{stroke:"#fff"}:{fill:"#fff"}}),(0,i.jsx)(y,{className:"mt-1",children:null==e?void 0:e.title[l]}),(0,i.jsx)(N,{children:null==e?void 0:e.description[l]})]}),(0,i.jsx)("div",{className:"absolute bg-pending px-4 py-1.5 right-4 top-4 roun
1ded-full",children:(0,i.jsxs)(C,{className:"text-xs",children:[r," ",x.global.credits(r)]})}),(0,i.jsx)(u.Z,{onClick:t=>E(t,e),size:"large",type:"accent",className:"absolute transform -translate-x-1/2 -translate-y-1/2 flex items-center justify-center hover:scale-110 transition-transform",style:{background:"var(--blue-haze-color)",top:"50%",left:"50%"},children:(0,i.jsx)(d.Z,{src:"/icons/play-white.svg",width:"16px",height:"16px",fill:"var(--blueberry-color)"})})]},o)})})}})]})}}},function(e){e.O(0,[24670,71819,92888,49774,40179],function(){return e(e.s=42505)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.