1import{_ as h}from"./SectionContainer-nc8N9wYU.js";import{T as _}from"./Toast-PM7v9XSn.js";import{S as y}from"./SpinnerIcon-BT_7Nkhe.js";import{_ as b}from"./VideoPlayer-DnB-4HML.js";import{i as d,o,g as i,a as f,w as x,b as u,c as g,d as s,t as m,n as k}from"./app-EDzeK_jU.js";import"./Box-DmSZGdRz.js";import"./Page-Cxf_GVRC.js";import"./ChevronUpIcon-DTXwQp30.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ChevronDownIcon-C-B9X1Y4.js";import"./TrashIcon-Cjv8gCRo.js";import"./PlusIcon-Dv_4nAkp.js";import"./MinusIcon-BPYLmDx9.js";import"./index-DX441AK6.js";const w=["id","disabled"],C=["for"],B={key:1},S={key:2},V={key:0,class:"mt-4"},$={key:1,class:"mt-1 text-sm text-red-500"},E={__name:"VideoSection",props:{section:{required:!0,type:Object}},setup(e){const l=e,n=d(),t=d(!1),r=d(0);function v(p){t.value=!0,r.value=0,l.section.data.file=null,n.value=null;const c=new FormData;c.append("file",p.target.files[0]),axios.post(route("api.admin.video.store"),c,{onUploadProgress:function(a){r.value=Math.round(a.loaded*100/a.total)}}).then(a=>{l.section.data.file=a.data.data,console.log(l.section.data.file)}).catch(a=>{a.response.status===422&&(n.value=a.response.data.message),_.error()}).finally(()=>{t.value=!1})}return(p,c)=>(o(),i("div",null,[f(h,{section:e.section},{default:x(()=>[u("input",{class:"hidden",id:`video-uploader-${e.section.uuid}`,accept:"video/mp4, video/webm",disabled:t.value,type:"file",onChange:v},null,40,w),u("label",{for:`video-uploader-${e.section.uuid}`,class:k([{"btn-disabled":t.value},"cursor-pointer btn btn-primary inline-flex items-center justify-center gap-x-2"])},[t.value?(o(),g(y,{key:0,class:"size-4 text-white animate-spin"})):s("",!0),t.value?(o(),i("span",B,m(r.value)+"%",1)):s("",!0),t.value?s("",!0):(o(),i("span",S,"Ladda upp"))],10,C),e.section.data.file?(o(),i("div",V,[f(b,{class:"max-w-md",autoplay:!1,controls:"",video:e.section.data.file},null,8,["video"]),u("p",null,m(e.section.data.file.file_name),1)])):s("",!0),n.value?(o(),i("p",$,m(n.value),1)):s("",!0)]),_:1},8,["section"])]))}};export{E as default};
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.