officialblock 3.1.4 → 3.1.6
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/dist/{index-D-8tWpCY.js → index-BeSWoUg6.js} +1 -1
- package/dist/index-CzrumEKa.mjs +4 -0
- package/dist/{index-B7HIPqj6.js → index-Dcl1vAzb.js} +1 -1
- package/dist/{index-C2-bLDpj.mjs → index-DmE1hIZp.mjs} +24 -24
- package/dist/{index-CuI7G_-R.js → index-hBD50DYa.js} +6 -6
- package/dist/{index-CgQuoxXf.mjs → index-kZODD1TI.mjs} +1 -1
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +1 -1
- package/dist/official-block.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-Cgu0V1KJ.mjs +0 -4
|
@@ -534,4 +534,4 @@ ${cl(t)}`),o.map&&!o.map.bytes&&(this.logger_("going to request init segment."),
|
|
|
534
534
|
`.split("").map(n=>n.charCodeAt(0)));class Jte extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Zte extends Dh{constructor(t,o={}){super(t,o),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=t.featuresNativeTextTracks,this.loadVttJs=t.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Kt();const t=this.subtitlesTrack_.cues,o=t[0].startTime,a=t[t.length-1].startTime;return Kt([[o,a]])}initSegmentForMap(t,o=!1){if(!t)return null;const a=wc(t);let i=this.initSegments_[a];if(o&&!i&&t.bytes){const s=n2.byteLength+t.bytes.byteLength,r=new Uint8Array(s);r.set(t.bytes),r.set(n2,t.bytes.byteLength),this.initSegments_[a]=i={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:r}}return i||t}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(t){return typeof t>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=t,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(t,o){xs(t,o,this.subtitlesTrack_)}fillBuffer_(){const t=this.chooseNextRequest_();if(t){if(this.syncController_.timestampOffsetForTimeline(t.timeline)===null){const o=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",o),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(t)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(t){for(;t&&t.segment.empty;){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t}stopForError(t){this.error(t),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(t,o,a){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(o.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(t){t.code===Qo.TIMEOUT&&this.handleTimeout_(),t.code===Qo.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(t);return}const i=this.pendingSegment_,s=a.mp4VttCues&&a.mp4VttCues.length;s&&(i.mp4VttCues=a.mp4VttCues),this.saveBandwidthRelatedStats_(i.duration,o.stats),o.key&&this.segmentKey(o.key,!0),this.state="APPENDING",this.trigger("appending");const r=i.segment;if(r.map&&(r.map.bytes=o.map.bytes),i.bytes=o.bytes,typeof _.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(t,o,a),()=>this.stopForError({message:"Error loading vtt.js"}));return}r.requested=!0;try{this.parseVTTCues_(i)}catch(l){this.stopForError({message:l.message,metadata:{errorType:se.Error.StreamingVttParserError,error:l}});return}if(s||this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.cues.length?i.timingInfo={start:i.cues[0].startTime,end:i.cues[i.cues.length-1].endTime}:i.timingInfo={start:i.startOfSegment,end:i.startOfSegment+i.duration},i.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,i.cues.forEach(l=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new _.VTTCue(l.startTime,l.endTime,l.text):l)}),Mte(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(t,o){const a=t&&t.type==="vtt",i=o&&o.type==="text";a&&i&&super.handleData_(t,o)}updateTimingInfoEnd_(){}parseMp4VttCues_(t){const o=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();t.mp4VttCues.forEach(a=>{const i=a.start+o,s=a.end+o,r=new _.VTTCue(i,s,a.cueText);a.settings&&a.settings.split(" ").forEach(l=>{const d=l.split(":"),c=d[0],u=d[1];r[c]=isNaN(u)?u:Number(u)}),t.cues.push(r)})}parseVTTCues_(t){let o,a=!1;if(typeof _.WebVTT!="function")throw new Jte;if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},t.mp4VttCues){this.parseMp4VttCues_(t);return}typeof _.TextDecoder=="function"?o=new _.TextDecoder("utf8"):(o=_.WebVTT.StringDecoder(),a=!0);const i=new _.WebVTT.Parser(_,_.vttjs,o);if(i.oncue=t.cues.push.bind(t.cues),i.ontimestampmap=r=>{t.timestampmap=r},i.onparsingerror=r=>{se.log.warn("Error encountered when parsing cues: "+r.message)},t.segment.map){let r=t.segment.map.bytes;a&&(r=t2(r)),i.parse(r)}let s=t.bytes;a&&(s=t2(s)),i.parse(s),i.flush()}updateTimeMapping_(t,o,a){const i=t.segment;if(!o)return;if(!t.cues.length){i.empty=!0;return}const{MPEGTS:s,LOCAL:r}=t.timestampmap,d=s/Xa.ONE_SECOND_IN_TS-r+o.mapping;if(t.cues.forEach(c=>{const u=c.endTime-c.startTime,g=this.handleRollover_(c.startTime+d,o.time);c.startTime=Math.max(g,0),c.endTime=Math.max(g+u,0)}),!a.syncInfo){const c=t.cues[0].startTime,u=t.cues[t.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+t.mediaIndex,time:Math.min(c,u-i.duration)}}}handleRollover_(t,o){if(o===null)return t;let a=t*Xa.ONE_SECOND_IN_TS;const i=o*Xa.ONE_SECOND_IN_TS;let s;for(i<a?s=-8589934592:s=8589934592;Math.abs(a-i)>4294967296;)a+=s;return a/Xa.ONE_SECOND_IN_TS}}const _te=function(n,t){const o=n.cues;for(let a=0;a<o.length;a++){const i=o[a];if(t>=i.adStartTime&&t<=i.adEndTime)return i}return null},$te=function(n,t,o=0){if(!n.segments)return;let a=o,i;for(let s=0;s<n.segments.length;s++){const r=n.segments[s];if(i||(i=_te(t,a+r.duration/2)),i){if("cueIn"in r){i.endTime=a,i.adEndTime=a,a+=r.duration,i=null;continue}if(a<i.endTime){a+=r.duration;continue}i.endTime+=r.duration}else if("cueOut"in r&&(i=new _.VTTCue(a,a+r.duration,r.cueOut),i.adStartTime=a,i.adEndTime=a+parseFloat(r.cueOut),t.addCue(i)),"cueOutCont"in r){const[l,d]=r.cueOutCont.split("/").map(parseFloat);i=new _.VTTCue(a,a+r.duration,""),i.adStartTime=a-l,i.adEndTime=i.adStartTime+d,t.addCue(i)}a+=r.duration}};class o2{constructor({start:t,end:o,segmentIndex:a,partIndex:i=null,appended:s=!1}){this.start_=t,this.end_=o,this.segmentIndex_=a,this.partIndex_=i,this.appended_=s}isInRange(t){return t>=this.start&&t<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class ene{constructor(t,o=[]){this.segmentSyncInfo_=t,this.partsSyncInfo_=o}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(t=>t.resetAppendedStatus())}}class a2{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(t=>t.resetAppendStatus())}update(t,o){const{mediaSequence:a,segments:i}=t;if(this.isReliable_=this.isReliablePlaylist_(a,i),!!this.isReliable_)return this.updateStorage_(i,a,this.calculateBaseTime_(a,i,o))}getSyncInfoForTime(t){for(const{segmentSyncInfo:o,partsSyncInfo:a}of this.storage_.values())if(a.length){for(const i of a)if(i.isInRange(t))return i}else if(o.isInRange(t))return o;return null}getSyncInfoForMediaSequence(t){return this.storage_.get(t)}updateStorage_(t,o,a){const i=new Map;let s=`
|
|
535
535
|
`,r=a,l=o;this.start_=r,t.forEach((d,c)=>{const u=this.storage_.get(l),g=r,f=g+d.duration,m=!!(u&&u.segmentSyncInfo&&u.segmentSyncInfo.isAppended),h=new o2({start:g,end:f,appended:m,segmentIndex:c});d.syncInfo=h;let p=r;const A=(d.parts||[]).map((E,x)=>{const b=p,C=p+E.duration,D=!!(u&&u.partsSyncInfo&&u.partsSyncInfo[x]&&u.partsSyncInfo[x].isAppended),S=new o2({start:b,end:C,appended:D,segmentIndex:c,partIndex:x});return p=C,s+=`Media Sequence: ${l}.${x} | Range: ${b} --> ${C} | Appended: ${D}
|
|
536
536
|
`,E.syncInfo=S,S});i.set(l,new ene(h,A)),s+=`${Gy(d.resolvedUri)} | Media Sequence: ${l} | Range: ${g} --> ${f} | Appended: ${m}
|
|
537
|
-
`,l++,r=f}),this.end_=r,this.storage_=i,this.diagnostics_=s}calculateBaseTime_(t,o,a){if(!this.storage_.size)return 0;if(this.storage_.has(t))return this.storage_.get(t).segmentSyncInfo.start;const i=Math.min(...this.storage_.keys());if(t<i){const s=i-t;let r=this.storage_.get(i).segmentSyncInfo.start;for(let l=0;l<s;l++){const d=o[l];r-=d.duration}return r}return a}isReliablePlaylist_(t,o){return t!=null&&Array.isArray(o)&&o.length}}class i2 extends a2{constructor(t){super(),this.parent_=t}calculateBaseTime_(t,o,a){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(t);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(t,o,a)}}const tne=86400,Nh=[{name:"VOD",run:(n,t,o,a,i)=>o!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(n,t,o,a,i,s)=>{const r=n.getMediaSequenceSync(s);if(!r||!r.isReliable)return null;const l=r.getSyncInfoForTime(i);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(n,t,o,a,i)=>{if(!Object.keys(n.timelineToDatetimeMappings).length)return null;let s=null,r=null;const l=uh(t);i=i||0;for(let d=0;d<l.length;d++){const c=t.endList||i===0?d:l.length-(d+1),u=l[c],g=u.segment,f=n.timelineToDatetimeMappings[g.timeline];if(!f||!g.dateTimeObject)continue;let h=g.dateTimeObject.getTime()/1e3+f;if(g.parts&&typeof u.partIndex=="number")for(let A=0;A<u.partIndex;A++)h+=g.parts[A].duration;const p=Math.abs(i-h);if(r!==null&&(p===0||r<p))break;r=p,s={time:h,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}return s}},{name:"Segment",run:(n,t,o,a,i)=>{let s=null,r=null;i=i||0;const l=uh(t);for(let d=0;d<l.length;d++){const c=t.endList||i===0?d:l.length-(d+1),u=l[c],g=u.segment,f=u.part&&u.part.start||g&&g.start;if(g.timeline===a&&typeof f<"u"){const m=Math.abs(i-f);if(r!==null&&r<m)break;(!s||r===null||r>=m)&&(r=m,s={time:f,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return s}},{name:"Discontinuity",run:(n,t,o,a,i)=>{let s=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let r=null;for(let l=0;l<t.discontinuityStarts.length;l++){const d=t.discontinuityStarts[l],c=t.discontinuitySequence+l+1,u=n.discontinuities[c];if(u){const g=Math.abs(i-u.time);if(r!==null&&r<g)break;(!s||r===null||r>=g)&&(r=g,s={time:u.time,segmentIndex:d,partIndex:null})}}}return s}},{name:"Playlist",run:(n,t,o,a,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class nne extends se.EventTarget{constructor(t={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const o=new a2,a=new i2(o),i=new i2(o);this.mediaSequenceStorage_={main:o,audio:a,vtt:i},this.logger_=lo("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,o,a,i,s){if(o!==1/0)return Nh.find(({name:d})=>d==="VOD").run(this,t,o);const r=this.runStrategies_(t,o,a,i,s);if(!r.length)return null;for(const l of r){const{syncPoint:d,strategy:c}=l,{segmentIndex:u,time:g}=d;if(u<0)continue;const f=t.segments[u],m=g,h=m+f.duration;if(this.logger_(`Strategy: ${c}. Current time: ${i}. selected segment: ${u}. Time: [${m} -> ${h}]}`),i>=m&&i<h)return this.logger_("Found sync point with exact match: ",d),d}return this.selectSyncPoint_(r,{key:"time",value:i})}getExpiredTime(t,o){if(!t||!t.segments)return null;const a=this.runStrategies_(t,o,t.discontinuitySequence,0);if(!a.length)return null;const i=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+Cs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(t,o,a,i,s){const r=[];for(let l=0;l<Nh.length;l++){const d=Nh[l],c=d.run(this,t,o,a,i,s);c&&(c.strategy=d.name,r.push({strategy:d.name,syncPoint:c}))}return r}selectSyncPoint_(t,o){let a=t[0].syncPoint,i=Math.abs(t[0].syncPoint[o.key]-o.value),s=t[0].strategy;for(let r=1;r<t.length;r++){const l=Math.abs(t[r].syncPoint[o.key]-o.value);l<i&&(i=l,a=t[r].syncPoint,s=t[r].strategy)}return this.logger_(`syncPoint for [${o.key}: ${o.value}] chosen with strategy [${s}]: [time:${a.time}, segmentIndex:${a.segmentIndex}`+(typeof a.partIndex=="number"?`,partIndex:${a.partIndex}`:"")+"]"),a}saveExpiredSegmentInfo(t,o){const a=o.mediaSequence-t.mediaSequence;if(a>tne){se.log.warn(`Not saving expired segment info. Media sequence gap ${a} is too large.`);return}for(let i=a-1;i>=0;i--){const s=t.segments[i];if(s&&typeof s.start<"u"){o.syncInfo={mediaSequence:t.mediaSequence+i,time:s.start},this.logger_(`playlist refresh sync: [time:${o.syncInfo.time}, mediaSequence: ${o.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const o=t.segments[0],a=o.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[o.timeline]=-a}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:o}){const a=this.calculateSegmentTimeMapping_(t,t.timingInfo,o),i=t.segment;a&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));const s=i.dateTimeObject;i.discontinuity&&o&&s&&(this.timelineToDatetimeMappings[i.timeline]=-(s.getTime()/1e3))}timestampOffsetForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].time}mappingForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].mapping}calculateSegmentTimeMapping_(t,o,a){const i=t.segment,s=t.part;let r=this.timelines[t.timeline],l,d;if(typeof t.timestampOffset=="number")r={time:t.startOfSegment,mapping:t.startOfSegment-o.start},a&&(this.timelines[t.timeline]=r,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${t.timeline}: [time: ${r.time}] [mapping: ${r.mapping}]`)),l=t.startOfSegment,d=o.end+r.mapping;else if(r)l=o.start+r.mapping,d=o.end+r.mapping;else return!1;return s&&(s.start=l,s.end=d),(!i.start||l<i.start)&&(i.start=l),i.end=d,!0}saveDiscontinuitySyncInfo_(t){const o=t.playlist,a=t.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(o.discontinuityStarts&&o.discontinuityStarts.length)for(let i=0;i<o.discontinuityStarts.length;i++){const s=o.discontinuityStarts[i],r=o.discontinuitySequence+i+1,l=s-t.mediaIndex,d=Math.abs(l);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>d){let c;l<0?c=a.start-Cs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex,endIndex:s}):c=a.end+Cs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex+1,endIndex:s}),this.discontinuities[r]={time:c,accuracy:d}}}}dispose(){this.trigger("dispose"),this.off()}}class one extends se.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:o,to:a}){return typeof o=="number"&&typeof a=="number"&&(this.pendingTimelineChanges_[t]={type:t,from:o,to:a},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:o,to:a}){if(typeof o=="number"&&typeof a=="number"){this.lastTimelineChanges_[t]={type:t,from:o,to:a},delete this.pendingTimelineChanges_[t];const i={timelineChangeInfo:{from:o,to:a}};this.trigger({type:"timelinechange",metadata:i})}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ane=Py(Iy(function(){var n=function(){function p(){this.listeners={}}var A=p.prototype;return A.on=function(x,b){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push(b)},A.off=function(x,b){if(!this.listeners[x])return!1;var C=this.listeners[x].indexOf(b);return this.listeners[x]=this.listeners[x].slice(0),this.listeners[x].splice(C,1),C>-1},A.trigger=function(x){var b=this.listeners[x];if(b)if(arguments.length===2)for(var C=b.length,D=0;D<C;++D)b[D].call(this,arguments[1]);else for(var S=Array.prototype.slice.call(arguments,1),w=b.length,V=0;V<w;++V)b[V].apply(this,S)},A.dispose=function(){this.listeners={}},A.pipe=function(x){this.on("data",function(b){x.push(b)})},p}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function t(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const o=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],A=p[0],E=p[1],x=A[4],b=E[4];let C,D,S;const w=[],V=[];let P,k,I,L,U,Q;for(C=0;C<256;C++)V[(w[C]=C<<1^(C>>7)*283)^C]=C;for(D=S=0;!x[D];D^=P||1,S=V[S]||1)for(L=S^S<<1^S<<2^S<<3^S<<4,L=L>>8^L&255^99,x[D]=L,b[L]=D,I=w[k=w[P=w[D]]],Q=I*16843009^k*65537^P*257^D*16843008,U=w[L]*257^L*16843008,C=0;C<4;C++)A[C][D]=U=U<<24^U>>>8,E[C][L]=Q=Q<<24^Q>>>8;for(C=0;C<5;C++)A[C]=A[C].slice(0),E[C]=E[C].slice(0);return p};let a=null;class i{constructor(A){a||(a=o()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];let E,x,b;const C=this._tables[0][4],D=this._tables[1],S=A.length;let w=1;if(S!==4&&S!==6&&S!==8)throw new Error("Invalid aes key size");const V=A.slice(0),P=[];for(this._key=[V,P],E=S;E<4*S+28;E++)b=V[E-1],(E%S===0||S===8&&E%S===4)&&(b=C[b>>>24]<<24^C[b>>16&255]<<16^C[b>>8&255]<<8^C[b&255],E%S===0&&(b=b<<8^b>>>24^w<<24,w=w<<1^(w>>7)*283)),V[E]=V[E-S]^b;for(x=0;E;x++,E--)b=V[x&3?E:E-4],E<=4||x<4?P[x]=b:P[x]=D[0][C[b>>>24]]^D[1][C[b>>16&255]]^D[2][C[b>>8&255]]^D[3][C[b&255]]}decrypt(A,E,x,b,C,D){const S=this._key[1];let w=A^S[0],V=b^S[1],P=x^S[2],k=E^S[3],I,L,U;const Q=S.length/4-2;let H,z=4;const K=this._tables[1],J=K[0],j=K[1],O=K[2],v=K[3],W=K[4];for(H=0;H<Q;H++)I=J[w>>>24]^j[V>>16&255]^O[P>>8&255]^v[k&255]^S[z],L=J[V>>>24]^j[P>>16&255]^O[k>>8&255]^v[w&255]^S[z+1],U=J[P>>>24]^j[k>>16&255]^O[w>>8&255]^v[V&255]^S[z+2],k=J[k>>>24]^j[w>>16&255]^O[V>>8&255]^v[P&255]^S[z+3],z+=4,w=I,V=L,P=U;for(H=0;H<4;H++)C[(3&-H)+D]=W[w>>>24]<<24^W[V>>16&255]<<16^W[P>>8&255]<<8^W[k&255]^S[z++],I=w,w=V,V=P,P=k,k=I}}class s extends n{constructor(){super(n),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const r=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},l=function(p,A,E){const x=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),b=new i(Array.prototype.slice.call(A)),C=new Uint8Array(p.byteLength),D=new Int32Array(C.buffer);let S,w,V,P,k,I,L,U,Q;for(S=E[0],w=E[1],V=E[2],P=E[3],Q=0;Q<x.length;Q+=4)k=r(x[Q]),I=r(x[Q+1]),L=r(x[Q+2]),U=r(x[Q+3]),b.decrypt(k,I,L,U,D,Q),D[Q]=r(D[Q]^S),D[Q+1]=r(D[Q+1]^w),D[Q+2]=r(D[Q+2]^V),D[Q+3]=r(D[Q+3]^P),S=k,w=I,V=L,P=U;return C};class d{constructor(A,E,x,b){const C=d.STEP,D=new Int32Array(A.buffer),S=new Uint8Array(A.byteLength);let w=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(D.subarray(w,w+C),E,x,S)),w=C;w<D.length;w+=C)x=new Uint32Array([r(D[w-4]),r(D[w-3]),r(D[w-2]),r(D[w-1])]),this.asyncStream_.push(this.decryptChunk_(D.subarray(w,w+C),E,x,S));this.asyncStream_.push(function(){b(null,t(S))})}static get STEP(){return 32e3}decryptChunk_(A,E,x,b){return function(){const C=l(A,E,x);b.set(C,A.byteOffset)}}}var c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},u;typeof window<"u"?u=window:typeof c<"u"?u=c:typeof self<"u"?u=self:u={};var g=u,f=function(A){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(A):A&&A.buffer instanceof ArrayBuffer},m=g.BigInt||Number;m("0x1"),m("0x100"),m("0x10000"),m("0x1000000"),m("0x100000000"),m("0x10000000000"),m("0x1000000000000"),m("0x100000000000000"),m("0x10000000000000000"),function(){var p=new Uint16Array([65484]),A=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return A[0]===255?"big":A[0]===204?"little":"unknown"}();const h=function(p){const A={};return Object.keys(p).forEach(E=>{const x=p[E];f(x)?A[E]={bytes:x.buffer,byteOffset:x.byteOffset,byteLength:x.byteLength}:A[E]=x}),A};self.onmessage=function(p){const A=p.data,E=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),x=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),b=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new d(E,x,b,function(C,D){self.postMessage(h({source:A.source,decrypted:D}),[D.buffer])})}}));var ine=Ty(ane);const lne=n=>{let t=n.default?"main":"alternative";return n.characteristics&&n.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},l2=(n,t)=>{n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Th=(n,t)=>{t.activePlaylistLoader=n,n.load()},sne=(n,t)=>()=>{const{segmentLoaders:{[n]:o,main:a},mediaTypes:{[n]:i}}=t,s=i.activeTrack(),r=i.getActiveGroup(),l=i.activePlaylistLoader,d=i.lastGroup_;if(!(r&&d&&r.id===d.id)&&(i.lastGroup_=r,i.lastTrack_=s,l2(o,i),!(!r||r.isMainPlaylist))){if(!r.playlistLoader){l&&a.resetEverything();return}o.resyncLoader(),Th(r.playlistLoader,i)}},rne=(n,t)=>()=>{const{segmentLoaders:{[n]:o},mediaTypes:{[n]:a}}=t;a.lastGroup_=null,o.abort(),o.pause()},dne=(n,t)=>()=>{const{mainPlaylistLoader:o,segmentLoaders:{[n]:a,main:i},mediaTypes:{[n]:s}}=t,r=s.activeTrack(),l=s.getActiveGroup(),d=s.activePlaylistLoader,c=s.lastTrack_;if(!(c&&r&&c.id===r.id)&&(s.lastGroup_=l,s.lastTrack_=r,l2(a,s),!!l)){if(l.isMainPlaylist){if(!r||!c||r.id===c.id)return;const u=t.vhs.playlistController_,g=u.selectPlaylist();if(u.media()===g)return;s.logger_(`track change. Switching main audio from ${c.id} to ${r.id}`),o.pause(),i.resetEverything(),u.fastQualityChange_(g);return}if(n==="AUDIO"){if(!l.playlistLoader){i.setAudio(!0),i.resetEverything();return}a.setAudio(!0),i.setAudio(!1)}if(d===l.playlistLoader){Th(l.playlistLoader,s);return}a.track&&a.track(r),a.resetEverything(),Th(l.playlistLoader,s)}},xc={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:o},excludePlaylist:a}=t,i=o.activeTrack(),s=o.activeGroup(),r=(s.filter(d=>d.default)[0]||s[0]).id,l=o.tracks[r];if(i===l){a({error:{message:"Problem encountered loading the default audio track."}});return}se.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const d in o.tracks)o.tracks[d].enabled=o.tracks[d]===l;o.onTrackChanged()},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:o}}=t;se.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const a=o.activeTrack();a&&(a.mode="disabled"),o.onTrackChanged()}},s2={AUDIO:(n,t,o)=>{if(!t)return;const{tech:a,requestOptions:i,segmentLoaders:{[n]:s}}=o;t.on("loadedmetadata",()=>{const r=t.media();s.playlist(r,i),(!a.paused()||r.endList&&a.preload()!=="none")&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),i),a.paused()||s.load()}),t.on("error",xc[n](n,o))},SUBTITLES:(n,t,o)=>{const{tech:a,requestOptions:i,segmentLoaders:{[n]:s},mediaTypes:{[n]:r}}=o;t.on("loadedmetadata",()=>{const l=t.media();s.playlist(l,i),s.track(r.activeTrack()),(!a.paused()||l.endList&&a.preload()!=="none")&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),i),a.paused()||s.load()}),t.on("error",xc[n](n,o))}},cne={AUDIO:(n,t)=>{const{vhs:o,sourceType:a,segmentLoaders:{[n]:i},requestOptions:s,main:{mediaGroups:r},mediaTypes:{[n]:{groups:l,tracks:d,logger_:c}},mainPlaylistLoader:u}=t,g=ws(u.main);(!r[n]||Object.keys(r[n]).length===0)&&(r[n]={main:{default:{default:!0}}},g&&(r[n].main.default.playlists=u.main.playlists));for(const f in r[n]){l[f]||(l[f]=[]);for(const m in r[n][f]){let h=r[n][f][m],p;if(g?(c(`AUDIO group '${f}' label '${m}' is a main playlist`),h.isMainPlaylist=!0,p=null):a==="vhs-json"&&h.playlists?p=new ll(h.playlists[0],o,s):h.resolvedUri?p=new ll(h.resolvedUri,o,s):h.playlists&&a==="dash"?p=new bh(h.playlists[0],o,s,u):p=null,h=rt({id:m,playlistLoader:p},h),s2[n](n,h.playlistLoader,t),l[f].push(h),typeof d[m]>"u"){const A=new se.AudioTrack({id:m,kind:lne(h),enabled:!1,language:h.language,default:h.default,label:m});d[m]=A}}}i.on("error",xc[n](n,t))},SUBTITLES:(n,t)=>{const{tech:o,vhs:a,sourceType:i,segmentLoaders:{[n]:s},requestOptions:r,main:{mediaGroups:l},mediaTypes:{[n]:{groups:d,tracks:c}},mainPlaylistLoader:u}=t;for(const g in l[n]){d[g]||(d[g]=[]);for(const f in l[n][g]){if(!a.options_.useForcedSubtitles&&l[n][g][f].forced)continue;let m=l[n][g][f],h;if(i==="hls")h=new ll(m.resolvedUri,a,r);else if(i==="dash"){if(!m.playlists.filter(A=>A.excludeUntil!==1/0).length)return;h=new bh(m.playlists[0],a,r,u)}else i==="vhs-json"&&(h=new ll(m.playlists?m.playlists[0]:m.resolvedUri,a,r));if(m=rt({id:f,playlistLoader:h},m),s2[n](n,m.playlistLoader,t),d[g].push(m),typeof c[f]>"u"){const p=o.addRemoteTextTrack({id:f,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:f},!1).track;c[f]=p}}}s.on("error",xc[n](n,t))},"CLOSED-CAPTIONS":(n,t)=>{const{tech:o,main:{mediaGroups:a},mediaTypes:{[n]:{groups:i,tracks:s}}}=t;for(const r in a[n]){i[r]||(i[r]=[]);for(const l in a[n][r]){const d=a[n][r][l];if(!/^(?:CC|SERVICE)/.test(d.instreamId))continue;const c=o.options_.vhs&&o.options_.vhs.captionServices||{};let u={label:l,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(c[u.instreamId]&&(u=rt(u,c[u.instreamId])),u.default===void 0&&delete u.default,i[r].push(rt({id:l},d)),typeof s[l]>"u"){const g=o.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;s[l]=g}}}}},r2=(n,t)=>{for(let o=0;o<n.length;o++)if(fh(t,n[o])||n[o].playlists&&r2(n[o].playlists,t))return!0;return!1},mne=(n,t)=>o=>{const{mainPlaylistLoader:a,mediaTypes:{[n]:{groups:i}}}=t,s=a.media();if(!s)return null;let r=null;s.attributes[n]&&(r=i[s.attributes[n]]);const l=Object.keys(i);if(!r)if(n==="AUDIO"&&l.length>1&&ws(t.main))for(let d=0;d<l.length;d++){const c=i[l[d]];if(r2(c,s)){r=c;break}}else i.main?r=i.main:l.length===1&&(r=i[l[0]]);return typeof o>"u"?r:o===null||!r?null:r.filter(d=>d.id===o.id)[0]||null},une={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].enabled)return o[a];return null},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].mode==="showing"||o[a].mode==="hidden")return o[a];return null}},hne=(n,{mediaTypes:t})=>()=>{const o=t[n].activeTrack();return o?t[n].activeGroup(o):null},pne=n=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(c=>{cne[c](c,n)});const{mediaTypes:t,mainPlaylistLoader:o,tech:a,vhs:i,segmentLoaders:{["AUDIO"]:s,main:r}}=n;["AUDIO","SUBTITLES"].forEach(c=>{t[c].activeGroup=mne(c,n),t[c].activeTrack=une[c](c,n),t[c].onGroupChanged=sne(c,n),t[c].onGroupChanging=rne(c,n),t[c].onTrackChanged=dne(c,n),t[c].getActiveGroup=hne(c,n)});const l=t.AUDIO.activeGroup();if(l){const c=(l.filter(g=>g.default)[0]||l[0]).id;t.AUDIO.tracks[c].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(r.setAudio(!1),s.setAudio(!0)):r.setAudio(!0)}o.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(c=>t[c].onGroupChanged())}),o.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(c=>t[c].onGroupChanging())});const d=()=>{t.AUDIO.onTrackChanged(),a.trigger({type:"usage",name:"vhs-audio-change"})};a.audioTracks().addEventListener("change",d),a.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",()=>{a.audioTracks().removeEventListener("change",d),a.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),a.clearTracks("audio");for(const c in t.AUDIO.tracks)a.audioTracks().addTrack(t.AUDIO.tracks[c])},fne=()=>{const n={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{n[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:na,activeTrack:na,getActiveGroup:na,onGroupChanged:na,onTrackChanged:na,lastTrack_:null,logger_:lo(`MediaGroups[${t}]`)}}),n};class d2{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(t){t===1&&(this.version_=t)}set ttl(t){this.ttl_=t||300}set reloadUri(t){t&&(this.reloadUri_=In(this.reloadUri_,t))}set priority(t){t&&t.length&&(this.priority_=t)}set pathwayClones(t){t&&t.length&&(this.pathwayClones_=new Map(t.map(o=>[o.ID,o])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class gne extends se.EventTarget{constructor(t,o){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new d2,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=lo("Content Steering"),this.xhr_=t,this.getBandwidth_=o}assignTagProperties(t,o){this.manifestType_=o.serverUri?"HLS":"DASH";const a=o.serverUri||o.serverURL;if(!a){this.logger_(`steering manifest URL is ${a}, cannot request steering manifest.`),this.trigger("error");return}if(a.startsWith("data:")){this.decodeDataUriManifest_(a.substring(a.indexOf(",")+1));return}this.steeringManifest.reloadUri=In(t,a),this.defaultPathway=o.pathwayId||o.defaultServiceLocation,this.queryBeforeStart=o.queryBeforeStart,this.proxyServerUrl_=o.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(t){const o=this.steeringManifest.reloadUri;if(!o)return;const a=t?o:this.getRequestURI(o);if(!a){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const i={contentSteeringInfo:{uri:a}};this.trigger({type:"contentsteeringloadstart",metadata:i}),this.request_=this.xhr_({uri:a,requestType:"content-steering-manifest"},(s,r)=>{if(s){if(r.status===410){this.logger_(`manifest request 410 ${s}.`),this.logger_(`There will be no more content steering requests to ${a} this session.`),this.excludedSteeringManifestURLs.add(a);return}if(r.status===429){const c=r.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${s}.`),this.logger_(`content steering will retry in ${c} seconds.`),this.startTTLTimeout_(parseInt(c,10));return}this.logger_(`manifest failed to load ${s}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:i});let l;try{l=JSON.parse(this.request_.responseText)}catch(c){const u={errorType:se.Error.StreamingContentSteeringParserError,error:c};this.trigger({type:"error",metadata:u})}this.assignSteeringProperties_(l);const d={contentSteeringInfo:i.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:d}),this.startTTLTimeout_()})}setProxyServerUrl_(t){const o=new _.URL(t),a=new _.URL(this.proxyServerUrl_);return a.searchParams.set("url",encodeURI(o.toString())),this.setSteeringParams_(a.toString())}decodeDataUriManifest_(t){const o=JSON.parse(_.atob(t));this.assignSteeringProperties_(o)}setSteeringParams_(t){const o=new _.URL(t),a=this.getPathway(),i=this.getBandwidth_();if(a){const s=`_${this.manifestType_}_pathway`;o.searchParams.set(s,a)}if(i){const s=`_${this.manifestType_}_throughput`;o.searchParams.set(s,i)}return o.toString()}assignSteeringProperties_(t){if(this.steeringManifest.version=t.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=t.TTL,this.steeringManifest.reloadUri=t["RELOAD-URI"],this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const a=(i=>{for(const s of i)if(this.availablePathways_.has(s))return s;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==a&&(this.currentPathway=a,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t)return null;const o=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!o(i))return i}const a=this.setSteeringParams_(t);return o(a)?null:a}startTTLTimeout_(t=this.steeringManifest.ttl){const o=t*1e3;this.ttlTimeout_=_.setTimeout(()=>{this.requestSteeringManifest()},o)}clearTTLTimeout_(){_.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new d2}addAvailablePathway(t){t&&this.availablePathways_.add(t)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,o){return!o&&this.steeringManifest.reloadUri||o&&(In(t,o.serverURL)!==this.steeringManifest.reloadUri||o.defaultServiceLocation!==this.defaultPathway||o.queryBeforeStart!==this.queryBeforeStart||o.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Ane=(n,t)=>{let o=null;return(...a)=>{clearTimeout(o),o=setTimeout(()=>{n.apply(null,a)},t)}},yne=10;let Ba;const Cne=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],wne=function(n){return this.audioSegmentLoader_[n]+this.mainSegmentLoader_[n]},bne=function({currentPlaylist:n,buffered:t,currentTime:o,nextPlaylist:a,bufferLowWaterLine:i,bufferHighWaterLine:s,duration:r,bufferBasedABR:l,log:d}){if(!a)return se.log.warn("We received no playlist to switch to. Please check your stream."),!1;const c=`allowing switch ${n&&n.id||"null"} -> ${a.id}`;if(!n)return d(`${c} as current playlist is not set`),!0;if(a.id===n.id)return!1;const u=!!ol(t,o).length;if(!n.endList)return!u&&typeof n.partTargetDuration=="number"?(d(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(d(`${c} as current playlist is live`),!0);const g=ch(t,o),f=l?Wt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Wt.MAX_BUFFER_LOW_WATER_LINE;if(r<f)return d(`${c} as duration < max low water line (${r} < ${f})`),!0;const m=a.attributes.BANDWIDTH,h=n.attributes.BANDWIDTH;if(m<h&&(!l||g<s)){let p=`${c} as next bandwidth < current bandwidth (${m} < ${h})`;return l&&(p+=` and forwardBuffer < bufferHighWaterLine (${g} < ${s})`),d(p),!0}if((!l||m>h)&&g>=i){let p=`${c} as forwardBuffer >= bufferLowWaterLine (${g} >= ${i})`;return l&&(p+=` and next bandwidth > current bandwidth (${m} > ${h})`),d(p),!0}return d(`not ${c} as no switching criteria met`),!1};class Ene extends se.EventTarget{constructor(t){super(),this.fastQualityChange_=Ane(this.fastQualityChange_.bind(this),100);const{src:o,withCredentials:a,tech:i,bandwidth:s,externVhs:r,useCueTags:l,playlistExclusionDuration:d,enableLowInitialPlaylist:c,sourceType:u,cacheEncryptionKeys:g,bufferBasedABR:f,leastPixelDiffSelector:m,captionServices:h,experimentalUseMMS:p}=t;if(!o)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:A}=t;(A===null||typeof A>"u")&&(A=1/0),Ba=r,this.bufferBasedABR=!!f,this.leastPixelDiffSelector=!!m,this.withCredentials=a,this.tech_=i,this.vhs_=i.vhs,this.player_=t.player_,this.sourceType_=u,this.useCueTags_=l,this.playlistExclusionDuration=d,this.maxPlaylistRetries=A,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:a,maxPlaylistRetries:A,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=fne(),p&&_.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new _.ManagedMediaSource,this.usingManagedMediaSource_=!0,se.log("Using ManagedMediaSource")):_.MediaSource&&(this.mediaSource=new _.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Kt(),this.hasPlayed_=!1,this.syncController_=new nne(t),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new ine,this.sourceUpdater_=new e2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new one,this.keyStatusMap_=new Map;const E={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:h,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new bh(o,this.vhs_,rt(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ll(o,this.vhs_,rt(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Dh(rt(E,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t),this.audioSegmentLoader_=new Dh(rt(E,{loaderType:"audio"}),t),this.subtitleSegmentLoader_=new Zte(rt(E,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((C,D)=>{function S(){i.off("vttjserror",w),C()}function w(){i.off("vttjsloaded",S),D()}i.one("vttjsloaded",S),i.one("vttjserror",w),i.addWebVttScript_()})}),t);const x=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new gne(this.vhs_.xhr,x),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Cne.forEach(C=>{this[C+"_"]=wne.bind(this,C)}),this.logger_=lo("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const b=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(b,()=>{const C=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-C,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_(),o=this.audioAppendsToLoadedData_();return t===-1||o===-1?-1:t+o}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const o=this.selectPlaylist();o&&this.shouldSwitchToMedia_(o)&&this.switchMedia_(o,t)}switchMedia_(t,o,a){const i=this.media(),s=i&&(i.id||i.uri),r=t&&(t.id||t.uri);if(s&&s!==r){this.logger_(`switch media ${s} -> ${r} from ${o}`);const l={renditionInfo:{id:r,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:o};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${o}`})}this.mainPlaylistLoader_.media(t,a)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{const o=this.mediaTypes_[t],a=o?o.activeGroup():null,i=this.contentSteeringController_.getPathway();if(a&&i){const r=(a.length?a[0].playlists:a.playlists).filter(l=>l.attributes.serviceLocation===i);r.length&&this.mediaTypes_[t].activePlaylistLoader.media(r[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=_.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(_.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const t=this.main(),o=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return o;const a=t.mediaGroups.AUDIO,i=Object.keys(a);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const l=a.main||i.length&&a[i[0]];for(const d in l)if(l[d].default){s={label:d};break}}if(!s)return o;const r=[];for(const l in a)if(a[l][s.label]){const d=a[l][s.label];if(d.playlists&&d.playlists.length)r.push.apply(r,d.playlists);else if(d.uri)r.push(d);else if(t.playlists.length)for(let c=0;c<t.playlists.length;c++){const u=t.playlists[c];u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===l&&r.push(u)}}return r.length?r:o}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;ph(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,o.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.mainSegmentLoader_.load()),pne({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),o),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let o=this.mainPlaylistLoader_.media();if(!o){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let a;if(this.enableLowInitialPlaylist&&(a=this.selectInitialPlaylist()),a||(a=this.selectPlaylist()),!a||!this.shouldSwitchToMedia_(a)||(this.initialMedia_=a,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;o=this.initialMedia_}this.handleUpdatedMediaPlaylist(o)}),this.mainPlaylistLoader_.on("error",()=>{const o=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:o.playlist,error:o})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;ph(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const o=this.mainPlaylistLoader_.media();if(o.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(o)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(o=>{this.mainPlaylistLoader_.on(o,a=>{this.player_.trigger(kt({},a))})})}handleUpdatedMediaPlaylist(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(t,o){const a=t.mediaGroups||{};let i=!0;const s=Object.keys(a.AUDIO);for(const r in a.AUDIO)for(const l in a.AUDIO[r])a.AUDIO[r][l].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(a.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ba.Playlist.isAes(o)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(a.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(t){const o=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),i=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),r=this.tech_.buffered();return bne({buffered:r,currentTime:a,currentPlaylist:o,nextPlaylist:t,bufferLowWaterLine:i,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const a=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:a.playlist,error:a})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const a=this.audioSegmentLoader_.pendingSegment_;if(!a||!a.segment||!a.segment.syncInfo)return;const i=a.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",a=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:yne}))});const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const a=this.getCodecsOrExclude_();a&&this.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(a=>{this.mainSegmentLoader_.on(a,i=>{this.player_.trigger(kt({},i))}),this.audioSegmentLoader_.on(a,i=>{this.player_.trigger(kt({},i))}),this.subtitleSegmentLoader_.on(a,i=>{this.player_.trigger(kt({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const t=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0))return this.tech_.setCurrentTime(t.end(t.length-1))}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList||t.start){const o=this.seekable();if(!o.length)return!1;const a=o.end(0);let i=a;if(t.start){const s=t.start.timeOffset;s<0?i=Math.max(a+s,o.start(0)):i=Math.min(a,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const t=this.tech_.play();typeof t<"u"&&typeof t.then=="function"&&t.then(null,o=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length)return;const o=this.duration();t[t.length-1].endTime=isNaN(o)||Math.abs(o)===1/0?Number.MAX_VALUE:o}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const o=this.mainSegmentLoader_.getCurrentMediaInfo_();!o||o.hasVideo?t=t&&this.audioSegmentLoader_.ended_:t=this.audioSegmentLoader_.ended_}t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(t){if(!this.seekable().length)return!1;const a=this.syncController_.getExpiredTime(t,this.duration());if(a===null)return!1;const i=Ba.Playlist.playlistEnd(t,a),s=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-s<=Oo;const l=r.end(r.length-1);return l-s<=Oo&&i-l<=Oo}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:o={},playlistExclusionDuration:a}){if(t=t||this.mainPlaylistLoader_.media(),a=a||o.playlistExclusionDuration||this.playlistExclusionDuration,!t){this.error=o,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}t.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,s=i.filter(Cc),r=s.length===1&&s[0]===t;if(i.length===1&&a!==1/0)return se.log.warn(`Problem encountered with playlist ${t.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const h=this.pathwayAttribute_(t),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(h),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(h)},p);return}let m=!1;i.forEach(h=>{if(h===t)return;const p=h.excludeUntil;typeof p<"u"&&p!==1/0&&(m=!0,delete h.excludeUntil)}),m&&(se.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;t.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+a*1e3,t.excludeUntil=l,o.reason&&(t.lastExcludeReason_=o.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const d=this.selectPlaylist();if(!d){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const c=o.internal?this.logger_:se.log.warn,u=o.message?" "+o.message:"";c(`${o.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.${u} Switching to playlist ${d.id}.`),d.attributes.AUDIO!==t.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),d.attributes.SUBTITLES!==t.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const g=d.targetDuration/2*1e3||5*1e3,f=typeof d.lastRequest=="number"&&Date.now()-d.lastRequest<=g;return this.switchMedia_(d,"exclude",r||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(t,o){const a=[],i=t==="all";(i||t==="main")&&a.push(this.mainPlaylistLoader_);const s=[];(i||t==="audio")&&s.push("AUDIO"),(i||t==="subtitle")&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(r=>{const l=this.mediaTypes_[r]&&this.mediaTypes_[r].activePlaylistLoader;l&&a.push(l)}),["main","audio","subtitle"].forEach(r=>{const l=this[`${r}SegmentLoader_`];l&&(t===r||t==="all")&&a.push(l)}),a.forEach(r=>o.forEach(l=>{typeof r[l]=="function"&&r[l]()}))}setCurrentTime(t){const o=ol(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(o&&o.length)return t;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const t=this.mainPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:Ba.Playlist.duration(t):1/0:0}seekable(){return this.seekable_}getSeekableRange_(t,o){const a=t.media();if(!a)return null;const i=this.syncController_.getMediaSequenceSync(o);if(i&&i.isReliable){const l=i.start,d=i.end;if(!isFinite(l)||!isFinite(d))return null;const c=Ba.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a),u=Math.max(l,d-c);return Kt([[l,u]])}const s=this.syncController_.getExpiredTime(a,this.duration());if(s===null)return null;const r=Ba.Playlist.seekable(a,s,Ba.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a));return r.length?r:null}computeFinalSeekable_(t,o){if(!o)return t;const a=t.start(0),i=t.end(0),s=o.start(0),r=o.end(0);return s>i||a>r?t:Kt([[Math.max(a,s),Math.min(i,r)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t)return;let o;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(o=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!o))return;const a=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,o),!this.seekable_||a&&a.length&&this.seekable_.length&&a.start(0)===this.seekable_.start(0)&&a.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${_0(this.seekable_)}]`);const i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const o=this.tech_.buffered();let a=Ba.Playlist.duration(this.mainPlaylistLoader_.media());o.length>0&&(a=Math.max(a,o.end(o.length-1))),this.mediaSource.duration!==a&&this.sourceUpdater_.setDuration(a)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(t=>{const o=this.mediaTypes_[t].groups;for(const a in o)o[a].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,o=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=t?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!o||!a)}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},o=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const a=Es(this.main(),o),i={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=a.video||t.main.videoCodec||GJ),t.main.isMuxed&&(i.video+=`,${a.audio||t.main.audioCodec||Wg}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||s)&&(i.audio=a.audio||t.main.audioCodec||t.audio.audioCodec||Wg,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:o,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const r=(c,u)=>c?Yl(u,this.usingManagedMediaSource_):qm(u),l={};let d;if(["video","audio"].forEach(function(c){if(i.hasOwnProperty(c)&&!r(t[c].isFmp4,i[c])){const u=t[c].isFmp4?"browser":"muxer";l[u]=l[u]||[],l[u].push(i[c]),c==="audio"&&(d=u)}}),s&&d&&o.attributes.AUDIO){const c=o.attributes.AUDIO;this.main().playlists.forEach(u=>{(u.attributes&&u.attributes.AUDIO)===c&&u!==o&&(u.excludeUntil=1/0)}),this.logger_(`excluding audio group ${c} as ${d} does not support codec(s): "${i.audio}"`)}if(Object.keys(l).length){const c=Object.keys(l).reduce((u,g)=>(u&&(u+=", "),u+=`${g} does not support codec(s): "${l[g].join(",")}"`,u),"")+".";this.excludePlaylist({playlistToExclude:o,error:{internal:!0,message:c},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const c=[];if(["video","audio"].forEach(u=>{const g=(ko(this.sourceUpdater_.codecs[u]||"")[0]||{}).type,f=(ko(i[u]||"")[0]||{}).type;g&&f&&g.toLowerCase()!==f.toLowerCase()&&c.push(`"${this.sourceUpdater_.codecs[u]}" -> "${i[u]}"`)}),c.length){this.excludePlaylist({playlistToExclude:o,error:{message:`Codec switching not supported: ${c.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const t=this.getCodecsOrExclude_();if(!t)return;this.sourceUpdater_.createSourceBuffers(t);const o=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(o)}excludeUnsupportedVariants_(){const t=this.main().playlists,o=[];Object.keys(t).forEach(a=>{const i=t[a];if(o.indexOf(i.id)!==-1)return;o.push(i.id);const s=Es(this.main,i),r=[];s.audio&&!qm(s.audio)&&!Yl(s.audio,this.usingManagedMediaSource_)&&r.push(`audio codec ${s.audio}`),s.video&&!qm(s.video)&&!Yl(s.video,this.usingManagedMediaSource_)&&r.push(`video codec ${s.video}`),s.text&&s.text==="stpp.ttml.im1t"&&r.push(`text codec ${s.text}`),r.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${r.join(", ")}`))})}excludeIncompatibleVariants_(t){const o=[],a=this.main().playlists,i=bs(ko(t)),s=gy(i),r=i.video&&ko(i.video)[0]||null,l=i.audio&&ko(i.audio)[0]||null;Object.keys(a).forEach(d=>{const c=a[d];if(o.indexOf(c.id)!==-1||c.excludeUntil===1/0)return;o.push(c.id);const u=[],g=Es(this.mainPlaylistLoader_.main,c),f=gy(g);if(!(!g.audio&&!g.video)){if(f!==s&&u.push(`codec count "${f}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const m=g.video&&ko(g.video)[0]||null,h=g.audio&&ko(g.audio)[0]||null;m&&r&&m.type.toLowerCase()!==r.type.toLowerCase()&&u.push(`video codec "${m.type}" !== "${r.type}"`),h&&l&&h.type.toLowerCase()!==l.type.toLowerCase()&&u.push(`audio codec "${h.type}" !== "${l.type}"`)}u.length&&(c.excludeUntil=1/0,this.logger_(`excluding ${c.id}: ${u.join(" && ")}`))}})}updateAdCues_(t){let o=0;const a=this.seekable();a.length&&(o=a.start(0)),$te(t,this.cueTagsTrack_,o)}goalBufferLength(){const t=this.tech_.currentTime(),o=Wt.GOAL_BUFFER_LENGTH,a=Wt.GOAL_BUFFER_LENGTH_RATE,i=Math.max(o,Wt.MAX_GOAL_BUFFER_LENGTH);return Math.min(o+t*a,i)}bufferLowWaterLine(){const t=this.tech_.currentTime(),o=Wt.BUFFER_LOW_WATER_LINE,a=Wt.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(o,Wt.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(o,Wt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(o+t*a,this.bufferBasedABR?s:i)}bufferHighWaterLine(){return Wt.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){Ky(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Ite({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,o,a){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Ky(this.inbandTextTracks_,t,this.tech_),Nte({inbandTextTracks:this.inbandTextTracks_,metadataArray:o,timestampOffset:i,videoDuration:a})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(t.contentSteering){for(const o of t.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(o));if(this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(o=>{this.contentSteeringController_.on(o,a=>{this.trigger(kt({},a))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const o=this.main();(this.contentSteeringController_.didDASHTagChange(o.uri,o.contentSteering)||(()=>{const s=this.contentSteeringController_.getAvailablePathways(),r=[];for(const l of o.playlists){const d=l.attributes.serviceLocation;if(d&&(r.push(d),!s.has(d)))return!0}return!!(!r.length&&s.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t)return;this.handlePathwayClones_();const a=this.main().playlists,i=new Set;let s=!1;Object.keys(a).forEach(r=>{const l=a[r],d=this.pathwayAttribute_(l),c=d&&t!==d;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!c&&(delete l.excludeUntil,delete l.lastExcludeReason_,s=!0);const g=!l.excludeUntil&&l.excludeUntil!==1/0;!i.has(l.id)&&c&&g&&(i.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(r=>{const l=this.mediaTypes_[r];if(l.activePlaylistLoader){const d=l.activePlaylistLoader.media_;d&&d.attributes.serviceLocation!==t&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const o=this.main().playlists,a=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(a&&a.size||i&&i.size){for(const[r,l]of a.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(r));for(const[r,l]of i.entries()){const d=a.get(r);if(!d){o.filter(u=>u.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(u=>{this.mainPlaylistLoader_.addClonePathway(l,u)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(d,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(t,o){if(t["BASE-ID"]!==o["BASE-ID"]||t.ID!==o.ID||t["URI-REPLACEMENT"].HOST!==o["URI-REPLACEMENT"].HOST)return!1;const a=t["URI-REPLACEMENT"].PARAMS,i=o["URI-REPLACEMENT"].PARAMS;for(const s in a)if(a[s]!==i[s])return!1;for(const s in i)if(a[s]!==i[s])return!1;return!0}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let t=0;const o="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=this.mainPlaylistLoader_.getKeyIdSet(a);!i||!i.size||i.forEach(s=>{const r="usable",l=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===r,d=a.lastExcludeReason_===o&&a.excludeUntil===1/0;l?l&&d&&(delete a.excludeUntil,delete a.lastExcludeReason_,this.logger_(`enabling playlist ${a.id} because key ID ${s} is ${r}`)):(a.excludeUntil!==1/0&&a.lastExcludeReason_!==o&&(a.excludeUntil=1/0,a.lastExcludeReason_=o,this.logger_(`excluding playlist ${a.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${r}`)),t++)})}),t>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=a&&a.attributes&&a.attributes.RESOLUTION&&a.attributes.RESOLUTION.height<720,s=a.excludeUntil===1/0&&a.lastExcludeReason_===o;i&&s&&(delete a.excludeUntil,se.log.warn(`enabling non-HD playlist ${a.id} because all playlists were excluded due to ${o} key IDs`))})}addKeyStatus_(t,o){const s=(typeof t=="string"?t:Xte(t)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${o}' with key ID ${s} added to the keyStatusMap`),this.keyStatusMap_.set(s,o)}updatePlaylistByKeyStatus(t,o){this.addKeyStatus_(t,o),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const xne=(n,t,o)=>a=>{const i=n.main.playlists[t],s=hh(i),r=Cc(i);if(typeof a>"u")return r;a?delete i.disabled:i.disabled=!0;const l={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:"fast-quality"};return a!==r&&!s&&(a?(o(i),n.trigger({type:"renditionenabled",metadata:l})):n.trigger({type:"renditiondisabled",metadata:l})),a};class Vne{constructor(t,o,a){const{playlistController_:i}=t,s=i.fastQualityChange_.bind(i);if(o.attributes){const r=o.attributes.RESOLUTION;this.width=r&&r.width,this.height=r&&r.height,this.bandwidth=o.attributes.BANDWIDTH,this.frameRate=o.attributes["FRAME-RATE"]}this.codecs=Es(i.main(),o),this.playlist=o,this.id=a,this.enabled=xne(t.playlists,o.id,s)}}const Bne=function(n){n.representations=()=>{const t=n.playlistController_.main(),o=ws(t)?n.playlistController_.getAudioTrackPlaylists_():t.playlists;return o?o.filter(a=>!hh(a)).map((a,i)=>new Vne(n,a,a.id)):[]}},c2=["seeking","seeked","pause","playing","error"];class kne extends se.EventTarget{constructor(t){super(),this.playlistController_=t.playlistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=lo("PlaybackWatcher"),this.logger_("initialize");const o=()=>this.monitorCurrentTime_(),a=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),r=this.playlistController_,l=["main","subtitle","audio"],d={};l.forEach(u=>{d[u]={reset:()=>this.resetSegmentDownloads_(u),updateend:()=>this.checkSegmentDownloads_(u)},r[`${u}SegmentLoader_`].on("appendsdone",d[u].updateend),r[`${u}SegmentLoader_`].on("playlistupdate",d[u].reset),this.tech_.on(["seeked","seeking"],d[u].reset)});const c=u=>{["main","audio"].forEach(g=>{r[`${g}SegmentLoader_`][u]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=()=>c("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(c2,s),this.tech_.on("canplay",a),this.tech_.one("play",o),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(c2,s),this.tech_.off("canplay",a),this.tech_.off("play",o),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(u=>{r[`${u}SegmentLoader_`].off("appendsdone",d[u].updateend),r[`${u}SegmentLoader_`].off("playlistupdate",d[u].reset),this.tech_.off(["seeked","seeking"],d[u].reset)}),this.checkCurrentTimeTimeout_&&_.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&_.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=_.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const o=this.playlistController_[`${t}SegmentLoader_`];this[`${t}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${t} loader`),this[`${t}StalledDownloads_`]=0,this[`${t}Buffered_`]=o.buffered_()}checkSegmentDownloads_(t){const o=this.playlistController_,a=o[`${t}SegmentLoader_`],i=a.buffered_(),s=pee(this[`${t}Buffered_`],i);if(this[`${t}Buffered_`]=i,s){const r={bufferedRanges:i};o.trigger({type:"bufferedrangeschanged",metadata:r}),this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++,this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:a.playlist_&&a.playlist_.id,buffered:oi(i)}),!(this[`${t}StalledDownloads_`]<10)&&(this.logger_(`${t} loader stalled download exclusion`),this.resetSegmentDownloads_(t),this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`}),t!=="subtitle"&&o.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const t=this.tech_.currentTime(),o=this.tech_.buffered();if(this.lastRecordedTime===t&&(!o.length||t+Oo>=o.end(o.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(t===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Kt([this.lastRecordedTime,t]));const a={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:a}),this.consecutiveUpdates=0,this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const o=this.seekable(),a=this.tech_.currentTime(),i=this.afterSeekableWindow_(o,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(i&&(s=o.end(o.length-1)),this.beforeSeekableWindow_(o,a)){const h=o.start(0);s=h+(h===o.end(0)?0:Oo)}if(typeof s<"u")return this.logger_(`Trying to seek outside of seekable at time ${a} with seekable range ${_0(o)}. Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0;const r=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),d=r.audioBuffer?r.audioBuffered():null,c=r.videoBuffer?r.videoBuffered():null,u=this.media(),g=u.partTargetDuration?u.partTargetDuration:(u.targetDuration-Lo)*2,f=[d,c];for(let h=0;h<f.length;h++){if(!f[h])continue;if(ch(f[h],a)<g)return!1}const m=yc(l,a);return m.length===0?!1:(s=m.start(0)+Oo,this.logger_(`Buffered region starts (${m.start(0)}) just beyond seek point (${a}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const t=this.tech_.currentTime(),o=this.tech_.buffered(),a=ol(o,t);if(a.length&&t+3<=a.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.logger_(`Stopped at ${t} while inside a buffered region [${a.start(0)} -> ${a.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const t=this.seekable(),o=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(t,o)){const l=t.end(t.length-1);return this.logger_(`Fell out of live window at time ${o}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const a=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:o}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const r=yc(i,o);return r.length>0?(this.logger_(`Stopped at ${o} and seeking to ${r.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(o),!0):!1}afterSeekableWindow_(t,o,a,i=!1){if(!t.length)return!1;let s=t.end(t.length-1)+Oo;const r=!a.endList,l=typeof a.partTargetDuration=="number";return r&&(l||i)&&(s=t.end(t.length-1)+a.targetDuration*3),o>s}beforeSeekableWindow_(t,o){return!!(t.length&&t.start(0)>0&&o<t.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:t,audioBuffered:o,currentTime:a}){if(!t)return;let i;if(t.length&&o.length){const s=ol(t,a-3),r=ol(t,a),l=ol(o,a);l.length&&!r.length&&s.length&&(i={start:s.end(0),end:l.end(0)})}else yc(t,a).length||(i=this.gapFromVideoUnderflow_(t,a));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${a}`),!0):!1}skipTheGap_(t){const o=this.tech_.buffered(),a=this.tech_.currentTime(),i=yc(o,a);if(this.resetTimeUpdate_(),i.length===0||a!==t)return;this.logger_("skipTheGap_:","currentTime:",a,"scheduled currentTime:",t,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Lo);const s={gapInfo:{from:a,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,o){const a=mee(t);for(let i=0;i<a.length;i++){const s=a.start(i),r=a.end(i);if(o-s<4&&o-s>2)return{start:s,end:r}}return null}}const Dne={errorInterval:30,getSource(n){const o=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return n(o)}},m2=function(n,t){let o=0,a=0;const i=rt(Dne,t);n.ready(()=>{n.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){a&&n.currentTime(a)},r=function(u){u!=null&&(a=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",s),n.src(u),n.trigger({type:"usage",name:"vhs-error-reload"}),n.play())},l=function(){if(Date.now()-o<i.errorInterval*1e3){n.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){se.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return o=Date.now(),i.getSource.call(n,r)},d=function(){n.off("loadedmetadata",s),n.off("error",l),n.off("dispose",d)},c=function(u){d(),m2(n,u)};n.on("error",l),n.on("dispose",d),n.reloadSourceOnError=c},Sne=function(n){m2(this,n)};var u2="3.17.2",Nne="7.1.0",Tne="1.3.1",Pne="7.2.0",Ine="4.0.2";const xt={PlaylistLoader:ll,Playlist:Mn,utils:Fee,STANDARD_PLAYLIST_SELECTOR:Yy,INITIAL_PLAYLIST_SELECTOR:Vte,lastBandwidthSelector:Yy,movingAverageBandwidthSelector:Ete,comparePlaylistBandwidth:Bh,comparePlaylistResolution:bte,xhr:by()};Object.keys(Wt).forEach(n=>{Object.defineProperty(xt,n,{get(){return se.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),Wt[n]},set(t){if(se.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),typeof t!="number"||t<0){se.log.warn(`value of Vhs.${n} must be greater than or equal to 0`);return}Wt[n]=t}})});const h2="videojs-vhs",p2=function(n,t){const o=t.media();let a=-1;for(let i=0;i<n.length;i++)if(n[i].id===o.id){a=i;break}n.selectedIndex_=a,n.trigger({selectedIndex:a,type:"change"})},Mne=function(n,t){t.representations().forEach(o=>{n.addQualityLevel(o)}),p2(n,t.playlists)};xt.canPlaySource=function(){return se.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Lne=(n,t,o)=>{if(!n)return n;let a={};t&&t.attributes&&t.attributes.CODECS&&(a=bs(ko(t.attributes.CODECS))),o&&o.attributes&&o.attributes.CODECS&&(a.audio=o.attributes.CODECS);const i=Di(a.video),s=Di(a.audio),r={};for(const l in n)r[l]={},s&&(r[l].audioContentType=s),i&&(r[l].videoContentType=i),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(r[l].pssh=t.contentProtection[l].pssh),typeof n[l]=="string"&&(r[l].url=n[l]);return rt(n,r)},One=(n,t)=>n.reduce((o,a)=>{if(!a.contentProtection)return o;const i=t.reduce((s,r)=>{const l=a.contentProtection[r];return l&&l.pssh&&(s[r]={pssh:l.pssh}),s},{});return Object.keys(i).length&&o.push(i),o},[]),Qne=({player:n,sourceKeySystems:t,audioMedia:o,mainPlaylists:a})=>{if(!n.eme.initializeMediaKeys)return Promise.resolve();const i=o?a.concat([o]):a,s=One(i,Object.keys(t)),r=[],l=[];return s.forEach(d=>{l.push(new Promise((c,u)=>{n.tech_.one("keysessioncreated",c)})),r.push(new Promise((c,u)=>{n.eme.initializeMediaKeys({keySystems:d},g=>{if(g){u(g);return}c()})}))}),Promise.race([Promise.all(r),Promise.race(l)])},Une=({player:n,sourceKeySystems:t,media:o,audioMedia:a})=>{const i=Lne(t,o,a);return i?(n.currentSource().keySystems=i,i&&!n.eme?(se.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},f2=()=>{if(!_.localStorage)return null;const n=_.localStorage.getItem(h2);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Fne=n=>{if(!_.localStorage)return!1;let t=f2();t=t?rt(t,n):n;try{_.localStorage.setItem(h2,JSON.stringify(t))}catch{return!1}return t},Hne=n=>n.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(n.substring(n.indexOf(",")+1)):n,g2=(n,t)=>{n._requestCallbackSet||(n._requestCallbackSet=new Set),n._requestCallbackSet.add(t)},A2=(n,t)=>{n._responseCallbackSet||(n._responseCallbackSet=new Set),n._responseCallbackSet.add(t)},y2=(n,t)=>{n._requestCallbackSet&&(n._requestCallbackSet.delete(t),n._requestCallbackSet.size||delete n._requestCallbackSet)},C2=(n,t)=>{n._responseCallbackSet&&(n._responseCallbackSet.delete(t),n._responseCallbackSet.size||delete n._responseCallbackSet)};xt.supportsNativeHls=function(){if(!be||!be.createElement)return!1;const n=be.createElement("video");return se.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(o){return/maybe|probably/i.test(n.canPlayType(o))}):!1}(),xt.supportsNativeDash=function(){return!be||!be.createElement||!se.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(be.createElement("video").canPlayType("application/dash+xml"))}(),xt.supportsTypeNatively=n=>n==="hls"?xt.supportsNativeHls:n==="dash"?xt.supportsNativeDash:!1,xt.isSupported=function(){return se.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},xt.xhr.onRequest=function(n){g2(xt.xhr,n)},xt.xhr.onResponse=function(n){A2(xt.xhr,n)},xt.xhr.offRequest=function(n){y2(xt.xhr,n)},xt.xhr.offResponse=function(n){C2(xt.xhr,n)};const zne=se.getComponent("Component");class w2 extends zne{constructor(t,o,a){if(super(o,a.vhs),typeof a.initialBandwidth=="number"&&(this.options_.bandwidth=a.initialBandwidth),this.logger_=lo("VhsHandler"),o.options_&&o.options_.playerId){const i=se.getPlayer(o.options_.playerId);this.player_=i}if(this.tech_=o,this.source_=t,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&o.overrideNativeAudioTracks&&o.overrideNativeVideoTracks)o.overrideNativeAudioTracks(!0),o.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(o.featuresNativeVideoTracks||o.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(be,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const s=be.fullscreenElement||be.webkitFullscreenElement||be.mozFullScreenElement||be.msFullscreenElement;s&&s.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(t={}){if(this.options_=rt(this.options_,t),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const a=f2();a&&a.bandwidth&&(this.options_.bandwidth=a.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),a&&a.throughput&&(this.options_.throughput=a.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Wt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Wt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(a=>{typeof this.source_[a]<"u"&&(this.options_[a]=this.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const o=this.options_.customPixelRatio;typeof o=="number"&&o>=0&&(this.customPixelRatio=o)}setOptions(t={}){this.setOptions_(t)}src(t,o){if(!t)return;this.setOptions_(),this.options_.src=Hne(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=xt,this.options_.sourceType=Xg(o),this.options_.seekTo=s=>{this.tech_.setCurrentTime(s)},this.options_.player_=this.player_,this.playlistController_=new Ene(this.options_);const a=rt({liveRangeSafeTimeDelta:Oo},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new kne(a),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const s=se.players[this.tech_.options_.playerId];let r=this.playlistController_.error;typeof r=="object"&&!r.code?r.code=3:typeof r=="string"&&(r={message:r,code:3}),s.error(r)});const i=this.options_.bufferBasedABR?xt.movingAverageBandwidthSelector(.55):xt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=xt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(s){this.playlistController_.selectPlaylist=s.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(s){this.playlistController_.mainSegmentLoader_.throughput.rate=s,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let s=this.playlistController_.mainSegmentLoader_.bandwidth;const r=_.navigator.connection||_.navigator.mozConnection||_.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&r){const d=r.downlink*1e3*1e3;d>=l&&s>=l?s=Math.max(s,d):s=d}return s},set(s){this.playlistController_.mainSegmentLoader_.bandwidth=s,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const s=1/(this.bandwidth||1);let r;return this.throughput>0?r=1/this.throughput:r=0,Math.floor(1/(s+r))},set(){se.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>oi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>oi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&Fne({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Bne(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=_.URL.createObjectURL(this.playlistController_.mediaSource),(se.browser.IS_ANY_SAFARI||se.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Qne({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(o=>{this.logger_("error while creating EME key session",o),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,o=Une({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",a=>{this.playlistController_.updatePlaylistByKeyStatus(a.keyId,a.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!o){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=se.players[this.tech_.options_.playerId];!t||!t.qualityLevels||this.qualityLevels_||(this.qualityLevels_=t.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Mne(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{p2(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":u2,"mux.js":Nne,"mpd-parser":Tne,"m3u8-parser":Pne,"aes-decrypter":Ine}}version(){return this.constructor.version()}canChangeType(){return e2.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&_.URL.revokeObjectURL&&(_.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(t,o){return Yee({playlist:this.playlistController_.media(),time:t,callback:o})}seekToProgramTime(t,o,a=!0,i=2){return ky({programTime:t,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:o})}setupXhrHooks_(){this.xhr.onRequest=t=>{g2(this.xhr,t)},this.xhr.onResponse=t=>{A2(this.xhr,t)},this.xhr.offRequest=t=>{y2(this.xhr,t)},this.xhr.offResponse=t=>{C2(this.xhr,t)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],o=["gapjumped","playedrangeschanged"];t.forEach(a=>{this.playlistController_.on(a,i=>{this.player_.trigger(kt({},i))})}),o.forEach(a=>{this.playbackWatcher_.on(a,i=>{this.player_.trigger(kt({},i))})})}}const Vc={name:"videojs-http-streaming",VERSION:u2,canHandleSource(n,t={}){const o=rt(se.options,t);return!o.vhs.experimentalUseMMS&&!Yl("avc1.4d400d,mp4a.40.2",!1)?!1:Vc.canPlayType(n.type,o)},handleSource(n,t,o={}){const a=rt(se.options,o);return t.vhs=new w2(n,t,a),t.vhs.xhr=by(),t.vhs.setupXhrHooks_(),t.vhs.src(n.src,n.type),t.vhs},canPlayType(n,t){const o=Xg(n);if(!o)return"";const a=Vc.getOverrideNative(t);return!xt.supportsTypeNatively(o)||a?"maybe":""},getOverrideNative(n={}){const{vhs:t={}}=n,o=!(se.browser.IS_ANY_SAFARI||se.browser.IS_IOS),{overrideNative:a=o}=t;return a}};Yl("avc1.4d400d,mp4a.40.2",!0)&&se.getTech("Html5").registerSourceHandler(Vc,0),se.VhsHandler=w2,se.VhsSourceHandler=Vc,se.Vhs=xt,se.use||se.registerComponent("Vhs",xt),se.options.vhs=se.options.vhs||{},(!se.getPlugin||!se.getPlugin("reloadSourceOnError"))&&se.registerPlugin("reloadSourceOnError",Sne);const Rne={name:"MediaVideoPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""}},data(){return{player:null}},mounted(){this.player=se(this.$refs.videoPlayer,{autoplay:!1,controls:!0,muted:!0,fluid:!0,sources:[{src:this.url,type:"video/mp4"}],poster:this.poster})},beforeDestroy(){this.player&&this.player.dispose()}},vne={ref:"videoPlayer",class:"video-js"};function jne(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("video",vne,null,512)}const qne=te(Rne,[["render",jne],["__scopeId","data-v-3e044975"]]),Yne={name:"YoutubePlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},control:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){if(!YT||!document.getElementById(`yt-player-${this.timestamp}`)){setTimeout(this.initPlayer,3e3);return}this.player||(this.player=new YT.Player(`yt-player-${this.timestamp}`,{origin:"http://localhost:3000/",events:{onStateChange:this.onPlayerStateChange}}))},onPlayerStateChange(){this.player.getPlayerState()==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{setTimeout(this.initPlayer,300)})}},Gne={class:"youtube-player"},Kne=["id","src"];function Wne(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",Gne,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",{"show-control-n-fit":o.control}])},[e.createElementVNode("iframe",{id:`yt-player-${i.timestamp}`,ref:"player",width:"1280",height:"537",src:`${o.url}?enablejsapi=1&controls=${o.control?1:0}&autoplay=${o.autoplay||o.isPlaying}&mute=${o.mute?1:0}`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,Kne)],2)):e.createCommentVNode("",!0)])}const Xne=te(Yne,[["render",Wne],["__scopeId","data-v-ca2b2fbb"]]),Jne={name:"BilibiliPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(n,t){this.resetVideo()}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight})}},Zne={class:"bilibili-player",ref:"wrapper"},_ne=["id","src"];function $ne(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",Zne,[e.createElementVNode("div",{class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":s.isVideoWider,"video-foreground--higher":!s.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("iframe",{key:0,id:`bilibili-player-${i.timestamp}`,scrolling:"no",border:"0",frameborder:"no",framespacing:"0",allowfullscreen:"true",src:`${o.url}&high_quality=1&danmaku=0&as_wide=1`},null,8,_ne)):e.createCommentVNode("",!0)],2)],512)}const eoe=te(Jne,[["render",$ne],["__scopeId","data-v-40e15401"]]),toe={name:"YoukuPlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}}},noe={class:"youku-player"},ooe=["src","id"];function aoe(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",noe,[e.createElementVNode("iframe",{width:"1280",height:"537",src:`${o.url}?rel=0&autoplay=${o.isPlaying}`,frameborder:"0",allowfullscreen:"",id:`youku-player-${i.timestamp}`,sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,ooe)])}const ioe=te(toe,[["render",aoe],["__scopeId","data-v-cf32c3a0"]]),loe={name:"QqPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){const n=document.getElementById(`qq-player-${this.timestamp}`);if(!Txp||!n){setTimeout(this.initPlayer,3e3);return}if(this.player)return;this.player=new Txp.Player({containerId:`qq-player-${this.timestamp}`,vid:this.url,width:"100%",height:"100%",autoplay:this.autoplay||this.$_vsWidth>=768||this.isPlaying,mini:!0,muted:this.mute,volume:this.mute?0:50});const t=n.querySelector("iframe");t.sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation",this.player.on("playStateChange",this.onPlayerStateChange)},onPlayerStateChange(n){n.state==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight,setTimeout(this.initPlayer,300)})}},soe={class:"qq-player",ref:"wrapper"},roe=["id"],doe={class:"qq-player__poster"},coe=["src"];function moe(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",soe,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":s.isVideoWider,"video-foreground--higher":!s.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:"iframe",id:`qq-player-${i.timestamp}`},null,8,roe)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",doe,[e.createElementVNode("img",{src:o.poster,alt:"poster"},null,8,coe)],512),[[e.vShow,!o.isPlaying&&!o.autoplay]])],512)}const uoe=te(loe,[["render",moe],["__scopeId","data-v-719611b1"]]),hoe={name:"FbPlayer",props:{html:{type:String,default:()=>""}},mounted(){this.loadFacebookSDK()},methods:{loadFacebookSDK(){if(document.querySelector('script[src*="connect.facebook.net"]'))return;const n=document.createElement("script");n.async=!0,n.defer=!0,n.crossOrigin="anonymous",n.src="https://connect.facebook.net/zh_TW/sdk.js#xfbml=1&version=v14.0",n.nonce="5tyirFAy",document.body.appendChild(n)}}},poe={class:"fb-player",ref:"wrapper"},foe=["innerHTML"];function goe(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",poe,[t[0]||(t[0]=e.createElementVNode("div",{id:"fb-root"},null,-1)),e.createElementVNode("div",{innerHTML:o.html},null,8,foe)],512)}const Aoe=te(hoe,[["render",goe],["__scopeId","data-v-c5a2a3ed"]]),yoe={class:"media_video_wrap"},Coe={class:"img-wrapper"},woe={key:0},boe={key:1},Eoe={key:2},xoe={key:3},Voe={key:4},Boe={key:5},Bc=te(e.defineComponent({name:"MediaVideo",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const o=n,a=t,i=e.ref(!1),s=()=>{var h;if(o.modelValue&&o.modelValue.data)return;const m={id:((h=o.modelValue)==null?void 0:h.id)||q(),type:"MediaVideo",showMode:"",data:{width:"",type:"inner",videoSrc:"https://mvideo.ycyw.com/2e1a9441vodgzp1253458132/a31402d51397757891052265568/SW8B19vOtzMA.mp4",videoThumbnail:"https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg"}};a("update:modelValue",m)},r=e.computed(()=>{var m,h;return o.isPreview?((m=o.modelValue)==null?void 0:m.showMode)==="pc"?!ue():((h=o.modelValue)==null?void 0:h.showMode)==="mobile"?ue():!0:!0}),l=e.ref(!1),d=e.ref(!1),c=e.computed(()=>{var p,A;const m=(A=(p=o.modelValue)==null?void 0:p.data)==null?void 0:A.width;return!m||m==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[m]||"container-content"}),u=()=>{a("handleDelete",o.modelValue.id)},g=()=>{a("handleCopy",o.modelValue)},f=m=>{a("handlePaste",m)};return s(),(m,h)=>{var p,A,E,x,b,C,D,S,w,V,P,k;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mediaVideo_wrap_box",onMouseenter:h[2]||(h[2]=I=>l.value=!0),onMouseleave:h[3]||(h[3]=I=>l.value=!1)},[e.createElementVNode("div",yoe,[e.createElementVNode("div",{class:e.normalizeClass(["media-video__container",c.value])},[e.createElementVNode("div",Coe,[((A=(p=n.modelValue)==null?void 0:p.data)==null?void 0:A.type)==="inner"?(e.openBlock(),e.createElementBlock("div",woe,[e.createVNode(qne,{url:n.modelValue.data.videoSrc,poster:n.modelValue.data.videoThumbnail},null,8,["url","poster"])])):e.createCommentVNode("",!0),((x=(E=n.modelValue)==null?void 0:E.data)==null?void 0:x.type)==="youtube"?(e.openBlock(),e.createElementBlock("div",boe,[e.createVNode(Xne,{url:n.modelValue.data.videoSrc,isPlaying:i.value,control:!0,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((C=(b=n.modelValue)==null?void 0:b.data)==null?void 0:C.type)==="bilibili"?(e.openBlock(),e.createElementBlock("div",Eoe,[e.createVNode(eoe,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((S=(D=n.modelValue)==null?void 0:D.data)==null?void 0:S.type)==="youku"?(e.openBlock(),e.createElementBlock("div",xoe,[e.createVNode(ioe,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((V=(w=n.modelValue)==null?void 0:w.data)==null?void 0:V.type)==="qq"?(e.openBlock(),e.createElementBlock("div",Voe,[e.createVNode(uoe,{url:n.modelValue.data.videoSrc,isPlaying:i.value,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((k=(P=n.modelValue)==null?void 0:P.data)==null?void 0:k.type)==="facebook"?(e.openBlock(),e.createElementBlock("div",Boe,[e.createVNode(Aoe,{html:n.modelValue.data.videoSrc},null,8,["html"])])):e.createCommentVNode("",!0)])],2)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:l.value,"onUpdate:show":h[0]||(h[0]=I=>l.value=I),locale:n.locale,onHandleEdit:h[1]||(h[1]=I=>d.value=!0),onHandleDelete:u,onHandleCopy:g,onHandlePaste:f},null,8,["show","locale"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(FX,{key:1,show:d.value,"onUpdate:show":h[4]||(h[4]=I=>d.value=I),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-716700db"]]),b2=Object.freeze(Object.defineProperty({__proto__:null,default:Bc},Symbol.toStringTag,{value:"Module"})),koe={class:"setting-content"},Doe={class:"setting-header flex items-center mb-10"},Soe={class:"header-title"},Noe={class:"item-title"},Toe={class:"item-title"},Poe={class:"item-title"},Ioe={class:"item-title"},Moe=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{i("update:show",!1)};return(r,l)=>{const d=e.resolveComponent("a-radio"),c=e.resolveComponent("a-radio-group"),u=e.resolveComponent("a-option"),g=e.resolveComponent("a-select"),f=e.resolveComponent("a-input"),m=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(m,{width:500,visible:n.show,footer:!1,onCancel:s,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",koe,[e.createElementVNode("div",Doe,[e.createElementVNode("span",Soe,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(c,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":l[0]||(l[0]=h=>n.data.showMode=h),type:"button"},{default:e.withCtx(()=>[e.createVNode(d,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(d,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(d,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("p",Noe,e.toDisplayString(e.unref(a)("setting.component_width")),1),e.createVNode(g,{modelValue:n.data.data.width,"onUpdate:modelValue":l[1]||(l[1]=h=>n.data.data.width=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_default")),1)]),_:1}),e.createVNode(u,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_small")),1)]),_:1}),e.createVNode(u,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_middle")),1)]),_:1}),e.createVNode(u,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("p",Toe,e.toDisplayString(e.unref(a)("setting.component_bg")),1),e.createVNode(g,{modelValue:n.data.bgColor,"onUpdate:modelValue":l[2]||(l[2]=h=>n.data.bgColor=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_white")),1)]),_:1}),e.createVNode(u,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("p",Poe,e.toDisplayString(e.unref(a)("setting.title")),1),e.createVNode(f,{modelValue:n.data.data.title,"onUpdate:modelValue":l[3]||(l[3]=h=>n.data.data.title=h),placeholder:e.unref(a)("setting.input_title"),"allow-clear":""},null,8,["modelValue","placeholder"]),e.createElementVNode("p",Ioe,e.toDisplayString(e.unref(a)("setting.link")),1),e.createVNode(f,{modelValue:n.data.data.link,"onUpdate:modelValue":l[4]||(l[4]=h=>n.data.data.link=h),placeholder:e.unref(a)("setting.link_url"),"allow-clear":""},null,8,["modelValue","placeholder"])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-f04f551a"]]),Loe={class:"information-link__wrapper"},Ooe={key:0},Qoe=["innerHTML"],Uoe={key:1,class:"information-link__btn btn p-0",type:"button"},Foe=["innerHTML"],kc=te(e.defineComponent({name:"InformationLink",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=h=>{!h||!o.isPreview||i("handleClick",h)},r=e.computed(()=>{var h,p;return o.isPreview?((h=o.modelValue)==null?void 0:h.showMode)==="pc"?!ue():((p=o.modelValue)==null?void 0:p.showMode)==="mobile"?ue():!0:!0}),l=()=>{var p;if(o.modelValue&&o.modelValue.data)return;const h={id:((p=o.modelValue)==null?void 0:p.id)||q(),type:"InformationLink",showMode:"",bgColor:"",data:{width:"",title:a("placeholder.title_here"),link:"https://www.ycyw-edu.com"}};i("update:modelValue",h)},d=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var A,E;const h=(E=(A=o.modelValue)==null?void 0:A.data)==null?void 0:E.width;return!h||h==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[h]||"container-content"}),g=()=>{i("handleDelete",o.modelValue.id)},f=()=>{i("handleCopy",o.modelValue)},m=h=>{i("handlePaste",h)};return l(),(h,p)=>{var A,E,x,b,C,D,S,w,V;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"informationLink_wrap",style:e.normalizeStyle({backgroundColor:((A=n.modelValue)==null?void 0:A.bgColor)||"transparent"}),onMouseenter:p[3]||(p[3]=P=>d.value=!0),onMouseleave:p[4]||(p[4]=P=>d.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["media-image-full",u.value])},[e.createElementVNode("div",Loe,[(x=(E=n.modelValue)==null?void 0:E.data)!=null&&x.link?(e.openBlock(),e.createElementBlock("div",Ooe,[(C=(b=n.modelValue)==null?void 0:b.data)!=null&&C.link?(e.openBlock(),e.createElementBlock("div",{key:0,target:"_blank",class:"information-link__btn btn p-0",onClick:p[0]||(p[0]=P=>{var k,I;return s((I=(k=n.modelValue)==null?void 0:k.data)==null?void 0:I.link)})},[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(S=(D=n.modelValue)==null?void 0:D.data)==null?void 0:S.title},null,8,Qoe),p[6]||(p[6]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",Uoe,[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(V=(w=n.modelValue)==null?void 0:w.data)==null?void 0:V.title},null,8,Foe),p[7]||(p[7]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))]))])],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:d.value,"onUpdate:show":p[1]||(p[1]=P=>d.value=P),locale:n.locale,onHandleEdit:p[2]||(p[2]=P=>c.value=!0),onHandleDelete:g,onHandleCopy:f,onHandlePaste:m},null,8,["show","locale"]))],36)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Moe,{key:1,show:c.value,"onUpdate:show":p[5]||(p[5]=P=>c.value=P),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-3d104efa"]]),E2=Object.freeze(Object.defineProperty({__proto__:null,default:kc},Symbol.toStringTag,{value:"Module"})),Hoe={key:0,class:"tab-primary__btn__img flex-center"},zoe=["src","alt"],Roe={key:1},voe=te({__name:"TabPrimary",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:()=>0},isFixed:{type:Boolean,default:()=>!1},fullWidth:{type:Boolean,default:()=>!1},isPreview:{type:Boolean,default:!0}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=n,d=t,c=e.ref(null),u=e.ref(null),g=e.ref([]),f=e.ref(0),m=e.ref(.5*a.value),h=e.ref(0),p=e.ref(!0),A=e.ref(!0),E=e.ref(0),x=e.ref(!1),b=e.ref(0),C=e.ref(0),D=e.ref(0);e.ref(0);const S=e.ref(null),w=e.ref(null),V=e.ref(null),P=e.ref(null),k=e.ref(null),I=e.computed(()=>f.value-m.value),L=e.computed(()=>[{"--strip-width":`${I.value}px`},{"--strip-left":`${m.value}px`},{"--fix-left":`${h.value}px`},{transition:A.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),U=e.computed(()=>b.value>0),Q=e.computed(()=>C.value-b.value+H.value>D.value),H=e.computed(()=>{if(!x.value)return 24;const ee=c.value;return ee?window.getComputedStyle(ee,null).getPropertyValue("padding-right").split("px")[0]*2:24}),z=e.computed(()=>!1);e.watch(a,()=>{O(),v()}),e.watch(()=>l.currentIdx,(ee,ce)=>{p.value=ee>ce,e.nextTick(K),e.nextTick(Y)}),e.watch(()=>l.tabList,(ee,ce)=>{v(),e.nextTick(()=>{K(0)})},{deep:!0}),e.watch(()=>l.isFixed,()=>{a.value>1200&&O(),e.nextTick(v)});const K=ee=>{const ce=ee??250;p.value?(J(),P.value=setTimeout(j,ce)):(j(),P.value=setTimeout(J,ce)),k.value=setTimeout(()=>{A.value=!0},ce)},J=()=>{const ee=g.value;let ce=null;ee&&ee[l.currentIdx]&&(ce=ee[l.currentIdx]),ce&&ce.getBoundingClientRect&&(f.value=ce.getBoundingClientRect().right)},j=()=>{const ee=g.value;let ce=null;ee&&ee[l.currentIdx]&&(ce=ee[l.currentIdx]),ce&&ce.getBoundingClientRect&&(m.value=ce.getBoundingClientRect().left)},O=()=>{A.value=!1,e.nextTick(()=>K(0)),e.nextTick(W)},v=()=>{const ee=c.value;if(ee){let ce=ee.getBoundingClientRect().left;h.value=(ee.offsetWidth-ee.getBoundingClientRect().width)/2+ce}},W=()=>{var re;if(!((re=l.tabList)!=null&&re.length))return;const ee=u.value;ee&&(b.value=ee.scrollLeft,C.value=ee.scrollWidth);const ce=c.value;ce&&(D.value=ce.getBoundingClientRect().width)},R=ee=>{u.value&&(ee=="next"?u.value.scrollLeft+=9999:u.value.scrollLeft-=9999)},Y=()=>{const ee=g.value[l.currentIdx];if(!ee)return;const ce=ee.clientWidth/2,re=a.value/2;E.value=ee.getBoundingClientRect().right-ce,u.value&&(u.value.scrollLeft-=re-E.value)},oe=(ee,ce)=>{ee&&l.isPreview||d("updateCurrentIdx",ce)},we=ee=>ee&&l.isPreview?"a":"button",fe=ee=>ee&&!ee.includes("http")?ee:null,ke=ee=>ee&&ee.includes("http")?ee:null,ge=ee=>ee&&ee.includes("http")?"_blank":null;return e.onMounted(()=>{x.value=!0,e.nextTick(()=>{K(0),S.value=setTimeout(O,300),v(),e.nextTick(()=>{w.value=setTimeout(Y,300)})})}),e.onBeforeUnmount(()=>{clearTimeout(S.value),clearTimeout(w.value),clearTimeout(V.value),clearTimeout(P.value),clearTimeout(k.value),window.removeEventListener("resize",()=>{a.value=window.innerWidth})}),(ee,ce)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-primary",[{"is-fixed":n.isFixed},{"is-campus":!z.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:c},[e.createElementVNode("ul",{class:"tab-primary__list",ref_key:"list",ref:u,onScroll:O},[e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__prev",onClick:ce[0]||(ce[0]=re=>R("prev"))},null,512),[[e.vShow,U.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(re,ie)=>(e.openBlock(),e.createElementBlock("li",{key:ie,class:e.normalizeClass(["tab-primary__item",[{"is-img":!!re.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btnRefs",ref:g,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(we(re.link)),{type:re.link?null:"button",to:fe(re.link),href:ke(re.link),target:ge(re.link),class:e.normalizeClass(["tab-primary__btn",[{"is-active":n.currentIdx==ie}]]),onClick:me=>oe(re.link,ie)},{default:e.withCtx(()=>[re.img?(e.openBlock(),e.createElementBlock("div",Hoe,[e.createElementVNode("img",{src:re.img,alt:re.alt||re.name},null,8,zoe)])):(e.openBlock(),e.createElementBlock("div",Roe,e.toDisplayString(re.name),1))]),_:2},1032,["type","to","href","target","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__next",onClick:ce[1]||(ce[1]=re=>R("next"))},null,512),[[e.vShow,Q.value]])],544),e.createElementVNode("span",{class:"tab-primary__strip",style:e.normalizeStyle(L.value)},null,4)],2))}},[["__scopeId","data-v-d117288d"]]),joe={class:"setting-content"},qoe={class:"setting-header flex items-center mb-10"},Yoe={class:"header-title"},Goe={class:"setting-header flex items-center"},Koe={class:"header-title"},Woe={class:"setting-body"},Xoe={class:"setting-toolbar"},Joe={class:"tools"},Zoe={class:"setting-item"},_oe={class:"item-header"},$oe={class:"btn-group"},eae={key:0,class:"drag-handle"},tae={class:"item-title"},nae={class:"components-content"},oae={class:"setting-body"},aae={class:"setting-toolbar"},iae={class:"tools"},lae={class:"setting-item"},sae={class:"item-header"},rae={class:"btn-group"},dae={key:0,class:"drag-handle"},cae={class:"item-title"},mae={class:"components-content"},uae=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=m=>m&&m.length>1,l=n,{t:d}=de(()=>l.locale),c=t,u=()=>{c("update:show",!1)},g=m=>{var p;debugger;const h=l.data;m==="listAbove"?h.listAbove.push({id:q(),key:q(),name:"New Tab",componentsDataJson:[{id:((p=l.modelValue)==null?void 0:p.id)||q(),type:"BannerImage",onlyShowPc:!1,data:{title:d("placeholder.title_here"),imgSrc:"https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg"}}]}):h.data.push({id:q(),key:q(),name:"New Tab",link:"",componentsDataJson:[]})},f=(m,h)=>{h==="listAbove"?l.data.listAbove.splice(l.data.listAbove.findIndex(p=>p.id===m),1):l.data.data.splice(l.data.data.findIndex(p=>p.id===m),1)};return(m,h)=>{const p=e.resolveComponent("a-radio"),A=e.resolveComponent("a-radio-group"),E=e.resolveComponent("a-option"),x=e.resolveComponent("a-select"),b=e.resolveComponent("icon-plus"),C=e.resolveComponent("a-button"),D=e.resolveComponent("icon-drag-arrow"),S=e.resolveComponent("icon-delete"),w=e.resolveComponent("a-input"),V=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(V,{width:1200,visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(d)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",joe,[e.createElementVNode("div",qoe,[e.createElementVNode("span",Yoe,e.toDisplayString(e.unref(d)("setting.show_mode_pc_mobile")),1),e.createVNode(A,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":h[0]||(h[0]=P=>n.data.showMode=P),type:"button"},{default:e.withCtx(()=>[e.createVNode(p,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_all")),1)]),_:1}),e.createVNode(p,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_pc")),1)]),_:1}),e.createVNode(p,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",Goe,[e.createElementVNode("span",Koe,e.toDisplayString(e.unref(d)("setting.component_bg")),1),e.createVNode(x,{modelValue:n.data.bgColor,"onUpdate:modelValue":h[1]||(h[1]=P=>n.data.bgColor=P),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(E,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_white")),1)]),_:1}),e.createVNode(E,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Woe,[e.createElementVNode("div",Xoe,[h[15]||(h[15]=e.createElementVNode("h1",null,"List Above",-1)),e.createElementVNode("div",Joe,[e.createVNode(C,{type:"primary",onClick:h[2]||(h[2]=P=>g("listAbove"))},{icon:e.withCtx(()=>[e.createVNode(b)]),default:e.withCtx(()=>[h[14]||(h[14]=e.createTextVNode(" List Above ",-1))]),_:1}),e.createVNode(C,{type:"primary",onClick:h[3]||(h[3]=P=>g("listAbove"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",Zoe,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.listAbove,"onUpdate:modelValue":h[5]||(h[5]=P=>n.data.listAbove=P),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},s.value,{disabled:!r(n.data.data),onStart:h[6]||(h[6]=P=>a.value=!0),onEnd:h[7]||(h[7]=P=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:P})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:P.id},[e.createElementVNode("div",_oe,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(P.name),1),e.createElementVNode("span",null,e.toDisplayString(P.key),1)]),e.createElementVNode("div",$oe,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",eae,[e.createVNode(D,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(S,{class:"btn-delete",onClick:k=>f(P.id,"listAbove")},null,8,["onClick"]),e.createVNode(C,{size:"mini",type:"primary",onClick:h[4]||(h[4]=k=>g("Video"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.copy_tab")),1)]),_:1})])]),e.createElementVNode("p",tae,e.toDisplayString(e.unref(d)("setting.tab_name")),1),e.createVNode(w,{modelValue:P.name,"onUpdate:modelValue":k=>P.name=k,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[16]||(h[16]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(w,{modelValue:P.key,"onUpdate:modelValue":k=>P.key=k,placeholder:e.unref(d)("setting.input_key"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[17]||(h[17]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",nae,[e.createVNode(Ya,{data:P.componentsDataJson,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:k=>P.componentsDataJson=k},null,8,["data","host","websiteId","locale","lang","footer","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])]),e.createElementVNode("div",oae,[e.createElementVNode("div",aae,[h[19]||(h[19]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",iae,[e.createVNode(C,{type:"primary",onClick:h[8]||(h[8]=P=>g("Video"))},{icon:e.withCtx(()=>[e.createVNode(b)]),default:e.withCtx(()=>[h[18]||(h[18]=e.createTextVNode(" List ",-1))]),_:1}),e.createVNode(C,{type:"primary",onClick:h[9]||(h[9]=P=>g("Video"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",lae,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":h[11]||(h[11]=P=>n.data.data=P),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!r(n.data.data),onStart:h[12]||(h[12]=P=>a.value=!0),onEnd:h[13]||(h[13]=P=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:P})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:P.id},[e.createElementVNode("div",sae,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(P.name),1),e.createElementVNode("span",null,e.toDisplayString(P.key),1)]),e.createElementVNode("div",rae,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",dae,[e.createVNode(D,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(S,{class:"btn-delete",onClick:k=>f(P.id,"list")},null,8,["onClick"]),e.createVNode(C,{size:"mini",type:"primary",onClick:h[10]||(h[10]=k=>g("Video"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.copy_tab")),1)]),_:1})])]),e.createElementVNode("p",cae,e.toDisplayString(e.unref(d)("setting.tab_name")),1),e.createVNode(w,{modelValue:P.name,"onUpdate:modelValue":k=>P.name=k,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[20]||(h[20]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(w,{modelValue:P.key,"onUpdate:modelValue":k=>P.key=k,placeholder:e.unref(d)("setting.input_key"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[21]||(h[21]=e.createElementVNode("p",{class:"item-title"},"Link",-1)),e.createVNode(w,{modelValue:P.link,"onUpdate:modelValue":k=>P.link=k,placeholder:e.unref(d)("setting.input_link_url"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[22]||(h[22]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",mae,[e.createVNode(Ya,{data:P.componentsDataJson,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,onUpdate:k=>P.componentsDataJson=k},null,8,["data","host","websiteId","locale","lang","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-796673e0"]]),hae={class:"tab-page__above"},pae={key:0},fae={key:0},gae={class:"tab-page__content"},Aae={key:0},yae={key:1,class:"component-wrapper"},Cae="",Dc=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,a=e.computed(()=>{var v,W;return c.isPreview?((v=c.modelValue)==null?void 0:v.showMode)==="pc"?!ue():((W=c.modelValue)==null?void 0:W.showMode)==="mobile"?ue():!0:!0}),{proxy:i}=e.getCurrentInstance(),{$_vsWidth:s,$_vsScrollY:r,$vsScreenAddListener:l,$vsScreenDestroyListener:d}=i,c=n,u=e.ref(0),g=e.ref(!1),f=e.ref(!0),m=e.ref(null),h=e.ref(null),p=e.ref(!1),A=e.ref(!1),E=v=>{if(!v)return{top:0,left:0};const W=v.getBoundingClientRect(),R=window.pageYOffset||document.documentElement.scrollTop,Y=window.pageXOffset||document.documentElement.scrollLeft;return{top:W.top+R,left:W.left+Y}},x=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.classes)??null});e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.style)??null}),e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.type)??"TabPrimary"});const b=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.listAbove)??[]}),C=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.data)??[]}),D=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.fixed)??!0}),S=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.resetToTop)??!0}),w=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.scrollToTop)??!0}),V=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const P=e.computed(()=>C.value.some(v=>v.img)),k=e.computed(()=>{var v;return((v=C.value[u.value])==null?void 0:v.key)??null}),I=e.computed(()=>{var W;if(!((W=c.modelValue)!=null&&W.data)||!Array.isArray(c.modelValue.data))return[];const v=c.modelValue.data[u.value];return v?v.componentsDataJson||[]:[]}),L=e.ref(""),U=()=>{var W;if(c.modelValue&&c.modelValue.data){const R=window==null?void 0:window.location.pathname.split("#")[0].split("/");L.value=(window==null?void 0:window.location.hash)||"",L.value&&setTimeout(()=>{nm(L.value)},1e3);const Y=R[R.length-1];u.value=C.value.findIndex(oe=>oe.key===Y)||0;return}const v={id:((W=c.modelValue)==null?void 0:W.id)||q(),type:"TabPage",showMode:"",containerWidth:"",bgColor:"",classes:"custom-class another-class",width:"",listAbove:[],data:[{id:q(),key:q(),name:"New Tab1",componentsDataJson:[]},{id:q(),key:q(),name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",v),u.value=0},Q=()=>{var we,fe;const v=h.value;if(!v)return;const W=v.getBoundingClientRect().top,R=m.value;if(!R)return;const Y=R.getBoundingClientRect().top,oe=+((fe=(we=window.getComputedStyle(document.body))==null?void 0:we.getPropertyValue("--header-height-calc"))==null?void 0:fe.split("px")[0])||0;if(Y>oe){g.value=!1;return}W<=oe&&(g.value=!0)},H=()=>{if(!w.value)return;let v=0;S.value||(v=E(m.value).top-170),window.scroll({top:v,left:0,behavior:"smooth"})},z=v=>{sessionStorage.setItem(Cae,v)},K=(v,W)=>{debugger;o("handleDelete",v||c.modelValue.id,W)},J=v=>{debugger;o("handleCopy",v||c.modelValue)},j=(v,W,R)=>{debugger;o("handlePaste",v,W,R)},O=v=>{o("handleClick",v)};return e.watch(()=>r.value,()=>{Q()}),e.watch(u,()=>{z(k.value),f.value&&H(),f.value=!0}),e.watch(k,v=>{v||(u.value=0)}),e.onMounted(()=>{U(),e.nextTick(Q),setTimeout(()=>{e.nextTick(Q)},200),setTimeout(()=>{},1e3)}),(v,W)=>{var R;return a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tab-page",x.value]),style:e.normalizeStyle({backgroundColor:((R=n.modelValue)==null?void 0:R.bgColor)||"transparent"}),onMouseover:W[10]||(W[10]=Y=>A.value=!0),onMouseout:W[11]||(W[11]=Y=>A.value=!1)},[e.createElementVNode("div",hae,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("div",pae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(Y,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Y.key},[k.value==Y.key?(e.openBlock(),e.createElementBlock("div",fae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.componentsDataJson,(we,fe)=>(e.openBlock(),e.createBlock(sn,{key:we.id,hash:we.hash,type:we.type,"props-data":{modelValue:we,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:W[0]||(W[0]=ke=>K(ke,I.value)),onHandleCopy:W[1]||(W[1]=ke=>J(ke)),onHandlePaste:ke=>j(ke,I.value,fe),onHandleClick:O},null,8,["hash","type","props-data","onHandlePaste"]))),128))])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&D.value},{"is-thick":P.value}]]),ref_key:"hold",ref:m},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:h},[e.createVNode(voe,{tabList:C.value,currentIdx:u.value,isFixed:g.value&&D.value,fullWidth:V.value,isPreview:n.isPreview,onUpdateCurrentIdx:W[2]||(W[2]=Y=>u.value=Y)},null,8,["tabList","currentIdx","isFixed","fullWidth","isPreview"])],512)],2),e.createElementVNode("div",gae,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("div",{key:k.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,Y=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[k.value==Y.key?(e.openBlock(),e.createElementBlock("div",Aae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.componentsDataJson,(oe,we)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:oe.id},[oe.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(oe.template,(fe,ke)=>(e.openBlock(),e.createElementBlock("div",{class:"component-wrapper",key:fe.id},[e.createVNode(sn,{type:fe.type,"props-data":{modelValue:fe,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:W[3]||(W[3]=ge=>K(ge,I.value)),onHandleCopy:W[4]||(W[4]=ge=>J(ge)),onHandlePaste:ge=>j(ge,I.value,ke),onHandleClick:O},null,8,["type","props-data","onHandlePaste"])]))),128)):(e.openBlock(),e.createElementBlock("div",yae,[e.createVNode(sn,{type:oe.type,"props-data":{modelValue:oe,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:W[5]||(W[5]=fe=>K(fe,I.value)),onHandleCopy:W[6]||(W[6]=fe=>J(fe)),onHandlePaste:fe=>j(fe,I.value,we),onHandleClick:O},null,8,["type","props-data","onHandlePaste"])]))],64))),128))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:A.value,"onUpdate:show":W[7]||(W[7]=Y=>A.value=Y),locale:n.locale,onHandleEdit:W[8]||(W[8]=Y=>p.value=!0),onHandleDelete:K,onHandleCopy:J,onHandlePaste:j},null,8,["show","locale"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(uae,{key:1,show:p.value,"onUpdate:show":W[9]||(W[9]=Y=>p.value=Y),data:n.modelValue,locale:n.locale,host:n.host,lang:n.lang,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","host","lang","websiteId","footer"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-54f0a70a"]]),x2=Object.freeze(Object.defineProperty({__proto__:null,default:Dc},Symbol.toStringTag,{value:"Module"})),wae={class:"tab-logo__btn__img flex-center"},bae=["src","alt"],Eae=te({__name:"TabLogo",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0},isFixed:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=n,d=t,c=e.ref(0),u=e.ref(.5*a.value),g=e.ref(0),f=e.ref(!0),m=e.ref(!0),h=e.ref(0),p=e.ref(!1),A=e.ref(0),E=e.ref(0),x=e.ref(0),b=e.ref(null),C=e.ref(null),D=e.ref([]),S=e.computed(()=>c.value-u.value),w=e.computed(()=>[{"--strip-width":`${S.value}px`},{"--strip-left":`${u.value}px`},{"--fix-left":`${g.value}px`},{transition:m.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),V=e.computed(()=>A.value>0),P=e.computed(()=>E.value-A.value+k.value>x.value),k=e.computed(()=>{if(!p.value)return 24;const v=b.value;if(!v)return 24;const W=window.getComputedStyle(v,null).getPropertyValue("padding-right").split("px")[0];return Number(W)*2}),I=e.computed(()=>!1);e.watch(a,()=>{H(),z()}),e.watch(()=>l.currentIdx,(v,W)=>{f.value=v>W,e.nextTick(()=>L()),e.nextTick(()=>j())}),e.watch(()=>l.isFixed,()=>{a.value>1200&&H(),e.nextTick(()=>z())}),e.watch(()=>l.tabList,(v,W)=>{z(),e.nextTick(()=>{L(0)})},{deep:!0});const L=v=>{const W=v??250;f.value?(U(),setTimeout(Q,W)):(Q(),setTimeout(U,W)),setTimeout(()=>{m.value=!0},W)},U=()=>{const v=D.value[l.currentIdx];v&&v.getBoundingClientRect&&(c.value=v.getBoundingClientRect().right)},Q=()=>{const v=D.value[l.currentIdx];v&&v.getBoundingClientRect&&(u.value=v.getBoundingClientRect().left)},H=()=>{m.value=!1,e.nextTick(()=>L(0)),e.nextTick(()=>K())},z=()=>{const v=b.value;if(v){let W=v.getBoundingClientRect().left;g.value=(v.offsetWidth-v.getBoundingClientRect().width)/2-W}},K=()=>{var v;(v=l.tabList)!=null&&v.length&&(C.value&&(A.value=C.value.scrollLeft,E.value=C.value.scrollWidth),b.value&&(x.value=b.value.getBoundingClientRect().width))},J=v=>{C.value&&(v=="next"?C.value.scrollLeft+=9999:C.value.scrollLeft-=9999)},j=()=>{const v=D.value[l.currentIdx];if(!v)return;const W=v.clientWidth/2,R=a.value/2;h.value=v.getBoundingClientRect().right-W,C.value&&(C.value.scrollLeft-=R-h.value)},O=v=>{d("updateCurrentIdx",v)};return e.onMounted(()=>{p.value=!0,e.nextTick(()=>{L(0),setTimeout(H,300),z(),e.nextTick(()=>{setTimeout(j,300)})})}),(v,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-logo",[{"is-fixed":n.isFixed},{"is-campus":!I.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:b},[e.createElementVNode("ul",{class:"tab-logo__list",ref_key:"list",ref:C,onScroll:H},[e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__prev",onClick:W[0]||(W[0]=R=>J("prev"))},null,512),[[e.vShow,V.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(R,Y)=>(e.openBlock(),e.createElementBlock("li",{key:Y,class:e.normalizeClass(["tab-logo__item",[{"tab-logo__item--img":!!R.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btn",ref:D,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(R.link?"a":"button"),{type:R.link?null:"button",href:R.link,class:e.normalizeClass(["tab-logo__btn",[{"is-active":n.currentIdx==Y}]]),onClick:oe=>O(Y)},{default:e.withCtx(()=>[e.createElementVNode("div",wae,[e.createElementVNode("img",{src:R.img,alt:R.alt},null,8,bae)])]),_:2},1032,["type","href","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__next",onClick:W[1]||(W[1]=R=>J("next"))},null,512),[[e.vShow,P.value]])],544),e.createElementVNode("span",{class:"tab-logo__strip",style:e.normalizeStyle(w.value)},null,4)],2))}},[["__scopeId","data-v-bd7e89c6"]]),xae={class:"setting-content"},Vae={class:"setting-header flex items-center mb-10"},Bae={class:"header-title"},kae={class:"setting-header flex items-center"},Dae={class:"header-title"},Sae={class:"setting-body"},Nae={class:"setting-toolbar"},Tae={class:"tools"},Pae={class:"setting-item"},Iae={class:"item-header"},Mae={class:"btn-group"},Lae={key:0,class:"drag-handle"},Oae={class:"item-title"},Qae=["src"],Uae={class:"item-uplaod flex items-center"},Fae={class:"components-content"},Hae=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));const s=f=>f&&f.length>1,r=n,{t:l}=de(()=>r.locale),d=t,c=()=>{d("update:show",!1)},u=f=>{debugger;r.data.data.push({id:q(),key:q(),name:"New Tab",img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:l("setting.image_alt"),componentsDataJson:[]})},g=(f,m)=>{r.data.data.splice(r.data.data.findIndex(h=>h.id===f),1)};return(f,m)=>{const h=e.resolveComponent("a-radio"),p=e.resolveComponent("a-radio-group"),A=e.resolveComponent("a-option"),E=e.resolveComponent("a-select"),x=e.resolveComponent("icon-plus"),b=e.resolveComponent("a-button"),C=e.resolveComponent("icon-drag-arrow"),D=e.resolveComponent("icon-delete"),S=e.resolveComponent("a-input"),w=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(w,{width:1200,visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(l)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",xae,[e.createElementVNode("div",Vae,[e.createElementVNode("span",Bae,e.toDisplayString(e.unref(l)("setting.show_mode_pc_mobile")),1),e.createVNode(p,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":m[0]||(m[0]=V=>n.data.showMode=V),type:"button"},{default:e.withCtx(()=>[e.createVNode(h,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.only_show_all")),1)]),_:1}),e.createVNode(h,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.only_show_pc")),1)]),_:1}),e.createVNode(h,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",kae,[e.createElementVNode("span",Dae,e.toDisplayString(e.unref(l)("setting.component_bg")),1),e.createVNode(E,{modelValue:n.data.bgColor,"onUpdate:modelValue":m[1]||(m[1]=V=>n.data.bgColor=V),placeholder:e.unref(l)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(A,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.bg_white")),1)]),_:1}),e.createVNode(A,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Sae,[e.createElementVNode("div",Nae,[m[9]||(m[9]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",Tae,[e.createVNode(b,{type:"primary",onClick:m[2]||(m[2]=V=>u())},{icon:e.withCtx(()=>[e.createVNode(x)]),default:e.withCtx(()=>[m[8]||(m[8]=e.createTextVNode(" List ",-1))]),_:1}),e.createVNode(b,{type:"primary",onClick:m[3]||(m[3]=V=>u())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",Pae,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":m[5]||(m[5]=V=>n.data.data=V),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!s(n.data.data),onStart:m[6]||(m[6]=V=>a.value=!0),onEnd:m[7]||(m[7]=V=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:V})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:V.id},[e.createElementVNode("div",Iae,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(V.name),1),e.createElementVNode("span",null,e.toDisplayString(V.key),1)]),e.createElementVNode("div",Mae,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",Lae,[e.createVNode(C,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(D,{class:"btn-delete",onClick:P=>g(V.id)},null,8,["onClick"]),e.createVNode(b,{size:"mini",type:"primary",onClick:m[4]||(m[4]=P=>u())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.copy_tab")),1)]),_:1})])]),m[10]||(m[10]=e.createElementVNode("p",{class:"item-title"},"Alt",-1)),e.createVNode(S,{modelValue:V.alt,"onUpdate:modelValue":P=>V.alt=P,placeholder:e.unref(l)("setting.input_image_alt"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),m[11]||(m[11]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(S,{modelValue:V.key,"onUpdate:modelValue":P=>V.key=P,placeholder:e.unref(l)("setting.input_key"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",Oae,e.toDisplayString(e.unref(l)("setting.image")),1),e.createElementVNode("img",{class:"item-img",src:V.img},null,8,Qae),e.createElementVNode("div",Uae,[e.createVNode(S,{modelValue:V.img,"onUpdate:modelValue":P=>V.img=P,placeholder:e.unref(l)("setting.image_link"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(je,{modelValue:V.img,"onUpdate:modelValue":P=>V.img=P,name:V.key},null,8,["modelValue","onUpdate:modelValue","name"])]),m[12]||(m[12]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",Fae,[e.createVNode(Ya,{data:V.componentsDataJson,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:P=>V.componentsDataJson=P},null,8,["data","host","websiteId","locale","lang","footer","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-8cd20642"]]),zae={class:"tab-page__content"},Rae={key:0},vae={key:1,class:"component-wrapper",style:{position:"relative"}},jae="",Sc=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,a=e.computed(()=>{var j,O;return c.isPreview?((j=c.modelValue)==null?void 0:j.showMode)==="pc"?!ue():((O=c.modelValue)==null?void 0:O.showMode)==="mobile"?ue():!0:!0}),{proxy:i}=e.getCurrentInstance(),{$_vsWidth:s,$_vsScrollY:r,$vsScreenAddListener:l,$vsScreenDestroyListener:d}=i,c=n,u=e.ref(0),g=e.ref(!1),f=e.ref(!0),m=e.ref(null),h=e.ref(null),p=e.ref(!1),A=e.ref(!1),E=j=>{if(!j)return{top:0,left:0};const O=j.getBoundingClientRect(),v=window.pageYOffset||document.documentElement.scrollTop,W=window.pageXOffset||document.documentElement.scrollLeft;return{top:O.top+v,left:O.left+W}},x=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.classes)??null});e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.style)??null}),e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.type)??"TabPrimary"});const b=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.data)??[]}),C=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.fixed)??!0}),D=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.resetToTop)??!0}),S=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.scrollToTop)??!0}),w=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const V=e.computed(()=>b.value.some(j=>j.img)),P=e.computed(()=>{var j;return((j=b.value[u.value])==null?void 0:j.key)??null}),k=e.computed(()=>{var O;if(!((O=c.modelValue)!=null&&O.data)||!Array.isArray(c.modelValue.data))return[];const j=c.modelValue.data[u.value];return j?j.componentsDataJson||[]:[]}),I=()=>{var O;if(c.modelValue&&c.modelValue.data)return;const j={id:((O=c.modelValue)==null?void 0:O.id)||q(),type:"TabLogo",showMode:"",containerWidth:"",bgColor:"",classes:"custom-class another-class",width:"",bgColor:"",resetToTop:!1,fullWidth:!0,fixed:!1,scrollToTop:!1,data:[{id:q(),key:q(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab1",componentsDataJson:[]},{id:q(),key:q(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",j),u.value=0},L=()=>{var Y,oe;const j=h.value;if(!j)return;const O=j.getBoundingClientRect().top,v=m.value;if(!v)return;const W=v.getBoundingClientRect().top,R=+((oe=(Y=window.getComputedStyle(document.body))==null?void 0:Y.getPropertyValue("--header-height-calc"))==null?void 0:oe.split("px")[0])||0;if(W>R){g.value=!1;return}O<=R&&(g.value=!0)},U=()=>{if(!S.value)return;let j=0;D.value||(j=E(m.value).top-170),window.scroll({top:j,left:0,behavior:"smooth"})},Q=j=>{sessionStorage.setItem(jae,j)},H=(j,O)=>{debugger;o("handleDelete",j||c.modelValue.id,O)},z=j=>{debugger;o("handleCopy",j||c.modelValue)},K=(j,O,v)=>{debugger;o("handlePaste",j,O,v)},J=j=>{o("handleClick",j)};return e.watch(()=>r.value,()=>{L()}),e.watch(u,()=>{Q(P.value),f.value&&U(),f.value=!0}),e.watch(P,j=>{j||(u.value=0)}),e.onMounted(()=>{I(),e.nextTick(L),setTimeout(()=>{e.nextTick(L)},200),setTimeout(()=>{},1e3)}),(j,O)=>{var v;return a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tab-page",x.value]),style:e.normalizeStyle({backgroundColor:((v=n.modelValue)==null?void 0:v.bgColor)||"transparent"}),onMouseover:O[8]||(O[8]=W=>A.value=!0),onMouseout:O[9]||(O[9]=W=>A.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&C.value},{"is-thick":V.value}]]),ref_key:"hold",ref:m},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:h},[e.createVNode(Eae,{tabList:b.value,currentIdx:u.value,isFixed:g.value&&C.value,fullWidth:w.value,onUpdateCurrentIdx:O[0]||(O[0]=W=>u.value=W)},null,8,["tabList","currentIdx","isFixed","fullWidth"])],512)],2),e.createElementVNode("div",zae,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[P.value?(e.openBlock(),e.createElementBlock("div",{key:P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,W=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[P.value==W.key?(e.openBlock(),e.createElementBlock("div",Rae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.componentsDataJson,(R,Y)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:R.id},[R.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.template,(oe,we)=>(e.openBlock(),e.createElementBlock("div",{class:"component-wrapper",key:oe.id,style:{position:"relative"}},[e.createVNode(sn,{type:oe.type,"props-data":{modelValue:oe,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:O[1]||(O[1]=fe=>H(fe,k.value)),onHandleCopy:O[2]||(O[2]=fe=>z(fe)),onHandlePaste:fe=>K(fe,k.value,we),onHandleClick:J},null,8,["type","props-data","onHandlePaste"])]))),128)):(e.openBlock(),e.createElementBlock("div",vae,[e.createVNode(sn,{type:R.type,"props-data":{modelValue:R,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:O[3]||(O[3]=oe=>H(oe,k.value)),onHandleCopy:O[4]||(O[4]=oe=>z(oe)),onHandlePaste:oe=>K(oe,k.value,Y),onHandleClick:J},null,8,["type","props-data","onHandlePaste"])]))],64))),128))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:A.value,"onUpdate:show":O[5]||(O[5]=W=>A.value=W),locale:n.locale,onHandleEdit:O[6]||(O[6]=W=>p.value=!0),onHandleDelete:H,onHandleCopy:z,onHandlePaste:K},null,8,["show","locale"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Hae,{key:1,show:p.value,"onUpdate:show":O[7]||(O[7]=W=>p.value=W),data:n.modelValue,locale:n.locale,host:n.host,lang:n.lang,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","host","lang","websiteId","footer"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-4d2dbc33"]]),V2=Object.freeze(Object.defineProperty({__proto__:null,default:Sc},Symbol.toStringTag,{value:"Module"})),qae={class:"setting-content"},Yae={class:"setting-header flex items-center mb-10"},Gae={class:"header-title"},Kae={class:"setting-header flex items-center"},Wae={class:"setting-header flex items-center"},Xae={class:"setting-header flex items-center"},Jae={class:"setting-header flex items-center"},Zae={class:"setting-header flex items-center"},_ae={class:"preview-container"},$ae=["src"],eie={key:1,class:"no-preview"},tie={class:"setting-body"},nie={class:"setting-toolbar"},oie={class:"setting-item"},aie={class:"components-content"},iie=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=e.ref([{id:"preset-1",name:"YCCECE Background 1",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",size:"cover",position:"center center"},{id:"preset-2",name:"YCCECE Background 2",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-02.svg",size:"",position:""},{id:"preset-3",name:"YCCECE Background 3",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-03.svg",size:"cover",position:""},{id:"preset-4",name:"YCCECE Background 4",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-04.svg",size:"cover",position:""}]),s=e.ref(),r=i.value.find(u=>u.image===o.data.backgroundImage);s.value=r?r.id:"";const l=()=>{const u=i.value.find(g=>g.id===s.value);u&&(o.data.backgroundImage=`${u.image}`,o.data.backgroundSize=u.size,o.data.backgroundPosition=u.position)},d=t,c=()=>{d("update:show",!1)};return(u,g)=>{const f=e.resolveComponent("a-radio"),m=e.resolveComponent("a-radio-group"),h=e.resolveComponent("a-option"),p=e.resolveComponent("a-select"),A=e.resolveComponent("a-button"),E=e.resolveComponent("a-input"),x=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(x,{width:1200,visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",qae,[e.createElementVNode("div",Yae,[e.createElementVNode("span",Gae,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(m,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":g[0]||(g[0]=b=>n.data.showMode=b),type:"button"},{default:e.withCtx(()=>[e.createVNode(f,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(f,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(f,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",Kae,[g[7]||(g[7]=e.createElementVNode("span",{class:"header-title"},"Background Preset",-1)),e.createVNode(p,{modelValue:s.value,"onUpdate:modelValue":g[1]||(g[1]=b=>s.value=b),style:{width:"300px","margin-right":"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,b=>(e.openBlock(),e.createBlock(h,{value:b.id,key:b.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(A,{type:"primary",onClick:l},{default:e.withCtx(()=>[...g[6]||(g[6]=[e.createTextVNode("Apply",-1)])]),_:1})]),e.createElementVNode("div",Wae,[g[8]||(g[8]=e.createElementVNode("span",{class:"header-title"},"Image",-1)),e.createVNode(E,{modelValue:n.data.backgroundImage,"onUpdate:modelValue":g[2]||(g[2]=b=>n.data.backgroundImage=b),disabled:!0,placeholder:e.unref(a)("setting.image_link"),style:{width:"300px"}},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Xae,[g[9]||(g[9]=e.createElementVNode("span",{class:"header-title"},"Size",-1)),e.createVNode(E,{modelValue:n.data.backgroundSize,"onUpdate:modelValue":g[3]||(g[3]=b=>n.data.backgroundSize=b),disabled:!0,placeholder:e.unref(a)("setting.size"),style:{width:"300px"}},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Jae,[g[10]||(g[10]=e.createElementVNode("span",{class:"header-title"},"Position",-1)),e.createVNode(E,{modelValue:n.data.backgroundPosition,"onUpdate:modelValue":g[4]||(g[4]=b=>n.data.backgroundPosition=b),disabled:!0,placeholder:e.unref(a)("setting.position"),style:{width:"300px"}},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Zae,[g[12]||(g[12]=e.createElementVNode("span",{class:"header-title"},"Preview",-1)),e.createElementVNode("div",_ae,[n.data.backgroundImage?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.data.backgroundImage,style:e.normalizeStyle({"object-fit":n.data.backgroundSize||"cover","background-position":n.data.backgroundPosition||"center center",width:"100%",height:"100px",border:"1px solid #ddd"}),alt:"Background Preview"},null,12,$ae)):(e.openBlock(),e.createElementBlock("div",eie,"No preview available")),g[11]||(g[11]=e.createElementVNode("p",{class:"preview-note"}," A light grey background has been applied for previewing and will not be reflected on website. ",-1))])]),e.createElementVNode("div",tie,[e.createElementVNode("div",nie,[e.createElementVNode("h4",null,e.toDisplayString(e.unref(a)("setting.component")),1)]),e.createElementVNode("div",oie,[e.createElementVNode("div",aie,[e.createVNode(Ya,{data:n.data.data,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:g[5]||(g[5]=b=>n.data.data=b)},null,8,["data","host","websiteId","locale","lang","footer"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-90cecf14"]]),lie={class:"component-wrapper"},sie={key:1,class:"page-item"},rie={class:"component-wrapper"},Nc=te({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=e.computed(()=>{var S,w;return!((S=o.modelValue)!=null&&S.data)||!Array.isArray(o.modelValue.data)?[]:(w=o.modelValue)==null?void 0:w.data}),r=(S,w)=>{debugger;i("handleDelete",S||o.modelValue.id,w)},l=S=>{debugger;i("handleCopy",S||o.modelValue)},d=(S,w,V)=>{debugger;i("handlePaste",S,w,V)},c=S=>{i("handleClick",S)},u=e.ref(!1),g=e.ref(!1),f=()=>{var w,V;if(o.modelValue&&o.modelValue.data)return;const S={id:((w=o.modelValue)==null?void 0:w.id)||q(),type:"BackgroundWrapper",showMode:"",backgroundImage:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",backgroundSize:"cover",backgroundPosition:"center center",data:[{id:((V=o.modelValue)==null?void 0:V.id)||q(),type:"CustomText",showMode:"",data:{width:1920,backgroundColor:"#ffffff",title:a("placeholder.this_is_title"),description:a("placeholder.this_is_description")}}]};i("update:modelValue",S)},m=e.computed(()=>{var S,w;return o.isPreview?((S=o.modelValue)==null?void 0:S.showMode)==="pc"?!ue():((w=o.modelValue)==null?void 0:w.showMode)==="mobile"?ue():!0:!0}),h=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.classes)??null}),p=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.style)??null}),A=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.width)??null}),E=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundImage)??""}),x=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundColor)??"transparent"}),b=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundSize)??"contain"}),C=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundPosition)??"center"}),D=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundRepeat)??"no-repeat"});return f(),(S,w)=>m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["background-wrapper",h.value]),style:e.normalizeStyle(p.value)},[e.createElementVNode("div",{class:e.normalizeClass(A.value),style:{position:"relative"},onMouseover:w[6]||(w[6]=V=>u.value=!0),onMouseout:w[7]||(w[7]=V=>u.value=!1)},[e.createElementVNode("div",{class:"background-wrapper__bg",style:e.normalizeStyle({"background-image":`url('${E.value}')`,"background-color":`${x.value}`,"background-size":`${b.value}`,"background-position":`${C.value}`,"background-repeat":`${D.value}`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(V,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.id},[V.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(V.template,(k,I)=>(e.openBlock(),e.createElementBlock("div",{key:k.id,class:"page-item"},[e.createElementVNode("div",lie,[e.createVNode(sn,{type:k.type,"props-data":{modelValue:k,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:w[0]||(w[0]=L=>r(L,s.value)),onHandleCopy:w[1]||(w[1]=L=>l(L)),onHandlePaste:L=>d(L,s.value,I),onHandleClick:c},null,8,["type","props-data","onHandlePaste"])])]))),128)):(e.openBlock(),e.createElementBlock("div",sie,[e.createElementVNode("div",rie,[e.createVNode(sn,{type:V.type,"props-data":{modelValue:V,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:w[2]||(w[2]=k=>r(k,s.value)),onHandleCopy:w[3]||(w[3]=k=>l(k)),onHandlePaste:k=>d(k,s.value,P),onHandleClick:c},null,8,["type","props-data","onHandlePaste"])])]))],64))),128))],4),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:u.value,"onUpdate:show":w[4]||(w[4]=V=>u.value=V),locale:n.locale,onHandleEdit:w[5]||(w[5]=V=>g.value=!0),onHandleDelete:r,onHandleCopy:l,onHandlePaste:d},null,8,["show","locale"]))],34),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(iie,{key:0,show:g.value,"onUpdate:show":w[8]||(w[8]=V=>g.value=V),data:n.modelValue,locale:n.locale,lang:n.lang,host:n.host,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","lang","host","websiteId","footer"]))],6)):e.createCommentVNode("",!0)}},[["__scopeId","data-v-6bcebc4f"]]),B2=Object.freeze(Object.defineProperty({__proto__:null,default:Nc},Symbol.toStringTag,{value:"Module"}));var k2="Expected a function",D2=NaN,die="[object Symbol]",cie=/^\s+|\s+$/g,mie=/^[-+]0x[0-9a-f]+$/i,uie=/^0b[01]+$/i,hie=/^0o[0-7]+$/i,pie=parseInt,fie=typeof pa=="object"&&pa&&pa.Object===Object&&pa,gie=typeof self=="object"&&self&&self.Object===Object&&self,Aie=fie||gie||Function("return this")(),yie=Object.prototype,Cie=yie.toString,wie=Math.max,bie=Math.min,Ph=function(){return Aie.Date.now()};function Eie(n,t,o){var a,i,s,r,l,d,c=0,u=!1,g=!1,f=!0;if(typeof n!="function")throw new TypeError(k2);t=S2(t)||0,Tc(o)&&(u=!!o.leading,g="maxWait"in o,s=g?wie(S2(o.maxWait)||0,t):s,f="trailing"in o?!!o.trailing:f);function m(S){var w=a,V=i;return a=i=void 0,c=S,r=n.apply(V,w),r}function h(S){return c=S,l=setTimeout(E,t),u?m(S):r}function p(S){var w=S-d,V=S-c,P=t-w;return g?bie(P,s-V):P}function A(S){var w=S-d,V=S-c;return d===void 0||w>=t||w<0||g&&V>=s}function E(){var S=Ph();if(A(S))return x(S);l=setTimeout(E,p(S))}function x(S){return l=void 0,f&&a?m(S):(a=i=void 0,r)}function b(){l!==void 0&&clearTimeout(l),c=0,a=d=i=l=void 0}function C(){return l===void 0?r:x(Ph())}function D(){var S=Ph(),w=A(S);if(a=arguments,i=this,d=S,w){if(l===void 0)return h(d);if(g)return l=setTimeout(E,t),m(d)}return l===void 0&&(l=setTimeout(E,t)),r}return D.cancel=b,D.flush=C,D}function xie(n,t,o){var a=!0,i=!0;if(typeof n!="function")throw new TypeError(k2);return Tc(o)&&(a="leading"in o?!!o.leading:a,i="trailing"in o?!!o.trailing:i),Eie(n,t,{leading:a,maxWait:t,trailing:i})}function Tc(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Vie(n){return!!n&&typeof n=="object"}function Bie(n){return typeof n=="symbol"||Vie(n)&&Cie.call(n)==die}function S2(n){if(typeof n=="number")return n;if(Bie(n))return D2;if(Tc(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Tc(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(cie,"");var o=uie.test(n);return o||hie.test(n)?pie(n.slice(2),o?2:8):mie.test(n)?D2:+n}var kie=xie;const Die=ja(kie),Sie={class:"setting-content"},Nie={class:"setting-header flex items-center mb-10"},Tie={class:"header-title"},Pie={class:"setting-header flex items-center"},Iie={class:"header-title"},Mie={class:"setting-header flex items-center"},Lie={class:"header-title"},Oie={class:"setting-header flex items-center"},Qie={class:"header-title"},Uie={class:"setting-body"},Fie={class:"setting-toolbar"},Hie={class:"setting-item"},zie={class:"components-content"},Rie=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:"sc"},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{i("update:show",!1)};return(r,l)=>{const d=e.resolveComponent("a-radio"),c=e.resolveComponent("a-radio-group"),u=e.resolveComponent("a-input"),g=e.resolveComponent("a-option"),f=e.resolveComponent("a-select"),m=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(m,{width:1200,visible:n.show,footer:!1,onCancel:s,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Sie,[e.createElementVNode("div",Nie,[e.createElementVNode("span",Tie,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(c,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":l[0]||(l[0]=h=>n.data.showMode=h),type:"button"},{default:e.withCtx(()=>[e.createVNode(d,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(d,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(d,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",Pie,[e.createElementVNode("span",Iie,e.toDisplayString(e.unref(a)("setting.title")),1),e.createVNode(u,{modelValue:n.data.title,"onUpdate:modelValue":l[1]||(l[1]=h=>n.data.title=h),placeholder:e.unref(a)("setting.input_title"),"allow-clear":""},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Mie,[e.createElementVNode("span",Lie,e.toDisplayString(e.unref(a)("setting.component_width")),1),e.createVNode(f,{modelValue:n.data.width,"onUpdate:modelValue":l[2]||(l[2]=h=>n.data.width=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(g,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_default")),1)]),_:1}),e.createVNode(g,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_small")),1)]),_:1}),e.createVNode(g,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_middle")),1)]),_:1}),e.createVNode(g,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Oie,[e.createElementVNode("span",Qie,e.toDisplayString(e.unref(a)("setting.opened_by_default")),1),e.createVNode(f,{modelValue:n.data.openFirst,"onUpdate:modelValue":l[3]||(l[3]=h=>n.data.openFirst=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(g,{value:!0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.yes")),1)]),_:1}),e.createVNode(g,{value:!1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.no")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Uie,[e.createElementVNode("div",Fie,[e.createElementVNode("h4",null,e.toDisplayString(e.unref(a)("setting.component")),1)]),e.createElementVNode("div",Hie,[e.createElementVNode("div",zie,[e.createVNode(Ya,{data:n.data.data,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:l[4]||(l[4]=h=>n.data.data=h)},null,8,["data","host","websiteId","locale","lang","footer"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-d5320404"]]),vie={class:"collapse-custom__wrapper"},jie=["innerHTML"],qie={class:"collapse-custom__content__wrapper"},Yie={class:"component-wrapper"},Gie={key:1,class:"page-item"},Kie={class:"component-wrapper"},Pc=te({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=e.ref(null),r=e.ref(0),l=e.ref(!1),d=e.ref(null),c=e.ref(!1),u=e.ref(!1),g=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.classes)??""}),f=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.style)??""});e.computed(()=>{var w;return(w=o.modelValue)==null?void 0:w.width});const m=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.title)??[]}),h=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.openFirst)??!1}),p=e.computed(()=>{var w,V;return!((w=o.modelValue)!=null&&w.data)||!Array.isArray(o.modelValue.data)?[]:(V=o.modelValue)==null?void 0:V.data}),A=()=>{var V;if(o.modelValue&&o.modelValue.data)return;const w={id:((V=o.modelValue)==null?void 0:V.id)||q(),type:"CollapseCustom",showMode:"",title:a("placeholder.title_here"),openFirst:!1,width:"",style:{},data:[]};i("update:modelValue",w)},E=e.computed(()=>{var w,V;return o.isPreview?((w=o.modelValue)==null?void 0:w.showMode)==="pc"?!ue():((V=o.modelValue)==null?void 0:V.showMode)==="mobile"?ue():!0:!0}),x=()=>{const w=s.value;w&&(r.value=w.scrollHeight)},b=(w,V)=>{debugger;i("handleDelete",w||o.modelValue.id,V)},C=w=>{debugger;i("handleCopy",w||o.modelValue)},D=(w,V,P)=>{debugger;i("handlePaste",w,V,P)},S=w=>{i("handleClick",w)};return e.onMounted(()=>{l.value=h.value,e.nextTick(x);const w=Die(()=>{x()},250);d.value=new ResizeObserver(w),d.value.observe(s.value)}),e.onBeforeUnmount(()=>{s.value&&d.value&&d.value.unobserve(s.value)}),A(),(w,V)=>{var P,k;return E.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["collapse-custom",g.value]),style:e.normalizeStyle(f.value),onMouseover:V[8]||(V[8]=I=>c.value=!0),onMouseout:V[9]||(V[9]=I=>c.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom_container",[(P=n.modelValue)!=null&&P.width?`container-content-${(k=n.modelValue)==null?void 0:k.width}`:"container-content"]])},[e.createElementVNode("div",vie,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["collapse-custom__btn",{"--is-collapsed":!l.value}]),onClick:V[0]||(V[0]=I=>l.value=!l.value)},[e.createElementVNode("h4",{class:"collapse-custom__btn__title",innerHTML:m.value},null,8,jie),V[10]||(V[10]=e.createElementVNode("span",{class:"collapse-custom__btn__icon"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom__content",{"--is-open":l.value}]),ref_key:"content",ref:s,style:e.normalizeStyle({"--scroll-height":`${r.value}px`})},[e.createElementVNode("div",qie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(I,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:I.id},[I.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(I.template,(U,Q)=>(e.openBlock(),e.createElementBlock("div",{key:U.id,class:"page-item"},[e.createElementVNode("div",Yie,[e.createVNode(sn,{type:U.type,"props-data":{modelValue:U,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:V[1]||(V[1]=H=>b(H,p.value)),onHandleCopy:V[2]||(V[2]=H=>C(H)),onHandlePaste:H=>D(H,p.value,Q),onHandleClick:S},null,8,["type","props-data","onHandlePaste"])])]))),128)):(e.openBlock(),e.createElementBlock("div",Gie,[e.createElementVNode("div",Kie,[e.createVNode(sn,{type:I.type,"props-data":{modelValue:I,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:V[3]||(V[3]=U=>b(U,p.value)),onHandleCopy:V[4]||(V[4]=U=>C(U)),onHandlePaste:U=>D(U,p.value,L),onHandleClick:S},null,8,["type","props-data","onHandlePaste"])])]))],64))),128))])],6)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:c.value,"onUpdate:show":V[5]||(V[5]=I=>c.value=I),locale:n.locale,onHandleEdit:V[6]||(V[6]=I=>u.value=!0),onHandleDelete:b,onHandleCopy:C,onHandlePaste:D},null,8,["show","locale"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Rie,{key:0,show:u.value,"onUpdate:show":V[7]||(V[7]=I=>u.value=I),data:n.modelValue,locale:n.locale,host:n.host,lang:n.lang,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","host","lang","websiteId","footer"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-e8565d79"]]),N2=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"})),Wie=["onClick"],Xie=te({__name:"VrTourTab",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,s=t,r=e.ref(0),l=e.ref(0),d=e.ref(0),c=e.ref(0),u=e.ref(null),g=e.ref(null),f=e.ref([]),m=e.computed(()=>r.value>40),h=e.computed(()=>d.value+c.value<l.value+40),p=e.computed({get(){return i.currentIdx??0},set(b){s("updateIdx",b)}});e.watch(a,()=>{A()});const A=()=>{var C;if(!((C=i.list)!=null&&C.length))return;g.value&&(r.value=g.value.scrollLeft),u.value&&(d.value=u.value.getBoundingClientRect().left,c.value=u.value.getBoundingClientRect().width);let b=null;f.value.length>0&&(b=Array.isArray(f.value)?f.value[f.value.length-1]:f.value),b&&b.getBoundingClientRect&&(l.value=b.getBoundingClientRect().left)},E=b=>{g.value&&(b==="next"?g.value.scrollLeft+=200:g.value.scrollLeft-=200)},x=()=>{A()};return e.onMounted(()=>{e.nextTick(()=>{x()})}),(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"VrtourWrapper",ref:u},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"VrtourList",ref:g,onScroll:x},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:C[0]||(C[0]=D=>E("prev"))},null,512),[[e.vShow,m.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(D,S)=>(e.openBlock(),e.createElementBlock("li",{key:S},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":p.value==S}]),ref_for:!0,ref_key:"VrtourBtn",ref:f,onClick:w=>p.value=S},e.toDisplayString(D.name),11,Wie)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:C[1]||(C[1]=D=>E("next"))},null,512),[[e.vShow,h.value]])],544)],512))}},[["__scopeId","data-v-45823646"]]),Jie=["onClick"],T2=te({__name:"VrTourCat",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),a=n,i=t,s=e.ref(null),r=e.ref(null),l=e.ref(null),d=e.ref(0),c=e.ref(0),u=e.ref(0),g=e.ref(0),f=e.ref(0),m=e.computed(()=>d.value>40),h=e.computed(()=>u.value+g.value<c.value+40),p=e.computed({get(){return a.currentIdx??0},set(C){i("updateIdx",C),e.nextTick(b)}}),A=()=>{var D;if(!((D=a.list)!=null&&D.length))return;r.value&&(d.value=r.value.scrollLeft),s.value&&(u.value=s.value.getBoundingClientRect().left,g.value=s.value.getBoundingClientRect().width);let C=null;l.value&&(C=Array.isArray(l.value)?l.value[l.value.length-1]:l.value),C&&C.getBoundingClientRect&&(c.value=C.getBoundingClientRect().left)},E=C=>{C=="next"?r.value.scrollLeft+=200:r.value.scrollLeft-=200},x=()=>{r.value&&(d.value=r.value.scrollLeft),A()},b=async()=>{if(await e.nextTick(),!l.value||!l.value[p.value])return;const C=l.value[p.value],D=C.clientWidth/2,S=o.$_vsWidth/2;f.value=C.getBoundingClientRect().right-D,r.value.scrollLeft-=S-f.value};return e.watch(()=>o.$_vsWidth,()=>{A()}),e.watch(()=>a.list,()=>{e.nextTick(A),r.value&&r.value.scrollLeft&&(r.value.scrollLeft=0)},{deep:!0}),e.onMounted(()=>{e.nextTick(x)}),(C,D)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"wrapper",ref:s},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:r,onScroll:x},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:D[0]||(D[0]=S=>E("prev"))},null,512),[[e.vShow,m.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(S,w)=>(e.openBlock(),e.createElementBlock("li",{key:w,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":p.value==w}]),ref_for:!0,ref_key:"btnRef",ref:l,onClick:V=>p.value=w},e.toDisplayString(S.name),11,Jie)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:D[1]||(D[1]=S=>E("next"))},null,512),[[e.vShow,h.value]])],544)],512))}},[["__scopeId","data-v-dec01fdd"]]),Zie={class:"tab-tag__nav__prev"},_ie=["onClick"],$ie=["src","alt"],ele={class:"tab-tag__btn__title"},tle={class:"tab-tag__nav__next"},nle=te({__name:"VrTourChoose",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,s=t,r=e.ref(null),l=e.ref(null),d=e.ref(null),c=e.ref(0),u=e.ref(0),g=e.ref(0),f=e.ref(0),m=e.ref(0),h=e.computed(()=>c.value>0),p=e.computed(()=>u.value-40>f.value),A=e.computed({get(){return i.currentIdx??0},set(D){s("updateIdx",D),e.nextTick(b)}}),E=()=>{var S,w,V,P;if(!((S=i.list)!=null&&S.length))return;c.value=(w=l.value)==null?void 0:w.scrollLeft,g.value=(V=r.value)==null?void 0:V.getBoundingClientRect().left,f.value=(P=r.value)==null?void 0:P.getBoundingClientRect().right;let D=null;d.value&&(D=Array.isArray(d.value)?d.value[d.value.length-1]:d.value),u.value=D==null?void 0:D.getBoundingClientRect().right},x=D=>{D==="next"?l.value.scrollLeft+=200:l.value.scrollLeft-=200},b=()=>{const D=d.value[A.value];if(!D)return;const S=D.clientWidth/2,w=a.value/2;m.value=D.getBoundingClientRect().right-S,l.value.scrollLeft-=w-m.value},C=()=>{E()};return e.watch(()=>a.value,()=>{E()}),e.watch(()=>i.list,()=>{e.nextTick(E),l.value&&l.value.scrollLeft&&(l.value.scrollLeft=0)}),e.onMounted(()=>{e.nextTick(C)}),(D,S)=>(e.openBlock(),e.createElementBlock("div",{class:"vr-tour-choose tab-tag",ref_key:"wrapper",ref:r},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:l,onScroll:C},[e.withDirectives(e.createElementVNode("div",Zie,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:S[0]||(S[0]=w=>x("prev"))})],512),[[e.vShow,h.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(w,V)=>(e.openBlock(),e.createElementBlock("li",{key:V,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":A.value===V}]),ref_for:!0,ref_key:"btn",ref:d,onClick:P=>A.value=V},[e.createElementVNode("img",{src:w.url,alt:w.name},null,8,$ie),e.createElementVNode("div",ele,e.toDisplayString(w.name),1)],10,_ie)]))),128)),e.withDirectives(e.createElementVNode("div",tle,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:S[1]||(S[1]=w=>x("next"))})],512),[[e.vShow,p.value]])],544)],512))}},[["__scopeId","data-v-8086a4bf"]]),ole={class:"vr-tour-scene"},ale=["src"],ile={key:1,class:"vr-tour-scene__img"},lle=["src","alt"],sle=te({__name:"VrTourScene",props:{scene:{type:Object,default:()=>({})}},setup(n){const t=n,o=e.computed(()=>{var s;return(s=t.scene)==null?void 0:s.embed}),a=e.computed(()=>{var s;return(s=t.scene)==null?void 0:s.url}),i=e.computed(()=>{var s;return(s=t.scene)==null?void 0:s.name});return(s,r)=>(e.openBlock(),e.createElementBlock("div",ole,[o.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:o.value,frameborder:"0"},null,8,ale)):(e.openBlock(),e.createElementBlock("div",ile,[e.createElementVNode("img",{src:a.value,alt:i.value},null,8,lle)]))]))}},[["__scopeId","data-v-c07507d5"]]),rle={class:"vr-tour-select"},dle={class:"select-btn__focus-name line-clamp-1"},cle={class:"select-list"},mle=["onClick"],P2=te({__name:"VrTourSelect",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i={mounted(p,A){p.clickOutsideEvent=E=>{p===E.target||p.contains(E.target)||A.value(E)},document.body.addEventListener("click",p.clickOutsideEvent)},unmounted(p){document.body.removeEventListener("click",p.clickOutsideEvent)}},s=n,r=t,l=e.ref(!1),d=e.ref(-8),c=e.ref(null),u=e.computed({get(){return s.currentIdx??0},set(p){r("updateIdx",p)}}),g=e.computed(()=>{var p;return((p=s.list[u.value])==null?void 0:p.name)||""});e.watch(l,()=>{m()}),e.onMounted(()=>{window.addEventListener("resize",()=>{a.value=window.innerWidth,l.value&&m()})});const f=()=>{l.value=!1},m=()=>{const p=c.value;if(!p)return;const A=ui(p).x+p.clientWidth;A>a.value&&(d.value=d.value-A+a.value-4)},h=p=>{u.value=p,f()};return(p,A)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",rle,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["select-btn",{"is-open":l.value}]),onClick:A[0]||(A[0]=E=>l.value=!l.value)},[e.createElementVNode("div",dle,e.toDisplayString(g.value),1),A[1]||(A[1]=e.createElementVNode("div",{class:"select-btn__arrow"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["select-block",{"is-open":l.value}]),style:e.normalizeStyle({"--left":`${d.value}px`}),ref_key:"blockRef",ref:c},[e.createElementVNode("ul",cle,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(E,x)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["select-item line-clamp-1",{"is-active":u.value===x}]),key:x,onClick:b=>h(x)},e.toDisplayString(E.name),11,mle))),128))])],6)])),[[i,f]])}},[["__scopeId","data-v-536804a2"]]),ule={class:"setting-content"},hle={class:"setting-header flex items-center mb-10"},ple={class:"header-title"},fle={class:"setting-header flex items-center"},gle={class:"header-title"},Ale={class:"setting-body"},yle={class:"setting-toolbar"},Cle={class:"tools"},wle={class:"setting-item"},ble={class:"item-header"},Ele={class:"btn-group"},xle={key:0,class:"drag-handle"},Vle={key:0},Ble={class:"item-header"},kle={class:"btn-group"},Dle={key:0,class:"drag-handle"},Sle={class:"item-header"},Nle={class:"btn-group"},Tle={key:0,class:"drag-handle"},Ple={class:"item-title"},Ile=["src"],Mle={class:"item-uplaod flex items-center"},Lle={style:{"text-align":"center"}},Ole={style:{"text-align":"center","margin-top":"20px"}},Qle=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=e.computed(()=>({animation:200,group:"gallerys-Categories",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=h=>h&&h.length>1,d=n,{t:c}=de(()=>d.locale),u=t,g=()=>{u("update:show",!1)},f=(h,p)=>{debugger;const A=d.data;h==="Campus"?A.data.push({key:q(),name:"New Campus",categoriesList:[]}):h==="Category"?p.categoriesList.push(JSON.parse(JSON.stringify({key:q(),name:"New Category",facilitiesList:[]}))):h==="facilitiy"?p.facilitiesList.push({key:q(),name:"New facilitiy",url:"",scene:null,embed:""}):A.data.push({id:q(),key:q(),name:"New Tab",link:"/",componentsDataJson:[]})},m=(h,p,A)=>{debugger;if(p==="Campuses")d.data.data=d.data.data.filter(E=>E.key!==h);else if(p==="facilitiy"){const E=A.findIndex(x=>x.key===h);E!==-1&&A.splice(E,1)}else if(p==="categories"){const E=A.findIndex(x=>x.key===h);E!==-1&&A.splice(E,1)}};return(h,p)=>{const A=e.resolveComponent("a-radio"),E=e.resolveComponent("a-radio-group"),x=e.resolveComponent("a-option"),b=e.resolveComponent("a-select"),C=e.resolveComponent("icon-plus"),D=e.resolveComponent("a-button"),S=e.resolveComponent("icon-drag-arrow"),w=e.resolveComponent("icon-delete"),V=e.resolveComponent("a-input"),P=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(P,{width:500,visible:n.show,footer:!1,onCancel:g,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(c)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ule,[e.createElementVNode("div",hle,[e.createElementVNode("span",ple,e.toDisplayString(e.unref(c)("setting.show_mode_pc_mobile")),1),e.createVNode(E,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":p[0]||(p[0]=k=>n.data.showMode=k),type:"button"},{default:e.withCtx(()=>[e.createVNode(A,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.only_show_all")),1)]),_:1}),e.createVNode(A,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.only_show_pc")),1)]),_:1}),e.createVNode(A,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",fle,[e.createElementVNode("span",gle,e.toDisplayString(e.unref(c)("setting.bg_color")),1),e.createVNode(b,{modelValue:n.data.data.bgColor,"onUpdate:modelValue":p[1]||(p[1]=k=>n.data.data.bgColor=k),placeholder:e.unref(c)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(x,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.bg_white")),1)]),_:1}),e.createVNode(x,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Ale,[e.createElementVNode("div",yle,[p[11]||(p[11]=e.createElementVNode("h1",null,"Campuses",-1)),e.createElementVNode("div",Cle,[e.createVNode(D,{type:"primary",onClick:p[2]||(p[2]=k=>f("Campus"))},{icon:e.withCtx(()=>[e.createVNode(C)]),default:e.withCtx(()=>[p[10]||(p[10]=e.createTextVNode(" Campus ",-1))]),_:1})])]),e.createElementVNode("div",wle,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":p[7]||(p[7]=k=>n.data.data=k),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!l(n.data.data),onStart:p[8]||(p[8]=k=>a.value=!0),onEnd:p[9]||(p[9]=k=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:k})=>{var I;return[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(n.data.data)}]),key:k.key},[e.createElementVNode("div",ble,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(k.name),1)]),e.createElementVNode("div",Ele,[l(n.data.data)?(e.openBlock(),e.createElementBlock("div",xle,[e.createVNode(S,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:L=>m(k.key,"Campuses")},null,8,["onClick"])])]),p[16]||(p[16]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(V,{modelValue:k.name,"onUpdate:modelValue":L=>k.name=L,placeholder:e.unref(c)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),p[17]||(p[17]=e.createElementVNode("p",{class:"item-title"},"Categories",-1)),e.createElementVNode("div",null,[(I=k.categoriesList)!=null&&I.length?(e.openBlock(),e.createElementBlock("div",Vle,[e.createVNode(e.unref(o),e.mergeProps({modelValue:k.categoriesList,"onUpdate:modelValue":L=>k.categoriesList=L,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},r.value,{disabled:!l(k.categoriesList),onStart:p[5]||(p[5]=L=>a.value=!0),onEnd:p[6]||(p[6]=L=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:L})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(k.categoriesList)}]),key:L.id,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",Ble,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(L.name),1)]),e.createElementVNode("div",kle,[l(k.categoriesList)?(e.openBlock(),e.createElementBlock("div",Dle,[e.createVNode(S,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:U=>m(L.key,"categories",k.categoriesList)},null,8,["onClick"])])]),p[14]||(p[14]=e.createElementVNode("p",null,"Name",-1)),e.createVNode(V,{modelValue:L.name,"onUpdate:modelValue":U=>L.name=U,placeholder:e.unref(c)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),p[15]||(p[15]=e.createElementVNode("p",{class:"item-title"},"Facilities",-1)),e.createElementVNode("div",null,[e.createVNode(e.unref(o),e.mergeProps({modelValue:L.facilitiesList,"onUpdate:modelValue":U=>L.facilitiesList=U,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},s.value,{disabled:!l(L.facilitiesList),onStart:p[3]||(p[3]=U=>a.value=!0),onEnd:p[4]||(p[4]=U=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:U})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(L.facilitiesList)}]),key:U.key,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",Sle,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(U.name),1)]),e.createElementVNode("div",Nle,[l(L.facilitiesList)?(e.openBlock(),e.createElementBlock("div",Tle,[e.createVNode(S,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:Q=>m(U.key,"facilitiy",L.facilitiesList)},null,8,["onClick"])])]),p[12]||(p[12]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(V,{modelValue:U.name,"onUpdate:modelValue":Q=>U.name=Q,placeholder:e.unref(c)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",Ple,e.toDisplayString(e.unref(c)("setting.image")),1),e.createElementVNode("img",{class:"item-img",src:U.url},null,8,Ile),e.createElementVNode("div",Mle,[e.createVNode(V,{modelValue:U.url,"onUpdate:modelValue":Q=>U.url=Q,placeholder:e.unref(c)("setting.image_link"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(je,{modelValue:U.url,"onUpdate:modelValue":Q=>U.url=Q,name:U.key},null,8,["modelValue","onUpdate:modelValue","name"])]),p[13]||(p[13]=e.createElementVNode("p",{class:"item-title"},"VR Embed URL",-1)),e.createVNode(V,{modelValue:U.embed,"onUpdate:modelValue":Q=>U.embed=Q,placeholder:e.unref(c)("setting.please_input"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])]),e.createElementVNode("div",Lle,[e.createVNode(D,{type:"primary",onClick:U=>f("facilitiy",L)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.add")),1)]),_:1},8,["onClick"])])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ole,[e.createVNode(D,{type:"primary",onClick:L=>f("Category",k)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.add")),1)]),_:1},8,["onClick"])])],2))]}),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-13185b94"]]),Ule={class:"vr-tour__wrapper"},Fle={key:0,class:"vr-tour__tabs"},Hle={class:"container-content-middle"},zle={key:1,class:"vr-tour__selects"},Rle={class:"container-content"},vle={class:"vr-tour__selects__list"},jle={class:"vr-tour__scene"},qle={key:2,class:"vr-tour__cats"},Yle={class:"pt-2"},Gle={key:3,class:"vr-tour__chooses"},Ic=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=t,d=n,c=e.computed(()=>{var w,V;return d.isPreview?((w=d.modelValue)==null?void 0:w.showMode)==="pc"?!ue():((V=d.modelValue)==null?void 0:V.showMode)==="mobile"?ue():!0:!0}),u=e.ref(0),g=e.ref(0),f=e.ref(0),m=e.ref(!1),h=e.ref(!1),p=e.computed(()=>{var V;const w=(V=d.modelValue)==null?void 0:V.data;return Array.isArray(w)?w:[]}),A=e.computed(()=>{var V;const w=(V=p.value[u.value])==null?void 0:V.categoriesList;return Array.isArray(w)?w:[]}),E=e.computed(()=>{var V;const w=(V=A.value[g.value])==null?void 0:V.facilitiesList;return Array.isArray(w)?w:[]}),x=e.computed(()=>{var w;return(w=E.value)==null?void 0:w[f.value]}),b=()=>{var V;if(d.modelValue&&d.modelValue.data)return;const w={id:((V=d.modelValue)==null?void 0:V.id)||q(),type:"VrTour",showMode:"",containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",data:[{key:q(),name:"SecondarySchool",categoriesList:[{key:q(),name:"Facilities",facilitiesList:[{key:q(),name:"ECE Learning Communities",url:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt/multi_floor_plans/853_floorplan.png",scene:null,embed:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt-2026/en/index.html"}]}]}]};l("update:modelValue",w),u.value=0};e.watch(u,()=>{g.value=0}),e.watch(g,()=>{f.value=0});const C=()=>{l("handleDelete",d.modelValue.id)},D=()=>{l("handleCopy",d.modelValue)},S=w=>{l("handlePaste",w)};return b(),(w,V)=>{var P;return c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vr-tour",{"pb-0":E.value&&E.value.length<=1}]),style:e.normalizeStyle({backgroundColor:((P=n.modelValue)==null?void 0:P.bgColor)||"transparent"}),onMouseover:V[9]||(V[9]=k=>h.value=!0),onMouseout:V[10]||(V[10]=k=>h.value=!1)},[e.createElementVNode("div",Ule,[p.value&&p.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",Fle,[e.createElementVNode("div",Hle,[e.createVNode(Xie,{list:p.value,onUpdateIdx:V[0]||(V[0]=k=>u.value=k),currentIdx:u.value},null,8,["list","currentIdx"])])])):e.createCommentVNode("",!0),e.unref(a)<768?(e.openBlock(),e.createElementBlock("div",zle,[e.createElementVNode("div",Rle,[e.createElementVNode("div",vle,[p.value.length>1?(e.openBlock(),e.createBlock(P2,{key:0,list:p.value,onUpdateIdx:V[1]||(V[1]=k=>u.value=k),currentIdx:u.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0),A.value.length>1?(e.openBlock(),e.createBlock(P2,{key:1,list:A.value,onUpdateIdx:V[2]||(V[2]=k=>g.value=k),currentIdx:g.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])]),E.value.length>1?(e.openBlock(),e.createBlock(T2,{key:0,list:E.value,onUpdateIdx:V[3]||(V[3]=k=>f.value=k),currentIdx:f.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jle,[e.createVNode(sle,{scene:x.value},null,8,["scene"])]),A.value&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",qle,[e.withDirectives(e.createElementVNode("div",Yle,null,512),[[e.vShow,A.value.length<=1&&E.value&&E.value.length>1]]),e.withDirectives(e.createVNode(T2,{list:A.value,onUpdateIdx:V[4]||(V[4]=k=>g.value=k),currentIdx:g.value},null,8,["list","currentIdx"]),[[e.vShow,A.value.length>1]])])):e.createCommentVNode("",!0),E.value&&E.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",Gle,[e.createVNode(nle,{list:E.value,onUpdateIdx:V[5]||(V[5]=k=>f.value=k),currentIdx:f.value},null,8,["list","currentIdx"])])):e.createCommentVNode("",!0)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:h.value,"onUpdate:show":V[6]||(V[6]=k=>h.value=k),locale:n.locale,onHandleEdit:V[7]||(V[7]=k=>m.value=!0),onHandleDelete:C,onHandleCopy:D,onHandlePaste:S},null,8,["show","locale"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Qle,{key:1,show:m.value,"onUpdate:show":V[8]||(V[8]=k=>m.value=k),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-f8f37cdb"]]),I2=Object.freeze(Object.defineProperty({__proto__:null,default:Ic},Symbol.toStringTag,{value:"Module"})),Kle={class:"seting-box"},Wle={class:"setting-header flex items-center mb-10"},Xle={class:"header-title"},Jle={class:"item-title"},Zle={class:"item-title"},_le={class:"part_title",style:{"margin-top":"20px"}},$le={key:0},ese={class:"setting-header items-center"},tse={class:"draggable_box"},nse={class:"drag_top_box"},ose=["onClick"],ase={class:"item-title",style:{"margin-top":"20px"}},ise={class:"item-title",style:{"margin-top":"20px"}},lse={key:0},sse={class:"draggable_link_box"},rse={class:"drag_link_top_box"},dse=["onClick"],cse={class:"link-title",style:{"margin-top":"20px"}},mse={class:"link-title",style:{"margin-top":"20px"}},use=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.computed(()=>({animation:200,group:"gridLinks",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),i=e.computed(()=>({animation:200,group:"gridLinkItems",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.ref(!1),r=e.ref(!1),l=n,{t:d}=de(()=>l.locale),c=e.ref(new Set),u=e.ref(new Set),g=()=>{var w,V;(V=(w=l.data)==null?void 0:w.data)!=null&&V.list&&Array.isArray(l.data.data.list)&&(c.value.clear(),u.value.clear(),l.data.data.list.forEach(P=>{P.id&&c.value.add(P.id),P.links&&Array.isArray(P.links)&&P.links.length>0&&P.links.forEach(k=>{k.id&&u.value.add(k.id)})}))},f=e.ref(!1);e.watch(()=>l.show,w=>{w&&!f.value?(f.value=!0,e.nextTick(()=>{g()})):w||(f.value=!1)},{immediate:!0});const m=w=>{var V,P;c.value.has(w.id)?(c.value.clear(),(P=(V=l.data)==null?void 0:V.data)!=null&&P.list&&l.data.data.list.forEach(k=>{k.id!==w.id&&c.value.add(k.id)})):c.value.add(w.id)},h=w=>c.value.has(w.id),p=w=>{l.data.data.list=l.data.data.list.filter(V=>V.id!==w)},A=()=>{var P,k;const w=l.data.data,V=q();w.list.push({id:V,title:d("placeholder.title_here"),links:[]}),c.value.clear(),(k=(P=l.data)==null?void 0:P.data)!=null&&k.list&&l.data.data.list.forEach(I=>{I.id!==V&&c.value.add(I.id)}),e.nextTick(()=>{if(typeof document<"u"){const I=document.querySelector(".arco-drawer-body");I&&(I.scrollTop=I.scrollHeight)}})},E=w=>{u.value.has(w.id)?u.value.delete(w.id):u.value.add(w.id)},x=w=>u.value.has(w.id),b=w=>{const V=l.data.data.list.find(P=>P.id===w);if(V){const P=q();V.links.push({id:P,name:d("placeholder.name_here"),link:""}),V.links&&Array.isArray(V.links)&&V.links.forEach(k=>{k.id!==P?u.value.add(k.id):u.value.delete(k.id)})}},C=(w,V)=>{const P=l.data.data.list.find(k=>k.id===w);P&&P.links&&(P.links=P.links.filter(k=>k.id!==V))},D=t,S=()=>{D("update:show",!1)};return(w,V)=>{const P=e.resolveComponent("a-radio"),k=e.resolveComponent("a-radio-group"),I=e.resolveComponent("a-option"),L=e.resolveComponent("a-select"),U=e.resolveComponent("icon-drag-dot"),Q=e.resolveComponent("icon-drag-arrow"),H=e.resolveComponent("icon-delete"),z=e.resolveComponent("a-input"),K=e.resolveComponent("icon-plus"),J=e.resolveComponent("a-button"),j=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(j,{width:500,visible:n.show,footer:!1,onCancel:S,unmountOnClose:""},{title:e.withCtx(()=>{var O;return[e.createTextVNode(e.toDisplayString((O=n.data)==null?void 0:O.type)+" "+e.toDisplayString(e.unref(d)("setting.component_edit")),1)]}),default:e.withCtx(()=>[e.createElementVNode("div",Kle,[e.createElementVNode("div",Wle,[e.createElementVNode("span",Xle,e.toDisplayString(e.unref(d)("setting.show_mode_pc_mobile")),1),e.createVNode(k,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":V[0]||(V[0]=O=>n.data.showMode=O),type:"button"},{default:e.withCtx(()=>[e.createVNode(P,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_all")),1)]),_:1}),e.createVNode(P,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_pc")),1)]),_:1}),e.createVNode(P,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("p",Jle,e.toDisplayString(e.unref(d)("setting.component_width")),1),e.createVNode(L,{modelValue:n.data.data.width,"onUpdate:modelValue":V[1]||(V[1]=O=>n.data.data.width=O),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(I,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_default")),1)]),_:1}),e.createVNode(I,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_small")),1)]),_:1}),e.createVNode(I,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_middle")),1)]),_:1}),e.createVNode(I,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("p",Zle,e.toDisplayString(e.unref(d)("setting.component_bg")),1),e.createVNode(L,{modelValue:n.data.bgColor,"onUpdate:modelValue":V[2]||(V[2]=O=>n.data.bgColor=O),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(I,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_white")),1)]),_:1}),e.createVNode(I,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("div",_le,e.toDisplayString(e.unref(d)("setting.link_list")),1),n.data.data.list.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$le,e.toDisplayString(e.unref(d)("setting.no_data")),1)),e.createElementVNode("div",ese,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data.list,"onUpdate:modelValue":V[5]||(V[5]=O=>n.data.data.list=O),"component-data":{tag:"div",type:"transition-group",name:s.value?null:"flip-list"}},a.value,{disabled:!1,onStart:V[6]||(V[6]=O=>s.value=!0),onEnd:V[7]||(V[7]=O=>s.value=!1),"item-key":"id"}),{item:e.withCtx(({element:O})=>[e.createElementVNode("div",tse,[e.createElementVNode("div",nse,[e.createElementVNode("div",{class:"drag-handle",onClick:v=>m(O)},[e.createVNode(U,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(O.title),1)],8,ose),e.createElementVNode("div",null,[e.createVNode(Q,{class:"icon_drag"}),e.createVNode(H,{class:"btn-delete",onClick:e.withModifiers(v=>p(O.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",ase,e.toDisplayString(e.unref(d)("setting.title")),1),e.createVNode(z,{modelValue:O.title,"onUpdate:modelValue":v=>O.title=v,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",ise,e.toDisplayString(e.unref(d)("setting.link")),1),O.links.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lse,e.toDisplayString(e.unref(d)("setting.no_data")),1)),e.createVNode(e.unref(o),e.mergeProps({modelValue:O.links,"onUpdate:modelValue":v=>O.links=v,"component-data":{tag:"div",type:"transition-group",name:r.value?null:"flip-list"}},i.value,{disabled:!1,onStart:V[3]||(V[3]=v=>r.value=!0),onEnd:V[4]||(V[4]=v=>r.value=!1),"item-key":"id"}),{item:e.withCtx(({element:v})=>[e.createElementVNode("div",sse,[e.createElementVNode("div",rse,[e.createElementVNode("div",{class:"drag-handle",onClick:W=>E(v)},[e.createVNode(U,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(e.unref(d)("setting.link")),1)],8,dse),e.createElementVNode("div",null,[e.createVNode(Q,{class:"icon_drag"}),e.createVNode(H,{class:"btn-delete",onClick:e.withModifiers(W=>C(O.id,v.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",cse,e.toDisplayString(e.unref(d)("setting.name")),1),e.createVNode(z,{modelValue:v.name,"onUpdate:modelValue":W=>v.name=W,placeholder:e.unref(d)("setting.input_name"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",mse,e.toDisplayString(e.unref(d)("setting.link_url")),1),e.createVNode(z,{modelValue:v.link,"onUpdate:modelValue":W=>v.link=W,placeholder:e.unref(d)("setting.input_link_url"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],512),[[e.vShow,!x(v)]])]),_:2},1024)])]),_:2},1040,["modelValue","onUpdate:modelValue","component-data"]),e.createVNode(J,{style:{"margin-top":"20px"},size:"mini",type:"primary",onClick:v=>b(O.id)},{icon:e.withCtx(()=>[e.createVNode(K)]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(d)("setting.link")),1)]),_:1},8,["onClick"])],512),[[e.vShow,!h(O)]])]),_:2},1024)])]),_:1},16,["modelValue","component-data"])]),e.createVNode(J,{type:"primary",onClick:A,style:{"margin-top":"20px"}},{icon:e.withCtx(()=>[e.createVNode(K)]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.add_row")),1)]),_:1})])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-990efe62"]]),hse=["innerHTML"],pse={key:0,class:"grid-links__sublist"},fse=["onClick"],gse={key:1,class:"grid-links__subitem__link"},Ih=te(e.defineComponent({name:"GridLinks",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=h=>{!h||!o.isPreview||i("handleClick",h)},r=e.computed(()=>{var h,p;return o.isPreview?((h=o.modelValue)==null?void 0:h.showMode)==="pc"?!ue():((p=o.modelValue)==null?void 0:p.showMode)==="mobile"?ue():!0:!0}),l=()=>{var p;if(o.modelValue&&o.modelValue.data)return;const h={id:((p=o.modelValue)==null?void 0:p.id)||q(),type:"GridLinks",showMode:"",data:{width:"",bgColor:"",list:[{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:""},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]},{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]},{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]},{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]}]}};i("update:modelValue",h)},d=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var A,E;const h=(E=(A=o.modelValue)==null?void 0:A.data)==null?void 0:E.width;return!h||h==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[h]||"container-content"}),g=()=>{i("handleDelete",o.modelValue.id)},f=()=>{i("handleCopy",o.modelValue)},m=h=>{i("handlePaste",h)};return l(),(h,p)=>{var A,E,x;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gridLinks_wrap",style:e.normalizeStyle({backgroundColor:((A=n.modelValue)==null?void 0:A.bgColor)||"transparent"}),onMouseenter:p[2]||(p[2]=b=>d.value=!0),onMouseleave:p[3]||(p[3]=b=>d.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(u.value)},[e.createElementVNode("div",{class:"grid-links__row",style:e.normalizeStyle({"--grid-columns-mobile":h.mobileCol,"--grid-columns-desktop":h.desktopCol})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((x=(E=n.modelValue)==null?void 0:E.data)==null?void 0:x.list)||[],(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"grid-links__item",key:`${(b==null?void 0:b.title)||"item"}-${C}`},[e.createElementVNode("h6",{class:"grid-links__item__title",innerHTML:(b==null?void 0:b.title)||""},null,8,hse),Array.isArray(b==null?void 0:b.links)&&b.links.length?(e.openBlock(),e.createElementBlock("ul",pse,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((b==null?void 0:b.links)||[],(D,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${(D==null?void 0:D.name)||"sub"}-${S}`,class:"grid-links__subitem"},[D!=null&&D.link?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:w=>s(D.link),class:"link_text"},[e.createTextVNode(e.toDisplayString(D==null?void 0:D.name)+" ",1),p[5]||(p[5]=e.createElementVNode("span",{class:"link_text__underline"},null,-1))],8,fse)):(e.openBlock(),e.createElementBlock("div",gse,e.toDisplayString(D==null?void 0:D.name),1))]))),128))])):e.createCommentVNode("",!0)]))),128))],4)],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:d.value,"onUpdate:show":p[0]||(p[0]=b=>d.value=b),locale:n.locale,onHandleEdit:p[1]||(p[1]=b=>c.value=!0),onHandleDelete:g,onHandleCopy:f,onHandlePaste:m},null,8,["show","locale"]))],36)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(use,{key:1,show:c.value,"onUpdate:show":p[4]||(p[4]=b=>c.value=b),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-705a66b5"]]),M2=Object.freeze(Object.defineProperty({__proto__:null,default:Ih},Symbol.toStringTag,{value:"Module"})),Ase={class:"setting-content"},yse={class:"setting-header flex items-center mb-10"},Cse={class:"header-title"},wse={class:"setting-header flex items-center"},bse={class:"header-title"},Ese={class:"setting-body"},xse={class:"setting-toolbar"},Vse={class:"tools"},Bse={class:"setting-item"},kse={class:"item-header"},Dse={class:"btn-group"},Sse={key:0,class:"drag-handle"},Nse={class:"item-title"},Tse={class:"item-title"},Pse=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:"sc"}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ut)),i=e.ref(!1),s=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=m=>m&&m.length>1,l=n,{t:d}=de(()=>l.locale),c=t,u=()=>{c("update:show",!1)},g=m=>{l.data.data.push({key:q(),title:"[[TITLE]]",content:""})},f=m=>{l.data.data=l.data.data.filter(h=>h.key!==m)};return(m,h)=>{const p=e.resolveComponent("a-radio"),A=e.resolveComponent("a-radio-group"),E=e.resolveComponent("a-option"),x=e.resolveComponent("a-select"),b=e.resolveComponent("icon-plus"),C=e.resolveComponent("a-button"),D=e.resolveComponent("icon-drag-arrow"),S=e.resolveComponent("icon-delete"),w=e.resolveComponent("a-input"),V=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(V,{width:500,visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(d)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ase,[e.createElementVNode("div",yse,[e.createElementVNode("span",Cse,e.toDisplayString(e.unref(d)("setting.show_mode_pc_mobile")),1),e.createVNode(A,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":h[0]||(h[0]=P=>n.data.showMode=P),type:"button"},{default:e.withCtx(()=>[e.createVNode(p,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_all")),1)]),_:1}),e.createVNode(p,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_pc")),1)]),_:1}),e.createVNode(p,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",wse,[e.createElementVNode("span",bse,e.toDisplayString(e.unref(d)("setting.component_width")),1),e.createVNode(x,{modelValue:n.data.width,"onUpdate:modelValue":h[1]||(h[1]=P=>n.data.width=P),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(E,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_default")),1)]),_:1}),e.createVNode(E,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_small")),1)]),_:1}),e.createVNode(E,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_middle")),1)]),_:1}),e.createVNode(E,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Ese,[e.createElementVNode("div",xse,[h[7]||(h[7]=e.createElementVNode("h4",null,"Topics",-1)),e.createElementVNode("div",Vse,[e.createVNode(C,{type:"primary",onClick:h[2]||(h[2]=P=>g())},{icon:e.withCtx(()=>[e.createVNode(b)]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(d)("setting.add_tab")),1)]),_:1}),e.createVNode(C,{type:"primary",onClick:h[3]||(h[3]=P=>g())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",Bse,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":h[4]||(h[4]=P=>n.data.data=P),"component-data":{tag:"div",type:"transition-group",name:i.value?null:"flip-list"}},s.value,{disabled:!r(n.data.data),onStart:h[5]||(h[5]=P=>i.value=!0),onEnd:h[6]||(h[6]=P=>i.value=!1),"item-key":"key"}),{item:e.withCtx(({element:P})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:P.key},[e.createElementVNode("div",kse,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(P.title),1)]),e.createElementVNode("div",Dse,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",Sse,[e.createVNode(D,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(S,{class:"btn-delete",onClick:k=>f(P.key)},null,8,["onClick"])])]),e.createElementVNode("p",Nse,e.toDisplayString(e.unref(d)("setting.title")),1),e.createVNode(w,{modelValue:P.title,"onUpdate:modelValue":k=>P.title=k,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",Tse,e.toDisplayString(e.unref(d)("setting.content")),1),e.createVNode(e.unref(a),{modelValue:P.content,"onUpdate:modelValue":k=>P.content=k,name:`AccordionText_${P.key}`},null,8,["modelValue","onUpdate:modelValue","name"])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-03cf9528"]]),Ise=["id"],Mse=["id"],Lse=["onClick"],Ose={class:"accordion-button__title"},Qse=["id","aria-expanded","aria-labelledby"],Use={class:"accordion-body"},Fse=["innerHTML"],Hse={class:"flex-center mt-10"},zse={class:"btn--udrline"},Mc=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=n,{t:d}=de(()=>l.locale),{t:c}=de(()=>l.lang),u=t,g=()=>{var J;if(l.modelValue&&Array.isArray(l.modelValue.data)&&l.modelValue.data.length){l.modelValue.openFirst&&p.value.size===0&&p.value.add(l.modelValue.data[0].key);return}const K={id:((J=l.modelValue)==null?void 0:J.id)||q(),type:"AccordionText",showMode:"",openFirst:!1,width:"",style:{},data:[{key:q(),title:"tab1",content:d("placeholder.this_is_content")}]};u("update:modelValue",K)},f=e.ref(Date.now()),m=e.ref(6),h=e.ref(6),p=e.ref(new Set),A=e.ref([]),E=e.ref([]),x=e.ref(!1),b=e.ref(!1),C=e.computed(()=>{var K,J;return l.isPreview?((K=l.modelValue)==null?void 0:K.showMode)==="pc"?!ue():((J=l.modelValue)==null?void 0:J.showMode)==="mobile"?ue():!0:!0}),D=e.computed(()=>{var K;return(K=l.modelValue)!=null&&K.hasOwnProperty("classes")?l.modelValue.classes:null}),S=e.computed(()=>{var K;return(K=l.modelValue)!=null&&K.hasOwnProperty("style")?l.modelValue.style:null});e.computed(()=>{var K;return(K=l.modelValue)!=null&&K.hasOwnProperty("width")?l.modelValue.width:null});const w=e.computed(()=>{var J;const K=(J=l.modelValue)==null?void 0:J.data;return Array.isArray(K)?K:[]}),V=e.computed(()=>w.value.slice(0,m.value)),P=K=>{var J;p.value.has(K)?p.value.delete(K):((J=l.modelValue)!=null&&J.allowMultiple||p.value.clear(),p.value.add(K)),setTimeout(()=>{I(document.getElementById(`accordion-${f.value}-${K}`))},350)},k=K=>p.value.has(K),I=K=>{if(a.value>=768)return;const j=ui(K).y-150;window.scroll({top:j,left:0,behavior:"smooth"})},L=()=>{a.value>=768?(m.value=6,h.value=6):(m.value=4,h.value=4)},U=(K,J)=>{debugger;u("handleDelete",K||l.modelValue.id,J)},Q=K=>{debugger;u("handleCopy",K||l.modelValue)},H=(K,J)=>{debugger;u("handlePaste",K,J)},z=()=>{};return e.watch(w,(K,J)=>{var j;L(),(j=l.modelValue)!=null&&j.openFirst&&K.length>0&&p.value.size===0&&p.value.add(K[0].key)},{deep:!0,immediate:!0}),e.watch(V,()=>{e.nextTick(z)},{immediate:!1}),e.onMounted(()=>{var K;e.nextTick(L),(K=l.modelValue)!=null&&K.openFirst&&w.value.length>0&&p.value.size===0&&p.value.add(w.value[0].key),e.nextTick(()=>{E.value.forEach(J=>{J&&J.querySelectorAll("a").forEach(O=>{O.addEventListener("click",v=>{const W=v.target.getAttribute("href");W&&!W.startsWith("http")&&(v.preventDefault(),u("handleClick",W))})})})})}),g(),(K,J)=>{var j,O;return C.value?(e.openBlock(),e.createElementBlock("div",{key:0,onMouseover:J[4]||(J[4]=v=>b.value=!0),onMouseout:J[5]||(J[5]=v=>b.value=!1),class:e.normalizeClass(["accordion-text",D.value]),id:`accordion-parent-${f.value}`,style:e.normalizeStyle(S.value)},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-text__container",[(j=n.modelValue)!=null&&j.width?`container-content-${(O=n.modelValue)==null?void 0:O.width}`:"container-content"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(v,W)=>(e.openBlock(),e.createElementBlock("div",{key:v.key,class:"accordion-item",ref_for:!0,ref_key:"itemRefs",ref:A,"data-aos":"fade-in"},[e.createElementVNode("div",{class:"accordion-header",id:`accordion-${f.value}-${v.key}`},[e.createElementVNode("button",{class:e.normalizeClass(["accordion-button",{collapsed:!k(v.key)}]),type:"button",onClick:R=>P(v.key)},[e.createElementVNode("div",null,[e.createElementVNode("div",Ose,e.toDisplayString(v.title),1)]),J[6]||(J[6]=e.createElementVNode("span",{class:"accordion-button__icon"},null,-1))],10,Lse)],8,Mse),e.createElementVNode("div",{id:`accordion-${f.value}-collapse-${v.key}`,class:e.normalizeClass(["accordion-collapse collapse",{show:k(v.key)}]),"aria-expanded":k(v.key),"aria-labelledby":`accordion-${f.value}-${v.key}`,style:e.normalizeStyle({height:k(v.key)?"auto":"0",overflow:"hidden"})},[e.createElementVNode("div",Use,[e.createElementVNode("div",{class:"accordion__content",innerHTML:v.content,ref_for:!0,ref_key:"contentRefs",ref:E},null,8,Fse)])],14,Qse)]))),128)),e.withDirectives(e.createElementVNode("div",Hse,[e.createElementVNode("button",{type:"button",class:"btn btn__load-more",onClick:J[0]||(J[0]=v=>m.value+=h.value)},[e.createElementVNode("div",zse,e.toDisplayString(e.unref(c)("text.see_more")),1),J[7]||(J[7]=e.createElementVNode("span",{class:"i i-load-more"},null,-1))])],512),[[e.vShow,m.value<w.value.length]]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:b.value,"onUpdate:show":J[1]||(J[1]=v=>b.value=v),locale:n.locale,onHandleEdit:J[2]||(J[2]=v=>x.value=!0),onHandleDelete:U,onHandleCopy:Q,onHandlePaste:H,style:{top:"-10px"}},null,8,["show","locale"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pse,{key:0,show:x.value,"onUpdate:show":J[3]||(J[3]=v=>x.value=v),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],46,Ise)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-40bd7e5c"]]),L2=Object.freeze(Object.defineProperty({__proto__:null,default:Mc},Symbol.toStringTag,{value:"Module"})),Rse={class:"setting-content"},vse={class:"setting-header flex items-center mb-10"},jse={class:"header-title"},qse={class:"setting-header flex items-center"},Yse={class:"header-title"},Gse={class:"setting-header flex items-center"},Kse={class:"header-title"},Wse={class:"setting-body"},Xse={class:"item-title"},Jse=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:"sc"}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{i("update:show",!1)};return(r,l)=>{const d=e.resolveComponent("a-radio"),c=e.resolveComponent("a-radio-group"),u=e.resolveComponent("a-option"),g=e.resolveComponent("a-select"),f=e.resolveComponent("a-textarea"),m=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(m,{width:500,visible:n.show,footer:!1,onCancel:s,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Rse,[e.createElementVNode("div",vse,[e.createElementVNode("span",jse,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(c,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":l[0]||(l[0]=h=>n.data.showMode=h),type:"button"},{default:e.withCtx(()=>[e.createVNode(d,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(d,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(d,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",qse,[e.createElementVNode("span",Yse,e.toDisplayString(e.unref(a)("setting.component_width")),1),e.createVNode(g,{modelValue:n.data.width,"onUpdate:modelValue":l[1]||(l[1]=h=>n.data.width=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_default")),1)]),_:1}),e.createVNode(u,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_small")),1)]),_:1}),e.createVNode(u,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_middle")),1)]),_:1}),e.createVNode(u,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Gse,[e.createElementVNode("span",Kse,e.toDisplayString(e.unref(a)("setting.component_bg")),1),e.createVNode(g,{modelValue:n.data.bgColor,"onUpdate:modelValue":l[2]||(l[2]=h=>n.data.bgColor=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_white")),1)]),_:1}),e.createVNode(u,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Wse,[e.createElementVNode("p",Xse,e.toDisplayString(e.unref(a)("setting.content")),1),e.createVNode(f,{modelValue:n.data.data.html,"onUpdate:modelValue":l[3]||(l[3]=h=>n.data.data.html=h),placeholder:e.unref(a)("setting.input_html"),"auto-size":{minRows:20}},null,8,["modelValue","placeholder"])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-c035b7e3"]]),Zse=e.defineComponent({__name:"shadowContainer",props:{html:{type:String,default:""}},setup(n){const t=n,o=e.ref(null);let a=null;const i=()=>{a&&(a.innerHTML=t.html)};return e.onMounted(()=>{o.value&&(a=o.value.attachShadow({mode:"open"}),i())}),e.watch(()=>t.html,i),(s,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:o},null,512))}}),Lc=te(e.defineComponent({name:"HtmlItem",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{var m;if(o.modelValue&&o.modelValue.data)return;const f={id:((m=o.modelValue)==null?void 0:m.id)||q(),type:"HtmlItem",showMode:"",width:"",bgColor:"",data:{html:a("placeholder.html_content")}};i("update:modelValue",f)},r=e.computed(()=>{var f,m;return o.isPreview?((f=o.modelValue)==null?void 0:f.showMode)==="pc"?!ue():((m=o.modelValue)==null?void 0:m.showMode)==="mobile"?ue():!0:!0}),l=e.ref(!1),d=e.ref(!1),c=()=>{i("handleDelete",o.modelValue.id)},u=()=>{i("handleCopy",o.modelValue)},g=f=>{i("handlePaste",f)};return s(),(f,m)=>{var h,p,A,E,x;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"html-item",style:e.normalizeStyle({backgroundColor:((h=n.modelValue)==null?void 0:h.bgColor)||"transparent"}),onMouseenter:m[2]||(m[2]=b=>l.value=!0),onMouseleave:m[3]||(m[3]=b=>l.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass([(p=n.modelValue)!=null&&p.width?`container-content-${(A=n.modelValue)==null?void 0:A.width}`:"container-content"])},[e.createVNode(Zse,{html:((x=(E=n.modelValue)==null?void 0:E.data)==null?void 0:x.html)||""},null,8,["html"])],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:l.value,"onUpdate:show":m[0]||(m[0]=b=>l.value=b),locale:n.locale,onHandleEdit:m[1]||(m[1]=b=>d.value=!0),onHandleDelete:c,onHandleCopy:u,onHandlePaste:g},null,8,["show","locale"]))],36)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Jse,{key:1,show:d.value,"onUpdate:show":m[4]||(m[4]=b=>d.value=b),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-980cc251"]]),O2=Object.freeze(Object.defineProperty({__proto__:null,default:Lc},Symbol.toStringTag,{value:"Module"})),_se={install:n=>{n.component("RibbonBlock",Pr)}},$se={install:n=>{n.component("TimelineStory",Ir)}},ere={install:n=>{n.component("NewsList",Mr)}},tre={install:n=>{n.component("TheHistoryCarousel",Lr)}},nre={install:n=>{n.component("CardShowcaseProfile",Or)}},ore={install:n=>{n.component("ArticleList",yl)}},are={install:n=>{n.component("BannerImage",vs)}},ire={install:n=>{n.component("BannerPage",js)}},lre={install:n=>{n.component("BtnList",Cl)}},sre={install:n=>{n.component("GalleryDefault",qs)}},rre={install:n=>{n.component("GalleryCaptionRound",Ys)}},dre={install:n=>{n.component("GalleryTimeline",gr)}},cre={install:n=>{n.component("GalleryTimelineCol",Ar)}},mre={install:n=>{n.component("Process",yr)}},ure={install:n=>{n.component("CustomSpace",Cr)}},hre={install:n=>{n.component("GalleryList",Er)}},pre={install:n=>{n.component("HeroSlide",xr)}},fre={install:n=>{n.component("LinkList",Vr)}},gre={install:n=>{n.component("QuoteText",Br)}},Are={install:n=>{n.component("DonorLinks",kr)}},yre={install:n=>{n.component("CardCarousel",Dr)}},Cre={install:n=>{n.component("CardCarouselMultiRow",Sr)}},wre={install:n=>{n.component("BannerQuote",Nr)}},bre={install:n=>{n.component("ArticleItem",Tr)}},Ere={install:n=>{n.component("CountDown",Qr)}},xre={install:n=>{n.component("CustomIframe",Ur)}},Vre={install:n=>{n.component("BannerImageWithLink",zr)}},Bre={install:n=>{n.component("ContactUsList",Fr)}},kre={install:n=>{n.component("TableTwo",Hr)}},Dre={install:n=>{n.component("ScrollKeyInfo",Rr)}},Sre={install:n=>{n.component("ContactUsInfo",vr)}},Nre={install:n=>{n.component("Publications",jr)}},Tre={install:n=>{n.component("MapStatic",qr)}},Pre={install:n=>{n.component("CardCarouselArticles",$r)}},Ire={install:n=>{n.component("CarouselLogo",Yr)}},Mre={install:n=>{n.component("Resources",Gr)}},Lre={install:n=>{n.component("ResourcesTwo",Kr)}},Ore={install:n=>{n.component("Disc",Wr)}},Qre={install:n=>{n.component("BasicCollapse",Xr)}},Ure={install:n=>{n.component("TableCollapse",Jr)}},Fre={install:n=>{n.component("MediaLogo",Hl)}},Hre={install:n=>{n.component("RegisterForm",Zr)}},zre={install:n=>{n.component("GalleryBlock",_r)}},Rre={install:n=>{n.component("CardCarouselMultiRowArticles",ed)}},vre={install:n=>{n.component("AlummiCommunityList",id)}},jre={install:n=>{n.component("BlessingMessage",ld)}},qre={install:n=>{n.component("BlessingSlider",sd)}},Yre={install:n=>{n.component("CardShowcase",rd)}},Gre={install:n=>{n.component("ExploreLinks",dd)}},Kre={install:n=>{n.component("SchoolLayout",md)}},Wre={install:n=>{n.component("CardCarouselMultiRowPublications",ud)}},Xre={install:n=>{n.component("CustomText",td)}},Jre={install:n=>{n.component("MediaImageFull",nd)}},Zre={install:n=>{n.component("MediaImageStatic",od)}},_re={install:n=>{n.component("ArticleListPureText",ad)}},$re={install:n=>{n.component("TabDefault",hd)}},ede={install:n=>{n.component("TabTimeLine",pd)}},tde={install:n=>{n.component("CardListProgramme",gd)}},nde={install:n=>{n.component("CardListCircle",fd)}},ode={install:n=>{n.component("CardListSchool",Ad)}},ade={install:n=>{n.component("MediaVideo",Bc)}},ide={install:n=>{n.component("DetailLink",yd)}},lde={install:n=>{n.component("InformationLink",kc)}},sde={install:n=>{n.component("TabPage",Dc)}},rde={install:n=>{n.component("AccordionText",Mc)}},dde={install:n=>{n.component("TabLogo",Sc)}},cde={install:n=>{n.component("BackgroundWrapper",Nc)}},mde={install:n=>{n.component("CollapseCustom",Pc)}},ude={install:n=>{n.component("VrTour",Ic)}},hde={install:n=>{n.component("HtmlItem",Lc)}},Mh={default:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},dark:{primaryColor:"#60a5fa",secondaryColor:"#c084fc",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},compact:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"12px",fontFamily:"Inter, sans-serif",borderRadius:"4px",spacing:"12px"},large:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"16px",fontFamily:"Inter, sans-serif",borderRadius:"8px",spacing:"20px"}},Ln=e.ref(Mh.default),Fo=e.ref(!1);function pde(){const n=h=>{typeof h=="string"?Ln.value={...Mh[h]}:Ln.value={...h},a()},t=h=>{Ln.value={...Ln.value,...h},a()},o=()=>{Fo.value=!Fo.value,typeof document<"u"&&document.documentElement.classList.toggle("dark",Fo.value)},a=()=>{if(typeof document>"u")return;const h=document.documentElement,p=Ln.value;h.style.setProperty("--theme-primary",p.primaryColor),h.style.setProperty("--theme-secondary",p.secondaryColor),h.style.setProperty("--font-size-default",p.fontSize),h.style.setProperty("--radius-md",p.borderRadius),h.style.setProperty("--spacing-md",p.spacing)},i=h=>e.computed(()=>h==="primary"?Ln.value.primaryColor:Ln.value.secondaryColor),s=()=>e.computed(()=>Ln.value.fontSize),r=()=>e.computed(()=>Ln.value.fontFamily),l=()=>e.computed(()=>Ln.value.borderRadius),d=()=>e.computed(()=>Ln.value.spacing),c=()=>{n("default"),Fo.value=!1,typeof document<"u"&&document.documentElement.classList.remove("dark")},u=()=>JSON.stringify(Ln.value,null,2),g=h=>{try{const p=JSON.parse(h);return n(p),!0}catch(p){return console.error("Invalid theme configuration:",p),!1}},f=()=>{const h=typeof window<"u"&&typeof localStorage<"u",p=h?localStorage.getItem("officialblock-theme"):null,A=h?localStorage.getItem("officialblock-dark-mode"):null;if(p)try{const E=JSON.parse(p);n(E)}catch(E){console.error("Failed to restore theme:",E)}if(A&&(Fo.value=A==="true",typeof document<"u"&&document.documentElement.classList.toggle("dark",Fo.value)),typeof window<"u"&&typeof window.matchMedia=="function"){const E=window.matchMedia("(prefers-color-scheme: dark)"),x=b=>{(!h||!localStorage.getItem("officialblock-dark-mode"))&&(Fo.value=b.matches,typeof document<"u"&&document.documentElement.classList.toggle("dark",Fo.value))};E.addEventListener("change",x)}a()},m=()=>{typeof window<"u"&&typeof localStorage<"u"&&(localStorage.setItem("officialblock-theme",JSON.stringify(Ln.value)),localStorage.setItem("officialblock-dark-mode",Fo.value.toString()))};return{currentTheme:e.computed(()=>Ln.value),isDarkMode:e.computed(()=>Fo.value),themePresets:Mh,setTheme:n,updateTheme:t,toggleDarkMode:o,resetTheme:c,exportTheme:u,importTheme:g,initTheme:f,saveTheme:m,getThemeColor:i,getFontSize:s,getFontFamily:r,getBorderRadius:l,getSpacing:d}}class fde{static hexToRgb(t){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:null}static rgbToHex(t,o,a){return"#"+((1<<24)+(t<<16)+(o<<8)+a).toString(16).slice(1)}static adjustBrightness(t,o){const a=this.hexToRgb(t);if(!a)return t;const i=s=>{const r=Math.round(s*(1+o/100));return Math.max(0,Math.min(255,r))};return this.rgbToHex(i(a.r),i(a.g),i(a.b))}static generateColorScale(t){const o=[50,100,200,300,400,500,600,700,800,900,950],a={};return o.forEach((i,s)=>{let r;i<=500?r=80-s*16:r=-20-(s-5)*12,a[i.toString()]=this.adjustBrightness(t,r)}),a}static getContrastRatio(t,o){const a=d=>{const c=this.hexToRgb(d);if(!c)return 0;const u=g=>{const f=g/255;return f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4)};return .2126*u(c.r)+.7152*u(c.g)+.0722*u(c.b)},i=a(t),s=a(o),r=Math.max(i,s),l=Math.min(i,s);return(r+.05)/(l+.05)}static isDarkColor(t){const o=this.hexToRgb(t);return o?(o.r*299+o.g*587+o.b*114)/1e3<128:!1}static getBestTextColor(t){return this.isDarkColor(t)?"#ffffff":"#000000"}static mixColors(t,o,a=.5){const i=this.hexToRgb(t),s=this.hexToRgb(o);if(!i||!s)return t;const r=(l,d)=>Math.round(l*(1-a)+d*a);return this.rgbToHex(r(i.r,s.r),r(i.g,s.g),r(i.b,s.b))}}class gde{static getCurrentBreakpoint(){if(typeof window>"u")return"xl";const t=window.innerWidth;return t<475?"xs":t<640?"sm":t<768?"md":t<1024?"lg":t<1280?"xl":"2xl"}static isMobile(){return typeof window>"u"?!1:window.innerWidth<768}static isTablet(){if(typeof window>"u")return!1;const t=window.innerWidth;return t>=768&&t<1024}static isDesktop(){return typeof window>"u"?!0:window.innerWidth>=1024}static onBreakpointChange(t){if(typeof window>"u")return()=>{};let o=this.getCurrentBreakpoint();const a=()=>{const i=this.getCurrentBreakpoint();i!==o&&(o=i,t(i))};return window.addEventListener("resize",a),()=>{typeof window<"u"&&window.removeEventListener("resize",a)}}}class Q2{static animate(t,o,a,i,s=this.easing.easeOutQuad){if(typeof window>"u"||typeof requestAnimationFrame>"u"||typeof performance>"u")return i(o),()=>{};const r=performance.now();let l;const d=c=>{const u=c-r,g=Math.min(u/a,1),f=s(g),m=t+(o-t)*f;i(m),g<1&&(l=requestAnimationFrame(d))};return l=requestAnimationFrame(d),()=>{l&&cancelAnimationFrame(l)}}static scrollTo(t,o,a=300,i=this.easing.easeOutQuad){return new Promise(s=>{if(typeof window>"u"){s();return}const r=t===window,l=r?window.pageYOffset:t.scrollTop;this.animate(l,o,a,d=>{r?window.scrollTo(0,d):t.scrollTop=d},i),setTimeout(s,a)})}}ra(Q2,"easing",{linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:-1+(4-2*t)*t,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1});class Ade{static setItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.setItem(t,JSON.stringify(o)),!0}catch(a){return console.warn("Failed to save to localStorage:",a),!1}}static getItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return o||null;try{const a=localStorage.getItem(t);return a?JSON.parse(a):o||null}catch(a){return console.warn("Failed to read from localStorage:",a),o||null}}static removeItem(t){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.removeItem(t),!0}catch(o){return console.warn("Failed to remove from localStorage:",o),!1}}static cleanExpired(){if(typeof window>"u"||typeof localStorage>"u")return;const t=Date.now(),o=[];for(let a=0;a<localStorage.length;a++){const i=localStorage.key(a);if(i&&i.startsWith("officialblock-"))try{const s=JSON.parse(localStorage.getItem(i)||"{}");s.expires&&s.expires<t&&o.push(i)}catch{}}o.forEach(a=>localStorage.removeItem(a))}}if(typeof globalThis<"u"&&!globalThis.FormData){class n{constructor(){ra(this,"data",new Map)}append(o,a,i){this.data.set(o,{value:a,filename:i})}get(o){const a=this.data.get(o);return a?a.value:null}has(o){return this.data.has(o)}delete(o){this.data.delete(o)}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[Symbol.iterator](){return this.data.entries()}}globalThis.FormData=n}const yde={install:n=>{n.use(tp),n.config.globalProperties.$device={get isMobile(){return typeof window<"u"?window.innerWidth<768:!1},get isTablet(){return typeof window<"u"?window.innerWidth>=768&&window.innerWidth<1024:!1},get isMobileOrTablet(){return typeof window<"u"?window.innerWidth<1024:!1},get isDesktop(){return typeof window<"u"?window.innerWidth>=1024:!0}},n.component("ArticleList",yl),n.component("BannerImage",vs),n.component("BannerPage",js),n.component("BtnList",Cl),n.component("GalleryDefault",qs),n.component("GalleryCaptionRound",Ys),n.component("GalleryTimeline",gr),n.component("GalleryTimelineCol",Ar),n.component("Process",yr),n.component("CustomSpace",Cr),n.component("GalleryList",Er),n.component("HeroSlide",xr),n.component("LinkList",Vr),n.component("QuoteText",Br),n.component("DonorLinks",kr),n.component("CardCarousel",Dr),n.component("CardCarouselMultiRow",Sr),n.component("BannerQuote",Nr),n.component("ArticleItem",Tr),n.component("RibbonBlock",Pr),n.component("TimelineStory",Ir),n.component("NewsList",Mr),n.component("TheHistoryCarousel",Lr),n.component("CardShowcaseProfile",Or),n.component("CountDown",Qr),n.component("ContactUsList",Fr),n.component("CustomIframe",Ur),n.component("TableTwo",Hr),n.component("ScrollKeyInfo",Rr),n.component("BannerImageWithLink",zr),n.component("ContactUsInfo",vr),n.component("Publications",jr),n.component("MapStatic",qr),n.component("CardCarouselArticles",$r),n.component("CarouselLogo",Yr),n.component("Resources",Gr),n.component("ResourcesTwo",Kr),n.component("Disc",Wr),n.component("BasicCollapse",Xr),n.component("TableCollapse",Jr),n.component("MediaLogo",Hl),n.component("RegisterForm",Zr),n.component("GalleryBlock",_r),n.component("CardCarouselMultiRowArticles",ed),n.component("AlummiCommunityList",id),n.component("BlessingMessage",ld),n.component("BlessingSlider",sd),n.component("CardShowcase",rd),n.component("ExploreLinks",dd),n.component("SchoolLayout",md),n.component("CardCarouselMultiRowPublications",ud),n.component("CustomText",td),n.component("MediaImageFull",nd),n.component("MediaImageStatic",od),n.component("ArticleListPureText",ad),n.component("TabDefault",hd),n.component("CardListProgramme",gd),n.component("CardListCircle",fd),n.component("CardListSchool",Ad),n.component("MediaVideo",Bc),n.component("DetailLink",yd),n.component("InformationLink",kc),n.component("TabTimeLine",pd),n.component("TabPage",Dc),n.component("TabLogo",Sc),n.component("BackgroundWrapper",Nc),n.component("CollapseCustom",Pc),n.component("VrTour",Ic),n.component("AccordionText",Mc),n.component("GridLinks",Ih),n.component("HtmlItem",Lc)}},Cde={class:"rich-text-editor"},Ut=Object.freeze(Object.defineProperty({__proto__:null,default:te(e.defineComponent({__name:"index",props:{name:{default:""},modelValue:{default:""},placeholder:{default:"Please input content..."},height:{default:"400px"},mode:{default:"default"},disabled:{type:Boolean,default:!1},maxLength:{default:1e4},excludeKeys:{default:()=>[]},includeKeys:{default:()=>[]}},emits:["update:modelValue","change","focus","blur","created","upload-image","upload-video"],setup(n,{expose:t,emit:o}){const a=n,i=o,s=e.shallowRef(),r=e.ref(""),l=e.computed(()=>typeof a.height=="number"?`${a.height}px`:a.height),d=e.inject("handleUpload",()=>{}),c=e.inject("fileUrl",null),u=e.inject("chooseName",null),g=e.ref(""),f=e.ref(null),m=I=>{if(!d){console.warn("Upload: handleUpload function not provided by ancestor");return}if(g.value=I,s.value)try{const U=s.value.selection;U&&(f.value={anchor:{path:[...U.anchor.path],offset:U.anchor.offset},focus:{path:[...U.focus.path],offset:U.focus.offset}})}catch(U){console.warn("保存光标位置失败:",U)}const L=a.name+"_"+I;d(!0,L)};e.watch(()=>a.name,()=>{c.value=null},{deep:!0,immediate:!0}),e.watch(()=>[c==null?void 0:c.value],([I])=>{const L=a.name+"_"+g.value;!I||!u.value||u.value!==L||s.value&&e.nextTick(()=>{var U,Q;if(s.value){try{if(s.value.focus(),f.value)try{s.value.select(f.value)}catch(H){console.warn("恢复光标位置失败,使用默认位置:",H)}}catch(H){console.warn("聚焦编辑器失败:",H)}if(g.value==="img"){const z=`<img src="${I}" alt="图片" style="max-width: 100%;">`;(U=s.value)==null||U.dangerouslyInsertHtml(z)}else{const z=`<video src="${I}" controls style="max-width: 100%;"></video>`;(Q=s.value)==null||Q.dangerouslyInsertHtml(z)}f.value=null,g.value=""}})},{immediate:!1});function h(I){return class{constructor(){ra(this,"title");ra(this,"tag");ra(this,"iconSvg");this.title="上传图片",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>'}isActive(){return!1}getValue(){return""}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传图片菜单"),I("img")})}}}function p(I){return class{constructor(){ra(this,"title");ra(this,"tag");ra(this,"iconSvg");this.title="上传视频",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>'}getValue(){return""}isActive(){return!1}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传视频菜单"),I("video")})}}}const A={toolbarKeys:["headerSelect","bold","italic","through","underline","color","fontSize","lineHeight","delIndent","indent","divider","insertTable","justifyCenter","justifyJustify","justifyLeft","justifyRight","bulletedList","numberedList","undo","redo","clearStyle","codeBlock"]},E=["#0032A0","#FF0044","#FF8200","#001E60","#E3E3E6","#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E8E8E8","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],x={placeholder:a.placeholder,readOnly:a.disabled,maxLength:a.maxLength,MENU_CONF:{color:{colors:E},bgColor:{colors:E}},hoverbarKeys:{text:{menuKeys:["headerSelect","insertLink","bold","italic","underline","through","clearStyle"]}}},b=Math.random().toString(36).substring(2,9),C=`CustomImageMenu_${b}`,D=`CustomVideoMenu_${b}`,S=I=>{s.value=I;try{const L=h(m),U=p(m),Q={key:C,factory(){return new L}},H={key:D,factory(){return new U}};Xh.Boot.registerMenu(Q),Xh.Boot.registerMenu(H)}catch(L){console.warn("菜单注册失败:",L)}A.insertKeys={index:0,keys:[C,D]},i("created",I)};e.onBeforeUnmount(()=>{const I=s.value;I!=null&&I.destroy()}),e.watch(()=>a.modelValue,I=>{I!==r.value&&(r.value=I||"")},{immediate:!0});const w=I=>{i("update:modelValue",r.value),i("change",I)},V=()=>{s.value=void 0},P=I=>{i("focus",I)},k=I=>{i("blur",I)};return t({editor:s,getHtml:()=>r.value,getText:()=>{var I;return((I=s.value)==null?void 0:I.getText())||""},isEmpty:()=>{var I;return((I=s.value)==null?void 0:I.isEmpty())||!0},clear:()=>{var I;return(I=s.value)==null?void 0:I.clear()},focus:()=>{var I;return(I=s.value)==null?void 0:I.focus()},blur:()=>{var I;return(I=s.value)==null?void 0:I.blur()},disable:()=>{var I;return(I=s.value)==null?void 0:I.disable()},enable:()=>{var I;return(I=s.value)==null?void 0:I.enable()}}),(I,L)=>(e.openBlock(),e.createElementBlock("div",Cde,[e.createVNode(e.unref(Wh.Toolbar),{class:"editor-toolbar",editor:s.value,defaultConfig:A,mode:n.mode},null,8,["editor","mode"]),e.createVNode(e.unref(Wh.Editor),{class:"editor-content",style:e.normalizeStyle({height:l.value}),modelValue:r.value,"onUpdate:modelValue":L[0]||(L[0]=U=>r.value=U),defaultConfig:x,mode:n.mode,onOnCreated:S,onOnChange:w,onOnDestroyed:V,onOnFocus:P,onOnBlur:k},null,8,["style","modelValue","mode"])]))}}),[["__scopeId","data-v-e97d4bf7"]])},Symbol.toStringTag,{value:"Module"}));le.AccordionText=Mc,le.AccordionTextPlugin=rde,le.AlummiCommunityList=id,le.AlummiCommunityListPlugin=vre,le.AnimationUtils=Q2,le.ArticleItem=Tr,le.ArticleItemPlugin=bre,le.ArticleList=yl,le.ArticleListPlugin=ore,le.ArticleListPureText=ad,le.ArticleListPureTextPlugin=_re,le.BackgroundWrapper=Nc,le.BackgroundWrapperPlugin=cde,le.BannerImage=vs,le.BannerImagePlugin=are,le.BannerImageWithLink=zr,le.BannerImageWithLinkPlugin=Vre,le.BannerPage=js,le.BannerPagePlugin=ire,le.BannerQuote=Nr,le.BannerQuotePlugin=wre,le.BasicCollapse=Xr,le.BasicCollapsePlugin=Qre,le.BlessingMessage=ld,le.BlessingMessagePlugin=jre,le.BlessingSlider=sd,le.BlessingSliderPlugin=qre,le.BtnList=Cl,le.BtnListPlugin=lre,le.CardCarousel=Dr,le.CardCarouselArticles=$r,le.CardCarouselArticlesPlugin=Pre,le.CardCarouselMultiRow=Sr,le.CardCarouselMultiRowArticles=ed,le.CardCarouselMultiRowArticlesPlugin=Rre,le.CardCarouselMultiRowPlugin=Cre,le.CardCarouselMultiRowPublications=ud,le.CardCarouselMultiRowPublicationsPlugin=Wre,le.CardCarouselPlugin=yre,le.CardListCircle=fd,le.CardListCirclePlugin=nde,le.CardListProgramme=gd,le.CardListProgrammePlugin=tde,le.CardListSchool=Ad,le.CardListSchoolPlugin=ode,le.CardShowcase=rd,le.CardShowcasePlugin=Yre,le.CardShowcaseProfile=Or,le.CardShowcaseProfilePlugin=nre,le.CarouselLogo=Yr,le.CarouselLogoPlugin=Ire,le.CollapseCustom=Pc,le.CollapseCustomPlugin=mde,le.ContactUsInfo=vr,le.ContactUsInfoPlugin=Sre,le.ContactUsList=Fr,le.ContactUsListPlugin=Bre,le.CountDown=Qr,le.CountDownPlugin=Ere,le.CustomIframe=Ur,le.CustomIframePlugin=xre,le.CustomSpace=Cr,le.CustomSpacePlugin=ure,le.CustomText=td,le.CustomTextPlugin=Xre,le.DetailLink=yd,le.DetailLinkPlugin=ide,le.Disc=Wr,le.DiscPlugin=Ore,le.DonorLinks=kr,le.DonorLinksPlugin=Are,le.ExploreLinks=dd,le.ExploreLinksPlugin=Gre,le.GalleryBlock=_r,le.GalleryBlockPlugin=zre,le.GalleryCaptionRound=Ys,le.GalleryCaptionRoundPlugin=rre,le.GalleryDefault=qs,le.GalleryDefaultPlugin=sre,le.GalleryList=Er,le.GalleryListPlugin=hre,le.GalleryTimeline=gr,le.GalleryTimelineCol=Ar,le.GalleryTimelineColPlugin=cre,le.GalleryTimelinePlugin=dre,le.GridLinks=Ih,le.HeroSlide=xr,le.HeroSlidePlugin=pre,le.HtmlItem=Lc,le.HtmlItemPlugin=hde,le.InformationLink=kc,le.InformationLinkPlugin=lde,le.LinkList=Vr,le.LinkListPlugin=fre,le.MapStatic=qr,le.MapStaticPlugin=Tre,le.MediaImageFull=nd,le.MediaImageFullPlugin=Jre,le.MediaImageStatic=od,le.MediaImageStaticPlugin=Zre,le.MediaLogo=Hl,le.MediaLogoPlugin=Fre,le.MediaVideo=Bc,le.MediaVideoPlugin=ade,le.NewsList=Mr,le.NewsListPlugin=ere,le.Process=yr,le.ProcessPlugin=mre,le.Publications=jr,le.PublicationsPlugin=Nre,le.QuoteText=Br,le.QuoteTextPlugin=gre,le.RegisterForm=Zr,le.RegisterFormPlugin=Hre,le.Resources=Gr,le.ResourcesPlugin=Mre,le.ResourcesTwo=Kr,le.ResourcesTwoPlugin=Lre,le.ResponsiveUtils=gde,le.RibbonBlock=Pr,le.RibbonBlockPlugin=_se,le.SchoolLayout=md,le.SchoolLayoutPlugin=Kre,le.ScrollKeyInfo=Rr,le.ScrollKeyInfoPlugin=Dre,le.StorageUtils=Ade,le.TabDefault=hd,le.TabDefaultPlugin=$re,le.TabLogo=Sc,le.TabLogoPlugin=dde,le.TabPage=Dc,le.TabPagePlugin=sde,le.TabTimeLine=pd,le.TabTimeLinePlugin=ede,le.TableCollapse=Jr,le.TableCollapsePlugin=Ure,le.TableTwo=Hr,le.TableTwoPlugin=kre,le.TheHistoryCarousel=Lr,le.TheHistoryCarouselPlugin=tre,le.ThemeUtils=fde,le.TimelineStory=Ir,le.TimelineStoryPlugin=$se,le.VrTour=Ic,le.VrTourPlugin=ude,le.VueScreenPlugin=tp,le.default=yde,le.useTheme=pde,le.useVueScreen=ep,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
537
|
+
`,l++,r=f}),this.end_=r,this.storage_=i,this.diagnostics_=s}calculateBaseTime_(t,o,a){if(!this.storage_.size)return 0;if(this.storage_.has(t))return this.storage_.get(t).segmentSyncInfo.start;const i=Math.min(...this.storage_.keys());if(t<i){const s=i-t;let r=this.storage_.get(i).segmentSyncInfo.start;for(let l=0;l<s;l++){const d=o[l];r-=d.duration}return r}return a}isReliablePlaylist_(t,o){return t!=null&&Array.isArray(o)&&o.length}}class i2 extends a2{constructor(t){super(),this.parent_=t}calculateBaseTime_(t,o,a){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(t);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(t,o,a)}}const tne=86400,Nh=[{name:"VOD",run:(n,t,o,a,i)=>o!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(n,t,o,a,i,s)=>{const r=n.getMediaSequenceSync(s);if(!r||!r.isReliable)return null;const l=r.getSyncInfoForTime(i);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(n,t,o,a,i)=>{if(!Object.keys(n.timelineToDatetimeMappings).length)return null;let s=null,r=null;const l=uh(t);i=i||0;for(let d=0;d<l.length;d++){const c=t.endList||i===0?d:l.length-(d+1),u=l[c],g=u.segment,f=n.timelineToDatetimeMappings[g.timeline];if(!f||!g.dateTimeObject)continue;let h=g.dateTimeObject.getTime()/1e3+f;if(g.parts&&typeof u.partIndex=="number")for(let A=0;A<u.partIndex;A++)h+=g.parts[A].duration;const p=Math.abs(i-h);if(r!==null&&(p===0||r<p))break;r=p,s={time:h,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}return s}},{name:"Segment",run:(n,t,o,a,i)=>{let s=null,r=null;i=i||0;const l=uh(t);for(let d=0;d<l.length;d++){const c=t.endList||i===0?d:l.length-(d+1),u=l[c],g=u.segment,f=u.part&&u.part.start||g&&g.start;if(g.timeline===a&&typeof f<"u"){const m=Math.abs(i-f);if(r!==null&&r<m)break;(!s||r===null||r>=m)&&(r=m,s={time:f,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return s}},{name:"Discontinuity",run:(n,t,o,a,i)=>{let s=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let r=null;for(let l=0;l<t.discontinuityStarts.length;l++){const d=t.discontinuityStarts[l],c=t.discontinuitySequence+l+1,u=n.discontinuities[c];if(u){const g=Math.abs(i-u.time);if(r!==null&&r<g)break;(!s||r===null||r>=g)&&(r=g,s={time:u.time,segmentIndex:d,partIndex:null})}}}return s}},{name:"Playlist",run:(n,t,o,a,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class nne extends se.EventTarget{constructor(t={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const o=new a2,a=new i2(o),i=new i2(o);this.mediaSequenceStorage_={main:o,audio:a,vtt:i},this.logger_=lo("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,o,a,i,s){if(o!==1/0)return Nh.find(({name:d})=>d==="VOD").run(this,t,o);const r=this.runStrategies_(t,o,a,i,s);if(!r.length)return null;for(const l of r){const{syncPoint:d,strategy:c}=l,{segmentIndex:u,time:g}=d;if(u<0)continue;const f=t.segments[u],m=g,h=m+f.duration;if(this.logger_(`Strategy: ${c}. Current time: ${i}. selected segment: ${u}. Time: [${m} -> ${h}]}`),i>=m&&i<h)return this.logger_("Found sync point with exact match: ",d),d}return this.selectSyncPoint_(r,{key:"time",value:i})}getExpiredTime(t,o){if(!t||!t.segments)return null;const a=this.runStrategies_(t,o,t.discontinuitySequence,0);if(!a.length)return null;const i=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+Cs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(t,o,a,i,s){const r=[];for(let l=0;l<Nh.length;l++){const d=Nh[l],c=d.run(this,t,o,a,i,s);c&&(c.strategy=d.name,r.push({strategy:d.name,syncPoint:c}))}return r}selectSyncPoint_(t,o){let a=t[0].syncPoint,i=Math.abs(t[0].syncPoint[o.key]-o.value),s=t[0].strategy;for(let r=1;r<t.length;r++){const l=Math.abs(t[r].syncPoint[o.key]-o.value);l<i&&(i=l,a=t[r].syncPoint,s=t[r].strategy)}return this.logger_(`syncPoint for [${o.key}: ${o.value}] chosen with strategy [${s}]: [time:${a.time}, segmentIndex:${a.segmentIndex}`+(typeof a.partIndex=="number"?`,partIndex:${a.partIndex}`:"")+"]"),a}saveExpiredSegmentInfo(t,o){const a=o.mediaSequence-t.mediaSequence;if(a>tne){se.log.warn(`Not saving expired segment info. Media sequence gap ${a} is too large.`);return}for(let i=a-1;i>=0;i--){const s=t.segments[i];if(s&&typeof s.start<"u"){o.syncInfo={mediaSequence:t.mediaSequence+i,time:s.start},this.logger_(`playlist refresh sync: [time:${o.syncInfo.time}, mediaSequence: ${o.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const o=t.segments[0],a=o.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[o.timeline]=-a}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:o}){const a=this.calculateSegmentTimeMapping_(t,t.timingInfo,o),i=t.segment;a&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));const s=i.dateTimeObject;i.discontinuity&&o&&s&&(this.timelineToDatetimeMappings[i.timeline]=-(s.getTime()/1e3))}timestampOffsetForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].time}mappingForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].mapping}calculateSegmentTimeMapping_(t,o,a){const i=t.segment,s=t.part;let r=this.timelines[t.timeline],l,d;if(typeof t.timestampOffset=="number")r={time:t.startOfSegment,mapping:t.startOfSegment-o.start},a&&(this.timelines[t.timeline]=r,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${t.timeline}: [time: ${r.time}] [mapping: ${r.mapping}]`)),l=t.startOfSegment,d=o.end+r.mapping;else if(r)l=o.start+r.mapping,d=o.end+r.mapping;else return!1;return s&&(s.start=l,s.end=d),(!i.start||l<i.start)&&(i.start=l),i.end=d,!0}saveDiscontinuitySyncInfo_(t){const o=t.playlist,a=t.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(o.discontinuityStarts&&o.discontinuityStarts.length)for(let i=0;i<o.discontinuityStarts.length;i++){const s=o.discontinuityStarts[i],r=o.discontinuitySequence+i+1,l=s-t.mediaIndex,d=Math.abs(l);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>d){let c;l<0?c=a.start-Cs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex,endIndex:s}):c=a.end+Cs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex+1,endIndex:s}),this.discontinuities[r]={time:c,accuracy:d}}}}dispose(){this.trigger("dispose"),this.off()}}class one extends se.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:o,to:a}){return typeof o=="number"&&typeof a=="number"&&(this.pendingTimelineChanges_[t]={type:t,from:o,to:a},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:o,to:a}){if(typeof o=="number"&&typeof a=="number"){this.lastTimelineChanges_[t]={type:t,from:o,to:a},delete this.pendingTimelineChanges_[t];const i={timelineChangeInfo:{from:o,to:a}};this.trigger({type:"timelinechange",metadata:i})}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ane=Py(Iy(function(){var n=function(){function p(){this.listeners={}}var A=p.prototype;return A.on=function(x,b){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push(b)},A.off=function(x,b){if(!this.listeners[x])return!1;var C=this.listeners[x].indexOf(b);return this.listeners[x]=this.listeners[x].slice(0),this.listeners[x].splice(C,1),C>-1},A.trigger=function(x){var b=this.listeners[x];if(b)if(arguments.length===2)for(var C=b.length,D=0;D<C;++D)b[D].call(this,arguments[1]);else for(var S=Array.prototype.slice.call(arguments,1),w=b.length,V=0;V<w;++V)b[V].apply(this,S)},A.dispose=function(){this.listeners={}},A.pipe=function(x){this.on("data",function(b){x.push(b)})},p}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function t(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const o=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],A=p[0],E=p[1],x=A[4],b=E[4];let C,D,S;const w=[],V=[];let P,k,I,L,U,Q;for(C=0;C<256;C++)V[(w[C]=C<<1^(C>>7)*283)^C]=C;for(D=S=0;!x[D];D^=P||1,S=V[S]||1)for(L=S^S<<1^S<<2^S<<3^S<<4,L=L>>8^L&255^99,x[D]=L,b[L]=D,I=w[k=w[P=w[D]]],Q=I*16843009^k*65537^P*257^D*16843008,U=w[L]*257^L*16843008,C=0;C<4;C++)A[C][D]=U=U<<24^U>>>8,E[C][L]=Q=Q<<24^Q>>>8;for(C=0;C<5;C++)A[C]=A[C].slice(0),E[C]=E[C].slice(0);return p};let a=null;class i{constructor(A){a||(a=o()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];let E,x,b;const C=this._tables[0][4],D=this._tables[1],S=A.length;let w=1;if(S!==4&&S!==6&&S!==8)throw new Error("Invalid aes key size");const V=A.slice(0),P=[];for(this._key=[V,P],E=S;E<4*S+28;E++)b=V[E-1],(E%S===0||S===8&&E%S===4)&&(b=C[b>>>24]<<24^C[b>>16&255]<<16^C[b>>8&255]<<8^C[b&255],E%S===0&&(b=b<<8^b>>>24^w<<24,w=w<<1^(w>>7)*283)),V[E]=V[E-S]^b;for(x=0;E;x++,E--)b=V[x&3?E:E-4],E<=4||x<4?P[x]=b:P[x]=D[0][C[b>>>24]]^D[1][C[b>>16&255]]^D[2][C[b>>8&255]]^D[3][C[b&255]]}decrypt(A,E,x,b,C,D){const S=this._key[1];let w=A^S[0],V=b^S[1],P=x^S[2],k=E^S[3],I,L,U;const Q=S.length/4-2;let H,z=4;const K=this._tables[1],J=K[0],j=K[1],O=K[2],v=K[3],W=K[4];for(H=0;H<Q;H++)I=J[w>>>24]^j[V>>16&255]^O[P>>8&255]^v[k&255]^S[z],L=J[V>>>24]^j[P>>16&255]^O[k>>8&255]^v[w&255]^S[z+1],U=J[P>>>24]^j[k>>16&255]^O[w>>8&255]^v[V&255]^S[z+2],k=J[k>>>24]^j[w>>16&255]^O[V>>8&255]^v[P&255]^S[z+3],z+=4,w=I,V=L,P=U;for(H=0;H<4;H++)C[(3&-H)+D]=W[w>>>24]<<24^W[V>>16&255]<<16^W[P>>8&255]<<8^W[k&255]^S[z++],I=w,w=V,V=P,P=k,k=I}}class s extends n{constructor(){super(n),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const r=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},l=function(p,A,E){const x=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),b=new i(Array.prototype.slice.call(A)),C=new Uint8Array(p.byteLength),D=new Int32Array(C.buffer);let S,w,V,P,k,I,L,U,Q;for(S=E[0],w=E[1],V=E[2],P=E[3],Q=0;Q<x.length;Q+=4)k=r(x[Q]),I=r(x[Q+1]),L=r(x[Q+2]),U=r(x[Q+3]),b.decrypt(k,I,L,U,D,Q),D[Q]=r(D[Q]^S),D[Q+1]=r(D[Q+1]^w),D[Q+2]=r(D[Q+2]^V),D[Q+3]=r(D[Q+3]^P),S=k,w=I,V=L,P=U;return C};class d{constructor(A,E,x,b){const C=d.STEP,D=new Int32Array(A.buffer),S=new Uint8Array(A.byteLength);let w=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(D.subarray(w,w+C),E,x,S)),w=C;w<D.length;w+=C)x=new Uint32Array([r(D[w-4]),r(D[w-3]),r(D[w-2]),r(D[w-1])]),this.asyncStream_.push(this.decryptChunk_(D.subarray(w,w+C),E,x,S));this.asyncStream_.push(function(){b(null,t(S))})}static get STEP(){return 32e3}decryptChunk_(A,E,x,b){return function(){const C=l(A,E,x);b.set(C,A.byteOffset)}}}var c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},u;typeof window<"u"?u=window:typeof c<"u"?u=c:typeof self<"u"?u=self:u={};var g=u,f=function(A){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(A):A&&A.buffer instanceof ArrayBuffer},m=g.BigInt||Number;m("0x1"),m("0x100"),m("0x10000"),m("0x1000000"),m("0x100000000"),m("0x10000000000"),m("0x1000000000000"),m("0x100000000000000"),m("0x10000000000000000"),function(){var p=new Uint16Array([65484]),A=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return A[0]===255?"big":A[0]===204?"little":"unknown"}();const h=function(p){const A={};return Object.keys(p).forEach(E=>{const x=p[E];f(x)?A[E]={bytes:x.buffer,byteOffset:x.byteOffset,byteLength:x.byteLength}:A[E]=x}),A};self.onmessage=function(p){const A=p.data,E=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),x=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),b=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new d(E,x,b,function(C,D){self.postMessage(h({source:A.source,decrypted:D}),[D.buffer])})}}));var ine=Ty(ane);const lne=n=>{let t=n.default?"main":"alternative";return n.characteristics&&n.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},l2=(n,t)=>{n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Th=(n,t)=>{t.activePlaylistLoader=n,n.load()},sne=(n,t)=>()=>{const{segmentLoaders:{[n]:o,main:a},mediaTypes:{[n]:i}}=t,s=i.activeTrack(),r=i.getActiveGroup(),l=i.activePlaylistLoader,d=i.lastGroup_;if(!(r&&d&&r.id===d.id)&&(i.lastGroup_=r,i.lastTrack_=s,l2(o,i),!(!r||r.isMainPlaylist))){if(!r.playlistLoader){l&&a.resetEverything();return}o.resyncLoader(),Th(r.playlistLoader,i)}},rne=(n,t)=>()=>{const{segmentLoaders:{[n]:o},mediaTypes:{[n]:a}}=t;a.lastGroup_=null,o.abort(),o.pause()},dne=(n,t)=>()=>{const{mainPlaylistLoader:o,segmentLoaders:{[n]:a,main:i},mediaTypes:{[n]:s}}=t,r=s.activeTrack(),l=s.getActiveGroup(),d=s.activePlaylistLoader,c=s.lastTrack_;if(!(c&&r&&c.id===r.id)&&(s.lastGroup_=l,s.lastTrack_=r,l2(a,s),!!l)){if(l.isMainPlaylist){if(!r||!c||r.id===c.id)return;const u=t.vhs.playlistController_,g=u.selectPlaylist();if(u.media()===g)return;s.logger_(`track change. Switching main audio from ${c.id} to ${r.id}`),o.pause(),i.resetEverything(),u.fastQualityChange_(g);return}if(n==="AUDIO"){if(!l.playlistLoader){i.setAudio(!0),i.resetEverything();return}a.setAudio(!0),i.setAudio(!1)}if(d===l.playlistLoader){Th(l.playlistLoader,s);return}a.track&&a.track(r),a.resetEverything(),Th(l.playlistLoader,s)}},xc={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:o},excludePlaylist:a}=t,i=o.activeTrack(),s=o.activeGroup(),r=(s.filter(d=>d.default)[0]||s[0]).id,l=o.tracks[r];if(i===l){a({error:{message:"Problem encountered loading the default audio track."}});return}se.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const d in o.tracks)o.tracks[d].enabled=o.tracks[d]===l;o.onTrackChanged()},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:o}}=t;se.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const a=o.activeTrack();a&&(a.mode="disabled"),o.onTrackChanged()}},s2={AUDIO:(n,t,o)=>{if(!t)return;const{tech:a,requestOptions:i,segmentLoaders:{[n]:s}}=o;t.on("loadedmetadata",()=>{const r=t.media();s.playlist(r,i),(!a.paused()||r.endList&&a.preload()!=="none")&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),i),a.paused()||s.load()}),t.on("error",xc[n](n,o))},SUBTITLES:(n,t,o)=>{const{tech:a,requestOptions:i,segmentLoaders:{[n]:s},mediaTypes:{[n]:r}}=o;t.on("loadedmetadata",()=>{const l=t.media();s.playlist(l,i),s.track(r.activeTrack()),(!a.paused()||l.endList&&a.preload()!=="none")&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),i),a.paused()||s.load()}),t.on("error",xc[n](n,o))}},cne={AUDIO:(n,t)=>{const{vhs:o,sourceType:a,segmentLoaders:{[n]:i},requestOptions:s,main:{mediaGroups:r},mediaTypes:{[n]:{groups:l,tracks:d,logger_:c}},mainPlaylistLoader:u}=t,g=ws(u.main);(!r[n]||Object.keys(r[n]).length===0)&&(r[n]={main:{default:{default:!0}}},g&&(r[n].main.default.playlists=u.main.playlists));for(const f in r[n]){l[f]||(l[f]=[]);for(const m in r[n][f]){let h=r[n][f][m],p;if(g?(c(`AUDIO group '${f}' label '${m}' is a main playlist`),h.isMainPlaylist=!0,p=null):a==="vhs-json"&&h.playlists?p=new ll(h.playlists[0],o,s):h.resolvedUri?p=new ll(h.resolvedUri,o,s):h.playlists&&a==="dash"?p=new bh(h.playlists[0],o,s,u):p=null,h=rt({id:m,playlistLoader:p},h),s2[n](n,h.playlistLoader,t),l[f].push(h),typeof d[m]>"u"){const A=new se.AudioTrack({id:m,kind:lne(h),enabled:!1,language:h.language,default:h.default,label:m});d[m]=A}}}i.on("error",xc[n](n,t))},SUBTITLES:(n,t)=>{const{tech:o,vhs:a,sourceType:i,segmentLoaders:{[n]:s},requestOptions:r,main:{mediaGroups:l},mediaTypes:{[n]:{groups:d,tracks:c}},mainPlaylistLoader:u}=t;for(const g in l[n]){d[g]||(d[g]=[]);for(const f in l[n][g]){if(!a.options_.useForcedSubtitles&&l[n][g][f].forced)continue;let m=l[n][g][f],h;if(i==="hls")h=new ll(m.resolvedUri,a,r);else if(i==="dash"){if(!m.playlists.filter(A=>A.excludeUntil!==1/0).length)return;h=new bh(m.playlists[0],a,r,u)}else i==="vhs-json"&&(h=new ll(m.playlists?m.playlists[0]:m.resolvedUri,a,r));if(m=rt({id:f,playlistLoader:h},m),s2[n](n,m.playlistLoader,t),d[g].push(m),typeof c[f]>"u"){const p=o.addRemoteTextTrack({id:f,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:f},!1).track;c[f]=p}}}s.on("error",xc[n](n,t))},"CLOSED-CAPTIONS":(n,t)=>{const{tech:o,main:{mediaGroups:a},mediaTypes:{[n]:{groups:i,tracks:s}}}=t;for(const r in a[n]){i[r]||(i[r]=[]);for(const l in a[n][r]){const d=a[n][r][l];if(!/^(?:CC|SERVICE)/.test(d.instreamId))continue;const c=o.options_.vhs&&o.options_.vhs.captionServices||{};let u={label:l,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(c[u.instreamId]&&(u=rt(u,c[u.instreamId])),u.default===void 0&&delete u.default,i[r].push(rt({id:l},d)),typeof s[l]>"u"){const g=o.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;s[l]=g}}}}},r2=(n,t)=>{for(let o=0;o<n.length;o++)if(fh(t,n[o])||n[o].playlists&&r2(n[o].playlists,t))return!0;return!1},mne=(n,t)=>o=>{const{mainPlaylistLoader:a,mediaTypes:{[n]:{groups:i}}}=t,s=a.media();if(!s)return null;let r=null;s.attributes[n]&&(r=i[s.attributes[n]]);const l=Object.keys(i);if(!r)if(n==="AUDIO"&&l.length>1&&ws(t.main))for(let d=0;d<l.length;d++){const c=i[l[d]];if(r2(c,s)){r=c;break}}else i.main?r=i.main:l.length===1&&(r=i[l[0]]);return typeof o>"u"?r:o===null||!r?null:r.filter(d=>d.id===o.id)[0]||null},une={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].enabled)return o[a];return null},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].mode==="showing"||o[a].mode==="hidden")return o[a];return null}},hne=(n,{mediaTypes:t})=>()=>{const o=t[n].activeTrack();return o?t[n].activeGroup(o):null},pne=n=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(c=>{cne[c](c,n)});const{mediaTypes:t,mainPlaylistLoader:o,tech:a,vhs:i,segmentLoaders:{["AUDIO"]:s,main:r}}=n;["AUDIO","SUBTITLES"].forEach(c=>{t[c].activeGroup=mne(c,n),t[c].activeTrack=une[c](c,n),t[c].onGroupChanged=sne(c,n),t[c].onGroupChanging=rne(c,n),t[c].onTrackChanged=dne(c,n),t[c].getActiveGroup=hne(c,n)});const l=t.AUDIO.activeGroup();if(l){const c=(l.filter(g=>g.default)[0]||l[0]).id;t.AUDIO.tracks[c].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(r.setAudio(!1),s.setAudio(!0)):r.setAudio(!0)}o.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(c=>t[c].onGroupChanged())}),o.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(c=>t[c].onGroupChanging())});const d=()=>{t.AUDIO.onTrackChanged(),a.trigger({type:"usage",name:"vhs-audio-change"})};a.audioTracks().addEventListener("change",d),a.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",()=>{a.audioTracks().removeEventListener("change",d),a.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),a.clearTracks("audio");for(const c in t.AUDIO.tracks)a.audioTracks().addTrack(t.AUDIO.tracks[c])},fne=()=>{const n={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{n[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:na,activeTrack:na,getActiveGroup:na,onGroupChanged:na,onTrackChanged:na,lastTrack_:null,logger_:lo(`MediaGroups[${t}]`)}}),n};class d2{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(t){t===1&&(this.version_=t)}set ttl(t){this.ttl_=t||300}set reloadUri(t){t&&(this.reloadUri_=In(this.reloadUri_,t))}set priority(t){t&&t.length&&(this.priority_=t)}set pathwayClones(t){t&&t.length&&(this.pathwayClones_=new Map(t.map(o=>[o.ID,o])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class gne extends se.EventTarget{constructor(t,o){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new d2,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=lo("Content Steering"),this.xhr_=t,this.getBandwidth_=o}assignTagProperties(t,o){this.manifestType_=o.serverUri?"HLS":"DASH";const a=o.serverUri||o.serverURL;if(!a){this.logger_(`steering manifest URL is ${a}, cannot request steering manifest.`),this.trigger("error");return}if(a.startsWith("data:")){this.decodeDataUriManifest_(a.substring(a.indexOf(",")+1));return}this.steeringManifest.reloadUri=In(t,a),this.defaultPathway=o.pathwayId||o.defaultServiceLocation,this.queryBeforeStart=o.queryBeforeStart,this.proxyServerUrl_=o.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(t){const o=this.steeringManifest.reloadUri;if(!o)return;const a=t?o:this.getRequestURI(o);if(!a){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const i={contentSteeringInfo:{uri:a}};this.trigger({type:"contentsteeringloadstart",metadata:i}),this.request_=this.xhr_({uri:a,requestType:"content-steering-manifest"},(s,r)=>{if(s){if(r.status===410){this.logger_(`manifest request 410 ${s}.`),this.logger_(`There will be no more content steering requests to ${a} this session.`),this.excludedSteeringManifestURLs.add(a);return}if(r.status===429){const c=r.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${s}.`),this.logger_(`content steering will retry in ${c} seconds.`),this.startTTLTimeout_(parseInt(c,10));return}this.logger_(`manifest failed to load ${s}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:i});let l;try{l=JSON.parse(this.request_.responseText)}catch(c){const u={errorType:se.Error.StreamingContentSteeringParserError,error:c};this.trigger({type:"error",metadata:u})}this.assignSteeringProperties_(l);const d={contentSteeringInfo:i.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:d}),this.startTTLTimeout_()})}setProxyServerUrl_(t){const o=new _.URL(t),a=new _.URL(this.proxyServerUrl_);return a.searchParams.set("url",encodeURI(o.toString())),this.setSteeringParams_(a.toString())}decodeDataUriManifest_(t){const o=JSON.parse(_.atob(t));this.assignSteeringProperties_(o)}setSteeringParams_(t){const o=new _.URL(t),a=this.getPathway(),i=this.getBandwidth_();if(a){const s=`_${this.manifestType_}_pathway`;o.searchParams.set(s,a)}if(i){const s=`_${this.manifestType_}_throughput`;o.searchParams.set(s,i)}return o.toString()}assignSteeringProperties_(t){if(this.steeringManifest.version=t.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=t.TTL,this.steeringManifest.reloadUri=t["RELOAD-URI"],this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const a=(i=>{for(const s of i)if(this.availablePathways_.has(s))return s;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==a&&(this.currentPathway=a,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t)return null;const o=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!o(i))return i}const a=this.setSteeringParams_(t);return o(a)?null:a}startTTLTimeout_(t=this.steeringManifest.ttl){const o=t*1e3;this.ttlTimeout_=_.setTimeout(()=>{this.requestSteeringManifest()},o)}clearTTLTimeout_(){_.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new d2}addAvailablePathway(t){t&&this.availablePathways_.add(t)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,o){return!o&&this.steeringManifest.reloadUri||o&&(In(t,o.serverURL)!==this.steeringManifest.reloadUri||o.defaultServiceLocation!==this.defaultPathway||o.queryBeforeStart!==this.queryBeforeStart||o.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Ane=(n,t)=>{let o=null;return(...a)=>{clearTimeout(o),o=setTimeout(()=>{n.apply(null,a)},t)}},yne=10;let Ba;const Cne=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],wne=function(n){return this.audioSegmentLoader_[n]+this.mainSegmentLoader_[n]},bne=function({currentPlaylist:n,buffered:t,currentTime:o,nextPlaylist:a,bufferLowWaterLine:i,bufferHighWaterLine:s,duration:r,bufferBasedABR:l,log:d}){if(!a)return se.log.warn("We received no playlist to switch to. Please check your stream."),!1;const c=`allowing switch ${n&&n.id||"null"} -> ${a.id}`;if(!n)return d(`${c} as current playlist is not set`),!0;if(a.id===n.id)return!1;const u=!!ol(t,o).length;if(!n.endList)return!u&&typeof n.partTargetDuration=="number"?(d(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(d(`${c} as current playlist is live`),!0);const g=ch(t,o),f=l?Wt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Wt.MAX_BUFFER_LOW_WATER_LINE;if(r<f)return d(`${c} as duration < max low water line (${r} < ${f})`),!0;const m=a.attributes.BANDWIDTH,h=n.attributes.BANDWIDTH;if(m<h&&(!l||g<s)){let p=`${c} as next bandwidth < current bandwidth (${m} < ${h})`;return l&&(p+=` and forwardBuffer < bufferHighWaterLine (${g} < ${s})`),d(p),!0}if((!l||m>h)&&g>=i){let p=`${c} as forwardBuffer >= bufferLowWaterLine (${g} >= ${i})`;return l&&(p+=` and next bandwidth > current bandwidth (${m} > ${h})`),d(p),!0}return d(`not ${c} as no switching criteria met`),!1};class Ene extends se.EventTarget{constructor(t){super(),this.fastQualityChange_=Ane(this.fastQualityChange_.bind(this),100);const{src:o,withCredentials:a,tech:i,bandwidth:s,externVhs:r,useCueTags:l,playlistExclusionDuration:d,enableLowInitialPlaylist:c,sourceType:u,cacheEncryptionKeys:g,bufferBasedABR:f,leastPixelDiffSelector:m,captionServices:h,experimentalUseMMS:p}=t;if(!o)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:A}=t;(A===null||typeof A>"u")&&(A=1/0),Ba=r,this.bufferBasedABR=!!f,this.leastPixelDiffSelector=!!m,this.withCredentials=a,this.tech_=i,this.vhs_=i.vhs,this.player_=t.player_,this.sourceType_=u,this.useCueTags_=l,this.playlistExclusionDuration=d,this.maxPlaylistRetries=A,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:a,maxPlaylistRetries:A,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=fne(),p&&_.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new _.ManagedMediaSource,this.usingManagedMediaSource_=!0,se.log("Using ManagedMediaSource")):_.MediaSource&&(this.mediaSource=new _.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Kt(),this.hasPlayed_=!1,this.syncController_=new nne(t),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new ine,this.sourceUpdater_=new e2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new one,this.keyStatusMap_=new Map;const E={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:h,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new bh(o,this.vhs_,rt(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ll(o,this.vhs_,rt(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Dh(rt(E,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t),this.audioSegmentLoader_=new Dh(rt(E,{loaderType:"audio"}),t),this.subtitleSegmentLoader_=new Zte(rt(E,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((C,D)=>{function S(){i.off("vttjserror",w),C()}function w(){i.off("vttjsloaded",S),D()}i.one("vttjsloaded",S),i.one("vttjserror",w),i.addWebVttScript_()})}),t);const x=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new gne(this.vhs_.xhr,x),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Cne.forEach(C=>{this[C+"_"]=wne.bind(this,C)}),this.logger_=lo("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const b=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(b,()=>{const C=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-C,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_(),o=this.audioAppendsToLoadedData_();return t===-1||o===-1?-1:t+o}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const o=this.selectPlaylist();o&&this.shouldSwitchToMedia_(o)&&this.switchMedia_(o,t)}switchMedia_(t,o,a){const i=this.media(),s=i&&(i.id||i.uri),r=t&&(t.id||t.uri);if(s&&s!==r){this.logger_(`switch media ${s} -> ${r} from ${o}`);const l={renditionInfo:{id:r,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:o};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${o}`})}this.mainPlaylistLoader_.media(t,a)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{const o=this.mediaTypes_[t],a=o?o.activeGroup():null,i=this.contentSteeringController_.getPathway();if(a&&i){const r=(a.length?a[0].playlists:a.playlists).filter(l=>l.attributes.serviceLocation===i);r.length&&this.mediaTypes_[t].activePlaylistLoader.media(r[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=_.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(_.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const t=this.main(),o=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return o;const a=t.mediaGroups.AUDIO,i=Object.keys(a);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const l=a.main||i.length&&a[i[0]];for(const d in l)if(l[d].default){s={label:d};break}}if(!s)return o;const r=[];for(const l in a)if(a[l][s.label]){const d=a[l][s.label];if(d.playlists&&d.playlists.length)r.push.apply(r,d.playlists);else if(d.uri)r.push(d);else if(t.playlists.length)for(let c=0;c<t.playlists.length;c++){const u=t.playlists[c];u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===l&&r.push(u)}}return r.length?r:o}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;ph(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,o.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.mainSegmentLoader_.load()),pne({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),o),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let o=this.mainPlaylistLoader_.media();if(!o){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let a;if(this.enableLowInitialPlaylist&&(a=this.selectInitialPlaylist()),a||(a=this.selectPlaylist()),!a||!this.shouldSwitchToMedia_(a)||(this.initialMedia_=a,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;o=this.initialMedia_}this.handleUpdatedMediaPlaylist(o)}),this.mainPlaylistLoader_.on("error",()=>{const o=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:o.playlist,error:o})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;ph(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const o=this.mainPlaylistLoader_.media();if(o.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(o)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(o=>{this.mainPlaylistLoader_.on(o,a=>{this.player_.trigger(kt({},a))})})}handleUpdatedMediaPlaylist(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(t,o){const a=t.mediaGroups||{};let i=!0;const s=Object.keys(a.AUDIO);for(const r in a.AUDIO)for(const l in a.AUDIO[r])a.AUDIO[r][l].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(a.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ba.Playlist.isAes(o)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(a.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(t){const o=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),i=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),r=this.tech_.buffered();return bne({buffered:r,currentTime:a,currentPlaylist:o,nextPlaylist:t,bufferLowWaterLine:i,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const a=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:a.playlist,error:a})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const a=this.audioSegmentLoader_.pendingSegment_;if(!a||!a.segment||!a.segment.syncInfo)return;const i=a.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",a=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:yne}))});const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const a=this.getCodecsOrExclude_();a&&this.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(a=>{this.mainSegmentLoader_.on(a,i=>{this.player_.trigger(kt({},i))}),this.audioSegmentLoader_.on(a,i=>{this.player_.trigger(kt({},i))}),this.subtitleSegmentLoader_.on(a,i=>{this.player_.trigger(kt({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const t=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0))return this.tech_.setCurrentTime(t.end(t.length-1))}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList||t.start){const o=this.seekable();if(!o.length)return!1;const a=o.end(0);let i=a;if(t.start){const s=t.start.timeOffset;s<0?i=Math.max(a+s,o.start(0)):i=Math.min(a,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const t=this.tech_.play();typeof t<"u"&&typeof t.then=="function"&&t.then(null,o=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length)return;const o=this.duration();t[t.length-1].endTime=isNaN(o)||Math.abs(o)===1/0?Number.MAX_VALUE:o}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const o=this.mainSegmentLoader_.getCurrentMediaInfo_();!o||o.hasVideo?t=t&&this.audioSegmentLoader_.ended_:t=this.audioSegmentLoader_.ended_}t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(t){if(!this.seekable().length)return!1;const a=this.syncController_.getExpiredTime(t,this.duration());if(a===null)return!1;const i=Ba.Playlist.playlistEnd(t,a),s=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-s<=Oo;const l=r.end(r.length-1);return l-s<=Oo&&i-l<=Oo}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:o={},playlistExclusionDuration:a}){if(t=t||this.mainPlaylistLoader_.media(),a=a||o.playlistExclusionDuration||this.playlistExclusionDuration,!t){this.error=o,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}t.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,s=i.filter(Cc),r=s.length===1&&s[0]===t;if(i.length===1&&a!==1/0)return se.log.warn(`Problem encountered with playlist ${t.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const h=this.pathwayAttribute_(t),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(h),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(h)},p);return}let m=!1;i.forEach(h=>{if(h===t)return;const p=h.excludeUntil;typeof p<"u"&&p!==1/0&&(m=!0,delete h.excludeUntil)}),m&&(se.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;t.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+a*1e3,t.excludeUntil=l,o.reason&&(t.lastExcludeReason_=o.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const d=this.selectPlaylist();if(!d){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const c=o.internal?this.logger_:se.log.warn,u=o.message?" "+o.message:"";c(`${o.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.${u} Switching to playlist ${d.id}.`),d.attributes.AUDIO!==t.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),d.attributes.SUBTITLES!==t.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const g=d.targetDuration/2*1e3||5*1e3,f=typeof d.lastRequest=="number"&&Date.now()-d.lastRequest<=g;return this.switchMedia_(d,"exclude",r||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(t,o){const a=[],i=t==="all";(i||t==="main")&&a.push(this.mainPlaylistLoader_);const s=[];(i||t==="audio")&&s.push("AUDIO"),(i||t==="subtitle")&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(r=>{const l=this.mediaTypes_[r]&&this.mediaTypes_[r].activePlaylistLoader;l&&a.push(l)}),["main","audio","subtitle"].forEach(r=>{const l=this[`${r}SegmentLoader_`];l&&(t===r||t==="all")&&a.push(l)}),a.forEach(r=>o.forEach(l=>{typeof r[l]=="function"&&r[l]()}))}setCurrentTime(t){const o=ol(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(o&&o.length)return t;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const t=this.mainPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:Ba.Playlist.duration(t):1/0:0}seekable(){return this.seekable_}getSeekableRange_(t,o){const a=t.media();if(!a)return null;const i=this.syncController_.getMediaSequenceSync(o);if(i&&i.isReliable){const l=i.start,d=i.end;if(!isFinite(l)||!isFinite(d))return null;const c=Ba.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a),u=Math.max(l,d-c);return Kt([[l,u]])}const s=this.syncController_.getExpiredTime(a,this.duration());if(s===null)return null;const r=Ba.Playlist.seekable(a,s,Ba.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a));return r.length?r:null}computeFinalSeekable_(t,o){if(!o)return t;const a=t.start(0),i=t.end(0),s=o.start(0),r=o.end(0);return s>i||a>r?t:Kt([[Math.max(a,s),Math.min(i,r)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t)return;let o;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(o=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!o))return;const a=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,o),!this.seekable_||a&&a.length&&this.seekable_.length&&a.start(0)===this.seekable_.start(0)&&a.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${_0(this.seekable_)}]`);const i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const o=this.tech_.buffered();let a=Ba.Playlist.duration(this.mainPlaylistLoader_.media());o.length>0&&(a=Math.max(a,o.end(o.length-1))),this.mediaSource.duration!==a&&this.sourceUpdater_.setDuration(a)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(t=>{const o=this.mediaTypes_[t].groups;for(const a in o)o[a].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,o=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=t?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!o||!a)}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},o=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const a=Es(this.main(),o),i={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=a.video||t.main.videoCodec||GJ),t.main.isMuxed&&(i.video+=`,${a.audio||t.main.audioCodec||Wg}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||s)&&(i.audio=a.audio||t.main.audioCodec||t.audio.audioCodec||Wg,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:o,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const r=(c,u)=>c?Yl(u,this.usingManagedMediaSource_):qm(u),l={};let d;if(["video","audio"].forEach(function(c){if(i.hasOwnProperty(c)&&!r(t[c].isFmp4,i[c])){const u=t[c].isFmp4?"browser":"muxer";l[u]=l[u]||[],l[u].push(i[c]),c==="audio"&&(d=u)}}),s&&d&&o.attributes.AUDIO){const c=o.attributes.AUDIO;this.main().playlists.forEach(u=>{(u.attributes&&u.attributes.AUDIO)===c&&u!==o&&(u.excludeUntil=1/0)}),this.logger_(`excluding audio group ${c} as ${d} does not support codec(s): "${i.audio}"`)}if(Object.keys(l).length){const c=Object.keys(l).reduce((u,g)=>(u&&(u+=", "),u+=`${g} does not support codec(s): "${l[g].join(",")}"`,u),"")+".";this.excludePlaylist({playlistToExclude:o,error:{internal:!0,message:c},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const c=[];if(["video","audio"].forEach(u=>{const g=(ko(this.sourceUpdater_.codecs[u]||"")[0]||{}).type,f=(ko(i[u]||"")[0]||{}).type;g&&f&&g.toLowerCase()!==f.toLowerCase()&&c.push(`"${this.sourceUpdater_.codecs[u]}" -> "${i[u]}"`)}),c.length){this.excludePlaylist({playlistToExclude:o,error:{message:`Codec switching not supported: ${c.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const t=this.getCodecsOrExclude_();if(!t)return;this.sourceUpdater_.createSourceBuffers(t);const o=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(o)}excludeUnsupportedVariants_(){const t=this.main().playlists,o=[];Object.keys(t).forEach(a=>{const i=t[a];if(o.indexOf(i.id)!==-1)return;o.push(i.id);const s=Es(this.main,i),r=[];s.audio&&!qm(s.audio)&&!Yl(s.audio,this.usingManagedMediaSource_)&&r.push(`audio codec ${s.audio}`),s.video&&!qm(s.video)&&!Yl(s.video,this.usingManagedMediaSource_)&&r.push(`video codec ${s.video}`),s.text&&s.text==="stpp.ttml.im1t"&&r.push(`text codec ${s.text}`),r.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${r.join(", ")}`))})}excludeIncompatibleVariants_(t){const o=[],a=this.main().playlists,i=bs(ko(t)),s=gy(i),r=i.video&&ko(i.video)[0]||null,l=i.audio&&ko(i.audio)[0]||null;Object.keys(a).forEach(d=>{const c=a[d];if(o.indexOf(c.id)!==-1||c.excludeUntil===1/0)return;o.push(c.id);const u=[],g=Es(this.mainPlaylistLoader_.main,c),f=gy(g);if(!(!g.audio&&!g.video)){if(f!==s&&u.push(`codec count "${f}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const m=g.video&&ko(g.video)[0]||null,h=g.audio&&ko(g.audio)[0]||null;m&&r&&m.type.toLowerCase()!==r.type.toLowerCase()&&u.push(`video codec "${m.type}" !== "${r.type}"`),h&&l&&h.type.toLowerCase()!==l.type.toLowerCase()&&u.push(`audio codec "${h.type}" !== "${l.type}"`)}u.length&&(c.excludeUntil=1/0,this.logger_(`excluding ${c.id}: ${u.join(" && ")}`))}})}updateAdCues_(t){let o=0;const a=this.seekable();a.length&&(o=a.start(0)),$te(t,this.cueTagsTrack_,o)}goalBufferLength(){const t=this.tech_.currentTime(),o=Wt.GOAL_BUFFER_LENGTH,a=Wt.GOAL_BUFFER_LENGTH_RATE,i=Math.max(o,Wt.MAX_GOAL_BUFFER_LENGTH);return Math.min(o+t*a,i)}bufferLowWaterLine(){const t=this.tech_.currentTime(),o=Wt.BUFFER_LOW_WATER_LINE,a=Wt.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(o,Wt.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(o,Wt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(o+t*a,this.bufferBasedABR?s:i)}bufferHighWaterLine(){return Wt.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){Ky(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Ite({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,o,a){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Ky(this.inbandTextTracks_,t,this.tech_),Nte({inbandTextTracks:this.inbandTextTracks_,metadataArray:o,timestampOffset:i,videoDuration:a})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(t.contentSteering){for(const o of t.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(o));if(this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(o=>{this.contentSteeringController_.on(o,a=>{this.trigger(kt({},a))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const o=this.main();(this.contentSteeringController_.didDASHTagChange(o.uri,o.contentSteering)||(()=>{const s=this.contentSteeringController_.getAvailablePathways(),r=[];for(const l of o.playlists){const d=l.attributes.serviceLocation;if(d&&(r.push(d),!s.has(d)))return!0}return!!(!r.length&&s.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t)return;this.handlePathwayClones_();const a=this.main().playlists,i=new Set;let s=!1;Object.keys(a).forEach(r=>{const l=a[r],d=this.pathwayAttribute_(l),c=d&&t!==d;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!c&&(delete l.excludeUntil,delete l.lastExcludeReason_,s=!0);const g=!l.excludeUntil&&l.excludeUntil!==1/0;!i.has(l.id)&&c&&g&&(i.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(r=>{const l=this.mediaTypes_[r];if(l.activePlaylistLoader){const d=l.activePlaylistLoader.media_;d&&d.attributes.serviceLocation!==t&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const o=this.main().playlists,a=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(a&&a.size||i&&i.size){for(const[r,l]of a.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(r));for(const[r,l]of i.entries()){const d=a.get(r);if(!d){o.filter(u=>u.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(u=>{this.mainPlaylistLoader_.addClonePathway(l,u)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(d,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(t,o){if(t["BASE-ID"]!==o["BASE-ID"]||t.ID!==o.ID||t["URI-REPLACEMENT"].HOST!==o["URI-REPLACEMENT"].HOST)return!1;const a=t["URI-REPLACEMENT"].PARAMS,i=o["URI-REPLACEMENT"].PARAMS;for(const s in a)if(a[s]!==i[s])return!1;for(const s in i)if(a[s]!==i[s])return!1;return!0}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let t=0;const o="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=this.mainPlaylistLoader_.getKeyIdSet(a);!i||!i.size||i.forEach(s=>{const r="usable",l=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===r,d=a.lastExcludeReason_===o&&a.excludeUntil===1/0;l?l&&d&&(delete a.excludeUntil,delete a.lastExcludeReason_,this.logger_(`enabling playlist ${a.id} because key ID ${s} is ${r}`)):(a.excludeUntil!==1/0&&a.lastExcludeReason_!==o&&(a.excludeUntil=1/0,a.lastExcludeReason_=o,this.logger_(`excluding playlist ${a.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${r}`)),t++)})}),t>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=a&&a.attributes&&a.attributes.RESOLUTION&&a.attributes.RESOLUTION.height<720,s=a.excludeUntil===1/0&&a.lastExcludeReason_===o;i&&s&&(delete a.excludeUntil,se.log.warn(`enabling non-HD playlist ${a.id} because all playlists were excluded due to ${o} key IDs`))})}addKeyStatus_(t,o){const s=(typeof t=="string"?t:Xte(t)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${o}' with key ID ${s} added to the keyStatusMap`),this.keyStatusMap_.set(s,o)}updatePlaylistByKeyStatus(t,o){this.addKeyStatus_(t,o),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const xne=(n,t,o)=>a=>{const i=n.main.playlists[t],s=hh(i),r=Cc(i);if(typeof a>"u")return r;a?delete i.disabled:i.disabled=!0;const l={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:"fast-quality"};return a!==r&&!s&&(a?(o(i),n.trigger({type:"renditionenabled",metadata:l})):n.trigger({type:"renditiondisabled",metadata:l})),a};class Vne{constructor(t,o,a){const{playlistController_:i}=t,s=i.fastQualityChange_.bind(i);if(o.attributes){const r=o.attributes.RESOLUTION;this.width=r&&r.width,this.height=r&&r.height,this.bandwidth=o.attributes.BANDWIDTH,this.frameRate=o.attributes["FRAME-RATE"]}this.codecs=Es(i.main(),o),this.playlist=o,this.id=a,this.enabled=xne(t.playlists,o.id,s)}}const Bne=function(n){n.representations=()=>{const t=n.playlistController_.main(),o=ws(t)?n.playlistController_.getAudioTrackPlaylists_():t.playlists;return o?o.filter(a=>!hh(a)).map((a,i)=>new Vne(n,a,a.id)):[]}},c2=["seeking","seeked","pause","playing","error"];class kne extends se.EventTarget{constructor(t){super(),this.playlistController_=t.playlistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=lo("PlaybackWatcher"),this.logger_("initialize");const o=()=>this.monitorCurrentTime_(),a=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),r=this.playlistController_,l=["main","subtitle","audio"],d={};l.forEach(u=>{d[u]={reset:()=>this.resetSegmentDownloads_(u),updateend:()=>this.checkSegmentDownloads_(u)},r[`${u}SegmentLoader_`].on("appendsdone",d[u].updateend),r[`${u}SegmentLoader_`].on("playlistupdate",d[u].reset),this.tech_.on(["seeked","seeking"],d[u].reset)});const c=u=>{["main","audio"].forEach(g=>{r[`${g}SegmentLoader_`][u]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=()=>c("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(c2,s),this.tech_.on("canplay",a),this.tech_.one("play",o),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(c2,s),this.tech_.off("canplay",a),this.tech_.off("play",o),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(u=>{r[`${u}SegmentLoader_`].off("appendsdone",d[u].updateend),r[`${u}SegmentLoader_`].off("playlistupdate",d[u].reset),this.tech_.off(["seeked","seeking"],d[u].reset)}),this.checkCurrentTimeTimeout_&&_.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&_.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=_.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const o=this.playlistController_[`${t}SegmentLoader_`];this[`${t}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${t} loader`),this[`${t}StalledDownloads_`]=0,this[`${t}Buffered_`]=o.buffered_()}checkSegmentDownloads_(t){const o=this.playlistController_,a=o[`${t}SegmentLoader_`],i=a.buffered_(),s=pee(this[`${t}Buffered_`],i);if(this[`${t}Buffered_`]=i,s){const r={bufferedRanges:i};o.trigger({type:"bufferedrangeschanged",metadata:r}),this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++,this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:a.playlist_&&a.playlist_.id,buffered:oi(i)}),!(this[`${t}StalledDownloads_`]<10)&&(this.logger_(`${t} loader stalled download exclusion`),this.resetSegmentDownloads_(t),this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`}),t!=="subtitle"&&o.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const t=this.tech_.currentTime(),o=this.tech_.buffered();if(this.lastRecordedTime===t&&(!o.length||t+Oo>=o.end(o.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(t===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Kt([this.lastRecordedTime,t]));const a={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:a}),this.consecutiveUpdates=0,this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const o=this.seekable(),a=this.tech_.currentTime(),i=this.afterSeekableWindow_(o,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(i&&(s=o.end(o.length-1)),this.beforeSeekableWindow_(o,a)){const h=o.start(0);s=h+(h===o.end(0)?0:Oo)}if(typeof s<"u")return this.logger_(`Trying to seek outside of seekable at time ${a} with seekable range ${_0(o)}. Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0;const r=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),d=r.audioBuffer?r.audioBuffered():null,c=r.videoBuffer?r.videoBuffered():null,u=this.media(),g=u.partTargetDuration?u.partTargetDuration:(u.targetDuration-Lo)*2,f=[d,c];for(let h=0;h<f.length;h++){if(!f[h])continue;if(ch(f[h],a)<g)return!1}const m=yc(l,a);return m.length===0?!1:(s=m.start(0)+Oo,this.logger_(`Buffered region starts (${m.start(0)}) just beyond seek point (${a}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const t=this.tech_.currentTime(),o=this.tech_.buffered(),a=ol(o,t);if(a.length&&t+3<=a.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.logger_(`Stopped at ${t} while inside a buffered region [${a.start(0)} -> ${a.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const t=this.seekable(),o=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(t,o)){const l=t.end(t.length-1);return this.logger_(`Fell out of live window at time ${o}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const a=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:o}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const r=yc(i,o);return r.length>0?(this.logger_(`Stopped at ${o} and seeking to ${r.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(o),!0):!1}afterSeekableWindow_(t,o,a,i=!1){if(!t.length)return!1;let s=t.end(t.length-1)+Oo;const r=!a.endList,l=typeof a.partTargetDuration=="number";return r&&(l||i)&&(s=t.end(t.length-1)+a.targetDuration*3),o>s}beforeSeekableWindow_(t,o){return!!(t.length&&t.start(0)>0&&o<t.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:t,audioBuffered:o,currentTime:a}){if(!t)return;let i;if(t.length&&o.length){const s=ol(t,a-3),r=ol(t,a),l=ol(o,a);l.length&&!r.length&&s.length&&(i={start:s.end(0),end:l.end(0)})}else yc(t,a).length||(i=this.gapFromVideoUnderflow_(t,a));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${a}`),!0):!1}skipTheGap_(t){const o=this.tech_.buffered(),a=this.tech_.currentTime(),i=yc(o,a);if(this.resetTimeUpdate_(),i.length===0||a!==t)return;this.logger_("skipTheGap_:","currentTime:",a,"scheduled currentTime:",t,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Lo);const s={gapInfo:{from:a,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,o){const a=mee(t);for(let i=0;i<a.length;i++){const s=a.start(i),r=a.end(i);if(o-s<4&&o-s>2)return{start:s,end:r}}return null}}const Dne={errorInterval:30,getSource(n){const o=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return n(o)}},m2=function(n,t){let o=0,a=0;const i=rt(Dne,t);n.ready(()=>{n.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){a&&n.currentTime(a)},r=function(u){u!=null&&(a=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",s),n.src(u),n.trigger({type:"usage",name:"vhs-error-reload"}),n.play())},l=function(){if(Date.now()-o<i.errorInterval*1e3){n.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){se.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return o=Date.now(),i.getSource.call(n,r)},d=function(){n.off("loadedmetadata",s),n.off("error",l),n.off("dispose",d)},c=function(u){d(),m2(n,u)};n.on("error",l),n.on("dispose",d),n.reloadSourceOnError=c},Sne=function(n){m2(this,n)};var u2="3.17.2",Nne="7.1.0",Tne="1.3.1",Pne="7.2.0",Ine="4.0.2";const xt={PlaylistLoader:ll,Playlist:Mn,utils:Fee,STANDARD_PLAYLIST_SELECTOR:Yy,INITIAL_PLAYLIST_SELECTOR:Vte,lastBandwidthSelector:Yy,movingAverageBandwidthSelector:Ete,comparePlaylistBandwidth:Bh,comparePlaylistResolution:bte,xhr:by()};Object.keys(Wt).forEach(n=>{Object.defineProperty(xt,n,{get(){return se.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),Wt[n]},set(t){if(se.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),typeof t!="number"||t<0){se.log.warn(`value of Vhs.${n} must be greater than or equal to 0`);return}Wt[n]=t}})});const h2="videojs-vhs",p2=function(n,t){const o=t.media();let a=-1;for(let i=0;i<n.length;i++)if(n[i].id===o.id){a=i;break}n.selectedIndex_=a,n.trigger({selectedIndex:a,type:"change"})},Mne=function(n,t){t.representations().forEach(o=>{n.addQualityLevel(o)}),p2(n,t.playlists)};xt.canPlaySource=function(){return se.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Lne=(n,t,o)=>{if(!n)return n;let a={};t&&t.attributes&&t.attributes.CODECS&&(a=bs(ko(t.attributes.CODECS))),o&&o.attributes&&o.attributes.CODECS&&(a.audio=o.attributes.CODECS);const i=Di(a.video),s=Di(a.audio),r={};for(const l in n)r[l]={},s&&(r[l].audioContentType=s),i&&(r[l].videoContentType=i),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(r[l].pssh=t.contentProtection[l].pssh),typeof n[l]=="string"&&(r[l].url=n[l]);return rt(n,r)},One=(n,t)=>n.reduce((o,a)=>{if(!a.contentProtection)return o;const i=t.reduce((s,r)=>{const l=a.contentProtection[r];return l&&l.pssh&&(s[r]={pssh:l.pssh}),s},{});return Object.keys(i).length&&o.push(i),o},[]),Qne=({player:n,sourceKeySystems:t,audioMedia:o,mainPlaylists:a})=>{if(!n.eme.initializeMediaKeys)return Promise.resolve();const i=o?a.concat([o]):a,s=One(i,Object.keys(t)),r=[],l=[];return s.forEach(d=>{l.push(new Promise((c,u)=>{n.tech_.one("keysessioncreated",c)})),r.push(new Promise((c,u)=>{n.eme.initializeMediaKeys({keySystems:d},g=>{if(g){u(g);return}c()})}))}),Promise.race([Promise.all(r),Promise.race(l)])},Une=({player:n,sourceKeySystems:t,media:o,audioMedia:a})=>{const i=Lne(t,o,a);return i?(n.currentSource().keySystems=i,i&&!n.eme?(se.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},f2=()=>{if(!_.localStorage)return null;const n=_.localStorage.getItem(h2);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Fne=n=>{if(!_.localStorage)return!1;let t=f2();t=t?rt(t,n):n;try{_.localStorage.setItem(h2,JSON.stringify(t))}catch{return!1}return t},Hne=n=>n.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(n.substring(n.indexOf(",")+1)):n,g2=(n,t)=>{n._requestCallbackSet||(n._requestCallbackSet=new Set),n._requestCallbackSet.add(t)},A2=(n,t)=>{n._responseCallbackSet||(n._responseCallbackSet=new Set),n._responseCallbackSet.add(t)},y2=(n,t)=>{n._requestCallbackSet&&(n._requestCallbackSet.delete(t),n._requestCallbackSet.size||delete n._requestCallbackSet)},C2=(n,t)=>{n._responseCallbackSet&&(n._responseCallbackSet.delete(t),n._responseCallbackSet.size||delete n._responseCallbackSet)};xt.supportsNativeHls=function(){if(!be||!be.createElement)return!1;const n=be.createElement("video");return se.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(o){return/maybe|probably/i.test(n.canPlayType(o))}):!1}(),xt.supportsNativeDash=function(){return!be||!be.createElement||!se.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(be.createElement("video").canPlayType("application/dash+xml"))}(),xt.supportsTypeNatively=n=>n==="hls"?xt.supportsNativeHls:n==="dash"?xt.supportsNativeDash:!1,xt.isSupported=function(){return se.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},xt.xhr.onRequest=function(n){g2(xt.xhr,n)},xt.xhr.onResponse=function(n){A2(xt.xhr,n)},xt.xhr.offRequest=function(n){y2(xt.xhr,n)},xt.xhr.offResponse=function(n){C2(xt.xhr,n)};const zne=se.getComponent("Component");class w2 extends zne{constructor(t,o,a){if(super(o,a.vhs),typeof a.initialBandwidth=="number"&&(this.options_.bandwidth=a.initialBandwidth),this.logger_=lo("VhsHandler"),o.options_&&o.options_.playerId){const i=se.getPlayer(o.options_.playerId);this.player_=i}if(this.tech_=o,this.source_=t,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&o.overrideNativeAudioTracks&&o.overrideNativeVideoTracks)o.overrideNativeAudioTracks(!0),o.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(o.featuresNativeVideoTracks||o.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(be,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const s=be.fullscreenElement||be.webkitFullscreenElement||be.mozFullScreenElement||be.msFullscreenElement;s&&s.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(t={}){if(this.options_=rt(this.options_,t),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const a=f2();a&&a.bandwidth&&(this.options_.bandwidth=a.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),a&&a.throughput&&(this.options_.throughput=a.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Wt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Wt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(a=>{typeof this.source_[a]<"u"&&(this.options_[a]=this.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const o=this.options_.customPixelRatio;typeof o=="number"&&o>=0&&(this.customPixelRatio=o)}setOptions(t={}){this.setOptions_(t)}src(t,o){if(!t)return;this.setOptions_(),this.options_.src=Hne(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=xt,this.options_.sourceType=Xg(o),this.options_.seekTo=s=>{this.tech_.setCurrentTime(s)},this.options_.player_=this.player_,this.playlistController_=new Ene(this.options_);const a=rt({liveRangeSafeTimeDelta:Oo},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new kne(a),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const s=se.players[this.tech_.options_.playerId];let r=this.playlistController_.error;typeof r=="object"&&!r.code?r.code=3:typeof r=="string"&&(r={message:r,code:3}),s.error(r)});const i=this.options_.bufferBasedABR?xt.movingAverageBandwidthSelector(.55):xt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=xt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(s){this.playlistController_.selectPlaylist=s.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(s){this.playlistController_.mainSegmentLoader_.throughput.rate=s,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let s=this.playlistController_.mainSegmentLoader_.bandwidth;const r=_.navigator.connection||_.navigator.mozConnection||_.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&r){const d=r.downlink*1e3*1e3;d>=l&&s>=l?s=Math.max(s,d):s=d}return s},set(s){this.playlistController_.mainSegmentLoader_.bandwidth=s,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const s=1/(this.bandwidth||1);let r;return this.throughput>0?r=1/this.throughput:r=0,Math.floor(1/(s+r))},set(){se.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>oi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>oi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&Fne({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Bne(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=_.URL.createObjectURL(this.playlistController_.mediaSource),(se.browser.IS_ANY_SAFARI||se.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Qne({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(o=>{this.logger_("error while creating EME key session",o),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,o=Une({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",a=>{this.playlistController_.updatePlaylistByKeyStatus(a.keyId,a.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!o){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=se.players[this.tech_.options_.playerId];!t||!t.qualityLevels||this.qualityLevels_||(this.qualityLevels_=t.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Mne(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{p2(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":u2,"mux.js":Nne,"mpd-parser":Tne,"m3u8-parser":Pne,"aes-decrypter":Ine}}version(){return this.constructor.version()}canChangeType(){return e2.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&_.URL.revokeObjectURL&&(_.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(t,o){return Yee({playlist:this.playlistController_.media(),time:t,callback:o})}seekToProgramTime(t,o,a=!0,i=2){return ky({programTime:t,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:o})}setupXhrHooks_(){this.xhr.onRequest=t=>{g2(this.xhr,t)},this.xhr.onResponse=t=>{A2(this.xhr,t)},this.xhr.offRequest=t=>{y2(this.xhr,t)},this.xhr.offResponse=t=>{C2(this.xhr,t)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],o=["gapjumped","playedrangeschanged"];t.forEach(a=>{this.playlistController_.on(a,i=>{this.player_.trigger(kt({},i))})}),o.forEach(a=>{this.playbackWatcher_.on(a,i=>{this.player_.trigger(kt({},i))})})}}const Vc={name:"videojs-http-streaming",VERSION:u2,canHandleSource(n,t={}){const o=rt(se.options,t);return!o.vhs.experimentalUseMMS&&!Yl("avc1.4d400d,mp4a.40.2",!1)?!1:Vc.canPlayType(n.type,o)},handleSource(n,t,o={}){const a=rt(se.options,o);return t.vhs=new w2(n,t,a),t.vhs.xhr=by(),t.vhs.setupXhrHooks_(),t.vhs.src(n.src,n.type),t.vhs},canPlayType(n,t){const o=Xg(n);if(!o)return"";const a=Vc.getOverrideNative(t);return!xt.supportsTypeNatively(o)||a?"maybe":""},getOverrideNative(n={}){const{vhs:t={}}=n,o=!(se.browser.IS_ANY_SAFARI||se.browser.IS_IOS),{overrideNative:a=o}=t;return a}};Yl("avc1.4d400d,mp4a.40.2",!0)&&se.getTech("Html5").registerSourceHandler(Vc,0),se.VhsHandler=w2,se.VhsSourceHandler=Vc,se.Vhs=xt,se.use||se.registerComponent("Vhs",xt),se.options.vhs=se.options.vhs||{},(!se.getPlugin||!se.getPlugin("reloadSourceOnError"))&&se.registerPlugin("reloadSourceOnError",Sne);const Rne={name:"MediaVideoPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""}},data(){return{player:null}},mounted(){this.player=se(this.$refs.videoPlayer,{autoplay:!1,controls:!0,muted:!0,fluid:!0,sources:[{src:this.url,type:"video/mp4"}],poster:this.poster})},beforeDestroy(){this.player&&this.player.dispose()}},vne={ref:"videoPlayer",class:"video-js"};function jne(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("video",vne,null,512)}const qne=te(Rne,[["render",jne],["__scopeId","data-v-3e044975"]]),Yne={name:"YoutubePlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},control:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){if(!YT||!document.getElementById(`yt-player-${this.timestamp}`)){setTimeout(this.initPlayer,3e3);return}this.player||(this.player=new YT.Player(`yt-player-${this.timestamp}`,{origin:"http://localhost:3000/",events:{onStateChange:this.onPlayerStateChange}}))},onPlayerStateChange(){this.player.getPlayerState()==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{setTimeout(this.initPlayer,300)})}},Gne={class:"youtube-player"},Kne=["id","src"];function Wne(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",Gne,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",{"show-control-n-fit":o.control}])},[e.createElementVNode("iframe",{id:`yt-player-${i.timestamp}`,ref:"player",width:"1280",height:"537",src:`${o.url}?enablejsapi=1&controls=${o.control?1:0}&autoplay=${o.autoplay||o.isPlaying}&mute=${o.mute?1:0}`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,Kne)],2)):e.createCommentVNode("",!0)])}const Xne=te(Yne,[["render",Wne],["__scopeId","data-v-ca2b2fbb"]]),Jne={name:"BilibiliPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(n,t){this.resetVideo()}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight})}},Zne={class:"bilibili-player",ref:"wrapper"},_ne=["id","src"];function $ne(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",Zne,[e.createElementVNode("div",{class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":s.isVideoWider,"video-foreground--higher":!s.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("iframe",{key:0,id:`bilibili-player-${i.timestamp}`,scrolling:"no",border:"0",frameborder:"no",framespacing:"0",allowfullscreen:"true",src:`${o.url}&high_quality=1&danmaku=0&as_wide=1`},null,8,_ne)):e.createCommentVNode("",!0)],2)],512)}const eoe=te(Jne,[["render",$ne],["__scopeId","data-v-40e15401"]]),toe={name:"YoukuPlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}}},noe={class:"youku-player"},ooe=["src","id"];function aoe(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",noe,[e.createElementVNode("iframe",{width:"1280",height:"537",src:`${o.url}?rel=0&autoplay=${o.isPlaying}`,frameborder:"0",allowfullscreen:"",id:`youku-player-${i.timestamp}`,sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,ooe)])}const ioe=te(toe,[["render",aoe],["__scopeId","data-v-cf32c3a0"]]),loe={name:"QqPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){const n=document.getElementById(`qq-player-${this.timestamp}`);if(!Txp||!n){setTimeout(this.initPlayer,3e3);return}if(this.player)return;this.player=new Txp.Player({containerId:`qq-player-${this.timestamp}`,vid:this.url,width:"100%",height:"100%",autoplay:this.autoplay||this.$_vsWidth>=768||this.isPlaying,mini:!0,muted:this.mute,volume:this.mute?0:50});const t=n.querySelector("iframe");t.sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation",this.player.on("playStateChange",this.onPlayerStateChange)},onPlayerStateChange(n){n.state==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight,setTimeout(this.initPlayer,300)})}},soe={class:"qq-player",ref:"wrapper"},roe=["id"],doe={class:"qq-player__poster"},coe=["src"];function moe(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",soe,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":s.isVideoWider,"video-foreground--higher":!s.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:"iframe",id:`qq-player-${i.timestamp}`},null,8,roe)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",doe,[e.createElementVNode("img",{src:o.poster,alt:"poster"},null,8,coe)],512),[[e.vShow,!o.isPlaying&&!o.autoplay]])],512)}const uoe=te(loe,[["render",moe],["__scopeId","data-v-719611b1"]]),hoe={name:"FbPlayer",props:{html:{type:String,default:()=>""}},mounted(){this.loadFacebookSDK()},methods:{loadFacebookSDK(){if(document.querySelector('script[src*="connect.facebook.net"]'))return;const n=document.createElement("script");n.async=!0,n.defer=!0,n.crossOrigin="anonymous",n.src="https://connect.facebook.net/zh_TW/sdk.js#xfbml=1&version=v14.0",n.nonce="5tyirFAy",document.body.appendChild(n)}}},poe={class:"fb-player",ref:"wrapper"},foe=["innerHTML"];function goe(n,t,o,a,i,s){return e.openBlock(),e.createElementBlock("div",poe,[t[0]||(t[0]=e.createElementVNode("div",{id:"fb-root"},null,-1)),e.createElementVNode("div",{innerHTML:o.html},null,8,foe)],512)}const Aoe=te(hoe,[["render",goe],["__scopeId","data-v-c5a2a3ed"]]),yoe={class:"media_video_wrap"},Coe={class:"img-wrapper"},woe={key:0},boe={key:1},Eoe={key:2},xoe={key:3},Voe={key:4},Boe={key:5},Bc=te(e.defineComponent({name:"MediaVideo",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const o=n,a=t,i=e.ref(!1),s=()=>{var h;if(o.modelValue&&o.modelValue.data)return;const m={id:((h=o.modelValue)==null?void 0:h.id)||q(),type:"MediaVideo",showMode:"",data:{width:"",type:"inner",videoSrc:"https://mvideo.ycyw.com/2e1a9441vodgzp1253458132/a31402d51397757891052265568/SW8B19vOtzMA.mp4",videoThumbnail:"https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg"}};a("update:modelValue",m)},r=e.computed(()=>{var m,h;return o.isPreview?((m=o.modelValue)==null?void 0:m.showMode)==="pc"?!ue():((h=o.modelValue)==null?void 0:h.showMode)==="mobile"?ue():!0:!0}),l=e.ref(!1),d=e.ref(!1),c=e.computed(()=>{var p,A;const m=(A=(p=o.modelValue)==null?void 0:p.data)==null?void 0:A.width;return!m||m==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[m]||"container-content"}),u=()=>{a("handleDelete",o.modelValue.id)},g=()=>{a("handleCopy",o.modelValue)},f=m=>{a("handlePaste",m)};return s(),(m,h)=>{var p,A,E,x,b,C,D,S,w,V,P,k;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mediaVideo_wrap_box",onMouseenter:h[2]||(h[2]=I=>l.value=!0),onMouseleave:h[3]||(h[3]=I=>l.value=!1)},[e.createElementVNode("div",yoe,[e.createElementVNode("div",{class:e.normalizeClass(["media-video__container",c.value])},[e.createElementVNode("div",Coe,[((A=(p=n.modelValue)==null?void 0:p.data)==null?void 0:A.type)==="inner"?(e.openBlock(),e.createElementBlock("div",woe,[e.createVNode(qne,{url:n.modelValue.data.videoSrc,poster:n.modelValue.data.videoThumbnail},null,8,["url","poster"])])):e.createCommentVNode("",!0),((x=(E=n.modelValue)==null?void 0:E.data)==null?void 0:x.type)==="youtube"?(e.openBlock(),e.createElementBlock("div",boe,[e.createVNode(Xne,{url:n.modelValue.data.videoSrc,isPlaying:i.value,control:!0,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((C=(b=n.modelValue)==null?void 0:b.data)==null?void 0:C.type)==="bilibili"?(e.openBlock(),e.createElementBlock("div",Eoe,[e.createVNode(eoe,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((S=(D=n.modelValue)==null?void 0:D.data)==null?void 0:S.type)==="youku"?(e.openBlock(),e.createElementBlock("div",xoe,[e.createVNode(ioe,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((V=(w=n.modelValue)==null?void 0:w.data)==null?void 0:V.type)==="qq"?(e.openBlock(),e.createElementBlock("div",Voe,[e.createVNode(uoe,{url:n.modelValue.data.videoSrc,isPlaying:i.value,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((k=(P=n.modelValue)==null?void 0:P.data)==null?void 0:k.type)==="facebook"?(e.openBlock(),e.createElementBlock("div",Boe,[e.createVNode(Aoe,{html:n.modelValue.data.videoSrc},null,8,["html"])])):e.createCommentVNode("",!0)])],2)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:l.value,"onUpdate:show":h[0]||(h[0]=I=>l.value=I),locale:n.locale,onHandleEdit:h[1]||(h[1]=I=>d.value=!0),onHandleDelete:u,onHandleCopy:g,onHandlePaste:f},null,8,["show","locale"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(FX,{key:1,show:d.value,"onUpdate:show":h[4]||(h[4]=I=>d.value=I),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-716700db"]]),b2=Object.freeze(Object.defineProperty({__proto__:null,default:Bc},Symbol.toStringTag,{value:"Module"})),koe={class:"setting-content"},Doe={class:"setting-header flex items-center mb-10"},Soe={class:"header-title"},Noe={class:"item-title"},Toe={class:"item-title"},Poe={class:"item-title"},Ioe={class:"item-title"},Moe=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{i("update:show",!1)};return(r,l)=>{const d=e.resolveComponent("a-radio"),c=e.resolveComponent("a-radio-group"),u=e.resolveComponent("a-option"),g=e.resolveComponent("a-select"),f=e.resolveComponent("a-input"),m=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(m,{width:500,visible:n.show,footer:!1,onCancel:s,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",koe,[e.createElementVNode("div",Doe,[e.createElementVNode("span",Soe,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(c,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":l[0]||(l[0]=h=>n.data.showMode=h),type:"button"},{default:e.withCtx(()=>[e.createVNode(d,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(d,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(d,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("p",Noe,e.toDisplayString(e.unref(a)("setting.component_width")),1),e.createVNode(g,{modelValue:n.data.data.width,"onUpdate:modelValue":l[1]||(l[1]=h=>n.data.data.width=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_default")),1)]),_:1}),e.createVNode(u,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_small")),1)]),_:1}),e.createVNode(u,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_middle")),1)]),_:1}),e.createVNode(u,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("p",Toe,e.toDisplayString(e.unref(a)("setting.component_bg")),1),e.createVNode(g,{modelValue:n.data.bgColor,"onUpdate:modelValue":l[2]||(l[2]=h=>n.data.bgColor=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_white")),1)]),_:1}),e.createVNode(u,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("p",Poe,e.toDisplayString(e.unref(a)("setting.title")),1),e.createVNode(f,{modelValue:n.data.data.title,"onUpdate:modelValue":l[3]||(l[3]=h=>n.data.data.title=h),placeholder:e.unref(a)("setting.input_title"),"allow-clear":""},null,8,["modelValue","placeholder"]),e.createElementVNode("p",Ioe,e.toDisplayString(e.unref(a)("setting.link")),1),e.createVNode(f,{modelValue:n.data.data.link,"onUpdate:modelValue":l[4]||(l[4]=h=>n.data.data.link=h),placeholder:e.unref(a)("setting.link_url"),"allow-clear":""},null,8,["modelValue","placeholder"])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-f04f551a"]]),Loe={class:"information-link__wrapper"},Ooe={key:0},Qoe=["innerHTML"],Uoe={key:1,class:"information-link__btn btn p-0",type:"button"},Foe=["innerHTML"],kc=te(e.defineComponent({name:"InformationLink",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=h=>{!h||!o.isPreview||i("handleClick",h)},r=e.computed(()=>{var h,p;return o.isPreview?((h=o.modelValue)==null?void 0:h.showMode)==="pc"?!ue():((p=o.modelValue)==null?void 0:p.showMode)==="mobile"?ue():!0:!0}),l=()=>{var p;if(o.modelValue&&o.modelValue.data)return;const h={id:((p=o.modelValue)==null?void 0:p.id)||q(),type:"InformationLink",showMode:"",bgColor:"",data:{width:"",title:a("placeholder.title_here"),link:"https://www.ycyw-edu.com"}};i("update:modelValue",h)},d=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var A,E;const h=(E=(A=o.modelValue)==null?void 0:A.data)==null?void 0:E.width;return!h||h==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[h]||"container-content"}),g=()=>{i("handleDelete",o.modelValue.id)},f=()=>{i("handleCopy",o.modelValue)},m=h=>{i("handlePaste",h)};return l(),(h,p)=>{var A,E,x,b,C,D,S,w,V;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"informationLink_wrap",style:e.normalizeStyle({backgroundColor:((A=n.modelValue)==null?void 0:A.bgColor)||"transparent"}),onMouseenter:p[3]||(p[3]=P=>d.value=!0),onMouseleave:p[4]||(p[4]=P=>d.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["media-image-full",u.value])},[e.createElementVNode("div",Loe,[(x=(E=n.modelValue)==null?void 0:E.data)!=null&&x.link?(e.openBlock(),e.createElementBlock("div",Ooe,[(C=(b=n.modelValue)==null?void 0:b.data)!=null&&C.link?(e.openBlock(),e.createElementBlock("div",{key:0,target:"_blank",class:"information-link__btn btn p-0",onClick:p[0]||(p[0]=P=>{var k,I;return s((I=(k=n.modelValue)==null?void 0:k.data)==null?void 0:I.link)})},[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(S=(D=n.modelValue)==null?void 0:D.data)==null?void 0:S.title},null,8,Qoe),p[6]||(p[6]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",Uoe,[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(V=(w=n.modelValue)==null?void 0:w.data)==null?void 0:V.title},null,8,Foe),p[7]||(p[7]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))]))])],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:d.value,"onUpdate:show":p[1]||(p[1]=P=>d.value=P),locale:n.locale,onHandleEdit:p[2]||(p[2]=P=>c.value=!0),onHandleDelete:g,onHandleCopy:f,onHandlePaste:m},null,8,["show","locale"]))],36)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Moe,{key:1,show:c.value,"onUpdate:show":p[5]||(p[5]=P=>c.value=P),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-3d104efa"]]),E2=Object.freeze(Object.defineProperty({__proto__:null,default:kc},Symbol.toStringTag,{value:"Module"})),Hoe={key:0,class:"tab-primary__btn__img flex-center"},zoe=["src","alt"],Roe={key:1},voe=te({__name:"TabPrimary",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:()=>0},isFixed:{type:Boolean,default:()=>!1},fullWidth:{type:Boolean,default:()=>!1},isPreview:{type:Boolean,default:!0}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=n,d=t,c=e.ref(null),u=e.ref(null),g=e.ref([]),f=e.ref(0),m=e.ref(.5*a.value),h=e.ref(0),p=e.ref(!0),A=e.ref(!0),E=e.ref(0),x=e.ref(!1),b=e.ref(0),C=e.ref(0),D=e.ref(0);e.ref(0);const S=e.ref(null),w=e.ref(null),V=e.ref(null),P=e.ref(null),k=e.ref(null),I=e.computed(()=>f.value-m.value),L=e.computed(()=>[{"--strip-width":`${I.value}px`},{"--strip-left":`${m.value}px`},{"--fix-left":`${h.value}px`},{transition:A.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),U=e.computed(()=>b.value>0),Q=e.computed(()=>C.value-b.value+H.value>D.value),H=e.computed(()=>{if(!x.value)return 24;const ee=c.value;return ee?window.getComputedStyle(ee,null).getPropertyValue("padding-right").split("px")[0]*2:24}),z=e.computed(()=>!1);e.watch(a,()=>{O(),v()}),e.watch(()=>l.currentIdx,(ee,ce)=>{p.value=ee>ce,e.nextTick(K),e.nextTick(Y)}),e.watch(()=>l.tabList,(ee,ce)=>{v(),e.nextTick(()=>{K(0)})},{deep:!0}),e.watch(()=>l.isFixed,()=>{a.value>1200&&O(),e.nextTick(v)});const K=ee=>{const ce=ee??250;p.value?(J(),P.value=setTimeout(j,ce)):(j(),P.value=setTimeout(J,ce)),k.value=setTimeout(()=>{A.value=!0},ce)},J=()=>{const ee=g.value;let ce=null;ee&&ee[l.currentIdx]&&(ce=ee[l.currentIdx]),ce&&ce.getBoundingClientRect&&(f.value=ce.getBoundingClientRect().right)},j=()=>{const ee=g.value;let ce=null;ee&&ee[l.currentIdx]&&(ce=ee[l.currentIdx]),ce&&ce.getBoundingClientRect&&(m.value=ce.getBoundingClientRect().left)},O=()=>{A.value=!1,e.nextTick(()=>K(0)),e.nextTick(W)},v=()=>{const ee=c.value;if(ee){let ce=ee.getBoundingClientRect().left;h.value=(ee.offsetWidth-ee.getBoundingClientRect().width)/2+ce}},W=()=>{var re;if(!((re=l.tabList)!=null&&re.length))return;const ee=u.value;ee&&(b.value=ee.scrollLeft,C.value=ee.scrollWidth);const ce=c.value;ce&&(D.value=ce.getBoundingClientRect().width)},R=ee=>{u.value&&(ee=="next"?u.value.scrollLeft+=9999:u.value.scrollLeft-=9999)},Y=()=>{const ee=g.value[l.currentIdx];if(!ee)return;const ce=ee.clientWidth/2,re=a.value/2;E.value=ee.getBoundingClientRect().right-ce,u.value&&(u.value.scrollLeft-=re-E.value)},oe=(ee,ce)=>{ee&&l.isPreview||d("updateCurrentIdx",ce)},we=ee=>ee&&l.isPreview?ee.includes("http")?"a":l.isPreview?"RouterLink":"button":"button",fe=ee=>ee&&!ee.includes("http")?ee:null,ke=ee=>ee&&ee.includes("http")?ee:null,ge=ee=>ee&&ee.includes("http")?"_blank":null;return e.onMounted(()=>{x.value=!0,e.nextTick(()=>{K(0),S.value=setTimeout(O,300),v(),e.nextTick(()=>{w.value=setTimeout(Y,300)})})}),e.onBeforeUnmount(()=>{clearTimeout(S.value),clearTimeout(w.value),clearTimeout(V.value),clearTimeout(P.value),clearTimeout(k.value),window.removeEventListener("resize",()=>{a.value=window.innerWidth})}),(ee,ce)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-primary",[{"is-fixed":n.isFixed},{"is-campus":!z.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:c},[e.createElementVNode("ul",{class:"tab-primary__list",ref_key:"list",ref:u,onScroll:O},[e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__prev",onClick:ce[0]||(ce[0]=re=>R("prev"))},null,512),[[e.vShow,U.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(re,ie)=>(e.openBlock(),e.createElementBlock("li",{key:ie,class:e.normalizeClass(["tab-primary__item",[{"is-img":!!re.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btnRefs",ref:g,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(we(re.link)),{type:re.link?null:"button",to:fe(re.link),href:ke(re.link),target:ge(re.link),class:e.normalizeClass(["tab-primary__btn",[{"is-active":n.currentIdx==ie}]]),onClick:me=>oe(re.link,ie)},{default:e.withCtx(()=>[re.img?(e.openBlock(),e.createElementBlock("div",Hoe,[e.createElementVNode("img",{src:re.img,alt:re.alt||re.name},null,8,zoe)])):(e.openBlock(),e.createElementBlock("div",Roe,e.toDisplayString(re.name),1))]),_:2},1032,["type","to","href","target","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__next",onClick:ce[1]||(ce[1]=re=>R("next"))},null,512),[[e.vShow,Q.value]])],544),e.createElementVNode("span",{class:"tab-primary__strip",style:e.normalizeStyle(L.value)},null,4)],2))}},[["__scopeId","data-v-51a22770"]]),joe={class:"setting-content"},qoe={class:"setting-header flex items-center mb-10"},Yoe={class:"header-title"},Goe={class:"setting-header flex items-center"},Koe={class:"header-title"},Woe={class:"setting-body"},Xoe={class:"setting-toolbar"},Joe={class:"tools"},Zoe={class:"setting-item"},_oe={class:"item-header"},$oe={class:"btn-group"},eae={key:0,class:"drag-handle"},tae={class:"item-title"},nae={class:"components-content"},oae={class:"setting-body"},aae={class:"setting-toolbar"},iae={class:"tools"},lae={class:"setting-item"},sae={class:"item-header"},rae={class:"btn-group"},dae={key:0,class:"drag-handle"},cae={class:"item-title"},mae={class:"components-content"},uae=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=m=>m&&m.length>1,l=n,{t:d}=de(()=>l.locale),c=t,u=()=>{c("update:show",!1)},g=m=>{var p;debugger;const h=l.data;m==="listAbove"?h.listAbove.push({id:q(),key:q(),name:"New Tab",componentsDataJson:[{id:((p=l.modelValue)==null?void 0:p.id)||q(),type:"BannerImage",onlyShowPc:!1,data:{title:d("placeholder.title_here"),imgSrc:"https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg"}}]}):h.data.push({id:q(),key:q(),name:"New Tab",link:"",componentsDataJson:[]})},f=(m,h)=>{h==="listAbove"?l.data.listAbove.splice(l.data.listAbove.findIndex(p=>p.id===m),1):l.data.data.splice(l.data.data.findIndex(p=>p.id===m),1)};return(m,h)=>{const p=e.resolveComponent("a-radio"),A=e.resolveComponent("a-radio-group"),E=e.resolveComponent("a-option"),x=e.resolveComponent("a-select"),b=e.resolveComponent("icon-plus"),C=e.resolveComponent("a-button"),D=e.resolveComponent("icon-drag-arrow"),S=e.resolveComponent("icon-delete"),w=e.resolveComponent("a-input"),V=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(V,{width:1200,visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(d)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",joe,[e.createElementVNode("div",qoe,[e.createElementVNode("span",Yoe,e.toDisplayString(e.unref(d)("setting.show_mode_pc_mobile")),1),e.createVNode(A,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":h[0]||(h[0]=P=>n.data.showMode=P),type:"button"},{default:e.withCtx(()=>[e.createVNode(p,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_all")),1)]),_:1}),e.createVNode(p,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_pc")),1)]),_:1}),e.createVNode(p,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",Goe,[e.createElementVNode("span",Koe,e.toDisplayString(e.unref(d)("setting.component_bg")),1),e.createVNode(x,{modelValue:n.data.bgColor,"onUpdate:modelValue":h[1]||(h[1]=P=>n.data.bgColor=P),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(E,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_white")),1)]),_:1}),e.createVNode(E,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Woe,[e.createElementVNode("div",Xoe,[h[15]||(h[15]=e.createElementVNode("h1",null,"List Above",-1)),e.createElementVNode("div",Joe,[e.createVNode(C,{type:"primary",onClick:h[2]||(h[2]=P=>g("listAbove"))},{icon:e.withCtx(()=>[e.createVNode(b)]),default:e.withCtx(()=>[h[14]||(h[14]=e.createTextVNode(" List Above ",-1))]),_:1}),e.createVNode(C,{type:"primary",onClick:h[3]||(h[3]=P=>g("listAbove"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",Zoe,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.listAbove,"onUpdate:modelValue":h[5]||(h[5]=P=>n.data.listAbove=P),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},s.value,{disabled:!r(n.data.data),onStart:h[6]||(h[6]=P=>a.value=!0),onEnd:h[7]||(h[7]=P=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:P})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:P.id},[e.createElementVNode("div",_oe,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(P.name),1),e.createElementVNode("span",null,e.toDisplayString(P.key),1)]),e.createElementVNode("div",$oe,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",eae,[e.createVNode(D,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(S,{class:"btn-delete",onClick:k=>f(P.id,"listAbove")},null,8,["onClick"]),e.createVNode(C,{size:"mini",type:"primary",onClick:h[4]||(h[4]=k=>g("Video"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.copy_tab")),1)]),_:1})])]),e.createElementVNode("p",tae,e.toDisplayString(e.unref(d)("setting.tab_name")),1),e.createVNode(w,{modelValue:P.name,"onUpdate:modelValue":k=>P.name=k,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[16]||(h[16]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(w,{modelValue:P.key,"onUpdate:modelValue":k=>P.key=k,placeholder:e.unref(d)("setting.input_key"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[17]||(h[17]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",nae,[e.createVNode(Ya,{data:P.componentsDataJson,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:k=>P.componentsDataJson=k},null,8,["data","host","websiteId","locale","lang","footer","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])]),e.createElementVNode("div",oae,[e.createElementVNode("div",aae,[h[19]||(h[19]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",iae,[e.createVNode(C,{type:"primary",onClick:h[8]||(h[8]=P=>g("Video"))},{icon:e.withCtx(()=>[e.createVNode(b)]),default:e.withCtx(()=>[h[18]||(h[18]=e.createTextVNode(" List ",-1))]),_:1}),e.createVNode(C,{type:"primary",onClick:h[9]||(h[9]=P=>g("Video"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",lae,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":h[11]||(h[11]=P=>n.data.data=P),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!r(n.data.data),onStart:h[12]||(h[12]=P=>a.value=!0),onEnd:h[13]||(h[13]=P=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:P})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:P.id},[e.createElementVNode("div",sae,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(P.name),1),e.createElementVNode("span",null,e.toDisplayString(P.key),1)]),e.createElementVNode("div",rae,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",dae,[e.createVNode(D,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(S,{class:"btn-delete",onClick:k=>f(P.id,"list")},null,8,["onClick"]),e.createVNode(C,{size:"mini",type:"primary",onClick:h[10]||(h[10]=k=>g("Video"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.copy_tab")),1)]),_:1})])]),e.createElementVNode("p",cae,e.toDisplayString(e.unref(d)("setting.tab_name")),1),e.createVNode(w,{modelValue:P.name,"onUpdate:modelValue":k=>P.name=k,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[20]||(h[20]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(w,{modelValue:P.key,"onUpdate:modelValue":k=>P.key=k,placeholder:e.unref(d)("setting.input_key"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[21]||(h[21]=e.createElementVNode("p",{class:"item-title"},"Link",-1)),e.createVNode(w,{modelValue:P.link,"onUpdate:modelValue":k=>P.link=k,placeholder:e.unref(d)("setting.input_link_url"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),h[22]||(h[22]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",mae,[e.createVNode(Ya,{data:P.componentsDataJson,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,onUpdate:k=>P.componentsDataJson=k},null,8,["data","host","websiteId","locale","lang","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-796673e0"]]),hae={class:"tab-page__above"},pae={key:0},fae={key:0},gae={class:"tab-page__content"},Aae={key:0},yae={key:1,class:"component-wrapper"},Cae="",Dc=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,a=e.computed(()=>{var v,W;return c.isPreview?((v=c.modelValue)==null?void 0:v.showMode)==="pc"?!ue():((W=c.modelValue)==null?void 0:W.showMode)==="mobile"?ue():!0:!0}),{proxy:i}=e.getCurrentInstance(),{$_vsWidth:s,$_vsScrollY:r,$vsScreenAddListener:l,$vsScreenDestroyListener:d}=i,c=n,u=e.ref(0),g=e.ref(!1),f=e.ref(!0),m=e.ref(null),h=e.ref(null),p=e.ref(!1),A=e.ref(!1),E=v=>{if(!v)return{top:0,left:0};const W=v.getBoundingClientRect(),R=window.pageYOffset||document.documentElement.scrollTop,Y=window.pageXOffset||document.documentElement.scrollLeft;return{top:W.top+R,left:W.left+Y}},x=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.classes)??null});e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.style)??null}),e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.type)??"TabPrimary"});const b=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.listAbove)??[]}),C=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.data)??[]}),D=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.fixed)??!0}),S=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.resetToTop)??!0}),w=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.scrollToTop)??!0}),V=e.computed(()=>{var v;return((v=c.modelValue)==null?void 0:v.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const P=e.computed(()=>C.value.some(v=>v.img)),k=e.computed(()=>{var v;return((v=C.value[u.value])==null?void 0:v.key)??null}),I=e.computed(()=>{var W;if(!((W=c.modelValue)!=null&&W.data)||!Array.isArray(c.modelValue.data))return[];const v=c.modelValue.data[u.value];return v?v.componentsDataJson||[]:[]}),L=e.ref(""),U=()=>{var W;if(c.modelValue&&c.modelValue.data){const R=window==null?void 0:window.location.pathname.split("#")[0].split("/");L.value=(window==null?void 0:window.location.hash)||"",L.value&&setTimeout(()=>{nm(L.value)},1e3);const Y=R[R.length-1];u.value=C.value.findIndex(oe=>oe.key===Y)||0;return}const v={id:((W=c.modelValue)==null?void 0:W.id)||q(),type:"TabPage",showMode:"",containerWidth:"",bgColor:"",classes:"custom-class another-class",width:"",listAbove:[],data:[{id:q(),key:q(),name:"New Tab1",componentsDataJson:[]},{id:q(),key:q(),name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",v),u.value=0},Q=()=>{var we,fe;const v=h.value;if(!v)return;const W=v.getBoundingClientRect().top,R=m.value;if(!R)return;const Y=R.getBoundingClientRect().top,oe=+((fe=(we=window.getComputedStyle(document.body))==null?void 0:we.getPropertyValue("--header-height-calc"))==null?void 0:fe.split("px")[0])||0;if(Y>oe){g.value=!1;return}W<=oe&&(g.value=!0)},H=()=>{if(!w.value)return;let v=0;S.value||(v=E(m.value).top-170),window.scroll({top:v,left:0,behavior:"smooth"})},z=v=>{sessionStorage.setItem(Cae,v)},K=(v,W)=>{debugger;o("handleDelete",v||c.modelValue.id,W)},J=v=>{debugger;o("handleCopy",v||c.modelValue)},j=(v,W,R)=>{debugger;o("handlePaste",v,W,R)},O=v=>{o("handleClick",v)};return e.watch(()=>r.value,()=>{Q()}),e.watch(u,()=>{z(k.value),f.value&&H(),f.value=!0}),e.watch(k,v=>{v||(u.value=0)}),e.onMounted(()=>{U(),e.nextTick(Q),setTimeout(()=>{e.nextTick(Q)},200),setTimeout(()=>{},1e3)}),(v,W)=>{var R;return a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tab-page",x.value]),style:e.normalizeStyle({backgroundColor:((R=n.modelValue)==null?void 0:R.bgColor)||"transparent"}),onMouseover:W[10]||(W[10]=Y=>A.value=!0),onMouseout:W[11]||(W[11]=Y=>A.value=!1)},[e.createElementVNode("div",hae,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("div",pae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(Y,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Y.key},[k.value==Y.key?(e.openBlock(),e.createElementBlock("div",fae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.componentsDataJson,(we,fe)=>(e.openBlock(),e.createBlock(sn,{key:we.id,hash:we.hash,type:we.type,"props-data":{modelValue:we,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:W[0]||(W[0]=ke=>K(ke,I.value)),onHandleCopy:W[1]||(W[1]=ke=>J(ke)),onHandlePaste:ke=>j(ke,I.value,fe),onHandleClick:O},null,8,["hash","type","props-data","onHandlePaste"]))),128))])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&D.value},{"is-thick":P.value}]]),ref_key:"hold",ref:m},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:h},[e.createVNode(voe,{tabList:C.value,currentIdx:u.value,isFixed:g.value&&D.value,fullWidth:V.value,isPreview:n.isPreview,onUpdateCurrentIdx:W[2]||(W[2]=Y=>u.value=Y)},null,8,["tabList","currentIdx","isFixed","fullWidth","isPreview"])],512)],2),e.createElementVNode("div",gae,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("div",{key:k.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,Y=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[k.value==Y.key?(e.openBlock(),e.createElementBlock("div",Aae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.componentsDataJson,(oe,we)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:oe.id},[oe.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(oe.template,(fe,ke)=>(e.openBlock(),e.createElementBlock("div",{class:"component-wrapper",key:fe.id},[e.createVNode(sn,{type:fe.type,"props-data":{modelValue:fe,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:W[3]||(W[3]=ge=>K(ge,I.value)),onHandleCopy:W[4]||(W[4]=ge=>J(ge)),onHandlePaste:ge=>j(ge,I.value,ke),onHandleClick:O},null,8,["type","props-data","onHandlePaste"])]))),128)):(e.openBlock(),e.createElementBlock("div",yae,[e.createVNode(sn,{type:oe.type,"props-data":{modelValue:oe,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:W[5]||(W[5]=fe=>K(fe,I.value)),onHandleCopy:W[6]||(W[6]=fe=>J(fe)),onHandlePaste:fe=>j(fe,I.value,we),onHandleClick:O},null,8,["type","props-data","onHandlePaste"])]))],64))),128))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:A.value,"onUpdate:show":W[7]||(W[7]=Y=>A.value=Y),locale:n.locale,onHandleEdit:W[8]||(W[8]=Y=>p.value=!0),onHandleDelete:K,onHandleCopy:J,onHandlePaste:j},null,8,["show","locale"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(uae,{key:1,show:p.value,"onUpdate:show":W[9]||(W[9]=Y=>p.value=Y),data:n.modelValue,locale:n.locale,host:n.host,lang:n.lang,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","host","lang","websiteId","footer"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-54f0a70a"]]),x2=Object.freeze(Object.defineProperty({__proto__:null,default:Dc},Symbol.toStringTag,{value:"Module"})),wae={class:"tab-logo__btn__img flex-center"},bae=["src","alt"],Eae=te({__name:"TabLogo",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0},isFixed:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=n,d=t,c=e.ref(0),u=e.ref(.5*a.value),g=e.ref(0),f=e.ref(!0),m=e.ref(!0),h=e.ref(0),p=e.ref(!1),A=e.ref(0),E=e.ref(0),x=e.ref(0),b=e.ref(null),C=e.ref(null),D=e.ref([]),S=e.computed(()=>c.value-u.value),w=e.computed(()=>[{"--strip-width":`${S.value}px`},{"--strip-left":`${u.value}px`},{"--fix-left":`${g.value}px`},{transition:m.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),V=e.computed(()=>A.value>0),P=e.computed(()=>E.value-A.value+k.value>x.value),k=e.computed(()=>{if(!p.value)return 24;const v=b.value;if(!v)return 24;const W=window.getComputedStyle(v,null).getPropertyValue("padding-right").split("px")[0];return Number(W)*2}),I=e.computed(()=>!1);e.watch(a,()=>{H(),z()}),e.watch(()=>l.currentIdx,(v,W)=>{f.value=v>W,e.nextTick(()=>L()),e.nextTick(()=>j())}),e.watch(()=>l.isFixed,()=>{a.value>1200&&H(),e.nextTick(()=>z())}),e.watch(()=>l.tabList,(v,W)=>{z(),e.nextTick(()=>{L(0)})},{deep:!0});const L=v=>{const W=v??250;f.value?(U(),setTimeout(Q,W)):(Q(),setTimeout(U,W)),setTimeout(()=>{m.value=!0},W)},U=()=>{const v=D.value[l.currentIdx];v&&v.getBoundingClientRect&&(c.value=v.getBoundingClientRect().right)},Q=()=>{const v=D.value[l.currentIdx];v&&v.getBoundingClientRect&&(u.value=v.getBoundingClientRect().left)},H=()=>{m.value=!1,e.nextTick(()=>L(0)),e.nextTick(()=>K())},z=()=>{const v=b.value;if(v){let W=v.getBoundingClientRect().left;g.value=(v.offsetWidth-v.getBoundingClientRect().width)/2-W}},K=()=>{var v;(v=l.tabList)!=null&&v.length&&(C.value&&(A.value=C.value.scrollLeft,E.value=C.value.scrollWidth),b.value&&(x.value=b.value.getBoundingClientRect().width))},J=v=>{C.value&&(v=="next"?C.value.scrollLeft+=9999:C.value.scrollLeft-=9999)},j=()=>{const v=D.value[l.currentIdx];if(!v)return;const W=v.clientWidth/2,R=a.value/2;h.value=v.getBoundingClientRect().right-W,C.value&&(C.value.scrollLeft-=R-h.value)},O=v=>{d("updateCurrentIdx",v)};return e.onMounted(()=>{p.value=!0,e.nextTick(()=>{L(0),setTimeout(H,300),z(),e.nextTick(()=>{setTimeout(j,300)})})}),(v,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-logo",[{"is-fixed":n.isFixed},{"is-campus":!I.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:b},[e.createElementVNode("ul",{class:"tab-logo__list",ref_key:"list",ref:C,onScroll:H},[e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__prev",onClick:W[0]||(W[0]=R=>J("prev"))},null,512),[[e.vShow,V.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(R,Y)=>(e.openBlock(),e.createElementBlock("li",{key:Y,class:e.normalizeClass(["tab-logo__item",[{"tab-logo__item--img":!!R.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btn",ref:D,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(R.link?"a":"button"),{type:R.link?null:"button",href:R.link,class:e.normalizeClass(["tab-logo__btn",[{"is-active":n.currentIdx==Y}]]),onClick:oe=>O(Y)},{default:e.withCtx(()=>[e.createElementVNode("div",wae,[e.createElementVNode("img",{src:R.img,alt:R.alt},null,8,bae)])]),_:2},1032,["type","href","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__next",onClick:W[1]||(W[1]=R=>J("next"))},null,512),[[e.vShow,P.value]])],544),e.createElementVNode("span",{class:"tab-logo__strip",style:e.normalizeStyle(w.value)},null,4)],2))}},[["__scopeId","data-v-bd7e89c6"]]),xae={class:"setting-content"},Vae={class:"setting-header flex items-center mb-10"},Bae={class:"header-title"},kae={class:"setting-header flex items-center"},Dae={class:"header-title"},Sae={class:"setting-body"},Nae={class:"setting-toolbar"},Tae={class:"tools"},Pae={class:"setting-item"},Iae={class:"item-header"},Mae={class:"btn-group"},Lae={key:0,class:"drag-handle"},Oae={class:"item-title"},Qae=["src"],Uae={class:"item-uplaod flex items-center"},Fae={class:"components-content"},Hae=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));const s=f=>f&&f.length>1,r=n,{t:l}=de(()=>r.locale),d=t,c=()=>{d("update:show",!1)},u=f=>{debugger;r.data.data.push({id:q(),key:q(),name:"New Tab",img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:l("setting.image_alt"),componentsDataJson:[]})},g=(f,m)=>{r.data.data.splice(r.data.data.findIndex(h=>h.id===f),1)};return(f,m)=>{const h=e.resolveComponent("a-radio"),p=e.resolveComponent("a-radio-group"),A=e.resolveComponent("a-option"),E=e.resolveComponent("a-select"),x=e.resolveComponent("icon-plus"),b=e.resolveComponent("a-button"),C=e.resolveComponent("icon-drag-arrow"),D=e.resolveComponent("icon-delete"),S=e.resolveComponent("a-input"),w=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(w,{width:1200,visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(l)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",xae,[e.createElementVNode("div",Vae,[e.createElementVNode("span",Bae,e.toDisplayString(e.unref(l)("setting.show_mode_pc_mobile")),1),e.createVNode(p,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":m[0]||(m[0]=V=>n.data.showMode=V),type:"button"},{default:e.withCtx(()=>[e.createVNode(h,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.only_show_all")),1)]),_:1}),e.createVNode(h,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.only_show_pc")),1)]),_:1}),e.createVNode(h,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",kae,[e.createElementVNode("span",Dae,e.toDisplayString(e.unref(l)("setting.component_bg")),1),e.createVNode(E,{modelValue:n.data.bgColor,"onUpdate:modelValue":m[1]||(m[1]=V=>n.data.bgColor=V),placeholder:e.unref(l)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(A,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.bg_white")),1)]),_:1}),e.createVNode(A,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Sae,[e.createElementVNode("div",Nae,[m[9]||(m[9]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",Tae,[e.createVNode(b,{type:"primary",onClick:m[2]||(m[2]=V=>u())},{icon:e.withCtx(()=>[e.createVNode(x)]),default:e.withCtx(()=>[m[8]||(m[8]=e.createTextVNode(" List ",-1))]),_:1}),e.createVNode(b,{type:"primary",onClick:m[3]||(m[3]=V=>u())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",Pae,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":m[5]||(m[5]=V=>n.data.data=V),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!s(n.data.data),onStart:m[6]||(m[6]=V=>a.value=!0),onEnd:m[7]||(m[7]=V=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:V})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:V.id},[e.createElementVNode("div",Iae,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(V.name),1),e.createElementVNode("span",null,e.toDisplayString(V.key),1)]),e.createElementVNode("div",Mae,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",Lae,[e.createVNode(C,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(D,{class:"btn-delete",onClick:P=>g(V.id)},null,8,["onClick"]),e.createVNode(b,{size:"mini",type:"primary",onClick:m[4]||(m[4]=P=>u())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("setting.copy_tab")),1)]),_:1})])]),m[10]||(m[10]=e.createElementVNode("p",{class:"item-title"},"Alt",-1)),e.createVNode(S,{modelValue:V.alt,"onUpdate:modelValue":P=>V.alt=P,placeholder:e.unref(l)("setting.input_image_alt"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),m[11]||(m[11]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(S,{modelValue:V.key,"onUpdate:modelValue":P=>V.key=P,placeholder:e.unref(l)("setting.input_key"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",Oae,e.toDisplayString(e.unref(l)("setting.image")),1),e.createElementVNode("img",{class:"item-img",src:V.img},null,8,Qae),e.createElementVNode("div",Uae,[e.createVNode(S,{modelValue:V.img,"onUpdate:modelValue":P=>V.img=P,placeholder:e.unref(l)("setting.image_link"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(je,{modelValue:V.img,"onUpdate:modelValue":P=>V.img=P,name:V.key},null,8,["modelValue","onUpdate:modelValue","name"])]),m[12]||(m[12]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",Fae,[e.createVNode(Ya,{data:V.componentsDataJson,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:P=>V.componentsDataJson=P},null,8,["data","host","websiteId","locale","lang","footer","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-8cd20642"]]),zae={class:"tab-page__content"},Rae={key:0},vae={key:1,class:"component-wrapper",style:{position:"relative"}},jae="",Sc=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,a=e.computed(()=>{var j,O;return c.isPreview?((j=c.modelValue)==null?void 0:j.showMode)==="pc"?!ue():((O=c.modelValue)==null?void 0:O.showMode)==="mobile"?ue():!0:!0}),{proxy:i}=e.getCurrentInstance(),{$_vsWidth:s,$_vsScrollY:r,$vsScreenAddListener:l,$vsScreenDestroyListener:d}=i,c=n,u=e.ref(0),g=e.ref(!1),f=e.ref(!0),m=e.ref(null),h=e.ref(null),p=e.ref(!1),A=e.ref(!1),E=j=>{if(!j)return{top:0,left:0};const O=j.getBoundingClientRect(),v=window.pageYOffset||document.documentElement.scrollTop,W=window.pageXOffset||document.documentElement.scrollLeft;return{top:O.top+v,left:O.left+W}},x=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.classes)??null});e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.style)??null}),e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.type)??"TabPrimary"});const b=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.data)??[]}),C=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.fixed)??!0}),D=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.resetToTop)??!0}),S=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.scrollToTop)??!0}),w=e.computed(()=>{var j;return((j=c.modelValue)==null?void 0:j.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const V=e.computed(()=>b.value.some(j=>j.img)),P=e.computed(()=>{var j;return((j=b.value[u.value])==null?void 0:j.key)??null}),k=e.computed(()=>{var O;if(!((O=c.modelValue)!=null&&O.data)||!Array.isArray(c.modelValue.data))return[];const j=c.modelValue.data[u.value];return j?j.componentsDataJson||[]:[]}),I=()=>{var O;if(c.modelValue&&c.modelValue.data)return;const j={id:((O=c.modelValue)==null?void 0:O.id)||q(),type:"TabLogo",showMode:"",containerWidth:"",bgColor:"",classes:"custom-class another-class",width:"",bgColor:"",resetToTop:!1,fullWidth:!0,fixed:!1,scrollToTop:!1,data:[{id:q(),key:q(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab1",componentsDataJson:[]},{id:q(),key:q(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",j),u.value=0},L=()=>{var Y,oe;const j=h.value;if(!j)return;const O=j.getBoundingClientRect().top,v=m.value;if(!v)return;const W=v.getBoundingClientRect().top,R=+((oe=(Y=window.getComputedStyle(document.body))==null?void 0:Y.getPropertyValue("--header-height-calc"))==null?void 0:oe.split("px")[0])||0;if(W>R){g.value=!1;return}O<=R&&(g.value=!0)},U=()=>{if(!S.value)return;let j=0;D.value||(j=E(m.value).top-170),window.scroll({top:j,left:0,behavior:"smooth"})},Q=j=>{sessionStorage.setItem(jae,j)},H=(j,O)=>{debugger;o("handleDelete",j||c.modelValue.id,O)},z=j=>{debugger;o("handleCopy",j||c.modelValue)},K=(j,O,v)=>{debugger;o("handlePaste",j,O,v)},J=j=>{o("handleClick",j)};return e.watch(()=>r.value,()=>{L()}),e.watch(u,()=>{Q(P.value),f.value&&U(),f.value=!0}),e.watch(P,j=>{j||(u.value=0)}),e.onMounted(()=>{I(),e.nextTick(L),setTimeout(()=>{e.nextTick(L)},200),setTimeout(()=>{},1e3)}),(j,O)=>{var v;return a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tab-page",x.value]),style:e.normalizeStyle({backgroundColor:((v=n.modelValue)==null?void 0:v.bgColor)||"transparent"}),onMouseover:O[8]||(O[8]=W=>A.value=!0),onMouseout:O[9]||(O[9]=W=>A.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&C.value},{"is-thick":V.value}]]),ref_key:"hold",ref:m},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:h},[e.createVNode(Eae,{tabList:b.value,currentIdx:u.value,isFixed:g.value&&C.value,fullWidth:w.value,onUpdateCurrentIdx:O[0]||(O[0]=W=>u.value=W)},null,8,["tabList","currentIdx","isFixed","fullWidth"])],512)],2),e.createElementVNode("div",zae,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[P.value?(e.openBlock(),e.createElementBlock("div",{key:P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,W=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[P.value==W.key?(e.openBlock(),e.createElementBlock("div",Rae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.componentsDataJson,(R,Y)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:R.id},[R.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.template,(oe,we)=>(e.openBlock(),e.createElementBlock("div",{class:"component-wrapper",key:oe.id,style:{position:"relative"}},[e.createVNode(sn,{type:oe.type,"props-data":{modelValue:oe,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:O[1]||(O[1]=fe=>H(fe,k.value)),onHandleCopy:O[2]||(O[2]=fe=>z(fe)),onHandlePaste:fe=>K(fe,k.value,we),onHandleClick:J},null,8,["type","props-data","onHandlePaste"])]))),128)):(e.openBlock(),e.createElementBlock("div",vae,[e.createVNode(sn,{type:R.type,"props-data":{modelValue:R,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:O[3]||(O[3]=oe=>H(oe,k.value)),onHandleCopy:O[4]||(O[4]=oe=>z(oe)),onHandlePaste:oe=>K(oe,k.value,Y),onHandleClick:J},null,8,["type","props-data","onHandlePaste"])]))],64))),128))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:A.value,"onUpdate:show":O[5]||(O[5]=W=>A.value=W),locale:n.locale,onHandleEdit:O[6]||(O[6]=W=>p.value=!0),onHandleDelete:H,onHandleCopy:z,onHandlePaste:K},null,8,["show","locale"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Hae,{key:1,show:p.value,"onUpdate:show":O[7]||(O[7]=W=>p.value=W),data:n.modelValue,locale:n.locale,host:n.host,lang:n.lang,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","host","lang","websiteId","footer"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-4d2dbc33"]]),V2=Object.freeze(Object.defineProperty({__proto__:null,default:Sc},Symbol.toStringTag,{value:"Module"})),qae={class:"setting-content"},Yae={class:"setting-header flex items-center mb-10"},Gae={class:"header-title"},Kae={class:"setting-header flex items-center"},Wae={class:"setting-header flex items-center"},Xae={class:"setting-header flex items-center"},Jae={class:"setting-header flex items-center"},Zae={class:"setting-header flex items-center"},_ae={class:"preview-container"},$ae=["src"],eie={key:1,class:"no-preview"},tie={class:"setting-body"},nie={class:"setting-toolbar"},oie={class:"setting-item"},aie={class:"components-content"},iie=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=e.ref([{id:"preset-1",name:"YCCECE Background 1",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",size:"cover",position:"center center"},{id:"preset-2",name:"YCCECE Background 2",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-02.svg",size:"",position:""},{id:"preset-3",name:"YCCECE Background 3",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-03.svg",size:"cover",position:""},{id:"preset-4",name:"YCCECE Background 4",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-04.svg",size:"cover",position:""}]),s=e.ref(),r=i.value.find(u=>u.image===o.data.backgroundImage);s.value=r?r.id:"";const l=()=>{const u=i.value.find(g=>g.id===s.value);u&&(o.data.backgroundImage=`${u.image}`,o.data.backgroundSize=u.size,o.data.backgroundPosition=u.position)},d=t,c=()=>{d("update:show",!1)};return(u,g)=>{const f=e.resolveComponent("a-radio"),m=e.resolveComponent("a-radio-group"),h=e.resolveComponent("a-option"),p=e.resolveComponent("a-select"),A=e.resolveComponent("a-button"),E=e.resolveComponent("a-input"),x=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(x,{width:1200,visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",qae,[e.createElementVNode("div",Yae,[e.createElementVNode("span",Gae,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(m,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":g[0]||(g[0]=b=>n.data.showMode=b),type:"button"},{default:e.withCtx(()=>[e.createVNode(f,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(f,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(f,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",Kae,[g[7]||(g[7]=e.createElementVNode("span",{class:"header-title"},"Background Preset",-1)),e.createVNode(p,{modelValue:s.value,"onUpdate:modelValue":g[1]||(g[1]=b=>s.value=b),style:{width:"300px","margin-right":"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,b=>(e.openBlock(),e.createBlock(h,{value:b.id,key:b.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(A,{type:"primary",onClick:l},{default:e.withCtx(()=>[...g[6]||(g[6]=[e.createTextVNode("Apply",-1)])]),_:1})]),e.createElementVNode("div",Wae,[g[8]||(g[8]=e.createElementVNode("span",{class:"header-title"},"Image",-1)),e.createVNode(E,{modelValue:n.data.backgroundImage,"onUpdate:modelValue":g[2]||(g[2]=b=>n.data.backgroundImage=b),disabled:!0,placeholder:e.unref(a)("setting.image_link"),style:{width:"300px"}},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Xae,[g[9]||(g[9]=e.createElementVNode("span",{class:"header-title"},"Size",-1)),e.createVNode(E,{modelValue:n.data.backgroundSize,"onUpdate:modelValue":g[3]||(g[3]=b=>n.data.backgroundSize=b),disabled:!0,placeholder:e.unref(a)("setting.size"),style:{width:"300px"}},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Jae,[g[10]||(g[10]=e.createElementVNode("span",{class:"header-title"},"Position",-1)),e.createVNode(E,{modelValue:n.data.backgroundPosition,"onUpdate:modelValue":g[4]||(g[4]=b=>n.data.backgroundPosition=b),disabled:!0,placeholder:e.unref(a)("setting.position"),style:{width:"300px"}},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Zae,[g[12]||(g[12]=e.createElementVNode("span",{class:"header-title"},"Preview",-1)),e.createElementVNode("div",_ae,[n.data.backgroundImage?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.data.backgroundImage,style:e.normalizeStyle({"object-fit":n.data.backgroundSize||"cover","background-position":n.data.backgroundPosition||"center center",width:"100%",height:"100px",border:"1px solid #ddd"}),alt:"Background Preview"},null,12,$ae)):(e.openBlock(),e.createElementBlock("div",eie,"No preview available")),g[11]||(g[11]=e.createElementVNode("p",{class:"preview-note"}," A light grey background has been applied for previewing and will not be reflected on website. ",-1))])]),e.createElementVNode("div",tie,[e.createElementVNode("div",nie,[e.createElementVNode("h4",null,e.toDisplayString(e.unref(a)("setting.component")),1)]),e.createElementVNode("div",oie,[e.createElementVNode("div",aie,[e.createVNode(Ya,{data:n.data.data,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:g[5]||(g[5]=b=>n.data.data=b)},null,8,["data","host","websiteId","locale","lang","footer"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-90cecf14"]]),lie={class:"component-wrapper"},sie={key:1,class:"page-item"},rie={class:"component-wrapper"},Nc=te({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=e.computed(()=>{var S,w;return!((S=o.modelValue)!=null&&S.data)||!Array.isArray(o.modelValue.data)?[]:(w=o.modelValue)==null?void 0:w.data}),r=(S,w)=>{debugger;i("handleDelete",S||o.modelValue.id,w)},l=S=>{debugger;i("handleCopy",S||o.modelValue)},d=(S,w,V)=>{debugger;i("handlePaste",S,w,V)},c=S=>{i("handleClick",S)},u=e.ref(!1),g=e.ref(!1),f=()=>{var w,V;if(o.modelValue&&o.modelValue.data)return;const S={id:((w=o.modelValue)==null?void 0:w.id)||q(),type:"BackgroundWrapper",showMode:"",backgroundImage:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",backgroundSize:"cover",backgroundPosition:"center center",data:[{id:((V=o.modelValue)==null?void 0:V.id)||q(),type:"CustomText",showMode:"",data:{width:1920,backgroundColor:"#ffffff",title:a("placeholder.this_is_title"),description:a("placeholder.this_is_description")}}]};i("update:modelValue",S)},m=e.computed(()=>{var S,w;return o.isPreview?((S=o.modelValue)==null?void 0:S.showMode)==="pc"?!ue():((w=o.modelValue)==null?void 0:w.showMode)==="mobile"?ue():!0:!0}),h=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.classes)??null}),p=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.style)??null}),A=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.width)??null}),E=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundImage)??""}),x=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundColor)??"transparent"}),b=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundSize)??"contain"}),C=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundPosition)??"center"}),D=e.computed(()=>{var S;return((S=o.modelValue)==null?void 0:S.backgroundRepeat)??"no-repeat"});return f(),(S,w)=>m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["background-wrapper",h.value]),style:e.normalizeStyle(p.value)},[e.createElementVNode("div",{class:e.normalizeClass(A.value),style:{position:"relative"},onMouseover:w[6]||(w[6]=V=>u.value=!0),onMouseout:w[7]||(w[7]=V=>u.value=!1)},[e.createElementVNode("div",{class:"background-wrapper__bg",style:e.normalizeStyle({"background-image":`url('${E.value}')`,"background-color":`${x.value}`,"background-size":`${b.value}`,"background-position":`${C.value}`,"background-repeat":`${D.value}`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(V,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.id},[V.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(V.template,(k,I)=>(e.openBlock(),e.createElementBlock("div",{key:k.id,class:"page-item"},[e.createElementVNode("div",lie,[e.createVNode(sn,{type:k.type,"props-data":{modelValue:k,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:w[0]||(w[0]=L=>r(L,s.value)),onHandleCopy:w[1]||(w[1]=L=>l(L)),onHandlePaste:L=>d(L,s.value,I),onHandleClick:c},null,8,["type","props-data","onHandlePaste"])])]))),128)):(e.openBlock(),e.createElementBlock("div",sie,[e.createElementVNode("div",rie,[e.createVNode(sn,{type:V.type,"props-data":{modelValue:V,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:w[2]||(w[2]=k=>r(k,s.value)),onHandleCopy:w[3]||(w[3]=k=>l(k)),onHandlePaste:k=>d(k,s.value,P),onHandleClick:c},null,8,["type","props-data","onHandlePaste"])])]))],64))),128))],4),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:u.value,"onUpdate:show":w[4]||(w[4]=V=>u.value=V),locale:n.locale,onHandleEdit:w[5]||(w[5]=V=>g.value=!0),onHandleDelete:r,onHandleCopy:l,onHandlePaste:d},null,8,["show","locale"]))],34),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(iie,{key:0,show:g.value,"onUpdate:show":w[8]||(w[8]=V=>g.value=V),data:n.modelValue,locale:n.locale,lang:n.lang,host:n.host,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","lang","host","websiteId","footer"]))],6)):e.createCommentVNode("",!0)}},[["__scopeId","data-v-6bcebc4f"]]),B2=Object.freeze(Object.defineProperty({__proto__:null,default:Nc},Symbol.toStringTag,{value:"Module"}));var k2="Expected a function",D2=NaN,die="[object Symbol]",cie=/^\s+|\s+$/g,mie=/^[-+]0x[0-9a-f]+$/i,uie=/^0b[01]+$/i,hie=/^0o[0-7]+$/i,pie=parseInt,fie=typeof pa=="object"&&pa&&pa.Object===Object&&pa,gie=typeof self=="object"&&self&&self.Object===Object&&self,Aie=fie||gie||Function("return this")(),yie=Object.prototype,Cie=yie.toString,wie=Math.max,bie=Math.min,Ph=function(){return Aie.Date.now()};function Eie(n,t,o){var a,i,s,r,l,d,c=0,u=!1,g=!1,f=!0;if(typeof n!="function")throw new TypeError(k2);t=S2(t)||0,Tc(o)&&(u=!!o.leading,g="maxWait"in o,s=g?wie(S2(o.maxWait)||0,t):s,f="trailing"in o?!!o.trailing:f);function m(S){var w=a,V=i;return a=i=void 0,c=S,r=n.apply(V,w),r}function h(S){return c=S,l=setTimeout(E,t),u?m(S):r}function p(S){var w=S-d,V=S-c,P=t-w;return g?bie(P,s-V):P}function A(S){var w=S-d,V=S-c;return d===void 0||w>=t||w<0||g&&V>=s}function E(){var S=Ph();if(A(S))return x(S);l=setTimeout(E,p(S))}function x(S){return l=void 0,f&&a?m(S):(a=i=void 0,r)}function b(){l!==void 0&&clearTimeout(l),c=0,a=d=i=l=void 0}function C(){return l===void 0?r:x(Ph())}function D(){var S=Ph(),w=A(S);if(a=arguments,i=this,d=S,w){if(l===void 0)return h(d);if(g)return l=setTimeout(E,t),m(d)}return l===void 0&&(l=setTimeout(E,t)),r}return D.cancel=b,D.flush=C,D}function xie(n,t,o){var a=!0,i=!0;if(typeof n!="function")throw new TypeError(k2);return Tc(o)&&(a="leading"in o?!!o.leading:a,i="trailing"in o?!!o.trailing:i),Eie(n,t,{leading:a,maxWait:t,trailing:i})}function Tc(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Vie(n){return!!n&&typeof n=="object"}function Bie(n){return typeof n=="symbol"||Vie(n)&&Cie.call(n)==die}function S2(n){if(typeof n=="number")return n;if(Bie(n))return D2;if(Tc(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Tc(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(cie,"");var o=uie.test(n);return o||hie.test(n)?pie(n.slice(2),o?2:8):mie.test(n)?D2:+n}var kie=xie;const Die=ja(kie),Sie={class:"setting-content"},Nie={class:"setting-header flex items-center mb-10"},Tie={class:"header-title"},Pie={class:"setting-header flex items-center"},Iie={class:"header-title"},Mie={class:"setting-header flex items-center"},Lie={class:"header-title"},Oie={class:"setting-header flex items-center"},Qie={class:"header-title"},Uie={class:"setting-body"},Fie={class:"setting-toolbar"},Hie={class:"setting-item"},zie={class:"components-content"},Rie=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:"sc"},lang:{type:String,default:""},host:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{i("update:show",!1)};return(r,l)=>{const d=e.resolveComponent("a-radio"),c=e.resolveComponent("a-radio-group"),u=e.resolveComponent("a-input"),g=e.resolveComponent("a-option"),f=e.resolveComponent("a-select"),m=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(m,{width:1200,visible:n.show,footer:!1,onCancel:s,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Sie,[e.createElementVNode("div",Nie,[e.createElementVNode("span",Tie,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(c,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":l[0]||(l[0]=h=>n.data.showMode=h),type:"button"},{default:e.withCtx(()=>[e.createVNode(d,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(d,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(d,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",Pie,[e.createElementVNode("span",Iie,e.toDisplayString(e.unref(a)("setting.title")),1),e.createVNode(u,{modelValue:n.data.title,"onUpdate:modelValue":l[1]||(l[1]=h=>n.data.title=h),placeholder:e.unref(a)("setting.input_title"),"allow-clear":""},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Mie,[e.createElementVNode("span",Lie,e.toDisplayString(e.unref(a)("setting.component_width")),1),e.createVNode(f,{modelValue:n.data.width,"onUpdate:modelValue":l[2]||(l[2]=h=>n.data.width=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(g,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_default")),1)]),_:1}),e.createVNode(g,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_small")),1)]),_:1}),e.createVNode(g,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_middle")),1)]),_:1}),e.createVNode(g,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Oie,[e.createElementVNode("span",Qie,e.toDisplayString(e.unref(a)("setting.opened_by_default")),1),e.createVNode(f,{modelValue:n.data.openFirst,"onUpdate:modelValue":l[3]||(l[3]=h=>n.data.openFirst=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(g,{value:!0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.yes")),1)]),_:1}),e.createVNode(g,{value:!1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.no")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Uie,[e.createElementVNode("div",Fie,[e.createElementVNode("h4",null,e.toDisplayString(e.unref(a)("setting.component")),1)]),e.createElementVNode("div",Hie,[e.createElementVNode("div",zie,[e.createVNode(Ya,{data:n.data.data,host:n.host,websiteId:n.websiteId,locale:n.locale,lang:n.lang,footer:n.footer,onUpdate:l[4]||(l[4]=h=>n.data.data=h)},null,8,["data","host","websiteId","locale","lang","footer"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-d5320404"]]),vie={class:"collapse-custom__wrapper"},jie=["innerHTML"],qie={class:"collapse-custom__content__wrapper"},Yie={class:"component-wrapper"},Gie={key:1,class:"page-item"},Kie={class:"component-wrapper"},Pc=te({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:"sc"},lang:{type:String,default:""},websiteId:{type:Number,default:0},footer:{type:Object,default:()=>{}}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=e.ref(null),r=e.ref(0),l=e.ref(!1),d=e.ref(null),c=e.ref(!1),u=e.ref(!1),g=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.classes)??""}),f=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.style)??""});e.computed(()=>{var w;return(w=o.modelValue)==null?void 0:w.width});const m=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.title)??[]}),h=e.computed(()=>{var w;return((w=o.modelValue)==null?void 0:w.openFirst)??!1}),p=e.computed(()=>{var w,V;return!((w=o.modelValue)!=null&&w.data)||!Array.isArray(o.modelValue.data)?[]:(V=o.modelValue)==null?void 0:V.data}),A=()=>{var V;if(o.modelValue&&o.modelValue.data)return;const w={id:((V=o.modelValue)==null?void 0:V.id)||q(),type:"CollapseCustom",showMode:"",title:a("placeholder.title_here"),openFirst:!1,width:"",style:{},data:[]};i("update:modelValue",w)},E=e.computed(()=>{var w,V;return o.isPreview?((w=o.modelValue)==null?void 0:w.showMode)==="pc"?!ue():((V=o.modelValue)==null?void 0:V.showMode)==="mobile"?ue():!0:!0}),x=()=>{const w=s.value;w&&(r.value=w.scrollHeight)},b=(w,V)=>{debugger;i("handleDelete",w||o.modelValue.id,V)},C=w=>{debugger;i("handleCopy",w||o.modelValue)},D=(w,V,P)=>{debugger;i("handlePaste",w,V,P)},S=w=>{i("handleClick",w)};return e.onMounted(()=>{l.value=h.value,e.nextTick(x);const w=Die(()=>{x()},250);d.value=new ResizeObserver(w),d.value.observe(s.value)}),e.onBeforeUnmount(()=>{s.value&&d.value&&d.value.unobserve(s.value)}),A(),(w,V)=>{var P,k;return E.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["collapse-custom",g.value]),style:e.normalizeStyle(f.value),onMouseover:V[8]||(V[8]=I=>c.value=!0),onMouseout:V[9]||(V[9]=I=>c.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom_container",[(P=n.modelValue)!=null&&P.width?`container-content-${(k=n.modelValue)==null?void 0:k.width}`:"container-content"]])},[e.createElementVNode("div",vie,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["collapse-custom__btn",{"--is-collapsed":!l.value}]),onClick:V[0]||(V[0]=I=>l.value=!l.value)},[e.createElementVNode("h4",{class:"collapse-custom__btn__title",innerHTML:m.value},null,8,jie),V[10]||(V[10]=e.createElementVNode("span",{class:"collapse-custom__btn__icon"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom__content",{"--is-open":l.value}]),ref_key:"content",ref:s,style:e.normalizeStyle({"--scroll-height":`${r.value}px`})},[e.createElementVNode("div",qie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(I,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:I.id},[I.type==="SharedComponent"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(I.template,(U,Q)=>(e.openBlock(),e.createElementBlock("div",{key:U.id,class:"page-item"},[e.createElementVNode("div",Yie,[e.createVNode(sn,{type:U.type,"props-data":{modelValue:U,isPreview:!0,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:V[1]||(V[1]=H=>b(H,p.value)),onHandleCopy:V[2]||(V[2]=H=>C(H)),onHandlePaste:H=>D(H,p.value,Q),onHandleClick:S},null,8,["type","props-data","onHandlePaste"])])]))),128)):(e.openBlock(),e.createElementBlock("div",Gie,[e.createElementVNode("div",Kie,[e.createVNode(sn,{type:I.type,"props-data":{modelValue:I,isPreview:n.isPreview,host:n.host,locale:n.locale,lang:n.lang,footer:n.footer},onHandleDelete:V[3]||(V[3]=U=>b(U,p.value)),onHandleCopy:V[4]||(V[4]=U=>C(U)),onHandlePaste:U=>D(U,p.value,L),onHandleClick:S},null,8,["type","props-data","onHandlePaste"])])]))],64))),128))])],6)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:c.value,"onUpdate:show":V[5]||(V[5]=I=>c.value=I),locale:n.locale,onHandleEdit:V[6]||(V[6]=I=>u.value=!0),onHandleDelete:b,onHandleCopy:C,onHandlePaste:D},null,8,["show","locale"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Rie,{key:0,show:u.value,"onUpdate:show":V[7]||(V[7]=I=>u.value=I),data:n.modelValue,locale:n.locale,host:n.host,lang:n.lang,websiteId:n.websiteId,footer:n.footer},null,8,["show","data","locale","host","lang","websiteId","footer"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-e8565d79"]]),N2=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"})),Wie=["onClick"],Xie=te({__name:"VrTourTab",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,s=t,r=e.ref(0),l=e.ref(0),d=e.ref(0),c=e.ref(0),u=e.ref(null),g=e.ref(null),f=e.ref([]),m=e.computed(()=>r.value>40),h=e.computed(()=>d.value+c.value<l.value+40),p=e.computed({get(){return i.currentIdx??0},set(b){s("updateIdx",b)}});e.watch(a,()=>{A()});const A=()=>{var C;if(!((C=i.list)!=null&&C.length))return;g.value&&(r.value=g.value.scrollLeft),u.value&&(d.value=u.value.getBoundingClientRect().left,c.value=u.value.getBoundingClientRect().width);let b=null;f.value.length>0&&(b=Array.isArray(f.value)?f.value[f.value.length-1]:f.value),b&&b.getBoundingClientRect&&(l.value=b.getBoundingClientRect().left)},E=b=>{g.value&&(b==="next"?g.value.scrollLeft+=200:g.value.scrollLeft-=200)},x=()=>{A()};return e.onMounted(()=>{e.nextTick(()=>{x()})}),(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"VrtourWrapper",ref:u},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"VrtourList",ref:g,onScroll:x},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:C[0]||(C[0]=D=>E("prev"))},null,512),[[e.vShow,m.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(D,S)=>(e.openBlock(),e.createElementBlock("li",{key:S},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":p.value==S}]),ref_for:!0,ref_key:"VrtourBtn",ref:f,onClick:w=>p.value=S},e.toDisplayString(D.name),11,Wie)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:C[1]||(C[1]=D=>E("next"))},null,512),[[e.vShow,h.value]])],544)],512))}},[["__scopeId","data-v-45823646"]]),Jie=["onClick"],T2=te({__name:"VrTourCat",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),a=n,i=t,s=e.ref(null),r=e.ref(null),l=e.ref(null),d=e.ref(0),c=e.ref(0),u=e.ref(0),g=e.ref(0),f=e.ref(0),m=e.computed(()=>d.value>40),h=e.computed(()=>u.value+g.value<c.value+40),p=e.computed({get(){return a.currentIdx??0},set(C){i("updateIdx",C),e.nextTick(b)}}),A=()=>{var D;if(!((D=a.list)!=null&&D.length))return;r.value&&(d.value=r.value.scrollLeft),s.value&&(u.value=s.value.getBoundingClientRect().left,g.value=s.value.getBoundingClientRect().width);let C=null;l.value&&(C=Array.isArray(l.value)?l.value[l.value.length-1]:l.value),C&&C.getBoundingClientRect&&(c.value=C.getBoundingClientRect().left)},E=C=>{C=="next"?r.value.scrollLeft+=200:r.value.scrollLeft-=200},x=()=>{r.value&&(d.value=r.value.scrollLeft),A()},b=async()=>{if(await e.nextTick(),!l.value||!l.value[p.value])return;const C=l.value[p.value],D=C.clientWidth/2,S=o.$_vsWidth/2;f.value=C.getBoundingClientRect().right-D,r.value.scrollLeft-=S-f.value};return e.watch(()=>o.$_vsWidth,()=>{A()}),e.watch(()=>a.list,()=>{e.nextTick(A),r.value&&r.value.scrollLeft&&(r.value.scrollLeft=0)},{deep:!0}),e.onMounted(()=>{e.nextTick(x)}),(C,D)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"wrapper",ref:s},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:r,onScroll:x},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:D[0]||(D[0]=S=>E("prev"))},null,512),[[e.vShow,m.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(S,w)=>(e.openBlock(),e.createElementBlock("li",{key:w,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":p.value==w}]),ref_for:!0,ref_key:"btnRef",ref:l,onClick:V=>p.value=w},e.toDisplayString(S.name),11,Jie)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:D[1]||(D[1]=S=>E("next"))},null,512),[[e.vShow,h.value]])],544)],512))}},[["__scopeId","data-v-dec01fdd"]]),Zie={class:"tab-tag__nav__prev"},_ie=["onClick"],$ie=["src","alt"],ele={class:"tab-tag__btn__title"},tle={class:"tab-tag__nav__next"},nle=te({__name:"VrTourChoose",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,s=t,r=e.ref(null),l=e.ref(null),d=e.ref(null),c=e.ref(0),u=e.ref(0),g=e.ref(0),f=e.ref(0),m=e.ref(0),h=e.computed(()=>c.value>0),p=e.computed(()=>u.value-40>f.value),A=e.computed({get(){return i.currentIdx??0},set(D){s("updateIdx",D),e.nextTick(b)}}),E=()=>{var S,w,V,P;if(!((S=i.list)!=null&&S.length))return;c.value=(w=l.value)==null?void 0:w.scrollLeft,g.value=(V=r.value)==null?void 0:V.getBoundingClientRect().left,f.value=(P=r.value)==null?void 0:P.getBoundingClientRect().right;let D=null;d.value&&(D=Array.isArray(d.value)?d.value[d.value.length-1]:d.value),u.value=D==null?void 0:D.getBoundingClientRect().right},x=D=>{D==="next"?l.value.scrollLeft+=200:l.value.scrollLeft-=200},b=()=>{const D=d.value[A.value];if(!D)return;const S=D.clientWidth/2,w=a.value/2;m.value=D.getBoundingClientRect().right-S,l.value.scrollLeft-=w-m.value},C=()=>{E()};return e.watch(()=>a.value,()=>{E()}),e.watch(()=>i.list,()=>{e.nextTick(E),l.value&&l.value.scrollLeft&&(l.value.scrollLeft=0)}),e.onMounted(()=>{e.nextTick(C)}),(D,S)=>(e.openBlock(),e.createElementBlock("div",{class:"vr-tour-choose tab-tag",ref_key:"wrapper",ref:r},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:l,onScroll:C},[e.withDirectives(e.createElementVNode("div",Zie,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:S[0]||(S[0]=w=>x("prev"))})],512),[[e.vShow,h.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(w,V)=>(e.openBlock(),e.createElementBlock("li",{key:V,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":A.value===V}]),ref_for:!0,ref_key:"btn",ref:d,onClick:P=>A.value=V},[e.createElementVNode("img",{src:w.url,alt:w.name},null,8,$ie),e.createElementVNode("div",ele,e.toDisplayString(w.name),1)],10,_ie)]))),128)),e.withDirectives(e.createElementVNode("div",tle,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:S[1]||(S[1]=w=>x("next"))})],512),[[e.vShow,p.value]])],544)],512))}},[["__scopeId","data-v-8086a4bf"]]),ole={class:"vr-tour-scene"},ale=["src"],ile={key:1,class:"vr-tour-scene__img"},lle=["src","alt"],sle=te({__name:"VrTourScene",props:{scene:{type:Object,default:()=>({})}},setup(n){const t=n,o=e.computed(()=>{var s;return(s=t.scene)==null?void 0:s.embed}),a=e.computed(()=>{var s;return(s=t.scene)==null?void 0:s.url}),i=e.computed(()=>{var s;return(s=t.scene)==null?void 0:s.name});return(s,r)=>(e.openBlock(),e.createElementBlock("div",ole,[o.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:o.value,frameborder:"0"},null,8,ale)):(e.openBlock(),e.createElementBlock("div",ile,[e.createElementVNode("img",{src:a.value,alt:i.value},null,8,lle)]))]))}},[["__scopeId","data-v-c07507d5"]]),rle={class:"vr-tour-select"},dle={class:"select-btn__focus-name line-clamp-1"},cle={class:"select-list"},mle=["onClick"],P2=te({__name:"VrTourSelect",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i={mounted(p,A){p.clickOutsideEvent=E=>{p===E.target||p.contains(E.target)||A.value(E)},document.body.addEventListener("click",p.clickOutsideEvent)},unmounted(p){document.body.removeEventListener("click",p.clickOutsideEvent)}},s=n,r=t,l=e.ref(!1),d=e.ref(-8),c=e.ref(null),u=e.computed({get(){return s.currentIdx??0},set(p){r("updateIdx",p)}}),g=e.computed(()=>{var p;return((p=s.list[u.value])==null?void 0:p.name)||""});e.watch(l,()=>{m()}),e.onMounted(()=>{window.addEventListener("resize",()=>{a.value=window.innerWidth,l.value&&m()})});const f=()=>{l.value=!1},m=()=>{const p=c.value;if(!p)return;const A=ui(p).x+p.clientWidth;A>a.value&&(d.value=d.value-A+a.value-4)},h=p=>{u.value=p,f()};return(p,A)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",rle,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["select-btn",{"is-open":l.value}]),onClick:A[0]||(A[0]=E=>l.value=!l.value)},[e.createElementVNode("div",dle,e.toDisplayString(g.value),1),A[1]||(A[1]=e.createElementVNode("div",{class:"select-btn__arrow"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["select-block",{"is-open":l.value}]),style:e.normalizeStyle({"--left":`${d.value}px`}),ref_key:"blockRef",ref:c},[e.createElementVNode("ul",cle,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(E,x)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["select-item line-clamp-1",{"is-active":u.value===x}]),key:x,onClick:b=>h(x)},e.toDisplayString(E.name),11,mle))),128))])],6)])),[[i,f]])}},[["__scopeId","data-v-536804a2"]]),ule={class:"setting-content"},hle={class:"setting-header flex items-center mb-10"},ple={class:"header-title"},fle={class:"setting-header flex items-center"},gle={class:"header-title"},Ale={class:"setting-body"},yle={class:"setting-toolbar"},Cle={class:"tools"},wle={class:"setting-item"},ble={class:"item-header"},Ele={class:"btn-group"},xle={key:0,class:"drag-handle"},Vle={key:0},Ble={class:"item-header"},kle={class:"btn-group"},Dle={key:0,class:"drag-handle"},Sle={class:"item-header"},Nle={class:"btn-group"},Tle={key:0,class:"drag-handle"},Ple={class:"item-title"},Ile=["src"],Mle={class:"item-uplaod flex items-center"},Lle={style:{"text-align":"center"}},Ole={style:{"text-align":"center","margin-top":"20px"}},Qle=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=e.computed(()=>({animation:200,group:"gallerys-Categories",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=h=>h&&h.length>1,d=n,{t:c}=de(()=>d.locale),u=t,g=()=>{u("update:show",!1)},f=(h,p)=>{debugger;const A=d.data;h==="Campus"?A.data.push({key:q(),name:"New Campus",categoriesList:[]}):h==="Category"?p.categoriesList.push(JSON.parse(JSON.stringify({key:q(),name:"New Category",facilitiesList:[]}))):h==="facilitiy"?p.facilitiesList.push({key:q(),name:"New facilitiy",url:"",scene:null,embed:""}):A.data.push({id:q(),key:q(),name:"New Tab",link:"/",componentsDataJson:[]})},m=(h,p,A)=>{debugger;if(p==="Campuses")d.data.data=d.data.data.filter(E=>E.key!==h);else if(p==="facilitiy"){const E=A.findIndex(x=>x.key===h);E!==-1&&A.splice(E,1)}else if(p==="categories"){const E=A.findIndex(x=>x.key===h);E!==-1&&A.splice(E,1)}};return(h,p)=>{const A=e.resolveComponent("a-radio"),E=e.resolveComponent("a-radio-group"),x=e.resolveComponent("a-option"),b=e.resolveComponent("a-select"),C=e.resolveComponent("icon-plus"),D=e.resolveComponent("a-button"),S=e.resolveComponent("icon-drag-arrow"),w=e.resolveComponent("icon-delete"),V=e.resolveComponent("a-input"),P=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(P,{width:500,visible:n.show,footer:!1,onCancel:g,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(c)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ule,[e.createElementVNode("div",hle,[e.createElementVNode("span",ple,e.toDisplayString(e.unref(c)("setting.show_mode_pc_mobile")),1),e.createVNode(E,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":p[0]||(p[0]=k=>n.data.showMode=k),type:"button"},{default:e.withCtx(()=>[e.createVNode(A,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.only_show_all")),1)]),_:1}),e.createVNode(A,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.only_show_pc")),1)]),_:1}),e.createVNode(A,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",fle,[e.createElementVNode("span",gle,e.toDisplayString(e.unref(c)("setting.bg_color")),1),e.createVNode(b,{modelValue:n.data.data.bgColor,"onUpdate:modelValue":p[1]||(p[1]=k=>n.data.data.bgColor=k),placeholder:e.unref(c)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(x,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.bg_white")),1)]),_:1}),e.createVNode(x,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Ale,[e.createElementVNode("div",yle,[p[11]||(p[11]=e.createElementVNode("h1",null,"Campuses",-1)),e.createElementVNode("div",Cle,[e.createVNode(D,{type:"primary",onClick:p[2]||(p[2]=k=>f("Campus"))},{icon:e.withCtx(()=>[e.createVNode(C)]),default:e.withCtx(()=>[p[10]||(p[10]=e.createTextVNode(" Campus ",-1))]),_:1})])]),e.createElementVNode("div",wle,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":p[7]||(p[7]=k=>n.data.data=k),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!l(n.data.data),onStart:p[8]||(p[8]=k=>a.value=!0),onEnd:p[9]||(p[9]=k=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:k})=>{var I;return[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(n.data.data)}]),key:k.key},[e.createElementVNode("div",ble,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(k.name),1)]),e.createElementVNode("div",Ele,[l(n.data.data)?(e.openBlock(),e.createElementBlock("div",xle,[e.createVNode(S,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:L=>m(k.key,"Campuses")},null,8,["onClick"])])]),p[16]||(p[16]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(V,{modelValue:k.name,"onUpdate:modelValue":L=>k.name=L,placeholder:e.unref(c)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),p[17]||(p[17]=e.createElementVNode("p",{class:"item-title"},"Categories",-1)),e.createElementVNode("div",null,[(I=k.categoriesList)!=null&&I.length?(e.openBlock(),e.createElementBlock("div",Vle,[e.createVNode(e.unref(o),e.mergeProps({modelValue:k.categoriesList,"onUpdate:modelValue":L=>k.categoriesList=L,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},r.value,{disabled:!l(k.categoriesList),onStart:p[5]||(p[5]=L=>a.value=!0),onEnd:p[6]||(p[6]=L=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:L})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(k.categoriesList)}]),key:L.id,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",Ble,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(L.name),1)]),e.createElementVNode("div",kle,[l(k.categoriesList)?(e.openBlock(),e.createElementBlock("div",Dle,[e.createVNode(S,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:U=>m(L.key,"categories",k.categoriesList)},null,8,["onClick"])])]),p[14]||(p[14]=e.createElementVNode("p",null,"Name",-1)),e.createVNode(V,{modelValue:L.name,"onUpdate:modelValue":U=>L.name=U,placeholder:e.unref(c)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),p[15]||(p[15]=e.createElementVNode("p",{class:"item-title"},"Facilities",-1)),e.createElementVNode("div",null,[e.createVNode(e.unref(o),e.mergeProps({modelValue:L.facilitiesList,"onUpdate:modelValue":U=>L.facilitiesList=U,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},s.value,{disabled:!l(L.facilitiesList),onStart:p[3]||(p[3]=U=>a.value=!0),onEnd:p[4]||(p[4]=U=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:U})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(L.facilitiesList)}]),key:U.key,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",Sle,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(U.name),1)]),e.createElementVNode("div",Nle,[l(L.facilitiesList)?(e.openBlock(),e.createElementBlock("div",Tle,[e.createVNode(S,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:Q=>m(U.key,"facilitiy",L.facilitiesList)},null,8,["onClick"])])]),p[12]||(p[12]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(V,{modelValue:U.name,"onUpdate:modelValue":Q=>U.name=Q,placeholder:e.unref(c)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",Ple,e.toDisplayString(e.unref(c)("setting.image")),1),e.createElementVNode("img",{class:"item-img",src:U.url},null,8,Ile),e.createElementVNode("div",Mle,[e.createVNode(V,{modelValue:U.url,"onUpdate:modelValue":Q=>U.url=Q,placeholder:e.unref(c)("setting.image_link"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(je,{modelValue:U.url,"onUpdate:modelValue":Q=>U.url=Q,name:U.key},null,8,["modelValue","onUpdate:modelValue","name"])]),p[13]||(p[13]=e.createElementVNode("p",{class:"item-title"},"VR Embed URL",-1)),e.createVNode(V,{modelValue:U.embed,"onUpdate:modelValue":Q=>U.embed=Q,placeholder:e.unref(c)("setting.please_input"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])]),e.createElementVNode("div",Lle,[e.createVNode(D,{type:"primary",onClick:U=>f("facilitiy",L)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.add")),1)]),_:1},8,["onClick"])])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ole,[e.createVNode(D,{type:"primary",onClick:L=>f("Category",k)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("setting.add")),1)]),_:1},8,["onClick"])])],2))]}),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-13185b94"]]),Ule={class:"vr-tour__wrapper"},Fle={key:0,class:"vr-tour__tabs"},Hle={class:"container-content-middle"},zle={key:1,class:"vr-tour__selects"},Rle={class:"container-content"},vle={class:"vr-tour__selects__list"},jle={class:"vr-tour__scene"},qle={key:2,class:"vr-tour__cats"},Yle={class:"pt-2"},Gle={key:3,class:"vr-tour__chooses"},Ic=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=t,d=n,c=e.computed(()=>{var w,V;return d.isPreview?((w=d.modelValue)==null?void 0:w.showMode)==="pc"?!ue():((V=d.modelValue)==null?void 0:V.showMode)==="mobile"?ue():!0:!0}),u=e.ref(0),g=e.ref(0),f=e.ref(0),m=e.ref(!1),h=e.ref(!1),p=e.computed(()=>{var V;const w=(V=d.modelValue)==null?void 0:V.data;return Array.isArray(w)?w:[]}),A=e.computed(()=>{var V;const w=(V=p.value[u.value])==null?void 0:V.categoriesList;return Array.isArray(w)?w:[]}),E=e.computed(()=>{var V;const w=(V=A.value[g.value])==null?void 0:V.facilitiesList;return Array.isArray(w)?w:[]}),x=e.computed(()=>{var w;return(w=E.value)==null?void 0:w[f.value]}),b=()=>{var V;if(d.modelValue&&d.modelValue.data)return;const w={id:((V=d.modelValue)==null?void 0:V.id)||q(),type:"VrTour",showMode:"",containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",data:[{key:q(),name:"SecondarySchool",categoriesList:[{key:q(),name:"Facilities",facilitiesList:[{key:q(),name:"ECE Learning Communities",url:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt/multi_floor_plans/853_floorplan.png",scene:null,embed:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt-2026/en/index.html"}]}]}]};l("update:modelValue",w),u.value=0};e.watch(u,()=>{g.value=0}),e.watch(g,()=>{f.value=0});const C=()=>{l("handleDelete",d.modelValue.id)},D=()=>{l("handleCopy",d.modelValue)},S=w=>{l("handlePaste",w)};return b(),(w,V)=>{var P;return c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vr-tour",{"pb-0":E.value&&E.value.length<=1}]),style:e.normalizeStyle({backgroundColor:((P=n.modelValue)==null?void 0:P.bgColor)||"transparent"}),onMouseover:V[9]||(V[9]=k=>h.value=!0),onMouseout:V[10]||(V[10]=k=>h.value=!1)},[e.createElementVNode("div",Ule,[p.value&&p.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",Fle,[e.createElementVNode("div",Hle,[e.createVNode(Xie,{list:p.value,onUpdateIdx:V[0]||(V[0]=k=>u.value=k),currentIdx:u.value},null,8,["list","currentIdx"])])])):e.createCommentVNode("",!0),e.unref(a)<768?(e.openBlock(),e.createElementBlock("div",zle,[e.createElementVNode("div",Rle,[e.createElementVNode("div",vle,[p.value.length>1?(e.openBlock(),e.createBlock(P2,{key:0,list:p.value,onUpdateIdx:V[1]||(V[1]=k=>u.value=k),currentIdx:u.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0),A.value.length>1?(e.openBlock(),e.createBlock(P2,{key:1,list:A.value,onUpdateIdx:V[2]||(V[2]=k=>g.value=k),currentIdx:g.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])]),E.value.length>1?(e.openBlock(),e.createBlock(T2,{key:0,list:E.value,onUpdateIdx:V[3]||(V[3]=k=>f.value=k),currentIdx:f.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jle,[e.createVNode(sle,{scene:x.value},null,8,["scene"])]),A.value&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",qle,[e.withDirectives(e.createElementVNode("div",Yle,null,512),[[e.vShow,A.value.length<=1&&E.value&&E.value.length>1]]),e.withDirectives(e.createVNode(T2,{list:A.value,onUpdateIdx:V[4]||(V[4]=k=>g.value=k),currentIdx:g.value},null,8,["list","currentIdx"]),[[e.vShow,A.value.length>1]])])):e.createCommentVNode("",!0),E.value&&E.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",Gle,[e.createVNode(nle,{list:E.value,onUpdateIdx:V[5]||(V[5]=k=>f.value=k),currentIdx:f.value},null,8,["list","currentIdx"])])):e.createCommentVNode("",!0)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:h.value,"onUpdate:show":V[6]||(V[6]=k=>h.value=k),locale:n.locale,onHandleEdit:V[7]||(V[7]=k=>m.value=!0),onHandleDelete:C,onHandleCopy:D,onHandlePaste:S},null,8,["show","locale"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Qle,{key:1,show:m.value,"onUpdate:show":V[8]||(V[8]=k=>m.value=k),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-f8f37cdb"]]),I2=Object.freeze(Object.defineProperty({__proto__:null,default:Ic},Symbol.toStringTag,{value:"Module"})),Kle={class:"seting-box"},Wle={class:"setting-header flex items-center mb-10"},Xle={class:"header-title"},Jle={class:"item-title"},Zle={class:"item-title"},_le={class:"part_title",style:{"margin-top":"20px"}},$le={key:0},ese={class:"setting-header items-center"},tse={class:"draggable_box"},nse={class:"drag_top_box"},ose=["onClick"],ase={class:"item-title",style:{"margin-top":"20px"}},ise={class:"item-title",style:{"margin-top":"20px"}},lse={key:0},sse={class:"draggable_link_box"},rse={class:"drag_link_top_box"},dse=["onClick"],cse={class:"link-title",style:{"margin-top":"20px"}},mse={class:"link-title",style:{"margin-top":"20px"}},use=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:""}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.computed(()=>({animation:200,group:"gridLinks",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),i=e.computed(()=>({animation:200,group:"gridLinkItems",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.ref(!1),r=e.ref(!1),l=n,{t:d}=de(()=>l.locale),c=e.ref(new Set),u=e.ref(new Set),g=()=>{var w,V;(V=(w=l.data)==null?void 0:w.data)!=null&&V.list&&Array.isArray(l.data.data.list)&&(c.value.clear(),u.value.clear(),l.data.data.list.forEach(P=>{P.id&&c.value.add(P.id),P.links&&Array.isArray(P.links)&&P.links.length>0&&P.links.forEach(k=>{k.id&&u.value.add(k.id)})}))},f=e.ref(!1);e.watch(()=>l.show,w=>{w&&!f.value?(f.value=!0,e.nextTick(()=>{g()})):w||(f.value=!1)},{immediate:!0});const m=w=>{var V,P;c.value.has(w.id)?(c.value.clear(),(P=(V=l.data)==null?void 0:V.data)!=null&&P.list&&l.data.data.list.forEach(k=>{k.id!==w.id&&c.value.add(k.id)})):c.value.add(w.id)},h=w=>c.value.has(w.id),p=w=>{l.data.data.list=l.data.data.list.filter(V=>V.id!==w)},A=()=>{var P,k;const w=l.data.data,V=q();w.list.push({id:V,title:d("placeholder.title_here"),links:[]}),c.value.clear(),(k=(P=l.data)==null?void 0:P.data)!=null&&k.list&&l.data.data.list.forEach(I=>{I.id!==V&&c.value.add(I.id)}),e.nextTick(()=>{if(typeof document<"u"){const I=document.querySelector(".arco-drawer-body");I&&(I.scrollTop=I.scrollHeight)}})},E=w=>{u.value.has(w.id)?u.value.delete(w.id):u.value.add(w.id)},x=w=>u.value.has(w.id),b=w=>{const V=l.data.data.list.find(P=>P.id===w);if(V){const P=q();V.links.push({id:P,name:d("placeholder.name_here"),link:""}),V.links&&Array.isArray(V.links)&&V.links.forEach(k=>{k.id!==P?u.value.add(k.id):u.value.delete(k.id)})}},C=(w,V)=>{const P=l.data.data.list.find(k=>k.id===w);P&&P.links&&(P.links=P.links.filter(k=>k.id!==V))},D=t,S=()=>{D("update:show",!1)};return(w,V)=>{const P=e.resolveComponent("a-radio"),k=e.resolveComponent("a-radio-group"),I=e.resolveComponent("a-option"),L=e.resolveComponent("a-select"),U=e.resolveComponent("icon-drag-dot"),Q=e.resolveComponent("icon-drag-arrow"),H=e.resolveComponent("icon-delete"),z=e.resolveComponent("a-input"),K=e.resolveComponent("icon-plus"),J=e.resolveComponent("a-button"),j=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(j,{width:500,visible:n.show,footer:!1,onCancel:S,unmountOnClose:""},{title:e.withCtx(()=>{var O;return[e.createTextVNode(e.toDisplayString((O=n.data)==null?void 0:O.type)+" "+e.toDisplayString(e.unref(d)("setting.component_edit")),1)]}),default:e.withCtx(()=>[e.createElementVNode("div",Kle,[e.createElementVNode("div",Wle,[e.createElementVNode("span",Xle,e.toDisplayString(e.unref(d)("setting.show_mode_pc_mobile")),1),e.createVNode(k,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":V[0]||(V[0]=O=>n.data.showMode=O),type:"button"},{default:e.withCtx(()=>[e.createVNode(P,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_all")),1)]),_:1}),e.createVNode(P,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_pc")),1)]),_:1}),e.createVNode(P,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("p",Jle,e.toDisplayString(e.unref(d)("setting.component_width")),1),e.createVNode(L,{modelValue:n.data.data.width,"onUpdate:modelValue":V[1]||(V[1]=O=>n.data.data.width=O),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(I,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_default")),1)]),_:1}),e.createVNode(I,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_small")),1)]),_:1}),e.createVNode(I,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_middle")),1)]),_:1}),e.createVNode(I,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("p",Zle,e.toDisplayString(e.unref(d)("setting.component_bg")),1),e.createVNode(L,{modelValue:n.data.bgColor,"onUpdate:modelValue":V[2]||(V[2]=O=>n.data.bgColor=O),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(I,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_white")),1)]),_:1}),e.createVNode(I,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"]),e.createElementVNode("div",_le,e.toDisplayString(e.unref(d)("setting.link_list")),1),n.data.data.list.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$le,e.toDisplayString(e.unref(d)("setting.no_data")),1)),e.createElementVNode("div",ese,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data.list,"onUpdate:modelValue":V[5]||(V[5]=O=>n.data.data.list=O),"component-data":{tag:"div",type:"transition-group",name:s.value?null:"flip-list"}},a.value,{disabled:!1,onStart:V[6]||(V[6]=O=>s.value=!0),onEnd:V[7]||(V[7]=O=>s.value=!1),"item-key":"id"}),{item:e.withCtx(({element:O})=>[e.createElementVNode("div",tse,[e.createElementVNode("div",nse,[e.createElementVNode("div",{class:"drag-handle",onClick:v=>m(O)},[e.createVNode(U,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(O.title),1)],8,ose),e.createElementVNode("div",null,[e.createVNode(Q,{class:"icon_drag"}),e.createVNode(H,{class:"btn-delete",onClick:e.withModifiers(v=>p(O.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",ase,e.toDisplayString(e.unref(d)("setting.title")),1),e.createVNode(z,{modelValue:O.title,"onUpdate:modelValue":v=>O.title=v,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",ise,e.toDisplayString(e.unref(d)("setting.link")),1),O.links.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lse,e.toDisplayString(e.unref(d)("setting.no_data")),1)),e.createVNode(e.unref(o),e.mergeProps({modelValue:O.links,"onUpdate:modelValue":v=>O.links=v,"component-data":{tag:"div",type:"transition-group",name:r.value?null:"flip-list"}},i.value,{disabled:!1,onStart:V[3]||(V[3]=v=>r.value=!0),onEnd:V[4]||(V[4]=v=>r.value=!1),"item-key":"id"}),{item:e.withCtx(({element:v})=>[e.createElementVNode("div",sse,[e.createElementVNode("div",rse,[e.createElementVNode("div",{class:"drag-handle",onClick:W=>E(v)},[e.createVNode(U,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(e.unref(d)("setting.link")),1)],8,dse),e.createElementVNode("div",null,[e.createVNode(Q,{class:"icon_drag"}),e.createVNode(H,{class:"btn-delete",onClick:e.withModifiers(W=>C(O.id,v.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",cse,e.toDisplayString(e.unref(d)("setting.name")),1),e.createVNode(z,{modelValue:v.name,"onUpdate:modelValue":W=>v.name=W,placeholder:e.unref(d)("setting.input_name"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",mse,e.toDisplayString(e.unref(d)("setting.link_url")),1),e.createVNode(z,{modelValue:v.link,"onUpdate:modelValue":W=>v.link=W,placeholder:e.unref(d)("setting.input_link_url"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],512),[[e.vShow,!x(v)]])]),_:2},1024)])]),_:2},1040,["modelValue","onUpdate:modelValue","component-data"]),e.createVNode(J,{style:{"margin-top":"20px"},size:"mini",type:"primary",onClick:v=>b(O.id)},{icon:e.withCtx(()=>[e.createVNode(K)]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(d)("setting.link")),1)]),_:1},8,["onClick"])],512),[[e.vShow,!h(O)]])]),_:2},1024)])]),_:1},16,["modelValue","component-data"])]),e.createVNode(J,{type:"primary",onClick:A,style:{"margin-top":"20px"}},{icon:e.withCtx(()=>[e.createVNode(K)]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.add_row")),1)]),_:1})])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-990efe62"]]),hse=["innerHTML"],pse={key:0,class:"grid-links__sublist"},fse=["onClick"],gse={key:1,class:"grid-links__subitem__link"},Ih=te(e.defineComponent({name:"GridLinks",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=h=>{!h||!o.isPreview||i("handleClick",h)},r=e.computed(()=>{var h,p;return o.isPreview?((h=o.modelValue)==null?void 0:h.showMode)==="pc"?!ue():((p=o.modelValue)==null?void 0:p.showMode)==="mobile"?ue():!0:!0}),l=()=>{var p;if(o.modelValue&&o.modelValue.data)return;const h={id:((p=o.modelValue)==null?void 0:p.id)||q(),type:"GridLinks",showMode:"",data:{width:"",bgColor:"",list:[{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:""},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]},{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]},{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]},{id:q(),title:a("placeholder.title_here"),links:[{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"},{id:q(),name:a("placeholder.name_here"),link:"https://www.ycyw-edu.com"}]}]}};i("update:modelValue",h)},d=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var A,E;const h=(E=(A=o.modelValue)==null?void 0:A.data)==null?void 0:E.width;return!h||h==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[h]||"container-content"}),g=()=>{i("handleDelete",o.modelValue.id)},f=()=>{i("handleCopy",o.modelValue)},m=h=>{i("handlePaste",h)};return l(),(h,p)=>{var A,E,x;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gridLinks_wrap",style:e.normalizeStyle({backgroundColor:((A=n.modelValue)==null?void 0:A.bgColor)||"transparent"}),onMouseenter:p[2]||(p[2]=b=>d.value=!0),onMouseleave:p[3]||(p[3]=b=>d.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(u.value)},[e.createElementVNode("div",{class:"grid-links__row",style:e.normalizeStyle({"--grid-columns-mobile":h.mobileCol,"--grid-columns-desktop":h.desktopCol})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((x=(E=n.modelValue)==null?void 0:E.data)==null?void 0:x.list)||[],(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"grid-links__item",key:`${(b==null?void 0:b.title)||"item"}-${C}`},[e.createElementVNode("h6",{class:"grid-links__item__title",innerHTML:(b==null?void 0:b.title)||""},null,8,hse),Array.isArray(b==null?void 0:b.links)&&b.links.length?(e.openBlock(),e.createElementBlock("ul",pse,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((b==null?void 0:b.links)||[],(D,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${(D==null?void 0:D.name)||"sub"}-${S}`,class:"grid-links__subitem"},[D!=null&&D.link?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:w=>s(D.link),class:"link_text"},[e.createTextVNode(e.toDisplayString(D==null?void 0:D.name)+" ",1),p[5]||(p[5]=e.createElementVNode("span",{class:"link_text__underline"},null,-1))],8,fse)):(e.openBlock(),e.createElementBlock("div",gse,e.toDisplayString(D==null?void 0:D.name),1))]))),128))])):e.createCommentVNode("",!0)]))),128))],4)],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:d.value,"onUpdate:show":p[0]||(p[0]=b=>d.value=b),locale:n.locale,onHandleEdit:p[1]||(p[1]=b=>c.value=!0),onHandleDelete:g,onHandleCopy:f,onHandlePaste:m},null,8,["show","locale"]))],36)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(use,{key:1,show:c.value,"onUpdate:show":p[4]||(p[4]=b=>c.value=b),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-705a66b5"]]),M2=Object.freeze(Object.defineProperty({__proto__:null,default:Ih},Symbol.toStringTag,{value:"Module"})),Ase={class:"setting-content"},yse={class:"setting-header flex items-center mb-10"},Cse={class:"header-title"},wse={class:"setting-header flex items-center"},bse={class:"header-title"},Ese={class:"setting-body"},xse={class:"setting-toolbar"},Vse={class:"tools"},Bse={class:"setting-item"},kse={class:"item-header"},Dse={class:"btn-group"},Sse={key:0,class:"drag-handle"},Nse={class:"item-title"},Tse={class:"item-title"},Pse=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:"sc"}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ut)),i=e.ref(!1),s=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=m=>m&&m.length>1,l=n,{t:d}=de(()=>l.locale),c=t,u=()=>{c("update:show",!1)},g=m=>{l.data.data.push({key:q(),title:"[[TITLE]]",content:""})},f=m=>{l.data.data=l.data.data.filter(h=>h.key!==m)};return(m,h)=>{const p=e.resolveComponent("a-radio"),A=e.resolveComponent("a-radio-group"),E=e.resolveComponent("a-option"),x=e.resolveComponent("a-select"),b=e.resolveComponent("icon-plus"),C=e.resolveComponent("a-button"),D=e.resolveComponent("icon-drag-arrow"),S=e.resolveComponent("icon-delete"),w=e.resolveComponent("a-input"),V=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(V,{width:500,visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(d)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ase,[e.createElementVNode("div",yse,[e.createElementVNode("span",Cse,e.toDisplayString(e.unref(d)("setting.show_mode_pc_mobile")),1),e.createVNode(A,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":h[0]||(h[0]=P=>n.data.showMode=P),type:"button"},{default:e.withCtx(()=>[e.createVNode(p,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_all")),1)]),_:1}),e.createVNode(p,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_pc")),1)]),_:1}),e.createVNode(p,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",wse,[e.createElementVNode("span",bse,e.toDisplayString(e.unref(d)("setting.component_width")),1),e.createVNode(x,{modelValue:n.data.width,"onUpdate:modelValue":h[1]||(h[1]=P=>n.data.width=P),placeholder:e.unref(d)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(E,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_default")),1)]),_:1}),e.createVNode(E,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_small")),1)]),_:1}),e.createVNode(E,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_middle")),1)]),_:1}),e.createVNode(E,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Ese,[e.createElementVNode("div",xse,[h[7]||(h[7]=e.createElementVNode("h4",null,"Topics",-1)),e.createElementVNode("div",Vse,[e.createVNode(C,{type:"primary",onClick:h[2]||(h[2]=P=>g())},{icon:e.withCtx(()=>[e.createVNode(b)]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(d)("setting.add_tab")),1)]),_:1}),e.createVNode(C,{type:"primary",onClick:h[3]||(h[3]=P=>g())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("setting.paste_tab")),1)]),_:1})])]),e.createElementVNode("div",Bse,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":h[4]||(h[4]=P=>n.data.data=P),"component-data":{tag:"div",type:"transition-group",name:i.value?null:"flip-list"}},s.value,{disabled:!r(n.data.data),onStart:h[5]||(h[5]=P=>i.value=!0),onEnd:h[6]||(h[6]=P=>i.value=!1),"item-key":"key"}),{item:e.withCtx(({element:P})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:P.key},[e.createElementVNode("div",kse,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(P.title),1)]),e.createElementVNode("div",Dse,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",Sse,[e.createVNode(D,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(S,{class:"btn-delete",onClick:k=>f(P.key)},null,8,["onClick"])])]),e.createElementVNode("p",Nse,e.toDisplayString(e.unref(d)("setting.title")),1),e.createVNode(w,{modelValue:P.title,"onUpdate:modelValue":k=>P.title=k,placeholder:e.unref(d)("setting.input_title"),"allow-clear":""},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createElementVNode("p",Tse,e.toDisplayString(e.unref(d)("setting.content")),1),e.createVNode(e.unref(a),{modelValue:P.content,"onUpdate:modelValue":k=>P.content=k,name:`AccordionText_${P.key}`},null,8,["modelValue","onUpdate:modelValue","name"])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-03cf9528"]]),Ise=["id"],Mse=["id"],Lse=["onClick"],Ose={class:"accordion-button__title"},Qse=["id","aria-expanded","aria-labelledby"],Use={class:"accordion-body"},Fse=["innerHTML"],Hse={class:"flex-center mt-10"},zse={class:"btn--udrline"},Mc=te({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=o,l=n,{t:d}=de(()=>l.locale),{t:c}=de(()=>l.lang),u=t,g=()=>{var J;if(l.modelValue&&Array.isArray(l.modelValue.data)&&l.modelValue.data.length){l.modelValue.openFirst&&p.value.size===0&&p.value.add(l.modelValue.data[0].key);return}const K={id:((J=l.modelValue)==null?void 0:J.id)||q(),type:"AccordionText",showMode:"",openFirst:!1,width:"",style:{},data:[{key:q(),title:"tab1",content:d("placeholder.this_is_content")}]};u("update:modelValue",K)},f=e.ref(Date.now()),m=e.ref(6),h=e.ref(6),p=e.ref(new Set),A=e.ref([]),E=e.ref([]),x=e.ref(!1),b=e.ref(!1),C=e.computed(()=>{var K,J;return l.isPreview?((K=l.modelValue)==null?void 0:K.showMode)==="pc"?!ue():((J=l.modelValue)==null?void 0:J.showMode)==="mobile"?ue():!0:!0}),D=e.computed(()=>{var K;return(K=l.modelValue)!=null&&K.hasOwnProperty("classes")?l.modelValue.classes:null}),S=e.computed(()=>{var K;return(K=l.modelValue)!=null&&K.hasOwnProperty("style")?l.modelValue.style:null});e.computed(()=>{var K;return(K=l.modelValue)!=null&&K.hasOwnProperty("width")?l.modelValue.width:null});const w=e.computed(()=>{var J;const K=(J=l.modelValue)==null?void 0:J.data;return Array.isArray(K)?K:[]}),V=e.computed(()=>w.value.slice(0,m.value)),P=K=>{var J;p.value.has(K)?p.value.delete(K):((J=l.modelValue)!=null&&J.allowMultiple||p.value.clear(),p.value.add(K)),setTimeout(()=>{I(document.getElementById(`accordion-${f.value}-${K}`))},350)},k=K=>p.value.has(K),I=K=>{if(a.value>=768)return;const j=ui(K).y-150;window.scroll({top:j,left:0,behavior:"smooth"})},L=()=>{a.value>=768?(m.value=6,h.value=6):(m.value=4,h.value=4)},U=(K,J)=>{debugger;u("handleDelete",K||l.modelValue.id,J)},Q=K=>{debugger;u("handleCopy",K||l.modelValue)},H=(K,J)=>{debugger;u("handlePaste",K,J)},z=()=>{};return e.watch(w,(K,J)=>{var j;L(),(j=l.modelValue)!=null&&j.openFirst&&K.length>0&&p.value.size===0&&p.value.add(K[0].key)},{deep:!0,immediate:!0}),e.watch(V,()=>{e.nextTick(z)},{immediate:!1}),e.onMounted(()=>{var K;e.nextTick(L),(K=l.modelValue)!=null&&K.openFirst&&w.value.length>0&&p.value.size===0&&p.value.add(w.value[0].key),e.nextTick(()=>{E.value.forEach(J=>{J&&J.querySelectorAll("a").forEach(O=>{O.addEventListener("click",v=>{const W=v.target.getAttribute("href");W&&!W.startsWith("http")&&(v.preventDefault(),u("handleClick",W))})})})})}),g(),(K,J)=>{var j,O;return C.value?(e.openBlock(),e.createElementBlock("div",{key:0,onMouseover:J[4]||(J[4]=v=>b.value=!0),onMouseout:J[5]||(J[5]=v=>b.value=!1),class:e.normalizeClass(["accordion-text",D.value]),id:`accordion-parent-${f.value}`,style:e.normalizeStyle(S.value)},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-text__container",[(j=n.modelValue)!=null&&j.width?`container-content-${(O=n.modelValue)==null?void 0:O.width}`:"container-content"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(v,W)=>(e.openBlock(),e.createElementBlock("div",{key:v.key,class:"accordion-item",ref_for:!0,ref_key:"itemRefs",ref:A,"data-aos":"fade-in"},[e.createElementVNode("div",{class:"accordion-header",id:`accordion-${f.value}-${v.key}`},[e.createElementVNode("button",{class:e.normalizeClass(["accordion-button",{collapsed:!k(v.key)}]),type:"button",onClick:R=>P(v.key)},[e.createElementVNode("div",null,[e.createElementVNode("div",Ose,e.toDisplayString(v.title),1)]),J[6]||(J[6]=e.createElementVNode("span",{class:"accordion-button__icon"},null,-1))],10,Lse)],8,Mse),e.createElementVNode("div",{id:`accordion-${f.value}-collapse-${v.key}`,class:e.normalizeClass(["accordion-collapse collapse",{show:k(v.key)}]),"aria-expanded":k(v.key),"aria-labelledby":`accordion-${f.value}-${v.key}`,style:e.normalizeStyle({height:k(v.key)?"auto":"0",overflow:"hidden"})},[e.createElementVNode("div",Use,[e.createElementVNode("div",{class:"accordion__content",innerHTML:v.content,ref_for:!0,ref_key:"contentRefs",ref:E},null,8,Fse)])],14,Qse)]))),128)),e.withDirectives(e.createElementVNode("div",Hse,[e.createElementVNode("button",{type:"button",class:"btn btn__load-more",onClick:J[0]||(J[0]=v=>m.value+=h.value)},[e.createElementVNode("div",zse,e.toDisplayString(e.unref(c)("text.see_more")),1),J[7]||(J[7]=e.createElementVNode("span",{class:"i i-load-more"},null,-1))])],512),[[e.vShow,m.value<w.value.length]]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:b.value,"onUpdate:show":J[1]||(J[1]=v=>b.value=v),locale:n.locale,onHandleEdit:J[2]||(J[2]=v=>x.value=!0),onHandleDelete:U,onHandleCopy:Q,onHandlePaste:H,style:{top:"-10px"}},null,8,["show","locale"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pse,{key:0,show:x.value,"onUpdate:show":J[3]||(J[3]=v=>x.value=v),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],46,Ise)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-40bd7e5c"]]),L2=Object.freeze(Object.defineProperty({__proto__:null,default:Mc},Symbol.toStringTag,{value:"Module"})),Rse={class:"setting-content"},vse={class:"setting-header flex items-center mb-10"},jse={class:"header-title"},qse={class:"setting-header flex items-center"},Yse={class:"header-title"},Gse={class:"setting-header flex items-center"},Kse={class:"header-title"},Wse={class:"setting-body"},Xse={class:"item-title"},Jse=te(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},locale:{type:String,default:"sc"}},emits:["update:show"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{i("update:show",!1)};return(r,l)=>{const d=e.resolveComponent("a-radio"),c=e.resolveComponent("a-radio-group"),u=e.resolveComponent("a-option"),g=e.resolveComponent("a-select"),f=e.resolveComponent("a-textarea"),m=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(m,{width:500,visible:n.show,footer:!1,onCancel:s,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+" "+e.toDisplayString(e.unref(a)("setting.component_edit")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Rse,[e.createElementVNode("div",vse,[e.createElementVNode("span",jse,e.toDisplayString(e.unref(a)("setting.show_mode_pc_mobile")),1),e.createVNode(c,{style:{"margin-left":"10px"},modelValue:n.data.showMode,"onUpdate:modelValue":l[0]||(l[0]=h=>n.data.showMode=h),type:"button"},{default:e.withCtx(()=>[e.createVNode(d,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_all")),1)]),_:1}),e.createVNode(d,{value:"pc"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_pc")),1)]),_:1}),e.createVNode(d,{value:"mobile"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.only_show_mobile")),1)]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",qse,[e.createElementVNode("span",Yse,e.toDisplayString(e.unref(a)("setting.component_width")),1),e.createVNode(g,{modelValue:n.data.width,"onUpdate:modelValue":l[1]||(l[1]=h=>n.data.width=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_default")),1)]),_:1}),e.createVNode(u,{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_small")),1)]),_:1}),e.createVNode(u,{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_middle")),1)]),_:1}),e.createVNode(u,{value:"max"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.width_large")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Gse,[e.createElementVNode("span",Kse,e.toDisplayString(e.unref(a)("setting.component_bg")),1),e.createVNode(g,{modelValue:n.data.bgColor,"onUpdate:modelValue":l[2]||(l[2]=h=>n.data.bgColor=h),placeholder:e.unref(a)("setting.please_select"),"allow-clear":""},{default:e.withCtx(()=>[e.createVNode(u,{value:"#ffffff"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_white")),1)]),_:1}),e.createVNode(u,{value:"#F7F7FA"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("setting.bg_grey")),1)]),_:1})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",Wse,[e.createElementVNode("p",Xse,e.toDisplayString(e.unref(a)("setting.content")),1),e.createVNode(f,{modelValue:n.data.data.html,"onUpdate:modelValue":l[3]||(l[3]=h=>n.data.data.html=h),placeholder:e.unref(a)("setting.input_html"),"auto-size":{minRows:20}},null,8,["modelValue","placeholder"])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-c035b7e3"]]),Zse=e.defineComponent({__name:"shadowContainer",props:{html:{type:String,default:""}},setup(n){const t=n,o=e.ref(null);let a=null;const i=()=>{a&&(a.innerHTML=t.html)};return e.onMounted(()=>{o.value&&(a=o.value.attachShadow({mode:"open"}),i())}),e.watch(()=>t.html,i),(s,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:o},null,512))}}),Lc=te(e.defineComponent({name:"HtmlItem",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},locale:{type:String,default:"sc"}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const o=n,{t:a}=de(()=>o.locale),i=t,s=()=>{var m;if(o.modelValue&&o.modelValue.data)return;const f={id:((m=o.modelValue)==null?void 0:m.id)||q(),type:"HtmlItem",showMode:"",width:"",bgColor:"",data:{html:a("placeholder.html_content")}};i("update:modelValue",f)},r=e.computed(()=>{var f,m;return o.isPreview?((f=o.modelValue)==null?void 0:f.showMode)==="pc"?!ue():((m=o.modelValue)==null?void 0:m.showMode)==="mobile"?ue():!0:!0}),l=e.ref(!1),d=e.ref(!1),c=()=>{i("handleDelete",o.modelValue.id)},u=()=>{i("handleCopy",o.modelValue)},g=f=>{i("handlePaste",f)};return s(),(f,m)=>{var h,p,A,E,x;return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"html-item",style:e.normalizeStyle({backgroundColor:((h=n.modelValue)==null?void 0:h.bgColor)||"transparent"}),onMouseenter:m[2]||(m[2]=b=>l.value=!0),onMouseleave:m[3]||(m[3]=b=>l.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass([(p=n.modelValue)!=null&&p.width?`container-content-${(A=n.modelValue)==null?void 0:A.width}`:"container-content"])},[e.createVNode(Zse,{html:((x=(E=n.modelValue)==null?void 0:E.data)==null?void 0:x.html)||""},null,8,["html"])],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne,{key:0,show:l.value,"onUpdate:show":m[0]||(m[0]=b=>l.value=b),locale:n.locale,onHandleEdit:m[1]||(m[1]=b=>d.value=!0),onHandleDelete:c,onHandleCopy:u,onHandlePaste:g},null,8,["show","locale"]))],36)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Jse,{key:1,show:d.value,"onUpdate:show":m[4]||(m[4]=b=>d.value=b),data:n.modelValue,locale:n.locale},null,8,["show","data","locale"]))],64)}}}),[["__scopeId","data-v-980cc251"]]),O2=Object.freeze(Object.defineProperty({__proto__:null,default:Lc},Symbol.toStringTag,{value:"Module"})),_se={install:n=>{n.component("RibbonBlock",Pr)}},$se={install:n=>{n.component("TimelineStory",Ir)}},ere={install:n=>{n.component("NewsList",Mr)}},tre={install:n=>{n.component("TheHistoryCarousel",Lr)}},nre={install:n=>{n.component("CardShowcaseProfile",Or)}},ore={install:n=>{n.component("ArticleList",yl)}},are={install:n=>{n.component("BannerImage",vs)}},ire={install:n=>{n.component("BannerPage",js)}},lre={install:n=>{n.component("BtnList",Cl)}},sre={install:n=>{n.component("GalleryDefault",qs)}},rre={install:n=>{n.component("GalleryCaptionRound",Ys)}},dre={install:n=>{n.component("GalleryTimeline",gr)}},cre={install:n=>{n.component("GalleryTimelineCol",Ar)}},mre={install:n=>{n.component("Process",yr)}},ure={install:n=>{n.component("CustomSpace",Cr)}},hre={install:n=>{n.component("GalleryList",Er)}},pre={install:n=>{n.component("HeroSlide",xr)}},fre={install:n=>{n.component("LinkList",Vr)}},gre={install:n=>{n.component("QuoteText",Br)}},Are={install:n=>{n.component("DonorLinks",kr)}},yre={install:n=>{n.component("CardCarousel",Dr)}},Cre={install:n=>{n.component("CardCarouselMultiRow",Sr)}},wre={install:n=>{n.component("BannerQuote",Nr)}},bre={install:n=>{n.component("ArticleItem",Tr)}},Ere={install:n=>{n.component("CountDown",Qr)}},xre={install:n=>{n.component("CustomIframe",Ur)}},Vre={install:n=>{n.component("BannerImageWithLink",zr)}},Bre={install:n=>{n.component("ContactUsList",Fr)}},kre={install:n=>{n.component("TableTwo",Hr)}},Dre={install:n=>{n.component("ScrollKeyInfo",Rr)}},Sre={install:n=>{n.component("ContactUsInfo",vr)}},Nre={install:n=>{n.component("Publications",jr)}},Tre={install:n=>{n.component("MapStatic",qr)}},Pre={install:n=>{n.component("CardCarouselArticles",$r)}},Ire={install:n=>{n.component("CarouselLogo",Yr)}},Mre={install:n=>{n.component("Resources",Gr)}},Lre={install:n=>{n.component("ResourcesTwo",Kr)}},Ore={install:n=>{n.component("Disc",Wr)}},Qre={install:n=>{n.component("BasicCollapse",Xr)}},Ure={install:n=>{n.component("TableCollapse",Jr)}},Fre={install:n=>{n.component("MediaLogo",Hl)}},Hre={install:n=>{n.component("RegisterForm",Zr)}},zre={install:n=>{n.component("GalleryBlock",_r)}},Rre={install:n=>{n.component("CardCarouselMultiRowArticles",ed)}},vre={install:n=>{n.component("AlummiCommunityList",id)}},jre={install:n=>{n.component("BlessingMessage",ld)}},qre={install:n=>{n.component("BlessingSlider",sd)}},Yre={install:n=>{n.component("CardShowcase",rd)}},Gre={install:n=>{n.component("ExploreLinks",dd)}},Kre={install:n=>{n.component("SchoolLayout",md)}},Wre={install:n=>{n.component("CardCarouselMultiRowPublications",ud)}},Xre={install:n=>{n.component("CustomText",td)}},Jre={install:n=>{n.component("MediaImageFull",nd)}},Zre={install:n=>{n.component("MediaImageStatic",od)}},_re={install:n=>{n.component("ArticleListPureText",ad)}},$re={install:n=>{n.component("TabDefault",hd)}},ede={install:n=>{n.component("TabTimeLine",pd)}},tde={install:n=>{n.component("CardListProgramme",gd)}},nde={install:n=>{n.component("CardListCircle",fd)}},ode={install:n=>{n.component("CardListSchool",Ad)}},ade={install:n=>{n.component("MediaVideo",Bc)}},ide={install:n=>{n.component("DetailLink",yd)}},lde={install:n=>{n.component("InformationLink",kc)}},sde={install:n=>{n.component("TabPage",Dc)}},rde={install:n=>{n.component("AccordionText",Mc)}},dde={install:n=>{n.component("TabLogo",Sc)}},cde={install:n=>{n.component("BackgroundWrapper",Nc)}},mde={install:n=>{n.component("CollapseCustom",Pc)}},ude={install:n=>{n.component("VrTour",Ic)}},hde={install:n=>{n.component("HtmlItem",Lc)}},Mh={default:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},dark:{primaryColor:"#60a5fa",secondaryColor:"#c084fc",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},compact:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"12px",fontFamily:"Inter, sans-serif",borderRadius:"4px",spacing:"12px"},large:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"16px",fontFamily:"Inter, sans-serif",borderRadius:"8px",spacing:"20px"}},Ln=e.ref(Mh.default),Fo=e.ref(!1);function pde(){const n=h=>{typeof h=="string"?Ln.value={...Mh[h]}:Ln.value={...h},a()},t=h=>{Ln.value={...Ln.value,...h},a()},o=()=>{Fo.value=!Fo.value,typeof document<"u"&&document.documentElement.classList.toggle("dark",Fo.value)},a=()=>{if(typeof document>"u")return;const h=document.documentElement,p=Ln.value;h.style.setProperty("--theme-primary",p.primaryColor),h.style.setProperty("--theme-secondary",p.secondaryColor),h.style.setProperty("--font-size-default",p.fontSize),h.style.setProperty("--radius-md",p.borderRadius),h.style.setProperty("--spacing-md",p.spacing)},i=h=>e.computed(()=>h==="primary"?Ln.value.primaryColor:Ln.value.secondaryColor),s=()=>e.computed(()=>Ln.value.fontSize),r=()=>e.computed(()=>Ln.value.fontFamily),l=()=>e.computed(()=>Ln.value.borderRadius),d=()=>e.computed(()=>Ln.value.spacing),c=()=>{n("default"),Fo.value=!1,typeof document<"u"&&document.documentElement.classList.remove("dark")},u=()=>JSON.stringify(Ln.value,null,2),g=h=>{try{const p=JSON.parse(h);return n(p),!0}catch(p){return console.error("Invalid theme configuration:",p),!1}},f=()=>{const h=typeof window<"u"&&typeof localStorage<"u",p=h?localStorage.getItem("officialblock-theme"):null,A=h?localStorage.getItem("officialblock-dark-mode"):null;if(p)try{const E=JSON.parse(p);n(E)}catch(E){console.error("Failed to restore theme:",E)}if(A&&(Fo.value=A==="true",typeof document<"u"&&document.documentElement.classList.toggle("dark",Fo.value)),typeof window<"u"&&typeof window.matchMedia=="function"){const E=window.matchMedia("(prefers-color-scheme: dark)"),x=b=>{(!h||!localStorage.getItem("officialblock-dark-mode"))&&(Fo.value=b.matches,typeof document<"u"&&document.documentElement.classList.toggle("dark",Fo.value))};E.addEventListener("change",x)}a()},m=()=>{typeof window<"u"&&typeof localStorage<"u"&&(localStorage.setItem("officialblock-theme",JSON.stringify(Ln.value)),localStorage.setItem("officialblock-dark-mode",Fo.value.toString()))};return{currentTheme:e.computed(()=>Ln.value),isDarkMode:e.computed(()=>Fo.value),themePresets:Mh,setTheme:n,updateTheme:t,toggleDarkMode:o,resetTheme:c,exportTheme:u,importTheme:g,initTheme:f,saveTheme:m,getThemeColor:i,getFontSize:s,getFontFamily:r,getBorderRadius:l,getSpacing:d}}class fde{static hexToRgb(t){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:null}static rgbToHex(t,o,a){return"#"+((1<<24)+(t<<16)+(o<<8)+a).toString(16).slice(1)}static adjustBrightness(t,o){const a=this.hexToRgb(t);if(!a)return t;const i=s=>{const r=Math.round(s*(1+o/100));return Math.max(0,Math.min(255,r))};return this.rgbToHex(i(a.r),i(a.g),i(a.b))}static generateColorScale(t){const o=[50,100,200,300,400,500,600,700,800,900,950],a={};return o.forEach((i,s)=>{let r;i<=500?r=80-s*16:r=-20-(s-5)*12,a[i.toString()]=this.adjustBrightness(t,r)}),a}static getContrastRatio(t,o){const a=d=>{const c=this.hexToRgb(d);if(!c)return 0;const u=g=>{const f=g/255;return f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4)};return .2126*u(c.r)+.7152*u(c.g)+.0722*u(c.b)},i=a(t),s=a(o),r=Math.max(i,s),l=Math.min(i,s);return(r+.05)/(l+.05)}static isDarkColor(t){const o=this.hexToRgb(t);return o?(o.r*299+o.g*587+o.b*114)/1e3<128:!1}static getBestTextColor(t){return this.isDarkColor(t)?"#ffffff":"#000000"}static mixColors(t,o,a=.5){const i=this.hexToRgb(t),s=this.hexToRgb(o);if(!i||!s)return t;const r=(l,d)=>Math.round(l*(1-a)+d*a);return this.rgbToHex(r(i.r,s.r),r(i.g,s.g),r(i.b,s.b))}}class gde{static getCurrentBreakpoint(){if(typeof window>"u")return"xl";const t=window.innerWidth;return t<475?"xs":t<640?"sm":t<768?"md":t<1024?"lg":t<1280?"xl":"2xl"}static isMobile(){return typeof window>"u"?!1:window.innerWidth<768}static isTablet(){if(typeof window>"u")return!1;const t=window.innerWidth;return t>=768&&t<1024}static isDesktop(){return typeof window>"u"?!0:window.innerWidth>=1024}static onBreakpointChange(t){if(typeof window>"u")return()=>{};let o=this.getCurrentBreakpoint();const a=()=>{const i=this.getCurrentBreakpoint();i!==o&&(o=i,t(i))};return window.addEventListener("resize",a),()=>{typeof window<"u"&&window.removeEventListener("resize",a)}}}class Q2{static animate(t,o,a,i,s=this.easing.easeOutQuad){if(typeof window>"u"||typeof requestAnimationFrame>"u"||typeof performance>"u")return i(o),()=>{};const r=performance.now();let l;const d=c=>{const u=c-r,g=Math.min(u/a,1),f=s(g),m=t+(o-t)*f;i(m),g<1&&(l=requestAnimationFrame(d))};return l=requestAnimationFrame(d),()=>{l&&cancelAnimationFrame(l)}}static scrollTo(t,o,a=300,i=this.easing.easeOutQuad){return new Promise(s=>{if(typeof window>"u"){s();return}const r=t===window,l=r?window.pageYOffset:t.scrollTop;this.animate(l,o,a,d=>{r?window.scrollTo(0,d):t.scrollTop=d},i),setTimeout(s,a)})}}ra(Q2,"easing",{linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:-1+(4-2*t)*t,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1});class Ade{static setItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.setItem(t,JSON.stringify(o)),!0}catch(a){return console.warn("Failed to save to localStorage:",a),!1}}static getItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return o||null;try{const a=localStorage.getItem(t);return a?JSON.parse(a):o||null}catch(a){return console.warn("Failed to read from localStorage:",a),o||null}}static removeItem(t){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.removeItem(t),!0}catch(o){return console.warn("Failed to remove from localStorage:",o),!1}}static cleanExpired(){if(typeof window>"u"||typeof localStorage>"u")return;const t=Date.now(),o=[];for(let a=0;a<localStorage.length;a++){const i=localStorage.key(a);if(i&&i.startsWith("officialblock-"))try{const s=JSON.parse(localStorage.getItem(i)||"{}");s.expires&&s.expires<t&&o.push(i)}catch{}}o.forEach(a=>localStorage.removeItem(a))}}if(typeof globalThis<"u"&&!globalThis.FormData){class n{constructor(){ra(this,"data",new Map)}append(o,a,i){this.data.set(o,{value:a,filename:i})}get(o){const a=this.data.get(o);return a?a.value:null}has(o){return this.data.has(o)}delete(o){this.data.delete(o)}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[Symbol.iterator](){return this.data.entries()}}globalThis.FormData=n}const yde={install:n=>{n.use(tp),n.config.globalProperties.$device={get isMobile(){return typeof window<"u"?window.innerWidth<768:!1},get isTablet(){return typeof window<"u"?window.innerWidth>=768&&window.innerWidth<1024:!1},get isMobileOrTablet(){return typeof window<"u"?window.innerWidth<1024:!1},get isDesktop(){return typeof window<"u"?window.innerWidth>=1024:!0}},n.component("ArticleList",yl),n.component("BannerImage",vs),n.component("BannerPage",js),n.component("BtnList",Cl),n.component("GalleryDefault",qs),n.component("GalleryCaptionRound",Ys),n.component("GalleryTimeline",gr),n.component("GalleryTimelineCol",Ar),n.component("Process",yr),n.component("CustomSpace",Cr),n.component("GalleryList",Er),n.component("HeroSlide",xr),n.component("LinkList",Vr),n.component("QuoteText",Br),n.component("DonorLinks",kr),n.component("CardCarousel",Dr),n.component("CardCarouselMultiRow",Sr),n.component("BannerQuote",Nr),n.component("ArticleItem",Tr),n.component("RibbonBlock",Pr),n.component("TimelineStory",Ir),n.component("NewsList",Mr),n.component("TheHistoryCarousel",Lr),n.component("CardShowcaseProfile",Or),n.component("CountDown",Qr),n.component("ContactUsList",Fr),n.component("CustomIframe",Ur),n.component("TableTwo",Hr),n.component("ScrollKeyInfo",Rr),n.component("BannerImageWithLink",zr),n.component("ContactUsInfo",vr),n.component("Publications",jr),n.component("MapStatic",qr),n.component("CardCarouselArticles",$r),n.component("CarouselLogo",Yr),n.component("Resources",Gr),n.component("ResourcesTwo",Kr),n.component("Disc",Wr),n.component("BasicCollapse",Xr),n.component("TableCollapse",Jr),n.component("MediaLogo",Hl),n.component("RegisterForm",Zr),n.component("GalleryBlock",_r),n.component("CardCarouselMultiRowArticles",ed),n.component("AlummiCommunityList",id),n.component("BlessingMessage",ld),n.component("BlessingSlider",sd),n.component("CardShowcase",rd),n.component("ExploreLinks",dd),n.component("SchoolLayout",md),n.component("CardCarouselMultiRowPublications",ud),n.component("CustomText",td),n.component("MediaImageFull",nd),n.component("MediaImageStatic",od),n.component("ArticleListPureText",ad),n.component("TabDefault",hd),n.component("CardListProgramme",gd),n.component("CardListCircle",fd),n.component("CardListSchool",Ad),n.component("MediaVideo",Bc),n.component("DetailLink",yd),n.component("InformationLink",kc),n.component("TabTimeLine",pd),n.component("TabPage",Dc),n.component("TabLogo",Sc),n.component("BackgroundWrapper",Nc),n.component("CollapseCustom",Pc),n.component("VrTour",Ic),n.component("AccordionText",Mc),n.component("GridLinks",Ih),n.component("HtmlItem",Lc)}},Cde={class:"rich-text-editor"},Ut=Object.freeze(Object.defineProperty({__proto__:null,default:te(e.defineComponent({__name:"index",props:{name:{default:""},modelValue:{default:""},placeholder:{default:"Please input content..."},height:{default:"400px"},mode:{default:"default"},disabled:{type:Boolean,default:!1},maxLength:{default:1e4},excludeKeys:{default:()=>[]},includeKeys:{default:()=>[]}},emits:["update:modelValue","change","focus","blur","created","upload-image","upload-video"],setup(n,{expose:t,emit:o}){const a=n,i=o,s=e.shallowRef(),r=e.ref(""),l=e.computed(()=>typeof a.height=="number"?`${a.height}px`:a.height),d=e.inject("handleUpload",()=>{}),c=e.inject("fileUrl",null),u=e.inject("chooseName",null),g=e.ref(""),f=e.ref(null),m=I=>{if(!d){console.warn("Upload: handleUpload function not provided by ancestor");return}if(g.value=I,s.value)try{const U=s.value.selection;U&&(f.value={anchor:{path:[...U.anchor.path],offset:U.anchor.offset},focus:{path:[...U.focus.path],offset:U.focus.offset}})}catch(U){console.warn("保存光标位置失败:",U)}const L=a.name+"_"+I;d(!0,L)};e.watch(()=>a.name,()=>{c.value=null},{deep:!0,immediate:!0}),e.watch(()=>[c==null?void 0:c.value],([I])=>{const L=a.name+"_"+g.value;!I||!u.value||u.value!==L||s.value&&e.nextTick(()=>{var U,Q;if(s.value){try{if(s.value.focus(),f.value)try{s.value.select(f.value)}catch(H){console.warn("恢复光标位置失败,使用默认位置:",H)}}catch(H){console.warn("聚焦编辑器失败:",H)}if(g.value==="img"){const z=`<img src="${I}" alt="图片" style="max-width: 100%;">`;(U=s.value)==null||U.dangerouslyInsertHtml(z)}else{const z=`<video src="${I}" controls style="max-width: 100%;"></video>`;(Q=s.value)==null||Q.dangerouslyInsertHtml(z)}f.value=null,g.value=""}})},{immediate:!1});function h(I){return class{constructor(){ra(this,"title");ra(this,"tag");ra(this,"iconSvg");this.title="上传图片",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>'}isActive(){return!1}getValue(){return""}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传图片菜单"),I("img")})}}}function p(I){return class{constructor(){ra(this,"title");ra(this,"tag");ra(this,"iconSvg");this.title="上传视频",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>'}getValue(){return""}isActive(){return!1}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传视频菜单"),I("video")})}}}const A={toolbarKeys:["headerSelect","bold","italic","through","underline","color","fontSize","lineHeight","delIndent","indent","divider","insertTable","justifyCenter","justifyJustify","justifyLeft","justifyRight","bulletedList","numberedList","undo","redo","clearStyle","codeBlock"]},E=["#0032A0","#FF0044","#FF8200","#001E60","#E3E3E6","#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E8E8E8","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],x={placeholder:a.placeholder,readOnly:a.disabled,maxLength:a.maxLength,MENU_CONF:{color:{colors:E},bgColor:{colors:E}},hoverbarKeys:{text:{menuKeys:["headerSelect","insertLink","bold","italic","underline","through","clearStyle"]}}},b=Math.random().toString(36).substring(2,9),C=`CustomImageMenu_${b}`,D=`CustomVideoMenu_${b}`,S=I=>{s.value=I;try{const L=h(m),U=p(m),Q={key:C,factory(){return new L}},H={key:D,factory(){return new U}};Xh.Boot.registerMenu(Q),Xh.Boot.registerMenu(H)}catch(L){console.warn("菜单注册失败:",L)}A.insertKeys={index:0,keys:[C,D]},i("created",I)};e.onBeforeUnmount(()=>{const I=s.value;I!=null&&I.destroy()}),e.watch(()=>a.modelValue,I=>{I!==r.value&&(r.value=I||"")},{immediate:!0});const w=I=>{i("update:modelValue",r.value),i("change",I)},V=()=>{s.value=void 0},P=I=>{i("focus",I)},k=I=>{i("blur",I)};return t({editor:s,getHtml:()=>r.value,getText:()=>{var I;return((I=s.value)==null?void 0:I.getText())||""},isEmpty:()=>{var I;return((I=s.value)==null?void 0:I.isEmpty())||!0},clear:()=>{var I;return(I=s.value)==null?void 0:I.clear()},focus:()=>{var I;return(I=s.value)==null?void 0:I.focus()},blur:()=>{var I;return(I=s.value)==null?void 0:I.blur()},disable:()=>{var I;return(I=s.value)==null?void 0:I.disable()},enable:()=>{var I;return(I=s.value)==null?void 0:I.enable()}}),(I,L)=>(e.openBlock(),e.createElementBlock("div",Cde,[e.createVNode(e.unref(Wh.Toolbar),{class:"editor-toolbar",editor:s.value,defaultConfig:A,mode:n.mode},null,8,["editor","mode"]),e.createVNode(e.unref(Wh.Editor),{class:"editor-content",style:e.normalizeStyle({height:l.value}),modelValue:r.value,"onUpdate:modelValue":L[0]||(L[0]=U=>r.value=U),defaultConfig:x,mode:n.mode,onOnCreated:S,onOnChange:w,onOnDestroyed:V,onOnFocus:P,onOnBlur:k},null,8,["style","modelValue","mode"])]))}}),[["__scopeId","data-v-e97d4bf7"]])},Symbol.toStringTag,{value:"Module"}));le.AccordionText=Mc,le.AccordionTextPlugin=rde,le.AlummiCommunityList=id,le.AlummiCommunityListPlugin=vre,le.AnimationUtils=Q2,le.ArticleItem=Tr,le.ArticleItemPlugin=bre,le.ArticleList=yl,le.ArticleListPlugin=ore,le.ArticleListPureText=ad,le.ArticleListPureTextPlugin=_re,le.BackgroundWrapper=Nc,le.BackgroundWrapperPlugin=cde,le.BannerImage=vs,le.BannerImagePlugin=are,le.BannerImageWithLink=zr,le.BannerImageWithLinkPlugin=Vre,le.BannerPage=js,le.BannerPagePlugin=ire,le.BannerQuote=Nr,le.BannerQuotePlugin=wre,le.BasicCollapse=Xr,le.BasicCollapsePlugin=Qre,le.BlessingMessage=ld,le.BlessingMessagePlugin=jre,le.BlessingSlider=sd,le.BlessingSliderPlugin=qre,le.BtnList=Cl,le.BtnListPlugin=lre,le.CardCarousel=Dr,le.CardCarouselArticles=$r,le.CardCarouselArticlesPlugin=Pre,le.CardCarouselMultiRow=Sr,le.CardCarouselMultiRowArticles=ed,le.CardCarouselMultiRowArticlesPlugin=Rre,le.CardCarouselMultiRowPlugin=Cre,le.CardCarouselMultiRowPublications=ud,le.CardCarouselMultiRowPublicationsPlugin=Wre,le.CardCarouselPlugin=yre,le.CardListCircle=fd,le.CardListCirclePlugin=nde,le.CardListProgramme=gd,le.CardListProgrammePlugin=tde,le.CardListSchool=Ad,le.CardListSchoolPlugin=ode,le.CardShowcase=rd,le.CardShowcasePlugin=Yre,le.CardShowcaseProfile=Or,le.CardShowcaseProfilePlugin=nre,le.CarouselLogo=Yr,le.CarouselLogoPlugin=Ire,le.CollapseCustom=Pc,le.CollapseCustomPlugin=mde,le.ContactUsInfo=vr,le.ContactUsInfoPlugin=Sre,le.ContactUsList=Fr,le.ContactUsListPlugin=Bre,le.CountDown=Qr,le.CountDownPlugin=Ere,le.CustomIframe=Ur,le.CustomIframePlugin=xre,le.CustomSpace=Cr,le.CustomSpacePlugin=ure,le.CustomText=td,le.CustomTextPlugin=Xre,le.DetailLink=yd,le.DetailLinkPlugin=ide,le.Disc=Wr,le.DiscPlugin=Ore,le.DonorLinks=kr,le.DonorLinksPlugin=Are,le.ExploreLinks=dd,le.ExploreLinksPlugin=Gre,le.GalleryBlock=_r,le.GalleryBlockPlugin=zre,le.GalleryCaptionRound=Ys,le.GalleryCaptionRoundPlugin=rre,le.GalleryDefault=qs,le.GalleryDefaultPlugin=sre,le.GalleryList=Er,le.GalleryListPlugin=hre,le.GalleryTimeline=gr,le.GalleryTimelineCol=Ar,le.GalleryTimelineColPlugin=cre,le.GalleryTimelinePlugin=dre,le.GridLinks=Ih,le.HeroSlide=xr,le.HeroSlidePlugin=pre,le.HtmlItem=Lc,le.HtmlItemPlugin=hde,le.InformationLink=kc,le.InformationLinkPlugin=lde,le.LinkList=Vr,le.LinkListPlugin=fre,le.MapStatic=qr,le.MapStaticPlugin=Tre,le.MediaImageFull=nd,le.MediaImageFullPlugin=Jre,le.MediaImageStatic=od,le.MediaImageStaticPlugin=Zre,le.MediaLogo=Hl,le.MediaLogoPlugin=Fre,le.MediaVideo=Bc,le.MediaVideoPlugin=ade,le.NewsList=Mr,le.NewsListPlugin=ere,le.Process=yr,le.ProcessPlugin=mre,le.Publications=jr,le.PublicationsPlugin=Nre,le.QuoteText=Br,le.QuoteTextPlugin=gre,le.RegisterForm=Zr,le.RegisterFormPlugin=Hre,le.Resources=Gr,le.ResourcesPlugin=Mre,le.ResourcesTwo=Kr,le.ResourcesTwoPlugin=Lre,le.ResponsiveUtils=gde,le.RibbonBlock=Pr,le.RibbonBlockPlugin=_se,le.SchoolLayout=md,le.SchoolLayoutPlugin=Kre,le.ScrollKeyInfo=Rr,le.ScrollKeyInfoPlugin=Dre,le.StorageUtils=Ade,le.TabDefault=hd,le.TabDefaultPlugin=$re,le.TabLogo=Sc,le.TabLogoPlugin=dde,le.TabPage=Dc,le.TabPagePlugin=sde,le.TabTimeLine=pd,le.TabTimeLinePlugin=ede,le.TableCollapse=Jr,le.TableCollapsePlugin=Ure,le.TableTwo=Hr,le.TableTwoPlugin=kre,le.TheHistoryCarousel=Lr,le.TheHistoryCarouselPlugin=tre,le.ThemeUtils=fde,le.TimelineStory=Ir,le.TimelineStoryPlugin=$se,le.VrTour=Ic,le.VrTourPlugin=ude,le.VueScreenPlugin=tp,le.default=yde,le.useTheme=pde,le.useVueScreen=ep,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|