streamlit-nightly 1.42.1.dev20250206__py2.py3-none-any.whl → 1.42.1.dev20250209__py2.py3-none-any.whl
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.
- streamlit/auth_util.py +8 -0
- streamlit/config.py +18 -1
- streamlit/proto/NewSession_pb2.pyi +4 -1
- streamlit/runtime/app_session.py +35 -15
- streamlit/runtime/caching/cache_utils.py +1 -1
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.DwBO4CPU.js → FileDownload.esm.D9415avj.js} +1 -1
- streamlit/static/static/js/FileDropzone.Cd515bsy.js +5 -0
- streamlit/static/static/js/{FormClearHelper.LI0uGKXr.js → FormClearHelper.BBpErIGP.js} +1 -1
- streamlit/static/static/js/{Hooks.Dic60qKO.js → Hooks.CeSTXIj2.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BVSrSzyM.js → InputInstructions.BU5Td5cJ.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CiuIhn-j.js → ProgressBar.J2QhvKtD.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DXoPwgJm.js → RenderInPortalIfExists.BbbrvJaa.js} +1 -1
- streamlit/static/static/js/{Toolbar.Bws727nN.js → Toolbar.D-hUr0RX.js} +1 -1
- streamlit/static/static/js/{base-input.BG3_mR5a.js → base-input.CNkkCv4B.js} +1 -1
- streamlit/static/static/js/{createSuper.BF6PuRKW.js → createSuper.DHhKMTIx.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.Bv759UXp.js → data-grid-overlay-editor.CRylpesE.js} +1 -1
- streamlit/static/static/js/{downloader.CVHmveIJ.js → downloader.D_08g5mI.js} +1 -1
- streamlit/static/static/js/{es6.CKbvqIhx.js → es6.B-Rq6ajt.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.BkEeeo8L.js → iframeResizer.contentWindow.CFL3MAVr.js} +1 -1
- streamlit/static/static/js/{index.C583HQPW.js → index.-SmXSkUY.js} +1 -1
- streamlit/static/static/js/{index.gthzAzzy.js → index.9wBA4A4f.js} +5 -5
- streamlit/static/static/js/{index.D0P1HMA1.js → index.B-4MHYvl.js} +1 -1
- streamlit/static/static/js/{index.DRYIN7K5.js → index.B0xfT3p4.js} +1 -1
- streamlit/static/static/js/{index.BKVJ1VBu.js → index.B2evntzQ.js} +1 -1
- streamlit/static/static/js/{index.DMae4Z-0.js → index.B9q8XlSH.js} +1 -1
- streamlit/static/static/js/{index.BOaiJM1y.js → index.BA5ubsQA.js} +1 -1
- streamlit/static/static/js/{index.DC0pyGdw.js → index.BCYuLMdi.js} +1 -1
- streamlit/static/static/js/{index.DI1n7tF5.js → index.BNrZwkh1.js} +1 -1
- streamlit/static/static/js/{index.C7ShUXWu.js → index.BVbWPXFU.js} +1 -1
- streamlit/static/static/js/{index.DET-MvNj.js → index.BevO9CYu.js} +2 -2
- streamlit/static/static/js/{index.BOWcB5X0.js → index.BlcNB-sY.js} +1 -1
- streamlit/static/static/js/{index.UxOzm9KZ.js → index.BpmrfDoR.js} +1 -1
- streamlit/static/static/js/{index.DC2ac6Nk.js → index.BqePTNWb.js} +1 -1
- streamlit/static/static/js/{index.ezIYG9hW.js → index.Bw9RDCaH.js} +2 -2
- streamlit/static/static/js/{index.CLsR30iv.js → index.C-_AHUSz.js} +1 -1
- streamlit/static/static/js/{index.y9PB-mTp.js → index.CEWcZMdD.js} +1 -1
- streamlit/static/static/js/{index.C07oOjJI.js → index.CEj-S3PF.js} +1 -1
- streamlit/static/static/js/{index.e9DSvZ6b.js → index.CFtAnwvU.js} +1 -1
- streamlit/static/static/js/{index.Cs3niYHd.js → index.CMcCB4vg.js} +1 -1
- streamlit/static/static/js/{index.VkiSji1p.js → index.CQ_wmqnz.js} +1 -1
- streamlit/static/static/js/{index.TDbcj-aD.js → index.CuNiy4LB.js} +1 -1
- streamlit/static/static/js/{index.C4CvtPIA.js → index.CvADzqCD.js} +1 -1
- streamlit/static/static/js/{index.CYyMatnb.js → index.D94jjl7_.js} +1 -1
- streamlit/static/static/js/{index.CIUGbfN-.js → index.D9M0iUu5.js} +1 -1
- streamlit/static/static/js/{index.Gdr5urlE.js → index.DPs04g4h.js} +1 -1
- streamlit/static/static/js/{index.--2AyPrU.js → index.DWIf4xZP.js} +1 -1
- streamlit/static/static/js/{index.D4zWkike.js → index.DYHaq5Cw.js} +22 -22
- streamlit/static/static/js/{index.BkPpT8KL.js → index.DfCewjMv.js} +1 -1
- streamlit/static/static/js/{index.C_i45xvQ.js → index.DgwklVRJ.js} +1 -1
- streamlit/static/static/js/{index.DZhFuLsM.js → index.DwWMkgFE.js} +1 -1
- streamlit/static/static/js/{index.B5Uxprvt.js → index.JSS70wsq.js} +1 -1
- streamlit/static/static/js/{index.CfBMTPce.js → index.Yr32ts47.js} +1 -1
- streamlit/static/static/js/{index.BImYg1mO.js → index.i2uLxrqv.js} +1 -1
- streamlit/static/static/js/{index.DvjJSBT_.js → index.joQNIDux.js} +1 -1
- streamlit/static/static/js/{index.DCUW0b-w.js → index.pzjWTi64.js} +1 -1
- streamlit/static/static/js/{index.lxFhX6K1.js → index.zzxJWhBg.js} +1 -1
- streamlit/static/static/js/{input.ekQXAXS2.js → input.Dbc83Str.js} +1 -1
- streamlit/static/static/js/{memory.CzhWwr8k.js → memory.BzHgTb9i.js} +1 -1
- streamlit/static/static/js/{mergeWith.CjWtfLVK.js → mergeWith.BCa1_PWb.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CFFRhwzv.js → number-overlay-editor.CtUWknLp.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.BiMrneUm.js → possibleConstructorReturn.DGVrr2j8.js} +1 -1
- streamlit/static/static/js/{sandbox.B1Cwdby0.js → sandbox.C20zasAf.js} +1 -1
- streamlit/static/static/js/{textarea.BYQOUi7u.js → textarea.BeRVLTOp.js} +1 -1
- streamlit/static/static/js/{timepicker.BbVkXpKf.js → timepicker.DyU-jgSC.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.eNZZBqsg.js → toConsumableArray.D4FxxWIg.js} +1 -1
- streamlit/static/static/js/{uniqueId.Ci60uueL.js → uniqueId.CAAlIP1-.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.BJ0FCAzu.js → useBasicWidgetState.C207Y3_O.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.xhIvlf7z.js → useOnInputChange.CsqRc0X0.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CKNKx70m.js → withFullScreenWrapper.DwHjQb3H.js} +1 -1
- {streamlit_nightly-1.42.1.dev20250206.dist-info → streamlit_nightly-1.42.1.dev20250209.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.1.dev20250206.dist-info → streamlit_nightly-1.42.1.dev20250209.dist-info}/RECORD +76 -76
- streamlit/static/static/js/FileDropzone.l_rm_qyP.js +0 -5
- {streamlit_nightly-1.42.1.dev20250206.data → streamlit_nightly-1.42.1.dev20250209.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.1.dev20250206.dist-info → streamlit_nightly-1.42.1.dev20250209.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.1.dev20250206.dist-info → streamlit_nightly-1.42.1.dev20250209.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.1.dev20250206.dist-info → streamlit_nightly-1.42.1.dev20250209.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{r as h,E as V,_ as z,n as w,z as p,j as r,b8 as y,bp as g,co as E,bq as U,cp as L,a_ as B,F as k,R as N,aC as W,bk as T,
|
1
|
+
import{r as h,E as V,_ as z,n as w,z as p,j as r,b8 as y,bp as g,co as E,bq as U,cp as L,a_ as B,F as k,R as N,aC as W,bk as T,K as u,bm as D,bl as H,bs as A,bF as R,bt as _,bc as $,bu as O}from"./index.9wBA4A4f.js";import{a as S}from"./axios.upsvKRUO.js";import{F as X}from"./FormClearHelper.BBpErIGP.js";import{S as x,I as q,b as K,c as G,d as j,C as J,e as Q,f as Y,h as Z,i as ee,g as b,F as f,j as te,k as se,l as ie,s as le,m as ae,n as re}from"./FileDropzone.Cd515bsy.js";import{S as ne,P as oe}from"./ProgressBar.J2QhvKtD.js";import{u as de}from"./Hooks.CeSTXIj2.js";import{U as m}from"./UploadFileInfo.C-jY39rj.js";var C=h.forwardRef(function(l,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(V,z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},l,{ref:o}),h.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const ce=w("div",{target:"egc9vxm0"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:l.spacing.twoXS,marginBottom:l.spacing.twoXS})),pe=w("div",{target:"egc9vxm1"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"center",color:l.colors.fadedText40})),ue=({currentPage:l,totalPages:o,onNext:e,onPrevious:t})=>p(ce,{"data-testid":"stFileUploaderPagination",children:[r(x,{children:`Showing page ${l} of ${o}`}),p(pe,{children:[r(U,{onClick:t,kind:y.MINIMAL,children:r(g,{content:E,size:"xl"})}),r(U,{onClick:e,kind:y.MINIMAL,children:r(g,{content:L,size:"xl"})})]})]}),I=(l,o)=>Math.ceil(l.length/o),he=l=>B(({pageSize:e,items:t,resetOnAdd:s,...a})=>{const[i,n]=h.useState(0),[d,F]=h.useState(I(t,e)),c=de(t);h.useEffect(()=>{c&&c.length!==t.length&&F(I(t,e)),c&&c.length<t.length?s&&n(0):i+1>=d&&n(d-1)},[t,i,e,c,s,d]);const v=()=>{n(Math.min(i+1,d-1))},M=()=>{n(Math.max(0,i-1))},P=t.slice(i*e,i*e+e);return p(k,{children:[r(l,{items:P,...a}),t.length>e?r(ue,{pageSize:e,totalPages:d,currentPage:i+1,onNext:v,onPrevious:M}):null]})},l),ge=({fileInfo:l})=>l.status.type==="uploading"?r(oe,{value:l.status.progress,size:ne.SMALL}):l.status.type==="error"?p(ee,{children:[r(Y,{"data-testid":"stFileUploaderFileErrorMessage",children:l.status.errorMessage}),r(Z,{children:r(g,{content:C,size:"lg"})})]}):l.status.type==="uploaded"?r(x,{children:b(l.size,f.Byte)}):null,me=({fileInfo:l,onDelete:o})=>p(Q,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[r(K,{children:r(g,{content:q,size:"twoXL"})}),p(G,{className:"stFileUploaderFileData",children:[r(j,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:l.name,children:l.name}),r(ge,{fileInfo:l})]}),r("div",{"data-testid":"stFileUploaderDeleteBtn",children:r(U,{onClick:()=>o(l.id),kind:y.MINIMAL,children:r(g,{content:J,size:"lg"})})})]}),fe=({items:l,onDelete:o})=>r(ie,{children:l.map(e=>r(se,{children:r(me,{fileInfo:e,onDelete:o})},e.id))}),Fe=he(fe),ye=l=>r(te,{children:r(Fe,{...l})});class ve extends N.PureComponent{constructor(o){super(o),this.formClearHelper=new X,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props,i=s.getFileUploaderStateValue(t);W(e,i)||s.setFileUploaderStateValue(t,e,{fromUi:!0},a)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:s}=this.props,{multipleFiles:a}=s;if(!a&&e.length===0&&t.length>1){const i=t.findIndex(n=>n.errors.length===1&&n.errors[0].code==="too-many-files");i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then(i=>{if(!a&&e.length>0){const n=this.state.files.find(d=>d.status.type!=="error");n&&(this.forceUpdatingStatus=!0,this.deleteFile(n.id),this.forceUpdatingStatus=!1)}T(i,e).forEach(([n,d])=>{this.uploadFile(n,d)})}).catch(i=>{this.addFiles(e.map(n=>new m(n.name,n.size,this.nextLocalFileId(),{type:"error",errorMessage:i})))}),t.length>0){const i=t.map(n=>{const{file:d}=n;return new m(d.name,d.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(n.errors[0].code,n.file)})});this.addFiles(i)}},this.uploadFile=(e,t)=>{const s=S.CancelToken.source(),a=new m(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,i=>this.onUploadProgress(i,a.id),s.token).then(()=>this.onUploadComplete(a.id,e)).catch(i=>{S.isCancel(i)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:i?i.toString():"Unknown error"}))})},this.onUploadComplete=(e,t)=>{const s=this.getFile(e);u(s)||s.status.type!=="uploading"||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return`File must be ${b(this.maxUploadSizeInBytes,f.Byte)} or smaller.`;case"file-invalid-type":return`${t.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);u(t)||(t.status.type==="uploading"&&t.status.cancelToken.cancel(),t.status.type==="uploaded"&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(t=>({files:[...t.files,e]}))},this.addFiles=e=>{this.setState(t=>({files:[...t.files,...e]}))},this.removeFile=e=>{this.setState(t=>({files:t.files.filter(s=>s.id!==e)}))},this.getFile=e=>this.state.files.find(t=>t.id===e),this.updateFile=(e,t)=>{this.setState(s=>({files:s.files.map(a=>a.id===e?t:a)}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(u(s)||s.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);s.status.progress!==a&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:a}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(u(e))return;const{widgetMgr:t,element:s,fragmentId:a}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},a)})},this.state=this.initialValue}get initialValue(){const o={files:[],newestServerFileId:0},{widgetMgr:e,element:t}=this.props,s=e.getFileUploaderStateValue(t);if(u(s))return o;const{uploadedFileInfo:a}=s;return u(a)||a.length===0?o:{files:a.map(i=>{const n=i.name,d=i.size,F=i.fileId,c=i.fileUrls;return new m(n,d,this.nextLocalFileId(),{type:"uploaded",fileId:F,fileUrls:c})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const o=this.props.element.maxUploadSizeMb;return le(o,f.Megabyte,f.Byte)}get status(){const o=e=>e.status.type==="uploading";return this.state.files.some(o)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const o=this.createWidgetValue(),{element:e,widgetMgr:t,fragmentId:s}=this.props;t.getFileUploaderStateValue(e)===void 0&&t.setFileUploaderStateValue(e,o,{fromUi:!1},s)}createWidgetValue(){const o=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:t,size:s,status:a}=e,{fileId:i,fileUrls:n}=a;return new D({fileId:i,fileUrls:n,name:t,size:s})});return new H({uploadedFileInfo:o})}render(){var d;const{files:o}=this.state,{element:e,disabled:t,widgetMgr:s,width:a}=this.props,i=e.type;this.formClearHelper.manageFormClearListener(s,e.formId,this.onFormCleared);const n=o.slice().reverse();return p(re,{className:"stFileUploader","data-testid":"stFileUploader",width:a,children:[r(O,{label:e.label,disabled:t,labelVisibility:A((d=e.labelVisibility)==null?void 0:d.value),children:e.help&&r(R,{children:r(_,{content:e.help,placement:$.TOP_RIGHT})})}),r(ae,{onDrop:this.dropHandler,multiple:e.multipleFiles,acceptedExtensions:i,maxSizeBytes:this.maxUploadSizeInBytes,label:e.label,disabled:t}),n.length>0&&r(ye,{items:n,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}export{ve as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as s,R as u,aF as b,bb as k,y as C,j as n,b9 as v,bc as L,z as y,D as T,aE as w}from"./index.
|
1
|
+
import{n as s,R as u,aF as b,bb as k,y as C,j as n,b9 as v,bc as L,z as y,D as T,aE as w}from"./index.9wBA4A4f.js";const S=s("div",{target:"e1xmaixs0"})({display:"flex",flexDirection:"column"}),h=s("a",{target:"e1xmaixs1"})(({disabled:a,isCurrentPage:o,fluidWidth:l,theme:e})=>({textDecoration:"none",width:typeof l=="number"?`${l}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),D=s("span",{target:"e1xmaixs2"})(({disabled:a,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function P(a,o){return a===null&&o?!0:a===null&&!o?!1:a===!0}function H(a){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(b),e=u.useContext(k),{colors:i}=C(),{disabled:t,element:r,width:c}=a,p={width:c},f=P(r.useContainerWidth,e),d=l===r.pageScriptHash,x=g=>{r.external?t&&g.preventDefault():(g.preventDefault(),t||o(r.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",style:p,children:n(v,{help:r.help,placement:L.TOP_RIGHT,children:n(S,{children:y(h,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,fluidWidth:f?c:!1,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:x,children:[r.icon&&n(T,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),n(D,{disabled:t,children:n(w,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}export{H as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as U,r as s,bj as V,j as l}from"./index.
|
1
|
+
import{n as U,r as s,bj as V,j as l}from"./index.9wBA4A4f.js";const P=U("iframe",{target:"eymnmwl0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:y,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:b}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const v=r.pathname.split("/").pop();v&&r.searchParams.append("playlist",v)}return N&&r.searchParams.append("autoplay","1"),b&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(P,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?R:void 0},crossOrigin:void 0,children:y&&y.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
|