!function(){var t=document.createElement("style");t.innerHTML="._playContent_jst3b_1{width:100vw;height:100vh;background-color:#000;overflow:hidden}._coursewarePlay_jst3b_7{position:relative;height:100vh;margin:0 auto}._playModel_jst3b_12{position:absolute;left:0;top:0;right:0;bottom:0;box-shadow:inset 0 0 4.37333rem #000;pointer-events:none}._headerContainer_jst3b_21{position:fixed;top:0;left:0;right:0;z-index:1;padding:.26667rem .64rem;display:flex;align-items:center;color:#fff;font-size:.32rem;background:linear-gradient(180deg,rgba(0,0,0,.6),transparent)}._backBtn_jst3b_34{color:#fff;width:1.06667rem;height:.69333rem;display:flex;justify-content:space-between;align-items:center;z-index:10}._menu_jst3b_43{flex:1;display:flex;justify-content:center;color:#fff}._tabsContent_jst3b_49{width:100vw;height:100vh}._tabsContent_jst3b_49 .van-tabs__wrap{display:none!important}._tabsContent_jst3b_49 .van-tabs__content{width:100%;height:100%}._loadWrap_jst3b_60{position:absolute;left:0;top:0;right:0;bottom:0;background:linear-gradient(45deg,#21232a,#111218);display:flex;justify-content:center;align-items:center}._itemDiv_jst3b_71{position:relative;width:100%;height:100%}._itemDiv_jst3b_71 video{width:100%;height:100%}._itemDiv_jst3b_71 img{display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}._videoModel_jst3b_86{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}._videoModel_jst3b_86>img{width:1.33333rem;height:1.33333rem}._rightFixedBtns_jst3b_100{position:fixed;top:50%;transform:translateY(-50%);right:.53333rem}._rightFixedBtns_jst3b_100 ._point_jst3b_106{margin-top:.26667rem;border-bottom-left-radius:0;border-bottom-right-radius:0}._rightFixedBtns_jst3b_100 ._point_jst3b_106+._fullBtn_jst3b_111{border-top-left-radius:0;border-top-right-radius:0}._leftFixedBtns_jst3b_115{position:fixed;top:50%;transform:translateY(-50%);left:.53333rem}._leftFixedBtns_jst3b_115 ._prePoint_jst3b_121{margin-bottom:.21333rem}._fullBtn_jst3b_111{width:1.01333rem;height:1.46667rem;background:rgba(51,51,51,.15);border-radius:.21333rem;display:flex;flex-direction:column;align-items:center;color:#fff;justify-content:space-evenly}._fullBtn_jst3b_111:active{opacity:.8}._bottomFixedContainer_jst3b_138{position:absolute;left:0;right:0;bottom:0;z-index:10;background:linear-gradient(0deg,rgba(0,0,0,.5),transparent);padding:0 .8rem}._bottomFixedContainer_jst3b_138 ._time_jst3b_147{display:flex;justify-content:space-between;color:#fff;font-size:.26667rem;padding:.10667rem 0}._bottomFixedContainer_jst3b_138 ._slider_jst3b_154{padding:.26667rem 0}._bottomFixedContainer_jst3b_138 ._actions_jst3b_157{display:flex;justify-content:space-between;color:#fff;font-size:.32rem;align-items:center}._bottomFixedContainer_jst3b_138 ._actions_jst3b_157 ._actionBtn_jst3b_164{display:flex}._bottomFixedContainer_jst3b_138 ._actions_jst3b_157 ._actionBtn_jst3b_164>img{width:.69333rem;height:.69333rem;display:block;padding:.21333rem .21333rem .37333rem}._popup_jst3b_173{background:rgba(0,0,0,.5)}._overlayClass_jst3b_176{--van-overlay-background: transparent}.top-enter-active,.top-leave-active{transition:transform .5s}.top-enter-from,.top-leave-to{transform:translateY(-100%)}.left-enter-active,.left-leave-active{transition:all .5s}.left-enter-from,.left-leave-to{left:-1.6rem}.right-enter-active,.right-leave-active{transition:all .5s}.right-enter-from,.right-leave-to{right:-1.6rem}.bottom-enter-active,.bottom-leave-active{transition:transform .5s}.bottom-enter-from,.bottom-leave-to{transform:translateY(100%)}\n",document.head.appendChild(t),System.register(["./index-legacy.eb062188.js","./plyr-legacy.2bfabaee.js","./icon-pause-legacy.520e7a8c.js","./useFee-legacy.54d7e2d0.js","./index-legacy.fab451f1.js"],(function(t){"use strict";var e,i,a,n,o,r,l,s,d,c,u,m,_,b,v,g,p,f,h,y,j,x,w,T,C,B,I,k,S,D,N,A,F,V,P,E,L,O,z,M,q,R,Y,W;return{setters:[function(t){e=t.t,i=t.d,a=t.R,n=t.aq,o=t.y,r=t.U,l=t.b8,s=t.a0,d=t.c,c=t.w,u=t.z,m=t.a_,_=t.an,b=t.a4,v=t.bN,g=t.bO,p=t.bF,f=t.aZ,h=t.D,y=t.r,j=t.b7,x=t.ah,w=t.ag,T=t.f,C=t.$,B=t.F,I=t.b9,k=t.bb,S=t.V,D=t.a5,N=t.q,A=t.al,F=t.e,V=t.m,P=t.g,E=t.bd,L=t.bi},function(){},function(t){O=t.i,z=t.a,M=t.p,q=t.b},function(t){R=t.h},function(t){Y=t.S,W=t.a}],execute:function(){const[H,$]=e("slider"),J={min:c(0),max:c(100),step:c(1),range:Boolean,reverse:Boolean,disabled:Boolean,readonly:Boolean,vertical:Boolean,barHeight:u,buttonSize:u,activeColor:String,inactiveColor:String,modelValue:{type:[Number,Array],default:0}};var X=i({name:H,props:J,emits:["change","dragEnd","dragStart","update:modelValue"],setup(t,{emit:e,slots:i}){let c,u,h;const y=a(),j=[a(),a()],x=a(),w=n(),T=o((()=>Number(t.max)-Number(t.min))),C=o((()=>{const e=t.vertical?"width":"height";return{background:t.inactiveColor,[e]:r(t.barHeight)}})),B=e=>t.range&&Array.isArray(e),I=()=>{const{modelValue:e,min:i}=t;return B(e)?100*(e[1]-e[0])/T.value+"%":100*(e-Number(i))/T.value+"%"},k=o((()=>{const e={[t.vertical?"height":"width"]:I(),background:t.activeColor};x.value&&(e.transition="none");return e[t.vertical?t.reverse?"bottom":"top":t.reverse?"right":"left"]=(()=>{const{modelValue:e,min:i}=t;return B(e)?100*(e[0]-Number(i))/T.value+"%":"0%"})(),e})),S=e=>{const i=+t.min,a=+t.max,n=+t.step;e=f(e,i,a);const o=Math.round((e-i)/n)*n;return g(i,o)},D=()=>{const e=t.modelValue;h=B(e)?e.map(S):S(e)},N=(i,a)=>{i=B(i)?(e=>{var i,a;const n=null!=(i=e[0])?i:Number(t.min),o=null!=(a=e[1])?a:Number(t.max);return n>o?[o,n]:[n,o]})(i).map(S):S(i),m(i,t.modelValue)||e("update:modelValue",i),a&&!m(i,h)&&e("change",i)},A=e=>{if(e.stopPropagation(),t.disabled||t.readonly)return;D();const{min:i,reverse:a,vertical:n,modelValue:o}=t,r=_(y),l=n?r.height:r.width,s=Number(i)+(n?a?r.bottom-e.clientY:e.clientY-r.top:a?r.right-e.clientX:e.clientX-r.left)/l*T.value;if(B(o)){const[t,e]=o;N(s<=(t+e)/2?[s,e]:[t,s],!0)}else N(s,!0)},F=i=>{if(t.disabled||t.readonly)return;"start"===x.value&&e("dragStart",i),b(i,!0),w.move(i),x.value="dragging";const a=_(y);let n=(t.vertical?w.deltaY.value:w.deltaX.value)/(t.vertical?a.height:a.width)*T.value;if(t.reverse&&(n=-n),B(h)){const e=t.reverse?1-c:c;u[e]=h[e]+n}else u=h+n;N(u)},V=i=>{t.disabled||t.readonly||("dragging"===x.value&&(N(u,!0),e("dragEnd",i)),x.value="")},P=e=>{if("number"==typeof e){return $("button-wrapper",["left","right"][e])}return $("button-wrapper",t.reverse?"left":"right")},E=(e,a)=>{const n="dragging"===x.value;if("number"==typeof a){const t=i[0===a?"left-button":"right-button"];let o;if(n&&Array.isArray(u)&&(o=u[0]>u[1]?1^c:c),t)return t({value:e,dragging:n,dragIndex:o})}return i.button?i.button({value:e,dragging:n}):d("div",{class:$("button"),style:p(t.buttonSize)},null)},L=e=>{const i="number"==typeof e?t.modelValue[e]:t.modelValue;return d("div",{ref:j[null!=e?e:0],role:"slider",class:P(e),tabindex:t.disabled?void 0:0,"aria-valuemin":t.min,"aria-valuenow":i,"aria-valuemax":t.max,"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,"aria-orientation":t.vertical?"vertical":"horizontal",onTouchstartPassive:i=>{"number"==typeof e&&(c=e),(e=>{t.disabled||t.readonly||(w.start(e),u=t.modelValue,D(),x.value="start")})(i)},onTouchend:V,onTouchcancel:V,onClick:v},[E(i,e)])};return N(t.modelValue),l((()=>t.modelValue)),j.forEach((t=>{s("touchmove",F,{target:t})})),()=>d("div",{ref:y,style:C.value,class:$({vertical:t.vertical,disabled:t.disabled}),onClick:A},[d("div",{class:$("bar"),style:k.value},[t.range?[L(0),L(1)]:L()])])}});const G=h(X);var U={playContent:"_playContent_jst3b_1",coursewarePlay:"_coursewarePlay_jst3b_7",playModel:"_playModel_jst3b_12",headerContainer:"_headerContainer_jst3b_21",backBtn:"_backBtn_jst3b_34",menu:"_menu_jst3b_43",tabsContent:"_tabsContent_jst3b_49",loadWrap:"_loadWrap_jst3b_60",itemDiv:"_itemDiv_jst3b_71",videoModel:"_videoModel_jst3b_86",rightFixedBtns:"_rightFixedBtns_jst3b_100",point:"_point_jst3b_106",fullBtn:"_fullBtn_jst3b_111",leftFixedBtns:"_leftFixedBtns_jst3b_115",prePoint:"_prePoint_jst3b_121",bottomFixedContainer:"_bottomFixedContainer_jst3b_138",time:"_time_jst3b_147",slider:"_slider_jst3b_154",actions:"_actions_jst3b_157",actionBtn:"_actionBtn_jst3b_164",popup:"_popup_jst3b_173",overlayClass:"_overlayClass_jst3b_176"};const Z="VIDEO",K="SONG";t("default",i({name:"exercise-after-class",setup(){const t=y({width:"100vw"}),e=(e=0)=>{(()=>{let e=Math.min(screen.width,screen.height)*(16/9);e>Math.max(screen.width,screen.height)?t.width="100vw":t.width=e+"px"})(),F({api:"setRequestedOrientation",content:{orientation:e}}),F({api:"setStatusBarVisibility",content:{isVisibility:e}})};e(),j((()=>{e(1)}));const i=x();w();const n=i.query,o=T(),r=a(),l=y({videoData:null,trainings:[],trainingTimes:0,itemList:[],showHead:!0,loading:!0,recordLoading:!1,isPlayBaseStatus:!0,isPlayAll:!0}),s=y({nowTime:0,model:!0,timer:null,item:null}),c=async()=>{try{var t,e;const o=await V.post(P.platformApi+`/studentLessonTraining/trainingRecord/${n.courseScheduleId}?userId=${null===(t=P.user)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.id}`,{hideLoading:!0});if(Array.isArray(null==o||null===(e=o.data)||void 0===e?void 0:e.trainings)){var a;const t=(null==o||null===(a=o.data)||void 0===a?void 0:a.trainings)||[],e=[];return t.forEach((t=>{e.push(...t.studentLessonTrainingDetails||[])})),e.forEach((t=>{let e={};try{e=JSON.parse(t.trainingContent)}catch(a){e=""}e.practiceTimes!==t.trainingTimes+""&&(l.isPlayAll=!1),t.materialId==i.query.materialId&&(_.tabName=t.knowledgePointName)})),e}}catch(o){}return[]};C((async()=>{const t=await c();t.forEach((t=>{let e={};try{e=JSON.parse(t.trainingContent)}catch(i){e=""}e.practiceTimes!==t.trainingTimes+""&&(l.isPlayBaseStatus=!1)})),(async t=>{Array.isArray(t)&&(l.trainings=t.map((t=>{try{t.trainingContent=JSON.parse(t.trainingContent)}catch(e){t.trainingContent=""}return{...t,currentTime:0,duration:100,paused:!0,loop:!1,videoEle:null,timer:null,muted:!0,autoplay:!0}})),l.itemList=l.trainings.filter((t=>t.materialId==i.query.materialId)),l.videoData=l.itemList[0],b())})(t),R()}));const u=()=>{F({api:"back"})},m=a(),_=y({firstIndex:0,open:!1,activeIndex:-1,tabActive:"",tabName:"",itemActive:"",itemName:""}),b=()=>{var t,i,a;if(0!=(null==l||null===(t=l.videoData)||void 0===t?void 0:t.trainingTimes)&&(null==l||null===(i=l.videoData)||void 0===i?void 0:i.trainingTimes)+""===(null===(a=l.videoData)||void 0===a||null===(a=a.trainingContent)||void 0===a?void 0:a.practiceTimes)){let t=!1,i=0;if(l.isPlayBaseStatus)i=l.trainings.findIndex((t=>{var e;return t.materialId==(null===(e=l.videoData)||void 0===e?void 0:e.materialId)})),t=i===l.trainings.length-1;else{let e=-1,a=!0;l.trainings.forEach(((t,i)=>{t.trainingContent.practiceTimes!==t.trainingTimes+""&&-1===e&&(e=i),t.trainingContent.practiceTimes!==t.trainingTimes+""&&(a=!1)})),i=-1!=e?e-1:-1,t=a}E({title:"课后作业",message:"你已完成该练习~",confirmButtonColor:"var(--van-primary)",confirmButtonText:t?"完成":"下一题",cancelButtonText:"继续"}).then((()=>{if(t)F({api:"goBack"});else{const t=l.trainings[i+1];if(t.knowledgePointName&&(_.tabName=t.knowledgePointName),(null==t?void 0:t.type)===Z&&(l.itemList=[t],l.videoData=t,b()),(null==t?void 0:t.type)===K){e(1),u();const i=L.stringify({id:t.content,courseScheduleId:n.courseScheduleId,lessonTrainingId:n.lessonTrainingId,materialId:t.materialId});let a=`${location.origin}/orchestra-music-score/?`+i;F({api:"openAccompanyWebView",content:{url:a,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}}})).catch((()=>{l.trainings[i].currentTime=0}))}};return()=>{let e;return d("div",{class:U.playContent},[d("div",{class:U.coursewarePlay,style:{width:t.width}},[d(Y,{style:{height:"100%"},ref:m,showIndicators:!1,loop:!1,vertical:!0,lazyRender:!0,touchable:!1,duration:0},(a=e=l.itemList.map(((t,e)=>d(W,null,{default:()=>[d(B,null,[d("div",{class:U.itemDiv,onClick:()=>{clearTimeout(t.timer),s.model=!s.model}},[d("video",{playsinline:"false",preload:"auto",class:"player",poster:"./assets/icon-videobg.2414ec8d.png","data-vid":t.id,src:t.content,loop:t.loop,autoplay:t.autoplay,muted:t.muted,onLoadedmetadata:async e=>{const i=e.target;t.duration=i.duration,t.videoEle=i,t.loaded=!0},onTimeupdate:e=>{if(!t.loaded)return;const i=e.target;t.currentTime=i.currentTime},onPlay:()=>{console.log("播放"),t.paused=!1,t.muted&&(t.muted=!1,t.videoEle.pause())},onPause:()=>{console.log("暂停"),t.paused=!0},onEnded:()=>(async t=>{var e;if(l.recordLoading)return;console.log("记录观看次数"),l.recordLoading=!0;const a=i.query,n={materialType:"VIDEO",record:{sourceTime:t.duration,clientType:P.platformType,feature:"LESSON_TRAINING",deviceType:o.android?"ANDROID":o.isApp?"IOS":"WEB"},courseScheduleId:a.courseScheduleId,lessonTrainingId:a.lessonTrainingId,materialId:(null===(e=l.videoData)||void 0===e?void 0:e.materialId)||""};try{await V.post(P.platformApi+"/studentLessonTraining/lessonTrainingRecord",{data:n,hideLoading:!0})}catch(r){}l.recordLoading=!1;try{const t=await c();if(Array.isArray(t)){const e=t.find((t=>{var e;return t.materialId==(null===(e=l.videoData)||void 0===e?void 0:e.materialId)}));e&&(l.videoData.trainingTimes=e.trainingTimes,b())}}catch(r){}})(t)},[d("source",{src:t.content,type:"video/mp4"},null)])]),d(I,{name:"bottom"},{default:()=>[s.model&&!t.muted&&d("div",{class:U.bottomFixedContainer},[d("div",{class:U.time},[d("span",null,[k(t.currentTime)]),d("span",null,[k(t.duration)])]),d("div",{class:U.slider},[t.duration&&d(G,{buttonSize:16,modelValue:t.currentTime,min:0,max:t.duration},null)]),d("div",{class:U.actions},[d("div",{class:U.actionBtn},[t.paused?d("img",{src:O,onClick:e=>{var i;clearTimeout(t.timer),null===(i=t.videoEle)||void 0===i||i.play(),t.paused=!1,t.timer=setTimeout((()=>{s.model=!1}),4e3)}},null):d("img",{src:z,onClick:e=>{var i;clearTimeout(t.timer),null===(i=t.videoEle)||void 0===i||i.pause(),t.paused=!0}},null)])])])]}),t.muted&&d("div",{class:U.loadWrap},[d(S,{animationData:M},null)])])]}))),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!A(a)?e:{default:()=>[e]})),d(I,{name:"top"},{default:()=>{var t,e;return[s.model&&d("div",{class:U.headerContainer,ref:r},[d("div",{class:U.backBtn,onClick:()=>u()},[d(D,{name:q},null),N("返回")]),d("div",{class:U.menu},[_.tabName]),d("div",{class:U.nums},[N("练习次数:"),(null===(t=l.videoData)||void 0===t?void 0:t.trainingTimes)||0,N("/"),(null===(e=l.videoData)||void 0===e||null===(e=e.trainingContent)||void 0===e?void 0:e.practiceTimes)||0])])]}})])]);var a}}}))}}}))}();