# HG changeset patch # User ymh # Date 1770053030 -3600 # Node ID 379db780cc711e9394d215ed70ac00966bc40006 # Parent 9cfcfbac1a43a8b80470489e1328dfd821e6846d Correct full screen button diff -r 9cfcfbac1a43 -r 379db780cc71 src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Tue Oct 22 09:57:18 2024 +0200 +++ b/src/ldt/ldt/__init__.py Mon Feb 02 18:23:50 2026 +0100 @@ -1,6 +1,6 @@ __all__ = ["VERSION", "get_version", "__version__", "default_app_config"] -VERSION = (1, 65, 8, "final", 0) +VERSION = (1, 66, 0, "final", 0) def get_version(): diff -r 9cfcfbac1a43 -r 379db780cc71 src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js --- a/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js Tue Oct 22 09:57:18 2024 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js Mon Feb 02 18:23:50 2026 +0100 @@ -506,7 +506,7 @@ `)St=0,_r=0,Lt=0,fr+=gr*Ae;else{var Pr=Lt&&Fe.glyphs[rt[Ur-1]]||{},_r=Fe.glyphs[rt[Ur]];St+=Lt?(Pr.w||Fe.w)+(Pr.k&&Pr.k[rt[Ur]]||0)+Fe.w*we:0,Lt=1}_r&&_r.d&&(Ft+=w.transformPath(_r.d,["t",St*Re,fr*Re,"s",Re,Re,nr,ar,"t",(ce-nr)/Re,(xe-ar)/Re]))}}return this.path(Ft).attr({fill:"#000",stroke:"none"})},E.add=function(ce){if(w.is(ce,"array"))for(var xe,Be=this.set(),Fe=0,Xe=ce.length;Fe1)for(var fe=0,V=re.length;fe.5)-1;j(J-.5,2)+j(X-.5,2)>.25&&(X=M.sqrt(.25-j(J-.5,2))*ht+.5)&&X!=.5&&(X=X.toFixed(5)-1e-5*ht)}return N})).split(/\s*\-\s*/),O=="linear"){var me=D.shift();if(me=-E(me),isNaN(me))return null;var pe=[0,0,M.cos(v.rad(me)),M.sin(v.rad(me))],qe=1/(P(I(pe[2]),I(pe[3]))||1);pe[2]*=qe,pe[3]*=qe,pe[2]<0&&(pe[0]=-pe[2],pe[2]=0),pe[3]<0&&(pe[1]=-pe[3],pe[3]=0)}var mt=v._parseDots(D);if(!mt)return null;if(Q=Q.replace(/[\(\)\s,\xb0#]/g,"_"),k.gradient&&Q!=k.gradient.id&&(z.defs.removeChild(k.gradient),delete k.gradient),!k.gradient){de=V(O+"Gradient",{id:Q}),k.gradient=de,V(de,O=="radial"?{fx:J,fy:X}:{x1:pe[0],y1:pe[1],x2:pe[2],y2:pe[3],gradientTransform:k.matrix.invert()}),z.defs.appendChild(de);for(var st=0,dt=mt.length;st1?Je.opacity/100:Je.opacity});case"stroke":Je=v.getRGB(U),O.setAttribute(X,Je.hex),X=="stroke"&&Je[w]("opacity")&&V(O,{"stroke-opacity":Je.opacity>1?Je.opacity/100:Je.opacity}),X=="stroke"&&k._.arrows&&("startString"in k._.arrows&&L(k,k._.arrows.startString),"endString"in k._.arrows&&L(k,k._.arrows.endString,1));break;case"gradient":(k.type=="circle"||k.type=="ellipse"||A(U).charAt()!="r")&&le(k,U);break;case"opacity":Q.gradient&&!Q[w]("stroke-opacity")&&V(O,{"stroke-opacity":U>1?U/100:U});case"fill-opacity":if(Q.gradient){(ht=v._g.doc.getElementById(O.getAttribute("fill").replace(/^url\(#|\)$/g,N)))&&(at=ht.getElementsByTagName("stop"),V(at[at.length-1],{"stop-opacity":U}));break}default:X=="font-size"&&(U=C(U,10)+"px");var bt=X.replace(/(\-.)/g,function(jt){return jt.substring(1).toUpperCase()});O.style[bt]=U,k._.dirty=1,O.setAttribute(X,U)}}c(k,D),O.style.visibility=J},c=function(k,D){if(k.type=="text"&&(D[w]("text")||D[w]("font")||D[w]("font-size")||D[w]("x")||D[w]("y"))){var O=k.attrs,Q=k.node,J=Q.firstChild?C(v._g.doc.defaultView.getComputedStyle(Q.firstChild,N).getPropertyValue("font-size"),10):10;if(D[w]("text")){for(O.text=D.text;Q.firstChild;)Q.removeChild(Q.firstChild);for(var X,U=A(D.text).split(` `),z=[],ie=0,de=U.length;ie"));var Me=Ct.getBoundingClientRect();ie.W=J.w=(Me.right-Me.left)/100,ie.H=J.h=(Me.bottom-Me.top)/100,ie.X=J.x,ie.Y=J.y+ie.H/2,("x"in O||"y"in O)&&(ie.path.v=v.format("m{0},{1}l{2},{1}",M(J.x*he),M(J.y*he),M(J.x*he)+1));for(var te=["x","y","text","font","font-family","font-weight","font-style","font-size"],_e=0,je=te.length;_e.25&&(st=C.sqrt(.25-J(mt-.5,2))*(2*(st>.5)-1)+.5),U=mt+N+st),ee})).split(/\s*\-\s*/),X=="linear"){var z=O.shift();if(z=-E(z),isNaN(z))return null}var ie=v._parseDots(O);if(!ie)return null;if(D=D.shape||D.node,ie.length){D.removeChild(Q),Q.on=!0,Q.method="none",Q.color=ie[0].color,Q.color2=ie[ie.length-1].color;for(var de=[],me=0,pe=ie.length;me')}}catch{S=function(J){return O.createElement("<"+J+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},v._engine.initWin(v._g.win),v._engine.create=function(){var D=v._getContainer.apply(0,arguments),O=D.container,Q=D.height,J=D.width,X=D.x,U=D.y;if(!O)throw new Error("VML container not found.");var z=new v._Paper,ie=z.canvas=v._g.doc.createElement("div"),de=ie.style;return X=X||0,U=U||0,J=J||512,Q=Q||342,z.width=J,z.height=Q,J==+J&&(J+="px"),Q==+Q&&(Q+="px"),z.coordsize=216e5+N+216e5,z.coordorigin="0 0",z.span=v._g.doc.createElement("span"),z.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",ie.appendChild(z.span),de.cssText=v.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",J,Q),O==1?(v._g.doc.body.appendChild(ie),de.left=X+"px",de.top=U+"px",de.position="absolute"):O.firstChild?O.insertBefore(ie,O.firstChild):O.appendChild(ie),z.renderfix=function(){},z},v.prototype.clear=function(){v.eve("raphael.clear",this),this.canvas.innerHTML=ee,this.span=v._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},v.prototype.remove=function(){for(var D in v.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[D]=typeof this[D]=="function"?v._removedFactory(D):null;return!0};var d=v.st;for(var k in b)b[w](k)&&!d[w](k)&&(d[k]=function(D){return function(){var O=arguments;return this.forEach(function(Q){Q[D].apply(Q,O)})}}(k))}}).apply(l,u))===void 0||(o.exports=h)}])})})(raphael_min);var raphael_minExports=raphael_min.exports;const Raphael=getDefaultExportFromCjs$1(raphael_minExports),Arrow=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l),this.current_pilot_widget=this.pilot_widget}draw(){this.height=this.arrow_height+this.base_height,this.$.addClass("Ldt-Arrow").css({height:1+this.height+"px","margin-top":"1px",overflow:"hidden"}),this.paper=new Raphael(this.container,this.width,1+this.height),window.myArrow=this,this.svgArrow=this.paper.path("M0,"+this.height+"L"+this.width+","+this.height),this.svgArrow.attr({stroke:this.stroke_color,"stroke-width":this.stroke_width,fill:this.fill_url?"url("+this.fill_url+")":this.fill_color}),this.moveToX(0)}drawAt(o){o=Math.max(0,Math.min(o,this.width));var l="M0,"+this.height+"L0,"+Math.min(this.height,this.arrow_height+this.base_curve)+"Q0,"+this.arrow_height+" "+Math.max(0,Math.min(this.base_curve,o-this.arrow_width/2))+","+this.arrow_height+"L"+Math.max(0,o-this.arrow_width/2)+","+this.arrow_height+"L"+Math.max(0,o-this.arrow_width/2)+","+Math.min(this.arrow_height,2*this.arrow_height*o/this.arrow_width)+"L"+o+",0L"+Math.min(this.width,o+this.arrow_width/2)+","+Math.min(this.arrow_height,2*this.arrow_height*(this.width-o)/this.arrow_width)+"L"+Math.min(this.width,o+this.arrow_width/2)+","+this.arrow_height+"L"+Math.min(this.width,Math.max(this.width-this.base_curve,o+this.arrow_width/2))+","+this.arrow_height+"Q"+this.width+","+this.arrow_height+" "+this.width+","+Math.min(this.height,this.arrow_height+this.base_curve)+"L"+this.width+","+this.height;this.svgArrow.attr({path:l})}moveToX(o){this.targetX=Math.max(0,Math.min(o,this.width)),typeof this.animInterval>"u"&&(this.animInterval=window.setInterval(this.functionWrapper("increment"),40)),this.increment()}moveToTime(o){this.media&&this.moveToX(this.width*o/this.media.duration)}increment(){typeof this.currentX>"u"&&(this.currentX=this.targetX),this.currentXthis.targetX&&(this.currentX=Math.max(this.targetX,this.currentX-this.animation_speed)),this.currentX===this.targetX&&(window.clearInterval(this.animInterval),this.animInterval=void 0),this.drawAt(this.currentX)}},Or(e,"defaults",{arrow_height:12,arrow_width:20,base_height:0,base_curve:0,fill_url:n.widgetsDir+"/img/pinstripe.png",fill_color:"#ffffff",stroke_color:"#b7b7b7",stroke_width:1.5,animation_speed:20}),e},controllerStyles={},Controller=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l),this.lastSearchValue=""}draw(){var o=this;this.renderTemplate(),this.$playButton=this.$.find(".Ldt-Ctrl-Play"),this.$searchBlock=this.$.find(".Ldt-Ctrl-Search"),this.$searchInput=this.$.find(".Ldt-Ctrl-SearchInput"),this.$volumeBar=this.$.find(".Ldt-Ctrl-Volume-Bar"),this.onMediaEvent("play","playButtonUpdater"),this.onMediaEvent("pause","playButtonUpdater"),this.onMediaEvent("volumechange","volumeUpdater"),this.onMediaEvent("timeupdate","timeDisplayUpdater"),this.onMediaEvent("loadedmetadata","volumeUpdater"),this.$playButton.click(this.functionWrapper("playHandler")),this.enable_quiz_toggle!==void 0?this.enable_quiz_toggle?(this.$.find(".Ldt-Ctrl-Quiz-Enable").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.$.find(".Ldt-Ctrl-Quiz-Create").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.$.find("#QuizEditContainer").show()):(this.$.find(".Ldt-Ctrl-Quiz-Enable").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.$.find(".Ldt-Ctrl-Quiz-Create").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.player.trigger("QuizCreator.hide"),this.$.find("#QuizEditContainer").hide()):this.$.find(".Ldt-Ctrl-Quiz-Enable").hide(),this.$.find(".Ldt-Ctrl-Annotate").click(function(){o.player.trigger("CreateAnnotation.toggle")}),this.$.find(".Ldt-Ctrl-SearchBtn").click(this.functionWrapper("searchButtonHandler")),this.$searchInput.keyup(this.functionWrapper("searchHandler")),this.$searchInput.on("search",this.functionWrapper("searchHandler")),this.$.find(".Ldt-Ctrl-Fullscreen-Button").click(this.functionWrapper("toggleFullscreen"));var l=n.getFullscreenEventname();l&&document.addEventListener(l,function(){n.isFullscreen()&&n.getFullscreenElement()==o.$[0]?o.$.addClass("Ldt-Fullscreen-Element"):o.$.removeClass("Ldt-Fullscreen-Element")}),this.$.find(".Ldt-Ctrl-Quiz-Enable").click(this.functionWrapper("toggleQuiz")),this.$.find(".Ldt-Ctrl-Quiz-Create").click(this.functionWrapper("createQuiz"));var t=this.$.find(".Ldt-Ctrl-Volume-Control");if(this.$.find(".Ldt-Ctrl-Sound").click(this.functionWrapper("muteHandler")).mouseover(function(){t.show()}).mouseout(function(){t.hide()}),t.mouseover(function(){t.show()}).mouseout(function(){t.hide()}),!this.disable_ctrl_f){var u=70,h=0;jQuery(document).keydown(function(w){if(w.keyCode===u&&(w.ctrlKey||w.metaKey)){var A=jQuery.now();return A-h>2e3&&o.searchButtonHandler(),h=A,!1}})}this.$volumeBar.slider({slide:function(w,A){o.$volumeBar.attr("title",o.l10n.volume+": "+A.value+"%"),o.media.setVolume(A.value/100)},stop:this.functionWrapper("volumeUpdater")}),this.$.hover(function(){o.player.trigger("Player.MouseOver")},function(){o.player.trigger("Player.MouseOut")}),this.timeDisplayUpdater(new n.Model.Time(0));var v=this.source.getAnnotations();v.on("search",function(w){o.$searchInput.val(w),o.showSearchBlock()}),v.on("found",function(w){o.$searchInput.css("background-color","#e1ffe1")}),v.on("not-found",function(w){o.$searchInput.css("background-color","#d62e3a")}),v.on("search-cleared",function(){o.hideSearchBlock()}),o.always_show_search&&o.showSearchBlock()}timeDisplayUpdater(o){var l=this.media.duration;this.$.find(".Ldt-Ctrl-Time-Elapsed").html(o.toString()),this.$.find(".Ldt-Ctrl-Time-Total").html(l.toString())}playButtonUpdater(){this.media.getPaused()?this.$playButton.attr("title",this.l10n.play).removeClass("Ldt-Ctrl-Play-PauseState").addClass("Ldt-Ctrl-Play-PlayState"):this.$playButton.attr("title",this.l10n.pause).removeClass("Ldt-Ctrl-Play-PlayState").addClass("Ldt-Ctrl-Play-PauseState")}toggleFullscreen(){n.isFullscreen()?n.setFullScreen(this.$[0],!1):n.setFullScreen(this.$[0],!0)}createQuiz(){this.player.trigger("Quiz.hide"),this.media.pause(),this.player.trigger("QuizCreator.create")}toggleQuiz(){this.enable_quiz_toggle=!this.enable_quiz_toggle,this.enable_quiz_toggle?(jQuery(".Ldt-Ctrl-Quiz-Enable").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),jQuery(".Ldt-Ctrl-Quiz-Create").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.player.trigger("Quiz.activate")):(jQuery(".Ldt-Ctrl-Quiz-Enable").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),jQuery(".Ldt-Ctrl-Quiz-Create").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.player.trigger("Quiz.deactivate"),this.player.trigger("QuizCreator.hide"))}playHandler(){this.media.getPaused()?this.media.play():this.media.pause()}muteHandler(){this.media.setMuted(!this.media.getMuted())}volumeUpdater(){var o=this.media.getMuted(),l=this.media.getVolume();l===!1&&(l=.5);var t=this.$.find(".Ldt-Ctrl-Sound");t.removeClass("Ldt-Ctrl-Sound-Mute Ldt-Ctrl-Sound-Half Ldt-Ctrl-Sound-Full"),o?t.attr("title",this.l10n.unmute).addClass("Ldt-Ctrl-Sound-Mute"):t.attr("title",this.l10n.mute).addClass(l<.5?"Ldt-Ctrl-Sound-Half":"Ldt-Ctrl-Sound-Full"),this.$volumeBar.slider("value",o?0:100*l)}showSearchBlock(){this.$searchBlock.animate({width:"160px"},200),this.$searchInput.css("background-color","#fff"),this.$searchInput.focus()}hideSearchBlock(){this.always_show_search||this.$searchBlock.animate({width:0},200)}searchButtonHandler(){if(this.$searchBlock.width())this.hideSearchBlock();else{this.showSearchBlock();var o=this.$searchInput.val();o&&this.source.getAnnotations().search(o)}}searchHandler(){this.$searchBlock.width()||(this.$searchBlock.css({width:"160px"}),this.$searchInput.css("background-color","#fff"));var o=this.$searchInput.val();this._positiveMatch=!1,o!==this.lastSearchValue&&(o?this.source.getAnnotations().search(o):(this.source.getAnnotations().trigger("clear-search"),this.$searchInput.css("background-color",""))),this.lastSearchValue=o}},Or(e,"defaults",{disable_annotate_btn:!1,disable_search_btn:!1,disable_ctrl_f:!1,disable_fullscreen:!0,always_show_search:!1,enable_quiz_toggle:void 0}),Or(e,"template",'
{{^disable_annotate_btn}}
{{/disable_annotate_btn}}{{^disable_search_btn}}
{{/disable_search_btn}}
{{^disable_fullscreen}}
00:00
/
00:00
'),Or(e,"messages",{en:{play_pause:"Play/Pause",mute_unmute:"Mute/Unmute",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",annotate:"Annotate",search:"Search",elapsed_time:"Elapsed time",total_time:"Total duration",volume:"Volume",volume_control:"Volume control",enable_quiz:"Enable quiz"},fr:{play_pause:"Lecture/Pause",mute_unmute:"Couper/Activer le son",play:"Lecture",pause:"Pause",mute:"Couper le son",unmute:"Activer le son",annotate:"Annoter",search:"Rechercher",elapsed_time:"Temps écoulé",total_time:"Durée totale",volume:"Niveau sonore",volume_control:"Réglage du niveau sonore",enable_quiz:"Activer le quiz"}}),e},createAnnotationStyles={},CreateAnnotation=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l),this.editable_storage!=""&&window.localStorage[this.editable_storage]&&this.source.onLoad(function(){var t=this.player.sourceManager.newLocalSource({serializer:n.serializers.ldt_localstorage});t.deSerialize(window.localStorage[this.editable_storage]),_this.source.merge(t)})}draw(){var o=this;this.begin=new n.Model.Time,this.end=this.source.getDuration(),this.tag_prefix=this.tag_prefix||"",this.tag_titles&&!this.tags&&(this.tag_titles.length==1&&this.tag_titles[0]==""?this.tags=!0:this.tags=_$1(this.tag_titles).map(function(l){var t,u=o.source.getTags().searchByTitle(l,!0);return u.length?t=u[0]:(t=new n.Model.Tag(!1,o.source),o.source.getTags().push(t),t.title=l),t}).value()),this.tags||(this.tags=this.source.getTags().sortBy(function(l){return-l.getAnnotations().length}).slice(0,this.max_tags).map(function(l){return l})),this.renderTemplate(),this.show_slice?this.insertSubwidget(this.$.find(".Ldt-CreateAnnotation-Slice"),{type:"Slice",show_arrow:this.show_arrow,annotation_type:this.slice_annotation_type,onBoundsChanged:function(l,t){o.setBeginEnd(l,t)}},"slice"):(this.show_arrow&&this.insertSubwidget(this.$.find(".Ldt-CreateAnnotation-Arrow"),{type:"Arrow"},"arrow"),this.onMediaEvent("timeupdate",function(l){o.$.find(".Ldt-CreateAnnotation-Description").val().trim()==""&&(o.setBeginEnd(l,l),o.arrow&&o.arrow.moveToTime(l))})),this.$.find(".Ldt-CreateAnnotation-Cancel").click(function(){o.player.trigger("CreateAnnotation.hide")}),this.$.find(".Ldt-CreateAnnotation-Close").click(function(){return o.close_after_send?o.player.trigger("CreateAnnotation.hide"):o.showScreen("Main"),!1}),this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").click(function(){return o.addKeyword(jQuery(this).attr("data-text")),!1}),this.$.find(".Ldt-CreateAnnotation-PolemicLi").each(function(){var l=jQuery(this),t=l.attr("data-text"),u=o.l10n["polemic"+t];u&&l.attr("title",u)}),this.$.find(".Ldt-CreateAnnotation-Description").bind("change keyup input paste",this.functionWrapper("onDescriptionChange")),this.show_title_field&&this.$.find(".Ldt-CreateAnnotation-Title").bind("change keyup input paste",this.functionWrapper("onTitleChange")),this.show_creator_field&&this.$.find(".Ldt-CreateAnnotation-Creator").bind("change keyup input paste",this.functionWrapper("onCreatorChange")),this.$.find("[class^='Ldt-CreateAnnotation-Control-']").click(function(){var l=this.className.replace("Ldt-CreateAnnotation-Control-","");switch(l){case"In":this.setBegin(o.media.getCurrentTime());break;case"Out":this.setEnd(o.media.getCurrentTime()||o.media.duration);break;case"Play":this.media.setCurrentTime(o.begin),this.media.play();break}return!1}),this.start_visible?this.show():(this.$.hide(),this.hide()),this.onMdpEvent("CreateAnnotation.toggle","toggle"),this.onMdpEvent("CreateAnnotation.hide","hide"),this.onMdpEvent("CreateAnnotation.show","show"),this.$.find("form").submit(this.functionWrapper("onSubmit"))}setBegin(o){this.begin=new n.Model.Time(o||0),this.$.find(".Ldt-CreateAnnotation-Begin").html(this.begin.toString())}setEnd(o){this.end=new n.Model.Time(o||0),this.$.find(".Ldt-CreateAnnotation-End").html(this.end.toString())}setBeginEnd(o,l){this.setBegin(o),this.setEnd(l)}showScreen(o){this.$.find(".Ldt-CreateAnnotation-"+o).show().siblings().hide()}show(){this.visible||(this.visible=!0,this.pause_when_displaying&&this.media.pause(),this.showScreen("Main"),this.$.find(".Ldt-CreateAnnotation-Description").val("").css("border-color","#666666").addClass("empty"),this.show_title_field&&this.$.find(".Ldt-CreateAnnotation-Title").val("").css("border-color","#666666").addClass("empty"),this.show_creator_field&&(this.$.find(".Ldt-CreateAnnotation-Creator").val(this.creator_name).css("border-color","#666666"),this.creator_name||this.$.find(".Ldt-CreateAnnotation-Creator").addClass("empty")),this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").removeClass("selected"),this.$.slideDown(),this.minimize_annotation_widget&&this.player.trigger("Annotation.minimize"))}hide(){this.visible&&(this.always_visible||(this.visible=!1,this.$.slideUp(),this.minimize_annotation_widget&&this.player.trigger("Annotation.maximize")))}toggle(){if(!this.always_visible)if(this.visible)this.hide();else{var o=this.media.getCurrentTime()||0;this.setBeginEnd(o,o),this.slice_widget&&this.slice_widget.setBounds(this.begin,this.end),this.show(),this.$.find(".Ldt-CreateAnnotation-Description").focus()}}addKeyword(o){var l=this.$.find(".Ldt-CreateAnnotation-Description"),t=n.Model.regexpFromTextOrArray(o),u=l.val();u=u.match(t)?u.replace(t,""):u+" "+o,l.val(u.replace(/\s{2,}/g," ").replace(/(^\s+|\s+$)/g,"")),this.onDescriptionChange()}pauseOnWrite(){this.pause_on_write&&!this.media.getPaused()&&this.media.pause()}onDescriptionChange(o){if(o!==void 0&&o.keyCode==13&&!o.shiftKey)return this.onSubmit(),!0;var l=this.$.find(".Ldt-CreateAnnotation-Description"),t=l.val();return l.css("border-color",t?"#666666":"#ff0000"),t?l.removeClass("empty"):l.addClass("empty"),this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").each(function(){var u=n.Model.regexpFromTextOrArray(jQuery(this).attr("data-text"));t.match(u)?jQuery(this).addClass("selected"):jQuery(this).removeClass("selected")}),this.pauseOnWrite(),!!t}onTitleChange(){var o=this.$.find(".Ldt-CreateAnnotation-Title"),l=o.val();return o.css("border-color",l?"#666666":"#ff0000"),l?o.removeClass("empty"):o.addClass("empty"),this.pauseOnWrite(),!!l}onCreatorChange(){var o=this.$.find(".Ldt-CreateAnnotation-Creator"),l=o.val();return o.css("border-color",l?"#666666":"#ff0000"),l?o.removeClass("empty"):o.addClass("empty"),this.pauseOnWrite(),!!l}onSubmit(){if(!this.onDescriptionChange()||this.show_title_field&&!this.onTitleChange()||this.show_creator_field&&!this.onCreatorChange())return!1;var o=this,l=new n.Model.List(this.player.sourceManager),t=this.player.sourceManager.newLocalSource({serializer:n.serializers[this.api_serializer]}),u=this.player.sourceManager.newLocalSource({serializer:n.serializers.ldt_localstorage}),h=new n.Model.Annotation(!1,t),v=this.source.getAnnotationTypes().searchByTitle(this.annotation_type,!0),w=v.length?v[0]:new n.Model.AnnotationType(!1,t),A=mustache.render(this.api_endpoint_template,{id:this.source.projectId});if(v.length||(w.dont_send_id=!0,w.title=this.annotation_type),h.setMedia(this.source.currentMedia.id),this.post_at_segment_time){var E=this.media.getCurrentTime(),C=this.source.getAnnotationsByTypeTitle(this.segments_annotation_type),M=C.filter(function(I){return E>=I.begin&&E<=I.end});M.length==0?(h.setBegin(this.begin),h.setEnd(this.end)):(h.setBegin(M[0].begin),h.setEnd(M[0].end))}else h.setBeginEnd(this.begin,this.end);h.setAnnotationType(w.id),this.show_title_field&&(h.title=this.$.find(".Ldt-CreateAnnotation-Title").val()),this.project_id!=""&&(h.project_id=this.project_id),h.created=new Date,h.description=this.$.find(".Ldt-CreateAnnotation-Description").val();var P=Array.prototype.map.call(this.$.find(".Ldt-CreateAnnotation-TagLi.selected"),function(I){return jQuery(I).attr("tag-id")});if(_$1(h.description.match(/#[^\s#.,;]+/g)).each(function(I){var j,B=I.replace(/^#/,""),F=o.source.getTags().searchByTitle(B,!0);F.length?j=F[0]:(j=new n.Model.Tag(!1,o.source),o.source.getTags().push(j),j.title=B),P.indexOf(j.id)===-1&&P.push(j.id)}),h.setTags(_$1(P).uniq()),this.audio_url&&(h.audio={src:"mic",mimetype:"audio/mp3",href:this.audio_url}),this.show_creator_field?h.creator=this.$.find(".Ldt-CreateAnnotation-Creator").val():h.creator=this.creator_name,l.push(h),this.editable_storage!=""&&(u.addList("annotation",l),o.source.merge(u),window.localStorage[this.editable_storage]&&u.deSerialize(window.localStorage[this.editable_storage]),window.localStorage[o.editable_storage]=u.serialize(),o.player.trigger("AnnotationsList.refresh"),o.player.trigger("Annotation.create",h),o.$.find(".Ldt-CreateAnnotation-Description").val("")),A!==""){l.push(h),t.addList("annotation",l);var o=this;jQuery.ajax({url:A,type:this.api_method,contentType:"application/json",data:t.serialize(),success:function(j){o.showScreen("Saved"),o.after_send_timeout&&window.setTimeout(function(){o.close_after_send?o.player.trigger("CreateAnnotation.hide"):o.player.trigger("CreateAnnotation.show")},o.after_send_timeout),t.getAnnotations().removeElement(h,!0),t.deSerialize(j),o.source.merge(t),o.pause_on_write&&o.media.getPaused()&&o.media.play(),o.player.trigger("AnnotationsList.refresh")},error:function(j,B,F){n.log("Error when sending annotation",F),t.getAnnotations().removeElement(h,!0),o.showScreen("Error"),window.setTimeout(function(){o.showScreen("Main")},o.after_send_timeout||5e3)}}),this.showScreen("Wait")}return!1}},Or(e,"defaults",{show_title_field:!0,show_creator_field:!0,creator_field_readonly:!1,start_visible:!0,always_visible:!1,show_slice:!0,show_arrow:!0,show_time:!0,minimize_annotation_widget:!0,creator_name:"",creator_avatar:"",tags:!1,tag_titles:!1,pause_on_write:!0,max_tags:8,polemics:[{keyword:"++",background_color:"#00a000",text_color:"#ffffff"},{keyword:"--",background_color:"#c00000",text_color:"#ffffff"},{keyword:"??",background_color:"#0000e0",text_color:"#ffffff"},{keyword:"==",background_color:"#f0e000",text_color:"#000000"}],slice_annotation_type:"chap",annotation_type:"Contributions",post_at_segment_time:!1,segment_annotation_type:"chap",api_serializer:"ldt_annotate",api_endpoint_template:"",api_method:"POST",editable_storage:"",project_id:"",after_send_timeout:0,close_after_send:!1,tag_prefix:"#",pause_when_displaying:!1,custom_send_button:!1,custom_cancel_button:!1,custom_description_placeholder:!1,preview_mode:!1}),Or(e,"messages",{en:{from_time:"from",to_time:"to",at_time:"at",submit:"Submit",preview_submit:"You cannot submit annotations in preview mode",cancel:"Cancel",add_keywords_:"Add keywords:",add_polemic_keywords_:"Add polemic attributes :",your_name_:"Your name:",annotate_video:"New note",type_title:"Annotation title",type_description:"Enter a new note...",wait_while_processing:"Please wait while your annotation is being processed...",error_while_contacting:"An error happened while contacting the server. Your annotation has not been saved.",annotation_saved:"Thank you, your annotation has been saved.",share_annotation:"Would you like to share it on social networks ?",close_widget:"Hide the annotation form","polemic++":"Agree","polemic--":"Disagree","polemic??":"Question","polemic==":"Reference",in_tooltip:"Set begin time to current player time",out_tooltip:"Set begin time to current player time",play_tooltip:"Play the fragment"},fr:{from_time:"de",to_time:"à",at_time:"à",submit:"Envoyer",preview_submit:"Vous ne pouvez pas envoyer d'annotation en mode aperçu",cancel:"Annuler",add_keywords_:"Ajouter des mots-clés :",add_polemic_keywords_:"Ajouter des attributs polémiques :",your_name_:"Votre nom :",annotate_video:"Entrez une nouvelle note...",type_title:"Titre de l'annotation",type_description:"Prenez vos notes...",wait_while_processing:"Veuillez patienter pendant le traitement de votre annotation...",error_while_contacting:"Une erreur s'est produite en contactant le serveur. Votre annotation n'a pas été enregistrée.",annotation_saved:"Merci, votre annotation a été enregistrée.",share_annotation:"Souhaitez-vous la partager sur les réseaux sociaux ?",close_widget:"Cacher le formulaire de création d'annotations","polemic++":"Accord","polemic--":"Désaccord","polemic??":"Question","polemic==":"Référence",in_tooltip:"Utiliser le temps courant comme début",out_tooltip:"Utiliser le temps courant comme fin",play_tooltip:"Jouer le fragment"}}),Or(e,"template",'{{#show_slice}}
{{/show_slice}}{{^show_slice}}{{#show_arrow}}
{{/show_arrow}}{{/show_slice}}

{{l10n.annotate_video}}{{#show_title_field}}

{{/show_title_field}}{{#show_time}} {{#show_slice}}{{l10n.from_time}} {{/show_slice}}{{^show_slice}}{{l10n.at_time}} {{/show_slice}} 00:00{{/show_time}}{{#show_slice}} {{l10n.to_time}} {{end}}{{/show_slice}}{{#show_creator_field}}{{l10n.your_name_}} {{/show_creator_field}}

{{#show_controls}}
InOutPlay
{{/show_controls}}{{#show_creator_field}}
{{/show_creator_field}}
{{#preview_mode}}{{/preview_mode}}{{^preview_mode}}{{/preview_mode}}
00:00
{{#tags.length}}
{{l10n.add_keywords_}}
    {{#tags}}
  • {{title}}
  • {{/tags}}
{{/tags.length}}{{#polemics.length}}
{{l10n.add_polemic_keywords_}}
    {{#polemics}}
  • {{keyword}}
  • {{/polemics}}
{{/polemics.length}}
{{l10n.wait_while_processing}}
{{^always_visible}}{{/always_visible}}
{{l10n.error_while_contacting}}
{{^always_visible}}{{/always_visible}}
{{l10n.annotation_saved}}
'),e},currentSegmentInfoboxStyles={},CurrentSegmentInfobox=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l)}draw(){var o=this;this.segments=this.getWidgetAnnotations(),this.renderTemplate(),this.currentSegment=!1,this.clearBox(),this.refresh(),this.onMediaEvent("timeupdate","refresh"),this.onMediaEvent("settimerange",function(l){var t=l[0],u=l[1],h=o.segments.filter(function(v){return v.begin.milliseconds==t.milliseconds&&v.end.milliseconds==u.milliseconds});h.length>0&&(o.$.toggleClass("editing",!1),o.currentSegment.id!=h[0].id&&(o.currentSegment=h[0],_data={editable_segments:o.editable_segments,edit:o.custom_edit_text?o.custom_edit_text:o.l10n.edit,title:o.currentSegment.title,description:o.currentSegment.description,description_placeholder:o.empty_description_placeholder,tags:o.currentSegment.getTagTexts()},o.$.html(mustache.render(o.template,_data)),o.editable_segments&&o.currentSegment&&o.$.find(".Ldt-CurrentSegmentInfobox").click(o.functionWrapper("enableEditMode"))))}),this.editable_segments&&this.currentSegment&&this.$.find(".Ldt-CurrentSegmentInfobox").click(o.functionWrapper("enableEditMode"))}enableEditMode(){this.currentSegment&&(_data={title:this.currentSegment.title,description:this.currentSegment.description,tags:this.currentSegment.getTagTexts(),submit:this.l10n.submit,cancel:this.l10n.cancel,headers:this.show_headers,tags_header:this.custom_tags_header?this.custom_tags_header:this.l10n.tags_header,fields_header:this.custom_fields_header?this.custom_fields_header:this.l10n.fields_header,new_tag:this.l10n.new_tag,delete_tag:this.l10n.delete_tag,new_tag_button:this.new_tag_button},this.$.toggleClass("editing",!0),this.$.html(mustache.render(this.editTemplate,_data)),this.$.find(".Ldt-CurrentSegmentInfobox-CancelButton").click(this.functionWrapper("disableEditMode")),this.new_tag_button?this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagButton").click(this.functionWrapper("insertTagInput")):(this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput").keypress(this.functionWrapper("insertTagInputKeypress")),this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput-Add").click(this.functionWrapper("insertTagInputKeypress"))),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput")),this.$.find(".Ldt-CurrentSegmentInfobox-SubmitButton").click(this.functionWrapper("onSubmit")))}disableEditMode(){this.currentSegment&&(_data={editable_segments:this.editable_segments,edit:this.custom_edit_text?this.custom_edit_text:this.l10n.edit,title:this.currentSegment.title,description:this.currentSegment.description,description_placeholder:this.empty_description_placeholder,tags:this.currentSegment.getTagTexts()},this.$.toggleClass("editing",!1),this.$.html(mustache.render(this.template,_data)),this.$.find(".Ldt-CurrentSegmentInfobox").click(this.functionWrapper("enableEditMode")))}insertTagInput(){!this.currentSegment.getTagTexts().length&&!this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").length&&this.$.find(".Ldt-CurrentSegmentInfobox-Tags").prepend('
    '),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").append('
  • '+this.l10n.delete_tag+"
  • "),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput"))}insertTagInputKeypress(o){var l=o.keyCode?o.keyCode:o.which;if(l=="13"||o.type=="click")return!this.currentSegment.getTagTexts().length&&!this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").length&&this.$.find(".Ldt-CurrentSegmentInfobox-Tags").prepend('
      '),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").append('
    • '+this.l10n.delete_tag+"
    • "),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput")),this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput").val(""),!1}deleteTagInput(o){jQuery(o.currentTarget).parent().remove()}onSubmit(){new_tags_titles=this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-Input").map(function(){if(jQuery(this).val())return jQuery(this).val()}),new_title=this.$.find(".Ldt-CurrentSegmentInfobox-TitleInput").val(),new_description=this.$.find(".Ldt-CurrentSegmentInfobox-DescriptionInput").val();var o=this,l=new n.Model.List(this.player.sourceManager),t=this.player.sourceManager.newLocalSource({serializer:n.serializers[this.api_serializer]}),u=new n.Model.Annotation(this.currentSegment.id,t);u.setAnnotationType(this.currentSegment.getAnnotationType().id),u.setMedia(this.currentSegment.getMedia().id),u.setBegin(this.currentSegment.begin),u.setEnd(this.currentSegment.end),u.created=this.currentSegment.created,u.creator=this.currentSegment.creator,u.title=new_title,u.description=new_description;var h=_$1(new_tags_titles).map(function(v){var w=o.source.getTags(!0).searchByTitle(v,!0);if(w.length)var A=w[0];else A=new n.Model.Tag(v.replace(/\W/g,"_"),o.source),A.title=v,o.source.getTags().push(A);return A.id}).value();u.setTags(h),u.project_id=this.project_id,l.push(u),t.addList("annotation",l),_url=mustache.render(this.api_endpoint_template,{annotation_id:this.currentSegment.id}),n.jQuery.ajax({url:_url,type:this.api_method,contentType:"application/json",data:t.serialize(),success:function(v){t.getAnnotations().removeElement(u,!0),t.deSerialize(v),o.source.merge(t),o.segments.forEach(function(w){w.id==u.id&&o.segments.removeElement(w)}),o.segments.push(u),o.currentSegment=u,v={editable_segments:o.editable_segments,edit:o.custom_edit_text?o.custom_edit_text:o.l10n.edit,title:o.currentSegment.title,description:o.currentSegment.description,description_placeholder:o.empty_description_placeholder,tags:o.currentSegment.getTagTexts()},o.$.html(mustache.render(o.template,v)),o.editable_segments&&o.currentSegment&&o.$.find(".Ldt-CurrentSegmentInfobox").click(o.functionWrapper("enableEditMode")),o.$.toggleClass("editing",!1)},error:function(v,w,A){n.log("Error when sending annotation",A),t.getAnnotations().removeElement(u,!0)}})}refresh(){if(!this.media.getTimeRange()){var o=this.media.getCurrentTime(),l=this.segments.filter(function(t){return t.begin<=o&&t.end>=o});l.length>0?this.currentSegment.id!=l[0].id&&(this.currentSegment=l[0],_data={editable_segments:this.editable_segments,edit:this.custom_edit_text?this.custom_edit_text:this.l10n.edit,title:this.currentSegment.title,description:this.currentSegment.description,description_placeholder:this.empty_description_placeholder,tags:this.currentSegment.getTagTexts()},this.$.html(mustache.render(this.template,_data)),this.editable_segments&&this.currentSegment&&this.$.find(".Ldt-CurrentSegmentInfobox").click(this.functionWrapper("enableEditMode"))):(this.currentSegment=!1,this.clearBox())}}clearBox(){var o=this.l10n.empty;this.empty_message&&(o=this.empty_message),this.$.find(".Ldt-CurrentSegmentInfobox").html("
      "+o+"
      ")}},Or(e,"defaults",{annotation_type:"chap",editable_segments:!1,empty_message:!1,project_id:!1,api_serializer:"ldt_annotate",api_method:"PUT",api_endpoint_template:"",new_tag_button:!0,show_headers:!1,custom_edit_text:!1,empty_description_placeholder:!1}),Or(e,"template",'
      {{#editable_segments}}
      {{edit}}
      {{/editable_segments}}
      {{title}}
      {{description}}
      {{^description}}{{^tags.length}}{{#description_placeholder}}
      {{description_placeholder}}
      {{/description_placeholder}}{{/tags.length}}{{/description}}
      {{#tags.length}}
        {{#tags}}{{#.}}
      • {{.}}
      • {{/.}}{{/tags}}
      {{/tags.length}}
      '),Or(e,"editTemplate",'
      {{#headers}}
      {{fields_header}}
      {{/headers}}
      {{#headers}}
      {{tags_header}}
      {{/headers}}{{#new_tag_button}}
      {{new_tag}}
      {{/new_tag_button}}{{^new_tag_button}}
      +
      {{/new_tag_button}}
        {{#tags}}{{#.}}
      • {{delete_tag}}
      • {{/.}}{{/tags}}
      {{submit}}
      {{cancel}}
      '),Or(e,"messages",{fr:{submit:"Soumettre",cancel:"Annuler",edit:"Editer",new_tag:"Nouveau tag",delete_tag:"Supprimer",fields_header:"Commentaire associé à ce segment",tags_header:"Mots-clés associés à ce segment",empty:"Le player vidéo ne lit actuellement aucun segment"},en:{submit:"Submit",cancel:"Cancel",edit:"Edit",new_tag:"New tag",delete_tag:"Delete tag",fields_header:"Current segment content",tags_header:"Current segment tags",empty:"The player currently doesn't read any segment"}}),e},DailymotionPlayer=function(n){var e;return e=class extends n.Widgets.Widget{constructor(l,t){super(l,t);Or(this,"draw",function(){typeof this.video>"u"&&(this.video=this.media.video),this.height=this.height||Math.floor(this.width/this.aspect_ratio);var l=this.media,t=null,u=this,h={pause:!0,apiready:!1,volume:0,time:0,duration:0},v=this.video.match(/www.dailymotion.com\/video\/(.+)/);v&&(t=v[1]);var w=mustache.render("{{ protocol }}//www.dailymotion.com/embed/video/{{ videoid }}",{protocol:document.location.protocol.search("http")==0?document.location.protocol:"http:",videoid:t}),A={api:"postMessage",chromeless:1,id:"dm_player",related:0,autoplay:1};u.$.html(mustache.render('',{player_url:w,params:Object.keys(A).reduce(function(C,M){return C.push(M+"="+encodeURIComponent(A[M])),C},[]).join("&"),width:this.width,height:this.height,id:A.id}));function E(){var C=u.$.find("#"+A.id)[0].contentWindow,M=function(P,I){I!==void 0&&(P=P+"="+I),C.postMessage(P,"*")};l.getCurrentTime=function(){return h.time},l.getVolume=function(){return h.volume},l.getPaused=function(){return h.pause},l.getMuted=function(){return h.muted},l.setCurrentTime=function(P){M("seek",P/1e3)},l.setVolume=function(P){M("volume",P*100)},l.mute=function(){M("muted",1)},l.unmute=function(){M("muted",0)},l.play=function(){M("play")},l.pause=function(){M("pause")}}window.addEventListener("message",function(C){if(C.data.split!==void 0){var M=C.data.split("&").map(function(P){return P.split("=")}).reduce(function(P,I){return P[I[0]]=decodeURIComponent(I[1]),P},{});switch(M.event){case"apiready":h.apiready=!0,E();break;case"durationchange":M.duration.slice(-2)=="sc"&&(h.duration=1e3*Number(M.duration.slice(0,-2)),l.setDuration(h.duration));break;case"ended":h.pause=!0;break;case"loadedmetadata":l.trigger("loadedmetadata");break;case"pause":h.pause=!0,l.trigger("pause");break;case"play":h.pause=!1,l.trigger("play");break;case"seeked":h.time=new n.Model.Time(1e3*Number(M.time)),l.trigger("seeked");break;case"timeupdate":h.time=new n.Model.Time(1e3*Number(M.time)),l.trigger("timeupdate",h.time);break;case"volumechange":h.muted=M.muted=="true",h.volume=Number(M.volume)/100;break}}},!1)})}},Or(e,"defaults",{aspect_ratio:14/9}),e},enrichedPlanStyles={},EnrichedPlan=function(n){var e;return e=class extends n.Widgets.Widget{constructor(l,t){super(l,t);Or(this,"annotationTemplate",'
      {{{ text }}} {{ author }}
      ')}draw(){var l=this;l.prefix="TODO";var t=this.getWidgetAnnotations().sortBy(function(A){return A.begin}),u=this.media.getAnnotations().filter(function(A){return A.getAnnotationType().title!=l.annotation_type}).sortBy(function(A){return A.begin});t.forEach(function(A){A.annotations=u.filter(function(E){return E.begin>=A.begin&&E.begin<=A.end})}),l.renderTemplate();var h=l.$.find(".Ldt-EnrichedPlan-Container"),v=l.$.find(".Ldt-EnrichedPlan-Content");function w(A){return A.title.indexOf("Anonyme")<0?"Own":"Other"}t.forEach(function(A){var E=mustache.render(l.slideTemplate,{id:A.id,atitle:n.textFieldHtml(A.title),level:A.content.level||1,begin:A.begin.toString(),begintc:A.begin.milliseconds,thumbnail:A.thumbnail,show_slides:l.show_slides,notes:A.annotations.map(function(M){return mustache.render(l.annotationTemplate,{id:M.id,text:n.textFieldHtml(M.description||M.title),author:M.creator,begin:M.begin.toString(),begintc:M.begin.milliseconds,atitle:M.title.slice(0,20),category:"Ldt-EnrichedPlan-Note-"+w(M),filtered:w(M)=="Own"&&!l.show_own_notes||w(M)=="Other"&&!l.show_other_notes||w(M)=="Teacher"&&!l.show_teacher_notes?"filtered_out":""})}).join(` +You are running Raphaël `+this.version};var S,c=function(D,O,Q){for(var J=A(O).toLowerCase().split("-"),X=Q?"end":"start",U=J.length,z="classic",ie="medium",de="medium";U--;)switch(J[U]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":z=J[U];break;case"wide":case"narrow":de=J[U];break;case"long":case"short":ie=J[U]}var me=D.node.getElementsByTagName("stroke")[0];me[X+"arrow"]=z,me[X+"arrowlength"]=ie,me[X+"arrowwidth"]=de},m=function(D,O){D.attrs=D.attrs||{};var Q=D.node,J=D.attrs,X=Q.style,U=ye[D.type]&&(O.x!=J.x||O.y!=J.y||O.width!=J.width||O.height!=J.height||O.cx!=J.cx||O.cy!=J.cy||O.rx!=J.rx||O.ry!=J.ry||O.r!=J.r),z=L[D.type]&&(J.cx!=O.cx||J.cy!=O.cy||J.r!=O.r||J.rx!=O.rx||J.ry!=O.ry),ie=D;for(var de in O)O[w](de)&&(J[de]=O[de]);if(U&&(J.path=v._getPath[D.type](D),D._.dirty=1),O.href&&(Q.href=O.href),O.title&&(Q.title=O.title),O.target&&(Q.target=O.target),O.cursor&&(X.cursor=O.cursor),"blur"in O&&D.blur(O.blur),(O.path&&D.type=="path"||U)&&(Q.path=function(We){var et=/[ahqstv]/gi,Ye=v._pathToAbsolute;if(A(We).match(et)&&(Ye=v._path2curve),et=/[clmz]/g,Ye==v._pathToAbsolute&&!A(We).match(et)){var De=A(We).replace(re,function(pt,Bt,ur){var kt=[],Ut=Bt.toLowerCase()=="m",Wr=Z[Bt];return ur.replace(V,function(zt){Ut&&kt.length==2&&(Wr+=kt+Z[Bt=="m"?"l":"L"],kt=[]),kt.push(M(zt*he))}),Wr+kt});return De}var Ht,Mt,ge=Ye(We);De=[];for(var Dt=0,yt=ge.length;Dt"));var Me=Ct.getBoundingClientRect();ie.W=J.w=(Me.right-Me.left)/100,ie.H=J.h=(Me.bottom-Me.top)/100,ie.X=J.x,ie.Y=J.y+ie.H/2,("x"in O||"y"in O)&&(ie.path.v=v.format("m{0},{1}l{2},{1}",M(J.x*he),M(J.y*he),M(J.x*he)+1));for(var te=["x","y","text","font","font-family","font-weight","font-style","font-size"],_e=0,je=te.length;_e.25&&(st=C.sqrt(.25-J(mt-.5,2))*(2*(st>.5)-1)+.5),U=mt+N+st),ee})).split(/\s*\-\s*/),X=="linear"){var z=O.shift();if(z=-E(z),isNaN(z))return null}var ie=v._parseDots(O);if(!ie)return null;if(D=D.shape||D.node,ie.length){D.removeChild(Q),Q.on=!0,Q.method="none",Q.color=ie[0].color,Q.color2=ie[ie.length-1].color;for(var de=[],me=0,pe=ie.length;me')}}catch{S=function(J){return O.createElement("<"+J+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},v._engine.initWin(v._g.win),v._engine.create=function(){var D=v._getContainer.apply(0,arguments),O=D.container,Q=D.height,J=D.width,X=D.x,U=D.y;if(!O)throw new Error("VML container not found.");var z=new v._Paper,ie=z.canvas=v._g.doc.createElement("div"),de=ie.style;return X=X||0,U=U||0,J=J||512,Q=Q||342,z.width=J,z.height=Q,J==+J&&(J+="px"),Q==+Q&&(Q+="px"),z.coordsize=216e5+N+216e5,z.coordorigin="0 0",z.span=v._g.doc.createElement("span"),z.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",ie.appendChild(z.span),de.cssText=v.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",J,Q),O==1?(v._g.doc.body.appendChild(ie),de.left=X+"px",de.top=U+"px",de.position="absolute"):O.firstChild?O.insertBefore(ie,O.firstChild):O.appendChild(ie),z.renderfix=function(){},z},v.prototype.clear=function(){v.eve("raphael.clear",this),this.canvas.innerHTML=ee,this.span=v._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},v.prototype.remove=function(){for(var D in v.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[D]=typeof this[D]=="function"?v._removedFactory(D):null;return!0};var d=v.st;for(var k in b)b[w](k)&&!d[w](k)&&(d[k]=function(D){return function(){var O=arguments;return this.forEach(function(Q){Q[D].apply(Q,O)})}}(k))}}).apply(l,u))===void 0||(o.exports=h)}])})})(raphael_min);var raphael_minExports=raphael_min.exports;const Raphael=getDefaultExportFromCjs$1(raphael_minExports),Arrow=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l),this.current_pilot_widget=this.pilot_widget}draw(){this.height=this.arrow_height+this.base_height,this.$.addClass("Ldt-Arrow").css({height:1+this.height+"px","margin-top":"1px",overflow:"hidden"}),this.paper=new Raphael(this.container,this.width,1+this.height),window.myArrow=this,this.svgArrow=this.paper.path("M0,"+this.height+"L"+this.width+","+this.height),this.svgArrow.attr({stroke:this.stroke_color,"stroke-width":this.stroke_width,fill:this.fill_url?"url("+this.fill_url+")":this.fill_color}),this.moveToX(0)}drawAt(o){o=Math.max(0,Math.min(o,this.width));var l="M0,"+this.height+"L0,"+Math.min(this.height,this.arrow_height+this.base_curve)+"Q0,"+this.arrow_height+" "+Math.max(0,Math.min(this.base_curve,o-this.arrow_width/2))+","+this.arrow_height+"L"+Math.max(0,o-this.arrow_width/2)+","+this.arrow_height+"L"+Math.max(0,o-this.arrow_width/2)+","+Math.min(this.arrow_height,2*this.arrow_height*o/this.arrow_width)+"L"+o+",0L"+Math.min(this.width,o+this.arrow_width/2)+","+Math.min(this.arrow_height,2*this.arrow_height*(this.width-o)/this.arrow_width)+"L"+Math.min(this.width,o+this.arrow_width/2)+","+this.arrow_height+"L"+Math.min(this.width,Math.max(this.width-this.base_curve,o+this.arrow_width/2))+","+this.arrow_height+"Q"+this.width+","+this.arrow_height+" "+this.width+","+Math.min(this.height,this.arrow_height+this.base_curve)+"L"+this.width+","+this.height;this.svgArrow.attr({path:l})}moveToX(o){this.targetX=Math.max(0,Math.min(o,this.width)),typeof this.animInterval>"u"&&(this.animInterval=window.setInterval(this.functionWrapper("increment"),40)),this.increment()}moveToTime(o){this.media&&this.moveToX(this.width*o/this.media.duration)}increment(){typeof this.currentX>"u"&&(this.currentX=this.targetX),this.currentXthis.targetX&&(this.currentX=Math.max(this.targetX,this.currentX-this.animation_speed)),this.currentX===this.targetX&&(window.clearInterval(this.animInterval),this.animInterval=void 0),this.drawAt(this.currentX)}},Or(e,"defaults",{arrow_height:12,arrow_width:20,base_height:0,base_curve:0,fill_url:n.widgetsDir+"/img/pinstripe.png",fill_color:"#ffffff",stroke_color:"#b7b7b7",stroke_width:1.5,animation_speed:20}),e},controllerStyles={},Controller=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l),this.lastSearchValue=""}draw(){var o=this;this.renderTemplate(),this.$playButton=this.$.find(".Ldt-Ctrl-Play"),this.$searchBlock=this.$.find(".Ldt-Ctrl-Search"),this.$searchInput=this.$.find(".Ldt-Ctrl-SearchInput"),this.$volumeBar=this.$.find(".Ldt-Ctrl-Volume-Bar"),this.onMediaEvent("play","playButtonUpdater"),this.onMediaEvent("pause","playButtonUpdater"),this.onMediaEvent("volumechange","volumeUpdater"),this.onMediaEvent("timeupdate","timeDisplayUpdater"),this.onMediaEvent("loadedmetadata","volumeUpdater"),this.$playButton.click(this.functionWrapper("playHandler")),this.enable_quiz_toggle!==void 0?this.enable_quiz_toggle?(this.$.find(".Ldt-Ctrl-Quiz-Enable").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.$.find(".Ldt-Ctrl-Quiz-Create").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.$.find("#QuizEditContainer").show()):(this.$.find(".Ldt-Ctrl-Quiz-Enable").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.$.find(".Ldt-Ctrl-Quiz-Create").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.player.trigger("QuizCreator.hide"),this.$.find("#QuizEditContainer").hide()):this.$.find(".Ldt-Ctrl-Quiz-Enable").hide(),this.$.find(".Ldt-Ctrl-Annotate").click(function(){o.player.trigger("CreateAnnotation.toggle")}),this.$.find(".Ldt-Ctrl-SearchBtn").click(this.functionWrapper("searchButtonHandler")),this.$searchInput.keyup(this.functionWrapper("searchHandler")),this.$searchInput.on("search",this.functionWrapper("searchHandler")),this.$.find(".Ldt-Ctrl-Fullscreen-Button").click(this.functionWrapper("toggleFullscreen"));var l=n.getFullscreenEventname();l&&document.addEventListener(l,function(){n.isFullscreen()&&n.getFullscreenElement()==o.$[0]?o.$.addClass("Ldt-Fullscreen-Element"):o.$.removeClass("Ldt-Fullscreen-Element")}),this.$.find(".Ldt-Ctrl-Quiz-Enable").click(this.functionWrapper("toggleQuiz")),this.$.find(".Ldt-Ctrl-Quiz-Create").click(this.functionWrapper("createQuiz"));var t=this.$.find(".Ldt-Ctrl-Volume-Control");if(this.$.find(".Ldt-Ctrl-Sound").click(this.functionWrapper("muteHandler")).mouseover(function(){t.show()}).mouseout(function(){t.hide()}),t.mouseover(function(){t.show()}).mouseout(function(){t.hide()}),!this.disable_ctrl_f){var u=70,h=0;jQuery(document).keydown(function(w){if(w.keyCode===u&&(w.ctrlKey||w.metaKey)){var A=jQuery.now();return A-h>2e3&&o.searchButtonHandler(),h=A,!1}})}this.$volumeBar.slider({slide:function(w,A){o.$volumeBar.attr("title",o.l10n.volume+": "+A.value+"%"),o.media.setVolume(A.value/100)},stop:this.functionWrapper("volumeUpdater")}),this.$.hover(function(){o.player.trigger("Player.MouseOver")},function(){o.player.trigger("Player.MouseOut")}),this.timeDisplayUpdater(new n.Model.Time(0));var v=this.source.getAnnotations();v.on("search",function(w){o.$searchInput.val(w),o.showSearchBlock()}),v.on("found",function(w){o.$searchInput.css("background-color","#e1ffe1")}),v.on("not-found",function(w){o.$searchInput.css("background-color","#d62e3a")}),v.on("search-cleared",function(){o.hideSearchBlock()}),o.always_show_search&&o.showSearchBlock()}timeDisplayUpdater(o){var l=this.media.duration;this.$.find(".Ldt-Ctrl-Time-Elapsed").html(o.toString()),this.$.find(".Ldt-Ctrl-Time-Total").html(l.toString())}playButtonUpdater(){this.media.getPaused()?this.$playButton.attr("title",this.l10n.play).removeClass("Ldt-Ctrl-Play-PauseState").addClass("Ldt-Ctrl-Play-PlayState"):this.$playButton.attr("title",this.l10n.pause).removeClass("Ldt-Ctrl-Play-PlayState").addClass("Ldt-Ctrl-Play-PauseState")}toggleFullscreen(){console.log("toggleFullscreen",jQuery("video",this.player.widgets[0].$[0]));const o=jQuery("video",this.player.widgets[0].$[0])[0];n.setFullScreen(o,!n.isFullscreen())}createQuiz(){this.player.trigger("Quiz.hide"),this.media.pause(),this.player.trigger("QuizCreator.create")}toggleQuiz(){this.enable_quiz_toggle=!this.enable_quiz_toggle,this.enable_quiz_toggle?(jQuery(".Ldt-Ctrl-Quiz-Enable").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),jQuery(".Ldt-Ctrl-Quiz-Create").addClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.player.trigger("Quiz.activate")):(jQuery(".Ldt-Ctrl-Quiz-Enable").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),jQuery(".Ldt-Ctrl-Quiz-Create").removeClass("Ldt-Ctrl-Quiz-Toggle-Active"),this.player.trigger("Quiz.deactivate"),this.player.trigger("QuizCreator.hide"))}playHandler(){this.media.getPaused()?this.media.play():this.media.pause()}muteHandler(){this.media.setMuted(!this.media.getMuted())}volumeUpdater(){var o=this.media.getMuted(),l=this.media.getVolume();l===!1&&(l=.5);var t=this.$.find(".Ldt-Ctrl-Sound");t.removeClass("Ldt-Ctrl-Sound-Mute Ldt-Ctrl-Sound-Half Ldt-Ctrl-Sound-Full"),o?t.attr("title",this.l10n.unmute).addClass("Ldt-Ctrl-Sound-Mute"):t.attr("title",this.l10n.mute).addClass(l<.5?"Ldt-Ctrl-Sound-Half":"Ldt-Ctrl-Sound-Full"),this.$volumeBar.slider("value",o?0:100*l)}showSearchBlock(){this.$searchBlock.animate({width:"160px"},200),this.$searchInput.css("background-color","#fff"),this.$searchInput.focus()}hideSearchBlock(){this.always_show_search||this.$searchBlock.animate({width:0},200)}searchButtonHandler(){if(this.$searchBlock.width())this.hideSearchBlock();else{this.showSearchBlock();var o=this.$searchInput.val();o&&this.source.getAnnotations().search(o)}}searchHandler(){this.$searchBlock.width()||(this.$searchBlock.css({width:"160px"}),this.$searchInput.css("background-color","#fff"));var o=this.$searchInput.val();this._positiveMatch=!1,o!==this.lastSearchValue&&(o?this.source.getAnnotations().search(o):(this.source.getAnnotations().trigger("clear-search"),this.$searchInput.css("background-color",""))),this.lastSearchValue=o}},Or(e,"defaults",{disable_annotate_btn:!1,disable_search_btn:!1,disable_ctrl_f:!1,disable_fullscreen:!0,always_show_search:!1,enable_quiz_toggle:void 0}),Or(e,"template",'
      {{^disable_annotate_btn}}
      {{/disable_annotate_btn}}{{^disable_search_btn}}
      {{/disable_search_btn}}
      {{^disable_fullscreen}}
      00:00
      /
      00:00
      '),Or(e,"messages",{en:{play_pause:"Play/Pause",mute_unmute:"Mute/Unmute",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",annotate:"Annotate",search:"Search",elapsed_time:"Elapsed time",total_time:"Total duration",volume:"Volume",volume_control:"Volume control",enable_quiz:"Enable quiz"},fr:{play_pause:"Lecture/Pause",mute_unmute:"Couper/Activer le son",play:"Lecture",pause:"Pause",mute:"Couper le son",unmute:"Activer le son",annotate:"Annoter",search:"Rechercher",elapsed_time:"Temps écoulé",total_time:"Durée totale",volume:"Niveau sonore",volume_control:"Réglage du niveau sonore",enable_quiz:"Activer le quiz"}}),e},createAnnotationStyles={},CreateAnnotation=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l),this.editable_storage!=""&&window.localStorage[this.editable_storage]&&this.source.onLoad(function(){var t=this.player.sourceManager.newLocalSource({serializer:n.serializers.ldt_localstorage});t.deSerialize(window.localStorage[this.editable_storage]),_this.source.merge(t)})}draw(){var o=this;this.begin=new n.Model.Time,this.end=this.source.getDuration(),this.tag_prefix=this.tag_prefix||"",this.tag_titles&&!this.tags&&(this.tag_titles.length==1&&this.tag_titles[0]==""?this.tags=!0:this.tags=_$1(this.tag_titles).map(function(l){var t,u=o.source.getTags().searchByTitle(l,!0);return u.length?t=u[0]:(t=new n.Model.Tag(!1,o.source),o.source.getTags().push(t),t.title=l),t}).value()),this.tags||(this.tags=this.source.getTags().sortBy(function(l){return-l.getAnnotations().length}).slice(0,this.max_tags).map(function(l){return l})),this.renderTemplate(),this.show_slice?this.insertSubwidget(this.$.find(".Ldt-CreateAnnotation-Slice"),{type:"Slice",show_arrow:this.show_arrow,annotation_type:this.slice_annotation_type,onBoundsChanged:function(l,t){o.setBeginEnd(l,t)}},"slice"):(this.show_arrow&&this.insertSubwidget(this.$.find(".Ldt-CreateAnnotation-Arrow"),{type:"Arrow"},"arrow"),this.onMediaEvent("timeupdate",function(l){o.$.find(".Ldt-CreateAnnotation-Description").val().trim()==""&&(o.setBeginEnd(l,l),o.arrow&&o.arrow.moveToTime(l))})),this.$.find(".Ldt-CreateAnnotation-Cancel").click(function(){o.player.trigger("CreateAnnotation.hide")}),this.$.find(".Ldt-CreateAnnotation-Close").click(function(){return o.close_after_send?o.player.trigger("CreateAnnotation.hide"):o.showScreen("Main"),!1}),this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").click(function(){return o.addKeyword(jQuery(this).attr("data-text")),!1}),this.$.find(".Ldt-CreateAnnotation-PolemicLi").each(function(){var l=jQuery(this),t=l.attr("data-text"),u=o.l10n["polemic"+t];u&&l.attr("title",u)}),this.$.find(".Ldt-CreateAnnotation-Description").bind("change keyup input paste",this.functionWrapper("onDescriptionChange")),this.show_title_field&&this.$.find(".Ldt-CreateAnnotation-Title").bind("change keyup input paste",this.functionWrapper("onTitleChange")),this.show_creator_field&&this.$.find(".Ldt-CreateAnnotation-Creator").bind("change keyup input paste",this.functionWrapper("onCreatorChange")),this.$.find("[class^='Ldt-CreateAnnotation-Control-']").click(function(){var l=this.className.replace("Ldt-CreateAnnotation-Control-","");switch(l){case"In":this.setBegin(o.media.getCurrentTime());break;case"Out":this.setEnd(o.media.getCurrentTime()||o.media.duration);break;case"Play":this.media.setCurrentTime(o.begin),this.media.play();break}return!1}),this.start_visible?this.show():(this.$.hide(),this.hide()),this.onMdpEvent("CreateAnnotation.toggle","toggle"),this.onMdpEvent("CreateAnnotation.hide","hide"),this.onMdpEvent("CreateAnnotation.show","show"),this.$.find("form").submit(this.functionWrapper("onSubmit"))}setBegin(o){this.begin=new n.Model.Time(o||0),this.$.find(".Ldt-CreateAnnotation-Begin").html(this.begin.toString())}setEnd(o){this.end=new n.Model.Time(o||0),this.$.find(".Ldt-CreateAnnotation-End").html(this.end.toString())}setBeginEnd(o,l){this.setBegin(o),this.setEnd(l)}showScreen(o){this.$.find(".Ldt-CreateAnnotation-"+o).show().siblings().hide()}show(){this.visible||(this.visible=!0,this.pause_when_displaying&&this.media.pause(),this.showScreen("Main"),this.$.find(".Ldt-CreateAnnotation-Description").val("").css("border-color","#666666").addClass("empty"),this.show_title_field&&this.$.find(".Ldt-CreateAnnotation-Title").val("").css("border-color","#666666").addClass("empty"),this.show_creator_field&&(this.$.find(".Ldt-CreateAnnotation-Creator").val(this.creator_name).css("border-color","#666666"),this.creator_name||this.$.find(".Ldt-CreateAnnotation-Creator").addClass("empty")),this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").removeClass("selected"),this.$.slideDown(),this.minimize_annotation_widget&&this.player.trigger("Annotation.minimize"))}hide(){this.visible&&(this.always_visible||(this.visible=!1,this.$.slideUp(),this.minimize_annotation_widget&&this.player.trigger("Annotation.maximize")))}toggle(){if(!this.always_visible)if(this.visible)this.hide();else{var o=this.media.getCurrentTime()||0;this.setBeginEnd(o,o),this.slice_widget&&this.slice_widget.setBounds(this.begin,this.end),this.show(),this.$.find(".Ldt-CreateAnnotation-Description").focus()}}addKeyword(o){var l=this.$.find(".Ldt-CreateAnnotation-Description"),t=n.Model.regexpFromTextOrArray(o),u=l.val();u=u.match(t)?u.replace(t,""):u+" "+o,l.val(u.replace(/\s{2,}/g," ").replace(/(^\s+|\s+$)/g,"")),this.onDescriptionChange()}pauseOnWrite(){this.pause_on_write&&!this.media.getPaused()&&this.media.pause()}onDescriptionChange(o){if(o!==void 0&&o.keyCode==13&&!o.shiftKey)return this.onSubmit(),!0;var l=this.$.find(".Ldt-CreateAnnotation-Description"),t=l.val();return l.css("border-color",t?"#666666":"#ff0000"),t?l.removeClass("empty"):l.addClass("empty"),this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").each(function(){var u=n.Model.regexpFromTextOrArray(jQuery(this).attr("data-text"));t.match(u)?jQuery(this).addClass("selected"):jQuery(this).removeClass("selected")}),this.pauseOnWrite(),!!t}onTitleChange(){var o=this.$.find(".Ldt-CreateAnnotation-Title"),l=o.val();return o.css("border-color",l?"#666666":"#ff0000"),l?o.removeClass("empty"):o.addClass("empty"),this.pauseOnWrite(),!!l}onCreatorChange(){var o=this.$.find(".Ldt-CreateAnnotation-Creator"),l=o.val();return o.css("border-color",l?"#666666":"#ff0000"),l?o.removeClass("empty"):o.addClass("empty"),this.pauseOnWrite(),!!l}onSubmit(){if(!this.onDescriptionChange()||this.show_title_field&&!this.onTitleChange()||this.show_creator_field&&!this.onCreatorChange())return!1;var o=this,l=new n.Model.List(this.player.sourceManager),t=this.player.sourceManager.newLocalSource({serializer:n.serializers[this.api_serializer]}),u=this.player.sourceManager.newLocalSource({serializer:n.serializers.ldt_localstorage}),h=new n.Model.Annotation(!1,t),v=this.source.getAnnotationTypes().searchByTitle(this.annotation_type,!0),w=v.length?v[0]:new n.Model.AnnotationType(!1,t),A=mustache.render(this.api_endpoint_template,{id:this.source.projectId});if(v.length||(w.dont_send_id=!0,w.title=this.annotation_type),h.setMedia(this.source.currentMedia.id),this.post_at_segment_time){var E=this.media.getCurrentTime(),C=this.source.getAnnotationsByTypeTitle(this.segments_annotation_type),M=C.filter(function(I){return E>=I.begin&&E<=I.end});M.length==0?(h.setBegin(this.begin),h.setEnd(this.end)):(h.setBegin(M[0].begin),h.setEnd(M[0].end))}else h.setBeginEnd(this.begin,this.end);h.setAnnotationType(w.id),this.show_title_field&&(h.title=this.$.find(".Ldt-CreateAnnotation-Title").val()),this.project_id!=""&&(h.project_id=this.project_id),h.created=new Date,h.description=this.$.find(".Ldt-CreateAnnotation-Description").val();var P=Array.prototype.map.call(this.$.find(".Ldt-CreateAnnotation-TagLi.selected"),function(I){return jQuery(I).attr("tag-id")});if(_$1(h.description.match(/#[^\s#.,;]+/g)).each(function(I){var j,B=I.replace(/^#/,""),F=o.source.getTags().searchByTitle(B,!0);F.length?j=F[0]:(j=new n.Model.Tag(!1,o.source),o.source.getTags().push(j),j.title=B),P.indexOf(j.id)===-1&&P.push(j.id)}),h.setTags(_$1(P).uniq()),this.audio_url&&(h.audio={src:"mic",mimetype:"audio/mp3",href:this.audio_url}),this.show_creator_field?h.creator=this.$.find(".Ldt-CreateAnnotation-Creator").val():h.creator=this.creator_name,l.push(h),this.editable_storage!=""&&(u.addList("annotation",l),o.source.merge(u),window.localStorage[this.editable_storage]&&u.deSerialize(window.localStorage[this.editable_storage]),window.localStorage[o.editable_storage]=u.serialize(),o.player.trigger("AnnotationsList.refresh"),o.player.trigger("Annotation.create",h),o.$.find(".Ldt-CreateAnnotation-Description").val("")),A!==""){l.push(h),t.addList("annotation",l);var o=this;jQuery.ajax({url:A,type:this.api_method,contentType:"application/json",data:t.serialize(),success:function(j){o.showScreen("Saved"),o.after_send_timeout&&window.setTimeout(function(){o.close_after_send?o.player.trigger("CreateAnnotation.hide"):o.player.trigger("CreateAnnotation.show")},o.after_send_timeout),t.getAnnotations().removeElement(h,!0),t.deSerialize(j),o.source.merge(t),o.pause_on_write&&o.media.getPaused()&&o.media.play(),o.player.trigger("AnnotationsList.refresh")},error:function(j,B,F){n.log("Error when sending annotation",F),t.getAnnotations().removeElement(h,!0),o.showScreen("Error"),window.setTimeout(function(){o.showScreen("Main")},o.after_send_timeout||5e3)}}),this.showScreen("Wait")}return!1}},Or(e,"defaults",{show_title_field:!0,show_creator_field:!0,creator_field_readonly:!1,start_visible:!0,always_visible:!1,show_slice:!0,show_arrow:!0,show_time:!0,minimize_annotation_widget:!0,creator_name:"",creator_avatar:"",tags:!1,tag_titles:!1,pause_on_write:!0,max_tags:8,polemics:[{keyword:"++",background_color:"#00a000",text_color:"#ffffff"},{keyword:"--",background_color:"#c00000",text_color:"#ffffff"},{keyword:"??",background_color:"#0000e0",text_color:"#ffffff"},{keyword:"==",background_color:"#f0e000",text_color:"#000000"}],slice_annotation_type:"chap",annotation_type:"Contributions",post_at_segment_time:!1,segment_annotation_type:"chap",api_serializer:"ldt_annotate",api_endpoint_template:"",api_method:"POST",editable_storage:"",project_id:"",after_send_timeout:0,close_after_send:!1,tag_prefix:"#",pause_when_displaying:!1,custom_send_button:!1,custom_cancel_button:!1,custom_description_placeholder:!1,preview_mode:!1}),Or(e,"messages",{en:{from_time:"from",to_time:"to",at_time:"at",submit:"Submit",preview_submit:"You cannot submit annotations in preview mode",cancel:"Cancel",add_keywords_:"Add keywords:",add_polemic_keywords_:"Add polemic attributes :",your_name_:"Your name:",annotate_video:"New note",type_title:"Annotation title",type_description:"Enter a new note...",wait_while_processing:"Please wait while your annotation is being processed...",error_while_contacting:"An error happened while contacting the server. Your annotation has not been saved.",annotation_saved:"Thank you, your annotation has been saved.",share_annotation:"Would you like to share it on social networks ?",close_widget:"Hide the annotation form","polemic++":"Agree","polemic--":"Disagree","polemic??":"Question","polemic==":"Reference",in_tooltip:"Set begin time to current player time",out_tooltip:"Set begin time to current player time",play_tooltip:"Play the fragment"},fr:{from_time:"de",to_time:"à",at_time:"à",submit:"Envoyer",preview_submit:"Vous ne pouvez pas envoyer d'annotation en mode aperçu",cancel:"Annuler",add_keywords_:"Ajouter des mots-clés :",add_polemic_keywords_:"Ajouter des attributs polémiques :",your_name_:"Votre nom :",annotate_video:"Entrez une nouvelle note...",type_title:"Titre de l'annotation",type_description:"Prenez vos notes...",wait_while_processing:"Veuillez patienter pendant le traitement de votre annotation...",error_while_contacting:"Une erreur s'est produite en contactant le serveur. Votre annotation n'a pas été enregistrée.",annotation_saved:"Merci, votre annotation a été enregistrée.",share_annotation:"Souhaitez-vous la partager sur les réseaux sociaux ?",close_widget:"Cacher le formulaire de création d'annotations","polemic++":"Accord","polemic--":"Désaccord","polemic??":"Question","polemic==":"Référence",in_tooltip:"Utiliser le temps courant comme début",out_tooltip:"Utiliser le temps courant comme fin",play_tooltip:"Jouer le fragment"}}),Or(e,"template",'{{#show_slice}}
      {{/show_slice}}{{^show_slice}}{{#show_arrow}}
      {{/show_arrow}}{{/show_slice}}

      {{l10n.annotate_video}}{{#show_title_field}}

      {{/show_title_field}}{{#show_time}} {{#show_slice}}{{l10n.from_time}} {{/show_slice}}{{^show_slice}}{{l10n.at_time}} {{/show_slice}} 00:00{{/show_time}}{{#show_slice}} {{l10n.to_time}} {{end}}{{/show_slice}}{{#show_creator_field}}{{l10n.your_name_}} {{/show_creator_field}}

      {{#show_controls}}
      InOutPlay
      {{/show_controls}}{{#show_creator_field}}
      {{/show_creator_field}}
      {{#preview_mode}}{{/preview_mode}}{{^preview_mode}}{{/preview_mode}}
      00:00
      {{#tags.length}}
      {{l10n.add_keywords_}}
        {{#tags}}
      • {{title}}
      • {{/tags}}
      {{/tags.length}}{{#polemics.length}}
      {{l10n.add_polemic_keywords_}}
        {{#polemics}}
      • {{keyword}}
      • {{/polemics}}
      {{/polemics.length}}
      {{l10n.wait_while_processing}}
      {{^always_visible}}{{/always_visible}}
      {{l10n.error_while_contacting}}
      {{^always_visible}}{{/always_visible}}
      {{l10n.annotation_saved}}
      '),e},currentSegmentInfoboxStyles={},CurrentSegmentInfobox=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l)}draw(){var o=this;this.segments=this.getWidgetAnnotations(),this.renderTemplate(),this.currentSegment=!1,this.clearBox(),this.refresh(),this.onMediaEvent("timeupdate","refresh"),this.onMediaEvent("settimerange",function(l){var t=l[0],u=l[1],h=o.segments.filter(function(v){return v.begin.milliseconds==t.milliseconds&&v.end.milliseconds==u.milliseconds});h.length>0&&(o.$.toggleClass("editing",!1),o.currentSegment.id!=h[0].id&&(o.currentSegment=h[0],_data={editable_segments:o.editable_segments,edit:o.custom_edit_text?o.custom_edit_text:o.l10n.edit,title:o.currentSegment.title,description:o.currentSegment.description,description_placeholder:o.empty_description_placeholder,tags:o.currentSegment.getTagTexts()},o.$.html(mustache.render(o.template,_data)),o.editable_segments&&o.currentSegment&&o.$.find(".Ldt-CurrentSegmentInfobox").click(o.functionWrapper("enableEditMode"))))}),this.editable_segments&&this.currentSegment&&this.$.find(".Ldt-CurrentSegmentInfobox").click(o.functionWrapper("enableEditMode"))}enableEditMode(){this.currentSegment&&(_data={title:this.currentSegment.title,description:this.currentSegment.description,tags:this.currentSegment.getTagTexts(),submit:this.l10n.submit,cancel:this.l10n.cancel,headers:this.show_headers,tags_header:this.custom_tags_header?this.custom_tags_header:this.l10n.tags_header,fields_header:this.custom_fields_header?this.custom_fields_header:this.l10n.fields_header,new_tag:this.l10n.new_tag,delete_tag:this.l10n.delete_tag,new_tag_button:this.new_tag_button},this.$.toggleClass("editing",!0),this.$.html(mustache.render(this.editTemplate,_data)),this.$.find(".Ldt-CurrentSegmentInfobox-CancelButton").click(this.functionWrapper("disableEditMode")),this.new_tag_button?this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagButton").click(this.functionWrapper("insertTagInput")):(this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput").keypress(this.functionWrapper("insertTagInputKeypress")),this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput-Add").click(this.functionWrapper("insertTagInputKeypress"))),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput")),this.$.find(".Ldt-CurrentSegmentInfobox-SubmitButton").click(this.functionWrapper("onSubmit")))}disableEditMode(){this.currentSegment&&(_data={editable_segments:this.editable_segments,edit:this.custom_edit_text?this.custom_edit_text:this.l10n.edit,title:this.currentSegment.title,description:this.currentSegment.description,description_placeholder:this.empty_description_placeholder,tags:this.currentSegment.getTagTexts()},this.$.toggleClass("editing",!1),this.$.html(mustache.render(this.template,_data)),this.$.find(".Ldt-CurrentSegmentInfobox").click(this.functionWrapper("enableEditMode")))}insertTagInput(){!this.currentSegment.getTagTexts().length&&!this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").length&&this.$.find(".Ldt-CurrentSegmentInfobox-Tags").prepend('
        '),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").append('
      • '+this.l10n.delete_tag+"
      • "),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput"))}insertTagInputKeypress(o){var l=o.keyCode?o.keyCode:o.which;if(l=="13"||o.type=="click")return!this.currentSegment.getTagTexts().length&&!this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").length&&this.$.find(".Ldt-CurrentSegmentInfobox-Tags").prepend('
          '),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").append('
        • '+this.l10n.delete_tag+"
        • "),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput")),this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput").val(""),!1}deleteTagInput(o){jQuery(o.currentTarget).parent().remove()}onSubmit(){new_tags_titles=this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-Input").map(function(){if(jQuery(this).val())return jQuery(this).val()}),new_title=this.$.find(".Ldt-CurrentSegmentInfobox-TitleInput").val(),new_description=this.$.find(".Ldt-CurrentSegmentInfobox-DescriptionInput").val();var o=this,l=new n.Model.List(this.player.sourceManager),t=this.player.sourceManager.newLocalSource({serializer:n.serializers[this.api_serializer]}),u=new n.Model.Annotation(this.currentSegment.id,t);u.setAnnotationType(this.currentSegment.getAnnotationType().id),u.setMedia(this.currentSegment.getMedia().id),u.setBegin(this.currentSegment.begin),u.setEnd(this.currentSegment.end),u.created=this.currentSegment.created,u.creator=this.currentSegment.creator,u.title=new_title,u.description=new_description;var h=_$1(new_tags_titles).map(function(v){var w=o.source.getTags(!0).searchByTitle(v,!0);if(w.length)var A=w[0];else A=new n.Model.Tag(v.replace(/\W/g,"_"),o.source),A.title=v,o.source.getTags().push(A);return A.id}).value();u.setTags(h),u.project_id=this.project_id,l.push(u),t.addList("annotation",l),_url=mustache.render(this.api_endpoint_template,{annotation_id:this.currentSegment.id}),n.jQuery.ajax({url:_url,type:this.api_method,contentType:"application/json",data:t.serialize(),success:function(v){t.getAnnotations().removeElement(u,!0),t.deSerialize(v),o.source.merge(t),o.segments.forEach(function(w){w.id==u.id&&o.segments.removeElement(w)}),o.segments.push(u),o.currentSegment=u,v={editable_segments:o.editable_segments,edit:o.custom_edit_text?o.custom_edit_text:o.l10n.edit,title:o.currentSegment.title,description:o.currentSegment.description,description_placeholder:o.empty_description_placeholder,tags:o.currentSegment.getTagTexts()},o.$.html(mustache.render(o.template,v)),o.editable_segments&&o.currentSegment&&o.$.find(".Ldt-CurrentSegmentInfobox").click(o.functionWrapper("enableEditMode")),o.$.toggleClass("editing",!1)},error:function(v,w,A){n.log("Error when sending annotation",A),t.getAnnotations().removeElement(u,!0)}})}refresh(){if(!this.media.getTimeRange()){var o=this.media.getCurrentTime(),l=this.segments.filter(function(t){return t.begin<=o&&t.end>=o});l.length>0?this.currentSegment.id!=l[0].id&&(this.currentSegment=l[0],_data={editable_segments:this.editable_segments,edit:this.custom_edit_text?this.custom_edit_text:this.l10n.edit,title:this.currentSegment.title,description:this.currentSegment.description,description_placeholder:this.empty_description_placeholder,tags:this.currentSegment.getTagTexts()},this.$.html(mustache.render(this.template,_data)),this.editable_segments&&this.currentSegment&&this.$.find(".Ldt-CurrentSegmentInfobox").click(this.functionWrapper("enableEditMode"))):(this.currentSegment=!1,this.clearBox())}}clearBox(){var o=this.l10n.empty;this.empty_message&&(o=this.empty_message),this.$.find(".Ldt-CurrentSegmentInfobox").html("
          "+o+"
          ")}},Or(e,"defaults",{annotation_type:"chap",editable_segments:!1,empty_message:!1,project_id:!1,api_serializer:"ldt_annotate",api_method:"PUT",api_endpoint_template:"",new_tag_button:!0,show_headers:!1,custom_edit_text:!1,empty_description_placeholder:!1}),Or(e,"template",'
          {{#editable_segments}}
          {{edit}}
          {{/editable_segments}}
          {{title}}
          {{description}}
          {{^description}}{{^tags.length}}{{#description_placeholder}}
          {{description_placeholder}}
          {{/description_placeholder}}{{/tags.length}}{{/description}}
          {{#tags.length}}
            {{#tags}}{{#.}}
          • {{.}}
          • {{/.}}{{/tags}}
          {{/tags.length}}
          '),Or(e,"editTemplate",'
          {{#headers}}
          {{fields_header}}
          {{/headers}}
          {{#headers}}
          {{tags_header}}
          {{/headers}}{{#new_tag_button}}
          {{new_tag}}
          {{/new_tag_button}}{{^new_tag_button}}
          +
          {{/new_tag_button}}
            {{#tags}}{{#.}}
          • {{delete_tag}}
          • {{/.}}{{/tags}}
          {{submit}}
          {{cancel}}
          '),Or(e,"messages",{fr:{submit:"Soumettre",cancel:"Annuler",edit:"Editer",new_tag:"Nouveau tag",delete_tag:"Supprimer",fields_header:"Commentaire associé à ce segment",tags_header:"Mots-clés associés à ce segment",empty:"Le player vidéo ne lit actuellement aucun segment"},en:{submit:"Submit",cancel:"Cancel",edit:"Edit",new_tag:"New tag",delete_tag:"Delete tag",fields_header:"Current segment content",tags_header:"Current segment tags",empty:"The player currently doesn't read any segment"}}),e},DailymotionPlayer=function(n){var e;return e=class extends n.Widgets.Widget{constructor(l,t){super(l,t);Or(this,"draw",function(){typeof this.video>"u"&&(this.video=this.media.video),this.height=this.height||Math.floor(this.width/this.aspect_ratio);var l=this.media,t=null,u=this,h={pause:!0,apiready:!1,volume:0,time:0,duration:0},v=this.video.match(/www.dailymotion.com\/video\/(.+)/);v&&(t=v[1]);var w=mustache.render("{{ protocol }}//www.dailymotion.com/embed/video/{{ videoid }}",{protocol:document.location.protocol.search("http")==0?document.location.protocol:"http:",videoid:t}),A={api:"postMessage",chromeless:1,id:"dm_player",related:0,autoplay:1};u.$.html(mustache.render('',{player_url:w,params:Object.keys(A).reduce(function(C,M){return C.push(M+"="+encodeURIComponent(A[M])),C},[]).join("&"),width:this.width,height:this.height,id:A.id}));function E(){var C=u.$.find("#"+A.id)[0].contentWindow,M=function(P,I){I!==void 0&&(P=P+"="+I),C.postMessage(P,"*")};l.getCurrentTime=function(){return h.time},l.getVolume=function(){return h.volume},l.getPaused=function(){return h.pause},l.getMuted=function(){return h.muted},l.setCurrentTime=function(P){M("seek",P/1e3)},l.setVolume=function(P){M("volume",P*100)},l.mute=function(){M("muted",1)},l.unmute=function(){M("muted",0)},l.play=function(){M("play")},l.pause=function(){M("pause")}}window.addEventListener("message",function(C){if(C.data.split!==void 0){var M=C.data.split("&").map(function(P){return P.split("=")}).reduce(function(P,I){return P[I[0]]=decodeURIComponent(I[1]),P},{});switch(M.event){case"apiready":h.apiready=!0,E();break;case"durationchange":M.duration.slice(-2)=="sc"&&(h.duration=1e3*Number(M.duration.slice(0,-2)),l.setDuration(h.duration));break;case"ended":h.pause=!0;break;case"loadedmetadata":l.trigger("loadedmetadata");break;case"pause":h.pause=!0,l.trigger("pause");break;case"play":h.pause=!1,l.trigger("play");break;case"seeked":h.time=new n.Model.Time(1e3*Number(M.time)),l.trigger("seeked");break;case"timeupdate":h.time=new n.Model.Time(1e3*Number(M.time)),l.trigger("timeupdate",h.time);break;case"volumechange":h.muted=M.muted=="true",h.volume=Number(M.volume)/100;break}}},!1)})}},Or(e,"defaults",{aspect_ratio:14/9}),e},enrichedPlanStyles={},EnrichedPlan=function(n){var e;return e=class extends n.Widgets.Widget{constructor(l,t){super(l,t);Or(this,"annotationTemplate",'
          {{{ text }}} {{ author }}
          ')}draw(){var l=this;l.prefix="TODO";var t=this.getWidgetAnnotations().sortBy(function(A){return A.begin}),u=this.media.getAnnotations().filter(function(A){return A.getAnnotationType().title!=l.annotation_type}).sortBy(function(A){return A.begin});t.forEach(function(A){A.annotations=u.filter(function(E){return E.begin>=A.begin&&E.begin<=A.end})}),l.renderTemplate();var h=l.$.find(".Ldt-EnrichedPlan-Container"),v=l.$.find(".Ldt-EnrichedPlan-Content");function w(A){return A.title.indexOf("Anonyme")<0?"Own":"Other"}t.forEach(function(A){var E=mustache.render(l.slideTemplate,{id:A.id,atitle:n.textFieldHtml(A.title),level:A.content.level||1,begin:A.begin.toString(),begintc:A.begin.milliseconds,thumbnail:A.thumbnail,show_slides:l.show_slides,notes:A.annotations.map(function(M){return mustache.render(l.annotationTemplate,{id:M.id,text:n.textFieldHtml(M.description||M.title),author:M.creator,begin:M.begin.toString(),begintc:M.begin.milliseconds,atitle:M.title.slice(0,20),category:"Ldt-EnrichedPlan-Note-"+w(M),filtered:w(M)=="Own"&&!l.show_own_notes||w(M)=="Other"&&!l.show_other_notes||w(M)=="Teacher"&&!l.show_teacher_notes?"filtered_out":""})}).join(` `)}),C=n.jQuery(E);v.append(C)}),h.on("click","[data-timecode]",function(){l.media.setCurrentTime(Number(this.dataset.timecode))}),h.on("click",".Ldt-EnrichedPlan-Control-Checkbox",function(){var A=_.first(_.filter(this.classList,function(E){return E!="Ldt-EnrichedPlan-Control-Checkbox"}));A!==void 0&&(jQuery(this).is(":checked")?v.find(".Ldt-EnrichedPlan-Slide ."+A).removeClass("filtered_out"):v.find(".Ldt-EnrichedPlan-Slide ."+A).addClass("filtered_out"))}),h.find(".Ldt-EnrichedPlan-Search-Input").on("search",function(){var A=jQuery(this).val().toLocaleLowerCase();A===""?v.find(".Ldt-EnrichedPlan-Note").removeClass("non_matching"):jQuery(".Ldt-EnrichedPlan-Note").each(function(){var E=jQuery(this);E.text().toLocaleLowerCase().indexOf(A)>-1?E.removeClass("non_matching"):E.addClass("non_matching")})})}},Or(e,"defaults",{annotation_type:"Slides",annotation_types:[],show_controls:!0,show_slides:!0,show_teacher_notes:!0,show_other_notes:!0,show_own_notes:!0}),Or(e,"template",'
          {{#show_controls}}
          {{/show_controls}}
          '),Or(e,"slideTemplate",'
          {{ begin }}
          {{ atitle }}
          {{{ notes }}}
          '),e},highlighterStyles={},Highlighter=function(n){var e;return e=class extends n.Widgets.Widget{constructor(o,l){super(o,l);var t=this;this.throttledRefresh=_$1.throttle(function(){t.update()},800)}update(){var o=this,l=o.media.getCurrentTime();return o.$.find(".Ldt-Highlighter-Annotation",document).toggleClass("currentAnnotation",function(){return this.dataset.media===o.media.id&&this.dataset.begin<=l&&l=o.duration&&(o.paused||(o.paused=!0,o.trigger("pause")),A=0);var P=o.getAnnotationAtTime(A);if(typeof P>"u"){o.currentMedia&&(o.currentMedia.pause(),o.paused||(o.paused=!0,o.trigger("pause")));return}o.currentAnnotation=P,v=o.currentAnnotation.annotation.begin.milliseconds,w=o.currentAnnotation.annotation.end.milliseconds,E=v-o.currentAnnotation.begin.milliseconds,o.currentMedia=o.currentAnnotation.getMedia(),o.getMedias().forEach(function(I){I!==o.currentMedia?(I.hide(),I.pause()):I.show()}),o.currentMedia.setCurrentTime(A+E),o.currentMedia.seeking=!0,o.paused||(o.currentMedia.play(),o.seeking=!0),o.trigger("timeupdate",new n.Model.Time(A))}o.getMedias().forEach(M),C(),o.trigger("loadedmetadata");function M(P){if(!P.has_player){P.has_player=!0;var I=P.video;typeof h=="function"&&(I=h(P.video));var j="video_"+P.id,B;P.show=function(){if(document.getElementById(j))return;P.loaded=!1,P.paused=!0;var ee=jQuery("