jclic 2.1.26 → 2.2.1
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/CHANGELOG.md +13 -0
- package/dist/jclic-node.js +33 -33
- package/dist/jclic-node.js.map +1 -1
- package/dist/jclic.components.LICENSE +3 -65
- package/dist/jclic.min.js +3 -3
- package/dist/jclic.min.js.map +1 -1
- package/package.json +11 -11
- package/src/AWT.js +1 -1
- package/src/GlobalData.js +1 -1
- package/src/JClic.js +3 -0
- package/src/activities/associations/ComplexAssociation.js +2 -2
- package/src/activities/associations/SimpleAssociation.js +2 -2
- package/src/activities/puzzles/DoublePuzzle.js +2 -2
- package/src/activities/text/FillInBlanks.js +8 -8
- package/src/activities/text/IdentifyText.js +2 -2
- package/src/activities/text/OrderText.js +1 -1
- package/src/activities/text/TextActivityBase.js +3 -3
- package/src/activities/text/TextActivityDocument.js +3 -1
- package/src/activities/text/WrittenAnswer.js +2 -2
- package/src/activities/textGrid/CrossWord.js +2 -2
- package/src/boxes/ActiveBox.js +2 -2
- package/src/skins/Skin.js +2 -4
package/dist/jclic.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
JClic.js version 2.1
|
|
2
|
+
JClic.js version 2.2.1 (2026-02-14)
|
|
3
3
|
HTML5 player for JClic activities
|
|
4
4
|
https://projectestac.github.io/jclic.js
|
|
5
5
|
|
|
6
|
-
(c) 2000-
|
|
6
|
+
(c) 2000-2026 Catalan Educational Telematic Network (XTEC)
|
|
7
7
|
|
|
8
8
|
Licensed under the EUPL, Version 1.2 or -as soon they will be approved by
|
|
9
9
|
the European Commission- subsequent versions of the EUPL (the "Licence");
|
|
@@ -23,5 +23,5 @@ For full license information of included components please see: jclic.components
|
|
|
23
23
|
WARNING: This is a compressed version of JClic.js. Full source code is freely available at:
|
|
24
24
|
https://projectestac.github.io/jclic.js
|
|
25
25
|
*/
|
|
26
|
-
(()=>{var t={9:t=>{"use strict";var e={};function i(){try{return new window.XMLHttpRequest}catch(t){}}e._getBinaryFromXHR=function(t){return t.response||t.responseText};var s="undefined"!=typeof window&&window.ActiveXObject?function(){return i()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:i;e.getBinaryContent=function(t,i){var n,r,a,o;i||(i={}),"function"==typeof i?(o=i,i={}):"function"==typeof i.callback&&(o=i.callback),o||"undefined"==typeof Promise?(r=function(t){o(null,t)},a=function(t){o(t,null)}):n=new Promise((function(t,e){r=t,a=e}));try{var c=s();c.open("GET",t,!0),"responseType"in c&&(c.responseType="arraybuffer"),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),c.onreadystatechange=function(i){if(4===c.readyState)if(200===c.status||0===c.status)try{r(e._getBinaryFromXHR(c))}catch(t){a(new Error(t))}else a(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},i.progress&&(c.onprogress=function(e){i.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),c.send()}catch(t){a(new Error(t),null)}return n},t.exports=e},371:(t,e,i)=>{var s;!function(){function n(t,e,i){return t.call.apply(t.bind,arguments)}function r(t,e,i){if(!t)throw Error();if(2<arguments.length){var s=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,s),t.apply(e,i)}}return function(){return t.apply(e,arguments)}}function a(t,e,i){return(a=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?n:r).apply(null,arguments)}var o=Date.now||function(){return+new Date};function c(t,e){this.a=t,this.o=e||t,this.c=this.o.document}var l=!!window.FontFace;function h(t,e,i,s){if(e=t.c.createElement(e),i)for(var n in i)i.hasOwnProperty(n)&&("style"==n?e.style.cssText=i[n]:e.setAttribute(n,i[n]));return s&&e.appendChild(t.c.createTextNode(s)),e}function u(t,e,i){(t=t.c.getElementsByTagName(e)[0])||(t=document.documentElement),t.insertBefore(i,t.lastChild)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t,e,i){e=e||[],i=i||[];for(var s=t.className.split(/\s+/),n=0;n<e.length;n+=1){for(var r=!1,a=0;a<s.length;a+=1)if(e[n]===s[a]){r=!0;break}r||s.push(e[n])}for(e=[],n=0;n<s.length;n+=1){for(r=!1,a=0;a<i.length;a+=1)if(s[n]===i[a]){r=!0;break}r||e.push(s[n])}t.className=e.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function f(t,e){for(var i=t.className.split(/\s+/),s=0,n=i.length;s<n;s++)if(i[s]==e)return!0;return!1}function g(t,e,i){function s(){o&&n&&r&&(o(a),o=null)}e=h(t,"link",{rel:"stylesheet",href:e,media:"all"});var n=!1,r=!0,a=null,o=i||null;l?(e.onload=function(){n=!0,s()},e.onerror=function(){n=!0,a=Error("Stylesheet failed to load"),s()}):setTimeout((function(){n=!0,s()}),0),u(t,"head",e)}function m(t,e,i,s){var n=t.c.getElementsByTagName("head")[0];if(n){var r=h(t,"script",{src:e}),a=!1;return r.onload=r.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,i&&i(null),r.onload=r.onreadystatechange=null,"HEAD"==r.parentNode.tagName&&n.removeChild(r))},n.appendChild(r),setTimeout((function(){a||(a=!0,i&&i(Error("Script load timeout")))}),s||5e3),r}return null}function v(){this.a=0,this.c=null}function b(t){return t.a++,function(){t.a--,w(t)}}function y(t,e){t.c=e,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function A(t){this.a=t||"-"}function C(t,e){this.c=t,this.f=4,this.a="n";var i=(e||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function x(t){var e=[];t=t.split(/,\s*/);for(var i=0;i<t.length;i++){var s=t[i].replace(/['"]/g,"");-1!=s.indexOf(" ")||/^\d/.test(s)?e.push("'"+s+"'"):e.push(s)}return e.join(",")}function k(t){return t.a+t.f}function S(t){var e="normal";return"o"===t.a?e="oblique":"i"===t.a&&(e="italic"),e}function T(t){var e=4,i="n",s=null;return t&&((s=t.match(/(normal|oblique|italic)/i))&&s[1]&&(i=s[1].substr(0,1).toLowerCase()),(s=t.match(/([1-9]00|normal|bold)/i))&&s[1]&&(/bold/i.test(s[1])?e=7:/[1-9]00/.test(s[1])&&(e=parseInt(s[1].substr(0,1),10)))),i+e}function E(t,e){this.c=t,this.f=t.o.document.documentElement,this.h=e,this.a=new A("-"),this.j=!1!==e.events,this.g=!1!==e.classes}function P(t){if(t.g){var e=f(t.f,t.a.c("wf","active")),i=[],s=[t.a.c("wf","loading")];e||i.push(t.a.c("wf","inactive")),p(t.f,i,s)}I(t,"inactive")}function I(t,e,i){t.j&&t.h[e]&&(i?t.h[e](i.c,k(i)):t.h[e]())}function B(){this.c={}}function _(t,e){this.c=t,this.f=e,this.a=h(this.c,"span",{"aria-hidden":"true"},this.f)}function O(t){u(t.c,"body",t.a)}function R(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+x(t.c)+";font-style:"+S(t)+";font-weight:"+t.f+"00;"}function D(t,e,i,s,n,r){this.g=t,this.j=e,this.a=s,this.c=i,this.f=n||3e3,this.h=r||void 0}function M(t,e,i,s,n,r,a){this.v=t,this.B=e,this.c=i,this.a=s,this.s=a||"BESbswy",this.f={},this.w=n||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new _(this.c,this.s),this.h=new _(this.c,this.s),this.j=new _(this.c,this.s),this.m=new _(this.c,this.s),t=R(t=new C(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=t,t=R(t=new C(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=t,t=R(t=new C("serif",k(this.a))),this.j.a.style.cssText=t,t=R(t=new C("sans-serif",k(this.a))),this.m.a.style.cssText=t,O(this.g),O(this.h),O(this.j),O(this.m)}A.prototype.c=function(t){for(var e=[],i=0;i<arguments.length;i++)e.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return e.join(this.a)},D.prototype.start=function(){var t=this.c.o.document,e=this,i=o(),s=new Promise((function(s,n){!function r(){o()-i>=e.f?n():t.fonts.load(function(t){return S(t)+" "+t.f+"00 300px "+x(t.c)}(e.a),e.h).then((function(t){1<=t.length?s():setTimeout(r,25)}),(function(){n()}))}()})),n=null,r=new Promise((function(t,i){n=setTimeout(i,e.f)}));Promise.race([r,s]).then((function(){n&&(clearTimeout(n),n=null),e.g(e.a)}),(function(){e.j(e.a)}))};var N={D:"serif",C:"sans-serif"},V=null;function j(){if(null===V){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);V=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return V}function q(t,e,i){for(var s in N)if(N.hasOwnProperty(s)&&e===t.f[N[s]]&&i===t.f[N[s]])return!0;return!1}function L(t){var e,i=t.g.a.offsetWidth,s=t.h.a.offsetWidth;(e=i===t.f.serif&&s===t.f["sans-serif"])||(e=j()&&q(t,i,s)),e?o()-t.A>=t.w?j()&&q(t,i,s)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?F(t,t.v):F(t,t.B):function(t){setTimeout(a((function(){L(this)}),t),50)}(t):F(t,t.v)}function F(t,e){setTimeout(a((function(){d(this.g.a),d(this.h.a),d(this.j.a),d(this.m.a),e(this.a)}),t),0)}function z(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}M.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),L(this)};var U=null;function H(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&p(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),I(t,"active")):P(t.a))}function $(t){this.j=t,this.a=new B,this.h=0,this.f=this.g=!0}function W(t,e,i,s,n){var r=0==--t.h;(t.f||t.g)&&setTimeout((function(){var t=n||null,o=s||{};if(0===i.length&&r)P(e.a);else{e.f+=i.length,r&&(e.j=r);var c,l=[];for(c=0;c<i.length;c++){var h=i[c],u=o[h.c],d=e.a,f=h;if(d.g&&p(d.f,[d.a.c("wf",f.c,k(f).toString(),"loading")]),I(d,"fontloading",f),d=null,null===U)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var g=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);U=f?42<parseInt(f[1],10):!g}else U=!1;d=U?new D(a(e.g,e),a(e.h,e),e.c,h,e.s,u):new M(a(e.g,e),a(e.h,e),e.c,h,e.s,t,u),l.push(d)}for(c=0;c<l.length;c++)l[c].start()}}),0)}function J(t,e){this.c=t,this.a=e}function G(t,e){this.c=t,this.a=e}function K(t,e){this.c=t||Z,this.a=[],this.f=[],this.g=e||""}z.prototype.g=function(t){var e=this.a;e.g&&p(e.f,[e.a.c("wf",t.c,k(t).toString(),"active")],[e.a.c("wf",t.c,k(t).toString(),"loading"),e.a.c("wf",t.c,k(t).toString(),"inactive")]),I(e,"fontactive",t),this.m=!0,H(this)},z.prototype.h=function(t){var e=this.a;if(e.g){var i=f(e.f,e.a.c("wf",t.c,k(t).toString(),"active")),s=[],n=[e.a.c("wf",t.c,k(t).toString(),"loading")];i||s.push(e.a.c("wf",t.c,k(t).toString(),"inactive")),p(e.f,s,n)}I(e,"fontinactive",t),H(this)},$.prototype.load=function(t){this.c=new c(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,e,i){var s=[],n=i.timeout;!function(t){t.g&&p(t.f,[t.a.c("wf","loading")]),I(t,"loading")}(e);s=function(t,e,i){var s,n=[];for(s in e)if(e.hasOwnProperty(s)){var r=t.c[s];r&&n.push(r(e[s],i))}return n}(t.a,i,t.c);var r=new z(t.c,e,n);for(t.h=s.length,e=0,i=s.length;e<i;e++)s[e].load((function(e,i,s){W(t,r,e,i,s)}))}(this,new E(this.c,t),t)},J.prototype.load=function(t){function e(){if(r["__mti_fntLst"+s]){var i,n=r["__mti_fntLst"+s](),a=[];if(n)for(var o=0;o<n.length;o++){var c=n[o].fontfamily;null!=n[o].fontStyle&&null!=n[o].fontWeight?(i=n[o].fontStyle+n[o].fontWeight,a.push(new C(c,i))):a.push(new C(c))}t(a)}else setTimeout((function(){e()}),50)}var i=this,s=i.a.projectId,n=i.a.version;if(s){var r=i.c.o;m(this.c,(i.a.api||"https://fast.fonts.net/jsapi")+"/"+s+".js"+(n?"?v="+n:""),(function(n){n?t([]):(r["__MonotypeConfiguration__"+s]=function(){return i.a},e())})).id="__MonotypeAPIScript__"+s}else t([])},G.prototype.load=function(t){var e,i,s=this.a.urls||[],n=this.a.families||[],r=this.a.testStrings||{},a=new v;for(e=0,i=s.length;e<i;e++)g(this.c,s[e],b(a));var o=[];for(e=0,i=n.length;e<i;e++)if((s=n[e].split(":"))[1])for(var c=s[1].split(","),l=0;l<c.length;l+=1)o.push(new C(s[0],c[l]));else o.push(new C(s[0]));y(a,(function(){t(o,r)}))};var Z="https://fonts.googleapis.com/css";function Y(t){this.f=t,this.a=[],this.c={}}var Q={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},X={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},tt={i:"i",italic:"i",n:"n",normal:"n"},et=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function it(t,e){this.c=t,this.a=e}var st={Arimo:!0,Cousine:!0,Tinos:!0};function nt(t,e){this.c=t,this.a=e}function rt(t,e){this.c=t,this.f=e,this.a=[]}it.prototype.load=function(t){var e=new v,i=this.c,s=new K(this.a.api,this.a.text),n=this.a.families;!function(t,e){for(var i=e.length,s=0;s<i;s++){var n=e[s].split(":");3==n.length&&t.f.push(n.pop());var r="";2==n.length&&""!=n[1]&&(r=":"),t.a.push(n.join(r))}}(s,n);var r=new Y(n);!function(t){for(var e=t.f.length,i=0;i<e;i++){var s=t.f[i].split(":"),n=s[0].replace(/\+/g," "),r=["n4"];if(2<=s.length){var a;if(a=[],o=s[1])for(var o,c=(o=o.split(",")).length,l=0;l<c;l++){var h;if((h=o[l]).match(/^[\w-]+$/))if(null==(u=et.exec(h.toLowerCase())))h="";else{if(h=null==(h=u[2])||""==h?"n":tt[h],null==(u=u[1])||""==u)u="4";else var u=X[u]||(isNaN(u)?"4":u.substr(0,1));h=[h,u].join("")}else h="";h&&a.push(h)}0<a.length&&(r=a),3==s.length&&(a=[],0<(s=(s=s[2])?s.split(","):a).length&&(s=Q[s[0]])&&(t.c[n]=s))}for(t.c[n]||(s=Q[n])&&(t.c[n]=s),s=0;s<r.length;s+=1)t.a.push(new C(n,r[s]))}}(r),g(i,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var e=t.a.length,i=[],s=0;s<e;s++)i.push(t.a[s].replace(/ /g,"+"));return e=t.c+"?family="+i.join("%7C"),0<t.f.length&&(e+="&subset="+t.f.join(",")),0<t.g.length&&(e+="&text="+encodeURIComponent(t.g)),e}(s),b(e)),y(e,(function(){t(r.a,r.c,st)}))},nt.prototype.load=function(t){var e=this.a.id,i=this.c.o;e?m(this.c,(this.a.api||"https://use.typekit.net")+"/"+e+".js",(function(e){if(e)t([]);else if(i.Typekit&&i.Typekit.config&&i.Typekit.config.fn){e=i.Typekit.config.fn;for(var s=[],n=0;n<e.length;n+=2)for(var r=e[n],a=e[n+1],o=0;o<a.length;o++)s.push(new C(r,a[o]));try{i.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}t(s)}}),2e3):t([])},rt.prototype.load=function(t){var e=this.f.id,i=this.c.o,s=this;e?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[e]=function(e,i){for(var n=0,r=i.fonts.length;n<r;++n){var a=i.fonts[n];s.a.push(new C(a.name,T("font-weight:"+a.weight+";font-style:"+a.style)))}t(s.a)},m(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+e+".js",(function(e){e&&t([])}))):t([])};var at=new $(window);at.a.c.custom=function(t,e){return new G(e,t)},at.a.c.fontdeck=function(t,e){return new rt(e,t)},at.a.c.monotype=function(t,e){return new J(e,t)},at.a.c.typekit=function(t,e){return new nt(e,t)},at.a.c.google=function(t,e){return new it(e,t)};var ot={load:a(at.load,at)};void 0===(s=function(){return ot}.call(e,i,e,t))||(t.exports=s)}()},692:function(t,e){var i;!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,(function(s,n){"use strict";var r=[],a=Object.getPrototypeOf,o=r.slice,c=r.flat?function(t){return r.flat.call(t)}:function(t){return r.concat.apply([],t)},l=r.push,h=r.indexOf,u={},d=u.toString,p=u.hasOwnProperty,f=p.toString,g=f.call(Object),m={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=s.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function A(t,e,i){var s,n,r=(i=i||y).createElement("script");if(r.text=t,e)for(s in w)(n=e[s]||e.getAttribute&&e.getAttribute(s))&&r.setAttribute(s,n);i.head.appendChild(r).parentNode.removeChild(r)}function C(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[d.call(t)]||"object":typeof t}var x="3.7.1",k=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function T(t){var e=!!t&&"length"in t&&t.length,i=C(t);return!v(t)&&!b(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:x,constructor:S,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:r.sort,splice:r.splice},S.extend=S.fn.extend=function(){var t,e,i,s,n,r,a=arguments[0]||{},o=1,c=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[o]||{},o++),"object"==typeof a||v(a)||(a={}),o===c&&(a=this,o--);o<c;o++)if(null!=(t=arguments[o]))for(e in t)s=t[e],"__proto__"!==e&&a!==s&&(l&&s&&(S.isPlainObject(s)||(n=Array.isArray(s)))?(i=a[e],r=n&&!Array.isArray(i)?[]:n||S.isPlainObject(i)?i:{},n=!1,a[e]=S.extend(l,r,s)):void 0!==s&&(a[e]=s));return a},S.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==d.call(t))&&(!(e=a(t))||"function"==typeof(i=p.call(e,"constructor")&&e.constructor)&&f.call(i)===g)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){A(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,s=0;if(T(t))for(i=t.length;s<i&&!1!==e.call(t[s],s,t[s]);s++);else for(s in t)if(!1===e.call(t[s],s,t[s]))break;return t},text:function(t){var e,i="",s=0,n=t.nodeType;if(!n)for(;e=t[s++];)i+=S.text(e);return 1===n||11===n?t.textContent:9===n?t.documentElement.textContent:3===n||4===n?t.nodeValue:i},makeArray:function(t,e){var i=e||[];return null!=t&&(T(Object(t))?S.merge(i,"string"==typeof t?[t]:t):l.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:h.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!k.test(e||i&&i.nodeName||"HTML")},merge:function(t,e){for(var i=+e.length,s=0,n=t.length;s<i;s++)t[n++]=e[s];return t.length=n,t},grep:function(t,e,i){for(var s=[],n=0,r=t.length,a=!i;n<r;n++)!e(t[n],n)!==a&&s.push(t[n]);return s},map:function(t,e,i){var s,n,r=0,a=[];if(T(t))for(s=t.length;r<s;r++)null!=(n=e(t[r],r,i))&&a.push(n);else for(r in t)null!=(n=e(t[r],r,i))&&a.push(n);return c(a)},guid:1,support:m}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=r[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){u["[object "+e+"]"]=e.toLowerCase()}));var P=r.pop,I=r.sort,B=r.splice,_="[\\x20\\t\\r\\n\\f]",O=new RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g");S.contains=function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))};var R=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function D(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}S.escapeSelector=function(t){return(t+"").replace(R,D)};var M=y,N=l;!function(){var t,e,i,n,a,c,l,u,d,f,g=N,v=S.expando,b=0,y=0,w=tt(),A=tt(),C=tt(),x=tt(),k=function(t,e){return t===e&&(a=!0),0},T="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="(?:\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",D="\\["+_+"*("+R+")(?:"+_+"*([*^$|!~]?=)"+_+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+_+"*\\]",V=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+D+")*)|.*)\\)|)",j=new RegExp(_+"+","g"),q=new RegExp("^"+_+"*,"+_+"*"),L=new RegExp("^"+_+"*([>+~]|"+_+")"+_+"*"),F=new RegExp(_+"|>"),z=new RegExp(V),U=new RegExp("^"+R+"$"),H={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+D),PSEUDO:new RegExp("^"+V),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),bool:new RegExp("^(?:"+T+")$","i"),needsContext:new RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},$=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/[+~]/,K=new RegExp("\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\([^\\r\\n\\f])","g"),Z=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},Y=function(){ct()},Q=dt((function(t){return!0===t.disabled&&E(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(r=o.call(M.childNodes),M.childNodes),r[M.childNodes.length].nodeType}catch(t){g={apply:function(t,e){N.apply(t,o.call(e))},call:function(t){N.apply(t,o.call(arguments,1))}}}function X(t,e,i,s){var n,r,a,o,l,h,p,f=e&&e.ownerDocument,b=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return i;if(!s&&(ct(e),e=e||c,u)){if(11!==b&&(l=J.exec(t)))if(n=l[1]){if(9===b){if(!(a=e.getElementById(n)))return i;if(a.id===n)return g.call(i,a),i}else if(f&&(a=f.getElementById(n))&&X.contains(e,a)&&a.id===n)return g.call(i,a),i}else{if(l[2])return g.apply(i,e.getElementsByTagName(t)),i;if((n=l[3])&&e.getElementsByClassName)return g.apply(i,e.getElementsByClassName(n)),i}if(!(x[t+" "]||d&&d.test(t))){if(p=t,f=e,1===b&&(F.test(t)||L.test(t))){for((f=G.test(t)&&ot(e.parentNode)||e)==e&&m.scope||((o=e.getAttribute("id"))?o=S.escapeSelector(o):e.setAttribute("id",o=v)),r=(h=ht(t)).length;r--;)h[r]=(o?"#"+o:":scope")+" "+ut(h[r]);p=h.join(",")}try{return g.apply(i,f.querySelectorAll(p)),i}catch(e){x(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(O,"$1"),e,i,s)}function tt(){var t=[];return function i(s,n){return t.push(s+" ")>e.cacheLength&&delete i[t.shift()],i[s+" "]=n}}function et(t){return t[v]=!0,t}function it(t){var e=c.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function st(t){return function(e){return E(e,"input")&&e.type===t}}function nt(t){return function(e){return(E(e,"input")||E(e,"button"))&&e.type===t}}function rt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Q(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(i,s){for(var n,r=t([],i.length,e),a=r.length;a--;)i[n=r[a]]&&(i[n]=!(s[n]=i[n]))}))}))}function ot(t){return t&&void 0!==t.getElementsByTagName&&t}function ct(t){var i,s=t?t.ownerDocument||t:M;return s!=c&&9===s.nodeType&&s.documentElement?(l=(c=s).documentElement,u=!S.isXMLDoc(c),f=l.matches||l.webkitMatchesSelector||l.msMatchesSelector,l.msMatchesSelector&&M!=c&&(i=c.defaultView)&&i.top!==i&&i.addEventListener("unload",Y),m.getById=it((function(t){return l.appendChild(t).id=S.expando,!c.getElementsByName||!c.getElementsByName(S.expando).length})),m.disconnectedMatch=it((function(t){return f.call(t,"*")})),m.scope=it((function(){return c.querySelectorAll(":scope")})),m.cssHas=it((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),m.getById?(e.filter.ID=function(t){var e=t.replace(K,Z);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i=e.getElementById(t);return i?[i]:[]}}):(e.filter.ID=function(t){var e=t.replace(K,Z);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i,s,n,r=e.getElementById(t);if(r){if((i=r.getAttributeNode("id"))&&i.value===t)return[r];for(n=e.getElementsByName(t),s=0;r=n[s++];)if((i=r.getAttributeNode("id"))&&i.value===t)return[r]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&u)return e.getElementsByClassName(t)},d=[],it((function(t){var e;l.appendChild(t).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+_+"*(?:value|"+T+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=c.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),l.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=c.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+_+"*name"+_+"*="+_+"*(?:''|\"\")")})),m.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),k=function(t,e){if(t===e)return a=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!m.sortDetached&&e.compareDocumentPosition(t)===i?t===c||t.ownerDocument==M&&X.contains(M,t)?-1:e===c||e.ownerDocument==M&&X.contains(M,e)?1:n?h.call(n,t)-h.call(n,e):0:4&i?-1:1)},c):c}for(t in X.matches=function(t,e){return X(t,null,null,e)},X.matchesSelector=function(t,e){if(ct(t),u&&!x[e+" "]&&(!d||!d.test(e)))try{var i=f.call(t,e);if(i||m.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){x(e,!0)}return X(e,c,null,[t]).length>0},X.contains=function(t,e){return(t.ownerDocument||t)!=c&&ct(t),S.contains(t,e)},X.attr=function(t,i){(t.ownerDocument||t)!=c&&ct(t);var s=e.attrHandle[i.toLowerCase()],n=s&&p.call(e.attrHandle,i.toLowerCase())?s(t,i,!u):void 0;return void 0!==n?n:t.getAttribute(i)},X.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,i=[],s=0,r=0;if(a=!m.sortStable,n=!m.sortStable&&o.call(t,0),I.call(t,k),a){for(;e=t[r++];)e===t[r]&&(s=i.push(r));for(;s--;)B.call(t,i[s],1)}return n=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(o.apply(this)))},e=S.expr={cacheLength:50,createPseudo:et,match:H,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(K,Z),t[3]=(t[3]||t[4]||t[5]||"").replace(K,Z),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||X.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&X.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return H.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&z.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(K,Z).toLowerCase();return"*"===t?function(){return!0}:function(t){return E(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+_+")"+t+"("+_+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(s){var n=X.attr(s,t);return null==n?"!="===e:!e||(n+="","="===e?n===i:"!="===e?n!==i:"^="===e?i&&0===n.indexOf(i):"*="===e?i&&n.indexOf(i)>-1:"$="===e?i&&n.slice(-i.length)===i:"~="===e?(" "+n.replace(j," ")+" ").indexOf(i)>-1:"|="===e&&(n===i||n.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,s,n){var r="nth"!==t.slice(0,3),a="last"!==t.slice(-4),o="of-type"===e;return 1===s&&0===n?function(t){return!!t.parentNode}:function(e,i,c){var l,h,u,d,p,f=r!==a?"nextSibling":"previousSibling",g=e.parentNode,m=o&&e.nodeName.toLowerCase(),y=!c&&!o,w=!1;if(g){if(r){for(;f;){for(u=e;u=u[f];)if(o?E(u,m):1===u.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(w=(d=(l=(h=g[v]||(g[v]={}))[t]||[])[0]===b&&l[1])&&l[2],u=d&&g.childNodes[d];u=++d&&u&&u[f]||(w=d=0)||p.pop();)if(1===u.nodeType&&++w&&u===e){h[t]=[b,d,w];break}}else if(y&&(w=d=(l=(h=e[v]||(e[v]={}))[t]||[])[0]===b&&l[1]),!1===w)for(;(u=++d&&u&&u[f]||(w=d=0)||p.pop())&&(!(o?E(u,m):1===u.nodeType)||!++w||(y&&((h=u[v]||(u[v]={}))[t]=[b,w]),u!==e)););return(w-=n)===s||w%s==0&&w/s>=0}}},PSEUDO:function(t,i){var s,n=e.pseudos[t]||e.setFilters[t.toLowerCase()]||X.error("unsupported pseudo: "+t);return n[v]?n(i):n.length>1?(s=[t,t,"",i],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var s,r=n(t,i),a=r.length;a--;)t[s=h.call(t,r[a])]=!(e[s]=r[a])})):function(t){return n(t,0,s)}):n}},pseudos:{not:et((function(t){var e=[],i=[],s=vt(t.replace(O,"$1"));return s[v]?et((function(t,e,i,n){for(var r,a=s(t,null,n,[]),o=t.length;o--;)(r=a[o])&&(t[o]=!(e[o]=r))})):function(t,n,r){return e[0]=t,s(e,null,r,i),e[0]=null,!i.pop()}})),has:et((function(t){return function(e){return X(t,e).length>0}})),contains:et((function(t){return t=t.replace(K,Z),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||X.error("unsupported lang: "+t),t=t.replace(K,Z).toLowerCase(),function(e){var i;do{if(i=u?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=s.location&&s.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===l},focus:function(t){return t===function(){try{return c.activeElement}catch(t){}}()&&c.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:rt(!1),disabled:rt(!0),checked:function(t){return E(t,"input")&&!!t.checked||E(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return $.test(t.nodeName)},button:function(t){return E(t,"input")&&"button"===t.type||E(t,"button")},text:function(t){var e;return E(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,i){return[i<0?i+e:i]})),even:at((function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:at((function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:at((function(t,e,i){var s;for(s=i<0?i+e:i>e?e:i;--s>=0;)t.push(s);return t})),gt:at((function(t,e,i){for(var s=i<0?i+e:i;++s<e;)t.push(s);return t}))}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=st(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=nt(t);function lt(){}function ht(t,i){var s,n,r,a,o,c,l,h=A[t+" "];if(h)return i?0:h.slice(0);for(o=t,c=[],l=e.preFilter;o;){for(a in s&&!(n=q.exec(o))||(n&&(o=o.slice(n[0].length)||o),c.push(r=[])),s=!1,(n=L.exec(o))&&(s=n.shift(),r.push({value:s,type:n[0].replace(O," ")}),o=o.slice(s.length)),e.filter)!(n=H[a].exec(o))||l[a]&&!(n=l[a](n))||(s=n.shift(),r.push({value:s,type:a,matches:n}),o=o.slice(s.length));if(!s)break}return i?o.length:o?X.error(t):A(t,c).slice(0)}function ut(t){for(var e=0,i=t.length,s="";e<i;e++)s+=t[e].value;return s}function dt(t,e,i){var s=e.dir,n=e.next,r=n||s,a=i&&"parentNode"===r,o=y++;return e.first?function(e,i,n){for(;e=e[s];)if(1===e.nodeType||a)return t(e,i,n);return!1}:function(e,i,c){var l,h,u=[b,o];if(c){for(;e=e[s];)if((1===e.nodeType||a)&&t(e,i,c))return!0}else for(;e=e[s];)if(1===e.nodeType||a)if(h=e[v]||(e[v]={}),n&&E(e,n))e=e[s]||e;else{if((l=h[r])&&l[0]===b&&l[1]===o)return u[2]=l[2];if(h[r]=u,u[2]=t(e,i,c))return!0}return!1}}function pt(t){return t.length>1?function(e,i,s){for(var n=t.length;n--;)if(!t[n](e,i,s))return!1;return!0}:t[0]}function ft(t,e,i,s,n){for(var r,a=[],o=0,c=t.length,l=null!=e;o<c;o++)(r=t[o])&&(i&&!i(r,s,n)||(a.push(r),l&&e.push(o)));return a}function gt(t,e,i,s,n,r){return s&&!s[v]&&(s=gt(s)),n&&!n[v]&&(n=gt(n,r)),et((function(r,a,o,c){var l,u,d,p,f=[],m=[],v=a.length,b=r||function(t,e,i){for(var s=0,n=e.length;s<n;s++)X(t,e[s],i);return i}(e||"*",o.nodeType?[o]:o,[]),y=!t||!r&&e?b:ft(b,f,t,o,c);if(i?i(y,p=n||(r?t:v||s)?[]:a,o,c):p=y,s)for(l=ft(p,m),s(l,[],o,c),u=l.length;u--;)(d=l[u])&&(p[m[u]]=!(y[m[u]]=d));if(r){if(n||t){if(n){for(l=[],u=p.length;u--;)(d=p[u])&&l.push(y[u]=d);n(null,p=[],l,c)}for(u=p.length;u--;)(d=p[u])&&(l=n?h.call(r,d):f[u])>-1&&(r[l]=!(a[l]=d))}}else p=ft(p===a?p.splice(v,p.length):p),n?n(null,a,p,c):g.apply(a,p)}))}function mt(t){for(var s,n,r,a=t.length,o=e.relative[t[0].type],c=o||e.relative[" "],l=o?1:0,u=dt((function(t){return t===s}),c,!0),d=dt((function(t){return h.call(s,t)>-1}),c,!0),p=[function(t,e,n){var r=!o&&(n||e!=i)||((s=e).nodeType?u(t,e,n):d(t,e,n));return s=null,r}];l<a;l++)if(n=e.relative[t[l].type])p=[dt(pt(p),n)];else{if((n=e.filter[t[l].type].apply(null,t[l].matches))[v]){for(r=++l;r<a&&!e.relative[t[r].type];r++);return gt(l>1&&pt(p),l>1&&ut(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(O,"$1"),n,l<r&&mt(t.slice(l,r)),r<a&&mt(t=t.slice(r)),r<a&&ut(t))}p.push(n)}return pt(p)}function vt(t,s){var n,r=[],a=[],o=C[t+" "];if(!o){for(s||(s=ht(t)),n=s.length;n--;)(o=mt(s[n]))[v]?r.push(o):a.push(o);o=C(t,function(t,s){var n=s.length>0,r=t.length>0,a=function(a,o,l,h,d){var p,f,m,v=0,y="0",w=a&&[],A=[],C=i,x=a||r&&e.find.TAG("*",d),k=b+=null==C?1:Math.random()||.1,T=x.length;for(d&&(i=o==c||o||d);y!==T&&null!=(p=x[y]);y++){if(r&&p){for(f=0,o||p.ownerDocument==c||(ct(p),l=!u);m=t[f++];)if(m(p,o||c,l)){g.call(h,p);break}d&&(b=k)}n&&((p=!m&&p)&&v--,a&&w.push(p))}if(v+=y,n&&y!==v){for(f=0;m=s[f++];)m(w,A,o,l);if(a){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=P.call(h));A=ft(A)}g.apply(h,A),d&&!a&&A.length>0&&v+s.length>1&&S.uniqueSort(h)}return d&&(b=k,i=C),w};return n?et(a):a}(a,r)),o.selector=t}return o}function bt(t,i,s,n){var r,a,o,c,l,h="function"==typeof t&&t,d=!n&&ht(t=h.selector||t);if(s=s||[],1===d.length){if((a=d[0]=d[0].slice(0)).length>2&&"ID"===(o=a[0]).type&&9===i.nodeType&&u&&e.relative[a[1].type]){if(!(i=(e.find.ID(o.matches[0].replace(K,Z),i)||[])[0]))return s;h&&(i=i.parentNode),t=t.slice(a.shift().value.length)}for(r=H.needsContext.test(t)?0:a.length;r--&&(o=a[r],!e.relative[c=o.type]);)if((l=e.find[c])&&(n=l(o.matches[0].replace(K,Z),G.test(a[0].type)&&ot(i.parentNode)||i))){if(a.splice(r,1),!(t=n.length&&ut(a)))return g.apply(s,n),s;break}}return(h||vt(t,d))(n,i,!u,s,!i||G.test(t)&&ot(i.parentNode)||i),s}lt.prototype=e.filters=e.pseudos,e.setFilters=new lt,m.sortStable=v.split("").sort(k).join("")===v,ct(),m.sortDetached=it((function(t){return 1&t.compareDocumentPosition(c.createElement("fieldset"))})),S.find=X,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,X.compile=vt,X.select=bt,X.setDocument=ct,X.tokenize=ht,X.escape=S.escapeSelector,X.getText=S.text,X.isXML=S.isXMLDoc,X.selectors=S.expr,X.support=S.support,X.uniqueSort=S.uniqueSort}();var V=function(t,e,i){for(var s=[],n=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(n&&S(t).is(i))break;s.push(t)}return s},j=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},q=S.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(t,e,i){return v(e)?S.grep(t,(function(t,s){return!!e.call(t,s,t)!==i})):e.nodeType?S.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?S.grep(t,(function(t){return h.call(e,t)>-1!==i})):S.filter(e,t,i)}S.filter=function(t,e,i){var s=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===s.nodeType?S.find.matchesSelector(s,t)?[s]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,i,s=this.length,n=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<s;e++)if(S.contains(n[e],this))return!0})));for(i=this.pushStack([]),e=0;e<s;e++)S.find(t,n[e],i);return s>1?S.uniqueSort(i):i},filter:function(t){return this.pushStack(F(this,t||[],!1))},not:function(t){return this.pushStack(F(this,t||[],!0))},is:function(t){return!!F(this,"string"==typeof t&&q.test(t)?S(t):t||[],!1).length}});var z,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var s,n;if(!t)return this;if(i=i||z,"string"==typeof t){if(!(s="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!s[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(s[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(s[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),L.test(s[1])&&S.isPlainObject(e))for(s in e)v(this[s])?this[s](e[s]):this.attr(s,e[s]);return this}return(n=y.getElementById(s[2]))&&(this[0]=n,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,z=S(y);var H=/^(?:parents|prev(?:Until|All))/,$={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),i=e.length;return this.filter((function(){for(var t=0;t<i;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var i,s=0,n=this.length,r=[],a="string"!=typeof t&&S(t);if(!q.test(t))for(;s<n;s++)for(i=this[s];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&S.find.matchesSelector(i,t))){r.push(i);break}return this.pushStack(r.length>1?S.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?h.call(S(t),this[0]):h.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return V(t,"parentNode")},parentsUntil:function(t,e,i){return V(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return V(t,"nextSibling")},prevAll:function(t){return V(t,"previousSibling")},nextUntil:function(t,e,i){return V(t,"nextSibling",i)},prevUntil:function(t,e,i){return V(t,"previousSibling",i)},siblings:function(t){return j((t.parentNode||{}).firstChild,t)},children:function(t){return j(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(i,s){var n=S.map(this,e,i);return"Until"!==t.slice(-5)&&(s=i),s&&"string"==typeof s&&(n=S.filter(s,n)),this.length>1&&($[t]||S.uniqueSort(n),H.test(t)&&n.reverse()),this.pushStack(n)}}));var J=/[^\x20\t\r\n\f]+/g;function G(t){return t}function K(t){throw t}function Z(t,e,i,s){var n;try{t&&v(n=t.promise)?n.call(t).done(e).fail(i):t&&v(n=t.then)?n.call(t,e,i):e.apply(void 0,[t].slice(s))}catch(t){i.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(J)||[],(function(t,i){e[i]=!0})),e}(t):S.extend({},t);var e,i,s,n,r=[],a=[],o=-1,c=function(){for(n=n||t.once,s=e=!0;a.length;o=-1)for(i=a.shift();++o<r.length;)!1===r[o].apply(i[0],i[1])&&t.stopOnFalse&&(o=r.length,i=!1);t.memory||(i=!1),e=!1,n&&(r=i?[]:"")},l={add:function(){return r&&(i&&!e&&(o=r.length-1,a.push(i)),function e(i){S.each(i,(function(i,s){v(s)?t.unique&&l.has(s)||r.push(s):s&&s.length&&"string"!==C(s)&&e(s)}))}(arguments),i&&!e&&c()),this},remove:function(){return S.each(arguments,(function(t,e){for(var i;(i=S.inArray(e,r,i))>-1;)r.splice(i,1),i<=o&&o--})),this},has:function(t){return t?S.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return n=a=[],r=i="",this},disabled:function(){return!r},lock:function(){return n=a=[],i||e||(r=i=""),this},locked:function(){return!!n},fireWith:function(t,i){return n||(i=[t,(i=i||[]).slice?i.slice():i],a.push(i),e||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!s}};return l},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return n.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(i){S.each(e,(function(e,s){var n=v(t[s[4]])&&t[s[4]];r[s[1]]((function(){var t=n&&n.apply(this,arguments);t&&v(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[s[0]+"With"](this,n?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,n){var r=0;function a(t,e,i,n){return function(){var o=this,c=arguments,l=function(){var s,l;if(!(t<r)){if((s=i.apply(o,c))===e.promise())throw new TypeError("Thenable self-resolution");l=s&&("object"==typeof s||"function"==typeof s)&&s.then,v(l)?n?l.call(s,a(r,e,G,n),a(r,e,K,n)):(r++,l.call(s,a(r,e,G,n),a(r,e,K,n),a(r,e,G,e.notifyWith))):(i!==G&&(o=void 0,c=[s]),(n||e.resolveWith)(o,c))}},h=n?l:function(){try{l()}catch(s){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(s,h.error),t+1>=r&&(i!==K&&(o=void 0,c=[s]),e.rejectWith(o,c))}};t?h():(S.Deferred.getErrorHook?h.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(h.error=S.Deferred.getStackHook()),s.setTimeout(h))}}return S.Deferred((function(s){e[0][3].add(a(0,s,v(n)?n:G,s.notifyWith)),e[1][3].add(a(0,s,v(t)?t:G)),e[2][3].add(a(0,s,v(i)?i:K))})).promise()},promise:function(t){return null!=t?S.extend(t,n):n}},r={};return S.each(e,(function(t,s){var a=s[2],o=s[5];n[s[1]]=a.add,o&&a.add((function(){i=o}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(s[3].fire),r[s[0]]=function(){return r[s[0]+"With"](this===r?void 0:this,arguments),this},r[s[0]+"With"]=a.fireWith})),n.promise(r),t&&t.call(r,r),r},when:function(t){var e=arguments.length,i=e,s=Array(i),n=o.call(arguments),r=S.Deferred(),a=function(t){return function(i){s[t]=this,n[t]=arguments.length>1?o.call(arguments):i,--e||r.resolveWith(s,n)}};if(e<=1&&(Z(t,r.done(a(i)).resolve,r.reject,!e),"pending"===r.state()||v(n[i]&&n[i].then)))return r.then();for(;i--;)Z(n[i],a(i),r.reject);return r.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){s.console&&s.console.warn&&t&&Y.test(t.name)&&s.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){s.setTimeout((function(){throw t}))};var Q=S.Deferred();function X(){y.removeEventListener("DOMContentLoaded",X),s.removeEventListener("load",X),S.ready()}S.fn.ready=function(t){return Q.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||Q.resolveWith(y,[S]))}}),S.ready.then=Q.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?s.setTimeout(S.ready):(y.addEventListener("DOMContentLoaded",X),s.addEventListener("load",X));var tt=function(t,e,i,s,n,r,a){var o=0,c=t.length,l=null==i;if("object"===C(i))for(o in n=!0,i)tt(t,e,o,i[o],!0,r,a);else if(void 0!==s&&(n=!0,v(s)||(a=!0),l&&(a?(e.call(t,s),e=null):(l=e,e=function(t,e,i){return l.call(S(t),i)})),e))for(;o<c;o++)e(t[o],i,a?s:s.call(t[o],o,e(t[o],i)));return n?t:l?e.call(t):c?e(t[0],i):r},et=/^-ms-/,it=/-([a-z])/g;function st(t,e){return e.toUpperCase()}function nt(t){return t.replace(et,"ms-").replace(it,st)}var rt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function at(){this.expando=S.expando+at.uid++}at.uid=1,at.prototype={cache:function(t){var e=t[this.expando];return e||(e={},rt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var s,n=this.cache(t);if("string"==typeof e)n[nt(e)]=i;else for(s in e)n[nt(s)]=e[s];return n},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][nt(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,s=t[this.expando];if(void 0!==s){if(void 0!==e){i=(e=Array.isArray(e)?e.map(nt):(e=nt(e))in s?[e]:e.match(J)||[]).length;for(;i--;)delete s[e[i]]}(void 0===e||S.isEmptyObject(s))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var ot=new at,ct=new at,lt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ht=/[A-Z]/g;function ut(t,e,i){var s;if(void 0===i&&1===t.nodeType)if(s="data-"+e.replace(ht,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(s))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:lt.test(t)?JSON.parse(t):t)}(i)}catch(t){}ct.set(t,e,i)}else i=void 0;return i}S.extend({hasData:function(t){return ct.hasData(t)||ot.hasData(t)},data:function(t,e,i){return ct.access(t,e,i)},removeData:function(t,e){ct.remove(t,e)},_data:function(t,e,i){return ot.access(t,e,i)},_removeData:function(t,e){ot.remove(t,e)}}),S.fn.extend({data:function(t,e){var i,s,n,r=this[0],a=r&&r.attributes;if(void 0===t){if(this.length&&(n=ct.get(r),1===r.nodeType&&!ot.get(r,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&0===(s=a[i].name).indexOf("data-")&&(s=nt(s.slice(5)),ut(r,s,n[s]));ot.set(r,"hasDataAttrs",!0)}return n}return"object"==typeof t?this.each((function(){ct.set(this,t)})):tt(this,(function(e){var i;if(r&&void 0===e)return void 0!==(i=ct.get(r,t))||void 0!==(i=ut(r,t))?i:void 0;this.each((function(){ct.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){ct.remove(this,t)}))}}),S.extend({queue:function(t,e,i){var s;if(t)return e=(e||"fx")+"queue",s=ot.get(t,e),i&&(!s||Array.isArray(i)?s=ot.access(t,e,S.makeArray(i)):s.push(i)),s||[]},dequeue:function(t,e){e=e||"fx";var i=S.queue(t,e),s=i.length,n=i.shift(),r=S._queueHooks(t,e);"inprogress"===n&&(n=i.shift(),s--),n&&("fx"===e&&i.unshift("inprogress"),delete r.stop,n.call(t,(function(){S.dequeue(t,e)}),r)),!s&&r&&r.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return ot.get(t,i)||ot.access(t,i,{empty:S.Callbacks("once memory").add((function(){ot.remove(t,[e+"queue",i])}))})}}),S.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?S.queue(this[0],t):void 0===e?this:this.each((function(){var i=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,s=1,n=S.Deferred(),r=this,a=this.length,o=function(){--s||n.resolveWith(r,[r])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=ot.get(r[a],t+"queueHooks"))&&i.empty&&(s++,i.empty.add(o));return o(),n.promise(e)}});var dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,pt=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),ft=["Top","Right","Bottom","Left"],gt=y.documentElement,mt=function(t){return S.contains(t.ownerDocument,t)},vt={composed:!0};gt.getRootNode&&(mt=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(vt)===t.ownerDocument});var bt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&mt(t)&&"none"===S.css(t,"display")};function yt(t,e,i,s){var n,r,a=20,o=s?function(){return s.cur()}:function(){return S.css(t,e,"")},c=o(),l=i&&i[3]||(S.cssNumber[e]?"":"px"),h=t.nodeType&&(S.cssNumber[e]||"px"!==l&&+c)&&pt.exec(S.css(t,e));if(h&&h[3]!==l){for(c/=2,l=l||h[3],h=+c||1;a--;)S.style(t,e,h+l),(1-r)*(1-(r=o()/c||.5))<=0&&(a=0),h/=r;h*=2,S.style(t,e,h+l),i=i||[]}return i&&(h=+h||+c||0,n=i[1]?h+(i[1]+1)*i[2]:+i[2],s&&(s.unit=l,s.start=h,s.end=n)),n}var wt={};function At(t){var e,i=t.ownerDocument,s=t.nodeName,n=wt[s];return n||(e=i.body.appendChild(i.createElement(s)),n=S.css(e,"display"),e.parentNode.removeChild(e),"none"===n&&(n="block"),wt[s]=n,n)}function Ct(t,e){for(var i,s,n=[],r=0,a=t.length;r<a;r++)(s=t[r]).style&&(i=s.style.display,e?("none"===i&&(n[r]=ot.get(s,"display")||null,n[r]||(s.style.display="")),""===s.style.display&&bt(s)&&(n[r]=At(s))):"none"!==i&&(n[r]="none",ot.set(s,"display",i)));for(r=0;r<a;r++)null!=n[r]&&(t[r].style.display=n[r]);return t}S.fn.extend({show:function(){return Ct(this,!0)},hide:function(){return Ct(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){bt(this)?S(this).show():S(this).hide()}))}});var xt,kt,St=/^(?:checkbox|radio)$/i,Tt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Et=/^$|^module$|\/(?:java|ecma)script/i;xt=y.createDocumentFragment().appendChild(y.createElement("div")),(kt=y.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),xt.appendChild(kt),m.checkClone=xt.cloneNode(!0).cloneNode(!0).lastChild.checked,xt.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!xt.cloneNode(!0).lastChild.defaultValue,xt.innerHTML="<option></option>",m.option=!!xt.lastChild;var Pt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function It(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?S.merge([t],i):i}function Bt(t,e){for(var i=0,s=t.length;i<s;i++)ot.set(t[i],"globalEval",!e||ot.get(e[i],"globalEval"))}Pt.tbody=Pt.tfoot=Pt.colgroup=Pt.caption=Pt.thead,Pt.th=Pt.td,m.option||(Pt.optgroup=Pt.option=[1,"<select multiple='multiple'>","</select>"]);var _t=/<|&#?\w+;/;function Ot(t,e,i,s,n){for(var r,a,o,c,l,h,u=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((r=t[p])||0===r)if("object"===C(r))S.merge(d,r.nodeType?[r]:r);else if(_t.test(r)){for(a=a||u.appendChild(e.createElement("div")),o=(Tt.exec(r)||["",""])[1].toLowerCase(),c=Pt[o]||Pt._default,a.innerHTML=c[1]+S.htmlPrefilter(r)+c[2],h=c[0];h--;)a=a.lastChild;S.merge(d,a.childNodes),(a=u.firstChild).textContent=""}else d.push(e.createTextNode(r));for(u.textContent="",p=0;r=d[p++];)if(s&&S.inArray(r,s)>-1)n&&n.push(r);else if(l=mt(r),a=It(u.appendChild(r),"script"),l&&Bt(a),i)for(h=0;r=a[h++];)Et.test(r.type||"")&&i.push(r);return u}var Rt=/^([^.]*)(?:\.(.+)|)/;function Dt(){return!0}function Mt(){return!1}function Nt(t,e,i,s,n,r){var a,o;if("object"==typeof e){for(o in"string"!=typeof i&&(s=s||i,i=void 0),e)Nt(t,o,i,s,e[o],r);return t}if(null==s&&null==n?(n=i,s=i=void 0):null==n&&("string"==typeof i?(n=s,s=void 0):(n=s,s=i,i=void 0)),!1===n)n=Mt;else if(!n)return t;return 1===r&&(a=n,n=function(t){return S().off(t),a.apply(this,arguments)},n.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,n,s,i)}))}function Vt(t,e,i){i?(ot.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,s=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(s)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=o.call(arguments),ot.set(this,e,s),this[e](),i=ot.get(this,e),ot.set(this,e,!1),s!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else s&&(ot.set(this,e,S.event.trigger(s[0],s.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Dt)}})):void 0===ot.get(t,e)&&S.event.add(t,e,Dt)}S.event={global:{},add:function(t,e,i,s,n){var r,a,o,c,l,h,u,d,p,f,g,m=ot.get(t);if(rt(t))for(i.handler&&(i=(r=i).handler,n=r.selector),n&&S.find.matchesSelector(gt,n),i.guid||(i.guid=S.guid++),(c=m.events)||(c=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(J)||[""]).length;l--;)p=g=(o=Rt.exec(e[l])||[])[1],f=(o[2]||"").split(".").sort(),p&&(u=S.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,u=S.event.special[p]||{},h=S.extend({type:p,origType:g,data:s,handler:i,guid:i.guid,selector:n,needsContext:n&&S.expr.match.needsContext.test(n),namespace:f.join(".")},r),(d=c[p])||((d=c[p]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,s,f,a)||t.addEventListener&&t.addEventListener(p,a)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),n?d.splice(d.delegateCount++,0,h):d.push(h),S.event.global[p]=!0)},remove:function(t,e,i,s,n){var r,a,o,c,l,h,u,d,p,f,g,m=ot.hasData(t)&&ot.get(t);if(m&&(c=m.events)){for(l=(e=(e||"").match(J)||[""]).length;l--;)if(p=g=(o=Rt.exec(e[l])||[])[1],f=(o[2]||"").split(".").sort(),p){for(u=S.event.special[p]||{},d=c[p=(s?u.delegateType:u.bindType)||p]||[],o=o[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=r=d.length;r--;)h=d[r],!n&&g!==h.origType||i&&i.guid!==h.guid||o&&!o.test(h.namespace)||s&&s!==h.selector&&("**"!==s||!h.selector)||(d.splice(r,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));a&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,f,m.handle)||S.removeEvent(t,p,m.handle),delete c[p])}else for(p in c)S.event.remove(t,p+e[l],i,s,!0);S.isEmptyObject(c)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,i,s,n,r,a,o=new Array(arguments.length),c=S.event.fix(t),l=(ot.get(this,"events")||Object.create(null))[c.type]||[],h=S.event.special[c.type]||{};for(o[0]=c,e=1;e<arguments.length;e++)o[e]=arguments[e];if(c.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,c)){for(a=S.event.handlers.call(this,c,l),e=0;(n=a[e++])&&!c.isPropagationStopped();)for(c.currentTarget=n.elem,i=0;(r=n.handlers[i++])&&!c.isImmediatePropagationStopped();)c.rnamespace&&!1!==r.namespace&&!c.rnamespace.test(r.namespace)||(c.handleObj=r,c.data=r.data,void 0!==(s=((S.event.special[r.origType]||{}).handle||r.handler).apply(n.elem,o))&&!1===(c.result=s)&&(c.preventDefault(),c.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,c),c.result}},handlers:function(t,e){var i,s,n,r,a,o=[],c=e.delegateCount,l=t.target;if(c&&l.nodeType&&!("click"===t.type&&t.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(r=[],a={},i=0;i<c;i++)void 0===a[n=(s=e[i]).selector+" "]&&(a[n]=s.needsContext?S(n,this).index(l)>-1:S.find(n,this,null,[l]).length),a[n]&&r.push(s);r.length&&o.push({elem:l,handlers:r})}return l=this,c<e.length&&o.push({elem:l,handlers:e.slice(c)}),o},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return St.test(e.type)&&e.click&&E(e,"input")&&Vt(e,"click",!0),!1},trigger:function(t){var e=this||t;return St.test(e.type)&&e.click&&E(e,"input")&&Vt(e,"click"),!0},_default:function(t){var e=t.target;return St.test(e.type)&&e.click&&E(e,"input")&&ot.get(e,"click")||E(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Dt:Mt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Mt,isPropagationStopped:Mt,isImmediatePropagationStopped:Mt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Dt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Dt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Dt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){function i(t){if(y.documentMode){var i=ot.get(this,"handle"),s=S.event.fix(t);s.type="focusin"===t.type?"focus":"blur",s.isSimulated=!0,i(t),s.target===s.currentTarget&&i(s)}else S.event.simulate(e,t.target,S.event.fix(t))}S.event.special[t]={setup:function(){var s;if(Vt(this,t,!0),!y.documentMode)return!1;(s=ot.get(this,e))||this.addEventListener(e,i),ot.set(this,e,(s||0)+1)},trigger:function(){return Vt(this,t),!0},teardown:function(){var t;if(!y.documentMode)return!1;(t=ot.get(this,e)-1)?ot.set(this,e,t):(this.removeEventListener(e,i),ot.remove(this,e))},_default:function(e){return ot.get(e.target,t)},delegateType:e},S.event.special[e]={setup:function(){var s=this.ownerDocument||this.document||this,n=y.documentMode?this:s,r=ot.get(n,e);r||(y.documentMode?this.addEventListener(e,i):s.addEventListener(t,i,!0)),ot.set(n,e,(r||0)+1)},teardown:function(){var s=this.ownerDocument||this.document||this,n=y.documentMode?this:s,r=ot.get(n,e)-1;r?ot.set(n,e,r):(y.documentMode?this.removeEventListener(e,i):s.removeEventListener(t,i,!0),ot.remove(n,e))}}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,s=t.relatedTarget,n=t.handleObj;return s&&(s===this||S.contains(this,s))||(t.type=n.origType,i=n.handler.apply(this,arguments),t.type=e),i}}})),S.fn.extend({on:function(t,e,i,s){return Nt(this,t,e,i,s)},one:function(t,e,i,s){return Nt(this,t,e,i,s,1)},off:function(t,e,i){var s,n;if(t&&t.preventDefault&&t.handleObj)return s=t.handleObj,S(t.delegateTarget).off(s.namespace?s.origType+"."+s.namespace:s.origType,s.selector,s.handler),this;if("object"==typeof t){for(n in t)this.off(n,e,t[n]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Mt),this.each((function(){S.event.remove(this,t,i,e)}))}});var jt=/<script|<style|<link/i,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ft(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function zt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ht(t,e){var i,s,n,r,a,o;if(1===e.nodeType){if(ot.hasData(t)&&(o=ot.get(t).events))for(n in ot.remove(e,"handle events"),o)for(i=0,s=o[n].length;i<s;i++)S.event.add(e,n,o[n][i]);ct.hasData(t)&&(r=ct.access(t),a=S.extend({},r),ct.set(e,a))}}function $t(t,e){var i=e.nodeName.toLowerCase();"input"===i&&St.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function Wt(t,e,i,s){e=c(e);var n,r,a,o,l,h,u=0,d=t.length,p=d-1,f=e[0],g=v(f);if(g||d>1&&"string"==typeof f&&!m.checkClone&&qt.test(f))return t.each((function(n){var r=t.eq(n);g&&(e[0]=f.call(this,n,r.html())),Wt(r,e,i,s)}));if(d&&(r=(n=Ot(e,t[0].ownerDocument,!1,t,s)).firstChild,1===n.childNodes.length&&(n=r),r||s)){for(o=(a=S.map(It(n,"script"),zt)).length;u<d;u++)l=n,u!==p&&(l=S.clone(l,!0,!0),o&&S.merge(a,It(l,"script"))),i.call(t[u],l,u);if(o)for(h=a[a.length-1].ownerDocument,S.map(a,Ut),u=0;u<o;u++)l=a[u],Et.test(l.type||"")&&!ot.access(l,"globalEval")&&S.contains(h,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?S._evalUrl&&!l.noModule&&S._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},h):A(l.textContent.replace(Lt,""),l,h))}return t}function Jt(t,e,i){for(var s,n=e?S.filter(e,t):t,r=0;null!=(s=n[r]);r++)i||1!==s.nodeType||S.cleanData(It(s)),s.parentNode&&(i&&mt(s)&&Bt(It(s,"script")),s.parentNode.removeChild(s));return t}S.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var s,n,r,a,o=t.cloneNode(!0),c=mt(t);if(!(m.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(a=It(o),s=0,n=(r=It(t)).length;s<n;s++)$t(r[s],a[s]);if(e)if(i)for(r=r||It(t),a=a||It(o),s=0,n=r.length;s<n;s++)Ht(r[s],a[s]);else Ht(t,o);return(a=It(o,"script")).length>0&&Bt(a,!c&&It(t,"script")),o},cleanData:function(t){for(var e,i,s,n=S.event.special,r=0;void 0!==(i=t[r]);r++)if(rt(i)){if(e=i[ot.expando]){if(e.events)for(s in e.events)n[s]?S.event.remove(i,s):S.removeEvent(i,s,e.handle);i[ot.expando]=void 0}i[ct.expando]&&(i[ct.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Jt(this,t,!0)},remove:function(t){return Jt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ft(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ft(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(It(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},i=0,s=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!jt.test(t)&&!Pt[(Tt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;i<s;i++)1===(e=this[i]||{}).nodeType&&(S.cleanData(It(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Wt(this,arguments,(function(e){var i=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(It(this)),i&&i.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var i,s=[],n=S(t),r=n.length-1,a=0;a<=r;a++)i=a===r?this:this.clone(!0),S(n[a])[e](i),l.apply(s,i.get());return this.pushStack(s)}}));var Gt=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),Kt=/^--/,Zt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=s),e.getComputedStyle(t)},Yt=function(t,e,i){var s,n,r={};for(n in e)r[n]=t.style[n],t.style[n]=e[n];for(n in s=i.call(t),e)t.style[n]=r[n];return s},Qt=new RegExp(ft.join("|"),"i");function Xt(t,e,i){var s,n,r,a,o=Kt.test(e),c=t.style;return(i=i||Zt(t))&&(a=i.getPropertyValue(e)||i[e],o&&a&&(a=a.replace(O,"$1")||void 0),""!==a||mt(t)||(a=S.style(t,e)),!m.pixelBoxStyles()&&Gt.test(a)&&Qt.test(e)&&(s=c.width,n=c.minWidth,r=c.maxWidth,c.minWidth=c.maxWidth=c.width=a,a=i.width,c.width=s,c.minWidth=n,c.maxWidth=r)),void 0!==a?a+"":a}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(h){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",gt.appendChild(l).appendChild(h);var t=s.getComputedStyle(h);i="1%"!==t.top,c=12===e(t.marginLeft),h.style.right="60%",a=36===e(t.right),n=36===e(t.width),h.style.position="absolute",r=12===e(h.offsetWidth/3),gt.removeChild(l),h=null}}function e(t){return Math.round(parseFloat(t))}var i,n,r,a,o,c,l=y.createElement("div"),h=y.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===h.style.backgroundClip,S.extend(m,{boxSizingReliable:function(){return t(),n},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),c},scrollboxSize:function(){return t(),r},reliableTrDimensions:function(){var t,e,i,n;return null==o&&(t=y.createElement("table"),e=y.createElement("tr"),i=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="box-sizing:content-box;border:1px solid",e.style.height="1px",i.style.height="9px",i.style.display="block",gt.appendChild(t).appendChild(e).appendChild(i),n=s.getComputedStyle(e),o=parseInt(n.height,10)+parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10)===e.offsetHeight,gt.removeChild(t)),o}}))}();var ee=["Webkit","Moz","ms"],ie=y.createElement("div").style,se={};function ne(t){var e=S.cssProps[t]||se[t];return e||(t in ie?t:se[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=ee.length;i--;)if((t=ee[i]+e)in ie)return t}(t)||t)}var re=/^(none|table(?!-c[ea]).+)/,ae={position:"absolute",visibility:"hidden",display:"block"},oe={letterSpacing:"0",fontWeight:"400"};function ce(t,e,i){var s=pt.exec(e);return s?Math.max(0,s[2]-(i||0))+(s[3]||"px"):e}function le(t,e,i,s,n,r){var a="width"===e?1:0,o=0,c=0,l=0;if(i===(s?"border":"content"))return 0;for(;a<4;a+=2)"margin"===i&&(l+=S.css(t,i+ft[a],!0,n)),s?("content"===i&&(c-=S.css(t,"padding"+ft[a],!0,n)),"margin"!==i&&(c-=S.css(t,"border"+ft[a]+"Width",!0,n))):(c+=S.css(t,"padding"+ft[a],!0,n),"padding"!==i?c+=S.css(t,"border"+ft[a]+"Width",!0,n):o+=S.css(t,"border"+ft[a]+"Width",!0,n));return!s&&r>=0&&(c+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-c-o-.5))||0),c+l}function he(t,e,i){var s=Zt(t),n=(!m.boxSizingReliable()||i)&&"border-box"===S.css(t,"boxSizing",!1,s),r=n,a=Xt(t,e,s),o="offset"+e[0].toUpperCase()+e.slice(1);if(Gt.test(a)){if(!i)return a;a="auto"}return(!m.boxSizingReliable()&&n||!m.reliableTrDimensions()&&E(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,s))&&t.getClientRects().length&&(n="border-box"===S.css(t,"boxSizing",!1,s),(r=o in t)&&(a=t[o])),(a=parseFloat(a)||0)+le(t,e,i||(n?"border":"content"),r,s,a)+"px"}function ue(t,e,i,s,n){return new ue.prototype.init(t,e,i,s,n)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Xt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,s){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var n,r,a,o=nt(e),c=Kt.test(e),l=t.style;if(c||(e=ne(o)),a=S.cssHooks[e]||S.cssHooks[o],void 0===i)return a&&"get"in a&&void 0!==(n=a.get(t,!1,s))?n:l[e];"string"===(r=typeof i)&&(n=pt.exec(i))&&n[1]&&(i=yt(t,e,n),r="number"),null!=i&&i==i&&("number"!==r||c||(i+=n&&n[3]||(S.cssNumber[o]?"":"px")),m.clearCloneStyle||""!==i||0!==e.indexOf("background")||(l[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,s))||(c?l.setProperty(e,i):l[e]=i))}},css:function(t,e,i,s){var n,r,a,o=nt(e);return Kt.test(e)||(e=ne(o)),(a=S.cssHooks[e]||S.cssHooks[o])&&"get"in a&&(n=a.get(t,!0,i)),void 0===n&&(n=Xt(t,e,s)),"normal"===n&&e in oe&&(n=oe[e]),""===i||i?(r=parseFloat(n),!0===i||isFinite(r)?r||0:n):n}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,i,s){if(i)return!re.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?he(t,e,s):Yt(t,ae,(function(){return he(t,e,s)}))},set:function(t,i,s){var n,r=Zt(t),a=!m.scrollboxSize()&&"absolute"===r.position,o=(a||s)&&"border-box"===S.css(t,"boxSizing",!1,r),c=s?le(t,e,s,o,r):0;return o&&a&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-le(t,e,"border",!1,r)-.5)),c&&(n=pt.exec(i))&&"px"!==(n[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),ce(0,i,c)}}})),S.cssHooks.marginLeft=te(m.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Xt(t,"marginLeft"))||t.getBoundingClientRect().left-Yt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(i){for(var s=0,n={},r="string"==typeof i?i.split(" "):[i];s<4;s++)n[t+ft[s]+e]=r[s]||r[s-2]||r[0];return n}},"margin"!==t&&(S.cssHooks[t+e].set=ce)})),S.fn.extend({css:function(t,e){return tt(this,(function(t,e,i){var s,n,r={},a=0;if(Array.isArray(e)){for(s=Zt(t),n=e.length;a<n;a++)r[e[a]]=S.css(t,e[a],!1,s);return r}return void 0!==i?S.style(t,e,i):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=ue,ue.prototype={constructor:ue,init:function(t,e,i,s,n,r){this.elem=t,this.prop=i,this.easing=n||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=s,this.unit=r||(S.cssNumber[i]?"":"px")},cur:function(){var t=ue.propHooks[this.prop];return t&&t.get?t.get(this):ue.propHooks._default.get(this)},run:function(t){var e,i=ue.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ue.propHooks._default.set(this),this}},ue.prototype.init.prototype=ue.prototype,ue.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[ne(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ue.propHooks.scrollTop=ue.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=ue.prototype.init,S.fx.step={};var de,pe,fe=/^(?:toggle|show|hide)$/,ge=/queueHooks$/;function me(){pe&&(!1===y.hidden&&s.requestAnimationFrame?s.requestAnimationFrame(me):s.setTimeout(me,S.fx.interval),S.fx.tick())}function ve(){return s.setTimeout((function(){de=void 0})),de=Date.now()}function be(t,e){var i,s=0,n={height:t};for(e=e?1:0;s<4;s+=2-e)n["margin"+(i=ft[s])]=n["padding"+i]=t;return e&&(n.opacity=n.width=t),n}function ye(t,e,i){for(var s,n=(we.tweeners[e]||[]).concat(we.tweeners["*"]),r=0,a=n.length;r<a;r++)if(s=n[r].call(i,e,t))return s}function we(t,e,i){var s,n,r=0,a=we.prefilters.length,o=S.Deferred().always((function(){delete c.elem})),c=function(){if(n)return!1;for(var e=de||ve(),i=Math.max(0,l.startTime+l.duration-e),s=1-(i/l.duration||0),r=0,a=l.tweens.length;r<a;r++)l.tweens[r].run(s);return o.notifyWith(t,[l,s,i]),s<1&&a?i:(a||o.notifyWith(t,[l,1,0]),o.resolveWith(t,[l]),!1)},l=o.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},i),originalProperties:e,originalOptions:i,startTime:de||ve(),duration:i.duration,tweens:[],createTween:function(e,i){var s=S.Tween(t,l.opts,e,i,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(s),s},stop:function(e){var i=0,s=e?l.tweens.length:0;if(n)return this;for(n=!0;i<s;i++)l.tweens[i].run(1);return e?(o.notifyWith(t,[l,1,0]),o.resolveWith(t,[l,e])):o.rejectWith(t,[l,e]),this}}),h=l.props;for(!function(t,e){var i,s,n,r,a;for(i in t)if(n=e[s=nt(i)],r=t[i],Array.isArray(r)&&(n=r[1],r=t[i]=r[0]),i!==s&&(t[s]=r,delete t[i]),(a=S.cssHooks[s])&&"expand"in a)for(i in r=a.expand(r),delete t[s],r)i in t||(t[i]=r[i],e[i]=n);else e[s]=n}(h,l.opts.specialEasing);r<a;r++)if(s=we.prefilters[r].call(l,t,h,l.opts))return v(s.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=s.stop.bind(s)),s;return S.map(h,ye,l),v(l.opts.start)&&l.opts.start.call(t,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(c,{elem:t,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(we,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return yt(i.elem,t,pt.exec(e),i),i}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(J);for(var i,s=0,n=t.length;s<n;s++)i=t[s],we.tweeners[i]=we.tweeners[i]||[],we.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var s,n,r,a,o,c,l,h,u="width"in e||"height"in e,d=this,p={},f=t.style,g=t.nodeType&&bt(t),m=ot.get(t,"fxshow");for(s in i.queue||(null==(a=S._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,o=a.empty.fire,a.empty.fire=function(){a.unqueued||o()}),a.unqueued++,d.always((function(){d.always((function(){a.unqueued--,S.queue(t,"fx").length||a.empty.fire()}))}))),e)if(n=e[s],fe.test(n)){if(delete e[s],r=r||"toggle"===n,n===(g?"hide":"show")){if("show"!==n||!m||void 0===m[s])continue;g=!0}p[s]=m&&m[s]||S.style(t,s)}if((c=!S.isEmptyObject(e))||!S.isEmptyObject(p))for(s in u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(l=m&&m.display)&&(l=ot.get(t,"display")),"none"===(h=S.css(t,"display"))&&(l?h=l:(Ct([t],!0),l=t.style.display||l,h=S.css(t,"display"),Ct([t]))),("inline"===h||"inline-block"===h&&null!=l)&&"none"===S.css(t,"float")&&(c||(d.done((function(){f.display=l})),null==l&&(h=f.display,l="none"===h?"":h)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",d.always((function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]}))),c=!1,p)c||(m?"hidden"in m&&(g=m.hidden):m=ot.access(t,"fxshow",{display:l}),r&&(m.hidden=!g),g&&Ct([t],!0),d.done((function(){for(s in g||Ct([t]),ot.remove(t,"fxshow"),p)S.style(t,s,p[s])}))),c=ye(g?m[s]:0,s,d),s in m||(m[s]=c.start,g&&(c.end=c.start,c.start=0))}],prefilter:function(t,e){e?we.prefilters.unshift(t):we.prefilters.push(t)}}),S.speed=function(t,e,i){var s=t&&"object"==typeof t?S.extend({},t):{complete:i||!i&&e||v(t)&&t,duration:t,easing:i&&e||e&&!v(e)&&e};return S.fx.off?s.duration=0:"number"!=typeof s.duration&&(s.duration in S.fx.speeds?s.duration=S.fx.speeds[s.duration]:s.duration=S.fx.speeds._default),null!=s.queue&&!0!==s.queue||(s.queue="fx"),s.old=s.complete,s.complete=function(){v(s.old)&&s.old.call(this),s.queue&&S.dequeue(this,s.queue)},s},S.fn.extend({fadeTo:function(t,e,i,s){return this.filter(bt).css("opacity",0).show().end().animate({opacity:e},t,i,s)},animate:function(t,e,i,s){var n=S.isEmptyObject(t),r=S.speed(e,i,s),a=function(){var e=we(this,S.extend({},t),r);(n||ot.get(this,"finish"))&&e.stop(!0)};return a.finish=a,n||!1===r.queue?this.each(a):this.queue(r.queue,a)},stop:function(t,e,i){var s=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,n=null!=t&&t+"queueHooks",r=S.timers,a=ot.get(this);if(n)a[n]&&a[n].stop&&s(a[n]);else for(n in a)a[n]&&a[n].stop&&ge.test(n)&&s(a[n]);for(n=r.length;n--;)r[n].elem!==this||null!=t&&r[n].queue!==t||(r[n].anim.stop(i),e=!1,r.splice(n,1));!e&&i||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,i=ot.get(this),s=i[t+"queue"],n=i[t+"queueHooks"],r=S.timers,a=s?s.length:0;for(i.finish=!0,S.queue(this,t,[]),n&&n.stop&&n.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===t&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<a;e++)s[e]&&s[e].finish&&s[e].finish.call(this);delete i.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var i=S.fn[e];S.fn[e]=function(t,s,n){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(be(e,!0),t,s,n)}})),S.each({slideDown:be("show"),slideUp:be("hide"),slideToggle:be("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,i,s){return this.animate(e,t,i,s)}})),S.timers=[],S.fx.tick=function(){var t,e=0,i=S.timers;for(de=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||S.fx.stop(),de=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){pe||(pe=!0,me())},S.fx.stop=function(){pe=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var n=s.setTimeout(e,t);i.stop=function(){s.clearTimeout(n)}}))},function(){var t=y.createElement("input"),e=y.createElement("select").appendChild(y.createElement("option"));t.type="checkbox",m.checkOn=""!==t.value,m.optSelected=e.selected,(t=y.createElement("input")).value="t",t.type="radio",m.radioValue="t"===t.value}();var Ae,Ce=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return tt(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,i){var s,n,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?S.prop(t,e,i):(1===r&&S.isXMLDoc(t)||(n=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?Ae:void 0)),void 0!==i?null===i?void S.removeAttr(t,e):n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:(t.setAttribute(e,i+""),i):n&&"get"in n&&null!==(s=n.get(t,e))?s:null==(s=S.find.attr(t,e))?void 0:s)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&E(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,s=0,n=e&&e.match(J);if(n&&1===t.nodeType)for(;i=n[s++];)t.removeAttribute(i)}}),Ae={set:function(t,e,i){return!1===e?S.removeAttr(t,i):t.setAttribute(i,i),i}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=Ce[e]||S.find.attr;Ce[e]=function(t,e,s){var n,r,a=e.toLowerCase();return s||(r=Ce[a],Ce[a]=n,n=null!=i(t,e,s)?a:null,Ce[a]=r),n}}));var xe=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function Se(t){return(t.match(J)||[]).join(" ")}function Te(t){return t.getAttribute&&t.getAttribute("class")||""}function Ee(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(J)||[]}S.fn.extend({prop:function(t,e){return tt(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,i){var s,n,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&S.isXMLDoc(t)||(e=S.propFix[e]||e,n=S.propHooks[e]),void 0!==i?n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:t[e]=i:n&&"get"in n&&null!==(s=n.get(t,e))?s:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):xe.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,i,s,n,r,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,Te(this)))})):(e=Ee(t)).length?this.each((function(){if(s=Te(this),i=1===this.nodeType&&" "+Se(s)+" "){for(r=0;r<e.length;r++)n=e[r],i.indexOf(" "+n+" ")<0&&(i+=n+" ");a=Se(i),s!==a&&this.setAttribute("class",a)}})):this},removeClass:function(t){var e,i,s,n,r,a;return v(t)?this.each((function(e){S(this).removeClass(t.call(this,e,Te(this)))})):arguments.length?(e=Ee(t)).length?this.each((function(){if(s=Te(this),i=1===this.nodeType&&" "+Se(s)+" "){for(r=0;r<e.length;r++)for(n=e[r];i.indexOf(" "+n+" ")>-1;)i=i.replace(" "+n+" "," ");a=Se(i),s!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,s,n,r,a=typeof t,o="string"===a||Array.isArray(t);return v(t)?this.each((function(i){S(this).toggleClass(t.call(this,i,Te(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(i=Ee(t),this.each((function(){if(o)for(r=S(this),n=0;n<i.length;n++)s=i[n],r.hasClass(s)?r.removeClass(s):r.addClass(s);else void 0!==t&&"boolean"!==a||((s=Te(this))&&ot.set(this,"__className__",s),this.setAttribute&&this.setAttribute("class",s||!1===t?"":ot.get(this,"__className__")||""))})))},hasClass:function(t){var e,i,s=0;for(e=" "+t+" ";i=this[s++];)if(1===i.nodeType&&(" "+Se(Te(i))+" ").indexOf(e)>-1)return!0;return!1}});var Pe=/\r/g;S.fn.extend({val:function(t){var e,i,s,n=this[0];return arguments.length?(s=v(t),this.each((function(i){var n;1===this.nodeType&&(null==(n=s?t.call(this,i,S(this).val()):t)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=S.map(n,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,n,"value")||(this.value=n))}))):n?(e=S.valHooks[n.type]||S.valHooks[n.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(n,"value"))?i:"string"==typeof(i=n.value)?i.replace(Pe,""):null==i?"":i:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,i,s,n=t.options,r=t.selectedIndex,a="select-one"===t.type,o=a?null:[],c=a?r+1:n.length;for(s=r<0?c:a?r:0;s<c;s++)if(((i=n[s]).selected||s===r)&&!i.disabled&&(!i.parentNode.disabled||!E(i.parentNode,"optgroup"))){if(e=S(i).val(),a)return e;o.push(e)}return o},set:function(t,e){for(var i,s,n=t.options,r=S.makeArray(e),a=n.length;a--;)((s=n[a]).selected=S.inArray(S.valHooks.option.get(s),r)>-1)&&(i=!0);return i||(t.selectedIndex=-1),r}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},m.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ie=s.location,Be={guid:Date.now()},_e=/\?/;S.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new s.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||S.error("Invalid XML: "+(i?S.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Oe=/^(?:focusinfocus|focusoutblur)$/,Re=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,n){var r,a,o,c,l,h,u,d,f=[i||y],g=p.call(t,"type")?t.type:t,m=p.call(t,"namespace")?t.namespace.split("."):[];if(a=d=o=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!Oe.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),l=g.indexOf(":")<0&&"on"+g,(t=t[S.expando]?t:new S.Event(g,"object"==typeof t&&t)).isTrigger=n?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:S.makeArray(e,[t]),u=S.event.special[g]||{},n||!u.trigger||!1!==u.trigger.apply(i,e))){if(!n&&!u.noBubble&&!b(i)){for(c=u.delegateType||g,Oe.test(c+g)||(a=a.parentNode);a;a=a.parentNode)f.push(a),o=a;o===(i.ownerDocument||y)&&f.push(o.defaultView||o.parentWindow||s)}for(r=0;(a=f[r++])&&!t.isPropagationStopped();)d=a,t.type=r>1?c:u.bindType||g,(h=(ot.get(a,"events")||Object.create(null))[t.type]&&ot.get(a,"handle"))&&h.apply(a,e),(h=l&&a[l])&&h.apply&&rt(a)&&(t.result=h.apply(a,e),!1===t.result&&t.preventDefault());return t.type=g,n||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(f.pop(),e)||!rt(i)||l&&v(i[g])&&!b(i)&&((o=i[l])&&(i[l]=null),S.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,Re),i[g](),t.isPropagationStopped()&&d.removeEventListener(g,Re),S.event.triggered=void 0,o&&(i[l]=o)),t.result}},simulate:function(t,e,i){var s=S.extend(new S.Event,i,{type:t,isSimulated:!0});S.event.trigger(s,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return S.event.trigger(t,e,i,!0)}});var De=/\[\]$/,Me=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,Ve=/^(?:input|select|textarea|keygen)/i;function je(t,e,i,s){var n;if(Array.isArray(e))S.each(e,(function(e,n){i||De.test(t)?s(t,n):je(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,s)}));else if(i||"object"!==C(e))s(t,e);else for(n in e)je(t+"["+n+"]",e[n],i,s)}S.param=function(t,e){var i,s=[],n=function(t,e){var i=v(e)?e():e;s[s.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){n(this.name,this.value)}));else for(i in t)je(i,t[i],e,n);return s.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Ve.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!St.test(t))})).map((function(t,e){var i=S(this).val();return null==i?null:Array.isArray(i)?S.map(i,(function(t){return{name:e.name,value:t.replace(Me,"\r\n")}})):{name:e.name,value:i.replace(Me,"\r\n")}})).get()}});var qe=/%20/g,Le=/#.*$/,Fe=/([?&])_=[^&]*/,ze=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,He=/^\/\//,$e={},We={},Je="*/".concat("*"),Ge=y.createElement("a");function Ke(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var s,n=0,r=e.toLowerCase().match(J)||[];if(v(i))for(;s=r[n++];)"+"===s[0]?(s=s.slice(1)||"*",(t[s]=t[s]||[]).unshift(i)):(t[s]=t[s]||[]).push(i)}}function Ze(t,e,i,s){var n={},r=t===We;function a(o){var c;return n[o]=!0,S.each(t[o]||[],(function(t,o){var l=o(e,i,s);return"string"!=typeof l||r||n[l]?r?!(c=l):void 0:(e.dataTypes.unshift(l),a(l),!1)})),c}return a(e.dataTypes[0])||!n["*"]&&a("*")}function Ye(t,e){var i,s,n=S.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((n[i]?t:s||(s={}))[i]=e[i]);return s&&S.extend(!0,t,s),t}Ge.href=Ie.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ie.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ie.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ye(Ye(t,S.ajaxSettings),e):Ye(S.ajaxSettings,t)},ajaxPrefilter:Ke($e),ajaxTransport:Ke(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,n,r,a,o,c,l,h,u,d,p=S.ajaxSetup({},e),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?S(f):S.event,m=S.Deferred(),v=S.Callbacks("once memory"),b=p.statusCode||{},w={},A={},C="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(l){if(!a)for(a={};e=ze.exec(r);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return l?r:null},setRequestHeader:function(t,e){return null==l&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)x.always(t[x.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return i&&i.abort(e),k(0,e),this}};if(m.promise(x),p.url=((t||p.url||Ie.href)+"").replace(He,Ie.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(J)||[""],null==p.crossDomain){c=y.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=Ge.protocol+"//"+Ge.host!=c.protocol+"//"+c.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze($e,p,e,x),l)return x;for(u in(h=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ue.test(p.type),n=p.url.replace(Le,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(qe,"+")):(d=p.url.slice(n.length),p.data&&(p.processData||"string"==typeof p.data)&&(n+=(_e.test(n)?"&":"?")+p.data,delete p.data),!1===p.cache&&(n=n.replace(Fe,"$1"),d=(_e.test(n)?"&":"?")+"_="+Be.guid+++d),p.url=n+d),p.ifModified&&(S.lastModified[n]&&x.setRequestHeader("If-Modified-Since",S.lastModified[n]),S.etag[n]&&x.setRequestHeader("If-None-Match",S.etag[n])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&x.setRequestHeader("Content-Type",p.contentType),x.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Je+"; q=0.01":""):p.accepts["*"]),p.headers)x.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,x,p)||l))return x.abort();if(C="abort",v.add(p.complete),x.done(p.success),x.fail(p.error),i=Ze(We,p,e,x)){if(x.readyState=1,h&&g.trigger("ajaxSend",[x,p]),l)return x;p.async&&p.timeout>0&&(o=s.setTimeout((function(){x.abort("timeout")}),p.timeout));try{l=!1,i.send(w,k)}catch(t){if(l)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,a,c){var u,d,y,w,A,C=e;l||(l=!0,o&&s.clearTimeout(o),i=void 0,r=c||"",x.readyState=t>0?4:0,u=t>=200&&t<300||304===t,a&&(w=function(t,e,i){for(var s,n,r,a,o=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),void 0===s&&(s=t.mimeType||e.getResponseHeader("Content-Type"));if(s)for(n in o)if(o[n]&&o[n].test(s)){c.unshift(n);break}if(c[0]in i)r=c[0];else{for(n in i){if(!c[0]||t.converters[n+" "+c[0]]){r=n;break}a||(a=n)}r=r||a}if(r)return r!==c[0]&&c.unshift(r),i[r]}(p,x,a)),!u&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,i,s){var n,r,a,o,c,l={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(r=h.shift();r;)if(t.responseFields[r]&&(i[t.responseFields[r]]=e),!c&&s&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=r,r=h.shift())if("*"===r)r=c;else if("*"!==c&&c!==r){if(!(a=l[c+" "+r]||l["* "+r]))for(n in l)if((o=n.split(" "))[1]===r&&(a=l[c+" "+o[0]]||l["* "+o[0]])){!0===a?a=l[n]:!0!==l[n]&&(r=o[0],h.unshift(o[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+c+" to "+r}}}return{state:"success",data:e}}(p,w,x,u),u?(p.ifModified&&((A=x.getResponseHeader("Last-Modified"))&&(S.lastModified[n]=A),(A=x.getResponseHeader("etag"))&&(S.etag[n]=A)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=w.state,d=w.data,u=!(y=w.error))):(y=C,!t&&C||(C="error",t<0&&(t=0))),x.status=t,x.statusText=(e||C)+"",u?m.resolveWith(f,[d,C,x]):m.rejectWith(f,[x,C,y]),x.statusCode(b),b=void 0,h&&g.trigger(u?"ajaxSuccess":"ajaxError",[x,p,u?d:y]),v.fireWith(f,[x,C]),h&&(g.trigger("ajaxComplete",[x,p]),--S.active||S.event.trigger("ajaxStop")))}return x},getJSON:function(t,e,i){return S.get(t,e,i,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,i,s,n){return v(i)&&(n=n||s,s=i,i=void 0),S.ajax(S.extend({url:t,type:e,dataType:n,data:i,success:s},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,i){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,i)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(i){S(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new s.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},Xe=S.ajaxSettings.xhr();m.cors=!!Xe&&"withCredentials"in Xe,m.ajax=Xe=!!Xe,S.ajaxTransport((function(t){var e,i;if(m.cors||Xe&&!t.crossDomain)return{send:function(n,r){var a,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)o[a]=t.xhrFields[a];for(a in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)o.setRequestHeader(a,n[a]);e=function(t){return function(){e&&(e=i=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?r(0,"error"):r(o.status,o.statusText):r(Qe[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),i=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=i:o.onreadystatechange=function(){4===o.readyState&&s.setTimeout((function(){e&&i()}))},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(s,n){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&n("error"===t.type?404:200,t.type)}),y.head.appendChild(e[0])},abort:function(){i&&i()}}}));var ti,ei=[],ii=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=ei.pop()||S.expando+"_"+Be.guid++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,i){var n,r,a,o=!1!==t.jsonp&&(ii.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ii.test(t.data)&&"data");if(o||"jsonp"===t.dataTypes[0])return n=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,o?t[o]=t[o].replace(ii,"$1"+n):!1!==t.jsonp&&(t.url+=(_e.test(t.url)?"&":"?")+t.jsonp+"="+n),t.converters["script json"]=function(){return a||S.error(n+" was not called"),a[0]},t.dataTypes[0]="json",r=s[n],s[n]=function(){a=arguments},i.always((function(){void 0===r?S(s).removeProp(n):s[n]=r,t[n]&&(t.jsonpCallback=e.jsonpCallback,ei.push(n)),a&&v(r)&&r(a[0]),a=r=void 0})),"script"})),m.createHTMLDocument=((ti=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ti.childNodes.length),S.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(m.createHTMLDocument?((s=(e=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,e.head.appendChild(s)):e=y),r=!i&&[],(n=L.exec(t))?[e.createElement(n[1])]:(n=Ot([t],e,r),r&&r.length&&S(r).remove(),S.merge([],n.childNodes)));var s,n,r},S.fn.load=function(t,e,i){var s,n,r,a=this,o=t.indexOf(" ");return o>-1&&(s=Se(t.slice(o)),t=t.slice(0,o)),v(e)?(i=e,e=void 0):e&&"object"==typeof e&&(n="POST"),a.length>0&&S.ajax({url:t,type:n||"GET",dataType:"html",data:e}).done((function(t){r=arguments,a.html(s?S("<div>").append(S.parseHTML(t)).find(s):t)})).always(i&&function(t,e){a.each((function(){i.apply(this,r||[t.responseText,e,t])}))}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,i){var s,n,r,a,o,c,l=S.css(t,"position"),h=S(t),u={};"static"===l&&(t.style.position="relative"),o=h.offset(),r=S.css(t,"top"),c=S.css(t,"left"),("absolute"===l||"fixed"===l)&&(r+c).indexOf("auto")>-1?(a=(s=h.position()).top,n=s.left):(a=parseFloat(r)||0,n=parseFloat(c)||0),v(e)&&(e=e.call(t,i,S.extend({},o))),null!=e.top&&(u.top=e.top-o.top+a),null!=e.left&&(u.left=e.left-o.left+n),"using"in e?e.using.call(t,u):h.css(u)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,i,s=this[0];return s?s.getClientRects().length?(e=s.getBoundingClientRect(),i=s.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,s=this[0],n={top:0,left:0};if("fixed"===S.css(s,"position"))e=s.getBoundingClientRect();else{for(e=this.offset(),i=s.ownerDocument,t=s.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==s&&1===t.nodeType&&((n=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),n.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-n.top-S.css(s,"marginTop",!0),left:e.left-n.left-S.css(s,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||gt}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var i="pageYOffset"===e;S.fn[t]=function(s){return tt(this,(function(t,s,n){var r;if(b(t)?r=t:9===t.nodeType&&(r=t.defaultView),void 0===n)return r?r[e]:t[s];r?r.scrollTo(i?r.pageXOffset:n,i?n:r.pageYOffset):t[s]=n}),t,s,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=te(m.pixelPosition,(function(t,i){if(i)return i=Xt(t,e),Gt.test(i)?S(t).position()[e]+"px":i}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(i,s){S.fn[s]=function(n,r){var a=arguments.length&&(i||"boolean"!=typeof n),o=i||(!0===n||!0===r?"margin":"border");return tt(this,(function(e,i,n){var r;return b(e)?0===s.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?S.css(e,i,o):S.style(e,i,n,o)}),e,a?n:void 0,a)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,s){return this.on(e,t,i,s)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){S.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}));var si=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(t,e){var i,s,n;if("string"==typeof e&&(i=t[e],e=t,t=i),v(t))return s=o.call(arguments,2),n=function(){return t.apply(e||this,s.concat(o.call(arguments)))},n.guid=t.guid=t.guid||S.guid++,n},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=E,S.isFunction=v,S.isWindow=b,S.camelCase=nt,S.type=C,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},S.trim=function(t){return null==t?"":(t+"").replace(si,"$1")},void 0===(i=function(){return S}.apply(e,[]))||(t.exports=i);var ni=s.jQuery,ri=s.$;return S.noConflict=function(t){return s.$===S&&(s.$=ri),t&&s.jQuery===S&&(s.jQuery=ni),S},void 0===n&&(s.jQuery=s.$=S),S}))},710:(t,e,i)=>{t.exports=function t(e,i,s){function n(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[a]={exports:{}};e[a][0].call(l.exports,(function(t){return n(e[a][1][t]||t)}),l,l.exports,t,e,i,s)}return i[a].exports}for(var r=void 0,a=0;a<s.length;a++)n(s[a]);return n}({1:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,n,a,o,c,l,h=[],u=0,d=t.length,p=d,f="string"!==s.getTypeOf(t);u<t.length;)p=d-u,n=f?(e=t[u++],i=u<d?t[u++]:0,u<d?t[u++]:0):(e=t.charCodeAt(u++),i=u<d?t.charCodeAt(u++):0,u<d?t.charCodeAt(u++):0),a=e>>2,o=(3&e)<<4|i>>4,c=1<p?(15&i)<<2|n>>6:64,l=2<p?63&n:64,h.push(r.charAt(a)+r.charAt(o)+r.charAt(c)+r.charAt(l));return h.join("")},i.decode=function(t){var e,i,s,a,o,c,l=0,h=0,u="data:";if(t.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var d,p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===r.charAt(64)&&p--,t.charAt(t.length-2)===r.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=n.uint8array?new Uint8Array(0|p):new Array(0|p);l<t.length;)e=r.indexOf(t.charAt(l++))<<2|(a=r.indexOf(t.charAt(l++)))>>4,i=(15&a)<<4|(o=r.indexOf(t.charAt(l++)))>>2,s=(3&o)<<6|(c=r.indexOf(t.charAt(l++))),d[h++]=e,64!==o&&(d[h++]=i),64!==c&&(d[h++]=s);return d}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var s=t("./external"),n=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,i,s,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=s,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,i){return t.pipe(new r).pipe(new a("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var s=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var s=t("./utils"),n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==s.getTypeOf(t)?function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e[o])];return~t}(0|e,t,t.length,0):function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e.charCodeAt(o))];return~t}(0|e,t,t.length,0):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var s=null;s="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:s}},{lie:37}],7:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),r=t("./utils"),a=t("./stream/GenericWorker"),o=s?"uint8array":"array";function c(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(c,a),c.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(o,t.data),!1)},c.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new c("Deflate",t)},i.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function s(t,e){var i,s="";for(i=0;i<e;i++)s+=String.fromCharCode(255&t),t>>>=8;return s}function n(t,e,i,n,a,h){var u,d,p=t.file,f=t.compression,g=h!==o.utf8encode,m=r.transformTo("string",h(p.name)),v=r.transformTo("string",o.utf8encode(p.name)),b=p.comment,y=r.transformTo("string",h(b)),w=r.transformTo("string",o.utf8encode(b)),A=v.length!==p.name.length,C=w.length!==b.length,x="",k="",S="",T=p.dir,E=p.date,P={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(P.crc32=t.crc32,P.compressedSize=t.compressedSize,P.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),g||!A&&!C||(I|=2048);var B=0,_=0;T&&(B|=16),"UNIX"===a?(_=798,B|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,T)):(_=20,B|=function(t){return 63&(t||0)}(p.dosPermissions)),u=E.getUTCHours(),u<<=6,u|=E.getUTCMinutes(),u<<=5,u|=E.getUTCSeconds()/2,d=E.getUTCFullYear()-1980,d<<=4,d|=E.getUTCMonth()+1,d<<=5,d|=E.getUTCDate(),A&&(k=s(1,1)+s(c(m),4)+v,x+="up"+s(k.length,2)+k),C&&(S=s(1,1)+s(c(y),4)+w,x+="uc"+s(S.length,2)+S);var O="";return O+="\n\0",O+=s(I,2),O+=f.magic,O+=s(u,2),O+=s(d,2),O+=s(P.crc32,4),O+=s(P.compressedSize,4),O+=s(P.uncompressedSize,4),O+=s(m.length,2),O+=s(x.length,2),{fileRecord:l.LOCAL_FILE_HEADER+O+m+x,dirRecord:l.CENTRAL_FILE_HEADER+s(_,2)+O+s(y.length,2)+"\0\0\0\0"+s(B,4)+s(n,4)+m+x+y}}var r=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),c=t("../crc32"),l=t("../signature");function h(t,e,i,s){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=s,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(h,a),h.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-s-1))/i:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return l.DATA_DESCRIPTOR+s(t.crc32,4)+s(t.compressedSize,4)+s(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i=this.bytesWritten-t,n=function(t,e,i,n,a){var o=r.transformTo("string",a(n));return l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(t,2)+s(t,2)+s(e,4)+s(i,4)+s(o.length,2)+o}(this.dirRecords.length,i,t,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},h.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(t){var e=this._sources;if(!a.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},h.prototype.lock=function(){a.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){"use strict";var s=t("../compressions"),n=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var r=new n(e.streamFiles,i,e.platform,e.encodeFileName),a=0;try{t.forEach((function(t,i){a++;var n=function(t,e){var i=t||e,n=s[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),o=i.options.compressionOptions||e.compressionOptions||{},c=i.dir,l=i.date;i._compressWorker(n,o).withStreamInfo("file",{name:t,dir:c,date:l,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(r)})),r.entriesCount=a}catch(t){r.error(t)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){"use strict";function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new s;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(t,e){return(new s).loadAsync(t,e)},s.external=t("./external"),e.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./external"),r=t("./utf8"),a=t("./zipEntries"),o=t("./stream/Crc32Probe"),c=t("./nodejsUtils");function l(t){return new n.Promise((function(e,i){var s=t.decompressed.getContentWorker().pipe(new o);s.on("error",(function(t){i(t)})).on("end",(function(){s.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var i=this;return e=s.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),c.isNode&&c.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var i=new a(e);return i.load(t),i})).then((function(t){var i=[n.Promise.resolve(t)],s=t.files;if(e.checkCRC32)for(var r=0;r<s.length;r++)i.push(l(s[r]));return n.Promise.all(i)})).then((function(t){for(var n=t.shift(),r=n.files,a=0;a<r.length;a++){var o=r[a],c=o.fileNameStr,l=s.resolve(o.fileNameStr);i.file(l,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders}),o.dir||(i.file(l).unsafeOriginalName=c)}return n.zipComment.length&&(i.comment=n.zipComment),i}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../stream/GenericWorker");function r(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}s.inherits(r,n),r.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){"use strict";var s=t("readable-stream").Readable;function n(t,e,i){s.call(this,e),this._helper=t;var n=this;t.on("data",(function(t,e){n.push(t)||n._helper.pause(),i&&i(e)})).on("error",(function(t){n.emit("error",t)})).on("end",(function(){n.push(null)}))}t("../utils").inherits(n,s),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){"use strict";function s(t,e,i){var s,n=r.getTypeOf(e),o=r.extend(i||{},c);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=g(t)),o.createFolders&&(s=f(t))&&m.call(this,s,!0);var u="string"===n&&!1===o.binary&&!1===o.base64;i&&void 0!==i.binary||(o.binary=!u),(e instanceof l&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",n="string");var v=null;v=e instanceof l||e instanceof a?e:d.isNode&&d.isStream(e)?new p(t,e):r.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var b=new h(t,v,o);this.files[t]=b}var n=t("./utf8"),r=t("./utils"),a=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),c=t("./defaults"),l=t("./compressedObject"),h=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),p=t("./nodejs/NodejsStreamInputAdapter"),f=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},g=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},m=function(t,e){return e=void 0!==e?e:c.createFolders,t=g(t),this.files[t]||s.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function v(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,s;for(e in this.files)s=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,s)},filter:function(t){var e=[];return this.forEach((function(i,s){t(i,s)&&e.push(s)})),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,s.call(this,t,e,i),this;if(v(t)){var n=t;return this.filter((function(t,e){return!e.dir&&n.test(t)}))}var r=this.files[this.root+t];return r&&!r.dir?r:null},folder:function(t){if(!t)return this;if(v(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=m.call(this,e),s=this.clone();return s.root=i.name,s},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter((function(e,i){return i.name.slice(0,t.length)===t})),s=0;s<i.length;s++)delete this.files[i[s].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");r.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var s=i.comment||this.comment||"";e=u.generateWorker(this,i,s)}catch(t){(e=new a("error")).error(t)}return new o(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.length-4;0<=r;--r)if(this.data[r]===e&&this.data[r+1]===i&&this.data[r+2]===s&&this.data[r+3]===n)return r-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.readData(4);return e===r[0]&&i===r[1]&&s===r[2]&&n===r[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var s=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return s.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,i){"use strict";var s=t("./Uint8ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var s=t("./ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../support"),r=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),c=t("./Uint8ArrayReader");e.exports=function(t){var e=s.getTypeOf(t);return s.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new o(t):n.uint8array?new c(s.transformTo("uint8array",t)):new r(s.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../utils");function r(t){s.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(r,s),r.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../crc32");function r(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,s),r.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}s.inherits(r,n),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=s.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}s.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function s(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=s},{}],29:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./ConvertWorker"),r=t("./GenericWorker"),a=t("../base64"),o=t("../support"),c=t("../external"),l=null;if(o.nodestream)try{l=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e){return new c.Promise((function(i,n){var r=[],o=t._internalType,c=t._outputType,l=t._mimeType;t.on("data",(function(t,i){r.push(t),e&&e(i)})).on("error",(function(t){r=[],n(t)})).on("end",(function(){try{var t=function(t,e,i){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),i);case"base64":return a.encode(e);default:return s.transformTo(t,e)}}(c,function(t,e){var i,s=0,n=null,r=0;for(i=0;i<e.length;i++)r+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(r),i=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(o,r),l);i(t)}catch(t){n(t)}r=[]})).resume()}))}function u(t,e,i){var a=e;switch(e){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=e,this._mimeType=i,s.checkSupport(a),this._worker=t.pipe(new n(a)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}u.prototype={accumulate:function(t){return h(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,(function(t){e.call(i,t.data,t.meta)})):this._worker.on(t,(function(){s.delay(e,arguments,i)})),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){"use strict";if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer="undefined"!=typeof Buffer,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=0===new Blob([s],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(s),i.blob=0===n.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){"use strict";for(var s=t("./utils"),n=t("./support"),r=t("./nodejsUtils"),a=t("./stream/GenericWorker"),o=new Array(256),c=0;c<256;c++)o[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function l(){a.call(this,"utf-8 decode"),this.leftOver=null}function h(){a.call(this,"utf-8 encode")}o[254]=o[254]=1,i.utf8encode=function(t){return n.nodebuffer?r.newBufferFrom(t,"utf-8"):function(t){var e,i,s,r,a,o=t.length,c=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),c+=i<128?1:i<2048?2:i<65536?3:4;for(e=n.uint8array?new Uint8Array(c):new Array(c),r=a=0;a<c;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e}(t)},i.utf8decode=function(t){return n.nodebuffer?s.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,n,r,a=t.length,c=new Array(2*a);for(e=i=0;e<a;)if((n=t[e++])<128)c[i++]=n;else if(4<(r=o[n]))c[i++]=65533,e+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&e<a;)n=n<<6|63&t[e++],r--;1<r?c[i++]=65533:n<65536?c[i++]=n:(n-=65536,c[i++]=55296|n>>10&1023,c[i++]=56320|1023&n)}return c.length!==i&&(c.subarray?c=c.subarray(0,i):c.length=i),s.applyFromCharCode(c)}(t=s.transformTo(n.uint8array?"uint8array":"array",t))},s.inherits(l,a),l.prototype.processChunk=function(t){var e=s.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}(e),c=e;a!==e.length&&(n.uint8array?(c=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(c=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:i.utf8decode(c),meta:t.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=l,s.inherits(h,a),h.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var s=t("./support"),n=t("./base64"),r=t("./nodejsUtils"),a=t("./external");function o(t){return t}function c(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}t("setimmediate"),i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(t),s.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(t,e,i){var s=[],n=0,r=t.length;if(r<=i)return String.fromCharCode.apply(null,t);for(;n<r;)"array"===e||"nodebuffer"===e?s.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,r)))):s.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,r)))),n+=i;return s.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(t){return!1}}()}};function h(t){var e=65536,s=i.getTypeOf(t),n=!0;if("uint8array"===s?n=l.applyCanBeUsed.uint8array:"nodebuffer"===s&&(n=l.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return l.stringifyByChunk(t,s,e)}catch(t){e=Math.floor(e/2)}return l.stringifyByChar(t)}function u(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=h;var d={};d.string={string:o,array:function(t){return c(t,new Array(t.length))},arraybuffer:function(t){return d.string.uint8array(t).buffer},uint8array:function(t){return c(t,new Uint8Array(t.length))},nodebuffer:function(t){return c(t,r.allocBuffer(t.length))}},d.array={string:h,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(t)}},d.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return u(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(new Uint8Array(t))}},d.uint8array={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return r.newBufferFrom(t)}},d.nodebuffer={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return d.nodebuffer.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:o},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var s=i.getTypeOf(e);return d[s][t](e)},i.resolve=function(t){for(var e=t.split("/"),i=[],s=0;s<e.length;s++){var n=e[s];"."===n||""===n&&0!==s&&s!==e.length-1||(".."===n?i.pop():i.push(n))}return i.join("/")},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&r.isBuffer(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!s[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,s="";for(i=0;i<(t||"").length;i++)s+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return s},i.delay=function(t,e,i){setImmediate((function(){t.apply(i||null,e||[])}))},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,r,o,l){return a.Promise.resolve(e).then((function(t){return s.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new a.Promise((function(e,i){var s=new FileReader;s.onload=function(t){e(t.target.result)},s.onerror=function(t){i(t.target.error)},s.readAsArrayBuffer(t)})):t})).then((function(e){var h=i.getTypeOf(e);return h?("arraybuffer"===h?e=i.transformTo("uint8array",e):"string"===h&&(l?e=n.decode(e):r&&!0!==o&&(e=function(t){return c(t,s.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):a.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./signature"),a=t("./zipEntry"),o=t("./support");function c(t){this.files=[],this.loadOptions=t}c.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var s=this.reader.readString(4)===e;return this.reader.setIndex(i),s},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=o.uint8array?"uint8array":"array",i=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,s=this.zip64EndOfCentralSize-44;0<s;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var s=e-i;if(0<s)this.isSignature(e,r.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(t){this.reader=s(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./compressedObject"),a=t("./crc32"),o=t("./utf8"),c=t("./compressions"),l=t("./support");function h(t,e){this.options=t,this.loadOptions=e}h.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in c)if(Object.prototype.hasOwnProperty.call(c,e)&&c[e].magic===t)return c[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=s(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,i,s,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),i=t.readInt(2),s=t.readData(i),this.extraFields[e]={id:e,length:i,value:s};t.setIndex(n)},handleUTF8:function(){var t=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var s=this.findExtraFieldUnicodeComment();if(null!==s)this.fileCommentStr=s;else{var r=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=s(t.value);return 1!==e.readInt(1)||a(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=s(t.value);return 1!==e.readInt(1)||a(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null}},e.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){"use strict";function s(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var n=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),a=t("./utf8"),o=t("./compressedObject"),c=t("./stream/GenericWorker");s.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var s="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!s&&(e=e.pipe(new a.Utf8EncodeWorker)),!r&&s&&(e=e.pipe(new a.Utf8DecodeWorker))}catch(t){(e=new c("error")).error(t)}return new n(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof c?this._data:new r(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<l.length;u++)s.prototype[l[u]]=h;e.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,s){(function(t){"use strict";var i,s,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var r=0,a=new n(h),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){h(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(h,0)};else{var c=new t.MessageChannel;c.port1.onmessage=h,i=function(){c.port2.postMessage(0)}}var l=[];function h(){var t,e;s=!0;for(var i=l.length;i;){for(e=l,l=[],t=-1;++t<i;)e[t]();i=l.length}s=!1}e.exports=function(t){1!==l.push(t)||s||i()}}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){"use strict";var s=t("immediate");function n(){}var r={},a=["REJECTED"],o=["FULFILLED"],c=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function u(t,e,i){s((function(){var s;try{s=e(i)}catch(s){return r.reject(t,s)}s===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,s)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var i=!1;function s(e){i||(i=!0,r.reject(t,e))}function n(e){i||(i=!0,r.resolve(t,e))}var a=f((function(){e(n,s)}));"error"===a.status&&s(a.value)}function f(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=l).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){throw i}))}))},l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var i=new this.constructor(n);return this.state!==c?u(i,this.state===o?t:e,this.outcome):this.queue.push(new h(i,t,e)),i},h.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){r.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=f(d,e);if("error"===i.status)return r.reject(t,i.value);var s=i.value;if(s)p(t,s);else{t.state=o,t.outcome=e;for(var n=-1,a=t.queue.length;++n<a;)t.queue[n].callFulfilled(e)}return t},r.reject=function(t,e){t.state=a,t.outcome=e;for(var i=-1,s=t.queue.length;++i<s;)t.queue[i].callRejected(e);return t},l.resolve=function(t){return t instanceof this?t:r.resolve(new this(n),t)},l.reject=function(t){var e=new this(n);return r.reject(e,t)},l.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var a=new Array(i),o=0,c=-1,l=new this(n);++c<i;)h(t[c],c);return l;function h(t,n){e.resolve(t).then((function(t){a[n]=t,++o!==i||s||(s=!0,r.resolve(l,a))}),(function(t){s||(s=!0,r.reject(l,t))}))}},l.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var a,o=-1,c=new this(n);++o<i;)a=t[o],e.resolve(a).then((function(t){s||(s=!0,r.resolve(c,t))}),(function(t){s||(s=!0,r.reject(c,t))}));return c}},{immediate:36}],38:[function(t,e,i){"use strict";var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){"use strict";var s=t("./zlib/deflate"),n=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/messages"),o=t("./zlib/zstream"),c=Object.prototype.toString,l=0,h=-1,u=0,d=8;function p(t){if(!(this instanceof p))return new p(t);this.options=n.assign({level:h,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var i=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==l)throw new Error(a[i]);if(e.header&&s.deflateSetHeader(this.strm,e.header),e.dictionary){var f;if(f="string"==typeof e.dictionary?r.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(i=s.deflateSetDictionary(this.strm,f))!==l)throw new Error(a[i]);this._dict_set=!0}}function f(t,e){var i=new p(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}p.prototype.push=function(t,e){var i,a,o=this.strm,h=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=r.string2buf(t):"[object ArrayBuffer]"===c.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new n.Buf8(h),o.next_out=0,o.avail_out=h),1!==(i=s.deflate(o,a))&&i!==l)return this.onEnd(i),!(this.ended=!0);0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(r.buf2binstring(n.shrinkBuf(o.output,o.next_out))):this.onData(n.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==i);return 4===a?(i=s.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===l):2!==a||(this.onEnd(l),!(o.avail_out=0))},p.prototype.onData=function(t){this.chunks.push(t)},p.prototype.onEnd=function(t){t===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=p,i.deflate=f,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,f(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var s=t("./zlib/inflate"),n=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/constants"),o=t("./zlib/messages"),c=t("./zlib/zstream"),l=t("./zlib/gzheader"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&!(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var i=s.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(o[i]);this.header=new l,s.inflateGetHeader(this.strm,this.header)}function d(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}u.prototype.push=function(t,e){var i,o,c,l,u,d,p=this.strm,f=this.options.chunkSize,g=this.options.dictionary,m=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?p.input=r.binstring2buf(t):"[object ArrayBuffer]"===h.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new n.Buf8(f),p.next_out=0,p.avail_out=f),(i=s.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&g&&(d="string"==typeof g?r.string2buf(g):"[object ArrayBuffer]"===h.call(g)?new Uint8Array(g):g,i=s.inflateSetDictionary(this.strm,d)),i===a.Z_BUF_ERROR&&!0===m&&(i=a.Z_OK,m=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&i!==a.Z_STREAM_END&&(0!==p.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(c=r.utf8border(p.output,p.next_out),l=p.next_out-c,u=r.buf2string(p.output,c),p.next_out=l,p.avail_out=f-l,l&&n.arraySet(p.output,p.output,c,l,0),this.onData(u)):this.onData(n.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((0<p.avail_in||0===p.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(i=s.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(p.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=u,i.inflate=d,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},i.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,s,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+s),n);else for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){var e,i,s,n,r,a;for(e=s=0,i=t.length;e<i;e++)s+=t[e].length;for(a=new Uint8Array(s),e=n=0,i=t.length;e<i;e++)r=t[e],a.set(r,n),n+=r.length;return a}},r={arraySet:function(t,e,i,s,n){for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(s)},{}],42:[function(t,e,i){"use strict";var s=t("./common"),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){r=!1}for(var a=new s.Buf8(256),o=0;o<256;o++)a[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function c(t,e){if(e<65537&&(t.subarray&&r||!t.subarray&&n))return String.fromCharCode.apply(null,s.shrinkBuf(t,e));for(var i="",a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i}a[254]=a[254]=1,i.string2buf=function(t){var e,i,n,r,a,o=t.length,c=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),c+=i<128?1:i<2048?2:i<65536?3:4;for(e=new s.Buf8(c),r=a=0;a<c;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e},i.buf2binstring=function(t){return c(t,t.length)},i.binstring2buf=function(t){for(var e=new s.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,s,n,r,o=e||t.length,l=new Array(2*o);for(i=s=0;i<o;)if((n=t[i++])<128)l[s++]=n;else if(4<(r=a[n]))l[s++]=65533,i+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&i<o;)n=n<<6|63&t[i++],r--;1<r?l[s++]=65533:n<65536?l[s++]=n:(n-=65536,l[s++]=55296|n>>10&1023,l[s++]=56320|1023&n)}return c(l,s)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,s){for(var n=65535&t,r=t>>>16&65535,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;r=r+(n=n+e[s++]|0)|0,--a;);n%=65521,r%=65521}return n|r<<16}},{}],44:[function(t,e,i){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){"use strict";var s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,n){var r=s,a=n+i;t^=-1;for(var o=n;o<a;o++)t=t>>>8^r[255&(t^e[o])];return~t}},{}],46:[function(t,e,i){"use strict";var s,n=t("../utils/common"),r=t("./trees"),a=t("./adler32"),o=t("./crc32"),c=t("./messages"),l=0,h=4,u=0,d=-2,p=-1,f=4,g=2,m=8,v=9,b=286,y=30,w=19,A=2*b+1,C=15,x=3,k=258,S=k+x+1,T=42,E=113,P=1,I=2,B=3,_=4;function O(t,e){return t.msg=c[e],e}function R(t){return(t<<1)-(4<t?9:0)}function D(t){for(var e=t.length;0<=--e;)t[e]=0}function M(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function N(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,M(t.strm)}function V(t,e){t.pending_buf[t.pending++]=e}function j(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function q(t,e){var i,s,n=t.max_chain_length,r=t.strstart,a=t.prev_length,o=t.nice_match,c=t.strstart>t.w_size-S?t.strstart-(t.w_size-S):0,l=t.window,h=t.w_mask,u=t.prev,d=t.strstart+k,p=l[r+a-1],f=l[r+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(l[(i=e)+a]===f&&l[i+a-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do{}while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<d);if(s=k-(d-r),r=d-k,a<s){if(t.match_start=e,o<=(a=s))break;p=l[r+a-1],f=l[r+a]}}}while((e=u[e&h])>c&&0!=--n);return a<=t.lookahead?a:t.lookahead}function L(t){var e,i,s,r,c,l,h,u,d,p,f=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-S)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=i=t.hash_size;s=t.head[--e],t.head[e]=f<=s?s-f:0,--i;);for(e=i=f;s=t.prev[--e],t.prev[e]=f<=s?s-f:0,--i;);r+=f}if(0===t.strm.avail_in)break;if(l=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=r)<(p=l.avail_in)&&(p=d),i=0===p?0:(l.avail_in-=p,n.arraySet(h,l.input,l.next_in,p,u),1===l.state.wrap?l.adler=a(l.adler,h,p,u):2===l.state.wrap&&(l.adler=o(l.adler,h,p,u)),l.next_in+=p,l.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=x)for(c=t.strstart-t.insert,t.ins_h=t.window[c],t.ins_h=(t.ins_h<<t.hash_shift^t.window[c+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[c+x-1])&t.hash_mask,t.prev[c&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=c,c++,t.insert--,!(t.lookahead+t.insert<x)););}while(t.lookahead<S&&0!==t.strm.avail_in)}function F(t,e){for(var i,s;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===l)return P;if(0===t.lookahead)break}if(i=0,t.lookahead>=x&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-S&&(t.match_length=q(t,i)),t.match_length>=x)if(s=r._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else s=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(s&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=t.strstart<x-1?t.strstart:x-1,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}function z(t,e){for(var i,s,n;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===l)return P;if(0===t.lookahead)break}if(i=0,t.lookahead>=x&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=x-1,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-S&&(t.match_length=q(t,i),t.match_length<=5&&(1===t.strategy||t.match_length===x&&4096<t.strstart-t.match_start)&&(t.match_length=x-1)),t.prev_length>=x&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-x,s=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=x-1,t.strstart++,s&&(N(t,!1),0===t.strm.avail_out))return P}else if(t.match_available){if((s=r._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return P}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(s=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<x-1?t.strstart:x-1,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}function U(t,e,i,s,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=s,this.func=n}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(2*A),this.dyn_dtree=new n.Buf16(2*(2*y+1)),this.bl_tree=new n.Buf16(2*(2*w+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(C+1),this.heap=new n.Buf16(2*b+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*b+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function $(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=g,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?T:E,t.adler=2===e.wrap?0:1,e.last_flush=l,r._tr_init(e),u):O(t,d)}function W(t){var e=$(t);return e===u&&function(t){t.window_size=2*t.w_size,D(t.head),t.max_lazy_match=s[t.level].max_lazy,t.good_match=s[t.level].good_length,t.nice_match=s[t.level].nice_length,t.max_chain_length=s[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=x-1,t.match_available=0,t.ins_h=0}(t.state),e}function J(t,e,i,s,r,a){if(!t)return d;var o=1;if(e===p&&(e=6),s<0?(o=0,s=-s):15<s&&(o=2,s-=16),r<1||v<r||i!==m||s<8||15<s||e<0||9<e||a<0||f<a)return O(t,d);8===s&&(s=9);var c=new H;return(t.state=c).strm=t,c.wrap=o,c.gzhead=null,c.w_bits=s,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=r+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+x-1)/x),c.window=new n.Buf8(2*c.w_size),c.head=new n.Buf16(c.hash_size),c.prev=new n.Buf16(c.w_size),c.lit_bufsize=1<<r+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new n.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=e,c.strategy=a,c.method=i,W(t)}s=[new U(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===l)return P;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var s=t.block_start+i;if((0===t.strstart||t.strstart>=s)&&(t.lookahead=t.strstart-s,t.strstart=s,N(t,!1),0===t.strm.avail_out))return P;if(t.strstart-t.block_start>=t.w_size-S&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?B:_):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),P)})),new U(4,4,8,4,F),new U(4,5,16,8,F),new U(4,6,32,32,F),new U(4,4,16,16,z),new U(8,16,32,32,z),new U(8,16,128,128,z),new U(8,32,128,256,z),new U(32,128,258,1024,z),new U(32,258,258,4096,z)],i.deflateInit=function(t,e){return J(t,e,m,15,8,0)},i.deflateInit2=J,i.deflateReset=W,i.deflateResetKeep=$,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?d:(t.state.gzhead=e,u):d},i.deflate=function(t,e){var i,n,a,c;if(!t||!t.state||5<e||e<0)return t?O(t,d):d;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&e!==h)return O(t,0===t.avail_out?-5:d);if(n.strm=t,i=n.last_flush,n.last_flush=e,n.status===T)if(2===n.wrap)t.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),V(n,255&n.gzhead.time),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),V(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,255&n.gzhead.extra.length),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=o(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),V(n,3),n.status=E);else{var p=m+(n.w_bits-8<<4)<<8;p|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(p|=32),p+=31-p%31,n.status=E,j(n,p),0!==n.strstart&&(j(n,t.adler>>>16),j(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending!==n.pending_buf_size));)V(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending===n.pending_buf_size)){c=1;break}c=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,V(n,c)}while(0!==c);n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===c&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending===n.pending_buf_size)){c=1;break}c=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,V(n,c)}while(0!==c);n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===c&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&M(t),n.pending+2<=n.pending_buf_size&&(V(n,255&t.adler),V(n,t.adler>>8&255),t.adler=0,n.status=E)):n.status=E),0!==n.pending){if(M(t),0===t.avail_out)return n.last_flush=-1,u}else if(0===t.avail_in&&R(e)<=R(i)&&e!==h)return O(t,-5);if(666===n.status&&0!==t.avail_in)return O(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==l&&666!==n.status){var f=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===l)return P;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}(n,e):3===n.strategy?function(t,e){for(var i,s,n,a,o=t.window;;){if(t.lookahead<=k){if(L(t),t.lookahead<=k&&e===l)return P;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0<t.strstart&&(s=o[n=t.strstart-1])===o[++n]&&s===o[++n]&&s===o[++n]){a=t.strstart+k;do{}while(s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&n<a);t.match_length=k-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(i=r._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}(n,e):s[n.level].func(n,e);if(f!==B&&f!==_||(n.status=666),f===P||f===B)return 0===t.avail_out&&(n.last_flush=-1),u;if(f===I&&(1===e?r._tr_align(n):5!==e&&(r._tr_stored_block(n,0,0,!1),3===e&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),M(t),0===t.avail_out))return n.last_flush=-1,u}return e!==h?u:n.wrap<=0?1:(2===n.wrap?(V(n,255&t.adler),V(n,t.adler>>8&255),V(n,t.adler>>16&255),V(n,t.adler>>24&255),V(n,255&t.total_in),V(n,t.total_in>>8&255),V(n,t.total_in>>16&255),V(n,t.total_in>>24&255)):(j(n,t.adler>>>16),j(n,65535&t.adler)),M(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?u:1)},i.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==T&&69!==e&&73!==e&&91!==e&&103!==e&&e!==E&&666!==e?O(t,d):(t.state=null,e===E?O(t,-3):u):d},i.deflateSetDictionary=function(t,e){var i,s,r,o,c,l,h,p,f=e.length;if(!t||!t.state)return d;if(2===(o=(i=t.state).wrap)||1===o&&i.status!==T||i.lookahead)return d;for(1===o&&(t.adler=a(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===o&&(D(i.head),i.strstart=0,i.block_start=0,i.insert=0),p=new n.Buf8(i.w_size),n.arraySet(p,e,f-i.w_size,i.w_size,0),e=p,f=i.w_size),c=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,L(i);i.lookahead>=x;){for(s=i.strstart,r=i.lookahead-(x-1);i.ins_h=(i.ins_h<<i.hash_shift^i.window[s+x-1])&i.hash_mask,i.prev[s&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=s,s++,--r;);i.strstart=s,i.lookahead=x-1,L(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=x-1,i.match_available=0,t.next_in=l,t.input=h,t.avail_in=c,i.wrap=o,u},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){"use strict";e.exports=function(t,e){var i,s,n,r,a,o,c,l,h,u,d,p,f,g,m,v,b,y,w,A,C,x,k,S,T;i=t.state,s=t.next_in,S=t.input,n=s+(t.avail_in-5),r=t.next_out,T=t.output,a=r-(e-t.avail_out),o=r+(t.avail_out-257),c=i.dmax,l=i.wsize,h=i.whave,u=i.wnext,d=i.window,p=i.hold,f=i.bits,g=i.lencode,m=i.distcode,v=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;t:do{f<15&&(p+=S[s++]<<f,f+=8,p+=S[s++]<<f,f+=8),y=g[p&v];e:for(;;){if(p>>>=w=y>>>24,f-=w,0==(w=y>>>16&255))T[r++]=65535&y;else{if(!(16&w)){if(!(64&w)){y=g[(65535&y)+(p&(1<<w)-1)];continue e}if(32&w){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}A=65535&y,(w&=15)&&(f<w&&(p+=S[s++]<<f,f+=8),A+=p&(1<<w)-1,p>>>=w,f-=w),f<15&&(p+=S[s++]<<f,f+=8,p+=S[s++]<<f,f+=8),y=m[p&b];i:for(;;){if(p>>>=w=y>>>24,f-=w,!(16&(w=y>>>16&255))){if(!(64&w)){y=m[(65535&y)+(p&(1<<w)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(C=65535&y,f<(w&=15)&&(p+=S[s++]<<f,(f+=8)<w&&(p+=S[s++]<<f,f+=8)),c<(C+=p&(1<<w)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,f-=w,(w=r-a)<C){if(h<(w=C-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=d,(x=0)===u){if(x+=l-w,w<A){for(A-=w;T[r++]=d[x++],--w;);x=r-C,k=T}}else if(u<w){if(x+=l+u-w,(w-=u)<A){for(A-=w;T[r++]=d[x++],--w;);if(x=0,u<A){for(A-=w=u;T[r++]=d[x++],--w;);x=r-C,k=T}}}else if(x+=u-w,w<A){for(A-=w;T[r++]=d[x++],--w;);x=r-C,k=T}for(;2<A;)T[r++]=k[x++],T[r++]=k[x++],T[r++]=k[x++],A-=3;A&&(T[r++]=k[x++],1<A&&(T[r++]=k[x++]))}else{for(x=r-C;T[r++]=T[x++],T[r++]=T[x++],T[r++]=T[x++],2<(A-=3););A&&(T[r++]=T[x++],1<A&&(T[r++]=T[x++]))}break}}break}}while(s<n&&r<o);s-=A=f>>3,p&=(1<<(f-=A<<3))-1,t.next_in=s,t.next_out=r,t.avail_in=s<n?n-s+5:5-(s-n),t.avail_out=r<o?o-r+257:257-(r-o),i.hold=p,i.bits=f}},{}],49:[function(t,e,i){"use strict";var s=t("../utils/common"),n=t("./adler32"),r=t("./crc32"),a=t("./inffast"),o=t("./inftrees"),c=1,l=2,h=0,u=-2,d=1,p=852,f=592;function g(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=d,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new s.Buf32(p),e.distcode=e.distdyn=new s.Buf32(f),e.sane=1,e.back=-1,h):u}function b(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,v(t)):u}function y(t,e){var i,s;return t&&t.state?(s=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?u:(null!==s.window&&s.wbits!==e&&(s.window=null),s.wrap=i,s.wbits=e,b(t))):u}function w(t,e){var i,s;return t?(s=new m,(t.state=s).window=null,(i=y(t,e))!==h&&(t.state=null),i):u}var A,C,x=!0;function k(t){if(x){var e;for(A=new s.Buf32(512),C=new s.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(c,t.lens,0,288,A,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(l,t.lens,0,32,C,0,t.work,{bits:5}),x=!1}t.lencode=A,t.lenbits=9,t.distcode=C,t.distbits=5}function S(t,e,i,n){var r,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new s.Buf8(a.wsize)),n>=a.wsize?(s.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n<(r=a.wsize-a.wnext)&&(r=n),s.arraySet(a.window,e,i-n,r,a.wnext),(n-=r)?(s.arraySet(a.window,e,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}i.inflateReset=b,i.inflateReset2=y,i.inflateResetKeep=v,i.inflateInit=function(t){return w(t,15)},i.inflateInit2=w,i.inflate=function(t,e){var i,p,f,m,v,b,y,w,A,C,x,T,E,P,I,B,_,O,R,D,M,N,V,j,q=0,L=new s.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return u;12===(i=t.state).mode&&(i.mode=13),v=t.next_out,f=t.output,y=t.avail_out,m=t.next_in,p=t.input,b=t.avail_in,w=i.hold,A=i.bits,C=b,x=y,N=h;t:for(;;)switch(i.mode){case d:if(0===i.wrap){i.mode=13;break}for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(2&i.wrap&&35615===w){L[i.check=0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0),A=w=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&w)<<8)+(w>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&w)){t.msg="unknown compression method",i.mode=30;break}if(A-=4,M=8+(15&(w>>>=4)),0===i.wbits)i.wbits=M;else if(M>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<M,t.adler=i.check=1,i.mode=512&w?10:12,A=w=0;break;case 2:for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(i.flags=w,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=w>>8&1),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0)),A=w=0,i.mode=3;case 3:for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.head&&(i.head.time=w),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,L[2]=w>>>16&255,L[3]=w>>>24&255,i.check=r(i.check,L,4,0)),A=w=0,i.mode=4;case 4:for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.head&&(i.head.xflags=255&w,i.head.os=w>>8),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0)),A=w=0,i.mode=5;case 5:if(1024&i.flags){for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.length=w,i.head&&(i.head.extra_len=w),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0)),A=w=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(b<(T=i.length)&&(T=b),T&&(i.head&&(M=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),s.arraySet(i.head.extra,p,m,T,M)),512&i.flags&&(i.check=r(i.check,p,T,m)),b-=T,m+=T,i.length-=T),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break t;for(T=0;M=p[m+T++],i.head&&M&&i.length<65536&&(i.head.name+=String.fromCharCode(M)),M&&T<b;);if(512&i.flags&&(i.check=r(i.check,p,T,m)),b-=T,m+=T,M)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===b)break t;for(T=0;M=p[m+T++],i.head&&M&&i.length<65536&&(i.head.comment+=String.fromCharCode(M)),M&&T<b;);if(512&i.flags&&(i.check=r(i.check,p,T,m)),b-=T,m+=T,M)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}A=w=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}t.adler=i.check=g(w),A=w=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){w>>>=7&A,A-=7&A,i.mode=27;break}for(;A<3;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}switch(i.last=1&w,A-=1,3&(w>>>=1)){case 0:i.mode=14;break;case 1:if(k(i),i.mode=20,6!==e)break;w>>>=2,A-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}w>>>=2,A-=2;break;case 14:for(w>>>=7&A,A-=7&A;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if((65535&w)!=(w>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&w,A=w=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(T=i.length){if(b<T&&(T=b),y<T&&(T=y),0===T)break t;s.arraySet(f,p,m,T,v),b-=T,m+=T,y-=T,v+=T,i.length-=T;break}i.mode=12;break;case 17:for(;A<14;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(i.nlen=257+(31&w),w>>>=5,A-=5,i.ndist=1+(31&w),w>>>=5,A-=5,i.ncode=4+(15&w),w>>>=4,A-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;A<3;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.lens[F[i.have++]]=7&w,w>>>=3,A-=3}for(;i.have<19;)i.lens[F[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,V={bits:i.lenbits},N=o(0,i.lens,0,19,i.lencode,0,i.work,V),i.lenbits=V.bits,N){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;B=(q=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(_<16)w>>>=I,A-=I,i.lens[i.have++]=_;else{if(16===_){for(j=I+2;A<j;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w>>>=I,A-=I,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}M=i.lens[i.have-1],T=3+(3&w),w>>>=2,A-=2}else if(17===_){for(j=I+3;A<j;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}A-=I,M=0,T=3+(7&(w>>>=I)),w>>>=3,A-=3}else{for(j=I+7;A<j;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}A-=I,M=0,T=11+(127&(w>>>=I)),w>>>=7,A-=7}if(i.have+T>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;T--;)i.lens[i.have++]=M}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,V={bits:i.lenbits},N=o(c,i.lens,0,i.nlen,i.lencode,0,i.work,V),i.lenbits=V.bits,N){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,V={bits:i.distbits},N=o(l,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,V),i.distbits=V.bits,N){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=b&&258<=y){t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,a(t,x),v=t.next_out,f=t.output,y=t.avail_out,m=t.next_in,p=t.input,b=t.avail_in,w=i.hold,A=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;B=(q=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(B&&!(240&B)){for(O=I,R=B,D=_;B=(q=i.lencode[D+((w&(1<<O+R)-1)>>O)])>>>16&255,_=65535&q,!(O+(I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}w>>>=O,A-=O,i.back+=O}if(w>>>=I,A-=I,i.back+=I,i.length=_,0===B){i.mode=26;break}if(32&B){i.back=-1,i.mode=12;break}if(64&B){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&B,i.mode=22;case 22:if(i.extra){for(j=i.extra;A<j;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.length+=w&(1<<i.extra)-1,w>>>=i.extra,A-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;B=(q=i.distcode[w&(1<<i.distbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(!(240&B)){for(O=I,R=B,D=_;B=(q=i.distcode[D+((w&(1<<O+R)-1)>>O)])>>>16&255,_=65535&q,!(O+(I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}w>>>=O,A-=O,i.back+=O}if(w>>>=I,A-=I,i.back+=I,64&B){t.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&B,i.mode=24;case 24:if(i.extra){for(j=i.extra;A<j;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.offset+=w&(1<<i.extra)-1,w>>>=i.extra,A-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===y)break t;if(T=x-y,i.offset>T){if((T=i.offset-T)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}E=T>i.wnext?(T-=i.wnext,i.wsize-T):i.wnext-T,T>i.length&&(T=i.length),P=i.window}else P=f,E=v-i.offset,T=i.length;for(y<T&&(T=y),y-=T,i.length-=T;f[v++]=P[E++],--T;);0===i.length&&(i.mode=21);break;case 26:if(0===y)break t;f[v++]=i.length,y--,i.mode=21;break;case 27:if(i.wrap){for(;A<32;){if(0===b)break t;b--,w|=p[m++]<<A,A+=8}if(x-=y,t.total_out+=x,i.total+=x,x&&(t.adler=i.check=i.flags?r(i.check,f,x,v-x):n(i.check,f,x,v-x)),x=y,(i.flags?w:g(w))!==i.check){t.msg="incorrect data check",i.mode=30;break}A=w=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}A=w=0}i.mode=29;case 29:N=1;break t;case 30:N=-3;break t;case 31:return-4;default:return u}return t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,(i.wsize||x!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&S(t,t.output,t.next_out,x-t.avail_out)?(i.mode=31,-4):(C-=t.avail_in,x-=t.avail_out,t.total_in+=C,t.total_out+=x,i.total+=x,i.wrap&&x&&(t.adler=i.check=i.flags?r(i.check,f,x,t.next_out-x):n(i.check,f,x,t.next_out-x)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==C&&0===x||4===e)&&N===h&&(N=-5),N)},i.inflateEnd=function(t){if(!t||!t.state)return u;var e=t.state;return e.window&&(e.window=null),t.state=null,h},i.inflateGetHeader=function(t,e){var i;return t&&t.state&&2&(i=t.state).wrap?((i.head=e).done=!1,h):u},i.inflateSetDictionary=function(t,e){var i,s=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?u:11===i.mode&&n(1,e,s,0)!==i.check?-3:S(t,e,s,s)?(i.mode=31,-4):(i.havedict=1,h):u},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){"use strict";var s=t("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,c,l,h,u,d){var p,f,g,m,v,b,y,w,A,C=d.bits,x=0,k=0,S=0,T=0,E=0,P=0,I=0,B=0,_=0,O=0,R=null,D=0,M=new s.Buf16(16),N=new s.Buf16(16),V=null,j=0;for(x=0;x<=15;x++)M[x]=0;for(k=0;k<c;k++)M[e[i+k]]++;for(E=C,T=15;1<=T&&0===M[T];T--);if(T<E&&(E=T),0===T)return l[h++]=20971520,l[h++]=20971520,d.bits=1,0;for(S=1;S<T&&0===M[S];S++);for(E<S&&(E=S),x=B=1;x<=15;x++)if(B<<=1,(B-=M[x])<0)return-1;if(0<B&&(0===t||1!==T))return-1;for(N[1]=0,x=1;x<15;x++)N[x+1]=N[x]+M[x];for(k=0;k<c;k++)0!==e[i+k]&&(u[N[e[i+k]]++]=k);if(b=0===t?(R=V=u,19):1===t?(R=n,D-=257,V=r,j-=257,256):(R=a,V=o,-1),x=S,v=h,I=k=O=0,g=-1,m=(_=1<<(P=E))-1,1===t&&852<_||2===t&&592<_)return 1;for(;;){for(y=x-I,A=u[k]<b?(w=0,u[k]):u[k]>b?(w=V[j+u[k]],R[D+u[k]]):(w=96,0),p=1<<x-I,S=f=1<<P;l[v+(O>>I)+(f-=p)]=y<<24|w<<16|A,0!==f;);for(p=1<<x-1;O&p;)p>>=1;if(0!==p?(O&=p-1,O+=p):O=0,k++,0==--M[x]){if(x===T)break;x=e[i+u[k]]}if(E<x&&(O&m)!==g){for(0===I&&(I=E),v+=S,B=1<<(P=x-I);P+I<T&&!((B-=M[P+I])<=0);)P++,B<<=1;if(_+=1<<P,1===t&&852<_||2===t&&592<_)return 1;l[g=O&m]=E<<24|P<<16|v-h}}return 0!==O&&(l[v+O]=x-I<<24|64<<16),d.bits=E,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var s=t("../utils/common"),n=0,r=1;function a(t){for(var e=t.length;0<=--e;)t[e]=0}var o=0,c=29,l=256,h=l+1+c,u=30,d=19,p=2*h+1,f=15,g=16,m=7,v=256,b=16,y=17,w=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],C=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(h+2));a(S);var T=new Array(2*u);a(T);var E=new Array(512);a(E);var P=new Array(256);a(P);var I=new Array(c);a(I);var B,_,O,R=new Array(u);function D(t,e,i,s,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=s,this.max_length=n,this.has_stree=t&&t.length}function M(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function N(t){return t<256?E[t]:E[256+(t>>>7)]}function V(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function j(t,e,i){t.bi_valid>g-i?(t.bi_buf|=e<<t.bi_valid&65535,V(t,t.bi_buf),t.bi_buf=e>>g-t.bi_valid,t.bi_valid+=i-g):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function q(t,e,i){j(t,i[2*e],i[2*e+1])}function L(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function F(t,e,i){var s,n,r=new Array(f+1),a=0;for(s=1;s<=f;s++)r[s]=a=a+i[s-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=L(r[o]++,o))}}function z(t){var e;for(e=0;e<h;e++)t.dyn_ltree[2*e]=0;for(e=0;e<u;e++)t.dyn_dtree[2*e]=0;for(e=0;e<d;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*v]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function U(t){8<t.bi_valid?V(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function H(t,e,i,s){var n=2*e,r=2*i;return t[n]<t[r]||t[n]===t[r]&&s[e]<=s[i]}function $(t,e,i){for(var s=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&H(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!H(e,s,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=s}function W(t,e,i){var s,n,r,a,o=0;if(0!==t.last_lit)for(;s=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],n=t.pending_buf[t.l_buf+o],o++,0===s?q(t,n,e):(q(t,(r=P[n])+l+1,e),0!==(a=A[r])&&j(t,n-=I[r],a),q(t,r=N(--s),i),0!==(a=C[r])&&j(t,s-=R[r],a)),o<t.last_lit;);q(t,v,e)}function J(t,e){var i,s,n,r=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,c=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=p,i=0;i<c;i++)0!==r[2*i]?(t.heap[++t.heap_len]=l=i,t.depth[i]=0):r[2*i+1]=0;for(;t.heap_len<2;)r[2*(n=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=a[2*n+1]);for(e.max_code=l,i=t.heap_len>>1;1<=i;i--)$(t,r,i);for(n=c;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],$(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=s,r[2*n]=r[2*i]+r[2*s],t.depth[n]=(t.depth[i]>=t.depth[s]?t.depth[i]:t.depth[s])+1,r[2*i+1]=r[2*s+1]=n,t.heap[1]=n++,$(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,s,n,r,a,o,c=e.dyn_tree,l=e.max_code,h=e.stat_desc.static_tree,u=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,g=e.stat_desc.extra_base,m=e.stat_desc.max_length,v=0;for(r=0;r<=f;r++)t.bl_count[r]=0;for(c[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<p;i++)m<(r=c[2*c[2*(s=t.heap[i])+1]+1]+1)&&(r=m,v++),c[2*s+1]=r,l<s||(t.bl_count[r]++,a=0,g<=s&&(a=d[s-g]),o=c[2*s],t.opt_len+=o*(r+a),u&&(t.static_len+=o*(h[2*s+1]+a)));if(0!==v){do{for(r=m-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[m]--,v-=2}while(0<v);for(r=m;0!==r;r--)for(s=t.bl_count[r];0!==s;)l<(n=t.heap[--i])||(c[2*n+1]!==r&&(t.opt_len+=(r-c[2*n+1])*c[2*n],c[2*n+1]=r),s--)}}(t,e),F(r,l,t.bl_count)}function G(t,e,i){var s,n,r=-1,a=e[1],o=0,c=7,l=4;for(0===a&&(c=138,l=3),e[2*(i+1)+1]=65535,s=0;s<=i;s++)n=a,a=e[2*(s+1)+1],++o<c&&n===a||(o<l?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*b]++):o<=10?t.bl_tree[2*y]++:t.bl_tree[2*w]++,r=n,l=(o=0)===a?(c=138,3):n===a?(c=6,3):(c=7,4))}function K(t,e,i){var s,n,r=-1,a=e[1],o=0,c=7,l=4;for(0===a&&(c=138,l=3),s=0;s<=i;s++)if(n=a,a=e[2*(s+1)+1],!(++o<c&&n===a)){if(o<l)for(;q(t,n,t.bl_tree),0!=--o;);else 0!==n?(n!==r&&(q(t,n,t.bl_tree),o--),q(t,b,t.bl_tree),j(t,o-3,2)):o<=10?(q(t,y,t.bl_tree),j(t,o-3,3)):(q(t,w,t.bl_tree),j(t,o-11,7));r=n,l=(o=0)===a?(c=138,3):n===a?(c=6,3):(c=7,4)}}a(R);var Z=!1;function Y(t,e,i,n){j(t,(o<<1)+(n?1:0),3),function(t,e,i,n){U(t),n&&(V(t,i),V(t,~i)),s.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i,!0)}i._tr_init=function(t){Z||(function(){var t,e,i,s,n,r=new Array(f+1);for(s=i=0;s<c-1;s++)for(I[s]=i,t=0;t<1<<A[s];t++)P[i++]=s;for(P[i-1]=s,s=n=0;s<16;s++)for(R[s]=n,t=0;t<1<<C[s];t++)E[n++]=s;for(n>>=7;s<u;s++)for(R[s]=n<<7,t=0;t<1<<C[s]-7;t++)E[256+n++]=s;for(e=0;e<=f;e++)r[e]=0;for(t=0;t<=143;)S[2*t+1]=8,t++,r[8]++;for(;t<=255;)S[2*t+1]=9,t++,r[9]++;for(;t<=279;)S[2*t+1]=7,t++,r[7]++;for(;t<=287;)S[2*t+1]=8,t++,r[8]++;for(F(S,h+1,r),t=0;t<u;t++)T[2*t+1]=5,T[2*t]=L(t,5);B=new D(S,A,l+1,h,f),_=new D(T,C,0,u,f),O=new D(new Array(0),x,0,d,m)}(),Z=!0),t.l_desc=new M(t.dyn_ltree,B),t.d_desc=new M(t.dyn_dtree,_),t.bl_desc=new M(t.bl_tree,O),t.bi_buf=0,t.bi_valid=0,z(t)},i._tr_stored_block=Y,i._tr_flush_block=function(t,e,i,s){var a,o,c=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return n;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return r;for(e=32;e<l;e++)if(0!==t.dyn_ltree[2*e])return r;return n}(t)),J(t,t.l_desc),J(t,t.d_desc),c=function(t){var e;for(G(t,t.dyn_ltree,t.l_desc.max_code),G(t,t.dyn_dtree,t.d_desc.max_code),J(t,t.bl_desc),e=d-1;3<=e&&0===t.bl_tree[2*k[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),a=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=a&&(a=o)):a=o=i+5,i+4<=a&&-1!==e?Y(t,e,i,s):4===t.strategy||o===a?(j(t,2+(s?1:0),3),W(t,S,T)):(j(t,4+(s?1:0),3),function(t,e,i,s){var n;for(j(t,e-257,5),j(t,i-1,5),j(t,s-4,4),n=0;n<s;n++)j(t,t.bl_tree[2*k[n]+1],3);K(t,t.dyn_ltree,e-1),K(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,c+1),W(t,t.dyn_ltree,t.dyn_dtree)),z(t),s&&U(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(P[i]+l+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){j(t,2,3),q(t,v,S),function(t){16===t.bi_valid?(V(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,s){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var i,s,n,r,a=1,o={},c=!1,l=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,i="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(s=l.documentElement,function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,s.removeChild(e),e=null},s.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),s=0;s<e.length;s++)e[s]=arguments[s+1];var n={callback:t,args:e};return o[a]=n,i(a),a++},h.clearImmediate=u}function u(t){delete o[t]}function d(t){if(c)setTimeout(d,0,t);else{var i=o[t];if(i){c=!0;try{!function(t){var i=t.callback,s=t.args;switch(s.length){case 0:i();break;case 1:i(s[0]);break;case 2:i(s[0],s[1]);break;case 3:i(s[0],s[1],s[2]);break;default:i.apply(e,s)}}(i)}finally{u(t),c=!1}}}}function p(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&d(+e.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},924:t=>{t.exports=function(){function t(e,i,s){function n(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[a]={exports:{}};e[a][0].call(l.exports,(function(t){return n(e[a][1][t]||t)}),l,l.exports,t,e,i,s)}return i[a].exports}for(var r=void 0,a=0;a<s.length;a++)n(s[a]);return n}return t}()({1:[function(t,e,i){function s(t){const e=t.createGain(),i=e._voltage=a(t),s=o(i),r=o(i),c=o(i);return e._startAmount=o(r),e._endAmount=o(c),e._multiplier=o(s),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=s.gain,e.startValue=r.gain,e.endValue=c.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,n),e}const n={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(t){const e=this._multiplier.gain,i=this._startAmount.gain,s=this._endAmount.gain;this._voltage.start(t),this._decayFrom=this._decayFrom=t+this.attack,this._startedAt=t;const n=this.sustain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),s.cancelScheduledValues(t),s.setValueAtTime(0,t),this.attack?(e.setValueAtTime(0,t),e.linearRampToValueAtTime(1,t+this.attack),i.setValueAtTime(1,t),i.linearRampToValueAtTime(0,t+this.attack)):(e.setValueAtTime(1,t),i.setValueAtTime(0,t)),this.decay&&e.setTargetAtTime(n,this._decayFrom,c(this.decay))}},stop:{value:function(t,e){e&&(t-=this.release);const i=t+this.release;if(this.release){const e=this._multiplier.gain,i=this._startAmount.gain,s=this._endAmount.gain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),s.cancelScheduledValues(t);const n=c(this.release);if(this.attack&&t<this._decayFrom){const s=l(0,1,this._startedAt,this._decayFrom,t);e.linearRampToValueAtTime(s,t),i.linearRampToValueAtTime(1-s,t),i.setTargetAtTime(0,t,n)}s.setTargetAtTime(1,t,n),e.setTargetAtTime(0,t,n)}return this._voltage.stop(i),i}},onended:{get:function(){return this._voltage.onended},set:function(t){this._voltage.onended=t}}},r=new Float32Array([1,1]);function a(t){const e=t.createBufferSource(),i=t.createBuffer(1,2,t.sampleRate);return i.getChannelData(0).set(r),e.buffer=i,e.loop=!0,e}function o(t){const e=t.context.createGain();return t.connect(e),e}function c(t){return Math.log(t+1)/Math.log(100)}function l(t,e,i,s,n){let r=t+(n-i)/(s-i)*(e-t);return r<=t&&(r=t),r>=e&&(r=e),r}e.exports=s},{}],2:[function(t,e,i){"use strict";function s(t){return t>64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:43===t?62:47===t?63:0}function n(t,e){const i=t.replace(/[^A-Za-z0-9\+\/]/g,""),n=i.length,r=e?Math.ceil((3*n+1>>2)/e)*e:3*n+1>>2,a=new Uint8Array(r);for(let t,e,o=0,c=0,l=0;l<n;l++)if(e=3&l,o|=s(i.charCodeAt(l))<<18-6*e,3===e||n-l==1){for(t=0;t<3&&c<r;t++,c++)a[c]=o>>>(16>>>t&24)&255;o=0}return a}e.exports={decode:n}},{}],3:[function(t,e,i){"use strict";e.exports=function(t,e){return new Promise((function(i,s){const n=new XMLHttpRequest;e&&(n.responseType=e),n.open("GET",t),n.onload=function(){200===n.status&&i(n.response),s(Error(n.statusText))},n.onerror=()=>s(Error("Network Error")),n.send()}))}},{}],4:[function(t,e,i){"use strict";const s=t("./base64"),n=t("./fetch");function r(t){return function(e){return"string"==typeof e&&t.test(e)}}function a(t,e){return"string"==typeof t?t+e:"function"==typeof t?t(e):e}function o(t,e,i,s){const n=c(e)?l:h(e)?u:d(e)?p:f(e)?g:m(e)?v:b(e)?y:w(e)?A:C(e)?x:null;return n?n(t,e,i||{}):s?Promise.resolve(s):Promise.reject(`Source not valid (${e})`)}function c(t){return t instanceof ArrayBuffer}function l(t,e,i){return new Promise((function(i,s){t.decodeAudioData(e,(function(t){i(t)}),(function(){s(`Can't decode audio data (${e.slice(0,30)}...)`)}))}))}o.fetch=n;const h=r(/\.(mp3|wav|ogg)(\?.*)?$/i);function u(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"arraybuffer"),i)}function d(t){return t&&"function"==typeof t.then}function p(t,e,i){return e.then((function(e){return o(t,e,i)}))}const f=Array.isArray;function g(t,e,i){return Promise.all(e.map((e=>o(t,e,i,e))))}function m(t){return t&&"object"==typeof t}function v(t,e,i){const s={},n=Object.keys(e).map((function(n){if(i.only&&-1===i.only.indexOf(n))return null;const r=e[n];return o(t,r,i,r).then((t=>{s[n]=t}))}));return Promise.all(n).then((()=>s))}const b=r(/\.json(\?.*)?$/i);function y(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"text").then(JSON.parse),i)}const w=r(/^data:audio/);function A(t,e,i){const n=e.indexOf(",");return o(t,s.decode(e.slice(n+1)).buffer,i)}const C=r(/\.js(\?.*)?$/i);function x(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"text").then(k),i)}function k(t){let e=t.indexOf("MIDI.Soundfont.");if(e<0)throw Error("Invalid MIDI.js Soundfont format");e=t.indexOf("=",e)+2;const i=t.lastIndexOf(",");return JSON.parse(t.slice(e,i)+"}")}e.exports={load:o}},{"./base64":2,"./fetch":3}],5:[function(t,e,i){const s={VERSION:"2.0.4",NOTES:[],CIRCLE_OF_FOURTHS:["C","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","Bbb","Ebb","Abb"],CIRCLE_OF_FIFTHS:["C","G","D","A","E","B","F#","C#","G#","D#","A#","E#"]},n=[["C"],["C#","Db"],["D"],["D#","Eb"],["E"],["F"],["F#","Gb"],["G"],["G#","Ab"],["A"],["A#","Bb"],["B"]];let r=0;for(let t=-1;t<=9;t++)n.forEach((e=>{e.forEach((e=>s.NOTES[r]=e+t)),r++}));e.exports.Constants=s},{}],6:[function(t,e,i){const s=t("./player"),n=t("./soundfont-player/index");e.exports={Player:s.Player,Soundfont:n.Soundfont}},{"./player":8,"./soundfont-player/index":14}],7:[function(t,e,i){"use strict";const s=(t,e)=>Array(e+1).join(t),n=t=>"number"==typeof t,r=t=>"string"==typeof t,a=t=>void 0!==t,o=(t,e)=>Math.pow(2,(t-69)/12)*(e||440),c=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function l(){return c}const h=[0,2,4,5,7,9,11];function u(t,e,i){if("string"!=typeof t)return null;const s=c.exec(t);if(!s||!e&&s[4])return null;const n={letter:s[1].toUpperCase(),acc:s[2].replace(/x/g,"##")};n.pc=n.letter+n.acc,n.step=(n.letter.charCodeAt(0)+3)%7,n.alt="b"===n.acc[0]?-n.acc.length:n.acc.length;const r=h[n.step]+n.alt;return n.chroma=r<0?12+r:r%12,s[3]&&(n.oct=+s[3],n.midi=r+12*(n.oct+1),n.freq=o(n.midi,i)),e&&(n.tonicOf=s[4]),n}const d="CDEFGAB",p=t=>n(t)?t<0?s("b",-t):s("#",t):"",f=t=>n(t)?""+t:"";function g(t,e,i){return null==t?null:t.step?g(t.step,t.alt,t.oct):t<0||t>6?null:d.charAt(t)+p(e)+f(i)}function m(t){if((n(t)||r(t))&&t>=0&&t<128)return+t;const e=u(t);return e&&a(e.midi)?e.midi:null}function v(t,e){const i=m(t);return null===i?null:o(i,e)}const b=t=>(u(t)||{}).letter,y=t=>(u(t)||{}).acc,w=t=>(u(t)||{}).pc,A=t=>(u(t)||{}).step,C=t=>(u(t)||{}).alt,x=t=>(u(t)||{}).chroma,k=t=>(u(t)||{}).oct;e.exports={regex:l,parse:u,build:g,midi:m,freq:v,letter:b,acc:y,pc:w,step:A,alt:C,chroma:x,oct:k}},{}],8:[function(t,e,i){const s=t("./utils").Utils,n=t("./track").Track;Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach});class r{constructor(t,e){this.sampleRate=5,this.startTime=0,this.buffer=e||null,this.division,this.format,this.setIntervalId=!1,this.tracks=[],this.instruments=[],this.defaultTempo=120,this.tempo=null,this.startTick=0,this.tick=0,this.lastTick=null,this.inLoop=!1,this.totalTicks=0,this.events=[],this.totalEvents=0,this.eventListeners={},"function"==typeof t&&this.on("midiEvent",t)}loadFile(e){const i=t("fs");return this.buffer=i.readFileSync(e),this.fileLoaded()}loadArrayBuffer(t){return this.buffer=new Uint8Array(t),this.fileLoaded()}loadDataUri(t){const e=window.atob(t.split(",")[1]),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return this.buffer=i,this.fileLoaded()}getFilesize(){return this.buffer?this.buffer.length:0}fileLoaded(){if(!this.validate())throw"Invalid MIDI file; should start with MThd";return this.setTempo(this.defaultTempo).getDivision().getFormat().getTracks().dryRun()}validate(){return"MThd"===s.bytesToLetters(this.buffer.subarray(0,4))}getFormat(){return this.format=s.bytesToNumber(this.buffer.subarray(8,10)),this}getTracks(){this.tracks=[];let t=0;for(;t<this.buffer.length;){if("MTrk"==s.bytesToLetters(this.buffer.subarray(t,t+4))){let e=s.bytesToNumber(this.buffer.subarray(t+4,t+8));this.tracks.push(new n(this.tracks.length,this.buffer.subarray(t+8,t+8+e)))}t+=s.bytesToNumber(this.buffer.subarray(t+4,t+8))+8}return this}enableTrack(t){return this.tracks[t-1].enable(),this}disableTrack(t){return this.tracks[t-1].disable(),this}getDivision(){return this.division=s.bytesToNumber(this.buffer.subarray(12,14)),this}playLoop(t){this.inLoop||(this.inLoop=!0,this.tick=this.getCurrentTick(),this.tracks.forEach((function(e){if(!t&&this.endOfFile())this.triggerPlayerEvent("endOfFile"),this.stop();else{let i=e.handleEvent(this.tick,t);t&&i?(i.hasOwnProperty("name")&&"Set Tempo"===i.name&&this.setTempo(i.data),i.hasOwnProperty("name")&&"Program Change"===i.name&&(this.instruments.includes(i.value)||this.instruments.push(i.value))):i&&this.emitEvent(i)}}),this),t||this.triggerPlayerEvent("playing",{tick:this.tick}),this.inLoop=!1)}setTempo(t){return this.tempo=t,this}setStartTime(t){this.startTime=t}play(){if(this.isPlaying())throw"Already playing...";return this.startTime||(this.startTime=(new Date).getTime()),this.setIntervalId=window.setInterval(this.playLoop.bind(this),this.sampleRate),this}pause(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=this.tick,this.startTime=0,this}stop(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=0,this.startTime=0,this.resetTracks(),this}skipToTick(t){return this.stop(),this.startTick=t,this.tracks.forEach((function(e){e.setEventIndexByTick(t)})),this}skipToPercent(t){if(t<0||t>100)throw"Percent must be number between 1 and 100.";return this.skipToTick(Math.round(t/100*this.totalTicks)),this}skipToSeconds(t){const e=this.getSongTime();if(t<0||t>e)throw`${t} seconds not within song time of ${e}`;return this.skipToPercent(t/e*100),this}isPlaying(){return this.setIntervalId>0||"object"==typeof this.setIntervalId}dryRun(){for(this.resetTracks();!this.endOfFile();)this.playLoop(!0);return this.events=this.getEvents(),this.totalEvents=this.getTotalEvents(),this.totalTicks=this.getTotalTicks(),this.startTick=0,this.startTime=0,this.resetTracks(),this.triggerPlayerEvent("fileLoaded",this),this}resetTracks(){return this.tracks.forEach((t=>t.reset())),this}getEvents(){return this.tracks.map((t=>t.events))}getTotalTicks(){return Math.max.apply(null,this.tracks.map((t=>t.delta)))}getTotalEvents(){return this.tracks.reduce(((t,e)=>({events:{length:t.events.length+e.events.length}})),{events:{length:0}}).events.length}getSongTime(){return this.totalTicks/this.division/this.tempo*60}getSongTimeRemaining(){return Math.round((this.totalTicks-this.tick)/this.division/this.tempo*60)}getSongPercentRemaining(){return Math.round(this.getSongTimeRemaining()/this.getSongTime()*100)}bytesProcessed(){return 14+8*this.tracks.length+this.tracks.reduce(((t,e)=>({pointer:t.pointer+e.pointer})),{pointer:0}).pointer}eventsPlayed(){return this.tracks.reduce(((t,e)=>({eventIndex:t.eventIndex+e.eventIndex})),{eventIndex:0}).eventIndex}endOfFile(){return this.isPlaying()?this.eventsPlayed()==this.totalEvents:this.bytesProcessed()==this.buffer.length}getCurrentTick(){return Math.round(((new Date).getTime()-this.startTime)/1e3*(this.division*(this.tempo/60)))+this.startTick}emitEvent(t){return this.triggerPlayerEvent("midiEvent",t),this}on(t,e){return this.eventListeners.hasOwnProperty(t)||(this.eventListeners[t]=[]),this.eventListeners[t].push(e),this}triggerPlayerEvent(t,e){return this.eventListeners.hasOwnProperty(t)&&this.eventListeners[t].forEach((t=>t(e||{}))),this}}e.exports={Player:r}},{"./track":15,"./utils":16,fs:void 0}],9:[function(t,e,i){function s(t,e){return function(i,s,n,r){t(i,s,n,r),e(i,s,n,r)}}e.exports=function(t){return t.on=function(e,i){if(1===arguments.length&&"function"==typeof e)return t.on("event",e);var n="on"+e,r=t[n];return t[n]=r?s(r,i):i,t},t}},{}],10:[function(t,e,i){"use strict";const s=t("./player"),n=t("./events"),r=t("./notes"),a=t("./scheduler");function o(t,e,i){return a(r(n(s(t,e,i))))}e.exports={SamplePlayer:o}},{"./events":9,"./notes":11,"./player":12,"./scheduler":13}],11:[function(t,e,i){"use strict";var s=t("../note-parser/index"),n=function(t){return null!==t&&t!==[]&&t>=0&&t<129},r=function(t){return n(t)?+t:s.midi(t)};function a(t,e){return Object.keys(t).reduce((function(i,s){return i[e(s)]=t[s],i}),{})}e.exports=function(t){if(t.buffers){var e=t.opts.map,i="function"==typeof e?e:r,s=function(t){return t?i(t)||t:null};t.buffers=a(t.buffers,s);var n=t.start;t.start=function(t,e,i){var r=s(t),a=r%1;return a&&(r=Math.floor(r),i=Object.assign(i||{},{cents:Math.floor(100*a)})),n(r,e,i)}}return t}},{"../note-parser/index":7}],12:[function(t,e,i){"use strict";const s=t("../adsr/index"),n={},r={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function a(t,e,i){let s=!1,a=0,o={};const c=t.createGain();c.gain.value=1;const u=Object.assign({},r,i),d={context:t,out:c,opts:u};return e instanceof AudioBuffer?d.buffer=e:d.buffers=e,d.start=function(e,i,r){if(d.buffer&&null!==e)return d.start(null,e,i);var a=e?d.buffers[e]:d.buffer;if(!a)return void console.warn(`Buffer ${e} not found.`);if(!s)return void console.warn("SamplePlayer not connected to any node.");const o=r||n;i=Math.max(t.currentTime,i||0),d.emit("start",i,e,o);var c=f(e,a,o);return c.id=p(e,c),c.env.start(i),c.source.start(i),d.emit("started",i,c.id,c),o.duration&&c.stop(i+o.duration),c},d.play=function(t,e,i){return d.start(t,e,i)},d.stop=function(t,e){return(e=e||Object.keys(o)).map((function(e){const i=o[e];return i?(i.stop(t),i.id):null}))},d.connect=function(t){return s=!0,c.connect(t),d},d.emit=function(t,e,i,s){d.onevent&&d.onevent(t,e,i,s);const n=d["on"+t];n&&n(e,i,s)},d;function p(e,i){return i.id=a++,o[i.id]=i,i.source.onended=function(){const e=t.currentTime;i.source.disconnect(),i.env.disconnect(),i.disconnect(),d.emit("ended",e,i.id,i)},i.id}function f(e,i,s){const n=t.createGain();return n.gain.value=0,n.connect(c),n.env=l(t,s,u),n.env.connect(n.gain),n.source=t.createBufferSource(),n.source.buffer=i,n.source.connect(n),n.source.loop=s.loop||u.loop,n.source.playbackRate.value=h(s.cents||u.cents),n.source.loopStart=s.loopStart||u.loopStart,n.source.loopEnd=s.loopEnd||u.loopEnd,n.stop=function(i){const s=i||t.currentTime;d.emit("stop",s,e);const r=n.env.stop(s);n.source.stop(r)},n}}function o(t){return"number"==typeof t}const c=["attack","decay","sustain","release"];function l(t,e,i){const n=s(t),r=e.adsr||i.adsr;return c.forEach((function(t,s){n[t]=r?r[s]:e[t]||i[t]})),n.value.value=o(e.gain)?e.gain:o(i.gain)?i.gain:1,n}function h(t){return t?Math.pow(2,t/1200):1}e.exports=a},{"../adsr/index":1}],13:[function(t,e,i){"use strict";var s=Array.isArray,n=function(t){return t&&"object"==typeof t},r={};e.exports=function(t){return t.schedule=function(e,i){var a,o,c,l,h=t.context.currentTime,u=e<h?h:e;return t.emit("schedule",u,i),i.map((function(e){return e?(s(e)?(a=e[0],o=e[1]):(a=e.time,o=e),n(o)?(c=o.name||o.key||o.note||o.midi||null,l=o):(c=o,l=r),t.start(c,u+(a||0),l)):null}))},t}},{}],14:[function(t,e,i){"use strict";const s=t("../audio-loader/index").load,n=t("../sample-player/index").SamplePlayer;function r(t,e,i={}){if(1===arguments.length)return function(e,i){return r(t,e,i)};let c="",l="";if("string"==typeof e){c=e;const t=i.isSoundfontURL||a,s=i.nameToUrl||o;l=t(e)?e:s(e,i.soundfont,i.format),e=l}return s(t,e,{only:i.only||i.notes}).then((e=>{const s=n(t,e,i).connect(i.destination?i.destination:t.destination);return s.url=l,s.name=c,s}))}function a(t){return/\.js(\?.*)?$/i.test(t)}function o(t,e,i){return"https://gleitz.github.io/midi-js-soundfonts/"+(e="FluidR3_GM"===e?e:"MusyngKite")+"/"+t+"-"+(i="ogg"===i?i:"mp3")+".js"}const c={instrument:r,nameToUrl:o};e.exports={Soundfont:c}},{"../audio-loader/index":4,"../sample-player/index":10}],15:[function(t,e,i){const s=t("./constants").Constants,n=t("./utils").Utils;class r{constructor(t,e){this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.index=t,this.data=e,this.delta=0,this.runningDelta=0,this.events=[]}reset(){return this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.delta=0,this.runningDelta=0,this}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}setEventIndexByTick(t){t=t||0;for(let e in this.events)if(this.events[e].tick>=t)return this.eventIndex=e,this}getCurrentByte(){return this.data[this.pointer]}getDeltaByteCount(){let t=this.getCurrentByte(),e=1;for(;t>=128;)t=this.data[this.pointer+e],e++;return e}getDelta(){return n.readVarInt(this.data.subarray(this.pointer,this.pointer+this.getDeltaByteCount()))}handleEvent(t,e){if(e=e||!1){const i=t-this.lastTick>=this.getDelta();if(this.pointer<this.data.length&&(e||i)){const t=this.parseEvent();if(this.enabled)return t}}else if(this.events[this.eventIndex]&&this.events[this.eventIndex].tick<=t&&(this.eventIndex++,this.enabled))return this.events[this.eventIndex-1];return null}getStringData(t){const e=1,i=n.readVarInt(this.data.subarray(t+2,t+2+e));return n.bytesToLetters(this.data.subarray(t+e+2,t+e+i+2))}parseEvent(){const t=this.pointer+this.getDeltaByteCount(),e={},i=this.getDeltaByteCount();if(e.track=this.index+1,e.delta=this.getDelta(),this.lastTick=this.lastTick+e.delta,this.runningDelta+=e.delta,e.tick=this.runningDelta,e.byteIndex=this.pointer,255==this.data[t]){switch(this.data[t+1]){case 0:e.name="Sequence Number";break;case 1:e.name="Text Event",e.string=this.getStringData(t);break;case 2:e.name="Copyright Notice";break;case 3:e.name="Sequence/Track Name",e.string=this.getStringData(t);break;case 4:e.name="Instrument Name",e.string=this.getStringData(t);break;case 5:e.name="Lyric",e.string=this.getStringData(t);break;case 6:e.name="Marker";break;case 7:e.name="Cue Point",e.string=this.getStringData(t);break;case 9:e.name="Device Name",e.string=this.getStringData(t);break;case 32:e.name="MIDI Channel Prefix";break;case 33:e.name="MIDI Port",e.data=n.bytesToNumber([this.data[t+3]]);break;case 47:e.name="End of Track";break;case 81:e.name="Set Tempo",e.data=Math.round(6e7/n.bytesToNumber(this.data.subarray(t+3,t+6))),this.tempo=e.data;break;case 84:e.name="SMTPE Offset";break;case 88:e.name="Time Signature",e.data=this.data.subarray(t+3,t+7),e.timeSignature=e.data[0]+"/"+Math.pow(2,e.data[1]);break;case 89:e.name="Key Signature",e.data=this.data.subarray(t+3,t+5),e.data[0]>=0?e.keySignature=s.CIRCLE_OF_FIFTHS[e.data[0]]:e.data[0]<0&&(e.keySignature=s.CIRCLE_OF_FOURTHS[Math.abs(e.data[0])]),0==e.data[1]?e.keySignature+=" Major":1==e.data[1]&&(e.keySignature+=" Minor");break;case 127:e.name="Sequencer-Specific Meta-event";break;default:e.name=`Unknown: ${this.data[t+1].toString(16)}`}const r=this.data[this.pointer+i+2];this.pointer+=i+3+r}else if(240==this.data[t]){e.name="Sysex";const t=this.data[this.pointer+i+1];this.pointer+=i+2+t}else this.data[t]<128?(e.running=!0,e.noteNumber=this.data[t],e.noteName=s.NOTES[this.data[t]],e.velocity=this.data[t+1],this.lastStatus<=143?(e.name="Note off",e.channel=this.lastStatus-128+1):this.lastStatus<=159&&(e.name="Note on",e.channel=this.lastStatus-144+1),this.pointer+=i+2):(this.lastStatus=this.data[t],this.data[t]<=143?(e.name="Note off",e.channel=this.lastStatus-128+1,e.noteNumber=this.data[t+1],e.noteName=s.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=i+3):this.data[t]<=159?(e.name="Note on",e.channel=this.lastStatus-144+1,e.noteNumber=this.data[t+1],e.noteName=s.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=i+3):this.data[t]<=175?(e.name="Polyphonic Key Pressure",e.channel=this.lastStatus-160+1,e.note=s.NOTES[this.data[t+1]],e.pressure=event[2],this.pointer+=i+3):this.data[t]<=191?(e.name="Controller Change",e.channel=this.lastStatus-176+1,e.number=this.data[t+1],e.value=this.data[t+2],this.pointer+=i+3):this.data[t]<=207?(e.name="Program Change",e.channel=this.lastStatus-192+1,e.value=this.data[t+1],this.pointer+=i+2):this.data[t]<=223?(e.name="Channel Key Pressure",e.channel=this.lastStatus-208+1,this.pointer+=i+2):this.data[t]<=239?(e.name="Pitch Bend",e.channel=this.lastStatus-224+1,this.pointer+=i+3):e.name=`Unknown. Pointer: ${this.pointer.toString()} ${t.toString()} ${this.data.length}`);return this.delta+=e.delta,this.events.push(e),e}endOfTrack(){return 255==this.data[this.pointer+1]&&47==this.data[this.pointer+2]&&0==this.data[this.pointer+3]}}e.exports={Track:r}},{"./constants":5,"./utils":16}],16:[function(t,e,i){class s{static byteToHex(t){return`0${t.toString(16)}`.slice(-2)}static bytesToHex(t){const e=[];return t.forEach((t=>e.push(s.byteToHex(t)))),e.join("")}static hexToNumber(t){return parseInt(t,16)}static bytesToNumber(t){return s.hexToNumber(s.bytesToHex(t))}static bytesToLetters(t){const e=[];return t.forEach((t=>e.push(String.fromCharCode(t)))),e.join("")}static decToBinary(t){return(t>>>0).toString(2)}static readVarInt(t){let e=0;return t.forEach((t=>{128&t?(e+=127&t,e<<=7):e+=t})),e}}e.exports={Utils:s}},{}]},{},[6])(6)}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(692),e=i.n(t),s=i(710),n=i.n(s),r=i(9),a=i.n(r);const o={version:"2.1.26 (2025-10-19)",languages:["en","ar","ast","bs","ca","ca_ES@valencia","cs","da","de","el","es","eu","fr","gl","he","hr","it","ja","nb_NO","nl","pl","pt","pt_BR","ro","ru","ta","tr","uk","vec","zh_TW"],messages:{ar:{Version:"الإصدار",time:"الوقت",actions:"المحاولات",score:"النتيجة","Next activity":"النشاط التالي","Previous activity":"النشاط السابق","Restart activity":"استئنف النشاط",Information:"المعلومة","Results are not currently being saved":"Results are not currently being saved","Current results":"تقارير المستخدم","Session started:":"Session started:","Reports system:":"Reports system:","User:":"المستخدم:","Projects:":"المشاريع:","Sequences:":"التسلسل","Activities done:":"Activities done:","Activities solved:":"Activities solved:","Global score:":"Global score:","(out of all project activities)":"(out of all project activities)","Total time in activities:":"Total time in activities:","Actions done:":"المحاولات","No activities done!":"No activities done!",Project:"المشروع:",sequence:"التسلسل",activity:"النشاط",OK:"موافق",YES:"YES",NO:"NO","Total:":"المجموع:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Partial score:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Activities played at least once:",Reports:"Reports","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"النشاط",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ast:{Version:"Versión",time:"tiempu",actions:"aiciones",score:"puntuación","Next activity":"Xera siguiente","Previous activity":"Xera previa","Restart activity":"Reaniciar xera",Information:"Información","Results are not currently being saved":"Anguaño los resultaos nun tán guardándose","Current results":"Resultaos actuales","Session started:":"Entamu de sesión:","Reports system:":"Sistema d'informes:","User:":"Usuariu:","Projects:":"Proyeutos:","Sequences:":"Secuencies:","Activities done:":"Xeres feches:","Activities solved:":"Xeres correutes:","Global score:":"Puntuación global:","(out of all project activities)":"Tiempu total en xeres:","Total time in activities:":"Tiempu total en xeres:","Actions done:":"Aiciones feches:","No activities done!":"¡Nun se fexo xera dala!",Project:"Proyeutu",sequence:"Secuencia",activity:"xera",OK:"Aceutar",YES:"SÍ",NO:"NON","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Puntuación global:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Xeres feches:",Reports:"Sistema d'informes:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Xeres feches:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},bs:{Version:"Verzija",time:"vrijeme",actions:"pokušaji",score:"rezultat","Next activity":"Sljedeća aktivnost","Previous activity":"Prethodna aktivnost","Restart activity":"Ponovno pokreni aktivnost",Information:"Informacije","Results are not currently being saved":"Results are not currently being saved","Current results":"Izvješća korisnika","Session started:":"Sesija započeta:","Reports system:":"Reports system:","User:":"Korisnik:","Projects:":"Projekti:","Sequences:":"Sekvenca","Activities done:":"Urađene aktivnosti:","Activities solved:":"Aktivnosti ok:","Global score:":"Ukupan rezultat:","(out of all project activities)":"Ukupno vrijeme aktivnosti:","Total time in activities:":"Ukupno vrijeme aktivnosti:","Actions done:":"Urađene aktivnosti:","No activities done!":"Urađene aktivnosti:",Project:"Projekt:",sequence:"Sekvenca",activity:"Aktivnost",OK:"Uredu",YES:"DA",NO:"NE","Total:":"Ukupno:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Ukupan rezultat:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Urađene aktivnosti:",Reports:"Reports","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Urađene aktivnosti:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ca:{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan desant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","(out of all project activities)":"(sobre totes les activitats del projecte)","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:","Select group:":"Seleccioneu el grup:","Select user:":"Seleccioneu l'usuari:",Cancel:"Cancel·la",Close:"Tanca","Copy data to clipboard":"Copia les dades al porta-retalls","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les dades s'han copiat en format HTML. Enganxeu-les a un full de càlcul o a un editor de text enriquit","The data has been copied to clipboard":"Les dades s'han copiat al porta-retalls","not connected":"no connectat","Please wait until the results of your activities are sent to the reports system":"Si us plau, espereu a que els resultats de les vostres activitats s'enviïn al servidor d'informes","Password:":"Contrasenya:","Incorrect password":"Contrasenya incorrecta","Invalid user":"Usuari/ària incorrecte","Partial score:":"Puntuació parcial:","(out of played activities)":"(sobre les activitats fetes)","Activities played at least once:":"Activitats fetes almenys una vegada:",Reports:"Informes","Toggle full screen":"Commuta pantalla completa","JClic logo":"Logotip del JClic",message:"missatge","Activity panel":"Tauler d'activitats",cell:"cel·la",image:"imatge",source:"origen",target:"destí","image fragment":"fragment d'imatge"},"ca_ES@valencia":{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan alçant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","(out of all project activities)":"(sobre totes les activitats del projecte)","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:","Select group:":"Seleccioneu el grup:","Select user:":"Seleccioneu l'usuari:",Cancel:"Cancel·la",Close:"Ix","Copy data to clipboard":"Copia les dades al porta-retalls","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les dades s'han copiat en format HTML. Enganxeu-les a un full de càlcul o a un editor de text enriquit","The data has been copied to clipboard":"Les dades s'han copiat al porta-retalls","not connected":"no connectat","Please wait until the results of your activities are sent to the reports system":"Espereu a que els resultats de les vostres activitats s'enviïn al servidor d'informes","Password:":"Contrasenya:","Incorrect password":"Contrasenya incorrecta","Invalid user":"Usuari/ària incorrecte","Partial score:":"Puntuació parcial:","(out of played activities)":"(sobre les activitats fetes)","Activities played at least once:":"Activitats fetes almenys una vegada:",Reports:"Informes","Toggle full screen":"Commuta pantalla completa","JClic logo":"Logotip del JClic",message:"missatge","Activity panel":"Tauler d'activitats",cell:"cel·la",image:"imatge",source:"origen",target:"destí","image fragment":"fragment d'imatge"},cs:{Version:"Verze",time:"čas",actions:"pokusů",score:"skóre","Next activity":"Další aktivita","Previous activity":"Předchozí aktivita","Restart activity":"Restartovat aktivitu",Information:"Informace","Results are not currently being saved":"Zpráva není zaregistrována v žádné DB","Current results":"Uživatelská sestava","Session started:":"Sezení spuštěno:","Reports system:":"Systém zprávy:","User:":"Uživatel:","Projects:":"Projekty:","Sequences:":"Sekvence:","Activities done:":"Dokončené aktivity:","Activities solved:":"Aktivity ok:","Global score:":"Celkové skóre:","(out of all project activities)":"Celkový čas aktivit:","Total time in activities:":"Celkový čas aktivit:","Actions done:":"Provedené akce:","No activities done!":"Nebyly nahlášeny žádné aktivity!",Project:"Projekt",sequence:"Sekvence",activity:"Aktivita",OK:"Ok",YES:"ANO",NO:"NE","Total:":"Celkem:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Celkové skóre:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Dokončené aktivity:",Reports:"Systém zprávy:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Dokončené aktivity:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},da:{Version:"Version",time:"tid",actions:"forsøg",score:"score","Next activity":"Næste aktivitet","Previous activity":"Forrige aktivitet","Restart activity":"Genstart aktivitet",Information:"Information","Results are not currently being saved":"Results are not currently being saved","Current results":"Bruger rapport","Session started:":"Session started:","Reports system:":"Reports system:","User:":"Bruger:","Projects:":"Projekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter udført:","Activities solved:":"Aktiviteter OK:","Global score:":"Global score:","(out of all project activities)":"(out of all project activities)","Total time in activities:":"Total time in activities:","Actions done:":"Aktiviteter udført:","No activities done!":"Ingen aktiviteter rapporteret!",Project:"Projekt",sequence:"Sequence",activity:"Aktivitet",OK:"Ok",YES:"JA",NO:"IKKE","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Global score:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Aktiviteter udført:",Reports:"Reports","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Aktiviteter udført:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},de:{Version:"Version",time:"Zeit",actions:"Versuche",score:"Ergebnis","Next activity":"Nächste Übung","Previous activity":"Vorherige Übung","Restart activity":"Übung neu starten",Information:"Informationen","Results are not currently being saved":"Bericht in keiner Datenbank eingetragen","Current results":"Benutzerberichte","Session started:":"Sitzung gestartet:","Reports system:":"Report system:","User:":"Benutzer:","Projects:":"Projekte:","Sequences:":"Sequenzen:","Activities done:":"Beendete Übungen:","Activities solved:":"Korrekte Übungen:","Global score:":"Gesamtpunktezahl:","(out of all project activities)":"Übungs-Gesamtzeit:","Total time in activities:":"Übungs-Gesamtzeit:","Actions done:":"Durchgeführte Aktionen:","No activities done!":"Keine Übungsberichte vorhanden!",Project:"Projekt",sequence:"Sequenz",activity:"Übung",OK:"OK",YES:"JA",NO:"NEIN","Total:":"Gesamt:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Gesamtpunktezahl:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Beendete Übungen:",Reports:"Report system:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Beendete Übungen:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},el:{Version:"Έκδοση",time:"χρόνος",actions:"προσπάθειες",score:"βαθμολογία","Next activity":"Επόμενη δραστηριότητα","Previous activity":"Προηγούμενη δραστηριότητα","Restart activity":"Επανεκκίνηση δραστηριότητας",Information:"Πληροφορίες","Results are not currently being saved":"Η αναφορά δεν εγγράφηκε στις βάσεις δεδομένων","Current results":"Αναφορές χρήστη","Session started:":"Έναρξη συνεδρίας:","Reports system:":"Σύστημα αναφορών:","User:":"Χρήστης:","Projects:":"Έργα:","Sequences:":"Αλληλουχίες:","Activities done:":"Ολοκληρωμένες δραστηριότητες:","Activities solved:":"Δραστηριότητες, εντάξει:","Global score:":"Συνολική βαθμολογία:","(out of all project activities)":"Συνολικός χρόνος δραστηριοτήτων:","Total time in activities:":"Συνολικός χρόνος δραστηριοτήτων:","Actions done:":"Οι ενέργειες ολοκληρώθηκαν:","No activities done!":"Για καμμία δραστηριότητα δεν έχει υποβληθεί αναφορά!",Project:"Έργο",sequence:"Αλληλουχία",activity:"Δραστηριότητα",OK:"Εντάξει",YES:"Ναί",NO:"όχι","Total:":"Σύνολο:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Συνολική βαθμολογία:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Ολοκληρωμένες δραστηριότητες:",Reports:"Σύστημα αναφορών:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Ολοκληρωμένες δραστηριότητες:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},es:{Version:"Versión",time:"tiempo",actions:"acciones",score:"aciertos","Next activity":"Actividad siguiente","Previous activity":"Actividad anterior","Restart activity":"Reiniciar actividad",Information:"Información","Results are not currently being saved":"Los resultados no se están guardando","Current results":"Resultados actuales","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario:","Projects:":"Proyectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades resueltas:","Global score:":"Puntuación global:","(out of all project activities)":"(sobre todas las actividades del proyecto)","Total time in activities:":"Tiempo total en las actividades:","Actions done:":"Acciones realizadas:","No activities done!":"¡No se ha realizado ninguna actividad!",Project:"Proyecto",sequence:"secuencia",activity:"actividad",OK:"OK",YES:"SI",NO:"NO","Total:":"Totales:","Select group:":"Seleccionar grupo:","Select user:":"Seleccionar usuario:",Cancel:"Cancelar",Close:"Cerrar","Copy data to clipboard":"Copiar datos al portapapeles","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Los datos se han copiado en formato HTML. Puedes pegarlos en una hoja de cálculo o en un editor de texto enriquecido","The data has been copied to clipboard":"Los datos se han copiado al portapapeles","not connected":"no conectado","Please wait until the results of your activities are sent to the reports system":"Por favor, espera mientras los resultados de las actividades se envian al servidor de informes","Password:":"Contraseña:","Incorrect password":"Contraseña incorrecta","Invalid user":"Usuario incorrecto","Partial score:":"Puntuación parcial:","(out of played activities)":"(sobre las actividades realizadas)","Activities played at least once:":"Actividades realizadas al menos una vez:",Reports:"Informes","Toggle full screen":"Conmutar pantalla completa","JClic logo":"Logotipo de JClic",message:"mensaje","Activity panel":"Panel de actividad",cell:"celda",image:"imagen",source:"origen",target:"destino","image fragment":"fragmento de imagen"},eu:{Version:"Bertsioa",time:"denbora",actions:"saiakerak",score:"puntuazioa","Next activity":"Hurrengo jarduera","Previous activity":"Aurreko jarduera","Restart activity":"Jarduera berriro hasi",Information:"Informazioa","Results are not currently being saved":"Txostena ez dago ezein datu-basetan","Current results":"Erabiltzailearen txostenak","Session started:":"Saio-hasiera:","Reports system:":"Txosten-sistema:","User:":"Erabiltzailea:","Projects:":"Proiektuak:","Sequences:":"Sekuentziak:","Activities done:":"Burututako ekinzak:","Activities solved:":"Jarduera zuzenak:","Global score:":"Jarduera zuzenak:","(out of all project activities)":"Jardueretan emandako denbora guztira:","Total time in activities:":"Jardueretan emandako denbora guztira:","Actions done:":"Burututako ekintzak:","No activities done!":"Ez da jardueren txostenik!",Project:"Proiektua",sequence:"Sekuentzia",activity:"Jarduera",OK:"Ados",YES:"BAI",NO:"EZ","Total:":"Guztira:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Jarduera zuzenak:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Burututako ekinzak:",Reports:"Txosten-sistema:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Burututako ekinzak:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},fr:{Version:"Version",time:"temps",actions:"essais",score:"résultat","Next activity":"Activité suivante","Previous activity":"Activité précédente","Restart activity":"Recommencer l'activité",Information:"Informations","Results are not currently being saved":"Le rapport n'est enregistré dans aucune base de données","Current results":"Rapports utilisateur","Session started:":"Session démarrée :","Reports system:":"Système de rapports :","User:":"Utilisateur :","Projects:":"Projets :","Sequences:":"Séquences :","Activities done:":"Activités réalisées :","Activities solved:":"Activités résolues :","Global score:":"Score global :","(out of all project activities)":"(sur toutes les activités du projet)","Total time in activities:":"Temps total sur les activités :","Actions done:":"Actions réalisées :","No activities done!":"Aucune activité réalisée !",Project:"Projet",sequence:"séquence",activity:"activité",OK:"OK",YES:"OUI",NO:"NON","Total:":"Total :","Select group:":"Sélectionner un groupe:","Select user:":"Sélectionner l'utilisateur:",Cancel:"Annuler",Close:"Fermer","Copy data to clipboard":"Copier les données dans le presse-papier","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les données ont été copiées au format HTML. Veuillez les coller dans une feuille de calcul ou dans un éditeur de texte","The data has been copied to clipboard":"Les données sont copier dans le presse-papier","not connected":"Non connecté ","Please wait until the results of your activities are sent to the reports system":"Veuillez patienter durant l'envoi de votre activité au rapport système","Password:":"Mot de passe: ","Incorrect password":"Mot de passe incorrect","Invalid user":"Utilisateur invalide","Partial score:":"Score partiel:","(out of played activities)":"(Hors activités jouées)","Activities played at least once:":"Les activités joué au moins une fois:",Reports:"Rapport","Toggle full screen":"Basculer en plein écran","JClic logo":"JClic logo",message:"message","Activity panel":"Groupe d'activités",cell:"cellule",image:"image",source:"source",target:"cible","image fragment":"fragment d'image"},gl:{Version:"Versión",time:"tempo",actions:"intentos",score:"acertos","Next activity":"Seguinte actividade","Previous activity":"Anterior actividade","Restart activity":"Reiniciar a actividade",Information:"Información","Results are not currently being saved":"O informe non está rexistrado en ningunha base de datos","Current results":"Informes de usuario","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario:","Projects:":"Proxectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Puntuación global:","(out of all project activities)":"Tempo total nas actividades:","Total time in activities:":"Tempo total nas actividades:","Actions done:":"Accións efectuadas:","No activities done!":"Non hai informada ningunha actividade!",Project:"Proxecto",sequence:"secuencia",activity:"actividade",OK:"Correcta",YES:"SI",NO:"NON","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Puntuación global:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Actividades realizadas:",Reports:"Sistema de informes:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Actividades realizadas:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},he:{Version:"גירסה",time:"זמן",actions:"נסיונות",score:"ניקוד","Next activity":"הפעילות הבאה","Previous activity":"הפעילות הקודמת","Restart activity":"התחל פעילות מחדש",Information:"מידע","Results are not currently being saved":"הדיווח אינו רשום במסד נתונים כלשהו","Current results":"דוחות משתמש","Session started:":"הפעלה החלה:","Reports system:":"מערכת דוחות:","User:":"משתמש:","Projects:":"פרוייקטים:","Sequences:":"רצפים:","Activities done:":"פעילויות שהושלמו:","Activities solved:":"פעילויות מאושרות:","Global score:":"ניקוד כללי:","(out of all project activities)":"משך הפעילויות המצטבר:","Total time in activities:":"משך הפעילויות המצטבר:","Actions done:":"פעולות שבוצעו:","No activities done!":"לא דווחו פעילויות!",Project:"פרוייקט",sequence:"רצף",activity:"פעילות",OK:"אישור",YES:"כן",NO:"לא","Total:":"סך הכל:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"ניקוד כללי:","(out of played activities)":"(out of played activities)","Activities played at least once:":"פעילויות שהושלמו:",Reports:"מערכת דוחות:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"פעילויות שהושלמו:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},hr:{Version:"Verzija",time:"vrijeme",actions:"radnje",score:"rezultat","Next activity":"Sljedeća aktivnost","Previous activity":"Prethodna aktivnost","Restart activity":"Ponovo pokreni aktivnost",Information:"Informacije","Results are not currently being saved":"Rezultati se trenutačno ne spremaju","Current results":"Trenutačni rezultati","Session started:":"Sesija započeta:","Reports system:":"Sustav izvještaja:","User:":"Korisnik:","Projects:":"Projekti:","Sequences:":"Slijedovi:","Activities done:":"Obavljene aktivnosti:","Activities solved:":"Riješene aktivnosti:","Global score:":"Ukupni rezultat:","(out of all project activities)":"(od svih projektnih aktivnosti)","Total time in activities:":"Ukupno vrijeme u aktivnostima:","Actions done:":"Izvršene radnje:","No activities done!":"Nema obavljenih aktivnosti!",Project:"Projekt",sequence:"slijed",activity:"aktivnost",OK:"U redu",YES:"DA",NO:"NE","Total:":"Ukupno:","Select group:":"Odaberi grupu:","Select user:":"Odaberi korisnika:",Cancel:"Odustani",Close:"Zatvori","Copy data to clipboard":"Kopiraj podatke u međuspremnik","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Podaci su kopirani u HTML formatu. Umetni ih u proračunsku tablicu ili u uređivač formatiranog teksta","The data has been copied to clipboard":"Podaci su kopirani u međuspremnik","not connected":"nepovezano","Please wait until the results of your activities are sent to the reports system":"Pričekaj da se rezultati tvojih aktivnosti pošalju sustavu izvještaja","Password:":"Lozinka:","Incorrect password":"Neispravna lozinka","Invalid user":"Korisnik ne postoji","Partial score:":"Prosjek:","(out of played activities)":"(od odigranih aktivnosti)","Activities played at least once:":"Barem jednom odigrane aktivnosti:",Reports:"Sustav izvještaja:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Obavljene aktivnosti:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},it:{Version:"Versione",time:"tempo",actions:"tentativi",score:"punteggio","Next activity":"Attività successiva","Previous activity":"Attività precedente","Restart activity":"Riavvia l'attività",Information:"Informazioni","Results are not currently being saved":"Rapporto non registrato in alcuna banca dati","Current results":"Rapporti utente","Session started:":"Sessione avviata:","Reports system:":"Sistema dei rapporti:","User:":"Utente:","Projects:":"Progetti:","Sequences:":"Sequenze:","Activities done:":"Attività eseguite:","Activities solved:":"Attività ok:","Global score:":"Punteggio globale:","(out of all project activities)":"Tempo totale nelle attività:","Total time in activities:":"Tempo totale nelle attività:","Actions done:":"Azioni compiute:","No activities done!":"Nessuna attività a rapporto!",Project:"Progetto",sequence:"sequenza",activity:"attività",OK:"Ok",YES:"SÌ",NO:"NO","Total:":"Totale:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Punteggio globale:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Attività eseguite:",Reports:"Sistema dei rapporti:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Attività eseguite:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ja:{Version:"バージョン",time:"時間",actions:"アクション",score:"スコア","Next activity":"次のアクティビティ","Previous activity":"前のアクティビティ","Restart activity":"アクティビティを再起動",Information:"情報","Results are not currently being saved":"結果は、現在保存されていません","Current results":"現在の結果","Session started:":"セッションが開始しました:","Reports system:":"レポート システム:","User:":"ユーザー:","Projects:":"プロジェクト:","Sequences:":"シーケンス:","Activities done:":"完了したアクティビティ:","Activities solved:":"解決したアクティビティ:","Global score:":"グローバル スコア:","(out of all project activities)":"(すべてのプロジェクト アクティビティの結果)","Total time in activities:":"アクティビティ時間の合計:","Actions done:":"完了したアクション:","No activities done!":"アクティビティは行われていません!",Project:"プロジェクト",sequence:"シーケンス",activity:"アクティビティ",OK:"OK",YES:"はい",NO:"いいえ","Total:":"合計:","Select group:":"グループを選択:","Select user:":"ユーザーを選択:",Cancel:"キャンセル",Close:"閉じる","Copy data to clipboard":"データをクリップボードにコピー","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"データは HTML 形式でコピーされます。リッチ テキスト エディターやスプレッドシートに貼り付けてください","The data has been copied to clipboard":"クリップボードにデータがコピーされました","not connected":"接続されていません","Please wait until the results of your activities are sent to the reports system":"アクティビティの結果がレポート システムに送信されるまでお待ちください","Password:":"パスワード:","Incorrect password":"パスワードが正しくありません","Invalid user":"無効なユーザー","Partial score:":"部分スコア:","(out of played activities)":"(プレイしたアクティビティの結果)","Activities played at least once:":"少なくとも一度プレイしたアクティビティ:",Reports:"レポート","Toggle full screen":"全画面の切り替え","JClic logo":"JClic ロゴ",message:"メッセージ","Activity panel":"アクティビティ パネル",cell:"セル",image:"画像",source:"ソース",target:"ターゲット","image fragment":"画像フラグメント"},nb_NO:{Version:"Versjon",time:"tid",actions:"forsøk",score:"poengsum","Next activity":"Neste aktivitet","Previous activity":"Forrige aktivitet","Restart activity":"Start aktivitet på nytt",Information:"Informasjon","Results are not currently being saved":"Resultater blir foreløpig ikke lagret","Current results":"Nåværende resultater","Session started:":"Økta startet:","Reports system:":"Rapportsystem:","User:":"Bruker:","Projects:":"Prosjekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter fullført:","Activities solved:":"Løste aktiviteter:","Global score:":"Global poengsum:","(out of all project activities)":"(av alle prosjektaktiviteter)","Total time in activities:":"Tidsforbruk på aktiviteter:","Actions done:":"Handlinger gjort:","No activities done!":"Ingen aktiviteter unnagjort.",Project:"Prosjekt",sequence:"sekvens",activity:"aktivitet",OK:"OK",YES:"JA",NO:"NEI","Total:":"Total:","Select group:":"Velg gruppe:","Select user:":"Velg bruker:",Cancel:"Avbryt",Close:"Lukk","Copy data to clipboard":"Kopier data til utklippstavle","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Dataen har blitt kopiert i HTML-format. Lim inn i et regneark eller en tekstbehandler med støtte for formatering","The data has been copied to clipboard":"Dataen har blitt kopier til utklippstavle","not connected":"ikke tilkoblet","Please wait until the results of your activities are sent to the reports system":"Vent mens resultatet av dine aktiviteter sendes til rapportsystemet","Password:":"Passord:","Incorrect password":"Feilaktig passord","Invalid user":"Ugyldig bruker","Partial score:":"Delvis poengsum:","(out of played activities)":"(av utførte aktiviteter)","Activities played at least once:":"Aktiviteter som har blitt utført minst én gang:",Reports:"Rapportsystem:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Aktiviteter fullført:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},nl:{Version:"Versie",time:"tijd",actions:"pogingen",score:"punten","Next activity":"Volgende activiteit","Previous activity":"Vorige activiteit","Restart activity":"Herstart activiteit",Information:"Informatie","Results are not currently being saved":"Rapport niet geregistreerd in een DB","Current results":"Gebruikers rapport","Session started:":"Reeks gestart:","Reports system:":"Rapporteer systeem:","User:":"Gebruiker:","Projects:":"Projecten:","Sequences:":"Reeksen:","Activities done:":"Activiteiten klaar:","Activities solved:":"Activiteiten ok:","Global score:":"Puntentotaal:","(out of all project activities)":"Totale tijd activiteiten:","Total time in activities:":"Totale tijd activiteiten:","Actions done:":"Einde activiteiten:","No activities done!":"Geen activiteiten gerapporteerd!",Project:"Project",sequence:"Volgorde",activity:"Activiteit",OK:"Ok",YES:"JA",NO:"NEE","Total:":"Totaal:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Puntentotaal:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Activiteiten klaar:",Reports:"Rapporteer systeem:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Activiteiten klaar:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},pl:{Version:"Wersja",time:"czas",actions:"działanie",score:"wynik","Next activity":"Następna aktywność","Previous activity":"Poprzednia aktywność","Restart activity":"Zrestartuj aktywność",Information:"Informacje","Results are not currently being saved":"Wyniki nie są obecnie zapisywane","Current results":"Aktualne wyniki","Session started:":"Sesja rozpoczęła się:","Reports system:":"System raportów:","User:":"Użytkownik:","Projects:":"Projektowanie:","Sequences:":"Sekwencje:","Activities done:":"Działania wykonane:","Activities solved:":"Działania rozwiązane:","Global score:":"Globalny wynik:","(out of all project activities)":"(poza wszystkimi działaniami projektu)","Total time in activities:":"Całkowity czas aktywności:","Actions done:":"Wykonane czynności:","No activities done!":"Nie wykonano żadnych czynności!",Project:"Projekt",sequence:"sekwencja",activity:"aktywność",OK:"OK",YES:"Tak",NO:"Nie","Total:":"Całkowity:","Select group:":"Wybierz grupę:","Select user:":"Wybierz użytkownika:",Cancel:"Anuluj",Close:"Zamknij","Copy data to clipboard":"Skopiuj dane do schowka","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Dane zostały skopiowane w formacie HTML. Wklej je do arkusza kalkulacyjnego lub edytora tekstu","The data has been copied to clipboard":"Dane zostały skopiowane do schowka","not connected":"nie połączony","Please wait until the results of your activities are sent to the reports system":"Poczekaj, aż wyniki Twoich działań zostaną przesłane do systemu raportów","Password:":"Hasło:","Incorrect password":"Niepoprawne hasło","Invalid user":"Nieprawidłowy użytkownik","Partial score:":"Wynik częściowy:","(out of played activities)":"(z granych zajęć)","Activities played at least once:":"Działania grane co najmniej raz:",Reports:"Raporty","Toggle full screen":"Przełącz tryb pełnoekranowy","JClic logo":"Logo JClic",message:"komunikat","Activity panel":"Panel aktywności",cell:"komórka",image:"obraz",source:"źródło",target:"miejsce docelowe","image fragment":"fragment obrazu"},pt:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"Actividade seguinte","Previous activity":"Actividade anterior","Restart activity":"Reiniciar a actividade",Information:"Informação","Results are not currently being saved":"O relatório não está registado em nenhuma base de dados","Current results":"Relatórios do utilizador","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Utilizador:","Projects:":"Projectos:","Sequences:":"Sequências:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Pontuação global:","(out of all project activities)":"Tempo total das actividades:","Total time in activities:":"Tempo total das actividades:","Actions done:":"Acções efectuadas:","No activities done!":"Nenhuma actividade registada!",Project:"Projecto",sequence:"sequência",activity:"Actividade",OK:"Correcta",YES:"sim",NO:"não","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Pontuação global:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Actividades realizadas:",Reports:"Sistema de relatórios:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Actividades realizadas:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},pt_BR:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"atividade seguinte","Previous activity":"atividade anterior","Restart activity":"Reiniciar a atividade",Information:"Informação","Results are not currently being saved":"O relatório não está registrando em nenhuma base de dados","Current results":"relatórios de usuário","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Usuário:","Projects:":"Projetos:","Sequences:":"Sequências:","Activities done:":"Atividades realizadas:","Activities solved:":"Atividades corretas:","Global score:":"Pontuação geral:","(out of all project activities)":"Tempo total das atividades:","Total time in activities:":"Tempo total das atividades:","Actions done:":"Ações efetuadas:","No activities done!":"Nenhuma atividade registrada!",Project:"Projeto",sequence:"sequência",activity:"atividade",OK:"Correta",YES:"sim",NO:"não","Total:":"Total:","Select group:":"Selecionar grupo:","Select user:":"Selecionar usuário:",Cancel:"Cancelar",Close:"Fechar","Copy data to clipboard":"Copiar dados para o clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Os dados foram copiados no formato HTML. Favor colá-los em uma planilha ou em um editor de texto com formatação","The data has been copied to clipboard":"Os dados foram copiados para o clipboard","not connected":"não conectado","Please wait until the results of your activities are sent to the reports system":"Favor aguardar até que os resultados das suas atividades sejam enviados ao sistema de relatórios","Password:":"Senha:","Incorrect password":"Senha errada","Invalid user":"Usuário inválido","Partial score:":"Pontuação geral:","(out of played activities)":"(das atividades realizadas)","Activities played at least once:":"Atividades realizadas:",Reports:"Sistema de relatórios:","Toggle full screen":"Modo tela cheia","JClic logo":"logo do JClic",message:"mensagem","Activity panel":"Atividades realizadas:",cell:"célula",image:"imagem",source:"fonte",target:"alvo","image fragment":"fragmento de imagem"},ro:{Version:"Versiune",time:"timp",actions:"acțiuni",score:"rezultat","Next activity":"Activitatea următoare","Previous activity":"Activitatea anterioară","Restart activity":"Restartează activitatea",Information:"Informații","Results are not currently being saved":"Rezultatul nu pare a fi salvat","Current results":"Rezultatul curent","Session started:":"Sesiune pornită la:","Reports system:":"Sistem raportare:","User:":"Utilizator","Projects:":"Proiecte:","Sequences:":"Secvențe:","Activities done:":"Activități realizate: ","Activities solved:":"Activități rezolvate: ","Global score:":"Rezultat global:","(out of all project activities)":"(în afara activităților din proiect)","Total time in activities:":"Timp total în activitate:","Actions done:":"Activități realizate: ","No activities done!":"Activități nerealizate: ",Project:"Proiect",sequence:"secvență",activity:"activitate",OK:"OK",YES:"DA",NO:"NU","Total:":"Total:","Select group:":"Alege grup:","Select user:":"Alege utilizator:",Cancel:"Anuleaza",Close:"Închide","Copy data to clipboard":"Copiază datele in clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Datele au fost copiate în format HTML. Vă rog lipiți-le într-o foaie de calcul sau într-un editor compatibil rich text","The data has been copied to clipboard":"Datele au fost copiate în clipboard","not connected":"neconectat","Please wait until the results of your activities are sent to the reports system":"Vă rugăm să așteptați până ce rezultatele activităților sunt trimise către sistemul de raportare","Password:":"Parolă:","Incorrect password":"Parolă incorectă","Invalid user":"Utilizator incorect","Partial score:":"Rezultat parțial:","(out of played activities)":"(în afara activități jucate) ","Activities played at least once:":"Activități jucate cel puțin o dată: ",Reports:"Rapoarte","Toggle full screen":"Comută în ecran plin","JClic logo":"Jclic logo",message:"mesaj","Activity panel":"Panou activități",cell:"celulă",image:"imagine",source:"sursă",target:"țintă","image fragment":"fragment de imagine "},ru:{Version:"Версия",time:"время",actions:"попытки",score:"счёт","Next activity":"Следующее действие","Previous activity":"Предыдущее действие","Restart activity":"Перезапуск действия",Information:"Информация","Results are not currently being saved":"Отчёт не зарегистрирован в БД","Current results":"Отчёты пользователя","Session started:":"Сессия начата:","Reports system:":"Система отчётов:","User:":"Пользователь:","Projects:":"Проекты:","Sequences:":"Последовательности:","Activities done:":"Совершенные действия:","Activities solved:":"Действия в порядке:","Global score:":"Общий счёт:","(out of all project activities)":"Общее время активности:","Total time in activities:":"Общее время активности:","Actions done:":"Завершено действий:","No activities done!":"Нет сообщенных действий!",Project:"Проект",sequence:"Последовательность",activity:"Активность",OK:"ОК",YES:"да",NO:"нет","Total:":"Итого:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Общий счёт:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Совершенные действия:",Reports:"Система отчётов:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Совершенные действия:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ta:{Version:"பதிப்பு",time:"நேரம்",actions:"செயல்கள்",score:"கெலிப்பெண்","Next activity":"அடுத்த செயல்பாடு","Previous activity":"முந்தைய செயல்பாடு","Restart activity":"செயல்பாட்டை மறுதொடக்கம் செய்யுங்கள்",Information:"தகவல்","Results are not currently being saved":"முடிவுகள் தற்போது சேமிக்கப்படவில்லை","Current results":"தற்போதைய முடிவுகள்","Session started:":"சந்திப்பு தொடங்கியது:","Reports system:":"அறிக்கை அமைப்பு:","User:":"பயனர்:","Projects:":"திட்டங்கள்:","Sequences:":"தொடர்கள்:","Activities done:":"முடிந்த நடவடிக்கைகள்:","Activities solved:":"தீர்க்கப்பட்ட நடவடிக்கைகள்:","Global score:":"உலகளாவிய மதிப்பெண்:","(out of all project activities)":"(அனைத்து திட்ட நடவடிக்கைகளிலும்)","Total time in activities:":"நடவடிக்கைகளில் மொத்த நேரம்:","Actions done:":"செய்யப்பட்ட செயல்கள்:","No activities done!":"நடவடிக்கைகள் எதுவும் செய்யப்படவில்லை!",Project:"திட்டம்",sequence:"வரிசை",activity:"செய்கைப்பாடு",OK:"சரி",YES:"ஆம்",NO:"இல்லை","Total:":"மொத்தம்:","Select group:":"குழுவைத் தேர்ந்தெடுக்கவும்:","Select user:":"பயனரைத் தேர்ந்தெடுக்கவும்:",Cancel:"ரத்துசெய்",Close:"மூடு","Copy data to clipboard":"இடைநிலைப்பலகைக்கு தரவை நகலெடுக்கவும்","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"தரவு உஉகுமொ வடிவத்தில் நகலெடுக்கப்பட்டுள்ளது. தயவுசெய்து அவற்றை ஒரு விரிதாளில் அல்லது பணக்கார உரை திருத்தியில் ஒட்டவும்","The data has been copied to clipboard":"தரவு இடைநிலைப்பலகைக்கு நகலெடுக்கப்பட்டுள்ளது","not connected":"இணைக்கப்படவில்லை","Please wait until the results of your activities are sent to the reports system":"உங்கள் செயல்பாடுகளின் முடிவுகள் அறிக்கைகள் முறைக்கு அனுப்பப்படும் வரை காத்திருங்கள்","Password:":"கடவுச்சொல்:","Incorrect password":"தவறான கடவுச்சொல்","Invalid user":"தவறான பயனர்","Partial score:":"பகுதி மதிப்பெண்:","(out of played activities)":"(விளையாடிய நடவடிக்கைகளுக்கு வெளியே)","Activities played at least once:":"செயல்பாடுகள் ஒரு முறையாவது:",Reports:"அறிக்கை அமைப்பு:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"முடிந்த நடவடிக்கைகள்:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},tr:{Version:"Sürüm",time:"zaman",actions:"Denemeler",score:"sonuç","Next activity":"Sonraki etkinlik","Previous activity":"Önceki etkinlik","Restart activity":"Etkinliği yeniden başlat",Information:"Bilgi","Results are not currently being saved":"Sonuçlar şu anda kaydedilmiyor","Current results":"Geçerli sonuçlar","Session started:":"Oturum başlatıldı:","Reports system:":"Sistem raporları:","User:":"Kullanıcı:","Projects:":"Projeler:","Sequences:":"Sekanslar:","Activities done:":"Tamamlanan etkinlikler:","Activities solved:":"Çözülen etkinlikler:","Global score:":"Genel puan:","(out of all project activities)":"Toplam etkinlik süresi:","Total time in activities:":"Toplam etkinlik süresi:","Actions done:":"Tamamlanan işlemler:","No activities done!":"Tamamlanan etkinlik yok!",Project:"Proje",sequence:"Etkinlik dizisi",activity:"Etkinlik",OK:"Tamam",YES:"Evet",NO:"Hayır","Total:":"Toplam:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Genel puan:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Tamamlanan etkinlikler:",Reports:"Sistem raporları:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Tamamlanan etkinlikler:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},uk:{Version:"Версія",time:"Час",actions:"спроби",score:"оцінка","Next activity":"Наступна діяльність","Previous activity":"Попередня діяльність","Restart activity":"Перезапуск діяльності",Information:"Інформація","Results are not currently being saved":"Звіт не зареєстровано в БД","Current results":"Звіти користувача","Session started:":"Сеанс розпочато:","Reports system:":"Система звітів:","User:":"Користувач:","Projects:":"Проєкти:","Sequences:":"Послідовності:","Activities done:":"Виконані діяльності:","Activities solved:":"Вирішені діяльності:","Global score:":"Загальна оцінка:","(out of all project activities)":"(з усіх діяльностей проєкту)","Total time in activities:":"Загальний час діяльності:","Actions done:":"Виконані дії:","No activities done!":"Жодних діяльностей не виконано!",Project:"Проєкт",sequence:"послідовність",activity:"активність",OK:"Гаразд",YES:"Так",NO:"Ні","Total:":"Підсумок:","Select group:":"Вибрати групу:","Select user:":"Виберіть користувача:",Cancel:"Скасувати",Close:"Закрити","Copy data to clipboard":"Копіювати дані в буфер обміну","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Дані скопійовані у форматі HTML. Будь ласка, вставте їх в електронну таблицю або у текстовий редактор","The data has been copied to clipboard":"Дані скопійовано до буферу обміну","not connected":"Немає з’єднання","Please wait until the results of your activities are sent to the reports system":"Будь ласка, зачекайте, поки результати вашої діяльності будуть надіслані до системи звітів","Password:":"Пароль:","Incorrect password":"Неправильний пароль","Invalid user":"Неприпустимий користувач","Partial score:":"Часткова оцінка:","(out of played activities)":"(поза відтвореними діяльностями)","Activities played at least once:":"Діяльності, які відтворювалися принаймні один раз:",Reports:"Система звітів:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Виконані діяльності:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},vec:{Version:"Version",time:"tenpo",actions:"tentadivi",score:"pontexio","Next activity":"Pròsima atività","Previous activity":"Atività presedente","Restart activity":"Invìa atività da novo",Information:"Informasion","Results are not currently being saved":"Report no registrà inte nisun database","Current results":"Reports utenti","Session started:":"Sesion inviada:","Reports system:":"Sistèma de report","User:":"Utente:","Projects:":"Proxèti:","Sequences:":"Secuense:","Activities done:":"Atività fate:","Activities solved:":"Atività ok:","Global score:":"Pontexio global","(out of all project activities)":"Tenpo total so ƚe atività","Total time in activities:":"Tenpo total so ƚe atività","Actions done:":"Asion exeguìe","No activities done!":"No xé stà reportà atività!",Project:"Proxèto:",sequence:"secuensa",activity:"Atività",OK:"Ok",YES:"SI",NO:"NO","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Pontexio global","(out of played activities)":"(out of played activities)","Activities played at least once:":"Atività fate:",Reports:"Sistèma de report","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Atività fate:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},zh_TW:{Version:"版本",time:"時間",actions:"嘗試次數",score:"分數","Next activity":"下一個活動","Previous activity":"上一個活動","Restart activity":"重設活動",Information:"相關資訊","Results are not currently being saved":"回報在DB中無註冊","Current results":"使用者報告","Session started:":"工作開始:","Reports system:":"報告系統:","User:":"使用者:","Projects:":"專案:","Sequences:":"順序:","Activities done:":"活動結束:","Activities solved:":"活動完成:","Global score:":"總成績:","(out of all project activities)":"活動總時間:","Total time in activities:":"活動總時間:","Actions done:":"活動完成:","No activities done!":"沒有活動完成!",Project:"專案",sequence:"順序",activity:"活動",OK:"確定",YES:"是",NO:"否","Total:":"總計:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"總成績:","(out of played activities)":"(out of played activities)","Activities played at least once:":"活動結束:",Reports:"報告系統:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"活動結束:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"}}};var c,l;const h={$:e(),JSZip:n(),JSZipUtils:a()},u=["none","error","warn","info","debug","trace","all"],d=[" ","ERROR","WARN ","INFO ","DEBUG","TRACE","ALL "],p={level:2,prefix:"JClic",timestamp:!0,popupOnErrors:!1,chainTo:null,pipeTo:null};let f={};function g(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t=q(t),e&&(void 0!==t.logLevel&&v(t.logLevel),"function"==typeof t.chainLogTo&&(p.chainTo=t.chainLogTo),"function"==typeof t.pipeLogTo&&(p.pipeTo=t.pipeLogTo)),i){const e=t.lang,i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=-1,n=[];if(i){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[,e=null,i=null,s=null]=/^([a-zA-Z]{2,3})[_-]?([a-zA-Z]{2})?@?([a-zA-Z0-9]*)?$/.exec(t.trim())||[];return e?"".concat(e.toLowerCase()).concat(i?"_".concat(i.toUpperCase()):"").concat(s?"@".concat(s.toLowerCase()):""):""}(i);t&&n.push(t)}window.navigator.languages&&(n=n.concat(window.navigator.languages));window.navigator.language&&n.push(window.navigator.language);n.push(e);for(let e=0;e<n.length;e++){let i=-1;for(let r in t)if(0===n[e].indexOf(t[r])&&(i=r,n[e]===t[r])){s=r;break}if(s>=0||(s=i)>=0)break}return t[s>=0?s:0]}(o.languages,"en",e);b("debug","Language ".concat(e?'requested: "'.concat(e,'" '):"",' used: "').concat(i,'"')),f="en"===i?{}:o.messages[i]}return t}function m(t){return f[t]||t}function v(t){const e=u.indexOf(t);e>=0&&(p.level=e)}function b(t,e){const i=u.indexOf(t),s=Array.prototype.slice.call(arguments);if(i<0||i<=p.level)if(p.pipeTo)p.pipeTo.apply(null,s);else{const t="".concat(p.prefix||""," ").concat(d[i]," ").concat(p.timestamp?S():""," ").concat(e);console[1===i?"error":2===i?"warn":"log"].apply(console,[t].concat(s.slice(2))),p.chainTo&&p.chainTo.apply(null,s)}}function y(t){return"true"===t||"false"!==t&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1])}function w(t){return""===t||null==t?arguments.length>1&&void 0!==arguments[1]?arguments[1]:null:t}function A(t,e){return Number(w(t,e))}function C(t){return"".concat(Math.round(100*t),"%")}function x(t){return"0".concat(t).slice(-2)}function k(t){const e=new Date(t),i=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds();return"".concat(i?i+"h ":"").concat(i||s?x(s)+"'":"").concat(x(n),'"')}function S(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return"".concat(t.getFullYear(),"/").concat(x(t.getMonth()+1),"/").concat(x(t.getDate())," ").concat(x(t.getHours()),":").concat(x(t.getMinutes()),":").concat(x(t.getSeconds()))}function T(t){let e=null;if(t){const i=t.trim().split("/");if(3===i.length){let t=parseInt(i[0])||0,s=parseInt(i[1])||0,n=parseInt(i[2])||0;if(t>12&&s<=12){const e=t;t=s,s=e}n<1980&&(n+=n<90?2e3:1900),s&&t&&n&&(e=new Date(Date.parse("".concat(t,"/").concat(s,"/").concat(n))))}}return e||new Date}function E(t){if(t){if(!t.match(/^[a-z][a-z][a-z]?$/)){const e=t.match(/\(([a-z][a-z][a-z]?)\)/);t=e&&2===e.length?e[1]:"--"}}else t="--";return t}function P(t){return"true"===t?1:"false"===t?0:arguments.length>1&&void 0!==arguments[1]?arguments[1]:2}function I(t){return Array(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).fill(t).join("")}function B(t){return null==t}function _(t,e){return null==t&&null==e||t===e}function O(t){let i="";return e()(t).children("p").each(((t,e)=>{i+="<p>".concat(e.textContent,"</p>")})),i}function R(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i={};t.attributes&&dt(t.attributes,((t,e)=>i[t]=/^-?\d*$/.test(e)?Number(e):e));const s=[],n=Array.from(t.children||t.childNodes||[]),r=n.filter((t=>"p"===t.nodeName));if(r.length>0&&r.length===n.filter((t=>"#text"!==t.nodeName)).length){const e=r.map((t=>t.textContent)).join("\n");return t.attributes?(i.text=e,i):e}return n.forEach((t=>{if("#text"===t.nodeName&&!e)return;const n=R(t,e);if(i[t.nodeName]||(i[t.nodeName]={},s.push(t.nodeName)),n.id)i[t.nodeName][n.id]=n;else{const e=Object.keys(i[t.nodeName]).length;i[t.nodeName][e]=n}})),s.forEach((t=>{const e=Object.keys(i[t]);if(!e.find((t=>isNaN(t))))if(1===e.length)i[t]=i[t][0];else{const s=[];e.forEach((e=>s.push(i[t][e]))),i[t]=s}})),0===n.length&&t.textContent&&(i.textContent=t.textContent),i}function D(t){const e=R(t);return"string"==typeof e?e:e.hasOwnProperty("text")?e.text:e.hasOwnProperty("textContent")?e.textContent:e}function M(t){if(t){Object.keys(t).forEach((e=>{const i=t[e];if("object"==typeof i){const s=Object.keys(i);1===s.length&&"text"===s[0]?t[e]=i.text:t[e]=M(i)}}))}return t}function N(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt.BoxBase.BACK_COLOR;if(null==t&&(t=e),"#"===(t=t.replace("0x","#")).charAt(0)&&t.length>7){const e=K(parseInt(t.substring(1,3),16)/255,2);t="rgba(".concat(parseInt(t.substring(3,5),16),",").concat(parseInt(t.substring(5,7),16),",").concat(parseInt(t.substring(7,9),16),",").concat(e,")")}return t}function V(t){if(Q(t,"rgba(")){var e=parseInt(t.substring(t.lastIndexOf(",")));return"number"==typeof e&&e<1}return!1}function j(t){return e().extend(!0,Object.create(Object.getPrototypeOf(t)),t)}function q(t){const i={};return t&&e().each(t,((t,e)=>{let s;"string"==typeof e&&""!==(s=e.trim().toLowerCase())&&(e="true"===s||"false"!==s&&(isNaN(s)?e:Number(s))),i[t]=e})),i}function L(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={};return e=e||Object.keys(t),e.forEach((e=>{const[s,n]=e.split("|");if(t.hasOwnProperty(s)&&void 0!==t[s]&&null!==t[s]&&t[s].toString()!==n){const e=F(t[s]);z(e)||(i[s]=e)}})),e=Object.keys(i),1===e.length&&"text"===e[0]&&(i=i.text),i}function F(t){return t.getAttributes?t.getAttributes():t instanceof Array?t.map((t=>F(t))):t instanceof Date?t.toISOString():t instanceof Object?L(t):t}function z(t){let e=null==t;if(!e)switch(typeof t){case"object":e=0===Object.keys(t).length;break;case"string":e=0===t.length}return e}function U(t,e,i){return i.forEach((i=>{if(i.key){const{key:s,fn:n,group:r,init:a,params:o}=i;if(!z(e[s])){const i=e[s];t[s]="object"===r?Object.keys(i).reduce(((t,e)=>(t[e]=H(n,i[e],"key"===a?e:a,o),t)),{}):"array"===r?i.map(((t,e)=>H(n,t,"key"===a?e:a,o))):H(n,i,a,o)}}else z(e[i])||(t[i]=e[i])})),t}function H(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return t.factory?t.factory(e,i,s):new t(i).setAttributes(e,...s)}function $(t){return vt.SEPARATORS.includes(t)}function W(t){return vt.WORD_DELIMITERS.includes(t)}function J(t){const e=[];let i={text:"",sep:""},s=!0;for(let n=0;n<t.length;n++){const r=t.charAt(n),a=W(r);s?a?(s=!1,i.sep=r):i.text+=r:a?i.sep+=r:(e.push(i),i={text:r,sep:""},s=!0)}return e.push(i),e}function G(t,e){return Math.round(t/e)*e}function K(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return t.toFixed?Number(t.toFixed(e)):t}function Z(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null===t||0===t.length||null===e||0===e.length)return!1;i||s||(t=t.toUpperCase()),t=t.trim(),s=s&&/\d/.test(t);for(let n of e.split("|"))if(s){if(Number.parseFloat(t.replace(/,/,"."))===Number.parseFloat(n.replace(/,/,".")))return!0}else if(t===(i?n:n.toUpperCase()).trim())return!0;return!1}function Y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&((arguments.length>2?arguments[2]:void 0)?t.trim():t).endsWith(e)}function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&0===((arguments.length>2?arguments[2]:void 0)?t.trim():t).indexOf(e)}function X(t){return t?t.replace(/\\/g,"/"):t}function tt(t){return/^(filesystem:)?(https?|file|data|ftps?):/i.test(t)}function et(t){const e=t.lastIndexOf("/");return e>=0?t.substring(0,e+1):""}function it(t,e){return e&&""!==e&&0===t.indexOf(e)?t.substring(e.length):t}function st(t,e){return tt(e)?e:t+e}function nt(t,e,i){if(i){const s=it(t+e,i.zipBasePath);if(i.files[s])return new Promise(((t,n)=>{i.file(s).async("base64").then((i=>{const s=e.toLowerCase().split(".").pop(),n=vt.MIME_TYPES[s]||"application/octet-stream";t("data:".concat(n,";base64,").concat(i))})).catch(n)}))}return Promise.resolve(st(t,e))}const rt={doubleCell:(t,i)=>e()("<tr/>").append(e()("<td/>").html(t)).append(e()("<td/>").html(i)),p:t=>e()("<p/>").html(t),td:(t,i)=>e()("<td/>",i?{class:i}:null).html(t),th:(t,i)=>e()("<th/>",i?{class:i}:null).html(t)};function at(t,e,i,s){return e&&(t=t.replace(/width=\"\d*\"/,'width="'.concat(e,'"'))),i&&(t=t.replace(/height=\"\d*\"/,'height="'.concat(i,'"'))),s&&(t=t.replace(/fill=\"[#A-Za-z0-9]*\"/,'fill="'.concat(s,'"'))),t}function ot(t,e,i,s){return"data:image/svg+xml;base64,"+window.btoa(at(t,e,i,s))}function ct(t,e,i,s){const n=null==t?null:isNaN(t)?t:t<0?"".concat(Math.abs(t),"%"):"".concat(t,"px");return e&&i&&(n||s)&&(e[i]=null!==n?n:s),n}function lt(t,e){const i=document.createElement("canvas");i.width=e.dim.width,i.height=e.dim.height;const s=i.getContext("2d");let n="";try{s.drawImage(t,e.pos.x,e.pos.y,e.dim.width,e.dim.height,0,0,e.dim.width,e.dim.height),n=i.toDataURL()}catch(t){b("error",t)}return n}function ht(t){if(t){for(;t.parentElement;)t=t.parentElement;t instanceof HTMLElement&&(t=t.parentNode||t),t=t.head||t}return t||document.head}function ut(t,e){const i=ht(e&&e.$topDiv?e.$topDiv[0]:null),s=document.createElement("style");return s.type="text/css",s.appendChild(document.createTextNode(t)),i.appendChild(s)}function dt(t,e){for(let i=0;i<t.length;i++)e(t[i].name,t[i].value)}function pt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t[e]?i.push(t):Object.values(t).forEach((t=>{"object"==typeof t&&pt(t,e,i)})),i}function ft(t){let e=0;const i=t.ownerDocument||t.document,s=i.defaultView||i.parentWindow;let n;if(void 0!==s.getSelection){if(n=s.getSelection(),n.rangeCount>0){const i=s.getSelection().getRangeAt(0),n=i.cloneRange();n.selectNodeContents(t),n.setEnd(i.endContainer,i.endOffset),e=n.toString().length}}else if((n=i.selection)&&"Control"!==n.type){const s=n.createRange(),r=i.body.createTextRange();r.moveToElementText(t),r.setEndPoint("EndToEnd",s),e=r.text.length}return e}function gt(t){const e=[];if(3===t.nodeType)e.push(t);else{const i=t.childNodes;for(let t=0,s=i.length;t<s;++t)e.push.apply(e,gt(i[t]))}return e}function mt(t,e,i){if(B(i)&&(i=e),document.createRange&&window.getSelection){const s=document.createRange();s.selectNodeContents(t);const n=gt(t);let r,a,o=!1,c=0;for(let t=0;t<n.length;t++){if(a=n[t],r=c+a.length,!o&&e>=c&&(e<r||e===r&&t+1<=n.length)&&(s.setStart(a,e-c),o=!0),o&&i<=r){s.setEnd(a,i-c);break}c=r}const l=window.getSelection();l.removeAllRanges(),l.addRange(s)}else if(document.selection&&document.body.createTextRange){const s=document.body.createTextRange();s.moveToElementText(t),s.collapse(!0),s.moveEnd("character",i),s.moveStart("character",e),s.select()}}const vt={VERSION:o.version,NODEJS:"undefined"==typeof window||(null===(c=window)||void 0===c||null===(c=c.navigator)||void 0===c||null===(c=c.userAgent)||void 0===c?void 0:c.includes("jsdom")),AB:0,BA:1,AUB:2,BUA:3,LAYOUT_NAMES:["AB","BA","AUB","BUA"],DEFAULT_WIDTH:400,DEFAULT_HEIGHT:300,MINIMUM_WIDTH:40,MINIMUM_HEIGHT:40,DEFAULT_NAME:"---",DEFAULT_MARGIN:8,DEFAULT_SHUFFLES:31,DEFAULT_GRID_ELEMENT_SIZE:20,MIN_CELL_SIZE:10,DEFAULT_BG_COLOR:"#C0C0C0",ACTIONS:{ACTION_MATCH:"MATCH",ACTION_PLACE:"PLACE",ACTION_WRITE:"WRITE",ACTION_SELECT:"SELECT",ACTION_HELP:"HELP"},PREVIOUS:0,MAIN:1,END:2,END_ERROR:3,NUM_MSG:4,MSG_TYPE:["previous","initial","final","finalError"],RANDOM_CHARS:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",NUM_COUNTERS:3,MAX_RECORD_LENGTH:180,BoxBase:{REDUCE_FONT_STEP:1,MIN_FONT_SIZE:8,STROKE:1,AC_MARGIN:6,BACK_COLOR:"#C0C0C0",TEXT_COLOR:"black",SHADOW_COLOR:"gray",INACTIVE_COLOR:"gray",ALTERNATIVE_COLOR:"gray",BORDER_COLOR:"black",BORDER_STROKE_WIDTH:.75,MARKER_STROKE_WIDTH:2.75},FILE_TYPES:{image:"gif,jpg,png,jpeg,bmp,ico,svg",audio:"wav,mp3,ogg,oga,au,aiff,flac",video:"avi,mov,mpeg,mp4,ogv,m4v,webm",font:"ttf,otf,eot,woff,woff2",midi:"mid,midi",anim:"swf",xml:"xml"},MIME_TYPES:{xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",wav:"audio/wav",mp3:"audio/mpeg",mp4:"video/mp4",m4v:"video/mp4",ogg:"audio/ogg",oga:"audio/ogg",ogv:"video/ogg",webm:"video/webm",au:"audio/basic",aiff:"audio/x-aiff",flac:"audio/flac",avi:"video/avi",mov:"video/quicktime",mpeg:"video/mpeg",ttf:"application/font-sfnt",otf:"application/font-sfnt",eot:" application/vnd.ms-fontobject",woff:"application/font-woff",woff2:"application/font-woff2",swf:"application/x-shockwave-flash",mid:"audio/midi",midi:"audio/midi"},COMPRESS_IMAGES:!0,VK:{LEFT:37,UP:38,RIGHT:39,DOWN:40},TOUCH_DEVICE:!1,LOAD_TIMEOUT:1e4,BEZIER_POINTS:4,CANVAS_DRAW_FOCUS:"undefined"!=typeof window&&"function"==typeof(null===(l=window)||void 0===l||null===(l=l.CanvasRenderingContext2D)||void 0===l||null===(l=l.prototype)||void 0===l?void 0:l.drawFocusIfNeeded),WHITESPACES:" \f\n\r\t\v \u2028\u2029 \ufeff"};vt.SEPARATORS="".concat(vt.WHITESPACES,".,;-|"),vt.WORD_DELIMITERS="".concat(vt.SEPARATORS,"…_<>\"“”«»'´`‘’•~+–—―=%¿?¡!:/\\()[]{}$£€");const bt={pkg:h,settings:vt,getMsg:m,LOG_LEVELS:u,LOG_PRINT_LABELS:d,LOG_OPTIONS:p,init:g,setLogLevel:v,log:b,getBoolean:y,getVal:w,getNumber:A,getPercent:C,zp:x,getHMStime:k,getDateTime:S,parseOldDate:T,cleanOldLanguageTag:E,FALSE:0,TRUE:1,DEFAULT:2,getTriState:P,fillString:I,isNullOrUndef:B,isEquivalent:_,getXmlText:O,parseXmlNode:R,getXmlNodeText:D,reduceTextsToStrings:M,cssToString:function(t){return Object.keys(t).reduce(((e,i)=>"".concat(e).concat(i,":").concat(t[i],";")),"")},checkColor:N,colorHasTransparency:V,cloneObject:j,normalizeObject:q,getAttr:L,getValue:F,isEmpty:z,setAttr:U,buildObj:H,isSeparator:$,isWordDelimiter:W,stringToWords:J,roundTo:G,fx:K,compareMultipleOptions:Z,endsWith:Y,startsWith:Q,nSlash:X,isURL:tt,getBasePath:et,getRelativePath:it,getPath:st,getPathPromise:nt,$HTML:rt,getSvg:at,svgToURI:ot,toCssSize:ct,getImgClipUrl:lt,getRootHead:ht,appendStyleAtHead:ut,attrForEach:dt,findParentsWithChild:pt,getCaretCharacterOffsetWithin:ft,getTextNodesIn:gt,setSelectionRange:mt};var yt=i(371),wt=i.n(yt);class At{constructor(t,e,i,s,n){t&&(this.family=t),"number"==typeof e&&(this.size=e),i&&(this.bold=i),s&&(this.italic=s),n&&(this.variant=n),this._metrics={ascent:-1,descent:-1,height:-1}}static checkTree(t,i){let s=At.SUBSTITUTIONS;i&&i.ownFonts&&i.ownFonts.forEach((t=>{At.ALREADY_LOADED_FONTS.indexOf(t)<0&&wt()&&wt().load&&(wt().load({custom:{families:[t]}}),At.ALREADY_LOADED_FONTS.push(t),delete s[t.trim().toLowerCase()])})),i&&i.fontSubstitutions&&(s=e().extend(Object.create(s),i.fontSubstitutions)),t.jquery?t.find("style[family],font[family]").each(((t,i)=>{const n=e()(i),r=n.attr("family").trim().toLowerCase();if(r in s){const t=s[r];""!==t&&(At.loadGoogleFont(t),n.attr("family",t))}})):pt(t,"family").forEach((t=>{if("string"==typeof t.family){const e=t.family;if(At.GOOGLEFONTS.includes(e))At.loadGoogleFont(e);else{const i=s[e.trim().toLowerCase()];i&&(At.loadGoogleFont(i),t.family=i)}}}))}static loadGoogleFont(t){t&&!At.ALREADY_LOADED_FONTS.includes(t)&&wt()&&wt().load&&(wt().load({google:{families:[t]}}),At.ALREADY_LOADED_FONTS.push(t))}static loadGoogleFonts(t){t&&t.forEach&&t.forEach((t=>At.loadGoogleFont(t)))}setProperties(t){return t.attr("family")&&(this.family=t.attr("family")),t.attr("size")&&(this.size=Number(t.attr("size"))),t.attr("bold")&&(this.bold=y(t.attr("bold"))),t.attr("italic")&&(this.italic=y(t.attr("italic"))),t.attr("variant")&&(this.variant=t.attr("variant")),this}getAttributes(){return L(this,["family|Arial","size|17","bold|0","italic|0","variant"])}setAttributes(t){return U(this,t,["family","size","bold","italic","variant"])}setSize(t){const e=this.size;return this.size=t,e!==t&&(this._metrics.height=-1),this}zoom(t){return this.setSize(this.size+t)}getMetrics(){if(this._metrics.height<0){const t=At.ALREADY_CALCULATED_FONTS.find((t=>t.equals(this)));t&&Object.assign(this._metrics,t._metrics),this._metrics.height<0&&(this._calcHeight(),this._metrics.height>0&&At.ALREADY_CALCULATED_FONTS.push(this))}return this._metrics}getHeight(){return this.getMetrics().height}toCss(t){return t||(t={}),t["font-family"]=this.family,t["font-size"]="".concat(this.size,"px"),this.hasOwnProperty("bold")&&(t["font-weight"]=this.bold?"bold":"normal"),this.hasOwnProperty("italic")&&(t["font-style"]=this.italic?"italic":"normal"),this.hasOwnProperty("variant")&&(t["font-variant"]=this.variant),t}cssFont(){return"".concat(this.italic?"italic ":"normal"," ").concat(""===this.variant?"normal":this.variant," ").concat(this.bold?"bold ":"normal"," ").concat(this.size,"px ").concat(this.family)}_calcHeight(){const t=e()("<span/>").html("Hg").css(this.toCss()),i=e()("<div/>").css({display:"inline-block",width:"1px",height:"0px"}),s=e()("<div/>").append(t,i);e()("body").append(s);try{i.css({verticalAlign:"baseline"}),this._metrics.ascent=i.offset().top-t.offset().top,i.css({verticalAlign:"bottom"}),this._metrics.height=i.offset().top-t.offset().top,this._metrics.descent=this._metrics.height-this._metrics.ascent}finally{s.remove()}return this}equals(t){return this.family===t.family&&this.size===t.size&&this.bold===t.bold&&this.italic===t.italic&&this.variant===t.variant}}At.ALREADY_CALCULATED_FONTS=[],At.ALREADY_LOADED_FONTS=["serif","sans-serif","monospace","cursive","fantasy"],At.SUBSTITUTIONS={dialog:"sans-serif",dialoginput:"sans-serif",monospaced:"monospace",sansserif:"sans-serif",abc:"Kalam","a.c.m.e. secret agent":"Permanent Marker","comic sans ms":"Patrick Hand",impact:"Oswald",massallera:"Vibur",memima:"Vibur",memima_n1:"Vibur",memima_n2:"Vibur","memimas-regularalternate":"Vibur",palmemim:"Vibur",zurichcalligraphic:"Felipa"},At.GOOGLEFONTS=["Kalam","Permanent Marker","Patrick Hand","Oswald","Vibur","Felipa"],Object.assign(At.prototype,{family:"Arial",size:17,bold:0,italic:0,variant:"",_metrics:{ascent:-1,descent:-1,height:-1}});class Ct{constructor(t,e,i,s){t&&(this.c1=t),e&&(this.c2=e),"number"==typeof i&&(this.angle=i%360),"number"==typeof s&&(this.cycles=s)}setProperties(t){return this.c1=N(t.attr("source"),"black"),this.c2=N(t.attr("dest"),"white"),this.angle=Number(t.attr("angle")||0)%360,this.cycles=Number(t.attr("cycles")||1),this}getAttributes(){return L(this,["c1","c2","angle|0","cycles|1"])}setAttributes(t){return U(this,t,["c1","c2","angle","cycles"])}getGradient(t,e){const i=e.getOppositeVertex(),s=t.createLinearGradient(e.pos.x,e.pos.y,i.x,i.y),n=1/Math.max(this.cycles,1);for(let t=0;t<=this.cycles;t++)s.addColorStop(t*n,t%2?this.c1:this.c2);return s}getCss(){let t="linear-gradient(".concat(this.angle+90,"deg, ").concat(this.c1,", ").concat(this.c2);for(let e=1;e<this.cycles;e++)t="".concat(t,", ").concat(e%2>0?this.c1:this.c2);return"".concat(t,")")}hasTransparency(){return V(this.c1)||V(this.c2)}}Object.assign(Ct.prototype,{c1:"white",c2:"black",angle:0,cycles:1});class xt{constructor(t,e,i,s){"number"==typeof t&&(this.lineWidth=t),e&&(this.lineCap=e),i&&(this.lineJoin=i),"number"==typeof s&&(this.miterLimit=s)}getAttributes(){return L(this,["lineWidth|1","lineCap|butt","lineJoin|miter","miterLimit|10"])}setAttributes(t){return U(this,t,["lineWidth","lineCap","lineJoin","miterLimit"])}setStroke(t){return t.lineWidth=this.lineWidth,t.lineCap=this.lineCap,t.lineJoin=this.lineJoin,t.miterLimit=this.miterLimit,t}}Object.assign(xt.prototype,{lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10});class kt{constructor(t,e){t instanceof kt?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}setProperties(t){return this.x=Number(t.attr("x")),this.y=Number(t.attr("y")),this}getAttributes(){return L(this,["x","y"])}setAttributes(t){return U(this,t,["x","y"])}moveBy(t){return this.x+=t.x||t.width||0,this.y+=t.y||t.height||0,this}moveTo(t,e){return"number"==typeof t?(this.x=t,this.y=e):(this.x=t.x,this.y=t.y),this}multBy(t){return this.x*=t.x||t.width||0,this.y*=t.y||t.height||0,this}equals(t){return this.x===t.x&&this.y===t.y}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2),Math.pow(this.y-t.y,2))}clone(){return new kt(this)}}Object.assign(kt.prototype,{x:0,y:0});class St{constructor(t,e){t instanceof kt&&e instanceof kt?(this.width=e.x-t.x,this.height=e.y-t.y):(this.width=t||0,this.height=e||0)}setProperties(t){return this.width=Number(t.attr("width")),this.height=Number(t.attr("height")),this}getAttributes(){return L(this,["width","height"])}setAttributes(t){return U(this,t,["width","height"])}equals(t){return this.width===t.width&&this.height===t.height}multBy(t){return this.width*=t.x||t.width||0,this.height*=t.y||t.height||0,this}setDimension(t,e){return t instanceof St&&(e=t.height,t=t.width),this.width=t,this.height=e,this}getSurface(){return this.width*this.height}}Object.assign(St.prototype,{width:0,height:0});class Tt{constructor(t){this.pos=t||new kt}moveBy(t){return this.pos.moveBy(t),this}moveTo(t){return this.pos.moveTo(t),this}getBounds(){return new Et(this.pos)}equals(t){return this.pos.equals(t.pos)}scaleBy(t){return this}getShape(t){return this.clone().scaleBy(t.dim).moveBy(t.pos)}contains(t){return!1}intersects(t){return!1}fill(t,e){return t.save(),e&&e.getSurface()>0&&(t.beginPath(),t.rect(e.pos.x,e.pos.y,e.dim.width,e.dim.height),t.clip()),this.preparePath(t),t.fill(),t.restore(),t}stroke(t){return this.preparePath(t),t.stroke(),t}preparePath(t){return t}clip(t,e){return this.preparePath(t),t.clip(e||"nonzero"),t}isRect(){return!1}toString(){return"Shape enclosed in ".concat(this.getBounds().getCoords())}setAttributes(t){return Tt.buildShape(t)}static buildShape(t){const e="rect"===t.type&&Et||"ellipse"===t.type&&Pt||"path"===t.type&&It||null;if(e)return(new e).setAttributes(t);console.log("unknown shape:",t)}}Object.assign(Tt.prototype,{type:"shape",pos:new kt,type:"shape"});class Et extends Tt{constructor(t,e,i,s){let n=t,r=e;t instanceof Et?(r=new St(t.dim.width,t.dim.height),n=new kt(t.pos.x,t.pos.y)):t instanceof kt?(n=new kt(t.x,t.y),e instanceof St&&(r=new St(e.width,e.height))):t instanceof Array?(n=new kt(t[0],t[1]),r=new St(t[2]-t[0],t[3]-t[1])):"number"==typeof i&&"number"==typeof s&&(n=new kt(t,e),r=new St(i,s)),super(n),this.dim=r instanceof St?r:r instanceof kt?new St(r.x-this.pos.x,r.y-this.pos.y):new St,this.type="rect"}getBounds(){return this}setBounds(t){return t||(t=new Et),this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this}equals(t){return t instanceof Et&&this.pos.equals(t.pos)&&this.dim.equals(t.dim)}clone(){return new Et(this)}scaleBy(t){return this.pos.multBy(t),this.dim.multBy(t),this}grow(t,e){return this.pos.x-=t,this.pos.y-=e,this.dim.width+=2*t,this.dim.height+=2*e,this}getOppositeVertex(){return new kt(this.pos.x+this.dim.width,this.pos.y+this.dim.height)}add(t){const e=this.getOppositeVertex(),i=t.getBounds().getOppositeVertex();return this.pos.moveTo(Math.min(this.pos.x,t.getBounds().pos.x),Math.min(this.pos.y,t.getBounds().pos.y)),this.dim.setDimension(Math.max(e.x,i.x)-this.pos.x,Math.max(e.y,i.y)-this.pos.y),this}contains(t){const e=this.getOppositeVertex();return t.x>=this.pos.x&&t.x<=e.x&&t.y>=this.pos.y&&t.y<=e.y}intersects(t){const e=this.pos,i=this.getOppositeVertex(),s=t.pos,n=t.getOppositeVertex();return n.x>=e.x&&s.x<=i.x&&n.y>=e.y&&s.y<=i.y}preparePath(t){return t.beginPath(),t.rect(this.pos.x,this.pos.y,this.dim.width,this.dim.height),t}getSurface(){return this.dim.getSurface()}isEmpty(){return 0===this.getSurface()}isRect(){return!0}toString(){return"Rectangle ".concat(this.getCoords())}getCoords(){return"[".concat(Math.round(this.pos.x),",").concat(Math.round(this.pos.y),",").concat(Math.round(this.pos.x+this.dim.width),",").concat(Math.round(this.pos.y+this.dim.height),"]")}getAttributes(){return L(this,["type","pos","dim"])}setAttributes(t){return U(this,t,["type",{key:"pos",fn:kt},{key:"dim",fn:St}])}}Object.assign(Et.prototype,{type:"rect",dim:new St});class Pt extends Et{constructor(t,e,i,s){super(t,e,i,s)}preparePath(t){const e=.5522848,i=e*this.dim.width/2,s=e*this.dim.height/2,n=this.pos.x+this.dim.width,r=this.pos.y+this.dim.height,a=this.pos.x+this.dim.width/2,o=this.pos.y+this.dim.height/2;return t.beginPath(),t.moveTo(this.pos.x,o),t.bezierCurveTo(this.pos.x,o-s,a-i,this.pos.y,a,this.pos.y),t.bezierCurveTo(a+i,this.pos.y,n,o-s,n,o),t.bezierCurveTo(n,o+s,a+i,r,a,r),t.bezierCurveTo(a-i,r,this.pos.x,o+s,this.pos.x,o),t.closePath(),t}contains(t){let e=super.contains(t);if(e){const i=this.dim.width/2,s=this.dim.height/2,n=this.pos.x+i,r=this.pos.y+s;e=Math.pow(t.x-n,2)/Math.pow(i,2)+Math.pow(t.y-r,2)/Math.pow(s,2)<=1}return e}getSurface(){return Math.PI*this.dim.width/2*this.dim.height/2}equals(t){return t instanceof Pt&&super.equals(t)}clone(){return new Pt(this.pos,this.dim)}isRect(){return!1}toString(){return"Ellipse enclosed in ".concat(this.getCoords())}}Object.assign(Pt.prototype,{type:"ellipse"});class It extends Tt{constructor(t){super(),t&&this.setStrokes(t)}setStrokes(t){return this.strokes=[],t.forEach((t=>this.strokes.push(new Bt(t.type||t.action,t.points||t.data)))),this.enclosing=new Et,this.enclosingPoints=[],this.calcEnclosingRect(),this.pos=this.enclosing.pos,this}clone(){return new It(this.strokes.map((t=>t.clone())))}addStroke(t){return this.strokes.push(t),this}calcEnclosingRect(){this.enclosingPoints=[];let t=new kt;this.strokes.forEach((e=>{e.getEnclosingPoints(t).forEach((e=>{t=new kt(e),this.enclosingPoints.push(t)}))}));let e=this.enclosingPoints.length;e>1&&this.enclosingPoints[0].equals(this.enclosingPoints[e-1])&&(this.enclosingPoints.pop(),e--);const i=new kt(this.enclosingPoints[0]),s=new kt(this.enclosingPoints[0]);for(let t=1;t<e;t++){const e=this.enclosingPoints[t];i.x=Math.min(e.x,i.x),i.y=Math.min(e.y,i.y),s.x=Math.max(e.x,s.x),s.y=Math.max(e.y,s.y)}return this.enclosing.setBounds(new Et(i,new St(i,s))),this.enclosing}getBounds(){return this.enclosing}moveBy(t){return this.strokes.forEach((e=>e.moveBy(t))),this.enclosingPoints.forEach((e=>e.moveBy(t))),this.enclosing.moveBy(t),this}moveTo(t){return this.moveBy(new St(t.x-this.pos.x,t.y-this.pos.y))}equals(t){return!1}scaleBy(t){return this.strokes.forEach((e=>e.multBy(t))),this.enclosingPoints.forEach((e=>e.multBy(t))),this.enclosing.scaleBy(t),this}contains(t){let e=this.enclosing.contains(t);if(e){const i=this.enclosingPoints.length;let s=0,n=0,r=this.enclosingPoints[0];for(let e=1;e<=i;e++){const a=this.enclosingPoints[e%i];t.y>Math.min(r.y,a.y)&&t.y<=Math.max(r.y,a.y)&&t.x<=Math.max(r.x,a.x)&&r.y!==a.y&&(s=(t.y-r.y)*(a.x-r.x)/(a.y-r.y)+r.x,(r.x===a.x||t.x<=s)&&n++),r=a}n%2==0&&(e=!1)}return e}intersects(t){return this.enclosing.intersects(t)}preparePath(t){return t.beginPath(),this.strokes.forEach((e=>e.stroke(t))),t}getAttributes(){return{type:this.type,strokes:this.strokes.map((t=>t.getAttributes())).join("|")}}setAttributes(t){const e=t.strokes.split("|").map((t=>{const[e,i]=t.split(":");return new Bt(e,i?i.split(","):[])}));return this.setStrokes(e)}}Object.assign(It.prototype,{type:"path",strokes:[],enclosing:new Et,enclosingPoints:[]});class Bt{constructor(t,e){if(this.type=t,e&&e.length>0)if(e[0]instanceof kt)this.points=e.map((t=>new kt(t)));else{this.points=[];for(let t=0;t<e.length;t+=2)this.points.push(new kt(e[t],e[t+1]))}}static getQuadraticPoints(t,e,i,s){s||(s=vt.BEZIER_POINTS);const n=[],r=new kt,a=new kt;for(let o=0;o<s;o++){const c=(o+1)/(s+1);r.x=t.x+(e.x-t.x)*c,r.y=t.y-(t.y-e.y)*c,a.x=e.x+(i.x-e.x)*c,a.y=e.y+(i.y-e.y)*c,n.push(new kt(r.x+(a.x-r.x)*c,r.y-(r.y-a.y)*c))}return n}static getCubicPoints(t,e,i,s,n){const r=[];n||(n=vt.BEZIER_POINTS);const a=Bt.getQuadraticPoints(t,e,i,n),o=Bt.getQuadraticPoints(e,i,s,n);for(let t=0;t<n;t++){const e=(t+1)/(n+1);r.push(new kt(a[t].x+(o[t].x-a[t].x)*e,a[t].y-(a[0].y-o[0].y)*e))}return r}clone(){return new Bt(this.type,this.points)}moveBy(t){return this.points&&this.points.forEach((e=>e.moveBy(t))),this}multBy(t){return this.points&&this.points.forEach((e=>e.multBy(t))),this}stroke(t){switch(this.type){case"M":t.moveTo(this.points[0].x,this.points[0].y);break;case"L":t.lineTo(this.points[0].x,this.points[0].y);break;case"Q":t.quadraticCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y);break;case"B":t.bezierCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y,this.points[2].x,this.points[2].y);break;case"X":t.closePath()}return t}getEnclosingPoints(t){let e=[];switch(this.type){case"M":case"L":e.push(this.points[0]);break;case"Q":e=Bt.getQuadraticPoints(t,this.points[0],this.points[1]),e.push(this.points[1]);break;case"B":e=Bt.getCubicPoints(t,this.points[0],this.points[1],this.points[2]),e.push(this.points[2])}return e}getAttributes(){return"".concat(this.type,":").concat(this.points?this.points.map((t=>"".concat(K(t.x),",").concat(K(t.y)))).join(","):"")}}Object.assign(Bt.prototype,{type:"X",points:null});class _t{constructor(t,e){this.name=t,this.actionPerformed=e,this._statusListeners=[]}actionPerformed(t,e){return this}processEvent(t){return this.actionPerformed(this,t)}addStatusListener(t){this._statusListeners.push(t)}removeStatusListener(t){this._statusListeners=this._statusListeners.map((e=>e!==t))}setEnabled(t){return this.enabled=t,this._statusListeners.forEach((t=>t.call(this,this))),this}}Object.assign(_t.prototype,{name:null,description:null,enabled:!1,_statusListeners:null});class Ot{constructor(t,e,i){this.actionPerformed=t,this.interval=e,this.setEnabled(!0===i)}actionPerformed(t){return this}processTimer(t){return this.ticks++,this.repeats||this.stop(),this.actionPerformed.call(this)}setEnabled(t,e){if(e||(this.ticks=0),!t||null===this.timer)return t?this.timer=window.setInterval((()=>this.processTimer(null)),this.interval):null!==this.timer&&(window.clearInterval(this.timer),this.timer=null),this}isRunning(){return null!==this.timer}start(t){return this.setEnabled(!0,t)}stop(t){return this.setEnabled(!1,t)}}Object.assign(Ot.prototype,{interval:0,ticks:0,timer:null,repeats:!0});class Rt extends Et{constructor(t,e,i,s){super(t,e,i,s)}invalidate(t){return t?null===this.invalidatedRect?this.invalidatedRect=t.clone():this.invalidatedRect.add(t):this.invalidatedRect=null,this}update(){return this.updateContent(this.invalidatedRect),this.invalidatedRect=null,this}updateContent(t){return this}}Object.assign(Rt.prototype,{invalidatedRect:null});const Dt={Font:At,Gradient:Ct,Stroke:xt,Point:kt,Dimension:St,Shape:Tt,Rectangle:Et,Ellipse:Pt,Path:It,PathStroke:Bt,Action:_t,Timer:Ot,Container:Rt};class Mt{constructor(t){this.player=t,this.sequenceStack=[],window&&window.history&&t.options.browserHistory&&(this.browserHistory=!0,e()(window).on("popstate",(t=>{const e=t.originalEvent.state;e&&this.processPopStateEvent(e)})))}processPopStateEvent(t){b("info","Processing History popstate event with state:",t),this.processingPop=!0,t.projectPath===this.player.project.path&&_(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}pushBrowserHistory(){if(this.browserHistory){if(this.processingPop)return void(this.processingPop=!1);const t=this.player.project.activitySequence,e=t.currentAct,i=this.player.actPanel.act.name||"No name",s=new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null);window.history.state?window.history.pushState(s,i):window.history.replaceState(s,i)}}storedElementsCount(){return this.sequenceStack.length}clearHistory(){this.sequenceStack=[0]}push(){if(null!==this.player.project&&null!==this.player.project.path){const t=this.player.project.activitySequence,e=t.currentAct;if(e>=0){if(this.sequenceStack.length>0){const t=this.sequenceStack[this.sequenceStack.length-1];if(t.projectPath===this.player.project.path&&t.activity===e)return}this.sequenceStack.push(new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null))}}}pop(){if(this.sequenceStack.length>0){const t=this.sequenceStack.pop();t.projectPath===this.player.project.path&&_(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.testMode&&null!==t.projectPath&&t.projectPath.length>0?b("info",'At this point, a jump to "'.concat(t.projectPath,'" should be performed.')):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}return!0}processJump(t,e){let i=!1;if(null!==t&&null!==this.player.project)switch(t.action){case"STOP":break;case"RETURN":if(this.sequenceStack.length>0||!this.player.options.returnAsExit){i=this.pop();break}case"EXIT":this.testMode?b("info","At this point, the program should exit."):this.player.exit(t.sequence);break;case"JUMP":if(t.sequence||t.projectPath)this.testMode&&null!==t.projectPath&&t.projectPath.length>0?b("info",'At this point, a jump to "'.concat(t.projectPath,'" should be performed.')):i=this.jumpToSequence(t.sequence,t.projectPath?st(this.player.project.basePath,t.projectPath):null,e);else{const s=this.player.project.activitySequence.getElement(t.actNum,!0);null!==s&&(e&&this.push(),this.player.load(null,null,s.activity),i=!0)}}return i}jumpToSequence(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(B(t)&&B(e))return!1;if(B(e)&&(e=this.player.project.path),this.sequenceStack.length>0){const i=this.sequenceStack[this.sequenceStack.length-1];if(!B(t)&&e===i.projectPath){let s=t===i.sequence;if(e===this.player.project.path){const e=this.player.project.activitySequence.getElement(i.activity,!1);s=null!==e&&t===e.tag}if(s)return this.pop()}}return i&&this.push(),e===this.player.project.path?this.player.load(null,t,null):this.player.load(e,t,null),!0}}Object.assign(Mt.prototype,{player:null,sequenceStack:[],testMode:!1,browserHistory:!1,processingPop:!1,HistoryElement:class{constructor(t,e,i,s){this.projectPath=t,this.sequence=e,this.activity=i,this.fullZipPath=s}}});const Nt=Mt;class Vt{constructor(t){navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&(this.enabled=!0),t&&(this.seconds=t),this.chunks=[]}play(){this.stop(),this.mediaPlayer?(this.mediaPlayer.currentTime=0,this.mediaPlayer.play()):this.playWhenFinished=!0}stop(){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.mediaPlayer&&!this.mediaPlayer.paused&&this.mediaPlayer.pause()}record(t){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.enabled&&(this.stop(),this.mediaPlayer=null,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((e=>{this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>this.chunks.push(t.data),this.mediaRecorder.onerror=t=>{b("error","Error recording audio: ".concat(t)),this.mediaRecorder=null},this.mediaRecorder.onstart=()=>{b("debug","Recording audio started"),this.visualFeedbak(!0,t)},this.mediaRecorder.onstop=()=>{b("debug","Recording audio finished"),this.visualFeedbak(!1,t),this.timeoutID&&(window.clearTimeout(this.timeoutID),this.timeoutID=null);const e={};this.chunks.length>0&&this.chunks[0].type&&(e.type=this.chunks[0].type);const i=new Blob(this.chunks,e);this.chunks=[],this.mediaPlayer=document.createElement("audio"),this.mediaPlayer.src=URL.createObjectURL(i),this.mediaPlayer.pause(),this.mediaRecorder=null,this.playWhenFinished&&(this.playWhenFinished=!1,this.mediaPlayer.play())},this.mediaRecorder.onwarning=t=>b("warn","Warning recording audio: ".concat(t)),this.playWhenFinished=!1,this.mediaRecorder.start(),this.timeoutID=window.setTimeout((()=>{this.mediaRecorder,this.mediaRecorder.stop()}),1e3*this.seconds)})).catch((e=>{b("error",e.toString()),this.visualFeedbak(!1,t)})))}visualFeedbak(t,e){e&&e.css("cursor",t?"progress":"inherit")}clear(){this.stop(),this.mediaPlayer=null}}Object.assign(Vt.prototype,{enabled:!1,seconds:20,mediaRecorder:null,chunks:null,mediaPlayer:null,timeoutID:null,playWhenFinished:!1}),Vt.MAX_RECORD_LENGTH=180;const jt=Vt;class qt{constructor(t,e,i){switch(this.mc=t,this.ps=i,t.type){case"RECORD_AUDIO":qt.AUDIO_BUFFERS&&(this.clearAudioBuffer(t.recBuffer),qt.AUDIO_BUFFERS[t.recBuffer]=new jt(t.length));case"PLAY_RECORDED_AUDIO":this.useAudioBuffer=!0;break;case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":this.mbe=e.getElement(t.file,!0)}}realize(){this.mbe&&this.mbe.build((t=>{t.data&&t.data.pause&&!t.data.paused&&!t.data.ended&&t.data.currentTime&&t.data.pause(),"video"!==t.type&&"anim"!==t.type||!t.data||(this.$visualComponent=e()(t.data),this.$visualComponent.css("z-index",20))}),this.ps,!1,this.mc.level)}playNow(t){if(this.useAudioBuffer){if(qt.AUDIO_BUFFERS){const t=this.ps&&this.ps.$div,e=qt.AUDIO_BUFFERS[this.mc.recBuffer];e&&("RECORD_AUDIO"===this.mc.type?e.record(t):e.play())}}else this.mbe&&this.mbe.build((()=>{if(this.mbe.data){if("midi"===this.mbe.type)this.mbe.data.playTo=this.mc.to||0;else{let t=!1;const i=e()(this.mbe.data);i.off(),this.mc.to>0&&i.on("timeupdate",(()=>{t&&this.mbe.data.currentTime>=this.mc.to/1e3&&(i.off("timeupdate"),this.mbe.data.pause())})),t=!0}this.mbe.data.paused||this.mbe.data.ended||!this.mbe.data.currentTime||this.mbe.data.pause(),this.mbe.data.currentTime=this.mc.from>0?this.mc.from/1e3:0,this.mbe.data.play()}}),this.ps,!0,this.mc.level)}play(t){this.stopAllAudioBuffers(),this.playNow(t)}stop(){this.useAudioBuffer?this.stopAudioBuffer(this.mc.recBuffer):this.mbe&&this.mbe.data&&this.mbe.data.pause&&!this.mbe.data.paused&&!this.mbe.data.ended&&this.mbe.data.currentTime&&this.mbe.data.pause()}clear(){this.stop(),this.useAudioBuffer&&this.clearAudioBuffer(this.mc.recBuffer)}clearAudioBuffer(t){qt.AUDIO_BUFFERS&&t>=0&&t<qt.AUDIO_BUFFERS.length&&qt.AUDIO_BUFFERS[t]&&(qt.AUDIO_BUFFERS[t].clear(),qt.AUDIO_BUFFERS[t]=null)}clearAllAudioBuffers(){qt.AUDIO_BUFFERS&&qt.AUDIO_BUFFERS.forEach(((t,e)=>this.clearAudioBuffer(e)))}countActiveBuffers(){return qt.AUDIO_BUFFERS?qt.AUDIO_BUFFERS.reduce(((t,e)=>t+e?1:0),0):0}stopAllAudioBuffers(){qt.AUDIO_BUFFERS&&qt.AUDIO_BUFFERS.forEach((t=>t?t.stop():null))}stopAudioBuffer(t){qt.AUDIO_BUFFERS&&t>=0&&t<qt.AUDIO_BUFFERS.length&&qt.AUDIO_BUFFERS[t]&&qt.AUDIO_BUFFERS[t].stop()}checkVisualComponentBounds(t){}setVisualComponentVisible(t){}linkTo(t){this.bx=t,this.bx&&this.$visualComponent&&this.bx.setHostedComponent(this.$visualComponent)}}Object.assign(qt.prototype,{mc:null,ps:null,bx:null,$visualComponent:null,useAudioBuffer:!1,mbe:null}),qt.REC_ENABLED="undefined"!=typeof MediaRecorder&&"undefined"!=typeof navigator,qt.REC_ENABLED&&(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia),qt.AUDIO_BUFFERS=qt.REC_ENABLED?[]:null;const Lt=qt;class Ft{constructor(){this.players=[]}createActiveMediaPlayer(t,e,i){let s=null;switch(t.type){case"RECORD_AUDIO":if(t.length<=0||t.length>=vt.MAX_RECORD_LENGTH)break;case"PLAY_RECORDED_AUDIO":if(t.recBuffer<0||t.recBuffer>=10)break;case"PLAY_AUDIO":case"PLAY_MIDI":case"PLAY_VIDEO":s=new Lt(t,e,i)}return null!==s&&this.players.push(s),s}getActiveMediaPlayer(t,e,i){return this.players.find((e=>e.mc===t||e.mc.isEquivalent(t)))||this.createActiveMediaPlayer(t,e,i)}removeActiveMediaPlayer(t){const e=this.players.findIndex((e=>e.mc===t));e>=0&&(this.players[e].clear(),this.players.splice(e,1))}realizeAll(){this.players.forEach((t=>t.realize()))}stopAll(t){void 0===t&&(t=-1),this.players.forEach((e=>{(-1===t||null!==e.mc&&e.mc.level<=t)&&e.stop()}))}removeAll(){this.players.forEach((t=>t.clear())),this.players.length=0,Lt.prototype.clearAllAudioBuffers()}}Object.assign(Ft.prototype,{players:[]});const zt=Ft;class Ut extends Rt{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(),this.ps=t,null!==i&&(this.name=i),this.options=s,this.options.skinId&&(this.skinId=this.options.skinId),!Ut.registerStyleSheet(this.skinId,t)){let e=this._getStyleSheets("default"),i=this._getStyleSheets("twoThirds");i.length>0&&(e+=" @media (max-width:".concat(this.twoThirdsMedia.width,"px),(max-height:").concat(this.twoThirdsMedia.height,"px){").concat(i,"}"));let s=this._getStyleSheets("half");s.length>0&&(e+=" @media (max-width:".concat(this.halfMedia.width,"px),(max-height:").concat(this.halfMedia.height,"px){").concat(s,"}")),ut(e.replace(/\.ID/g,".".concat(this.skinId)),t)}let n="";this.$div=e()("<div/>",{class:this.skinId}),this.$playerCnt=e()("<div/>",{class:"JClicPlayerCnt"}),this.$progress=e()("<progress/>",{class:"progressBar"}).css({display:"none"}),this.$waitPanel=e()("<div/>").css({display:"none","background-color":"rgba(255, 255, 255, .60)","z-index":99}).append(e()("<div/>",{class:"waitPanel"}).css({display:"flex","flex-direction":"column"}).append(e()("<div/>",{class:"animImgBox"}).append(e()(this.waitImgBig),e()(this.waitImgSmall))).append(this.$progress)),this.$playerCnt.append(this.$waitPanel),this.buttons=j(Ut.prototype.buttons),this.counters=j(Ut.prototype.counters),this.msgArea=j(Ut.prototype.msgArea),this.$dlgOverlay=e()("<div/>",{class:"dlgOverlay"}).css({"z-index":98,position:"fixed",left:0,top:0,width:"100%",height:"100%",display:"none","background-color":"rgba(30,30,30,0.7)"}).on("click",(()=>(this._isModalDlg||this._closeDlg(!0),!1)));const r=e()("<div/>",{class:"dlgDiv",role:"dialog","aria-labelledby":t.getUniqueId("ReportsLb"),"aria-describedby":t.getUniqueId("ReportsCnt")}).css({display:"inline-block",position:"relative",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}).on("click",(()=>!1));this.$dlgMainPanel=e()("<div/>",{class:"dlgMainPanel",id:t.getUniqueId("ReportsCnt")}),this.$dlgBottomPanel=e()("<div/>",{class:"dlgBottomPanel",role:"navigation"}),this.$div.append(this.$playerCnt,this.$dlgOverlay.append(r.append(this.$dlgMainPanel,this.$dlgBottomPanel))),n=m("JClic logo"),this.$infoHead=e()("<div/>",{class:"infoHead"}).append(e()("<div/>",{class:"headTitle unselectableText"}).append(e()(this.appLogo,{"aria-label":n}).css({width:"1.5em",height:"1.5em","vertical-align":"bottom"}).on("dblclick",(()=>{v("all"),b("trace",'Log level set to "trace"')}))).append(e()("<span/>").html("JClic.js"))).append(e()("<p/>").css({"margin-top":0,"margin-left":"3.5em"}).append(e()("<a/>",{href:"https://projectes.xtec.cat/clic/"}).html("https://projectes.xtec.cat/clic/")).append(e()("<br>")).append(e()("<span/>").html("".concat(m("Version")," ").concat(vt.VERSION)))),this.$reportsPanel=e()("<div/>",{class:"reportsPanel",role:"document"}),n=m("Copy data to clipboard"),this.$copyBtn=e()("<button/>",{title:n,"aria-label":n}).append(e()(this.copyIcon).css({width:"26px",height:"26px"})).on("click",(()=>{const t=new ClipboardItem({"text/plain":new Blob(["===> ".concat(m("The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor")," <===")],{type:"text/plain"}),"text/html":new Blob([this.$reportsPanel.html()],{type:"text/html"})});navigator.clipboard.write([t]).then((()=>this.$copyBtn.parent().append(e()("<div/>",{class:"smallPopup"}).html(m("The data has been copied to clipboard")).fadeIn().delay(3e3).fadeOut((function(){e()(this).remove()}))))).catch((t=>this.$copyBtn.parent().append(e()("<div/>",{class:"smallPopup"}).html("ERROR: Unable to write data into the clipboard: ".concat(t)).fadeIn().delay(3e3).fadeOut((function(){e()(this).remove()})))))})),n=m("Close"),this.$closeDlgBtn=e()("<button/>",{title:n,"aria-label":n}).append(e()(this.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",(()=>this._closeDlg(!0))),n=m("OK"),this.$okDlgBtn=e()("<button/>",{title:n,"aria-label":n}).append(e()(this.okDialogIcon).css({width:"26px",height:"26px"})).on("click",(()=>this._closeDlg(!0))),n=m("Cancel"),this.$cancelDlgBtn=e()("<button/>",{title:n,"aria-label":n}).append(e()(this.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",(()=>this._closeDlg(!1))),Ut.skinStack.push(this)}static registerClass(t,e){return Ut.CLASSES[t]=e,e}static registerStyleSheet(t,e){let i=!1;const s=ht(e);s.__JClicID||(s.__JClicID="SK".concat(Ut.lastId++));let n=Ut.rootStyles[s.__JClicID];return n||(n=[],Ut.rootStyles[s.__JClicID]=n),n.indexOf(t)<0?(b("trace",'Stylesheet "'.concat(t,'" has been registered for root node labeled as "').concat(s.__JClicID,'"')),n.push(t)):i=!0,i}static getSkin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t=t||"default","@"===t.charAt(0,1)&&t.endsWith(".xml")&&(t=t.substring(1,t.length-4)),t&&e){const i=Ut.skinStack.find((i=>i.name===t&&i.ps===e));if(i)return i}let s=Ut.CLASSES[t];if(!s){const n=e.project.mediaBag.getElement(t,!1);n&&n.data&&(i=Object.assign({},i,n.data),i.skinId="JClic-".concat(t.replace(".xml",""))),!e.zip&&"edu.xtec.jclic.skins.BasicSkin"===i.class&&i.image&&e.project.mediaBag.getElement(i.image,!1)&&e.project.mediaBag.getElement(i.image,!1).data?s=Ut.CLASSES.custom:(b("warn","Unknown skin class: ".concat(t)),s=Ut.CLASSES.default)}return new s(e,t,i)}_getStyleSheets(){return"default"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default")?this.basicCSS+this.waitAnimCSS+this.reportsCSS:""}attach(t){this.detach(),null!==t&&null!==t.skin&&t.skin.detach(),this.player=t,this.$playerCnt.prepend(t.$div),this.setSkinSizes(),t.$mainContainer.append(this.$div)}setSkinSizes(t){var e;const i={},s=(null===(e=this.player)||void 0===e?void 0:e.$topDiv.height())||0,n=this.player.fullScreenChecked?"inherit":null;void 0===t&&(t=!(!document||!document.fullscreenElement)),ct(t?"100vw":this.ps.options.minWidth,i,"min-width",n),ct(t?"100vh":this.ps.options.minHeight,i,"min-height",n),ct(t?"100vw":this.ps.options.maxWidth,i,"max-width",n),ct(t?"100vh":this.ps.options.maxHeight,i,"max-height",n),ct(t?"100vw":this.ps.options.width,i,"width","100%"),ct(t?"100vh":this.ps.options.height,i,"height",s>0?"100%":"100vh"),this.$div.css(i)}detach(){null!==this.player&&(this.player.$div.remove(),this.$div.detach(),this.player=null)}updateContent(t){if(this.$msgBoxDivCanvas){const e=this.$msgBoxDivCanvas.get(-1).getContext("2d");e.clearRect(0,0,e.canvas.clientWidth,e.canvas.clientHeight),this.msgBox.update(e,t)}return super.updateContent()}resetAllCounters(t){e().each(this.counters,((e,i)=>{null!==i&&(i.value=0,i.countDown=0,i.enabled=t,i.refreshDisplay())}))}setWaitCursor(t){if(void 0===t)this.$waitPanel&&this.$waitPanel.css({display:this.waitCursorCount>0?"initial":"none"});else{switch(t){case!0:this.waitCursorCount++;break;case!1:--this.waitCursorCount<0&&(this.waitCursorCount=0);break;case"reset":this.waitCursorCount=0}this.setWaitCursor()}}setProgress(t,e){this.$progress&&(this.currentProgress=t,t<0?this.$progress.css({display:"none"}):(e&&(this.maxProgress=e,this.$progress.attr("max",e).css({display:"initial"})),this.$progress.attr("value",t)),b("trace","Progress: ".concat(this.currentProgress,"/").concat(this.maxProgress)))}incProgress(t){this.currentProgress>=0&&this.setProgress(this.currentProgress+(t||1))}showHelp(t){}showDlg(t,e){return new Promise(((i,s)=>{this._dlgOkValue="ok",this._dlgCancelValue="cancelled",this._isModalDlg=t,this.$dlgMainPanel.children().detach(),this.$dlgBottomPanel.children().detach(),e.main&&this.$dlgMainPanel.append(e.main),e.bottom&&this.$dlgBottomPanel.append(e.bottom),this._closeDlg=t=>{t&&i?i(this._dlgOkValue):!t&&s&&s(this._dlgCancelValue),this.$dlgOverlay.css({display:"none"}),this.enableMainButtons(!0),this._closeDlg=Ut.prototype._closeDlg},this.enableMainButtons(!1),this.$dlgOverlay.css({display:"initial"})}))}enableMainButtons(t){this.$playerCnt.find("button").attr("tabindex",t?"0":"-1")}_closeDlg(){}showReports(t){return this.$reportsPanel.html(this.$printReport(t)),this.showDlg(!1,{main:[this.$infoHead,this.$reportsPanel],bottom:[this.$copyBtn,this.$closeDlgBtn]})}$printReport(t){let i=[];if(t){const s=t.getData(),n=new Date(s.started);i.push(e()("<div/>",{class:"subTitle",id:this.ps.getUniqueId("ReportsLb")}).html(m("Current results")));const r=e()("<table/>",{class:"JCGlobalResults"});r.append(rt.doubleCell(m("Session started:"),"".concat(n.toLocaleDateString()," ").concat(n.toLocaleTimeString())),rt.doubleCell(m("Reports system:"),"".concat(m(s.descriptionKey)," ").concat(s.descriptionDetail))),s.userId?r.append(rt.doubleCell(m("User:"),s.userId)):s.user&&r.append(rt.doubleCell(m("User:"),s.user)),s.sequences>0?(s.sessions.length>1&&r.append(rt.doubleCell(m("Projects:"),s.sessions.length)),r.append(rt.doubleCell(m("Sequences:"),s.sequences),rt.doubleCell(m("Activities done:"),s.activitiesDone),rt.doubleCell(m("Activities played at least once:"),"".concat(s.playedOnce,"/").concat(s.reportable," (").concat(C(s.ratioPlayed/100),")"))),s.activitiesDone>0&&(r.append(rt.doubleCell(m("Activities solved:"),"".concat(s.activitiesSolved," (").concat(C(s.ratioSolved/100),")"))),s.actScore>0&&r.append(rt.doubleCell(m("Partial score:"),"".concat(C(s.partialScore/100)," ").concat(m("(out of played activities)"))),rt.doubleCell(m("Global score:"),"".concat(C(s.globalScore/100)," ").concat(m("(out of all project activities)")))),r.append(rt.doubleCell(m("Total time in activities:"),k(1e3*s.time)),rt.doubleCell(m("Actions done:"),s.actions))),i.push(r),s.sessions.forEach((t=>{if(t.sequences.length>0){const n=e()("<table/>",{class:"JCDetailed"});i.push(e()("<p/>").html(s.sessions.length>1?"".concat(m("Project")," ").concat(t.projectName):"")),n.append(e()("<thead/>").append(e()("<tr/>").append(rt.th(m("sequence")),rt.th(m("activity")),rt.th(m("OK")),rt.th(m("actions")),rt.th(m("score")),rt.th(m("time"))))),t.sequences.forEach((t=>{let i=e()("<tr/>").append(e()("<td/>",{rowspan:t.activities.length}).html(t.sequence));t.activities.forEach((t=>{if(t.closed)i.append(rt.td(t.name)),i.append(t.solved?rt.td(m("YES"),"ok"):rt.td(m("NO"),"no")),i.append(rt.td(t.actions)),i.append(rt.td(C(t.precision/100))),i.append(rt.td(k(1e3*t.time)));else{i.append(rt.td(t.name,"incomplete"));for(let t=0;t<4;t++)i.append(rt.td("-","incomplete"))}n.append(i),i=e()("<tr/>")}))})),n.append(e()("<tr/>").append(rt.td(m("Total:")),rt.td("".concat(t.played," (").concat(C(t.ratioPlayed/100),")")),rt.td("".concat(t.solved," (").concat(C(t.ratioSolved/100),")")),rt.td(t.actions),rt.td(C(t.score/100)),rt.td(k(1e3*t.time)))),i.push(n)}}),this)):i.push(e()("<p/>").html(m("No activities done!")))}return i}enableCounter(t,e){this.counters[t]&&this.counters[t].setEnabled(e)}doLayout(){this.player.doLayout(),this.$msgBoxDiv&&window.setTimeout((()=>{this.$msgBoxDivCanvas&&this.$msgBoxDivCanvas.remove();const t=this.$msgBoxDiv.outerWidth(),i=this.$msgBoxDiv.outerHeight();null!==this.$msgBoxDivCanvas&&this.msgBox.dim.widht===t&&this.msgBox.dim.height===i||(this.$msgBoxDivCanvas=e()('<canvas width="'.concat(t,'" height="').concat(i,'"/>')),this.msgBox.setBounds(new Et(0,0,t+1,i)),this.msgBox.buildAccessibleElement(this.$msgBoxDivCanvas,this.$msgBoxDiv)),this.$msgBoxDiv.append(this.$msgBoxDivCanvas),this.updateContent()}),0)}fit(){return this.doLayout(),new St(this.$div.width(),this.$div.height())}setScreenFull(t){if(document&&document.fullscreenEnabled&&(!0===t&&!document.fullscreenElement||!1===t&&!document.fullscreenElement||!0!==t&&!1!==t)){const t=!!document.fullscreenElement;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen();else{const t=this.player.$mainContainer.get(-1);t&&t.requestFullscreen&&t.requestFullscreen()}this.player.fullScreenChecked=!0,this.setSkinSizes(!t)}}actionStatusChanged(t){t.name&&this.buttons[t.name]&&this.setEnabled(this.buttons[t.name],t.enabled)}setEnabled(t,e){t&&e?t.removeAttr("disabled"):t&&t.attr("disabled",!0)}equals(t){return t&&this.name===t.name&&this.ps===t.ps}getMsgBox(){return this.msgBox}}Ut.skinStack=[],Ut.rootStyles={},Ut.lastId=1,Ut.CLASSES={},Object.assign(Ut.prototype,{skinId:"JClicBasicSkin",$div:null,$playerCnt:null,name:"default",options:{},$waitPanel:null,$progress:null,currentProgress:-1,maxProgress:0,msgBox:null,$msgBoxDiv:null,$msgBoxDivCanvas:null,$dlgOverlay:null,$dlgMainPanel:null,$dlgBottomPanel:null,$infoHead:null,$copyBtn:null,$closeDlgBtn:null,$okDlgBtn:null,$cancelDlgBtn:null,_dlgOkValue:null,_dlgCancelValue:null,_isModalDlg:!1,$reportsPanel:null,buttons:{prev:null,next:null,return:null,reset:null,info:null,help:null,audio:null,about:null,fullscreen:null,close:null},counters:{actions:null,score:null,time:null},msgArea:{main:null,aux:null,mem:null},player:null,ps:null,waitCursorCount:0,basicCSS:".ID {\n width: 100%;\n background-color: #3F51B5;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-direction: column;\n flex-direction: column;\n}\n\n.ID .JClicPlayerCnt {\n background-color: lightblue;\n margin: 18px;\n -webkit-flex-grow: 1;\n flex-grow: 1;\n position: relative;\n}\n\n.ID .JClicPlayerCnt>div {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.ID button:not(.StockBtn) {\n background: transparent;\n padding: 0;\n border: none;\n box-shadow: none;\n text-shadow: none;\n}\n\n.ID .unselectableText {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ID .progressBar {\n width: 250px\n}\n",waitAnimCSS:".ID .waitPanel {\n display: -webkit-flex;\n display: flex;\n width: 100%;\n height: 100%;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-align-items: center;\n align-items: center;\n}\n\n.ID .animImgBox {\n position: relative;\n width: 300px;\n height: 300px;\n max-width: 80%;\n max-height: 80%;\n}\n\n.ID .animImgBox svg {\n position: absolute;\n width: 100%;\n height: 100%;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n.ID #waitImgBig {\n animation-duration: 0.8s;\n animation-name: rotate-right;\n}\n\n@keyframes rotate-right {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(1turn);\n }\n}\n\n.ID #waitImgSmall {\n animation-duration: 0.6s;\n animation-name: rotate-left;\n}\n\n@keyframes rotate-left {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(-1turn);\n }\n}\n",waitImgBig:'<svg id="waitImgBig" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 65.99,40.19 c -0.42,5.33 7.80,4.94 8.11,0.20 C 74.50,34.37 66.35,8.59 42.92,7.98 15.90,7.29 9.96,29.50 9.94,39.41 15.33,-1.66 68.61,7.048 65.99,40.19 Z" />\n</svg>\n',waitImgSmall:'<svg id="waitImgSmall" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 57.00,39.43 c -0.28,-3.53 5.16,-3.27 5.37,-0.13 0.26,3.99 -5.13,21.04 -20.63,21.44 C 23.85,61.19 19.93,46.50 19.92,39.94 23.48,67.11 58.73,61.35 57.00,39.43 Z" />\n</svg>\n',reportsCSS:".ID .dlgDiv {\n background-color: #efefef;\n color: #757575;\n font-family: Roboto, sans-serif;\n font-size: 10pt;\n line-height: normal;\n}\n\n.ID .dlgDiv a, a:visited, a:active, a:hover {\n text-decoration: none;\n color: inherit;\n}\n\n.ID .dlgMainPanel {\n padding: 1em 2em;\n max-height: calc(100vh - 8em);\n max-width: calc(100vw - 2em);\n min-width: 20em;\n overflow: auto;\n}\n\n.ID .dlgMainPanel .headTitle {\n font-size: 2.5em;\n font-weight: bold;\n margin: auto;\n}\n\n.ID .dlgMainPanel .subTitle {\n font-size: 1.4em;\n font-weight: bold;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel p {\n font-size: 1.1em;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel table {\n table-layout: fixed;\n width: 40em;\n margin: 0.5em 0 1.7em 0;\n border-collapse: collapse;\n}\n\n.ID .dlgMainPanel select {\n min-width: 20em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n color: #757575;\n}\n\n.ID .dlgMainPanel input {\n margin-left: 1em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n border-color: lightgray;\n}\n\n.ID .infoHead {\n padding: 1em 0em 0.5em;\n}\n\n.ID .JCGlobalResults td {\n padding: 0.4em;\n border-bottom: 1px solid #b6b6b6;\n}\n\n.ID .JCGlobalResults td:first-child {\n font-weight: 600;\n width: 14em;\n}\n\n.ID .JCDetailed td, th {\n border-bottom: 1px solid #b6b6b6;\n padding: 0.3em 0.4em;\n vertical-align: top;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ID .JCDetailed thead {\n font-weight: 600;\n}\n\n.ID .JCDetailed th:first-child {\n width: 7em;\n}\n\n.ID .JCDetailed th:nth-last-child(4) {\n width: 4em;\n}\n\n.ID .JCDetailed th:nth-last-child(-n+3) {\n width: 4.1em;\n text-align: right;\n}\n\n.ID .JCDetailed td:nth-last-child(-n+3) {\n text-align: right;\n}\n\n.ID .JCDetailed .ok {\n color: #4bae4f;\n font-weight: 600;\n}\n\n.ID .JCDetailed .no {\n color: #f34235;\n font-weight: 600;\n}\n\n.ID .JCDetailed tr:last-child {\n font-weight: bold;\n}\n\n.ID .JCDetailed .incomplete {\n font-style: italic;\n}\n\n.ID .dlgBottomPanel {\n height: 3.5em;\n background-color: white;\n padding: 0.5em;\n font-weight: bold;\n text-align: right;\n border-top: 1px solid #eee;\n position: relative;\n}\n\n.ID .dlgBottomPanel .smallPopup {\n background-color: #222;\n color: #ddd;\n padding: 0.5em;\n font-size: 0.9em;\n position: absolute;\n right: 6em;\n top: 1em;\n}\n\n.ID .dlgBottomPanel button {\n display: inline-block;\n padding: 10px;\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .dlgBottomPanel button:hover {\n background-color: #eee;\n border-radius: 80px;\n}\n\n.ID .dlgBottomPanel button:active {\n background-color: #b3e5fc;\n}\n",closeDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',okDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',copyIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />\n</svg>\n',appLogo:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">\n <g transform="matrix(.02081 0 0-.02081 5 62.33)">\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1999 519 3 11 999-266 999-266z" fill="none" stroke="#9d6329" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1998 519 3 11 999-266 999-266" fill="#f89c0e" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994z" fill="none" stroke="#86882b" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994" fill="#d9e70c" />\n </g>\n</svg>\n',halfMedia:{width:376,height:282},twoThirdsMedia:{width:420,height:315}});const Ht=Ut;class $t{constructor(t,e){this.type=t,e&&(this.file=e)}setProperties(t){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"type":this.type=e;break;case"file":this.file=X(e);break;case"params":this.externalParam=X(e);break;case"pFrom":this.absLocationFrom=e;break;case"buffer":this.recBuffer=Number(e);break;case"level":case"from":case"to":case"length":this[t]=Number(e);break;case"px":case"py":null===this.absLocation&&(this.absLocation=new kt(0,0)),"px"===t?this.absLocation.x=Number(e):this.absLocation.y=Number(e);break;case"stretch":case"free":case"catchMouseEvents":case"loop":case"autostart":this[t]=y(e)}})),this}getAttributes(){return L(this,["type","file","externalParam","absLocation","absLocationFrom","recBuffer","level|1","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}setAttributes(t){return U(this,t,["type","file","externalParam",{key:"absLocation",fn:kt},"absLocationFrom","recBuffer","level","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}isEquivalent(t){return this.type===t.type&&(this.file===t.file||null!==this.file&&null!==t.file&&this.file.toLocaleLowerCase()===t.file.toLocaleLowerCase())&&this.from===t.from&&this.to===t.to&&this.recBuffer===t.recBuffer}getDescription(){let t="".concat(this.type);return this.file?t="".concat(t," ").concat(this.file).concat(this.from>=0?" from:".concat(this.from):"").concat(this.to>=0?" to:".concat(this.to):""):this.externalParam&&(t="".concat(t," ").concat(this.externalParam)),t}toString(){return"".concat(this.type).concat(this.file?" ".concat(this.file):"")}getIcon(){let t=null;switch(this.type){case"PLAY_AUDIO":case"PLAY_RECORDED_AUDIO":t="audio";break;case"RECORD_AUDIO":t="mic";break;case"PLAY_VIDEO":t="movie";break;case"PLAY_MIDI":t="music";break;case"URL":t="url";break;default:t="generic"}return t?$t.ICONS[t]:null}}Object.assign($t.prototype,{type:"UNKNOWN",level:1,file:null,externalParam:null,from:-1,to:-1,length:3,recBuffer:0,stretch:!1,free:!1,absLocation:null,absLocationFrom:null,catchMouseEvents:!1,loop:!1,autoStart:!1});const Wt={generic:'<svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M28.8 12L28 8H10v34h4V28h11.2l.8 4h14V12z" />\n</svg>\n',audio:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" />\n</svg>\n',movie:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z" />\n</svg>\n',mic:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" />\n</svg>\n',music:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" />\n</svg>\n',url:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" />\n</svg>\n'};$t.ICONS={},e().each(Wt,((t,e)=>{const i=new Image;i.src=ot(e),$t.ICONS[t]=i}));const Jt=$t;class Gt{constructor(t,e){this.id=t,e&&(Q(e,"data:")?this.audio=new Audio(e):this.file=e)}setProperties(t){return this.file=t.attr("file"),this.enabled=P(t.attr("enabled")),this}getAttributes(){return L(this,["enabled|".concat(2),"file"])}setAttributes(t){return U(this,t,["enabled","file"])}realize(t,e){this.audio||null!==this.player||null===this.file||(this.player=new Lt(new Jt("PLAY_AUDIO",this.file),e,t),this.player.realize())}play(){this.enabled&&(this.audio?(this.audio.currentTime=0,this.audio.play()):this.player&&this.player.play())}stop(){this.enabled&&(this.audio?this.audio.pause():this.player&&this.player.stop())}}Object.assign(Gt.prototype,{file:null,enabled:2,player:null,audio:null});const Kt=Gt;class Zt{constructor(t){t&&(this.elements=Object.assign({},this.elements,t.elements),this.enabled=t.enabled)}setProperties(t){return this.enabled=P(t.attr("enabled"),this.enabled),t.children().each(((t,i)=>{const s=i.getAttribute("id");this.elements[s]=new Kt(s),this.elements[s].setProperties(e()(i))})),this}getAttributes(){return L(this,["enabled|".concat(2),"elements"])}setAttributes(t){return U(this,t,["enabled",{key:"elements",fn:Kt,group:"object"}])}realize(t,i){e().each(this.elements,((e,s)=>s.realize(t,i)))}play(t){if(this.globalEnabled&&this.enabled){const e=this.elements[t];e&&e.enabled&&e.play()}}}Zt.MEDIA={start:"data:audio/mpeg;base64,//NAxAARGk5RdUEQANIEZEBAPGPyIAAYAKMY/6EaQn8hP+c/yEb//kITU7oc9Cf6nPnPoT/8nQhCKEEEnDizkAwM8ThYH1Bj/EAYEhyUGghyivv7fn0vtsLdYI0CiTQE+aaqfH3BW37/80LEFhl6nvZfj1ACplLtsfx19gOQfBp7iHeEWRj8WxiLLI6khikjEI9IvsePycfERCSpPJ9s95IbO1O/tRX70XQiOGX+n+hmeb+aMirKxN/IibInf//G3K9PVym7NoL/W2usCkcMT5T/80DEDBcivuJd0lADkXMLoGxcA7ENhPlAY8LMK280iLkhQq80ojkRQCwz/rEsTjjTlMPMu3RWZ2c3dmONON0NVDzDzDzP79Y9PFg9v//oqi4hHyp+7HGl2b///I8VcYAAls9qrCT1Mv/zQsQKFsrCvlzLRNa/FN/jd/HUrGLUa8tKonzDK8+t55alG5sbKYilBExD8Id1ugmp+eKIdSplGpaoxNZiznEU/J9KJmUsqBzPVjJ/+Aif//71QCdv+gE7f//6gICqPAAci1sbgH8/G//zQMQKFfF2qb9ZaAKU9PlY3uHFsAqAXfgZvyyhtTM2fC1zH/8+tFlslODFHjTHsClFqSTfprRCxdzMcppQ8yHsbbEkzpoLvZFBnWt1GBa/+8se/+SPdQe//FIIsAAAba7YbC65AQAf//NCxA0XMh6xv5OIAEIz0mVENAJ0DbwIQjpGYFNAvTSI1ePBuh+MwYk+xib0DA/K5YQadIk+o0Z0UyLmiv+h5bMD1Ro3/3/TSUggmu/+v/7KNL03CcLAh//5dpCqkltAAAqFFpldqAHI//NAxAwXGl7aXYxoABm/nTyF8EwhIPY/DSOKUIQ2WXUzAlFDQXzyRCXBUNUk33XoqQNhyeltWFUL6CKTImv7/vSZNZw0MP6v/v2oFQ5EUR7/1SVyb//E7FkIn9f9NXWQAg47vXRBbzv/80LEChbaYs5f2IAC9rPHK1z/yygqmvwSoaAGvNLr9jCagdVUGyxOpVqpp79lJPf9ZNEttWXTUvf/9azMUgOcZrZPMThF00d7//v///9SnpUlpJJJJJFeLhp3///yKi4QAHWdrdQE07P/80DEChTJvrI+Ro6Oalhjl3DYQyyMpMHHcIbTFNlqYvp6GKBJBYZ89G+PKyt/Q4oCbx9z9b//80CTA+F3zTlSqOz6G0PoVCIItC3/CnwN/xZAvcr/99VSIAEKz7+UABhWz01LyctXJv/zQsQRE5nOvl4WFHISWA9Ybn87+VaIKzA0kk7n33/KHo6qv1QKoNjMTHtX//ocaRCuGg2MP8jbueS9WIWU3NPcenOEv/CbcsVAKiIkATNv/9QAb60qFitrzbcZQ+ixX7169gCfAOpwHf/zQMQeE+Fasl4T0HJRrdobjyh8XBKr80WAqJQaiQPhY7vmJ4///ppkOhOaLMDbgVOwVdYt0SgqM/4hBQO+qglKQAFQM0aPnrrVvpRJLyCYt2amWVGBpcJrSl6ypI4hgoMQk5Di+Yv3//NCxCkP+IpANGYehC+92dkrPJ/1a+z+3/r/sL/6f+6G7BotKqkVeDWsJLMDPP8pf2a4///Jf+VgHuRkfn85h7MIeAY9RE3ZM3IRTyUaGvCJpep52lDPb0nCY5xRqRkEWzDKgw+8Ftdp//NAxEUS42YhgAhHHAG9ZCQjo0VONppYbQStB6qWUv5f591O8bze0/3y//62eUqnWzSn9vNsnOBzK8TN6urr6bcxGukbeqNZjuyIMO5FREnqzI6SVZVcahzgpCwMa561B4M8zjedy6v/80LEVBI7ViYoCEsdN5b7kv/+Rsub5P/X6yz0/JdhcZdZl+/hII/xFYdTSmc0ck3O0055fkc2R+ZgsyZsEagnMwRqkK1xle//6iZh/ITJmiF/yEKT4QyEKEP8hMQl/mNYxv+hn/lKZyn/80DEZxEbPiWICEc9StmmMZW0r1KXR/qYxnX0UpWMZAxQFqoapnCiQwqxihWDAQEBAQEKE6mZGZGTTMiMjTWZHa/aZkZlTRGXojIzL///////8yP85/5k1lspGrWRyNWCggYME4kGJf/zQsR9EkNiDAAARN1MNUkqTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/zQMSQDcslQAoAR1mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",click:"data:audio/mpeg;base64,//NAxAASsyJgIUEQAY///gX8///yfyHO/8hCEafoRp3nPQgAAEUAABBCEIT//QhCKQhNGyEIQhCNITU5//OQhCN7f/yEZQAAIynOc5CEIhGnABGY/4gAIQZ4h4h4d3Z2Z9Jba5XWhWP/80LEEBhJOxcfiUAC9BEda+oiKFQsViiMpvHFC98pLjySjUNeKoYxMpwIT21HmHlEhx83A9K5vDAuZUQxzq7nJPgEVWKQZ1Iu5oJH3UpGObWV/MfAgLC4Z/yhP/ULKnqHd/syOQenhOL/80DEChZpZs7rzBgAT3bBWub0T/xNtn9nY5bvQdCA0TvnpXNC7EJ3iRPtebJ//7xK4IAqIii2AKbfkBAJxATDLN7wiUGv6VANBNjqQwGCayGoaBAJaNC79/z5wP2IuJbfZsNFgBVo7P/zQsQLF0lGxvRJhlQVDyEmYldHXJGadquTRs6aYmq9VY1hqqt6xmqts2zGTvGNrl+u1IMBHREJREbkpaFQkFRoa2FYSDvBp6DwSf1lgFqfkQ0JcRCYlKxKg0eEw8sKqgaEogGBH3EZpv/zQMQJEyEudaoIBoAf+HV2UBjoOsP2/IwrkezQ1Y4e2wVxgxlVAqDQUSRUBRU6LrBY1lvxEdUBWBIOnZWOCrvlVnTsltWNOqPP4seUBcKgKpW44m3GkHLjaBS4ohHZdTGi6FXXVo6+//NCxBcNYAYyWAhEAJ3U+j3uXdl1z1Du30fCySCGablvUTrhwggLTomAAmrWsmWY9ym89ZcvlwX/zf+a95ZLwXOar/LNrJ60LUl25Hs58yKRWIjSbt9DCIs0UtF/TOlm2cyNTpKysuCB//NAxD0Rw1YliAhHPdmd9nYYQOsGCgAfmqIAXlnhbNZeUBQvyL/y6NlP/r1LLlEiSPL/7lE9SirM5zxZEwCseMDL330yrtl8/8jJs6mt5dTloYsvNSGbmTkYQhpVpRpCG1yr9YSfr1b/80LEURFLZiWQCEc8v/rLXPzys+Z9z8v+H9qyCMpGLn3bla9qtcxYZXk9cbOUjb8t0q2ytz79ImM1R0ht3QdWK11myihIpt8SZBRAlbWq3CDpDKWUte/VHgJDH6k+lsqSPbRj+pHWWrL/80DEZxKjYh2ICIfhxIKhMBeLPjgKlFRIKjCxIKjCukkFAKCSCxFtgTAQFIkisqIg2EngUVFg8FQCQUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsR3EnAF9kgARgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",actionOk:"data:audio/mpeg;base64,//NAxAAT+gKmPUFoAI81KAANYQZECuQAASjAD820006kC+buYDgGEGEKIcsCYAUQYA6JeI2JmS5wcY5yXL6b1IJpp6kG////9X+h/oaaaadAvpvBA5/9QIDQQOQ+cbQllsQQAKTggvn/80LECxdCcupdjFACwA8cFoNFZuosRJUe3E48kEhWIRueePjSdR4T9XMQ4SwB/BZ1GQNAtHHOPzOFryImV2zlb//rZV/6MYp56IY00sPgvi5vp1NN///3Q4ZlSUVV6wAAHLn//b/+Bv3/80DEChbo7s5fmGgA8cDgPEdPslrmVdkwdsV66+p2vZktFECYbF0sxMc6XTyGfU7omIDWqTLdIdocopcSHkqkN/1OLnGEiTI5lQIHz6F//h8+Aw////SWn6Ai////RQCALJttttthGP/zQsQJFgLXBl+PUAJpUBpuDr/a/Bn7vbuBpTSaJu9C26HLGnV05pymMa+52rjwoQl9HX5xkseQEWn/zR+C+CGcTN1IQsr/O/6N///////zyotv//Ulb+WNu/4a/G/DAGASAsBQ86QpAv/zQMQNFyqWqFWaUACorGJ3w70JwQXdB1Iw8FBR6w8BkLlXmCwSQKbRFEDGyFEFw/LiWNeT8eOSG/++3///5oEpv5wrF/RmoYsz////+yuLZ55GT//yosfyqj5gugANMBv///+Bt0Bw//NCxAsWul7hv49QAIAcsuZ3XnIKHgXVwYS+wjbgGuEvA8WjfAsaQmNk2QkZh5517ceH7uZegsm5y///0VTDzzDz09dev/6IIMKcL8i/5CSjE3/oqRMBZpmk7R/RgAAbjwkkcZrZNKRG//NAxAwW4j6pudpoAwwbDspelxARGBQ5l21KTHGz7RkyVSuLZ5l3/S9SQ1CutfuvPzIvF4HUFzRXNkiXJVH+pv//mvMTVRJGyT6S29LRao2Wqj///UbLJxLHVPBVD9SWyADnc5p6REf/80LECxb6Uoxe3A7SY0MyGLYtINLEx4dXVEEvywRGZ7pcZEtrkjRpam6yOArCCRZNX/W3WOoGKq04z/0I/nt/UCYZf6GfovMahvTn21oZ7KnY4oNhuRFQuLsBID8cKC5qSQAC9j29EzH/80DECxNZYoT+xuAyRLbuBA8WRBNAN0Eq+mboAV7G62xjgCvi7cM0Ov1kOELDyoy/75RGdB8iaMZJ//S9SaPWe8oonsV4o5NO40K5FG2xNQZo78WcFOwcZjQQYvlIW6mGkh0f0ZiOBv/zQsQYE8jiVBDfVogDF7hUFzGQhTgpeTFkKEeXlL8syjVHZ03ZCDR2nSxR7Pq7np3LRaHB9adBZ07r018kdy3tjTX1KiSqekjtoMGlaAKNEYCZkOHzpZziA0FmwmEDZhMwfvxGWFAY3P/zQMQkE5DaRAjW1ohECprRK1TRrKRtJsNpyJrNfLvndF7g+gSnAyt351B5obyX8r/u//////rqgBmlYGs01hNdBQpEQyNoHhEMuUtgytPS01oLy0hu6NVNabzryYxwzfIqvKPaRFls//NCxDAQ+FYw8gjSKH7tHbMxfJlUtVpIB16SI0SEXBsf68/+/L//zfLll/nmj7F/1pcpZ/+Z3Ur5Eq5WpbM9MfPljxeb9Lamv/nXIuOSkVXJVRmzRxLpVUlMiBhOahamKCgmCgSwVXHX//NAxEgRU1YcAABGvSNI0Nzzp5SNpUj5aE3ZUqAvIkhEnnq1D3/yxFqrceAgEVIho8WKlhKVGBUJHjzvOh0JndVbtdYykkFQmdDoaDqCIaLKTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqr/80LEXRFYBf5ICEYAqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",actionError:"data:audio/mpeg;base64,//M4xAAUuVJUAUgYARcXFz4DgFAeKHAeChiIie7u+iaIibgYuAYGcTz3OIhf/Xd38v+J6J7u+gGBiw8P8PDw8PDHRw8/+O6GADo/h78BEQz8HAHh5+v+A4A6H/8AAEfIiZmZBXlicwVCsWj1//M4xAwYWvL/H4goAHY5EADTzSBEDUpfz/OhTMPGC+NAMWAgfAcAgHFSjhZD1PCRAUQFBjMUxMhGGuOVyndnXzvlH2dGLp+jbHsUykMTTFkX/+ror2841v+k//+MIOdv/GUVmvrpkGSqAYta//M4xAkXMsLmN89oAg/iwxc/bCcqY374+ZYv8ms1WUWQHQlTUFCJgbIjvMcd6K1m71G+ttB9Pt32bR6OptTZxtV0l/ov20P3b9/1/1f0dSCkh7FjKTdSRbQKiRLyBKFroXi7uP0CAvGOAWNk//M4xAsXwr7a/mPUwS+O1HXtgEWD0qvqiuk8xOG4QoqkAU5eFUIMYl8WHoK3Hcq2dx5p5fTjLvlFtLucF2SuaciHhslc4JhNnm5XU2pCS6c3n6+3/9GyFsk+xwWUQmSTumm7e5ggAEWsUBor//M4xAsXCrLXHntO7NUoPTkrtfAzt+Vmc1QDhdvOk4mMiMaxzG9AERpgbNKfJVp0/lfOvjfl9SWj5XpoXfIYVep7R0WTaUAGDj1IkMHy1Oyrfnfq2e37/22fJduLdKpFmVawABglJaFVG03L//M4xA0XurK+5HnLTJeQXpCP4L6DAO1L6jOnPOCx/wVBu4nAIHEgOCbXJbP5R/74hGiwND1iw7BYtTsqM6viJ1aoa14o/kdXwsdo2K6nxravl7al1/t+rUDz4J+IDtW7bbVAX+3gDwiUL8lI//M4xA0Xgq7qVnoO+zaBvGmHeGt1WGsEPh7RWPKQT82FEhiWLGeUlRHjRERFE6UUhhATy9J5Lcv+PM+axpVIkaHDqqvi+yUHdjW3sp2vTv+rav9F/Kt+Lm9QJFdnwrvt7SXHLLMAFKoGoNaO//M4xA4UurLyXkDFT5XYo5iQ9ckoWFh61037WowPpb5NVRWlrUmVVqxmNV/b6q+xuJVfY1VVXfDHvnL7TGOFMb6ifdZf0etaP//lZH6FbyuK5MUAYWLKUvoamjS5tZpdNnrWz2ASUXdsckcS//M4xBoUcVJ4IisMydfHkiAUZzmoyajzSOzOf1T9qlFq+ORkFFeC//HxXOxf/PKPG/CNxYO4+WKbl+Lv4VBQU6KKhP/K/+vK3+WXVv/9SobSZ1b/lb9SshjN9S/Upahjf/LMahjv6qx/DpAR//M4xCcS40IEABDN5DMaqqrVVVjWLGPjH7GpWZ/7dqr47Eq/7HQds4duAxGfzkjUTpoLSIv///qn///YxTAwQIGhyP/u7O/3P2eqNZ2k4so4sp2NFAYhnZ2couBNTEFNRTMuOTkuNVVVVVVV//M4xDoKqz1wDACNy1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",finishedOk:"data:audio/mpeg;base64,//NAxAAQiXIEAUIQAPnfO/OdyAYGehP/U5Gqd+c/8785zoBi3QhCMpCVP+SpwM6AYGODH/8TvB+sPiMP5cMCcPygIAg7/lAff4IAgcBCD6ofD4diQbC0WaISi0SB3EAzA8WZgeALXg3/80LEGBoDGyZfglACgsRODRuWFcnMLm+eQEhRVQz5IePy5Icm/2Yn5GLY58hG3/J0JyAkq54WhVHosmkTmr//OYkIx+aejta5yObVf////fbcgJP/8oP//L/+w6tzSgKyRVuaO6jleQb/80DEDBdLJs4/2FABfMefV3NU1/Pu+MiMj5TGccdZM7mtR9poqDaj269WQ7clU5//OzTSgSRYFoL8eoeaaxhw+u9lq/9jn/NY7/3VPohqW+///////5ELQ+cqSm8F1QfSAHmkZP3Rz//zQsQJFgHCul9ZUACtuzlS2auXefrUxQUkTU+etjYpBz++SrehymLQlDIbPScu+uppsoFMTf/5uSiO7kpKKo1ONQ6/NbKkDv8iJj3OE/xEHRQl1Hv//4UPLBeWtoFTaaAttttstQEAgP/zQMQNF1PXDl+BUAJQhUAPuz0DJsKELcVBuf+NDz79ceCoSE/meeYSBfk6fQt91kZOYYxE3/+2YwtnyQxn////0JHMY+w/H5OSN/////zDGf5+p7///////kjSQxXTFGTyENw7gapG//NCxAoVUeLUAYKYABCegFrFga4BpxsoJJHKbdSSNc9rTRNTiRTtofSWUkUt1o19fWkoiIJAGaRYixFlM4yQ2FK7pDOlX6q0Ty0TFQNc910f521f//sEw5VqWAAa0xN/4IJysXXPUXWj//NAxBAYQc7CX9RQAD7L1moNjonkAxWFww4nWd9JCeciFDR6QsKgKiayKccZU7pWdi9jnzTd7C9HzWNZFE6VNY70udouzEPUInt/WdLG0YKntR5SDn/rBWjQpBIJjCnEADG403RAjmT/80LEChYx1rpfU2gCXkzXRRXSZBTHSfAUM4JVGmSJvr92ZalqJzOtY1C+n3qXd7ojHpJVph9KfTv2QF00S62UsnjyUkk+pbH0Uf+akuloBUN9eziVT/Kbf//1pSuJ/YIvIGDjaERizGT/80DEDRciBtzLgWgAnyaG0C1lwTMAJBpi0QiX27oskt/p2pJGx1aanoWQ9R1FMw1JVmtN1vSNE2ZKcL4kwhTIv+7hPkVpum9/54qQNoCB5od9Wc/WVZltv//9olVqRkBpkMgFbWp6pf/zQsQLFGGq0jfYOAJYZ33eO8O4ay/WUDUrPXKa0BSIWhEPEua1Jvfvd1CxL/0T7nGsppoSEjjaf6tN1ZTTR0SRqRO/+K/Ou/9CwVOnmrcSdMqBpY56yFdrrd+BUSsXF/De07+HriXkC//zQMQVEyIO7l9IOAINDw83zXmx47coMuc54Km6W6HL5VI1dHUoFS9CrJ/FZBL1apo8Bec67a3b/1JDQt4iEv/niXtWlQKNhcSXFrNXq9RoxmJPGjO8N0UWAZDR6hQZVGYs4HkcGtuz//NCxCMcqvMKX4VQAp6GEjERDVO0nICRTDDitdHYkPnkRhZTDzS5o/yvFTPc9GLCuTkX7OXt7fseehISK578TUFArC8lNQ06n//2Gg/Jy48bb9TWcmmH//93/Fyy29rQUkjgEwC74QXH//NAxAwTWb76X8xoAtGYil8Sf13FyrazOOzs66VgJUPYvJbKXWr+myS2SrPPf1KWiiiyOpLSWjRTZFlalf//omqn///Bl/gqd4NSP1sCtUboQAq2KfAZcuompqTyWlosplpidkw4Y4D/80LEGRRiJrZdUqAAgAJMBywG+KiSmxrWtlKfMj6SV386x0gTt/1OtvvS0CizI+umWkl/XUbP1ESayKkktX93dfzztT61SAEkgBQEjccjkciAYAa39zxcaPCYCFY9Q550fgIUwErGSDn/80DEIxwS+tZfhWgDSkw83gvvZTK1Iko2tI9rLpf1mZ+b1tMy4Nm06mXyUQY9ZLXyQUJTs9RmYhzjd0y+bppJEj+8v/+81fqQYzTN1ppIW/////+pA0UgaXaVuC5FVLzhMlMyKAyi3P/zQsQNF/I62AGBiABLhOwsg1FMBUmAa4LK0kU0GslRZGmpJb+3on0EzNJjN/Rt+6CJfdTUtj6KkvV+iRcjyBCdC2XzhNFUvstzFYtImJ1Ff9ZRIj59h0HQICe1It//pYprEApJJFaBDP/zQMQJFHJu5l/GaALvVEYd0Zlq2t/CXLznyPVFYKIeRsUnRSrZNn/r6CnqdQ5i8i3q1bKfpGtS0UV2JMeKP6knf2Nf0VaLGLbf//rR0WRKyF4MhrBplw9IE232uwC4QyFzCiYsW86d//NCxBIT0nLqXgpUxo9sRW7llTyJzaqvmIaPi3VgsG/mt9ykwfCQIU3OOY04ehw7/ppOC+OfQ45TbwRmsdOf9V//3NEgtEX//4aVAAFRFv32vuC0ePWVlkuksMhlhMTeSZcTTa6TL1tX//NAxB4T0m7aXgNUnlF5nDuaJdERvfmX6mCXNcKxO/V1USAU/9yGy3Aqp/1gZFJn/1f/82RAAwvUf/9n/4aVAAEIF91+vwCeBTp6TCmP9INghMQii720i+pAnlzzrUX1IHQtju2swb//80LEKRQCbtJeAJqGnOo/ai6SKYMAWbN+pyk9BZgJk//uSoi1brV+z//mZmmHNKZ13/4fAAEADstllgF/v972towZ0QXK8AA+PC5cN0PRTdbHW9k5M9zgqso/zibfk+1ZC/skJF/61jz/80DENROyfrpeA9qODemqMKr/rUHwRS1Nq9SKD//rZIcRZmT//kUEALSZ3D//6vAmzqOlAm8FwxbwFiX8VRMT/DEsPCqRbOw8Q1mIxxtBkkSi3qAOVm6F2/FRWYSyB/bF4bP/YoK6TP/zQsRBE7JuiRpulMRYCzO1V/Bgm+3///oVNQABURf9/bgBP/8U9MW42GQb/AyP4bURvzzGIYvAhJL0x3ooCTlFLZYWlmfqPt+PdVErEQz3RZKDyTFf60vWSP/2GMeX/qsr/+oxmB0RAP/zQMROEzJqxl4CWpcBmBvv9vwBTX/L98zdfopM4GlbpJtgUn1eHHhe8yxjmqcdp+upQEuTdtU3X9x6VTAMv2qIoiG/VYg/GN7/nhJgfH2Qf0qSKab/9STkueh1IDkmklAH5fflAZLq//NCxFwT8m7CXgPall7BM4igvw7JyAbmlbrY2Zmc95UkokD/dw4U/VNjZq2TcStZukKgZTDVrng8v/mRTZa8Yre35WIl+v9boo3/1pprJU2wFQAyBI5tJABr9/77Z/CdRCLoRWqEYrN6//NAxGgUEnKcfgPaq4nSU+eNbpg1JSTemhOK12Eir1L/WdGRPphACdmzWMj7GIgg/nV/2MkNzYiH1f+MUXviFwhf5ESNESoACMgKy22UAf/oZWmPclPEoiClH5cGwN0IZce9FABAWFr/80LEchQJ8p2+BhqSJMm0Y97b+IcHG7exHP1o1ozptGFJY96zeDFv2jvm5WapBNLZ6npCx39f9//xJxaUAGauYYNH0NxP49ytAzAugiwASDuCaDUpRXKKAro0F7oKjNigqK2bCimismz/80DEfRPCbrJeUYsW2bJs07zhUJE83J52vOGiuPNiokv/+//8tONhddJC82Fk8VX//+//+L/+X8vgX38/zyBLzXnwocMyMyN5mLPJsiIzhs/AZfSMyzTJX/zT7ykZlXbe+/dxn2i68f/zQsSJFBiqZBYAXknZ3GPTCDzzqqXjKRMJwaRC8G6IQU2nG4n4GGmXKsyZrv9S/Pz0LNbNUKz3/+L//YfmT5sn3CfNUKp/vzCv+a/PzXF+sMhBLEGQyJlrOq0Ao4kKJILAayo7MqEZp//zQMSUEvNmFAAIzcjp0sip/9jKz0mW6zFUj/RP6r+xkUjlR2Mj/dbbIrGRyodjWKh2MrGEVYys5TKUSGhweBQ8NIQysZWMrlRxEYLh0SRVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//NCxKMQi2IeUAhHXVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//NAxLwR22HQAAgKnVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",finishedError:"data:audio/mpeg;base64,/+MgxAAT5BX8AUEoAP///mNkc/////1Oc/6noc/9f///85/0O///r/kI2jf+pCf/Of/6HP/znOc7znPkIQgfFzvIRjhwOChCEIQOB8Ph853yHOc/zvEA4AAAAABF/UgSPmQKhhYBw4f/4yLECxVpXpgBmYgAKgCEXoz6Bj24G4gxlPDKhgAUoFxwtiGufjWFsGbKgF+Fh4noT/8i5uaFcZgLm1i2k0Mbam8ZAiwbYX0nExHIEEx2FBBP9J3S5vA6wAAltAA+pUwHS9e7B4EtiwD/4yDEERexdr1fz2ABlQrFTFPgXqqjQRzMFqGEeDUkEbrrMjtB+lU/tcuj+umyBDN1q/2GlFesgKLdHTqWo7RktruiRwdRlfa8J/BPRN+XHtgb0Y/AzC/2cZdiQgBuTa69W4S8bMAAXP/jIsQNF0k6wVZ5xSYzp4BvjV+T2Udd8R2+On01SiRpX5PGv6QjYpD1nBt8VZ0skMc9QHq1CpqJlnhoqVPKPHZYGqnIypEyWPAo8SPz0OhX//QJmyvHu/o8qM/6CtXSAhKu34FZMGcPy//jIMQLFcmeyX5pRy5R0BZEoNVh/FruKTVBRcR5rUTQpGyFqJx7CzcOcPjqoGcWJjOrcdzfsGXZAsFs2WdUKwcLiEIhWFB7w0GpuTa0XaMGgcqzrQsz/+kNKkIAFLvgP/OonDe+4DCL/+MixA4XgpK9XsKG9sYelKU8J/UGwRrm0l9/tjMjWMAOthrqK45iONNBfxi+hbllz+raE/If6Y91Y8jnb49Kxn0WeTT6ihhKnGOj8LGIiWQHuOogUc/66H/hHf+ZgAISpdgBncq6Fj3n/+MgxAwWYfa9fnqHEiCLPLVweu/9CIz6wGZbXVpry1Kg57ZhtwxXKh82K2giB2guGug/OyF9W1JuQftstdzJ1LPcEKLR5hTreUz/iBxskEVBY+CqAyCgQoz+yuNqlTn/4AmceACjmEH/4yLEDROBjtGfTFACEdnXxxr0lwp2+ghopgB4IjWCiAiL1Fns+pLqPWoKx2ncfG0InzW1JerftHxMpxQ801HHziUMvQeK6+SzxEliW+qFqaEByyhgQELpGQIgqtQ3JzIWch4kp17kEgX/4yDEGxrBdpwBmcgA2HbmH2R4LIKeMtsKwjCc/PT00y9l+qMGDIckAycFqvMfuJz7iPxLEzFQo5sngfD9d/3Lh+njFJYublz8Q5Rf////T2+4Yc+Lz9NurVqf9g+AKTd3AE4qU1E2vP/jIsQLFHFG1N/MMAKBuH8oS/ikp9KqlSqkwegTJgTLjeYlyndKcQSsCSPJJQRk9HC1Mj+l42THqWrK1khp0NFfwKks86SKw6IipGbLX60JBY92Jgpy/gAfjbqATePy62LBPlndI3QLQ//jIMQVEzHK0D5ITaKR7RryvYmOsx1fbM6V2JJnbpavk1iJiS8JPqV6qgWaY6uxhvzoBzN51ktGpofVlW2syZxMO0b3qgp3fgAeIb4DIseOluSeSAlQn7hrzAjZSZuJ1hX4vsT7jPQ//+MixCMTSZ7MPlmQ9/X6VzdY3edjF975aHZclh+kp0dpLevY334aVbI8HpNcncwNu/n4iv+WjdUp78AD9ctNSZuODC31N8HTqGeWmtBbEAMsHqNC8I2hSomoRqXy9S0ceUx3G2Xy1HlX/+MgxDETia7EHnnS35XKZuzIM1elCplWUbSZUyasFtQGBXZtvjOkd7fyKgXdgAP2BBZD9S9RP5NG79jO2pTIwZr7J8G1gzEtzOp2ieBOgOaBuVOqMyrSjT9MjQyjbxO0deP52eZM5EX/4yLEPRPR9rgeeccSHPRatU3MJQt+RHNLSiTFR+5aqgXbiAQBNtgMw1oA6FmGT6BBFIiJwdNzPHg4GwWjwaEZMdZCYHjSgwh4y0x3apZUmcmPvrb6vn+zvD/t5itoX1ejvi2HXytG9Pf/4yDESRRRirQZT1gDn6MGwmcJJfWqPBUiBf4SQhy0VHhgDRhoxv1ZsAhtWpzFYcHZOFihgb4zFC60dOmrlmXJiSomyBZ2YpiZigYKoIYAIGkiMAiwM8MMgCyIACjNhTPqzAnwKNMoKP/jIsRSJSlqhAma0AChCECX2WopEOPhhoiCKtdUFCCgKJA0W01lY2TxupC5HD8td2jhciVYlirC37fwM/kcmq9jHKMSipK977GKSz039KNFCnN8BxNkyKQ7PaifSU06ZWbLXIRrxeNesv/jIMQZFAk6zD/MMAKWQS5DeCUx/Y3lI4WvyH8L5+c/sB9iWul3X4R9zz7SwOgUyMBtTkhABBIUn1CLs///////9YC1KgVL/IbU4pxAdm9RCY22Fl3QDjRdhcbGgh/GwR2i7lo1CmY0/+MixCMT0ZasGMPKX2VNy3/JfvZB7an/a3fEB8Ky4hh6gJUlR8Y0bs8ZsysdHzOS5lQSpSjDL8SjagVdQAPkgaNhAzDy0U7Ny7ewjcdcD9uihn7LI+uRtxwzNFzBvzo+Dh1KUoG4nLxM/+MgxC8TQaK0HnnHLvdpTPyNVqWq8ps87Xc4tp+84odaBg0EhAGhAEm9SAVb+0XZfMCMzNKdBLCfWT9Cl5ZjyQd6VlAraiTVvTti91RulyZBkwXuoV3YXmOkKVn5U0rzPNMp1ltR6t7/4yLEPRQ5lqwYw1ETceczuhocBflPuWRyT5NPfTibxXsKc3HAHohRMAuHFwWYsiboQoSDQaBHij2BTtI1iU2jto6ycFqsuHDPAswsJlcSaDHBypOCRwT6zM81yPX/lTY4KIGgWSGQ4+n/4yDESBLppsg+SYaW///sUgodAxFs3LEahGcMIGORNKMFqJMRseA8gjpVF3QapN5RoQOoQ0DWBwiRkkW4R+n8dpREBICTA00IFzMpEJUo25plEqklOrq6VWSDH6/u3crqCEL0P4bJIP/jIsRXE9ECWADD0lknZeEGlVUAgUCFiDzDzCj4WjRpT2WWWUGKhkz4qKC1QsK/ioqLN9ISFhURmfWKi3//////////QDIVFBIHgZFaTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqv/jIMRjEaCVZAp5hlCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"},Object.assign(Zt.prototype,{elements:{start:new Kt("start",Zt.MEDIA.start),click:new Kt("click",Zt.MEDIA.click),actionOk:new Kt("actionOk",Zt.MEDIA.actionOk),actionError:new Kt("actionError",Zt.MEDIA.actionError),finishedOk:new Kt("finishedOk",Zt.MEDIA.finishedOk),finishedError:new Kt("finishedError",Zt.MEDIA.finishedError)},enabled:2,globalEnabled:!0});const Yt=Zt;class Qt{constructor(t){this.project=t,this.authors=[],this.organizations=[],this.revisions=[],this.languages=[],this.locales=[],this.description={},this.tags={}}setProperties(t){let i=null;const s=[];return t.children().each(((t,n)=>{switch(n.nodeName){case"title":this.title=n.textContent;break;case"description":i=D(n);break;case"descriptions":e()(n).children().each(((t,e)=>s.push(R(e))));break;case"author":this.authors.push(M(R(n)));break;case"organization":this.organizations.push(M(R(n)));break;case"revision":const t=M(R(n));t.date&&(t.date=T(t.date)),this.revisions.push(t);break;case"language":this.languages.push(E(n.textContent));break;case"eventSounds":this.eventSounds=new Yt,this.eventSounds.setProperties(e()(n));break;case"skin":this.skinFileName=e()(n).attr("file");break;case"descriptors":this.tags=R(n,!0),this.tags["#text"]&&(this.tags.other=this.tags["#text"].textContent,delete this.tags["#text"]);break;case"license":this.license=D(n);break;case"cover":case"thumb":const r=D(n);r.file&&(this[n.nodeName]=r.file)}})),this.buildLocales(),s.forEach((t=>{t.language&&t.text&&(this.description[t.language]=t.text)})),i&&this.languages.length>0&&!this.description[this.languages[0]]&&(this.description[this.languages[0]]=i),this}buildLocales(){return this.languages.length>0&&window.Intl&&window.Intl.getCanonicalLocales&&(this.locales=[],this.languages.forEach((t=>{const e=/\(([a-z,A-Z,-]+)\)/.exec(t);if(e&&e.length>1)try{const t=window.Intl.getCanonicalLocales(e[1]);t&&(this.locales=this.locales.concat(t))}catch(e){b("error","Invalid language: ".concat(t))}}))),this}getAttributes(){return L(this,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"])}setAttributes(t){return U(this,t,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"]),this.revisions&&this.revisions.forEach((t=>{t.date&&(t.date=new Date(t.date))})),this.buildLocales()}}Object.assign(Qt.prototype,{project:null,title:"Untitled",authors:null,organizations:null,revisions:null,description:null,languages:null,tags:null,cover:null,thumb:null,license:{type:"by-nc-sa",url:"https://creativecommons.org/licenses/by-nc-sa/4.0"},locales:null,skinFileName:null,eventSounds:new Yt});const Xt=Qt;class te{constructor(t,e){switch(this.action=t,typeof e){case"string":this.sequence=e;break;case"number":this.actNum=e}}setProperties(t){return this.id=t.attr("id"),this.action=t.attr("action")||"JUMP",t.attr("tag")&&(this.sequence=X(t.attr("tag"))),t.attr("project")&&(this.projectPath=X(t.attr("project"))),this}getAttributes(){return L(this,["id","action","actNum","sequence","projectPath"])}setAttributes(t){return["id","action","actNum","sequence","projectPath"].forEach((e=>{z(t[e])||(this[e]=t[e])})),this}}Object.assign(te.prototype,{id:null,action:null,actNum:-1,sequence:null,projectPath:null});const ee=te;class ie extends ee{constructor(t,e,i,s){super(t,e),this.threshold="number"==typeof i?i:-1,this.time="number"==typeof i?s:-1}setProperties(t){return super.setProperties(t),void 0!==t.attr("threshold")&&(this.threshold=t.attr("threshold")),void 0!==t.attr("time")&&(this.time=t.attr("time")),this}getAttributes(){return Object.assign(super.getAttributes(),L(this,["threshold","time"]))}setAttributes(t){return super.setAttributes(t),["threshold","time"].forEach((e=>{z(t[e])||(this[e]=t[e])})),this}}Object.assign(ie.prototype,{threshold:-1,time:-1});const se=ie;class ne extends ee{constructor(t,e){super(t,e)}setProperties(t){return super.setProperties(t),t.children("jump").each(((t,i)=>{const s=(new se).setProperties(e()(i));"upper"===s.id?this.upperJump=s:"lower"===s.id&&(this.lowerJump=s)})),this}getAttributes(){return Object.assign(super.getAttributes(),L(this,["upperJump","lowerJump"]))}setAttributes(t){return super.setAttributes(t),["upperJump","lowerJump"].forEach((e=>{t[e]&&(this[e]=(new se).setAttributes(t[e]))})),this}resolveJump(t,e){let i=this;return t>=0&&e>=0&&(null!==this.upperJump&&t>this.upperJump.threshold&&(this.upperJump.time<=0||e<this.upperJump.time)?i=this.upperJump:null!==this.lowerJump&&(t<this.lowerJump.threshold||this.lowerJump.time>0&&e>this.lowerJump.time)&&(i=this.lowerJump)),i}}Object.assign(ne.prototype,{upperJump:null,lowerJump:null});const re=ne;class ae{constructor(){}setProperties(t){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"id":this.tag=X(e);break;case"name":this.activity=e;break;case"description":case"navButtons":this[t]=e;break;case"delay":this[t]=Number(e)}})),t.children("jump").each(((t,i)=>{const s=(new re).setProperties(e()(i));"forward"===s.id?this.fwdJump=s:"back"===s.id&&(this.backJump=s)})),this}getAttributes(){return L(this,["tag","description","activity","fwdJump","backJump","navButtons","delay"])}setAttributes(t){return["tag","description","activity","navButtons","delay"].forEach((e=>{z(t[e])||(this[e]=t[e])})),["fwdJump","backJump"].forEach((e=>{t[e]&&(this[e]=(new re).setAttributes(t[e]))})),this}}Object.assign(ae.prototype,{tag:null,description:null,activity:"",fwdJump:null,backJump:null,navButtons:"both",delay:0});const oe=ae;class ce{constructor(t){this.project=t,this.elements=[]}setProperties(t){return t.children("item").each(((t,i)=>this.elements.push((new oe).setProperties(e()(i))))),this}getAttributes(){return this.elements.map((t=>t.getAttributes()))}setAttributes(t){return t.forEach((t=>this.elements.push((new oe).setAttributes(t)))),this}getElementIndex(t){return null===t?-1:this.elements.indexOf(t)}getElement(t,e){let i=null;return t>=0&&t<this.elements.length&&(i=this.elements[t],e&&(this.currentAct=t)),i}getElementByTag(t,e){let i=null,s=-1;return t&&(t=X(t),this.elements.some(((e,n)=>(e.tag===t&&(i=e,s=n),-1!==s))),-1!==s&&e&&(this.currentAct=s)),i}getCurrentAct(){return this.getElement(this.currentAct,!1)}hasNextAct(t){let e=!1;const i=this.getCurrentAct();if(i)if(null===i.fwdJump)e=!0;else switch(i.fwdJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}hasPrevAct(t){let e=!1;const i=this.getCurrentAct();if(i)if(null===i.backJump)e=!0;else switch(i.backJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}getNavButtonsFlag(){let t="none";const e=this.getCurrentAct();return e&&(t=e.navButtons),t}getJump(t,e){const i=this.getCurrentAct();let s=null;if(i){const n=t?i.backJump:i.fwdJump;if(null===n){let e=this.currentAct+(t?-1:1);(e>=this.elements.length||e<0)&&(e=0),s=new ee("JUMP",e)}else{let t=-1,i=-1;if(null!==e){const s=e.getCurrentSequenceInfo();null!==s&&(t=Math.round(s.tScore),i=Math.round(s.tTime/1e3))}s=n.resolveJump(t,i)}}return s}getSequenceForElement(t){let e=null;if(t>=0&&t<this.elements.length)for(let i=t;null===e&&i>=0;i--)e=this.getElement(i,!1).tag;return e}getElementByActivityName(t){let e=null;if(null!==t)for(let i=0;null===e&&i<this.elements.length;i++){const s=this.getElement(i,!1);s.activity.toLowerCase()===t.toLowerCase()&&(e=s)}return e}checkCurrentActivity(t){let e=this.getCurrentAct();if(null===e||e.activity.toUpperCase()!==t.toUpperCase()){for(let e=0;e<this.elements.length;e++)if(this.getElement(e,!1).activity.toUpperCase()===t.toUpperCase())return this.currentAct=e,!1;return e=new oe,e.activity=t,e.fwdJump=new re("STOP"),e.backJump=new re("STOP"),this.elements.push(e),this.currentAct=this.elements.length-1,!1}return!0}}Object.assign(ce.prototype,{elements:null,project:null,currentAct:-1});const le=ce;var he=i(924),ue=i.n(he);class de{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=window&&(window.AudioContext||window.webkitAudioContext);i&&(de.prepareInstrument(e,new i),this.data=t,this.player=new(ue().Player)((t=>this.playEvent(t))),this.player&&this.player.loadArrayBuffer(t))}static prepareInstrument(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;!1===de.loadingInstrument&&(de.loadingInstrument=!0,de.audioContext=e,ue().Soundfont.instrument(de.audioContext,t.MIDISoundFontObject||de.MIDISoundFontObject||"".concat(t.MIDISoundFontBase||de.MIDISoundFontBase,"/").concat(t.MIDISoundFontName||de.MIDISoundFontName).concat(t.MIDISoundFontExtension||de.MIDISoundFontExtension)).then((t=>{b("info","MIDI soundfont instrument loaded"),de.instrument=t})).catch((t=>{b("error","Error loading soundfont base instrument: ".concat(t))})))}pause(){this.player&&(this.player.pause(),this.startedNotes=[])}play(){this.player&&(this.startedNotes=[],this.player.play())}get paused(){return this.player&&!this.player.isPlaying()}get ended(){return this.player&&this.player.getSongTimeRemaining()<=0}get currentTime(){return this.player&&1e3*this.player.getSongTime()||0}set currentTime(t){this.player&&this.player.skipToSeconds(t/1e3)}playEvent(t){this.player&&de.instrument&&(this.playTo>0&&this.currentTime>=this.playTo?this.pause():"Controller Change"===t.name&&7===t.number?this.mainVolume=t.value/127:"Note on"===t.name&&t.velocity>0?this.startedNotes[t.noteNumber]=de.instrument.play(t.noteName,de.audioContext.currentTime,{gain:this.mainVolume*t.velocity/100*2}):"Note off"===t.name&&t.noteNumber&&this.startedNotes[t.noteNumber]&&(this.startedNotes[t.noteNumber].stop(),delete this.startedNotes[t.noteNumber]))}}Object.assign(de.prototype,{data:null,player:null,playTo:0,mainVolume:1,startedNotes:[]}),de.audioContext=null,de.instrument=null,de.loadingInstrument=!1,de.MIDISoundFontObject=null,de.MIDISoundFontBase="https://clic.xtec.cat/dist/jclic.js/soundfonts/MusyngKite",de.MIDISoundFontName="acoustic_grand_piano",de.MIDISoundFontExtension="-mp3.js";const pe=de;function fe(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ge{constructor(t,e,i){t&&(this.basePath=t),e&&(this.file=X(e),this.name=X(e),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&this.checkAnimatedGif()),i&&(this.zip=i),this.timeout=Date.now()+vt.LOAD_TIMEOUT}static getAudioPlayer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return ge._audioPlayers[t]||(ge._audioPlayers[t]=document.createElement("audio")),ge._audioPlayers[t]}static resetAudioElements(){ge._audioPlayers.fill(null),ge._currentAudioElements.fill(null)}setProperties(t){if(this.name=X(t.attr("name")),this.file=X(t.attr("file")),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext){const e=t.attr("animated");void 0===e?this.checkAnimatedGif():this.animated="true"===e}return"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}getAttributes(){return L(this,["name","file","animated"])}setAttributes(t){return["name","file","animated"].forEach((e=>{z(t[e])||(this[e]=t[e])})),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&"undefined"===this.animated&&this.checkAnimatedGif(),"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}checkAnimatedGif(){const t=new XMLHttpRequest;t.addEventListener("load",(()=>{const e=new Uint8Array(t.response),i=e.length;if(71===e[0]&&73===e[1]&&70===e[2]&&56===e[3]){for(let t=0,s=i-3,n=0;t<s&&n<2;++t)if(0===e[t]&&33===e[t+1]&&249===e[t+2]){const s=t+4+e[t+3];if(s+1<i&&0===e[s]&&(44===e[s+1]||33===e[s+1])&&++n>1){this.animated=!0,b("debug","Animated GIF detected: ".concat(this.file));break}}}else this.animated=!1})),this.getFullPathPromise().then((e=>{t.open("GET",e,!0),t.responseType="arraybuffer",t.send()}))}isEmpty(){return null===this.data}getFileType(t){let e=null;for(let i in vt.FILE_TYPES)if(vt.FILE_TYPES[i].indexOf(t)>=0){e=i;break}return e}build(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return vt.NODEJS&&(this.data=[],this.ready=!0),t&&(this._whenReady||(this._whenReady=[]),this._whenReady.push(t)),this.data?this.ready&&this._onReady():this.getFullPathPromise().then((t=>{switch(this.type){case"font":const r="ttf"===this.ext?"truetype":"otf"===this.ext?"embedded-opentype":this.ext;ut('@font-face{font-family:"'.concat(this.fontName,'";src:url(').concat(t,') format("').concat(r,'");}'),i),this.data=new At(this.name),this.ready=!0;break;case"image":this.data=new Image,this.data.addEventListener("load",(()=>{this._onReady.call(this)}),{once:!0}),this.data.src=t;break;case"video":this.data=document.createElement(this.type),this.data.addEventListener("canplay",(()=>{this._onReady.call(this)}),{once:!0}),this.data.src=t,this.data.load(),this.data.pause();break;case"audio":if(s){const e=ge._currentAudioElements[n];e&&e!==this&&(e.data=null,e.ready=!1),ge._currentAudioElements[n]=this;const i=ge.getAudioPlayer(n);i.src!==t?(b("trace","Loading static player #".concat(n," with new audio: ").concat(t)),this.data=i,this.ready=!1,i.addEventListener("canplay",(()=>{this._onReady.call(this)}),{once:!0}),i.src=t,i.load(),i.pause()):b("trace","Reusing existing audio in player #".concat(n,": ").concat(t))}else this.ready=!0;break;case"anim":this.data=e()('<object type"application/x-shockwave-flash" width="300" height="200" data="'.concat(t,'"/>')).get(-1),this.ready=!0;break;case"xml":e().get(t,null,null,"xml").done((t=>{const e=t?t.children||t.childNodes:null;this.data=e&&e.length>0?R(e[0]):null,this._onReady()})).fail((t=>{b("error","Error loading ".concat(this.name,": ").concat(t)),this._onReady()}));break;case"midi":const a=new XMLHttpRequest;a.onreadystatechange=()=>{4===a.readyState&&(200===a.status?this.data=new pe(a.response,i&&i.options):b("error","Error loading ".concat(this.name,": ").concat(a.statusText)),this._onReady())},a.open("GET",t,!0),a.responseType="arraybuffer",a.send();break;default:b("trace","Media currently not supported: ".concat(this.name)),this.ready=!0}this.ready&&this._onReady()})),this}checkReady(){if(this.data&&!this.ready)switch(this.type){case"image":this.ready=!0===this.data.complete;break;case"audio":case"video":case"anim":this.ready=this.data.readyState>=1;break;default:this.ready=!0}return this.ready}checkTimeout(){const t=Date.now()>this.timeout;return t&&b("warn","Timeout while loading: ".concat(this.name)),t}_onReady(){this.ready=!0,this._whenReady&&(this._whenReady.forEach((t=>t.call(this,this))),this._whenReady=null)}getFullPath(){return this._fullPath}getFullPathPromise(){return nt(this.basePath,this.file,this.zip).then((t=>(this._fullPath=vt.NODEJS?t:new URL(t,document.location.href).toString(),this._fullPath)))}}fe(ge,"_audioPlayers",[]),fe(ge,"_currentAudioElements",[]),Object.assign(ge.prototype,{name:"",file:"",fontName:"",basePath:"",zip:null,data:null,ready:!1,_whenReady:null,ext:"",type:null,timeout:0,animated:!1,_fullPath:null});const me=ge;class ve{constructor(t){this.project=t,this.elements={}}setProperties(t){return t.children("media").each(((t,i)=>{const s=new me(this.project.basePath,null,this.project.zip);s.setProperties(e()(i)),this.elements[s.name]=s})),this}getAttributes(){return Object.keys(this.elements).map((t=>this.elements[t].getAttributes()))}setAttributes(t){return t&&t.length&&t.forEach((t=>{const e=new me(this.project.basePath,null,this.project.zip);e.setAttributes(t),this.elements[e.name]=e})),this}getElement(t,e){t=X(t);let i=this.elements[t];return e&&!i&&(i=this.getElementByFileName(t,e)),i}getElementByFileName(t,e){let i=null;if(t){t=X(t);for(let e in this.elements)if(this.elements[e].file===t){i=this.elements[e];break}!i&&e&&(i=new me(this.project.basePath,null,this.project.zip),i.name=t,i.file=t,i.ext=t.toLowerCase().split("#")[0].split(".").pop(),i.type=i.getFileType(i.ext),this.elements[i.name]=i)}return i}getElementsOfType(t){const i=[];return e().each(this.elements,((e,s)=>{s.type===t&&i.push("font"===t?s.fontName:e)})),i}buildAll(t,i,s){let n=0;return e().each(this.elements,((e,r)=>{t&&r.type!==t||(r.build(i,s,!1),n++)})),n}countWaitingElements(){let t=0,i=!0;return e().each(this.elements,((e,s)=>{!s.data||s.ready||s.checkReady()||s.checkTimeout()?t++:(b("debug","... waiting for: %s",e),i=!1)})),i?-1:t}getSkinElement(t,e){return Ht.getSkin(t,e)}}Object.assign(ve.prototype,{elements:null,project:null});const be=ve,ye=vt.BoxBase;class we{constructor(t){this.parent=t||null}setProperties(t){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"shadow":case"transparent":this[t]=y(e,!1);break;case"margin":this[t]=Number(e);break;case"borderStroke":this.borderStroke=new xt(Number(e));break;case"markerStroke":this.markerStroke=new xt(Number(e))}})),t.children().each(((t,i)=>{const s=e()(i);switch(i.nodeName){case"font":this.font=(new At).setProperties(s);break;case"gradient":this.bgGradient=(new Ct).setProperties(s);break;case"color":this.textColor=N(s.attr("foreground"),this.textColor),this.backColor=N(s.attr("background"),this.backColor),this.shadowColor=N(s.attr("shadow"),this.shadowColor),this.inactiveColor=N(s.attr("inactive"),this.inactiveColor),this.alternativeColor=N(s.attr("alternative"),this.alternativeColor),this.borderColor=N(s.attr("border"),this.borderColor)}})),this}getAttributes(){return L(this,["shadow","transparent","margin","borderStroke","markerStroke","font","bgGradient","textColor|".concat(we.prototype.textColor),"backColor|".concat(we.prototype.backColor),"shadowColor|".concat(we.prototype.shadowColor),"inactiveColor|".concat(we.prototype.inactiveColor),"alternativeColor|".concat(we.prototype.alternativeColor),"borderColor|".concat(we.prototype.borderColor)])}setAttributes(t){return U(this,t,["shadow","transparent","margin",{key:"borderStroke",fn:xt},{key:"markerStroke",fn:xt},{key:"font",fn:At},{key:"bgGradient",fn:Ct},"textColor","backColor","shadowColor","inactiveColor","alternativeColor","borderColor"])}get(t){return this.hasOwnProperty(t)||null===this.parent?this[t]:this.parent.get(t)}set(t,e){return this[t]=e,this}getOwn(t){return this.hasOwnProperty(t)?this[t]:null!==this.parent?this.parent.getOwn(t):("object"==typeof this[t]?this[t]=j(we.prototype[t]):this[t]=we.prototype[t],this[t])}getCSS(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=this.get("font");(t=n.toCss(t)).color=i?this.get("backColor"):s?this.get("alternativeColor"):this.get("textColor");const r=this.get("transparent");t["background-color"]=r?"transparent":e?this.get("inactiveColor"):i?this.get("textColor"):this.get("backColor");const a=this.get("bgGradient");if(a&&!r&&(t["background-image"]=a.getCss()),1===this.shadow){const e=Math.max(1,Math.round(n.size/10)),i=this.get("shadowColor");t["text-shadow"]="".concat(e,"px ").concat(e,"px 3px ").concat(i)}return t}prepareText(t,e,i,s){const n=[],r=this.get("font"),a=r.getHeight();let o=0;const c=e.trim().split("\n");t.font=r.cssFont();for(let l=0;l<c.length;l++){let h=c[l].trim(),u=t.measureText(h).width;if(u>i){let n=0,a=0;for(let e=0;e<h.length;e++)if($(h[e])){const s=t.measureText(h.substring(0,e).trim()).width;if(s>i)break;n=e,a=s}if(n>0)c.splice(l+1,0,h.substring(n+1).trim()),h=c[l]=h.substring(0,n).trim(),u=a;else if(r.size>ye.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,i,s)}if(n.push({text:h,size:new St(u,a)}),o+=a,o>s&&r.size>ye.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,i,s)}return n}}Object.assign(we.prototype,{parent:null,default:ye,font:new At,dynFontSize:0,resetFontCounter:0,backColor:ye.BACK_COLOR,bgGradient:null,textColor:ye.TEXT_COLOR,shadowColor:ye.SHADOW_COLOR,borderColor:ye.BORDER_COLOR,inactiveColor:ye.INACTIVE_COLOR,alternativeColor:ye.ALTERNATIVE_COLOR,shadow:!1,transparent:!1,dontFill:!1,textMargin:ye.AC_MARGIN,borderStroke:new xt(ye.BORDER_STROKE_WIDTH),markerStroke:new xt(ye.MARKER_STROKE_WIDTH)}),we.DEFAULT_BOX_BASE=new we;const Ae=we;class Ce{constructor(t,e){t&&(this.h=t),e&&(this.v=e)}getAttributes(){return L(this,["h|center","v|center"])}setAttributes(t){return U(this,t,["h","v"])}}Object.assign(Ce.prototype,{h:"center",v:"center"});class xe{constructor(t){void 0!==t&&(this.id=t),this.imgAlign=new Ce,this.txtAlign=new Ce}setProperties(t,i){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"id":case"item":this[t]=Number(e);break;case"width":case"height":null===this.dimension&&(this.dimension=new St(0,0)),this.dimension[t]=Number(e);break;case"txtAlign":case"imgAlign":this[t]=this.readAlign(e);break;case"hAlign":this.txtAlign=this.readAlign(e+",center"),this.imgAlign=this.readAlign(e+",center");break;case"border":case"avoidOverlapping":this[t]=y(e);break;case"image":this.image=X(e)}})),t.children().each(((t,i)=>{const s=e()(i);switch(i.nodeName){case"style":this.style=new Ae(null).setProperties(s);break;case"media":this.mediaContent=(new Jt).setProperties(s);break;case"p":null===this.text?this.text="":this.text+="\n",this.text+=i.textContent}})),i&&this.realizeContent(i),this}getAttributes(){return L(this,["id","item","dimension","border","avoidOverlapping","image","text","objectType","txtAlign","imgAlign","style","mediaContent"])}setAttributes(t,e){return"string"==typeof t?this.text=t:U(this,t,["id","item","border","avoidOverlapping","image","text","objectType",{key:"dimension",fn:St},{key:"txtAlign",fn:Ce},{key:"imgAlign",fn:Ce},{key:"style",fn:Ae},{key:"mediaContent",fn:Jt}]),e&&this.realizeContent(e),this}readAlign(t){const e=new Ce;if(t){const i=t.split(",");e.h=i[0].replace("middle","center"),e.v=i[1].replace("middle","center")}return e}isEmpty(){return null===this.text&&null===this.img}isEquivalent(t,e){if(t===this)return!0;let i=!1;return null!==t&&(i=this.isEmpty()&&t.isEmpty()?this.id===t.id:(null===this.text?null===t.text:e?this.text===t.text:this.text.toLocaleLowerCase()===t.text.toLocaleLowerCase())&&(null===this.mediaContent?null===t.mediaContent:this.mediaContent.isEquivalent(t.mediaContent))&&this.img===t.img&&(null===this.imgClip?null===t.imgClip:this.imgClip.equals(t.imgClip))),i}setTextContent(t){null!==t?(this.text=t,this.checkHtmlText()):(this.text=null,this.innerHtmlText=null)}checkHtmlText(){if(this.innerHtmlText=null,Q(this.text,"<html>",!0)){const t=this.text.trim(),e=t.toLocaleLowerCase();if(-1===e.indexOf("<body")){const i=e.indexOf("</html>");i>=0&&(this.innerHtmlText=t.substring(6,i))}}}setImgContent(t,e,i){this.img=t,this.image=null,this.imgClip=e,i&&(this.animatedGifFile=i)}prepareMedia(t){!this.amp&&this.mediaContent&&"PLAY_VIDEO"===this.mediaContent.type&&(this.amp=t.getActiveMediaPlayer(this.mediaContent),this.amp.realize())}realizeContent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null!==this.image&&this.image.length>0&&(this.mbe=t.getElement(this.image,!0),this.mbe&&this.mbe.build((()=>{this.img=this.mbe.data,this.animatedGifFile=this.mbe.animated?this.mbe.getFullPath():null}),e,!0)),null!==this.mediaContent&&(null!==this.image||null!==this.text&&0!==this.text.length||(this.img=this.mediaContent.getIcon(),this.animatedGifFile=null)),this.checkHtmlText(t)}getDescription(){const t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push("".concat(m("image")," ").concat(this.image)),this.imgClip&&t.push(this.imgClip.toString()),this.mediaContent&&t.push(this.mediaContent.getDescription()),t.join(" ")}toString(){const t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push("".concat(m("image")," ").concat(this.image)),this.imgClip&&t.push("".concat(m("image fragment")," ").concat((this.id>=0?this.id:this.item)+1)),t.join(" ")||m("cell")}}Object.assign(xe.prototype,{style:null,dimension:null,border:null,text:null,image:null,imgClip:null,mediaContent:null,imgAlign:null,txtAlign:null,avoidOverlapping:!1,id:-1,item:-1,img:null,animatedGifFile:null,innerHtmlText:null,amp:null,mbe:null}),xe.EMPTY_CONTENT=new xe;const ke=xe;class Se{constructor(t,e){this.reset(t,e)}static registerClass(t,e){return Se.CLASSES[t]=e,e}static getShaper(t,e,i){const s=Se.CLASSES[(t||"").replace(/^edu\.xtec\.jclic\.shapers\./,"@")];return s||b("error","Unknown shaper: ".concat(t)),s?new s(e,i):null}reset(t,e){this.nCols=t,this.nRows=e,this.nCells=e*t,this.initiated=!1,this.shapeData=[];for(let t=0;t<this.nCells;t++)this.shapeData[t]=new Tt}setProperties(t){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"class":this.className=e;break;case"cols":this.nCols=Number(e);break;case"rows":this.nRows=Number(e);break;case"baseWidthFactor":case"toothHeightFactor":case"scaleX":case"scaleY":this[t]=Number(e);break;case"randomLines":case"showEnclosure":this[t]=y(e,!0)}})),t.children("enclosing:first").each(((t,i)=>{e()(i).children("shape:first").each(((t,e)=>{let i=Se.readShapeData(e,this.scaleX,this.scaleY);this.enclosing=i,this.showEnclosure=!0,this.hasRemainder=!0}))})),t.children("shape").each(((t,e)=>{this.shapeData[t]=Se.readShapeData(e,this.scaleX,this.scaleY)})),this.shapeData.length>0&&(this.nCells=this.shapeData.length),this}static readShapeData(t,i,s){const n=[];let r=null;return e().each(t.textContent.split("|"),((t,e)=>{const a=e.split(":");let o=a.length>1?a[1].split(","):null;switch(o&&(o=o.map(((t,e)=>t/(e%2?s:i)))),a[0]){case"rectangle":r=new Et(o[0],o[1],o[2],o[3]);break;case"ellipse":r=new Pt(o[0],o[1],o[2],o[3]);break;default:n.push(new Bt(a[0],o))}})),!r&&n.length>0?new It(n):r}getAttributes(){const t=["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines"];return this.customShapes&&["showEnclosure","hasRemainder","enclosing","shapeData"].forEach((e=>t.push(e))),L(this,t)}static factory(t){const e=Se.getShaper(t.className,t.nCols,t.nRows);return U(e,t,["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines","showEnclosure","hasRemainder",{key:"enclosing",fn:Tt},{key:"shapeData",fn:Tt,group:"array"}]),e.nCells=e.shapeData.length||e.nCols*e.nRows,e}buildShapes(){}getShape(t,e){return this.initiated||this.buildShapes(),t>=this.nCells||null===this.shapeData[t]?null:this.shapeData[t].getShape(e)}getShapeData(t){return t>=0&&t<this.shapeData.length?this.shapeData[t]:null}getEnclosingShapeData(){return new Et(0,0,1,1)}getRemainderShape(t){if(!this.hasRemainder)return null;this.initiated||this.buildShapes();const e=this.getEnclosingShapeData(),i=e?e.getShape(t):new Et;for(let e=0;e<this.nCells;e++)this.shapeData[e]&&i.add(this.shapeData[e].getShape(t),!1);return i}}Object.assign(Se.prototype,{className:"Shaper",nCols:0,nRows:0,nCells:0,shapeData:null,initiated:!1,baseWidthFactor:1/3,toothHeightFactor:1/6,randomLines:!1,scaleX:1,scaleY:1,enclosing:null,showEnclosure:!1,rectangularShapes:!1,hasRemainder:!1,customShapes:!1}),Se.CLASSES={};const Te=Se;class Ee{constructor(t,e,i){t&&(this.id=t),this.cells=[],this.ncw=Math.max(1,e),this.nch=Math.max(1,i)}setProperties(t,i){let s=!1;if(dt(t.get(0).attributes,((t,e)=>{switch(t){case"id":this.id=e;break;case"image":this.image=X(e);break;case"rows":this.nch=Number(e);break;case"columns":s=!0;case"cols":this.ncw=Number(e);break;case"cellWidth":this.w=Number(e);break;case"cellHeight":this.h=Number(e);break;case"border":this.border=y(e)}})),s){let t=this.ncw;this.ncw=this.nch,this.nch=t}t.children().each(((t,s)=>{const n=e()(s);switch(s.nodeName){case"style":this.style=new Ae(null).setProperties(n);break;case"shaper":const t=n.attr("class"),e=Math.max(1,n.attr("cols")),r=Math.max(1,n.attr("rows"));this.shaper=Te.getShaper(t,e,r),this.shaper.setProperties(n);break;case"ids":this.ids=s.textContent,this.ids.split(" ").forEach(((t,e)=>{this.cells[e]=new ke(Number(t))}));break;case"cell":this.cells.push((new ke).setProperties(n,i))}}));let n=this.cells.length;if(0===n&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,n=this.shaper.nCells,this.getActiveBoxContent(n-1)),n>0){let t=!0;for(let e=0;e<n;e++){const i=this.getActiveBoxContent(e);if(-1!==i.id||-1!==i.item||!i.isEmpty()){t=!1;break}}if(t)for(let t=0;t<n;t++)this.getActiveBoxContent(t).id=t}return this.style&&this.cells.forEach((t=>{t.style&&(t.style.parent=this.style)})),this}getAttributes(){const t=["id","image","ncw","nch","w","h","border","style","shaper"];return this.initiallyEmptyCells||t.push(this.ids?"ids":"cells"),L(this,t)}setAttributes(t,e){U(this,t,["id","image","ncw","nch","w","h","border",{key:"style",fn:Ae},{key:"shaper",fn:Te},"ids",{key:"cells",fn:ke,group:"array",params:[e]}]);let i=this.cells.length;if(0===i&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,i=this.shaper.nCells,this.getActiveBoxContent(i-1),this.ids&&this.ids.split(" ").forEach(((t,e)=>{this.getActiveBoxContent(e).id=Number(t)}))),i>0){let t=!0;for(let e=0;e<i;e++){const i=this.getActiveBoxContent(e);if(-1!==i.id||-1!==i.item||!i.isEmpty()){t=!1;break}}if(t)for(let t=0;t<i;t++)this.getActiveBoxContent(t).id=t}return this.style&&this.cells.forEach((t=>{t.style&&(t.style.parent=this.style)})),e&&this.cells.forEach((t=>t.realizeContent(e))),this}prepareMedia(t){this.cells.forEach((e=>e.prepareMedia(t)))}getTotalWidth(){return this.w*this.ncw}getTotalHeight(){return this.h*this.nch}getNumCells(){return this.cells.length}isEmpty(){return 0===this.cells.length}getShaper(){return null===this.shaper&&(this.shaper=Te.getShaper("@Rectangular",this.ncw,this.nch)),this.shaper}getBoxBase(){return null===this.style&&(this.style=new Ae),this.style}addActiveBoxContent(t){this.cells.push(t),0!==this.ncw&&0!==this.nch||(this.ncw=this.nch=1)}getActiveBoxContent(t){if(t>=this.cells.length)for(let e=this.cells.length;e<=t;e++)this.cells.push(new ke);return this.cells[t]}getActiveBoxContentWith(t,e){return this.cells.find((i=>i.id===t&&i.item===e))}setImgContent(t,e,i){e&&this.setShaper(e),"@Holes"===this.shaper.className&&(this.shaper.hasRemainder=!0),this.ncw=this.shaper.nCols,this.nch=this.shaper.nRows;const s=t.elements[this.image];t&&this.image&&s&&s.ready?(this.img=s.data,s.animated&&(this.animatedGifFile=s.getFullPath()),this.w=this.img.width/this.ncw,this.h=this.img.height/this.nch,i&&(this.w=Math.round(this.w),this.h=Math.round(this.h))):(this.img=null,this.w=Math.max(this.w,10),this.h=Math.max(this.h,10));const n=new Et(0,0,this.w*this.ncw,this.h*this.nch);for(let t=0;t<this.shaper.nCells;t++)this.getActiveBoxContent(t).setImgContent(this.img,this.shaper.getShape(t,n),this.animatedGifFile);this.shaper.hasRemainder&&(this.backgroundContent=new ke,this.backgroundContent.setImgContent(this.img,this.shaper.getRemainderShape(n)))}setTextContent(t,e,i){this.ncw=Math.max(1,e),this.nch=Math.max(1,i);const s=this.ncw*this.nch;for(let e=0;e<s;e++)this.getActiveBoxContent(e).setTextContent(e>=t.length||null===t[e]?"":t[e])}setIds(t){for(let e=0;e<t.length&&e<this.cells.length;e++)this.getActiveBoxContent(e).id=t[e]}setCellsAttribute(t,e){this.cells.forEach((i=>i[t]=e))}avoidAllIdsNull(t){this.cells.every((t=>-1===t.id))&&(t=Math.max(1,t),this.cells.forEach(((e,i)=>{e.id=i%t})))}}Object.assign(Ee.prototype,{id:"primary",image:null,img:null,animatedGifFile:null,ncw:1,nch:1,w:vt.DEFAULT_GRID_ELEMENT_SIZE,h:vt.DEFAULT_GRID_ELEMENT_SIZE,border:!0,style:null,shaper:null,backgroundContent:null,cells:null,defaultIdValue:-1,ids:null});const Pe=Ee;class Ie{constructor(){}static getProvider(t){let e=null;if(t){const i=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),s=Ie.CLASSES[i];s?(e=new s,e.setProperties(t)):b("error","Unknown AutoContentProvider class: ".concat(i))}return e}setProperties(t){return this.className=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),this}getAttributes(){return L(this,["className"])}static factory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(new(0,Ie.CLASSES[t.className])).setAttributes(t,...e)}init(){}generateContent(t,e,i,s){return this.process(new Ie.ActiveBagContentKit(t,e,i,s))}process(t){return!1}static registerClass(t,e){return Ie.CLASSES[t]=e,e}}Object.assign(Ie.prototype,{numericContent:!1}),Ie.ActiveBagContentKit=class{constructor(t,e,i,s){this.nRows=t,this.nCols=e,this.content=i,this.useIds=s}},Ie.CLASSES={"@tagreplace.TagReplace":Ie},Ie.registerClass("@tagreplace.TagReplace",Ie);const Be=Ie;class _e{constructor(){this.style=new Ae(null),this.text=[]}setProperties(t){dt(t.get(0).attributes,((t,e)=>{switch(t){case"rows":this.ncw=Number(e);break;case"columns":this.nch=Number(e);break;case"cellWidth":this.w=Number(e);break;case"cellHeight":this.h=Number(e);break;case"border":this.border=y(e);break;case"wild":case"randomChars":this[t]=e}})),t.children("style:first").each(((t,i)=>{this.style=(new Ae).setProperties(e()(i))})),t.find("text:first > row").each(((t,e)=>this.text.push(e.textContent)));for(let t=this.text.length;t<this.nch;t++)this.text[t]="";return this}getAttributes(){return L(this,["ncw","nch","w","h","text","style","border","wild|*","randomChars|".concat(vt.RANDOM_CHARS)])}setAttributes(t){return U(this,t,["ncw","nch","w","h","text",{key:"style",fn:Ae},"border","wild","randomChars"])}countWildChars(){let t=0;if(this.text)for(let e=0;e<this.nch;e++)for(let i=0;i<this.ncw;i++)this.text[e].charAt(i)===this.wild&&t++;return t}getNumChars(){return this.ncw*this.nch}setCharAt(t,e,i){t>=0&&t<this.ncw&&e>=0&&e<this.nch&&(this.text[e]=this.text[e].substring(0,t)+i+this.text[e].substring(t+1))}}Object.assign(_e.prototype,{ncw:1,nch:1,w:20,h:20,border:!1,style:null,text:null,wild:"*",randomChars:vt.RANDOM_CHARS});const Oe=_e;class Re{constructor(t){this.className=t,this.collator=window.Intl&&window.Intl.Collator?new window.Intl.Collator:{compare:(t,e)=>this.checkCase?t===e:t.toUpperCase()===e.toUpperCase()}}static getEvaluator(t){let e=null;if(t){const i=t.attr("class"),s=Re.CLASSES[i];s?(e=new s(i),e.setProperties(t)):b("error",'Unknown evaluator class: "'.concat(i,'"'))}return e}setProperties(t){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"class":this.className=e;break;case"checkCase":case"checkAccents":case"checkPunctuation":case"checkDoubleSpaces":case"detail":this[t]=y(e);break;case"checkSteps":case"checkScope":this[t]=Number(e)}})),this}static factory(t){const e=Re.CLASSES[t.className];if(e){return U(new e(t.className),t,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}return null}getAttributes(){return L(this,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}init(t){this.initiated=!0}checkText(t,e){return e instanceof Array?e.some((e=>this._checkText(t,e))):!!e&&this._checkText(t,e)}_checkText(t,e){return!1}evalText(t,e){return e instanceof Array||(e=[e]),this._evalText(t,e)}_evalText(t,e){return[]}isOk(t){return t&&t.length>0&&!t.some((t=>0!==t))}}Object.assign(Re.prototype,{className:null,initiated:!1,collator:null,checkCase:!1});class De extends Re{constructor(t){super(t)}init(t){super.init([t]),window.Intl&&window.Intl.Collator&&(this.collator=new window.Intl.Collator(t,{sensitivity:this.checkAccents?this.checkCase?"case":"accent":"base",ignorePunctuation:!this.checkPunctuation}))}_checkText(t,e){return 0===this.collator.compare(this.getClearedText(t),this.getClearedText(e))}_evalText(t,e){return Array(t.length).fill(this._checkText(t,e[0])?0:1)}getClearedText(t,e){if(this.checkPunctuation&&this.checkDoubleSpaces)return t;e||(e=Array(t.length).fill(!1));let i="";for(let s=0,n=!1;s<t.length;s++){const r=t.charAt(s);this.PUNCTUATION.indexOf(r)>=0&&!this.checkPunctuation?(n?e[s]=!0:i+=" ",n=!0):" "===r?(this.checkDoubleSpaces||!n?i+=r:e[s]=!0,n=!0):(n=!1,i+=r)}return i}}Object.assign(De.prototype,{checkAccents:!0,checkPunctuation:!0,checkDoubleSpaces:!1,PUNCTUATION:".,;:"});class Me extends De{constructor(t){super(t)}_evalText(t,e){if(!this.detail)return super._evalText(t,e);const i=Array(t.length).fill(!1),s=this.getClearedText(t,i),n=Array(e.length),r=Array(e.length),a=Array(t.length);let o=-1,c=-1;for(let i=0;i<e.length;i++){r[i]=Array(t.length).fill(0);const a=this.compareSegment(s,s.length,e[i],e[i].length,r[i],!1);n[i]=this.countFlagsOk(r[i]),a&&(c=i,o=n[i])}if(-1===c)for(let t=0;t<e.length;t++)n[t]>o&&(o=n[t],c=t);for(let e=0,s=0;e<t.length;e++)a[e]=i[e]?0:r[c][s++];return a}countFlagsOk(t){return t.reduce(((t,e)=>0==e?++t:t),0)}compareSegment(t,e,i,s,n,r){let a=0,o=0,c=0,l=!0,h=!0,u="",d="";if(0===e||0===s||null===t||null===i)return!1;for(;a<e;a++,o++)if(u=t.charAt(a),c=a,d=o>=0&&o<s?i.charAt(o):0,0===this.collator.compare(u,d))n[a]=0,l=!0;else if(h=!1,n[a]=1,!r&&l&&0!==d&&this.checkSteps>0&&this.checkScope>0){const n=2*this.checkSteps+1,r=[];let c=0,h=0;for(;h<n;h++){if(r[h]=0,c=o+Math.floor((h+1)/2)*(1&h?1:-1),c>=s)continue;const n=c<0?a-c:a;if(n>=e)continue;const l=Math.min(e-n,this.checkScope),u=c<0?0:c,d=Math.min(s-u,this.checkScope),p=Array(t.length-n).fill(0),f=this.compareSegment(t.substring(n),l,i.substring(u),d,p,!0);if(r[h]=this.countFlagsOk(p),f)break}if(h===n){let t=this.checkSteps;for(h=0;h<n;h++)r[h]>r[t]&&(t=h);c=o+Math.floor((t+1)/2)*(1&t?1:-1)}o=c,l=!1}return o!==s&&(h=!1,n[c]=1),h}}Object.assign(Me.prototype,{detail:!0,checkSteps:3,checkScope:6}),Re.CLASSES={"@BasicEvaluator":De,"@ComplexEvaluator":Me};const Ne=Re;function Ve(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function je(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ve(Object(i),!0).forEach((function(e){qe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ve(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function qe(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Le{constructor(){this.style={default:je({},Le.DEFAULT_DOC_STYLE)},this.p=[]}setProperties(t,i){return t.children("style").toArray().sort(((t,e)=>{var i=t.getAttribute("name"),s=t.getAttribute("base")||null,n=e.getAttribute("name"),r=e.getAttribute("base")||null;return"default"===i?-1:"default"===n||s===n?1:r===i?-1:s?r?0:1:-1})).forEach((t=>{const i=this.readDocAttributes(e()(t));this.style[i.name]="default"===i.name?e().extend(!0,this.style.default,i):i})),t.find("section > p").each(((t,s)=>{const n={elements:[]};dt(s.attributes,((t,e)=>{switch(t){case"style":n[t]=e;break;case"bidiLevel":case"Alignment":n[t]=Number(e)}})),e()(s).children().each(((t,s)=>{let r;const a=e()(s);switch(s.nodeName){case"cell":r=(new ke).setProperties(a,i);break;case"text":r={text:s.textContent.replace(/\t/g,"	")};const t=this.readDocAttributes(a);e().isEmptyObject(t)||(r.attr=t);break;case"target":r=new Fe(this,s.textContent.replace(/\t/g,"	")),r.setProperties(a,i),this.numTargets++;break;default:b("error",'Unknown object in activity document: "'.concat(s.nodeName,'"'))}r&&(r.objectType=s.nodeName,n.elements.push(r))})),this.p.push(n)})),this}readDocAttributes(t){let i={},s={};return dt(t.get(0).attributes,((t,n)=>{switch(t){case"background":n=N(n,"white"),i[t]=n,s["background-color"]=n;break;case"foreground":n=N(n,"black"),i[t]=n,s.color=n;break;case"family":s["font-family"]=n;case"name":case"style":i[t]=n;break;case"base":i[t]=n,this.style[n]&&(i=e().extend(!0,{},this.style[n],i),this.style[n].css&&(s=e().extend({},this.style[n].css,s)));break;case"bold":n=y(n),i[t]=n,s["font-weight"]=n?"bold":"normal";break;case"italic":n=y(n),i[t]=n,s["font-style"]=n?"italic":"normal";break;case"target":i[t]=y(n);break;case"size":i[t]=Number(n),s["font-size"]="".concat(n,"px");break;case"tabWidth":this.tabSpc=n,s["tab-size"]=this.tabSpc,s["white-space"]="pre-wrap";break;default:b("warn",'Unknown text attribute: "'.concat(t,'" = "').concat(n,'"')),i[t]=n}})),e().isEmptyObject(s)||(i.css=s),i}getAttributes(){return L(this,["style","tabSpc","targetType","p"])}setAttributes(t,e){return U(this,t,["style","tabSpc","targetType","p"]),this.p.forEach((t=>{t.elements?t.elements=t.elements.map((t=>"cell"===t.objectType?(new ke).setAttributes(t,e):"target"===t.objectType?new Fe(this).setAttributes(t,e):t)):t.elements=[]})),this}getRawText(){const t=e()("<div/>");return this.p.forEach((i=>{const s=e()("<p/>");let n=!0;i.elements.forEach((t=>{switch(t.objectType){case"text":case"target":s.append(t.text)}n=!1})),n&&s.html(" "),t.append(s)})),t.text().trim()}getFullStyle(t){const i=e().extend(!0,{},this.style.default);return e().extend(!0,i,this.style[t]?this.style[t]:{})}}Le.DEFAULT_DOC_STYLE={background:"0xFFFFFF",foreground:"0x000000",family:"Arial",bold:!1,italic:!1,size:17,css:{"background-color":"#FFFFFF",color:"#000000","font-family":"Arial","font-weight":"normal","font-style":"normal","font-size":"17px"}},Object.assign(Le.prototype,{tabSpc:12,lastBoxId:0,tmb:null,numTargets:0,targetType:"TT_FREE",style:null,p:null});class Fe{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.doc=t,this.text=e,this.numIniChars=e.length,this.answers=[e],this.maxLenResp=this.numIniChars}reset(t){this.targetStatus=t||"NOT_EDITED",this.flagModified=!1}setProperties(t,i){let s=!0;t.children().each(((t,n)=>{const r=e()(n);switch(n.nodeName){case"answer":s&&(s=!1,this.answers=[]),null===this.answers&&(this.answers=[]),this.answers.push(n.textContent);break;case"optionList":r.children("option").each(((t,e)=>{this.isList=!0,null===this.options&&(this.options=[]),this.options.push(e.textContent)}));break;case"response":this.iniChar=w(r.attr("fill"),this.iniChar).charAt(0),vt.WHITESPACES.indexOf(this.iniChar)>=0&&(this.iniChar="_"),this.numIniChars=A(r.attr("length"),this.numIniChars),this.maxLenResp=A(r.attr("maxLength"),this.maxLenResp),this.iniText=w(r.attr("show"),this.iniText);break;case"info":this.infoMode=w(r.attr("mode"),"always"),this.popupDelay=A(r.attr("delay"),this.popupDelay),this.popupMaxTime=A(r.attr("maxTime"),this.popupMaxTime),r.children("media").each(((t,i)=>{this.onlyPlay=!0,this.popupContent=new ke,this.popupContent.mediaContent=(new Jt).setProperties(e()(i))})),this.popupContent||r.children("cell").each(((t,s)=>{this.popupContent=(new ke).setProperties(e()(s),i)}));break;case"text":this.text=n.textContent.replace(/\t/g,"	");const t=this.doc.readDocAttributes(e()(n));e().isEmptyObject(t)||(this.attr=t)}}))}getAttributes(){return L(this,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay","popupContent"])}setAttributes(t,e){return U(this,t,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay",{key:"popupContent",fn:ke,params:[e]}])}getAnswers(){return this.answers?this.answers.join("|"):""}checkColors(){const t=this.$comboList||this.$span;if(t){const e=this.doc.style["WITH_ERROR"===this.targetStatus?"targetError":"HIDDEN"===this.targetStatus?"default":"target"];e&&e.css&&t.css(e.css)}}readCurrentText(){return this.$span?this.currentText=this.$span.text():this.$comboList&&(this.currentText=this.$comboList.val()),this.currentText}}Object.assign(Fe.prototype,{doc:null,text:null,attr:null,isList:!1,numIniChars:1,iniChar:"_",maxLenResp:0,answers:null,options:null,iniText:null,infoMode:"no_info",popupKey:"F1",popupContent:null,popupDelay:0,popupMaxTime:0,onlyPlay:!1,$comboList:null,$span:null,$p:null,$popup:null,currentText:"",num:0,pos:0,targetStatus:"NOT_EDITED",flagModified:!1,parentPane:null}),Le.TextTarget=Fe;const ze=Le,Ue="touchstart";class He{constructor(t){this.project=t,this.eventSounds=new Yt(this.project.settings.eventSounds),this.messages={},this.abc={}}static registerClass(t,e){return He.CLASSES[t]=e,e}static getActivity(t,e){let i=null;const s=t.jquery&&!0;if(t&&e){const n=s?(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.activities\./,"@"):t.className,r=He.CLASSES[n];r?(i=new r(e),s?i.setProperties(t):i.setAttributes(t)):b("error","Unknown activity class: ".concat(n))}return i}setProperties(t){return dt(t.get(0).attributes,((t,e)=>{switch(t){case"name":e=X(e);case"code":case"type":case"description":this[t]=e;break;case"class":this.className=e.replace(/^edu\.xtec\.jclic\.activities\./,"@");break;case"inverse":this.invAss=y(e,!1);break;case"autoJump":case"forceOkToAdvance":case"amongParagraphs":this[t]=y(e,!1)}})),t.children().each(((t,i)=>{const s=e()(i);switch(i.nodeName){case"settings":dt(s.get(0).attributes,((t,e)=>{switch(t){case"infoUrl":case"infoCmd":this[t]=e;break;case"margin":case"maxTime":case"maxActions":this[t]=Number(e);break;case"report":this.includeInReports=y(e,!1);break;case"countDownTime":case"countDownActions":case"reportActions":case"useOrder":case"dragCells":this[t]=y(e,!1)}})),s.children().each(((t,i)=>{const s=e()(i);switch(i.nodeName){case"skin":this.skinFileName=s.attr("file");break;case"helpWindow":this.helpMsg=O(this),this.showSolution=y(s.attr("showSolution"),!1),this.helpWindow=null!==this.helpMsg||this.showSolution;break;case"container":this.bgColor=N(s.attr("bgColor"),vt.BoxBase.BACK_COLOR),s.children().each(((t,i)=>{const s=e()(i);switch(i.nodeName){case"image":this.bgImageFile=s.attr("name"),this.tiledBgImg=y(s.attr("tiled"),!1);break;case"counters":this.bTimeCounter=y(s.attr("time"),!0),this.bActionsCounter=y(s.attr("actions"),!0),this.bScoreCounter=y(s.attr("score"),!0);break;case"gradient":this.bgGradient=(new Ct).setProperties(s)}}));break;case"window":this.activityBgColor=N(s.attr("bgColor"),vt.DEFAULT_BG_COLOR),this.transparentBg=y(s.attr("transparent"),!1),this.border=y(s.attr("border"),!1),s.children().each(((t,i)=>{const s=e()(i);switch(i.nodeName){case"gradient":this.activityBgGradient=(new Ct).setProperties(s);break;case"position":this.absolutePosition=(new kt).setProperties(s),this.absolutePositioned=!0;break;case"size":this.windowSize=(new St).setProperties(s)}}));break;case"eventSounds":this.eventSounds.setProperties(s)}}));break;case"messages":s.children("cell").each(((t,i)=>{const s=this.readMessage(e()(i));this.messages[s.type]=s}));break;case"automation":this.acp=Be.getProvider(s,this.project),this.acp&&(this.numericContent=this.acp.numericContent);break;case"cells":const t=(new Pe).setProperties(s,this.project.mediaBag);this.abc[t.id]=t;break;case"scramble":this.shuffles=Number(s.attr("times")),this.shuffleA=y(s.attr("primary")),this.shuffleB=y(s.attr("secondary"));break;case"layout":dt(s.get(0).attributes,((t,e)=>{switch(t){case"position":this.boxGridPos=e;break;case"wildTransparent":case"upperCase":case"checkCase":this[t]=y(e)}}));break;case"menuElement":this.menuElements.push({caption:s.attr("caption")||"",icon:s.attr("icon")||null,projectPath:s.attr("path")||null,sequence:s.attr("sequence")||null,description:s.attr("description")||""});break;case"textGrid":this.tgc=(new Oe).setProperties(s);break;case"clues":this.clues=[],this.clueItems=[],s.children("clue").each(((t,i)=>{this.clueItems[t]=Number(e()(i).attr("id")),this.clues[t]=i.textContent}));break;case"checkButton":this.checkButtonText=i.textContent||"check";break;case"prevScreen":this.prevScreen=!0,this.prevScreenMaxTime=s.attr("maxTime")||-1,s.children().each(((t,i)=>{switch(i.nodeName){case"style":this.prevScreenStyle=(new Ae).setProperties(e()(i));break;case"p":null===this.prevScreenText&&(this.prevScreenText=""),this.prevScreenText+="<p>".concat(i.textContent,"</p>")}}));break;case"evaluator":this.ev=Ne.getEvaluator(s);break;case"document":this.document=(new ze).setProperties(s,this.project.mediaBag)}})),this}readMessage(t){const e=(new ke).setProperties(t,this.project.mediaBag);return e.type=t.attr("type"),B(e.style)&&(e.style=new Ae(null)),e}getAttributes(){return L(this,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd","margin|".concat(vt.DEFAULT_MARGIN),"maxTime","maxActions","includeInReports|true","reportActions|false","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution|false","helpMsg","bgColor|".concat(vt.DEFAULT_BG_COLOR),"bgImageFile","tiledBgImg","bTimeCounter|true","bActionsCounter|true","bScoreCounter|true","activityBgColor|".concat(vt.DEFAULT_BG_COLOR),"transparentBg|false","border|true","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText","bgGradient","activityBgGradient","absolutePosition","windowSize","eventSounds","messages","acp","abc","menuElements","tgc","clues","clueItems","prevScreenStyle","ev","document"])}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.project.mediaBag;return U(this,t,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd","margin","maxTime","maxActions","includeInReports","reportActions","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution","helpMsg","bgColor","bgImageFile","tiledBgImg","bTimeCounter","bActionsCounter","bScoreCounter","activityBgColor","transparentBg","border","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText",{key:"bgGradient",fn:Ct},{key:"activityBgGradient",fn:Ct},{key:"absolutePosition",fn:kt},{key:"windowSize",fn:St},{key:"messages",fn:ke,group:"object",init:"key",params:[e]},{key:"abc",fn:Pe,group:"object",init:"key",params:[e]},{key:"acp",fn:Be,params:[e]},"menuElements",{key:"tgc",fn:Oe},"clues","clueItems",{key:"prevScreenStyle",fn:Ae},{key:"ev",fn:Ne},{key:"document",fn:ze,params:[e]}]),t.eventSounds&&this.eventSounds.setAttributes(t.eventSounds),this.absolutePosition&&(this.absolutePositioned=!0),this}initAutoContentProvider(){null!==this.acp&&this.acp.init()}prepareMedia(t){return this.eventSounds.realize(t,this.project.mediaBag),e().each(this.messages,((e,i)=>{null!==i&&i.prepareMedia(t)})),e().each(this.abc,((e,i)=>{null!==i&&i.prepareMedia(t)})),!0}helpSolutionAllowed(){return!1}helpWindowAllowed(){return this.helpWindow&&(this.helpSolutionAllowed()&&this.showSolution||null!==this.helpMsg)}getMinNumActions(){return 0}mustPauseSequence(){return 0!==this.getMinNumActions()}canReinit(){return!0}hasInfo(){return null!==this.infoUrl&&this.infoUrl.length>0||null!==this.infoCmd&&this.infoCmd.length>0}hasRandom(){return!1}shuffleAlways(){return!1}needsKeyboard(){return!1}end(){this.eventSounds.close(),this.clear()}clear(){}getWindowSize(){return new St(this.windowSize)}setWindowSize(t){this.windowSize=new St(t)}getActivityPanel(t){return new this.constructor.Panel(this,t)}}He.CLASSES={"@panels.Menu":He},Object.assign(He.prototype,{project:null,name:vt.DEFAULT_NAME,className:null,code:null,type:null,description:null,margin:vt.DEFAULT_MARGIN,bgColor:vt.DEFAULT_BG_COLOR,bgGradient:null,tiledBgImg:!1,bgImageFile:null,border:!0,absolutePositioned:!1,absolutePosition:null,includeInReports:!0,reportActions:!1,helpWindow:!1,showSolution:!1,helpMsg:"",eventSounds:null,useOrder:!1,dragCells:!1,skinFileName:null,maxTime:0,countDownTime:!1,maxActions:0,countDownActions:!1,infoUrl:null,infoCmd:null,messages:null,windowSize:new St(vt.DEFAULT_WIDTH,vt.DEFAULT_HEIGHT),transparentBg:!1,activityBgColor:vt.DEFAULT_BG_COLOR,activityBgGradient:null,bTimeCounter:!0,bScoreCounter:!0,bActionsCounter:!0,acp:null,abc:null,tgc:null,document:null,boxGridPos:"AB",shuffles:vt.DEFAULT_SHUFFLES,shuffleA:!0,shuffleB:!0,invAss:!1,menuElements:null,numericContent:!1});class $e extends Rt{constructor(t,i,s){super(),this.act=t,this.ps=i,this.minimumSize=new St(100,100),this.preferredSize=new St(500,400),this.$div=s||e()("<div/>",{class:"JClicActivity","aria-label":m("Activity panel")}),this.act.initAutoContentProvider()}setBounds(t){this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this.invalidate(t),this.$div.css({position:"relative",left:t.pos.x,top:t.pos.y,width:t.dim.width,height:t.dim.height})}buildVisualComponents(){if(this.playing=!1,this.skin=null,this.act.skinFileName&&this.act.skinFileName.length>0&&this.act.skinFileName!==this.act.project.settings.skinFileName&&(this.skin=this.act.project.mediaBag.getSkinElement(this.act.skinFileName,this.ps)),this.bgImage=null,this.act.bgImageFile&&this.act.bgImageFile.length>0){const t=this.act.project.mediaBag.getElement(this.act.bgImageFile,!0);t&&(this.bgImage=t.data)}this.backgroundColor=this.act.activityBgColor,this.act.transparentBg&&(this.backgroundTransparent=!0),this.act.border&&(this.border=!0);const t={display:"block","background-color":this.backgroundTransparent?"transparent":this.backgroundColor};this.border&&(t["box-shadow"]="0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)",t["border-radius"]="2px",t.color="#272727"),this.act.activityBgGradient&&(t["background-image"]=this.act.activityBgGradient.getCss()),this.$div.css(t)}updateContent(t){return super.updateContent(t)}playEvent(t){this.act.eventSounds.play(t)}initActivity(){this.playing&&(this.playing=!1,this.ps.reportEndActivity(this.act,this.solved)),this.solved=!1,this.ps.reportNewActivity(this.act,0),this.attachEvents(),this.enableCounters()}startActivity(){this.playing=!0}activityReady(){}showHelp(){}setDimension(t){return new St(Math.min(t.width,this.act.windowSize.width),Math.min(t.height,this.act.windowSize.height))}attachEvents(){this.events.forEach((t=>this.attachEvent(this.$div,t))),vt.TOUCH_DEVICE||-1!==e().inArray(Ue,this.events)||this.attachEvent(this.$div,Ue)}attachEvent(t,i){t.on(i,this,(i=>{if(i.type!==Ue||(vt.TOUCH_DEVICE||(vt.TOUCH_DEVICE=!0),-1!==e().inArray(Ue,this.events)))return i.data.processEvent.call(i.data,i);t.off(Ue)}))}processEvent(t){return!1}fitTo(t,e){const i=new kt;this.act.absolutePositioned&&null!==this.act.absolutePosition&&(i.x=Math.max(0,this.act.absolutePosition.x+t.pos.x),i.y=Math.max(0,this.act.absolutePosition.y+t.pos.y),t.dim.width-=this.act.absolutePosition.x,t.dim.height-=this.act.absolutePosition.y);const s=this.setDimension(new St(Math.max(2*this.act.margin+vt.MINIMUM_WIDTH,t.dim.width),Math.max(2*this.act.margin+vt.MINIMUM_HEIGHT,t.dim.height)));this.act.absolutePositioned||i.moveTo(Math.max(0,t.pos.x+(t.dim.width-s.width)/2),Math.max(0,t.pos.y+(t.dim.height-s.height)/2)),i.x+s.width>e.dim.width&&(i.x=Math.max(0,e.dim.width-s.width)),i.y+s.height>e.dim.height&&(i.y=Math.max(0,e.dim.height-s.height)),this.setBounds(new Et(i.x,i.y,s.width,s.height)),window.setTimeout((()=>this.buildAccessibleComponents()),0)}buildAccessibleComponents(){this.accessibleCanvas&&this.$canvas&&this.$canvas.children().length>0&&this.$canvas.empty()}forceFinishActivity(){}finishActivity(t){this.playing=!1,this.solved=t,null!==this.bc&&this.bc.end(),t?this.setAndPlayMsg("final","finishedOk"):this.setAndPlayMsg("finalError","finishedError"),this.ps.activityFinished(this.solved),this.ps.reportEndActivity(this.act,this.solved)}setAndPlayMsg(t,e){const i=this.act.messages[t]||null;this.ps.setMsg(i),null!==i&&null!==i.mediaContent||this.playEvent(e)}end(){this.forceFinishActivity(),this.playing&&(null!==this.bc&&this.bc.end(),this.ps.reportEndActivity(this.act,this.solved),this.playing=!1,this.solved=!1),this.clear()}clear(){}enableCounters(t,e,i){void 0===t&&(t=this.act.bTimeCounter),void 0===e&&(e=this.act.bScoreCounter),void 0===i&&(i=this.act.bActionsCounter),this.ps.setCounterEnabled("time",t),this.act.countDownTime&&this.ps.setCountDown("time",this.act.maxTime),this.ps.setCounterEnabled("score",e),this.ps.setCounterEnabled("actions",i),this.act.countDownActions&&this.ps.setCountDown("actions",this.act.maxActions)}shuffle(t,e,i){const s=this.act.shuffles;let n=s;for(;n>0;){const e=n>s?s:n;t.forEach((t=>{t&&t.shuffleCells(e,i)})),n-=s}}}Object.assign($e.prototype,{act:null,$div:null,$canvas:null,accessibleCanvas:!0,skin:null,$animatedBg:null,$animatedBgB:null,solved:!1,bgImage:null,playing:!1,firstRun:!0,currentItem:0,bc:null,ps:null,minimumSize:null,preferredSize:null,events:["click"],backgroundColor:null,backgroundTransparent:!1,border:null}),He.Panel=$e;const We=He;class Je{constructor(){this.settings=new Xt(this),this.activitySequence=new le(this),this._activities={},this.mediaBag=new be(this)}setProperties(t,i,s,n){i&&(this.path=i,i.file?this.basePath=i:this.basePath=et(i)),this.zip=s,this.name=t.attr("name"),this.version=t.attr("version"),void 0!==t.attr("type")&&""!==t.attr("type")&&(this.type=t.attr("type")),void 0!==t.attr("code")&&""!==t.attr("code")&&(this.code=t.attr("code")),this.settings.setProperties(t.children("settings")),this.activitySequence.setProperties(t.children("sequence")),this.mediaBag.setProperties(t.children("mediaBag")),this.reportableActs=0,this._activities={};const r=t.children("activities").children("activity"),a=this.mediaBag.getElementsOfType("font");return a.length>0&&(n.ownFonts=(n.ownFonts||[]).concat(a)),vt.NODEJS||At.checkTree(r,n),r.each(((t,i)=>{const s=e()(i);this._activities[X(s.attr("name"))]=s,"true"===s.children("settings").attr("report")&&this.reportableActs++})),this}getAttributes(){const t=Object.keys(this._activities);return this.activities={},t.forEach((t=>{const e=this._activities[t];this.activities[t]=e.jquery?We.getActivity(e,this):e})),L(this,["name","version","type","code","settings","activitySequence","activities","mediaBag"])}getJSON(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return JSON.stringify(this.getAttributes(),((t,e)=>e.toFixed?Number(e.toFixed(4)):e),t)}setAttributes(t,e,i,s){e&&(this.path=e,e.file?this.basePath=e:this.basePath=et(e)),this.zip=i,this.name=t.name,this.version=t.version,t.type&&(this.type=t.type),t.code&&(this.code=t.code),this.settings.setAttributes(t.settings),this.activitySequence.setAttributes(t.activitySequence),this.mediaBag.setAttributes(t.mediaBag),this.reportableActs=0,this._activities=t.activities;const n=this.mediaBag.getElementsOfType("font");return n.length>0&&(s.ownFonts=(s.ownFonts||[]).concat(n)),At.checkTree(this._activities,s),this.reportableActs=Object.keys(this._activities).filter((t=>this._activities[t].includeInReports)).length,this}getActivity(t){return We.getActivity(this._activities[X(t)],this)}realize(t){null===this.skin&&null!==this.settings.skinFileName&&this.settings.skinFileName.length>0&&(this.skin=this.mediaBag.getSkinElement(this.settings.skinFileName,t)),this.settings.eventSounds.realize(t,this.mediaBag),this.mediaBag.buildAll("font",null,t)}end(){}}Object.assign(Je.prototype,{name:"unknown",version:"0.1.3",type:null,code:null,settings:null,activitySequence:null,_activities:null,reportableActs:0,mediaBag:null,skin:null,basePath:"",path:null,zip:null});const Ge=Je;class Ke{constructor(t,e,i,s){this.type=t,this.source=e||null,this.dest=i||null,this.ok=s||!1,this.time=(new Date).valueOf()}$getXML(){const t={ok:this.ok,time:this.time};return this.type&&(t.type=this.type),this.source&&(t.source=this.source),this.dest&&(t.dest=this.dest),e()("<action/>",t)}setProperties(t){dt(t.get(0).attributes,((t,e)=>{switch(t){case"type":case"source":case"dest":this[t]=e;break;case"time":this[t]=Number(e);break;case"ok":this[t]=y(e,!1)}}))}}Object.assign(Ke.prototype,{type:"unknown",source:null,dest:null,time:0,isOk:!1});const Ze=Ke;class Ye{constructor(t){this.name=t.name,this.code=t.code,this.actions=[],this.startTime=(new Date).valueOf(),this.minActions=t.getMinNumActions(),this.reportActions=t.reportActions}$getXML(){const t={start:this.startTime,time:this.totalTime,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions};this.name&&(t.name=this.name),this.code&&(t.code=this.code),this.closed||(t.closed=!1),this.reportActions&&(t.reportActions=!0);const i=e()("<activity/>",t);return this.actions.forEach((t=>{i.append(t.$getXML())})),i}getData(){const t={name:this.name,time:Math.round(this.totalTime/10)/100,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions,precision:this.getPrecision(),closed:this.closed};return this.code&&(t.code=this.code),t}setProperties(t){dt(t.get(0).attributes,((t,e)=>{switch(t){case"name":case"code":this[t]=e;break;case"start":case"time":case"score":case"minActions":case"actions":this[t]=Number(e);break;case"solved":case"closed":case"reportActions":this[t]=y(e,!1)}})),t.children("action").each(((t,i)=>{const s=new Ze;s.setProperties(e()(i)),this.actions.push(s)}))}newAction(t,e,i,s){this.closed||(this.lastAction=new Ze(t,e,i,s),this.actions.push(this.lastAction))}getActionReg(t){return t>=this.actions.length?null:this.actions[t]}closeActivity(){this.closed||(this.lastAction?this.totalTime=this.lastAction.time-this.startTime:this.totalTime=(new Date).valueOf()-this.startTime,this.closed=!0)}getPrecision(){let t=0;return this.closed&&this.minActions>0&&this.numActions>0&&(t=this.solved?this.numActions<this.minActions?100:Math.round(100*this.minActions/this.numActions):Math.round(this.score*this.score*100/(this.minActions*this.numActions))),t}endActivity(t,e,i){this.closed||(this.solved=i,this.numActions=e,this.score=t,this.closeActivity())}}Object.assign(Ye.prototype,{name:"",code:"",startTime:0,totalTime:0,actions:[],solved:!1,lastAction:null,score:0,minActions:0,closed:!1,reportActions:!1,numActions:0});const Qe=Ye;class Xe{constructor(t){this.name=t.tag,this.description=t.description,this.activities=[],this.currentActivity=null,this.totalTime=0,this.closed=!1,this.info=new ti(this)}getData(){const t={sequence:this.name,activities:[]};return this.activities.forEach((e=>t.activities.push(e.getData()))),t}getInfo(){return this.info.recalc()}endSequence(){this.currentActivity&&this.activities.length>0&&(this.currentActivity.closed||this.currentActivity.closeActivity(),this.totalTime=this.currentActivity.startTime+this.currentActivity.totalTime-this.activities[0].startTime,this.info.valid=!1)}newActivity(t){this.closed||(this.currentActivity=new Qe(t),this.activities.push(this.currentActivity),this.info.valid=!1)}endActivity(t,e,i){this.currentActivity&&(this.currentActivity.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentActivity&&(this.currentActivity.newAction(t,e,i,s),this.info.valid=!1)}}Object.assign(Xe.prototype,{name:"",description:"",activities:[],currentActivity:null,totalTime:0,closed:!1,info:null});class ti{constructor(t){this.sqReg=t}clear(){this.nActivities=this.nActClosed=this.nActSolved=this.nActScore=0,this.ratioSolved=this.nActions=this.tScore=this.tTime=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.nActivities=this.sqReg.activities.length,this.nActivities>0&&(this.sqReg.activities.forEach((t=>{if(t.closed){this.nActClosed++,this.tTime+=t.totalTime,this.nActions+=t.numActions,t.solved&&this.nActSolved++;const e=t.getPrecision();e>=0&&(this.tScore+=e,this.nActScore++)}})),this.nActClosed>0&&(this.ratioSolved=this.nActSolved/this.nActClosed),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore))),this.valid=!0),this}}Object.assign(ti.prototype,{sqReg:null,valid:!1,nActivities:0,nActClosed:0,nActSolved:0,nActScore:0,ratioSolved:0,nActions:0,tScore:0,tTime:0}),Xe.Info=ti;const ei=Xe;class ii{constructor(t,e){this.projectName=t.name,this.code=e||t.code,this.sequences=[],this.actNames=[],this.started=new Date,this.info=new si(this),this.reportableActs=t.reportableActs}getData(t,e){t&&this.info.recalc();const i={projectName:this.projectName,played:this.info.nActivities,ratioPlayed:Math.round(100*this.info.ratioPlayed),solved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actions:this.info.nActions,score:this.info.tScore,time:Math.round(this.info.tTime/10)/100,sequences:[]};return this.sequences.forEach((t=>{const s=t.getData();(e||s.activities.length>0)&&i.sequences.push(s)})),i}getInfo(){return this.info.recalc()}end(){this.endSequence()}endSequence(){this.currentSequence&&0===this.currentSequence.totalTime&&this.currentSequence.endSequence(),this.currentSequence=null,this.info.valid=!1}newSequence(t){this.endSequence(),this.currentSequence=new ei(t),this.sequences.push(this.currentSequence),this.info.valid=!1}newActivity(t){this.currentSequence&&(-1===this.actNames.indexOf(t.name)&&this.actNames.push(t.name),this.currentSequence.newActivity(t),this.info.valid=!1)}endActivity(t,e,i){this.currentSequence&&(this.currentSequence.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentSequence&&(this.currentSequence.newAction(t,e,i,s),this.info.valid=!1)}getCurrentSequenceTag(){return this.currentSequence?this.currentSequence.name:null}getCurrentSequenceInfo(){return this.currentSequence?this.currentSequence.getInfo():null}}Object.assign(ii.prototype,{reportableActs:0,actNames:null,sequences:null,currentSequence:null,started:null,projectName:"",info:null,code:null});class si{constructor(t){this.sReg=t}clear(){this.numSequences=this.nActivities=this.nActSolved=this.nActScore=0,this.ratioSolved=this.ratioPlayed=this.nActions=this.tScore=this.tTime=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.sReg.sequences.forEach((t=>{const e=t.getInfo();e.nActivities>0&&(this.numSequences++,e.nActClosed>0&&(this.nActivities+=e.nActClosed,this.nActions+=e.nActions,e.nActScore>0&&(this.nActScore+=e.nActScore,this.tScore+=e.tScore*e.nActScore),this.tTime+=e.tTime,this.nActSolved+=e.nActSolved))})),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore)),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.sReg.reportableActs>0&&(this.ratioPlayed=this.sReg.actNames.length/this.sReg.reportableActs)),this.valid=!0),this}}Object.assign(si.prototype,{sReg:null,valid:!1,numSequences:0,nActivities:0,nActSolved:0,nActScore:0,ratioSolved:0,ratioPlayed:0,nActions:0,tScore:0,tTime:0}),ii.Info=si;const ni=ii;class ri{static Decrypt(t){if(null===t||0===t.length)return null;const e=ri.decodify(t);return e===ri.BLANK?"":e}static hexCharArrayToChar(t,e){let i=0;for(let s=0;s<=3;s++){const n=Number.parseInt(t[e+s],16);if(isNaN(n))throw"Invalid expression!";i=16*i+n}return String.fromCharCode(i)}static hexCharArrayToInt(t,e){let i=0;for(let s=0;s<=1;s++){const n=Number.parseInt(t[e+s],16);if(isNaN(n))throw"Invalid expression!";i=16*i+n}return i}static decodifyZerosField(t){let e="",i=Number.parseInt(t[0],32),s=0,n=0;for(n=0;0!==i;n++){for(;i>0;)e=e+t[3*n+1]+t[3*n+2],i--,s++;i=t.length>3*n+3?Number.parseInt(t[3*n+3],32):0}for(let i=3*n+1;i<t.length;i++)e+=t[i];return Number.parseInt(s,32)+e}static decompressZeros(t){t=ri.decodifyZerosField(t);let e=Number.parseInt(t[0],32),i=2*e+1,s=!1,n="";for(let r=0;r<e&&!s;r++){let e=ri.hexCharArrayToInt(t,1+2*r).toString(2);for(;e.length<8;)e="0"+e;for(let r=0;r<=7&&!s;r++)"1"===e[r]?n+="0":i<t.length?n+=t[i++]:s=!0}return n}static decodifyFromHex(t){let e="",i=0;for(let s=0;i<t.length;s++){e+=ri.hexCharArrayToChar(t,i),i+=4}return e}static unchangeOrder(t){let e=0,i=t.length-1;const s=[];for(let e=0;e<t.length;e++)s[e]="";for(let n=0;n<t.length;n++)s[n]=n%2==0?t[e++]:t[i--];return s.join("")}static codify(t){if(t.length>24)throw"Password is too large!";return ri.changeOrder(ri.compressZeros(ri.codifyToHexWord(t)))}static decodify(t){try{return ri.decodifyFromHex(ri.decompressZeros(ri.unchangeOrder(t)))}catch(t){return""}}}ri.BLANK="___blank___##";const ai=ri;class oi{constructor(t,e){this.API=t,"function"==typeof t.Initialize?this.is2004=!0:(this.prefix="LMS",this.core="cmi.core."),this.reporter=e}static scanForAPI(t,e){return t.API_1484_11&&t.API_1184_11.Initialize&&t.API_1184_11.SetValue&&t.API_1184_11.Commit?t.API_1184_11:t.API&&t.API.LMSInitialize&&t.API.LMSSetValue&&t.API.LMSCommit?t.API:t.parent&&t.parent!==t&&e++<oi.DISCOVER_MAX_TRIES?oi.scanForAPI(t.parent,e):null}static getSCORM(t){let e=null;try{let i=oi.scanForAPI(window,0);null===i&&window.opener&&(i=oi.scanForAPI(window.opener,0)),i&&(e=new oi(i,t),e.initialize()||(e=null))}catch(t){e=null,b("warn","Unable to use SCORM: %s",t.toString())}return e}initialize(){let t=!1;try{t=this.API[this.prefix+"Initialize"](""),t&&(this.studentId=this.getValue(this.core+(this.is2004?"learner_id":"student_id")),this.studentName=this.getValue(this.core+(this.is2004?"learner_name":"student_name")),this.setValue(this.core+"score.min",0),this.setValue(this.core+"score.max",100),e()(window).on("unload",(()=>{this.commitInfo(),this.terminate(),this.API=null}))),b("debug","SCORM initialized")}catch(t){b("error","Error initializing SCORM API: ".concat(t.message))}return t}terminate(){let t=!1;try{t=this.API[this.is2004?"Terminate":"LMSFinish"]("")}catch(t){b("error","Error terminating SCORM API: ".concat(t.message))}return t}commitInfo(){const t=this.reporter.getInfo(),e=Math.round(100*t.globalScore),i=this.getTimeExpression(t.tTime);this.setValue(this.core+"score.raw",e),this.setValue(this.core+"session_time",i),this.commit(),b("debug","SCORM results reported: ".concat(e," (").concat(i,")"))}commit(){let t=!1;try{t=this.API[this.prefix+"Commit"]("")}catch(t){b("error","Error commiting data to the SCORM API: ".concat(t.message))}return t}setValue(t,e){let i=!1;try{i=this.API[this.prefix+"SetValue"](t,e)}catch(i){b("error",'Error setting value "'.concat(e,'" to "').concat(t,'" in SCORM API: ').concat(i.message))}return i}getValue(t){let e=!1;try{e=this.API[this.prefix+"GetValue"](t)}catch(e){b("error",'Error retrieving "'.concat(t,'" from SCORM API: ').concat(e.message))}return e}getTimeExpression(t){const e=new Date(t),i=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds();return this.is2004?"PT".concat(i,"H").concat(s,"M").concat(n,"S"):"".concat(("0000"+i).slice(-4),":").concat(("00"+s).slice(-2),":").concat(("00"+n).slice(-2))}getScormType(){return"SCORM ".concat(this.is2004?"2004":"1.2")}}Object.assign(oi.prototype,{is2004:!1,reporter:null,prefix:"",core:"cmi.",API:null,studentId:"",studentName:""}),oi.DISCOVER_MAX_TRIES=50;const ci=oi;class li{constructor(t){this.ps=t,this.sessions=[],this.started=new Date,this.initiated=!1,this.info=new hi(this)}static registerClass(t,e){return li.CLASSES[t]=e,e}static getReporter(t,e){let i=null;return null===t&&(t="Reporter",e.options.hasOwnProperty("reporter")&&(t=e.options.reporter)),li.CLASSES.hasOwnProperty(t)?i=new li.CLASSES[t](e):b("error","Unknown reporter class: %s",t),i}getInfo(){return this.info.recalc()}getProperty(t,e){return e}getBooleanProperty(t,e){const i=this.getProperty(t,!0===e?"true":"false");return null===t?e:"true"===i}getGroups(){return Promise.reject("No groups defined!")}getUsers(t){return Promise.reject("No users defined in "+t)}getUserData(t){return Promise.reject("Unknown user!")}getGroupData(t){return Promise.reject("Unknown group!")}userBased(){return null===this.bUserBased&&(this.bUserBased=this.getBooleanProperty("USER_TABLES",!1)),this.bUserBased}promptForNewGroup(){return Promise.reject("Remote creation of groups not yet implemented!")}promptForNewUser(){return Promise.reject("Remote creation of users not yet implemented!")}promptGroupId(){return new Promise(((t,i)=>{this.userBased()?this.getGroups().then((s=>{if(!s||s.length<1)i("No groups defined!");else{let n=0;const r=e()("<select/>").attr({size:Math.max(3,Math.min(15,s.length))});s.forEach((t=>r.append(e()("<option/>").attr({value:t.id}).text(t.name)))),r.change((t=>{n=t.target.selectedIndex})),this.ps.skin.showDlg(!0,{main:[e()("<h2/>",{class:"subtitle"}).html(m("Select group:")),r],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then((()=>{t(s[n].id)})).catch(i)}})).catch(i):i("This system does not manage users!")}))}promptUserId(t){return new Promise(((i,s)=>{if(null===this.userId||t)if(this.userBased()){const t=e()("<input/>",{type:"password",size:8,maxlength:64});if(this.getBooleanProperty("SHOW_USER_LIST",!0))this.promptGroupId().then((n=>{this.getUsers(n).then((r=>{if(!r||r.length<1)s("Group "+n+" has no users!");else{let n=-1;const a=e()("<select/>").attr({size:Math.max(3,Math.min(15,r.length))});r.forEach((t=>a.append(e()("<option/>").attr({value:t.id}).text(t.name)))),a.change((t=>{n=t.target.selectedIndex})),this.ps.skin.showDlg(!0,{main:[e()("<h2/>",{class:"subtitle"}).html(m("Select user:")),a,e()("<h2/>",{class:"subtitle"}).html(m("Password:")).append(t)],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then((()=>{n>=0?r[n].pwd&&ai.Decrypt(r[n].pwd)!==t.val()?(window.alert(m("Incorrect password")),s("Incorrect password")):(this.userId=r[n].id,i(this.userId)):s("No user has been selected")})).catch(s)}})).catch(s)})).catch(s);else{const n=e()("<input/>",{type:"text",size:8,maxlength:64});this.ps.skin.showDlg(!0,{main:[e()("<div/>").css({"text-align":"right"}).append(e()("<h2/>",{class:"subtitle"}).html(m("User:")).append(n)).append(e()("<h2/>",{class:"subtitle"}).html(m("Password:")).append(t))],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then((()=>{this.getUserData(n.val()).then((e=>{e.pwd&&ai.Decrypt(e.pwd)!==t.val()?(window.alert(m("Incorrect password")),s("Incorrect password")):(this.userId=e.id,i(this.userId))})).catch(s)})).catch(s)}}else s("This system does not manage users!");else i(this.userId)}))}getData(){this.info.recalc();const t={started:this.started.toISOString(),descriptionKey:this.descriptionKey,descriptionDetail:this.descriptionDetail,projects:this.info.numSessions,sequences:this.info.numSequences,activitiesDone:this.info.nActivities,playedOnce:this.info.nActPlayed,reportable:this.info.reportableActs,ratioPlayed:Math.round(100*this.info.ratioPlayed),activitiesSolved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actScore:this.info.nActScore,partialScore:Math.round(100*this.info.partialScore),globalScore:Math.round(100*this.info.globalScore),time:Math.round(this.info.tTime/10)/100,actions:this.info.nActions,sessions:[]};return this.userId?t.userId=this.userId:this.SCORM&&(t.user=this.SCORM.studentName+(""===this.SCORM.studentId?"":" (".concat(this.SCORM.studentId,")"))),this.sessions.forEach((e=>{e.getInfo().numSequences>0&&t.sessions.push(e.getData(!1,!1))})),t}init(t){return t||(t=this.ps.options),this.userId=w(t.user),this.sessionKey=w(t.key),this.sessionContext=w(t.context),this.groupCodeFilter=w(t.groupCodeFilter),this.userCodeFilter=w(t.userCodeFilter),!1!==t.SCORM&&(this.SCORM=ci.getSCORM(this),null!==this.SCORM&&this.descriptionKey===li.prototype.descriptionKey&&(this.descriptionKey=this.SCORM.getScormType())),this.initiated=!0,b("debug","Basic Reporter initialized"),Promise.resolve(!0)}end(){return b("debug","Basic Reporter ending"),this.endSession(),Promise.resolve(!0)}endSequence(){this.currentSession&&(this.currentSession.endSequence(),this.info.valid=!1)}endSession(){this.endSequence(),this.currentSession=null}newGroup(t){throw"No database!"}newUser(t){throw"No database!"}newSession(t){this.endSession(),this.currentSession=new ni(t),this.sessions.push(this.currentSession),this.info.valid=!1}newSequence(t){this.currentSession&&(this.currentSession.newSequence(t),this.info.valid=!1,this.SCORM&&this.SCORM.commitInfo())}newActivity(t){this.currentSession&&(this.currentSession.newActivity(t),this.info.valid=!1)}endActivity(t,e,i){this.currentSession&&(this.currentSession.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentSession&&(this.currentSession.newAction(t,e,i,s),this.info.valid=!1)}getCurrentSequenceInfo(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceInfo()}getCurrentSequenceTag(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceTag()}}Object.assign(li.prototype,{info:null,ps:null,SCORM:null,userId:null,sessionKey:null,sessionContext:null,groupCodeFilter:null,userCodeFilter:null,descriptionKey:"Results are not currently being saved",descriptionDetail:"",started:null,sessions:[],currentSession:null,initiated:!1,bUserBased:null,MAX_USERID_PROMPT_ATTEMPTS:3});class hi{constructor(t){this.rep=t}clear(){this.numSessions=this.numSequences=this.nActivities=this.reportableActs=this.nActSolved=this.nActPlayed=this.nActScore=this.nActions=this.ratioSolved=this.ratioPlayed=this.tScore=this.tTime=this.partialScore=this.globalScore=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.rep.sessions.forEach((t=>{const e=t.getInfo();this.reportableActs+=e.sReg.reportableActs,e.numSequences>0&&(this.numSessions++,this.numSequences+=e.numSequences,e.nActivities>0&&(this.nActivities+=e.nActivities,this.nActPlayed+=e.sReg.actNames.length,this.nActSolved+=e.nActSolved,this.nActions+=e.nActions,e.nActScore>0&&(this.tScore+=e.tScore*e.nActScore,this.nActScore+=e.nActScore),this.tTime+=e.tTime))})),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.reportableActs>0&&(this.ratioPlayed=this.nActPlayed/this.reportableActs),this.partialScore=this.tScore/(100*this.nActScore),this.globalScore=this.partialScore*this.ratioPlayed),this.valid=!0),this}}Object.assign(hi.prototype,{rep:null,valid:!1,numSessions:0,numSequences:0,nActivities:0,reportableActs:0,nActSolved:0,nActPlayed:0,nActScore:0,nActions:0,ratioSolved:0,ratioPlayed:0,tScore:0,partialScore:0,tTime:0,globalScore:0}),li.Info=hi,li.CLASSES={Reporter:li};const ui=li;class di extends Rt{constructor(t,i){super(),i=g(i),this.options=e().extend(Object.create(this.options),i),this.id="JC".concat((65536+Math.round(65535*Math.random())).toString(16).toUpperCase().substring(1)),this.$topDiv=t||e()("<div/>"),this.$topDiv.css({"text-align":"initial"}),this.$topDiv.parent().is("td")&&this.$topDiv.css({width:ct(this.options.width,null,null,"100%"),height:ct(this.options.height,null,null,"100%")}),this.$mainContainer=e()("<div/>",{class:"JClicContainer",id:this.id}).css({width:"100%",height:"100%"}).appendTo(this.$topDiv),this.localFS=location&&"file:"===location.protocol,this.$div=e()("<div/>",{class:"JClicPlayer"}),this.project=new Ge,this.activeMediaBag=new zt,this.counterVal={score:0,actions:0,time:0},this.bgImageOrigin=new kt,this.buildActions(),this.history=new Nt(this),this.audioEnabled=this.options.audioEnabled,this.navButtonsAlways=this.options.navButtonsAlways,this.defaultSkin=Ht.getSkin(this.options.skin,this),this.setSkin(Ht.getSkin("@empty.xml",this)),this.initTimers(),this.listenTouchEvents(),b("info","JClicPlayer ready")}listenTouchEvents(){let t=null,e=0,i=this.$div[0];const{minSwipeX:s,maxSwipeY:n,rightToLeft:r}=this.options,a=a=>{if(a.target===i&&a.changedTouches&&1===a.changedTouches.length){const i=a.changedTouches[0],o=t?i.clientX-t.clientX:0,c=t?i.clientY-t.clientY:0,l=Math.sqrt(o*o+c*c);switch(a.type){case"touchstart":const h=new Date;document&&document.fullscreenEnabled&&t&&e&&h-e<800&&l<s?(a.preventDefault(),b("info","Toggle full screen mode from double touch"),this.skin.setScreenFull(),t=null):(t=i,e=h);break;case"touchend":if(t&&Math.abs(o)>s&&Math.abs(c)<n){const e=o<0&&!r?"next":"prev",i=this.actions[e];i&&i.enabled&&(a.preventDefault(),b("info",'Performing action "'.concat(e,'" from touch gesture')),i.actionPerformed(a)),t=null}else l>s&&(t=null);break;case"touchcancel":t=null}}else t=null};i.addEventListener("touchstart",a),i.addEventListener("touchend",a),i.addEventListener("touchcancel",a)}getUniqueId(t){return"".concat(this.id,"-").concat(t)}buildActions(){this.actions={next:new _t("next",(()=>this.history.processJump(this.project.activitySequence.getJump(!1,this.reporter),!1))),prev:new _t("prev",(()=>this.history.processJump(this.project.activitySequence.getJump(!0,this.reporter),!1))),return:new _t("return",(()=>this.history.pop())),reset:new _t("reset",(()=>{this.actPanel&&this.actPanel.act.canReinit()&&this.initActivity()})),help:new _t("help",(()=>{this.actPanel&&this.actPanel.showHelp()})),info:new _t("info",(()=>{this.actPanel&&this.actPanel.act.hasInfo()&&(this.actPanel.act.infoUrl?this.displayURL(this.act.infoUrl,!0):this.actPanel.act.infoCmd&&this.runCmd(this.actPanel.act.infoCmd))})),reports:new _t("reports",(()=>this.showReports())),audio:new _t("audio",(()=>{this.audioEnabled=!this.audioEnabled,this.audioEnabled||this.stopMedia(),Yt.prototype.globalEnabled=this.audioEnabled}))},e().each(this.actions,((t,e)=>{e.addStatusListener((t=>{this.skin&&this.skin.actionStatusChanged(t)}))}))}reset(){b("info","Restoring player"),this.removeActivity(),this.end(),this.activeMediaBag=new zt,this.history.clearHistory(),this.setSkin(null),this.setMsg(null),this.setCounterValue("score",0),this.setCounterValue("actions",0),this.setCounterValue("time",0),this.skin&&this.skin.setWaitCursor("reset")}stop(){this.stopMedia(-1)}end(){let t=null;return this.stopMedia(),this.closeHelpWindow(),this.reporter&&(t=this.reporter.end(),this.reporter=null),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null),this.project&&(this.project.end(),this.project=null),this.activeMediaBag&&this.activeMediaBag.removeAll(),t||Promise.resolve(!0)}initReporter(){return this.reporter&&(this.reporter.end(),this.reporter=null),this.reporter=ui.getReporter(null,this),this.reporter.init()}initTimers(){this.timer&&this.timer.stop(),this.timer=new Ot((()=>{this.incCounterValue("time"),this.actPanel&&this.actPanel.act.maxTime>0&&this.actPanel.playing&&this.counterVal.time>=this.actPanel.act.maxTime&&this.actPanel.finishActivity(!1)}),1e3,!1),this.delayedTimer&&this.delayedTimer.stop(),this.delayedTimer=new Ot((()=>{this.delayedAction&&this.delayedAction.processEvent(this.delayedAction,null)}),1e3,!1),this.delayedTimer.repeats=!1}showReports(){this.skin&&this.skin.showReports(this.reporter)}closeHelpWindow(){this.skin&&this.skin._closeDlg(!1)}setSkin(t){!(t=t||(this.project&&this.project.skin?this.project.skin:this.defaultSkin))||null!==this.skin&&t.name===this.skin.name||(t.attach(this),this.skin=t,this.skin.doLayout())}setProject(t){this.project&&(this.project!==t&&this.project.end(),this.removeActivity()),this.project=t||new Ge,this.project.realize(this)}load(t,i,s){this.forceFinishActivity(),this.setWaitCursor(!0);let r=null;if(t){if("string"==typeof t){const r=st(this.basePath,t);if(r.endsWith("project.json"))return b("info","Loading JSON info from: ".concat(r)),void e().getJSON(r).done((t=>{let{mainFile:e}=t;e&&Y(e,".jclic")||Y(e,".jclic.json")?this.load(st(et(r),e),i,s):b("error",'Invalid or null "mainFile" specified in '.concat(r,' - "project.json".'))})).fail(((e,i,s)=>{const n="".concat(i," (").concat(s,") while loading ").concat(t);b(n),window.alert("Error!\n".concat(n))})).always((()=>this.setWaitCursor(!1)));if(r.endsWith(".zip"))return this.zip=null,b("info","Loading ZIP file: ".concat(r)),void a().getBinaryContent(r,((t,e)=>{if(t)return this.setWaitCursor(!1),void b("error","Error loading ZIP file: ".concat(t.toString()));(new(n())).loadAsync(e).then((t=>{this.zip=t,this.zip.fullZipPath=r,this.zip.zipBasePath=et(r);let e=null;this.zip.files["project.json"]?this.zip.files["project.json"].async("string").then((t=>{try{const e=JSON.parse(t);Y(e.mainFile,".jclic")?this.load(st(this.zip.zipBasePath,e.mainFile),i,s):b("error",'Invalid or null "mainFile" specified in '.concat(r,' - "project.json".'))}catch(t){b("error",'Error reading "project.json" in '.concat(r,": ").concat(t?t.toString():"unknown error"))}})).catch((t=>{b("error","Error reading ZIP file: ".concat(t?t.toString():"unknown reason"))})):(e=Object.keys(this.zip.files).find((t=>t.endsWith(".jclic")))||null,e?this.load(st(this.zip.zipBasePath,e),i,s):b("error","This ZIP file does not contain any JClic project!")),this.setWaitCursor(!1)})).catch((t=>{b("error","Error reading ZIP file: ".concat(t?t.toString():"unknown reason")),this.setWaitCursor(!1)}))}));if(this.localFS&&window.JClicObject&&!window.JClicObject.projectFiles[r]){const e=document.createElement("script");return e.src="".concat(r,".js"),e.onload=()=>{var e,n;window.JClicObject.projectFiles[r]&&(window.JClicObject.projectFiles[r]=(e=[[/
/g,"\r"],[/
/g,"\n"],[/	/g,"\t"]],n=window.JClicObject.projectFiles[r],e.reduce(((t,e)=>{let[i,s]=e;return t.replace(i,s)}),n)),this.load(t,i,s))},document.head.appendChild(e),void this.setWaitCursor(!1)}const o=n=>{const a=0===n.indexOf("data:text/xml;")||n.endsWith(".jclic");(a?e().get(n,null,null,"xml"):e().getJSON(n)).done((n=>{if(null===n||"object"!=typeof n)return void b("error","Bad data. Project not loaded: ".concat(t));const o=new Ge;a?o.setProperties(e()(n).find("JClicProject"),r,this.zip,this.options):o.setAttributes(n,r,this.zip,this.options),b("info","Project file loaded and parsed: ".concat(t));const c=o.mediaBag.buildAll(null,(t=>{b("trace",'"'.concat(t.name,'" ready.')),this.incProgress(1)}),this);b("info","Media elements to be loaded: ".concat(c)),this.setProgress(0,c);let l=0;this.setWaitCursor(!0);const h=window.setInterval((()=>{++l>this.options.maxWaitTime/500&&(window.clearInterval(h),this.setProgress(-1),this.setWaitCursor(!1),b("error","Error loading media"));-1===o.mediaBag.countWaitingElements()&&(window.clearInterval(h),this.setProgress(-1),this.setWaitCursor(!1),this.load(o,i,s))}),500)})).fail(((e,i,s)=>{const n="".concat(i," (").concat(s,") while loading ").concat(t);b(n),window.alert("Error!\n".concat(n))})).always((()=>this.setWaitCursor(!1)))};b("info","Loading project: ".concat(t));let c=r;if(this.zip){const t=it(c,this.zip.zipBasePath);if(this.zip.files[t])return void this.zip.file(t).async("string").then((e=>{o("data:".concat(t.endsWith(".jclic")?"text/xml":"application/json",";charset=UTF-8,").concat(encodeURIComponent(e)))})).catch((e=>{b("error",'Unable to extract "'.concat(t,'" from ZIP file because of: ').concat(e?e.toString():"unknown reason")),this.setWaitCursor(!1)}))}else if(this.localFS){if(!window.JClicObject||!window.JClicObject.projectFiles[r])return b("error","Unable to load: ".concat(r,".js")),void this.setWaitCursor(!1);c="data:".concat(r.endsWith(".jclic")?"text/xml":"application/json",";charset=UTF-8,").concat(encodeURIComponent(window.JClicObject.projectFiles[r]))}return void o(c)}this.setProject(t),i||s||(i="0"),this.reporter&&this.reporter.newSession(t)}if(!B(i)){b("info","Loading sequence: ".concat(i)),this.navButtonsDisabled=!1;let t=null;if("string"==typeof i&&(t=this.project.activitySequence.getElementByTag(i,!0)),null===t){const e=parseInt(i,10);"number"==typeof e&&(t=this.project.activitySequence.getElement(e,!0))}null!==t&&(this.reporter&&this.reporter.newSequence(t),s=t.activity)}if(s){const t=this.project.getActivity(s);t?(b("info","Loading activity: ".concat(s)),me.resetAudioElements(),t.prepareMedia(this),this.project.activitySequence.checkCurrentActivity(t.name),r=t.getActivityPanel(this),r.buildVisualComponents()):b("error","Missing activity: ".concat(s))}if(null!==this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setCounterValue("time",0)),r){if(this.actPanel=r,this.options.fade>0&&this.actPanel.$div.css("display","none"),this.$div.prepend(this.actPanel.$div),this.skin&&this.skin.resetAllCounters(!1),this.actPanel.skin?this.setSkin(this.actPanel.skin):this.project.skin?(this.setSkin(this.project.skin),this.lastProjectSkin=this.project.skin):this.lastProjectSkin?this.setSkin(this.lastProjectSkin):this.setSkin(null),this.skin){const t=this.history.storedElementsCount()>0||this.options.returnAsExit,e=this.navButtonsAlways?"both":this.navButtonsDisabled?"none":this.project.activitySequence.getNavButtonsFlag();this.actions.next.setEnabled(("fwd"===e||"both"===e)&&this.project.activitySequence.hasNextAct(t)),this.actions.prev.setEnabled(("back"===e||"both"===e)&&this.project.activitySequence.hasPrevAct(t)),this.actions.return.setEnabled(t),this.actions.help.setEnabled(this.actPanel.act.helpWindowAllowed()),this.actions.reset.setEnabled(this.actPanel.act.canReinit()),this.actions.info.setEnabled(this.actPanel.act.hasInfo())}this.doLayout(),this.initActivity(),this.history.pushBrowserHistory(),this.actPanel.$div.fadeIn(this.options.fade,(()=>this.activityReady()))}this.setWaitCursor(!1)}forceFinishActivity(){this.timer.stop(),this.delayedTimer.stop(),this.actPanel&&(this.closeHelpWindow(),this.actPanel.forceFinishActivity(),this.stopMedia(),this.activeMediaBag.removeAll())}removeActivity(){this.forceFinishActivity(),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setMsg(null),this.doLayout())}initActivity(){this.setWaitCursor(!0),this.timer.stop(),this.delayedTimer.stop(),this.setCounterValue("time",0),this.stopMedia(),this.actPanel&&(this.actPanel.initActivity(),this.timer.start(),this.actPanel.act.mustPauseSequence()||this.startAutoPassTimer(),b("info",'Activity "'.concat(this.actPanel.act.name,'" running'))),this.setWaitCursor(!1)}activityReady(){this.actPanel&&(this.actPanel.activityReady(),b("info","Activity ready"))}startActivity(){this.setWaitCursor(!0),this.actPanel&&this.actPanel.startActivity(),this.setWaitCursor(!1)}doLayout(){const t=this.dim.width=this.$div.width(),e=this.dim.height=this.$div.height(),i={"background-color":this.actPanel?this.actPanel.act.bgColor:"azure","background-image":""};if(this.actPanel){const s=this.actPanel.act;s.bgGradient&&(i["background-image"]=s.bgGradient.getCss()),s.bgImageFile&&s.bgImageFile.length>0&&this.project.mediaBag.getElement(s.bgImageFile,!0).getFullPathPromise().then((t=>{this.$div.css({"background-image":"url('"+t+"')","background-repeat":s.tiledBgImg?"repeat":"no-repeat","background-position":s.tiledBgImg?"":"center center"})}));const n=vt.BoxBase.AC_MARGIN,r=new Et(n,n,t-2*n,e-2*n);this.actPanel.bgImage&&!s.tiledBgImg&&s.absolutePositioned&&(this.bgImageOrigin.x=(t-this.actPanel.bgImage.width)/2,this.bgImageOrigin.y=(e-this.actPanel.bgImage.height)/2,r.pos.moveTo(this.bgImageOrigin),r.dim.width-=this.bgImageOrigin.x-n,r.dim.height-=this.bgImageOrigin.y-n,r.dim.width=Math.min(r.dim.width,t),r.dim.height=Math.min(r.dim.height,e)),this.actPanel.fitTo(r,this)}this.$div.css(i)}playMedia(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=null;const n=t.file;let r=null;switch(t.type){case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":case"RECORD_AUDIO":case"PLAY_RECORDED_AUDIO":if(this.audioEnabled){const i=this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this);i&&(r=()=>i.play(e))}break;case"RUN_CLIC_PACKAGE":s=new ee("JUMP",n),t.externalParam&&(s.projectPath=t.externalParam),r=()=>this.history.processJump(s,!0);break;case"RUN_CLIC_ACTIVITY":this.history.push(),r=()=>this.load(null,null,n);break;case"RETURN":if(this.history.storedElementsCount()>0||!this.options.returnAsExit){r=()=>this.history.pop();break}case"EXIT":s=new ee("EXIT",n),r=()=>this.history.processJump(s,!1);break;case"RUN_EXTERNAL":r=()=>this.runCmd(n);break;case"URL":n&&(r=()=>this.displayURL(n,t.level>1));break;default:b("error","Unknown media type: ".concat(t.type))}i&&r?i.push(r):r&&r()}stopMedia(t){"number"!=typeof t&&(t=-1),this.activeMediaBag.stopAll(t)}runCmd(t){b("warn",'Unsupported call to external command: "'.concat(t,'"'))}activityFinished(t){this.closeHelpWindow(),b("info","Activity finished"),this.timer.stop(),this.startAutoPassTimer()}startAutoPassTimer(){const t=this.project.activitySequence.getCurrentAct();null!==t&&t.delay>0&&!this.delayedTimer.isRunning()&&!this.navButtonsDisabled&&(this.delayedAction=this.actions.next,this.delayedTimer.interval=1e3*t.delay,this.delayedTimer.start())}setMsg(t){const e=this.skin?this.skin.getMsgBox():null;e&&(e.clear(),this.skin.invalidate(e).update(),e.setContent(t||ke.EMPTY_CONTENT),this.skin.invalidate(e).update(),e.playMedia(this))}playMsg(){this.skin&&this.skin.getMsgBox()&&this.skin.getMsgBox().playMedia(this)}setCounterValue(t,e){this.counterVal[t]=e,this.skin&&this.skin.counters[t]&&this.skin.counters[t].setValue(e)}getCounterValue(t){return this.counterVal[t]}setCounterEnabled(t,e){this.skin&&(this.skin.enableCounter(t,e),this.setCountDown(t,0))}incCounterValue(t){this.counterVal[t]++;const e=this.actPanel,i=this.skin?this.skin.counters[t]:null;i&&i.setValue(this.counterVal[t]),"actions"===t&&null!==e&&e.act.maxActions>0&&e.playing&&this.counterVal.actions>=e.act.maxActions&&window.setTimeout((()=>{e.finishActivity(e.solved)}),0)}setCountDown(t,e){this.skin&&this.skin.counters[t]&&this.skin.counters[t].setCountDown(e)}setWaitCursor(t){this.skin&&this.skin.setWaitCursor(t)}setProgress(t,e){this.skin&&this.skin.setProgress(t,e)}incProgress(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.skin&&this.skin.incProgress(t)}getActiveMediaPlayer(t){return this.activeMediaBag&&t?this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this):null}reportNewActivity(t){const e=this.project.activitySequence.getCurrentAct();this.reporter&&(e.tag===this.reporter.getCurrentSequenceTag()&&this.reporter.newSequence(e),t.includeInReports&&this.reporter.newActivity(t)),this.setCounterValue("actions",0),this.setCounterValue("score",0)}reportNewAction(t,e,i,s,n,r){this.reporter&&t.includeInReports&&t.reportActions&&this.reporter.newAction(e,i,s,n),r>=0&&(this.incCounterValue("actions"),this.setCounterValue("score",r))}reportEndActivity(t,e){this.reporter&&t.includeInReports&&this.reporter.endActivity(this.counterVal.score,this.counterVal.actions,e)}showHelp(t){return!!this.skin&&this.skin.showHelp(t)}displayURL(t,e){t&&(e?window.open(t,this.options.infoUrlFrame):this.end().then((()=>{window.location.href=t})))}exit(t){this.displayURL(t||this.options.exitUrl,!1)}setWindowTitle(t){b("info","running ".concat(t))}}Object.assign(di.prototype,{options:{maxWaitTime:12e4,infoUrlFrame:"_blank",exitUrl:null,returnAsExit:!1,audioEnabled:!0,navButtonsAlways:!1,fade:300,minSwipeX:40,maxSwipeY:100,rightToLeft:!1},id:"JC0000",$div:null,$topDiv:null,$mainContainer:null,fullScreenChecked:!1,project:null,basePath:"",zip:null,localFS:!1,actPanel:null,history:null,skin:null,defaultSkin:null,lastProjectSkin:null,activeMediaBag:null,reporter:null,actions:{},timer:null,delayedTimer:null,delayedAction:null,counterVal:{score:0,actions:0,time:0},bgImageOrigin:null,audioEnabled:!0,navButtonsDisabled:!1,navButtonsAlways:!1});const pi=di;class fi extends Et{constructor(t,e,i){super(),this.container=e,this.parent=t,this.boxBase=i,this.shape=this,this.specialShape=!1,this.visible=!0}setParent(t){this.parent=t}getParent(){return this.parent}end(){}setContainer(t){this.container=t,this.$hostedComponent&&this.container&&this.container.$div&&(this.$hostedComponent.detach(),this.container.$div.append(this.$hostedComponent))}getContainerX(){return this.container}getContainerResolve(){let t=this;for(;null===t.container&&null!==t.parent;)t=t.parent;return t.container}invalidate(t){const e=this.getContainerResolve();e&&e.invalidate(t)}setBoxBase(t){this.boxBase=t,this.invalidate()}getBoxBaseResolve(){let t=this;for(;!t.boxBase&&t.parent;)t=t.parent;return t.boxBase||Ae.DEFAULT_BOX_BASE}setShape(t){this.shape=t,this.specialShape=!0,this.invalidate(),super.setBounds(t.getBounds()),this.invalidate()}getShape(){return this.shape}contains(t){return this.shape===this?super.contains(t):this.shape.contains(t)}setBounds(t,e,i,s){if("number"==typeof t&&(t=new Et(t,e,i,s)),this.equals(t))return;const n=!this.dim.equals(t.dim);return this.specialShape?(n&&(this.shape.scaleBy(new St(t.dim.width/this.dim.width,t.dim.height/this.dim.height)),this.setShape(this.shape)),this.pos.equals(t.pos)||this.shape.moveTo(t.pos),this.setShape(this.shape)):super.setBounds(t),this.$hostedComponent&&this.setHostedComponentBounds(n),this}moveTo(t,e){"number"==typeof t&&(t=new kt(t,e)),this.setBounds(new Et(this).moveTo(t))}moveBy(t,e){this.setBounds(new Et(this).moveBy(t,e))}setSize(t,e){this.setBounds(new Et(this.pos,new St(t,e)))}hasBorder(){return this.border}setBorder(t){t||this.invalidate(),this.border=t,t&&this.invalidate()}isVisible(){return this.visible}setVisible(t){this.visible=t,this.setHostedComponentVisible(),this.invalidate()}setHostedComponentVisible(){this.$hostedComponent&&this.$hostedComponent.css("visibility",this.visible?"visible":"hidden")}isTemporaryHidden(){return this.temporaryHidden}setTemporaryHidden(t){this.temporaryHidden=t}isInactive(){return this.inactive}setInactive(t){if(this.inactive=t,this.$hostedComponent)this.setHostedComponentColors(),this.setHostedComponentVisible();else{if(this.$accessibleElement){const t=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement.prop({disabled:t,tabindex:t?-1:0})}this.invalidate()}}isInverted(){return this.inverted}setInverted(t){this.inverted=t,this.$hostedComponent?this.setHostedComponentColors():this.invalidate()}isMarked(){return this.marked}setMarked(t){t||this.invalidate(),this.marked=t,this.$hostedComponent?(this.setHostedComponentColors(),this.setHostedComponentBorder()):t&&this.invalidate()}isFocused(){return this.focused}setFocused(t){t||this.invalidate(),this.focused=t,t&&this.invalidate(),this.$hostedComponent&&this.$hostedComponent.css("z-index",this.focused?20:2)}isAlternative(){return this.alternative}setAlternative(t){this.alternative=t,this.invalidate()}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())return!1;if(e&&!this.shape.intersects(e))return!1;const i=this.getBoxBaseResolve();return i.transparent||i.dontFill||this.tmpTrans||(i.bgGradient&&!i.bgGradient.hasTransparency()||(t.fillStyle=this.inactive?i.inactiveColor:this.inverted?i.textColor:i.backColor,this.shape.fill(t,e)),i.bgGradient&&(t.fillStyle=i.bgGradient.getGradient(t,this.shape.getBounds()),this.shape.fill(t,e)),t.fillStyle="black"),this.$hostedComponent||this.updateContent(t,e),this.drawBorder(t),!0}updateContent(t,e){}drawBorder(t){if(this.border||this.marked){const e=this.getBoxBaseResolve();t.strokeStyle=e.borderColor,e[this.marked?"markerStroke":"borderStroke"].setStroke(t),this.marked&&(t.globalCompositeOperation="xor"),this.shape.stroke(t),this.marked&&(t.globalCompositeOperation="source-over"),t.strokeStyle="black",xt.prototype.setStroke(t)}}getBorderBounds(){const t=new Et(this.getBounds());if(this.border||this.marked){const e=this.getBoxBaseResolve()[this.marked?"markerStroke":"borderStroke"].lineWidth;t.moveBy(-e/2,-e/2),t.dim.width+=e,t.dim.height+=e}return t}setHostedComponent(t){this.$hostedComponent&&this.$hostedComponent.detach(),this.$hostedComponent=t,this.$hostedComponent&&(this.setContainer(this.container),this.setHostedComponentColors(),this.setHostedComponentBorder(),this.setHostedComponentBounds(!0),this.setHostedComponentVisible(),this.setFocused(this.focused))}getHostedComponent(){return this.$hostedComponent}setHostedComponentColors(){if(this.$hostedComponent){const t=this.getBoxBaseResolve().getCSS(null,this.inactive,this.inverted,this.alternative);this.$hostedComponent.data("background-image")&&t["background-image"]&&(t["background-image"]="".concat(this.$hostedComponent.data("background-image"),",").concat(t["background-image"])),this.$hostedComponent.css(t)}}setHostedComponentBorder(){if(this.$hostedComponent&&(this.border||this.marked)){const t=this.getBoxBaseResolve();this.$hostedComponent.css({"border-width":"".concat(t.get(this.marked?"markerStroke":"borderStroke").lineWidth,"px"),"border-style":"solid","border-color":t.get("borderColor")})}}setHostedComponentBounds(t){if(this.$hostedComponent){const t=this.getBounds(),e=this.border||this.marked?this.getBoxBaseResolve().get(this.marked?"markerStroke":"borderStroke").lineWidth:0;this.$hostedComponent.css({position:"absolute",width:t.dim.width-2*e+"px",height:t.dim.height-2*e+"px",top:t.pos.y+"px",left:t.pos.x+"px"})}}}Object.assign(fi.prototype,{parent:null,container:null,boxBase:null,border:!1,shape:null,specialShape:!1,visible:!0,temporaryHidden:!1,tmpTrans:!1,inactive:!1,inverted:!1,alternative:!1,marked:!1,focused:!1,accessibleText:"",role:"cell",$accessibleElement:null,accessibleAlwaysActive:!1,$hostedComponent:null});const gi=fi;class mi extends gi{constructor(t,e,i,s,n){super(t,e,i),this.clear(),"number"==typeof s&&(this.idLoc=s,this.idAss=0,this.idOrder=0),n&&this.setBounds(n)}static createCell(t,i){if(i&&i.dimension){const s=new mi,n=e()('<canvas width="'+i.dimension.width+'" height="'+i.dimension.height+'"/>'),r=new Et(0,0,i.dimension.width,i.dimension.height);return s.container=new Rt,s.container.$div=t,s.setContent(i),s.setBounds(r),t.append(n),i.mediaContent&&s.buildAccessibleElement(n,t),s.update(n.get(-1).getContext("2d"),r),s}}getCurrentContent(){return this.isAlternative()?this.altContent:this.content}getContent(){return this.content||this.setContent(new ke),this.content}clear(){this.content=null,this.altContent=null,this.idOrder=-1,this.setInactive(!0),this.hasHostedComponent||this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(""),this.tmpTrans&&(this.tmpTrans=!1),this.invalidate()}isEquivalent(t,e){return null!==t&&null!==this.content&&this.content.isEquivalent(t.content,e)}isCurrentContentEquivalent(t,e){return null!==t&&null!==this.getCurrentContent()&&this.getCurrentContent().isEquivalent(t.getCurrentContent(),e)}exchangeLocation(t){const e=new kt(this.pos),i=this.idLoc;this.moveTo(t.pos),t.moveTo(e),this.idLoc=t.idLoc,t.idLoc=i}copyContent(t){this.idOrder=t.idOrder,this.idAss=t.idAss,this.content=t.content,this.altContent=t.altContent,this.content&&(this.content.style&&this.setBoxBase(this.content.style),null!==this.content.border&&t.hasBorder()!==this.content.border&&this.setBorder(this.content.border)),this.setInactive(t.isInactive()),this.setInverted(t.isInverted()),this.setAlternative(t.isAlternative()),this.setHostedComponent(t.getHostedComponent()),this.hasHostedComponent=t.hasHostedComponent,this.setHostedMediaPlayer(t.hostedMediaPlayer),this.hostedMediaPlayer&&this.hostedMediaPlayer.setVisualComponentVisible(!this.isInactive()&&this.isVisible()),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}exchangeContent(t){const e=new mi(this.getParent(),this.getContainerX(),this.boxBase);e.copyContent(this),this.copyContent(t),t.copyContent(e)}setTextContent(t){t||(t=""),this.content||(this.content=new ke),this.content.text=t,this.content.mediaContent=null,this.content.img=null,this.setHostedComponent(null),this.setInactive(!1),this.checkHostedComponent(),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}setDefaultIdAss(){this.idAss=null===this.content?-1:this.content.id}isAtPlace(){return this.idOrder===this.idLoc}setContent(t,i){if(t instanceof Pe){if(i<0&&(i=this.idOrder),i>=t.getNumCells())return;t.style!==this.boxBase&&this.setBoxBase(t.style),t=t.getActiveBoxContent(i)}if(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.content=t,t){if(t.animatedGifFile&&!this.specialShape){const i="url(".concat(t.animatedGifFile,")"),s=e()("<span/>").css({"background-image":i,"background-position":"center","background-repeat":"no-repeat"});s.data("background-image",i),null!==t.imgClip&&s.css({"background-origin":"border-box","background-position":"".concat(-t.imgClip.pos.x,"px ").concat(-t.imgClip.pos.y,"px")}),this.setHostedComponent(s)}t.style!==this.boxBase&&this.setBoxBase(t.style),t.innerHtmlText&&this.setHostedComponent(e()("<div/>").html(t.innerHtmlText)),t.hasOwnProperty("border")&&this.hasBorder()!==t.border&&this.setBorder(t.border),this.setInactive(!1),t.amp&&this.setHostedMediaPlayer(t.amp),this.checkHostedComponent(),this.checkAutoStartMedia()}else this.clear();this.invalidate(),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}setAltContent(t,e){t instanceof Pe&&(e<0&&(e=this.idOrder),t=t.getActiveBoxContent(e)),this.altContent=t,this.checkHostedComponent(),this.isAlternative()&&this.hostedMediaPlayer&&this.setHostedMediaPlayer(null),this.$accessibleElement&&(this.$accessibleElement.html(this.toString()),this.$accessibleElement.prop("disabled",!0))}setCurrentContent(t){this.isAlternative()?this.setAltContent(t):this.setContent(t),this.invalidate()}switchToAlt(){return!(this.isAlternative()||!this.altContent||this.altContent.isEmpty())&&(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.setAlternative(!0),this.tmpTrans=!1,this.checkHostedComponent(),this.checkAutoStartMedia(),this.$accessibleElement&&this.$accessibleElement.html(this.toString()),!0)}checkHostedComponent(){if(this.hasHostedComponent)return;const t=this.getCurrentContent(),e=this.getBoxBaseResolve();!this.isInactive()&&t&&t.innerHtmlText&&(e.getCSS()["text-align"]=t.txtAlign.h.replace("middle","center"))}checkAutoStartMedia(){const t=this.getContent();t&&t.mediaContent&&t.mediaContent.autoStart&&t.amp&&t.amp.playNow(this)}updateContent(t,e){const i=this.getCurrentContent(),s=this.getBoxBaseResolve();if(this.isInactive()||!i||this.dim.width<2||this.dim.height<2)return this._focusAccessibleElement(t),!0;if(e&&!this.intersects(e))return!1;let n=null;if(i.img&&!this.tmpTrans)try{if(i.imgClip){const e=i.imgClip.getBounds();let s=i.img;if(!i.imgClip.isRect()){const t=document.createElement("canvas");t.width=e.pos.x+e.dim.width,t.height=e.pos.y+e.dim.height;const n=t.getContext("2d");i.imgClip.clip(n),n.drawImage(i.img,0,0),s=t}t.drawImage(s,Math.max(0,e.pos.x),Math.max(0,e.pos.y),Math.min(s.width,e.dim.width),Math.min(s.height,e.dim.height),this.pos.x,this.pos.y,this.dim.width,this.dim.height)}else{let e=i.img.naturalWidth||this.dim.width,s=i.img.naturalHeight||this.dim.height,r=!1,a=1;vt.COMPRESS_IMAGES&&this.dim.width>0&&this.dim.height>0&&(e>this.dim.width||s>this.dim.height)&&(a=Math.min(this.dim.width/e,this.dim.height/s),e*=a,s*=a,r=!0);const o="left"===i.imgAlign.h?0:"right"===i.imgAlign.h?this.dim.width-e:(this.dim.width-e)/2,c="top"===i.imgAlign.v?0:"bottom"===i.imgAlign.v?this.dim.height-s:(this.dim.height-s)/2;r?t.drawImage(i.img,this.pos.x+o,this.pos.y+c,e,s):t.drawImage(i.img,this.pos.x+o,this.pos.y+c),i.avoidOverlapping&&i.text&&(n=new Et(Math.max(0,o),Math.max(0,c),Math.min(this.dim.width,e),Math.min(this.dim.height,s)))}}catch(t){b("warn",'Unable to draw image "'.concat(i.image,'": ').concat(t.message))}if(i.text&&i.text.length>0){let e=this.pos.x,r=this.pos.y,a=this.dim.width,o=this.dim.height;if(n){const t=[0,n.pos.x,n.pos.x+n.dim.width,a],s=[0,n.pos.y,n.pos.y+n.dim.height,o],c=[new Et(t[0],s[0],t[3],s[1]),new Et(t[0],s[2],t[3],s[3]-s[2]),new Et(t[0],s[0],t[1],s[3]),new Et(t[2],s[0],t[3]-t[2],s[3])];let l=c[0],h=l.dim.width*l.dim.height;for(let t=1;t<c.length;t++){let e=c[t].dim.width*c[t].dim.height;if(e>h-1){if(Math.abs(e-h)<=1){let e=!1;switch(t){case 1:e="bottom"===i.txtAlign.v;break;case 2:e="left"===i.txtAlign.h;break;case 3:e="right"===i.txtAlign.h}if(!e)continue}h=e,l=c[t]}}e+=l.pos.x,r+=l.pos.y,a=l.dim.width,o=l.dim.height}const c=Math.max(5,a-2*s.textMargin),l=Math.max(5,o-2*s.textMargin),h=s.prepareText(t,i.text,c,l);t.font=s.font.cssFont(),t.textBaseline="alphabetic";const u=s.font.getHeight(),d=u*h.length;let p=r+s.textMargin+("top"===i.txtAlign.v?0:"bottom"===i.txtAlign.v?l-d:(l-d)/2)+s.font.getMetrics().ascent;for(let n=0;n<h.length;n++,p+=u){const r=e+s.textMargin+("left"===i.txtAlign.h?0:"right"===i.txtAlign.h?c-h[n].size.width:(c-h[n].size.width)/2);if(s.shadow){const e=Math.max(1,s.font.size/10);t.fillStyle=s.shadowColor,t.fillText(h[n].text,r+e,p+e)}t.fillStyle=this.isInverted()?s.backColor:this.isAlternative()?s.alternativeColor:s.textColor,t.fillText(h[n].text,r,p)}this._focusAccessibleElement(t)}return!0}_focusAccessibleElement(t){vt.CANVAS_DRAW_FOCUS&&this.$accessibleElement&&(this.shape.preparePath(t),t.drawFocusIfNeeded(this.$accessibleElement.get(-1)))}getDescription(){return this.content?this.content.getDescription():""}toString(){return("cell"!==this.role?m(this.role):"")+(this.getCurrentContent()||"-").toString()}playMedia(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.getCurrentContent();return!(!i||!i.mediaContent)&&(b("debug","Playing: ".concat(i.mediaContent.toString())),t.playMedia(i.mediaContent,this,e),!0)}setHostedMediaPlayer(t){const e=this.hostedMediaPlayer;this.hostedMediaPlayer=t,e&&e!==t&&e.linkTo(null),t&&t.linkTo(this)}setBounds(t,e,i,s){"number"==typeof t&&(t=new Et(t,e,i,s)),this.equals(t)||(super.setBounds(t),this.hostedMediaPlayer&&this.hostedMediaPlayer.checkVisualComponentBounds(this))}setHostedComponentBounds(t){if(this.$hostedComponent){super.setHostedComponentBounds(t);const e=this.getCurrentContent();if(t&&e&&e.animatedGifFile&&e.img){const t=e.img,i=Math.max(t.naturalWidth,this.dim.width),s=Math.max(t.naturalHeight,this.dim.height);let n=1,r="";if(e.imgClip){const t=e.imgClip.getBounds();(this.dim.width<t.dim.width||this.dim.height<t.dim.height)&&(n=Math.min(this.dim.width/t.dim.width,this.dim.height/t.dim.height),r="".concat(i*n,"px ").concat(s*n,"px")),this.$hostedComponent.css({"background-position":"".concat(-e.imgClip.pos.x*n,"px ").concat(-e.imgClip.pos.y*n,"px"),"background-size":r})}else(this.dim.width<i||this.dim.height<s)&&(n=Math.min(this.dim.width/i,this.dim.height/s),r="".concat(i*n,"px ").concat(s*n,"px")),this.$hostedComponent.css({"background-size":r})}}}buildAccessibleElement(t,i,s,n){this.$accessibleElement&&this.$accessibleElement.remove();const r=t.get(-1);if(r.width>0&&r.height>0){const a=Math.round(1e5*Math.random()),o=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement=e()("<button/>",{tabindex:o?-1:0,id:"AE".concat(a),disabled:o}).html(this.toString()).on("click",(s=>{if(s.originalEvent&&(0!==s.originalEvent.pageX||0!==s.originalEvent.pageY))return!0;b("debug","Click on accessible element: ".concat(this.toString()));const r=e().Event(n||"click"),a=this.getBounds(),o=t.offset();return r.pageX=o.left+a.pos.x+a.dim.width/2,r.pageY=o.top+a.pos.y+a.dim.height/2,i.trigger(r),!1}));(s||t).append(this.$accessibleElement),vt.CANVAS_DRAW_FOCUS&&this.$accessibleElement.on("focus blur",(t=>{b("debug","".concat(t.type," accessible element: ").concat(this.toString())),this.container&&this.container.update(),this.updateContent(r.getContext("2d"),null)}))}return this.$accessibleElement}}Object.assign(mi.prototype,{idOrder:-1,idLoc:-1,idAss:-1,pos0:null,content:null,altContent:null,hasHostedComponent:!1,hostedMediaPlayer:null,isBackground:!1});const vi=mi;class bi{constructor(t,e){t&&(this.id=t),e&&(this.$div=e)}getDisplayValue(){let t=this.countDown>0?this.countDown-this.value:this.value;return this.displayDiffFrom&&(t-=this.displayDiffFrom.value),Math.max(0,Math.min(this.MAX_DISPLAY_VALUE,t))}refreshDisplay(){this.$div&&this.$div.html(this.enabled?(this.getDisplayValue()+1e3).toString().substring(1):"000")}setEnabled(t){this.enabled!==t&&(this.enabled=t,this.$div&&(this.refreshDisplay(),this.$div.css("opacity",this.enabled?1:.3)))}setCountDown(t){this.countDown!==(this.countDown=t)&&this.refreshDisplay()}incValue(){this.value++,this.enabled&&this.refreshDisplay()}setValue(t){this.enabled&&this.value!==(this.value=t)&&this.refreshDisplay()}}Object.assign(bi.prototype,{id:"",$div:null,value:0,countDown:0,enabled:!0,MAX_DISPLAY_VALUE:999,displayDiffFrom:null});const yi=bi;class wi extends Ht{constructor(t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i);let s="";if(At.loadGoogleFonts(this.cssFonts),this.$ctrlCnt=e()("<div/>",{class:"JClicCtrlCnt unselectableText",role:"navigation"}),this.$div.append(this.$ctrlCnt),s=m("Previous activity"),this.buttons.prev=e()("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e()(at(this.prevIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.prev.processEvent(t)})),this.$ctrlCnt.append(this.buttons.prev),this.msgBox=new vi,this.msgBox.role="message",this.$msgBoxDiv=e()("<div/>",{class:"JClicMsgBox"}).on("click",(()=>(this.msgBox.playMedia(t),!1))),this.$ctrlCnt.append(this.$msgBoxDiv),s=m("Next activity"),this.buttons.next=e()("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e()(at(this.nextIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.next.processEvent(t)})),this.$ctrlCnt.append(this.buttons.next),!1!==this.ps.options.counters&&!1!==i.counters){s=m("Reports");const t=e()("<button/>",{class:"JClicCountCnt","aria-label":s}).on("click",(t=>{this.ps&&this.ps.actions.reports.processEvent(t)}));e().each(Ht.prototype.counters,((i,n)=>{s=m(i),this.counters[i]=new yi(i,e()("<div/>",{class:"JClicCounter",title:s,"aria-label":s}).css({"background-image":"url(".concat(ot(this[i+"Icon"],this.counterIconWidth,this.counterIconHeight,this.counterIconFill),")"),color:this.counterIconFill}).html("000").appendTo(t))})),this.$ctrlCnt.append(t)}if(!0!==this.ps.options.info&&!0!==i.info||(s=m("Information"),this.buttons.info=e()("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e()(at(this.infoIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.info.processEvent(t)})),this.$ctrlCnt.append(this.buttons.info)),!0!==this.ps.options.reportsBtn&&!0!==i.reportsBtn||(s=m("Reports"),this.buttons.about=e()("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e()(at(this.reportsIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.reports.processEvent(t)})),this.$ctrlCnt.append(this.buttons.about)),document&&document.fullscreenEnabled&&(s=m("Toggle full screen"),this.buttons.fullscreen=e()("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e()("<img/>",{src:ot(this.fullScreenIcon,this.iconWidth,this.iconHeight,this.iconFill)})).on("click",(()=>{this.setScreenFull(null)})),this.$ctrlCnt.append(this.buttons.fullscreen)),"function"==typeof this.ps.options.closeFn){s=m("Close");const t=this.ps.options.closeFn;this.buttons.close=e()("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e()(at(this.closeIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(()=>{b("info","Closing the player"),t()})),this.$ctrlCnt.append(this.buttons.close)}let n=null;e().each(this.buttons,((t,e)=>{!e||"function"==typeof e[0].focus&&"function"==typeof e[0].blur||(null===n&&(n=()=>b("error",'"blur" and "focus" not defined for SVG objects in Explorer/Edge')),e[0].focus=e[0].blur=n)}))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return"".concat(super._getStyleSheets(t)).concat("default"===t?this.mainCSS:"half"===t?this.mainCSSHalf:"twoThirds"===t?this.mainCSSTwoThirds:"")}doLayout(){super.doLayout(),this.buttons.fullscreen&&(this.buttons.fullscreen.find("img").get(-1).src=ot(this[document&&document.fullscreenElement?"fullScreenExitIcon":"fullScreenIcon"],this.iconWidth,this.iconHeight,this.iconFill))}enableMainButtons(t){this.$ctrlCnt.find(".JClicBtn,.JClicCountCnt").attr("tabindex",t?"0":"-1")}}Object.assign(wi.prototype,{skinId:"JClicDefaultSkin",$ctrlCnt:null,margin:18,msgBoxHeight:60,countersWidth:60,countersHeight:20,mainCSS:".ID .JClicCtrlCnt {\n margin: 0 9px 18px 9px;\n display: -webkit-flex;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ID .JClicCountCnt {\n display: -webkit-flex;\n display: flex;\n flex-direction: column;\n}\n\n.ID .JClicMsgBox {\n height: 60px;\n flex-grow: 1;\n background-color: lightblue;\n}\n\n.ID .JClicBtn {\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .JClicBtn:disabled {\n cursor: inherit;\n opacity: 0.3;\n}\n\n.ID .JClicCounter {\n width: 40px;\n height: 20px;\n padding-left: 20px;\n color: white;\n cursor: pointer;\n font-family: Roboto, Sans-serif;\n font-size: 18px;\n text-align: center;\n background-repeat: no-repeat;\n background-position: left;\n box-sizing: content-box;\n}\n",mainCSSHalf:".ID .JClicPlayerCnt {\n margin: 9px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 4px 9px 4px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 18px;\n height: 18px;\n}\n\n.ID .JClicMsgBox {\n height: 30px;\n}\n\n.ID .JClicCounter {\n width: 20px;\n height: 10px;\n margin-left: -15px;\n transform: scale(0.5);\n}\n",mainCSSTwoThirds:".ID .JClicPlayerCnt {\n margin: 12px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 6px 12px 6px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 24px;\n height: 24px;\n}\n\n.ID .JClicMsgBox {\n height: 40px;\n}\n\n.ID .JClicCounter {\n width: 27px;\n height: 13px;\n margin-left: -10px;\n transform: scale(0.666);\n}\n",cssFonts:["Roboto"],iconWidth:36,iconHeight:36,iconFill:"#FFFFFF",prevIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" />\n</svg>\n',nextIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />\n</svg>\n',fullScreenIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" />\n</svg>\n',fullScreenExitIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" />\n</svg>\n',closeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',infoIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z" />\n</svg>\n',reportsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z" />\n</svg>\n',counterIconWidth:18,counterIconHeight:18,counterIconFill:"#FFFFFF",timeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />\n <path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />\n</svg>\n',scoreIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',actionsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.49 5.48c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-3.6 13.9l1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3c1.3 1.5 3.3 2.5 5.5 2.5v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1l-5.2 2.2v4.7h2v-3.4l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4z" />\n</svg>\n'});const Ai=Ht.registerClass("default",wi);class Ci extends Ai{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(Ci.prototype,{skinId:"JClicOrangeSkin",skinCSS:".ID {background-color:#FF8B19;}"});const xi=Ht.registerClass("orange",Ci);class ki extends Ai{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(ki.prototype,{skinId:"JClicGreenSkin",iconFill:"#20640E",counterIconFill:"#20640E",skinCSS:".ID {background-color:#4AFF19;}"});const Si=Ht.registerClass("green",ki);class Ti extends Ai{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(Ti.prototype,{skinId:"JClicBlueSkin",skinCSS:".ID {background-color:#1990FF;}"});const Ei=Ht.registerClass("blue",Ti);class Pi extends Ai{constructor(t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Object.assign({},i,{counters:!1,reportsBtn:!0})),this.$ctrlCnt.detach().prependTo(this.$div),this.$msgBoxDiv.detach().appendTo(this.$div),e()("<div/>").css({"flex-grow":1}).insertAfter(this.$ctrlCnt.children(":nth-child(2)"))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return"".concat(super._getStyleSheets(t)).concat("default"===t?this.skinCSS:"half"===t?this.skinCSSHalf:"twoThirds"===t?this.skinCSSTwoThirds:"")}}Object.assign(Pi.prototype,{skinId:"JClicSimpleSkin",skinCSS:".ID {\n background-color: #888888;\n}\n\n.ID .JClicCtrlCnt {\n margin: 9px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 18px 18px;\n}\n\n.ID .JClicMsgBox {\n flex-grow: 0;\n margin: 0 18px 18px 18px;\n}\n",skinCSSHalf:".ID .JClicCtrlCnt {\n margin: 4px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 9px 9px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 9px 9px 9px;\n}\n",skinCSSTwoThirds:".ID .JClicCtrlCnt {\n margin: 6px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 12px 12px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 12px 12px 12px;\n}\n"});const Ii=Ht.registerClass("simple",Pi);class Bi extends Ai{constructor(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Object.assign({},e,{counters:!1,reportsBtn:!0}))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(Bi.prototype,{skinId:"JClicMiniSkin",iconWidth:18,iconHeight:18,iconFill:"#080808",counterIconFill:"#080808",margin:8,skinCSS:".ID {\n background-color: #F4F4F4;\n}\n\n.ID .JClicPlayerCnt {\n margin: 4px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 2px 4px 2px;\n}\n\n.ID .JClicMsgBox {\n height: 25px;\n}\n",mainCSSHalf:"",mainCSSTwoThirds:""});const _i=Ht.registerClass("mini",Bi);class Oi extends Ht{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.msgBox=new vi,this.msgBox.role="message"}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.mainCSS:"")}}Object.assign(Oi.prototype,{skinId:"JClicEmptySkin",mainCSS:".ID .JClicPlayerCnt {margin:0;}"});const Ri=Ht.registerClass("empty",Oi);class Di extends Ht{constructor(t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i),this.$mainPanel=e()("<div/>",{class:"JClicCustomMainPanel"}),this.$gridPanel=e()("<div/>",{class:"JClicGridPanel"});for(let t=0;t<9;t++)this.$gridPanel.append(e()("<div/>",{class:"JClicCell JClicCell".concat(t+1)}));this.$mainPanel.append(this.$gridPanel),this.$playerCnt.detach().addClass("JClicPlayerCell").appendTo(this.$mainPanel),this.$div.prepend(this.$mainPanel),i.buttons&&Object.keys(i.buttons.button).forEach((i=>{const s="about"===i?"reports":i,n=m(this.msgKeys[s]||s);this.buttons[s]=e()("<button/>",{class:"JClicBtn JClicTransform Btn-".concat(s),title:n,"aria-label":n,disabled:void 0===this.msgKeys[s]}).on("click",(e=>{t.actions[s]&&t.actions[s].processEvent(e)})),this.$mainPanel.append(this.buttons[s])})),i.rectangle.messages&&(this.msgBox=new vi,this.msgBox.role="message",this.$msgBoxDiv=e()("<div/>",{class:"JClicMsgBox"}).on("click",(()=>(this.msgBox.playMedia(t),!1))),this.$mainPanel.append(this.$msgBoxDiv)),!1!==this.ps.options.counters&&i.counters&&i.counters.counter&&e().each(Ht.prototype.counters,((t,s)=>{if(i.counters.counter[t]){const i=m(t);this.counters[t]=new yi(t,e()("<div/>",{class:"JClicCounter JClicTransform Counter-".concat(t),title:i,"aria-label":i}).html("000").appendTo(this.$mainPanel))}})),i.progressAnimation&&(this.$progressAnimation=e()("<div/>",{class:"JClicProgressAnimation JClicTransform"}),this.$mainPanel.append(this.$progressAnimation))}enableMainButtons(t){this.$mainPanel.find(".JClicBtn").attr("tabindex",t?"0":"-1")}_computeStyleSheets(){const t=this.options.dimension.preferredSize.width,e=this.options.dimension.preferredSize.height;this.twoThirdsMedia={width:t,height:e},this.halfMedia={width:Math.round(2*t/3),height:Math.round(2*e/3)};const i=this.options.rectangle.frame.left,s=i+this.options.rectangle.player.left,n=i+this.options.slicer.left,r=i+this.options.slicer.right,a=s+this.options.rectangle.player.width,o=i+this.options.rectangle.frame.width,c=this.options.rectangle.frame.top,l=c+this.options.rectangle.player.top,h=c+this.options.slicer.top,u=c+this.options.slicer.bottom,d=l+this.options.rectangle.player.height,p=c+this.options.rectangle.frame.height,f=this.ps.project.mediaBag.getElement(this.options.image,!0),g=f.data&&f.data.src?f.data.src:"",v=f.data?lt(f.data,new Et(i,c,n-i,h-c)):"",b=f.data?lt(f.data,new Et(n-i,c,r-n,h-c)):"",y=f.data?lt(f.data,new Et(r,c,o-r,h-c)):"",w=f.data?lt(f.data,new Et(i,h-c,n-i,u-h)):"",A=f.data?lt(f.data,new Et(r-i,h-c,o-r,u-h)):"",C=f.data?lt(f.data,new Et(i,u-c,n-i,p-u)):"",x=f.data?lt(f.data,new Et(n-i,u-c,r-n,p-u)):"",k=f.data?lt(f.data,new Et(r,u-c,o-r,p-u)):"";let S="\n.ID .JClicCustomMainPanel {flex-grow:1;position:relative;background-color: ".concat(N(this.options.color.fill.value),";}\n.ID .JClicGridPanel {position:absolute;width:100%;height:100%;display:grid;grid-template-columns:").concat(n-i,"px 1fr ").concat(o-r,"px;grid-template-rows:").concat(h-c,"px 1fr ").concat(p-u,"px;}\n.ID .JClicCell {background-repeat:no-repeat;background-size:contain;}\n.ID .JClicPlayerCell {position:absolute;top:").concat(l-c,"px;right:").concat(o-a,"px;bottom:").concat(p-d,"px;left:").concat(s-i,"px;}\n.ID .JClicCell1 {background-image:url(").concat(v,");}\n.ID .JClicCell2 {background-image:url(").concat(b,");background-repeat:repeat-x;}\n.ID .JClicCell3 {background-image:url(").concat(y,");}\n.ID .JClicCell4 {background-image:url(").concat(w,");background-repeat:repeat-y;}\n.ID .JClicCell5 {}\n.ID .JClicCell6 {background-image:url(").concat(A,");background-repeat:repeat-y;}\n.ID .JClicCell7 {background-image:url(").concat(C,");}\n.ID .JClicCell8 {background-image:url(").concat(x,");background-repeat:repeat-x;}\n.ID .JClicCell9 {background-image:url(").concat(k,");}"),T="\n.ID .JClicGridPanel {grid-template-columns:".concat(Math.round((n-i)/2),"px 1fr ").concat(Math.round((o-r)/2),"px;grid-template-rows:").concat(Math.round((h-c)/2),"px 1fr ").concat(Math.round((p-u)/2),"px;}\n.ID .JClicPlayerCell {top:").concat(Math.round((l-c)/2),"px;right:").concat(Math.round((o-a)/2),"px;bottom:").concat(Math.round((p-d)/2),"px;left:").concat(Math.round((s-i)/2),"px;}\n.ID .JClicTransform {transform: scale(0.5);}"),E="\n.ID .JClicGridPanel {grid-template-columns:".concat(Math.round(2*(n-i)/3),"px 1fr ").concat(Math.round(2*(o-r)/3),"px;grid-template-rows:").concat(Math.round(2*(h-c)/3),"px 1fr ").concat(Math.round(2*(p-u)/3),"px;}\n.ID .JClicPlayerCell {top:").concat(Math.round(2*(l-c)/3),"px;right:").concat(Math.round(2*(o-a)/3),"px;bottom:").concat(Math.round(2*(p-d)/3),"px;left:").concat(Math.round(2*(s-i)/3),"px;}\n.ID .JClicTransform {transform: scale(0.666);}");if(this.options.buttons){const t=this.options.buttons;let e=30,i=30,s={};t.settings&&(t.settings.dimension&&(e=t.settings.dimension.width||e,i=t.settings.dimension.height||i),t.settings.offset&&Object.assign(s,t.settings.offset)),Object.keys(this.options.buttons.button).forEach((r=>{const a=t.button[r],c="about"===r?"reports":r;let l=e,u=i,d=s;a.settings&&(a.settings.dimension&&(l=a.settings.dimension.width||l,u=a.settings.dimension.height||u),a.settings.offset&&(d=Object.assign({},s,a.settings.offset)));const f=a.point.pos.left,m=f<n?"left:".concat(f):"right:".concat(o-f-l),v=f<n?"left:".concat(Math.round(f/2-l/4)):"right:".concat(Math.round((o-f-l)/2-l/4)),b=f<n?"left:".concat(Math.round(2*f/3-l/6)):"right:".concat(Math.round(2*(o-f-l)/3-l/6)),y=a.point.pos.top,w=y<h?"top:".concat(y):"bottom:".concat(p-y-u),A=y<h?"top:".concat(Math.round(y/2-u/4)):"bottom:".concat(Math.round((p-y-u)/2-u/4)),C=y<h?"top:".concat(Math.round(2*y/3-u/6)):"bottom:".concat(Math.round(2*(p-y-u)/3-u/6)),x=a.point.source.left,k=a.point.source.top;S+=".ID .Btn-".concat(c," {position:absolute;").concat(m,"px;").concat(w,"px;width:").concat(l,"px;height:").concat(u,"px;background:url(").concat(g,") !important;background-position:-").concat(x,"px -").concat(k,"px !important;}\n"),T+=".ID .Btn-".concat(c," {").concat(v,"px;").concat(A,"px;}\n"),E+=".ID .Btn-".concat(c," {").concat(b,"px;").concat(C,"px;}\n"),d.active&&(S+=".ID .Btn-".concat(c,":active {background-position:-").concat(x+d.active.right,"px -").concat(k+d.active.down,"px !important;}\n")),d.over&&(S+=".ID .Btn-".concat(c,":hover {background-position:-").concat(x+d.over.right,"px -").concat(k+d.over.down,"px !important;}\n")),d.disabled&&(S+=".ID .Btn-".concat(c,":disabled {background-position:-").concat(x+d.disabled.right,"px -").concat(k+d.disabled.down,"px !important;}\n"))}))}if(this.options.counters&&this.options.counters.settings){const t=this.options.counters;let e=35,i=20;t.settings.dimension&&t.settings.dimension.counter&&(e=t.settings.dimension.counter.width||e,i=t.settings.dimension.counter.height||i);let s=37,r=14;t.settings.dimension&&t.settings.dimension.label&&(s=t.settings.dimension.label.width||s,r=t.settings.dimension.label.height||r);let a="black";t.style&&t.style.color&&t.style.color.foreground&&(a=N(t.style.color.foreground.value||a));let c=r-4,l="Roboto";t.style&&t.style.font&&t.style.font.label&&(c=Math.max(8,t.style.font.label.size||c),l="".concat(t.style.font.label.family||"Roboto",",Roboto,sans-serif")),S+=".ID .JClicCounter {font-size:".concat(i-2,"px;color:").concat(a,"}\n"),Object.keys(this.options.counters.counter).forEach((a=>{const u=t.counter[a];let d=e,f=i;const g=u.point.counter.left,v=u.point.label.left||g-Math.round((s-e)/2),b=g<n?"left:".concat(g):"right:".concat(o-g-d),y=g<n?"left:".concat(Math.round(g/2-d/4)):"right:".concat(Math.round((o-g-d)/2-d/4)),w=g<n?"left:".concat(Math.round(2*g/3-d/6)):"right:".concat(Math.round(2*(o-g-d)/3-d/6)),A=u.point.counter.top,C=u.point.label.top||A-r,x=A<h?"top:".concat(A):"bottom:".concat(p-A-f),k=A<h?"top:".concat(Math.round(A/2-f/4)):"bottom:".concat(Math.round((p-A-f)/2-f/4)),P=A<h?"top:".concat(Math.round(2*A/3-f/6)):"bottom:".concat(Math.round(2*(p-A-f)/3-f/6));S+=".ID .Counter-".concat(a," {position:absolute;").concat(b,"px;").concat(x,"px;width:").concat(d,"px;height:").concat(f,"px;line-height:").concat(f,"px;}\n"),S+=".ID .Counter-".concat(a,':before {content:"').concat(m(a),'";font-size:').concat(c,"px;font-family:").concat(l,";width:").concat(s,"px;height:").concat(r,"px;line-height:").concat(r,"px;position:absolute;top:").concat(C-A,"px;left:").concat(v-g,"px;}"),T+=".ID .Counter-".concat(a," {").concat(y,"px;").concat(k,"px;}\n"),E+=".ID .Counter-".concat(a," {").concat(w,"px;").concat(P,"px;}\n")}))}if(this.options.progressAnimation){const t=this.options.progressAnimation;let e=30,i=30;t.dimension&&(e=t.dimension.width||e,i=t.dimension.height||i);const s=t.point.pos.left,r=s<n?"left:".concat(s):"right:".concat(o-s-e),a=s<n?"left:".concat(Math.round(s/2-e/4)):"right:".concat(Math.round((o-s-e)/2-e/4)),c=s<n?"left:".concat(Math.round(2*s/3-e/6)):"right:".concat(Math.round(2*(o-s-e)/3-e/6)),l=t.point.pos.top,u=l<h?"top:".concat(l):"bottom:".concat(p-l-i),d=l<h?"top:".concat(Math.round(l/2-i/4)):"bottom:".concat(Math.round((p-l-i)/2-i/4)),f=l<h?"top:".concat(Math.round(2*l/3-i/6)):"bottom:".concat(Math.round(2*(p-l-i)/3-i/6)),m=t.point.source.left,v=t.point.source.top;if(S+=".ID .JClicProgressAnimation {position:absolute;".concat(r,"px;").concat(u,"px;width:").concat(e,"px;height:").concat(i,"px;background:url(").concat(g,");background-position:-").concat(m,"px -").concat(v,"px;}\n"),T+=".ID .JClicProgressAnimation {".concat(a,"px;").concat(d,"px;}\n"),E+=".ID .JClicProgressAnimation {".concat(c,"px;").concat(f,"px;}\n"),t.frames&&t.direction){const s=(t.step||e)*("right"===t.direction?1:"left"===t.direction?-1:0),n=(t.step||i)*("down"===t.direction?1:"up"===t.direction?-1:0);S+="\n@keyframes anim {100% {background-position:".concat(-1*(m+s*t.frames),"px ").concat(-1*(v+n*t.frames),"px;}}\n.ID .JClicProgressAnimation {animation: anim ").concat(t.frames*t.delay,"ms steps(").concat(t.frames,") infinite;}")}}if(this.options.rectangle.messages){const t=this.options.rectangle.messages,e=i+t.left,s=o-t.width-t.left-i,n=t.top<h?"top:".concat(t.top):"bottom:".concat(p-t.height-t.top),r=t.top<h?"top:".concat(Math.round(t.top/2)):"bottom:".concat(Math.round((p-t.height-t.top)/2)),a=t.top<h?"top:".concat(Math.round(2*t.top/3)):"bottom:".concat(Math.round(2*(p-t.height-t.top)/3));S+=".ID .JClicMsgBox {position:absolute;left:".concat(e,"px;right:").concat(s,"px;height:").concat(t.height,"px;").concat(n,"px;}"),T+=".ID .JClicMsgBox {left:".concat(Math.round(e/2),"px;right:").concat(Math.round(s/2),"px;height:").concat(Math.round(t.height/2),"px;").concat(r,"px;}"),E+=".ID .JClicMsgBox {left:".concat(Math.round(2*e/3),"px;right:").concat(Math.round(2*s/3),"px;height:").concat(Math.round(2*t.height/3),"px;").concat(a,"px;}")}this.cssVariants={default:this.mainCSS+S,half:T,twoThirds:E}}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return this.cssVariants||this._computeStyleSheets(),"".concat(super._getStyleSheets(t)).concat(this.cssVariants[t]||"")}setWaitCursor(t){super.setWaitCursor(t),this.$progressAnimation&&this.$progressAnimation.css("animation-play-state",this.waitCursorCount>0?"running":"paused")}}Object.assign(Di.prototype,{skinId:"JClicCustomSkin",image:null,mainCSS:".ID .JClicPlayerCnt {margin:0;}.ID .JClicBtn:focus {outline:0;}.ID .JClicCounter {font-family:Roboto,sans-serif;text-align:center;}",cssVariants:null,msgKeys:{next:"Next activity",prev:"Previous activity",info:"Information",help:"Help",reports:"Reports",audio:"Audio on/off",reset:"Reset activity"},$progressAnimation:null});const Mi=Ht.registerClass("custom",Di);class Ni extends Te{constructor(t,e){super(t,e)}buildShapes(){const t=1/this.nCols,e=1/this.nRows;for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.shapeData[i*this.nCols+s]=new Et(new kt(s*t,i*e),new St(t,e));this.initiated=!0}}Object.assign(Ni.prototype,{rectangularShapes:!0});const Vi=Te.registerClass("@Rectangular",Ni);const ji=Te.registerClass("@Holes",class extends Te{constructor(t,e){super(1,1),this.customShapes=!0,this.nCols=t,this.nRows=e,this.showEnclosure=!0}buildShapes(){this.nCells>0&&(this.initiated=!0)}getEnclosingShapeData(){return this.showEnclosure?this.enclosing||super.getEnclosingShapeData():null}});const qi=Te.registerClass("@JigSaw",class extends Te{constructor(t,e){super(t,e)}buildShapes(){let t=[],e=[];for(let i=0;i<=this.nRows;i++)t[i]=[],e[i]=[];for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)t[i][s]=0===i?0:1+(this.randomLines?Math.round(9*Math.random()):i+s)%2,e[i][s]=0===s?0:1+(this.randomLines?Math.round(9*Math.random()):s+i+1)%2,s===this.nCols-1&&(e[i][s+1]=0),i===this.nRows-1&&(t[i+1][s]=0);const i=1/this.nCols,s=1/this.nRows;for(let n=0;n<this.nRows;n++)for(let r=0;r<this.nCols;r++){const a=i*r,o=s*n,c=new It([new Bt("M",[a,o])]);this.hLine(c,t[n][r],a+0,o+0,i,s,!1),this.vLine(c,e[n][r+1],a+i,o+0,i,s,!1),this.hLine(c,t[n+1][r],a+i,o+s,i,s,!0),this.vLine(c,e[n][r],a+0,o+s,i,s,!0),c.addStroke(new Bt("X")),c.calcEnclosingRect(),this.shapeData[n*this.nCols+r]=c}this.initiated=!0}hLine(t,e,i,s,n,r,a){const o=a?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new Bt("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*this.baseWidthFactor*o;t.addStroke(new Bt("L",[e,s]));const l=r*this.toothHeightFactor*c;t.addStroke(new Bt("L",[e,s+l])),t.addStroke(new Bt("L",[e+a,s+l])),t.addStroke(new Bt("L",[e+a,s])),t.addStroke(new Bt("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new Bt("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor*o;t.addStroke(new Bt("L",[i,e]));const l=n*this.toothHeightFactor*c;t.addStroke(new Bt("L",[i+l,e])),t.addStroke(new Bt("L",[i+l,e+a])),t.addStroke(new Bt("L",[i,e+a])),t.addStroke(new Bt("L",[i,s+r*o]))}}});const Li=Te.registerClass("@TriangularJigSaw",class extends qi{constructor(t,e){super(t,e)}hLine(t,e,i,s,n,r,a){const o=a?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new Bt("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*this.baseWidthFactor*o;t.addStroke(new Bt("L",[e,s]));const l=r*this.toothHeightFactor*c;t.addStroke(new Bt("L",[e+a/2,s+l])),t.addStroke(new Bt("L",[e+a,s])),t.addStroke(new Bt("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new Bt("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor*o;t.addStroke(new Bt("L",[i,e]));const l=n*this.toothHeightFactor*c;t.addStroke(new Bt("L",[i+l,e+a/2])),t.addStroke(new Bt("L",[i,e+a])),t.addStroke(new Bt("L",[i,s+r*o]))}}});class Fi extends qi{constructor(t,e){super(t,e)}hLine(t,e,i,s,n,r,a){const o=a?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new Bt("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*(this.baseWidthFactor/12)*o;t.addStroke(new Bt("L",[e,s]));const l=r*this.toothHeightFactor*c/8;t.addStroke(new Bt("B",[e+4*a,s,e+6*a,s-l,e+4*a,s-3*l])),t.addStroke(new Bt("B",[e+2*a,s-5*l,e+10*a,s-5*l,e+8*a,s-3*l])),t.addStroke(new Bt("B",[e+6*a,s-1*l,e+8*a,s,e+12*a,s])),t.addStroke(new Bt("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new Bt("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor/12*o;t.addStroke(new Bt("L",[i,e]));const l=n*this.toothHeightFactor*c/8;t.addStroke(new Bt("B",[i,e+4*a,i-l,e+6*a,i-3*l,e+4*a])),t.addStroke(new Bt("B",[i-5*l,e+2*a,i-5*l,e+10*a,i-3*l,e+8*a])),t.addStroke(new Bt("B",[i-1*l,e+6*a,i,e+8*a,i,e+12*a])),t.addStroke(new Bt("L",[i,s+r*o]))}}}Object.assign(Fi.prototype,{baseWidthFactor:3/4,toothHeightFactor:.6});const zi=Te.registerClass("@ClassicJigSaw",Fi),Ui=["+","-",String.fromCharCode(215),":"],Hi=-12345,$i=Intl&&Intl.NumberFormat().format(1.1).indexOf(",")>0;class Wi extends Be{constructor(){super(),this.className="@arith.Arith",this.numericContent=!0,this.opA=new Wi.Operator,this.opB=new Wi.Operator}static DecFormat(t,e,i){let s=t.toFixed(e);if(i){let t=s.indexOf(".");for(t<0&&(t=s.length);t<i;t++)s="0".concat(s)}return s}setProperties(t){return t.children().each(((t,i)=>{const s=e()(i);let n="";switch(i.nodeName){case"operand":switch(s.attr("id")){case"A":this.opA.setProperties(s);break;case"B":this.opB.setProperties(s)}break;case"operations":this.use_add=y(s.attr("plus")),this.use_subst=y(s.attr("minus")),this.use_mult=y(s.attr("multiply")),this.use_div=y(s.attr("divide"));break;case"unknown":this.exp_abx=y(s.attr("result")),this.exp_xbc=y(s.attr("first")),this.exp_axc=y(s.attr("last")),this.exp_axbc=y(s.attr("operand")),this.exp_caxb=y(s.attr("inverse"));break;case"result":n=s.attr("from"),this.resultLimInf=A("x"===n?0:n,this.resultLimInf),n=s.attr("to"),this.resultLimSup=A("x"===n?0:n,this.resultLimSup),this.resultCarry=y(s.attr("notCarry"),this.resultCarry),this.resultNoDup=!y(s.attr("duplicates"),!this.resultNoDup);let t=s.attr("order");this.resultOrder="ascending"===t?"SORTASC":"descending"===t?"SORTDESC":"NOSORT",t=s.attr("condition"),this.opCond="firstBig"===t?"AGB":"lastBig"===t?"BGA":"INDIF"}})),this}getAttributes(){return L(this,["className","opA","opB","use_add","use_subst","use_mult","use_div","exp_abx|true","exp_axc|false","exp_xbc|false","exp_axbc|false","exp_caxb|false","resultLimInf|0","resultLimSup|9999","resultCarry|false","resultNoDup|false","resultOrder|NOSORT","opCond|INDIF"])}setAttributes(t){return U(this,t,["className",{key:"opA",fn:Wi.Operator},{key:"opB",fn:Wi.Operator},"use_add","use_subst","use_mult","use_div","exp_abx","exp_axc","exp_xbc","exp_axbc","exp_caxb","resultLimInf","resultLimSup","resultCarry","resultNoDup","resultOrder","opCond"])}genNum(t,e,i,s){let n=!1;t.c=e.numDec;const r=0===t.c?1:1===t.c?10:100;let a=e.limSup;s!==Hi&&s<a&&(a=s);let o=e.limInf;if(i!==Hi&&i>o&&(o=i),e.fromList>0&&(t.vf=e.lst[Math.floor(Math.random()*e.fromList)],n=!0),!n){const i=Math.floor(100*Math.random());e.wZero&&i<=10?(t.vf=0,n=!0):e.wOne&&i>10&&i<=20?(t.vf=1,n=!0):e.wMinusOne&&i>20&&i<=30&&(t.vf=-1,n=!0)}if(!n){if(o>a){const t=o;o=a,a=t}let e=Math.floor(a-o+1);e<0&&(e=1);let i=(Math.floor(Math.random()*e)+o)*r;r>1&&(i+=Math.floor(Math.random()*r)),t.vf=i/r}return!0}genOp(t){let e,i,s,n,r,a,o,c;const l=[],h=this.resultLimInf,u=this.resultLimSup;let d=0;this.use_add&&(l[d++]="SUM"),this.use_subst&&(l[d++]="REST"),this.use_mult&&(l[d++]="MULT"),this.use_div&&(l[d++]="DIV");switch(l[Math.floor(Math.random()*d)]){case"SUM":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,u),i=t.numA.vf<h?h-Math.floor(t.numA.vf):this.RES,s=u-Math.floor(t.numA.vf),this.opCond){case"AGB":(s===this.RES||s>t.numA.vf)&&(s=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf+t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=0,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0){for(n=2===t.numR.c?100:1===t.numR.c?10:1,o=Wi.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),c=Wi.DecFormat(Math.floor(t.numB.vf*n+.5),0,10).split(""),e=0;e<10&&("0"===o[e]&&"0"===c[e]);e++);for(;e<10;e++)if(r=parseInt(o[e]),a=parseInt(c[e]),!(r+a<10)){for(;r+a>9;)r>a?r=r>0?Math.floor(Math.random()*r):0:a=a>0?Math.floor(Math.random()*a):0;o[e]=r.toFixed(0),c[e]=a.toFixed(0)}t.numA.vf=parseInt(o.join(""))/n,t.numB.vf=parseInt(c.join(""))/n,t.numR.vf=Math.floor(t.numA.vf*n+t.numB.vf*n+.5)/n}break;case"REST":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,h,this.RES),i=t.numA.vf>u?Math.floor(t.numA.vf-u):this.RES,s=Math.floor(t.numA.vf-h),this.opCond){case"AGB":(s===this.RES||s>t.numA.vf)&&(s=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf-t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=1,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0&&t.numA.vf>=t.numB.vf){for(n=2===t.numR.c?100:1===t.numR.c?10:1,o=Wi.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),c=Wi.DecFormat(Math.floor(t.numB.vf*n+.5),0,10).split(""),e=0;e<10&&"0"===c[e];e++);for(;e<10;e++)r=parseInt(o[e]),a=parseInt(c[e]),r>=a||(a=r>0?Math.floor(Math.random()*r):0,c[e]=a.toFixed(0));t.numA.vf=parseInt(o.join(""))/n,t.numB.vf=parseInt(c.join(""))/n,t.numR.vf=Math.floor(t.numA.vf*n-t.numB.vf*n+.5)/n}break;case"MULT":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,s=this.opB.limSup,this.opCond){case"AGB":s>t.numA.vf&&(s=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf*t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}t.numR.c=t.numA.c+t.numB.c,t.op=2;break;case"DIV":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,s=this.opB.limSup,this.opCond){case"AGB":s>t.numA.vf&&(s=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),0!==t.numB.vf&&Math.abs(t.numA.vf)>=Math.abs(t.numB.vf)&&(t.numR.vf=t.numA.vf/t.numB.vf)>=h&&t.numR.vf<=u)break}0===t.numB.vf&&(t.numB.vf=1),t.numR.vf=t.numA.vf/t.numB.vf,e=t.numA.c-t.numB.c,n=Math.pow(10,e),t.numA.vf*=n,t.numR.vf*=n,t.numR.vf=Math.floor(t.numR.vf),t.numA.vf=t.numR.vf*t.numB.vf,t.numA.vf/=n,t.numR.vf/=n,t.numR.c=e>0?e:0,t.op=3;break;default:return!1}return!0}process(t){let e,i,s,n,r,a,o=t.nRows,c=t.nCols,l=t.content,h=t.useIds,u=[],d=[],p=this.exp_caxb,f="",g="",m="",v="",b=[],y=[],w=[],A=c,C=o,x=o*c,k=null;if(o<=0||c<=0||null===l||l.length<1||null===l[0])return!1;if(x<2)return!1;if(r=0,this.exp_abx&&(d[r++]="ABX"),this.exp_axc&&(d[r++]="AXC"),this.exp_xbc&&(d[r++]="XBC"),this.exp_axbc&&(d[r++]="AXBC"),0===r)return!1;for(e=0;e<x;e++){for(n=new Wi.Operation,i=0;i<60&&(this.genOp(n),this.resultNoDup);i++){for(s=0;s<e&&n.numR.vf!==u[s].numR.vf;s++);if(s===e)break}u[e]=n}if(0!==this.resultOrder)for(e=x-1;e>0;e--)for(i=0;i<e;i++)("SORTASC"===this.resultOrder&&u[i].numR.vf>u[i+1].numR.vf||"SORTDESC"===this.resultOrder&&u[i].numR.vf<u[i+1].numR.vf)&&(n=u[i],u[i]=u[i+1],u[i+1]=n);for(e=0;e<x;e++)switch(a=d[Math.floor(Math.random()*r)],f=Wi.DecFormat(u[e].numA.vf,u[0].numA.c),g=Wi.DecFormat(u[e].numB.vf,u[0].numB.c),m=Wi.DecFormat(u[e].numR.vf,u[0].numR.c),v=Ui[u[e].op],w[e]=p?"".concat(m," = ").concat(f," ").concat(v," ").concat(g):"".concat(f," ").concat(v," ").concat(g," = ").concat(m),a){case"AXC":y[e]=g,b[e]=p?"".concat(m," = ").concat(f," ").concat(v," ?"):"".concat(f," ").concat(v," ? = ").concat(m);break;case"XBC":y[e]=f,b[e]=p?"".concat(m," = ? ").concat(v," ").concat(g):"? ".concat(v," ").concat(g," = ").concat(m);break;case"AXBC":y[e]=v,b[e]=p?"".concat(m," = ").concat(f," ? ").concat(g):"".concat(f," ? ").concat(g," = ").concat(m);break;default:y[e]=m,b[e]=p?"? = ".concat(f," ").concat(v," ").concat(g):"".concat(f," ").concat(v," ").concat(g," =")}if(h){k=[];let S=[];for(s=0,e=0;e<x;e++){for(i=0;i<s&&y[e]!==S[i];i++);i===s?(S[s]=y[e],k[e]=s,s++):k[e]=i}for(y=[],e=0;e<s;e++)y[e]=S[e];if(C*A!==s){let T=!1;switch(s){case 6:C=T?2:3,A=T?3:2;break;case 8:C=T?2:4,A=T?4:2;break;case 9:C=3,A=3;break;case 10:C=T?2:5,A=T?5:2;break;case 12:C=T?3:4,A=T?4:3;break;case 14:C=T?2:7,A=T?7:2;break;case 15:C=T?3:5,A=T?3:5;break;case 16:C=4,A=4;break;case 18:C=T?6:3,A=T?3:6;break;case 20:C=T?4:5,A=T?5:4;break;default:C=T?1:s,A=T?s:1}}}if($i){function E(t){return t.replace(/\./g,",")}b=b.map(E),y=y.map(E),w=w.map(E)}return l[0].setTextContent(b,c,o),null!==k&&l[0].setIds(k),l.length>1&&null!==l[1]&&(l[1].setTextContent(y,A,C),l[1].getShaper().reset(A,C)),l.length>2&&null!==l[2]&&l[2].setTextContent(w,c,o),!0}}Object.assign(Wi.prototype,{opA:null,opB:null,use_add:!0,use_subst:!1,use_mult:!1,use_div:!1,exp_abx:!0,exp_axc:!1,exp_xbc:!1,exp_axbc:!1,exp_caxb:!1,resultLimInf:0,resultLimSup:9999,resultCarry:!1,resultNoDup:!1,resultOrder:"NOSORT",opCond:"INDIF"}),Wi.Operator=class{constructor(){}setProperties(t){return dt(t.get(0).attributes,((i,s)=>{switch(i){case"decimals":this.numDec=Number(s);break;case"values":this.lst=s.split(" ").map((t=>Number(t))),this.fromList=this.lst.length;break;case"from":this.limInf=Number("x"===s?0:s);break;case"to":this.limSup=Number("x"===s?0:s)}t.children().each(((t,i)=>{const s=e()(i);if("include"===i.nodeName)this.wZero=y(s.attr("zero")),this.wOne=y(s.attr("one")),this.wMinusOne=y(s.attr("minusOne"))}))})),this}getAttributes(){return L(this,["limInf","limSup","numDec|0","wZero|false","wOne|false","wMinusOne|false","fromList|0","lst"])}setAttributes(t){return U(this,t,["limInf","limSup","numDec","wZero","wOne","wMinusOne","fromList","lst"])}},Object.assign(Wi.Operator.prototype,{limInf:0,limSup:10,numDec:0,wZero:!1,wOne:!1,wMinusOne:!1,fromList:0,lst:[]}),Wi.Num=class{constructor(){this.vf=0,this.c=0}format(){return Wi.DecFormat(this.vf,this.c)}},Wi.Operation=class{constructor(){this.numA=new Wi.Num,this.numB=new Wi.Num,this.numR=new Wi.Num,this.op=0}};const Ji=Be.registerClass("@arith.Arith",Wi);function Gi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function Ki(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gi(Object(i),!0).forEach((function(e){Zi(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Zi(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Yi extends He{constructor(t){super(t)}getMinNumActions(){return this.document?this.document.numTargets:0}}Object.assign(Yi.prototype,{ev:null,checkButtonText:null,prevScreen:!1,prevScreenText:null,prevScreenStyle:null,prevScreenMaxTime:-1});class Qi extends $e{constructor(t,e,i){super(t,e,i),this.targets=[]}setDocContent(t,i){t.empty().css(i.style.default.css).css({display:"flex","flex-direction":"column"});const s=e()("<div/>").css({"flex-grow":1,overflow:"auto"}),n=e()("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(i.style.default.css);let r=null;const a=[];return i.p.forEach((t=>{const s=e()("<p/>").css({margin:0});let o=!0;if(t.style?(r=i.style[t.style].css,s.css(r)):r=null,t.Alignment){const e=Number(t.Alignment);s.css({"text-align":1===e?"center":2===e?"right":"left"})}t.elements.forEach((t=>{let n;switch(t.objectType){case"text":const o=e()("<span/>").html(t.text).text();(this.spanText?J(o):[{text:o,sep:""}]).forEach((r=>{var a,o;let{text:c,sep:l}=r,h=Ki({},this.act.document.style.default.css);null!=t&&null!==(a=t.attr)&&void 0!==a&&a.style&&(h=Ki(Ki({},h),i.style[t.attr.style].css)),null!=t&&null!==(o=t.attr)&&void 0!==o&&o.css&&(h=Ki(Ki({},h),t.attr.css));(this.spanChars?[...c]:[c]).forEach((i=>{t.attr?(n=e()("<span/>").html(i).css(h),n.initialCSS=h,s.append(this.$createSpanElement(n))):this.spanText?(n=e()("<span/>").html(i),s.append(this.$createSpanElement(n))):s.append(i)})),""!==l&&s.append(l)}));break;case"cell":n=e()("<span/>");const c=vi.createCell(n.css({position:"relative"}),t);n.css({display:"inline-block","vertical-align":"middle"}),t.mediaContent&&n.on("click",(t=>(t.preventDefault(),this.ps.stopMedia(1),c.playMedia(this.ps),!1))),s.append(n);break;case"target":if(n=e()("<span/>"),this.showingPrevScreen){n.text(t.text),s.append(n);break}const l=t;let h=null;if("no_info"!==l.infoMode&&l.popupContent){h=e()("<span/>").css({position:"absolute","padding-top":"2pt",display:"none"});const t=vi.createCell(h,l.popupContent);l.popupContent.mediaContent&&h.on("click",(e=>(e.preventDefault(),this.ps.stopMedia(1),t?t.playMedia(this.ps):l.popupContent.mediaContent&&this.ps.playMedia(l.popupContent.mediaContent),!1))),l.$popup=h,a.push({p:s,span:h,box:t})}n=this.$createTargetElement(l,n),l.num=this.targets.length,l.pos=l.num,this.targets.push(l),n&&(n.css(i.style.default.css),r&&n.css(r),this.targetsMarked?l.attr?(l.attr.style||(l.attr.style="target"),n.css(i.style[l.attr.style].css),l.attr.css&&n.css(l.attr.css)):i.style.target&&n.css(i.style.target.css):l.targetStatus="HIDDEN",null!==h&&"onDemand"===l.infoMode&&n.keydown((t=>{t.key===l.popupKey?(t.preventDefault(),this.showPopup(h,l.popupMaxTime,l.popupDelay)):"Escape"===t.key&&(t.preventDefault(),this.showPopup(null))}))),h&&n?l.isList?s.append(n).append(h):s.append(h).append(n):n&&s.append(n),l.$p=s}o=!1})),o&&s.html(" "),n.append(s)})),t.append(s.append(n)),this.act.checkButtonText&&!this.showingPrevScreen&&(this.$checkButton=e()("<button/>",{class:"StockBtn"}).html(this.act.checkButtonText).css({width:"100%","flex-shrink":0}).on("click",(()=>this.evaluatePanel())),t.append(this.$checkButton)),a.forEach((t=>t.span.css({"margin-top":t.p.css("font-size")}))),this.act.ev&&this.act.ev.init(this.act.project.settings.locales),t}$createTargetElement(t,e){return e.text(t.text),t.$span=e,e}$createSpanElement(t){return t}initActivity(){this.act.prevScreen?this.preInitActivity():this.startActivity()}startActivity(){super.initActivity(),this.setAndPlayMsg("initial","start"),this.setDocContent(this.$div,this.act.document),this.playing=!0}preInitActivity(){if(!this.act.prevScreen)return;const t=()=>(this.showingPrevScreen=!1,this.$div.unbind("click"),this.prevScreenTimer&&(window.clearTimeout(this.prevScreenTimer),this.prevScreenTimer=null),this.startActivity(),!0);if(this.showingPrevScreen=!0,this.$div.empty(),this.act.prevScreenText){this.act.prevScreenStyle||(this.act.prevScreenStyle=new Ae),this.$div.css(this.act.prevScreenStyle.getCSS()).css("overflow","auto");const t=e()("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(this.act.prevScreenStyle.getCSS()).append(this.act.prevScreenText);this.$div.append(t)}else this.setDocContent(this.$div,this.act.document);this.enableCounters(!0,!1,!1),this.ps.setCounterValue("time",0),this.ps.setMsg(this.act.messages.previous),this.act.prevScreenMaxTime>0&&(this.ps.setCountDown("time",this.act.prevScreenMaxTime),this.prevScreenTimer=window.setTimeout(t,1e3*this.act.prevScreenMaxTime)),this.$div.on("click",t),this.ps.playMsg()}evaluatePanel(){return this.finishActivity(!0),!0}finishActivity(t){this.$checkButton&&this.$checkButton.prop("disabled",!0),this.targets.forEach((t=>{t.$comboList&&t.$comboList.attr("disabled",!0)})),this.showPopup(null),super.finishActivity(t)}processEvent(t){return this.playing}showPopup(t,e,i){this.$currentPopup&&(this.$currentPopup.css({display:"none"}),this.$currentPopup=null,this.currentPopupTimer&&(window.clearTimeout(this.currentPopupTimer),this.currentPopupTimer=0)),this.popupWaitTimer&&(window.clearTimeout(this.popupWaitTimer),this.popupWaitTimer=0),i?this.popupWaitTimer=window.setTimeout((()=>{this.showPopup(t,e)}),1e3*i):t&&(t.css({display:""}),t.trigger("click"),this.$currentPopup=t,e&&(this.currentPopupTimer=window.setTimeout((()=>{t.css({display:"none"}),this.$currentPopup===t&&(this.$currentPopup=null,this.currentPopupTimer=0)}),1e3*e)))}}Object.assign(Qi.prototype,{targets:null,targetsMarked:!0,$checkButton:null,prevScreenTimer:null,$currentPopup:null,currentPopupTimer:0,popupWaitTimer:0,spanText:!1,spanChars:!1}),Yi.Panel=Qi;const Xi=Yi;class ts extends Yi{constructor(t){super(t)}needsKeyboard(){return!0}}Object.assign(ts.prototype,{autoJump:!1,forceOkToAdvance:!1});class es extends Qi{constructor(t,e,i){super(t,e,i)}$createTargetElement(t,i){i.addClass("JClicTextTarget");const s="target".concat("000".concat(this.targets.length-1).slice(-3));return t.isList&&t.options&&t.options.length>0?(i=e()("<select/>",{id:s,name:s}),""!==t.options[0].trim()&&e()("<option selected/>",{value:"",text:""}).appendTo(i),t.options.forEach((t=>e()("<option/>",{value:t,text:t}).appendTo(i))),t.$comboList=i.bind("focus change",(e=>{e.textTarget=t,this.processEvent(e)}))):(t.currentText=t.iniText?t.iniText:I(t.iniChar,t.numIniChars),t.$span=i.text(t.currentText).attr({contenteditable:"true",id:s,autocomplete:"off",spellcheck:"false"}).bind("focus input blur",(e=>{e.textTarget=t,this.processEvent(e)})).bind("keydown keyup",(e=>{13===e.keyCode&&(e.preventDefault(),"keydown"===e.type&&(e.textTarget=t,e.type="blur",this.processEvent(e)))}))),i}evaluatePanel(){let t=0;const e=this.targets.length;return this.targets.forEach((e=>{const i=this.act.ev.evalText(e.readCurrentText(),e.answers),s=this.act.ev.isOk(i);e.targetStatus=s?"SOLVED":"WITH_ERROR",s&&t++,this.markTarget(e,i),this.ps.reportNewAction(this.act,"WRITE",e.currentText,e.getAnswers(),s,t)})),t===e?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}checkTarget(t,e,i){const s=this.act.ev.evalText(t.currentText,t.answers),n=this.act.ev.isOk(s);if(t.targetStatus=n?"SOLVED":"WITH_ERROR",e)return n;this.markTarget(t,s);const r=this.countSolvedTargets(!1,!1);if(t.currentText.length>0&&this.ps.reportNewAction(this.act,"WRITE",t.currentText,t.getAnswers(),n,r),n&&r===this.targets.length)return this.finishActivity(!0),n;if(t.currentText.length>0&&this.playEvent(n?"actionOk":"actionError"),i&&0!==i){let e=t.num+i;e>=this.targets.length?e=0:e<0&&(e=this.targets.length-1);const s=this.targets[e];s.$span?(s.$span.focus(),mt(s.$span.get(-1),0,0)):s.$comboList&&s.$comboList.focus()}return n}countSolvedTargets(t,e){return this.targets.reduce(((i,s)=>(t&&(s.readCurrentText(),this.checkTarget(s,!e)),"SOLVED"===s.targetStatus?++i:i)),0)}markTarget(t,i){if(t.$comboList||this.act.ev.isOk(i))t.checkColors();else if(t.$span){const s=t.currentText,n=[];let r=-1,a=-1,o=0;for(;o<i.length&&o<s.length;o++)i[o]!==r&&(n[++a]="",r=i[o]),n[a]+=s.charAt(o);o<s.length&&(n[a]+=s.substring(o)),t.$span.empty(),r=i[0],n.forEach((i=>{e()("<span/>").text(i).css(t.doc.style[0===r?"target":"targetError"].css).appendTo(t.$span),r^=1}))}t.flagModified=!1}activityReady(){super.activityReady(),e()(".JClicTextTarget").css("white-space","normal"),this.targets.length>0&&this.targets[0].$span&&this.targets[0].$span.focus()}finishActivity(t){return this.targets.forEach((t=>{t.$span?t.$span.removeAttr("contenteditable").blur():t.$comboList&&t.$comboList.attr("disabled","true").blur()})),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t))return!1;const e=t.textTarget;let i=null,s=0;switch(t.type){case"focus":e&&(e.$span&&e.$span.children().length>0?(i=e.$span,s=Math.min(e.currentText.length,ft(i.get(-1))),i.empty(),i.text(e.currentText),mt(i.get(-1),s,s),e.flagModified=!0):e.$comboList&&e.$comboList.css(e.doc.style.target.css),e.$popup&&("always"===e.infoMode||"onError"===e.infoMode&&"WITH_ERROR"===e.targetStatus)?this.showPopup(e.$popup,e.popupMaxTime,e.popupDelay):this.showPopup(null));break;case"blur":e.flagModified&&!this.$checkButton&&this.checkTarget(e,!1,1);break;case"input":if(e&&e.$span){i=e.$span;let t=i.html();if(/(<br>|\n|\r)/.test(t))return t=t.replace(/(<br>|\n|\r)/g,""),i.html(t),e.currentText=i.text(),!this.$checkButton&&this.checkTarget(e,!1,1);if(t=i.text(),t!==e.currentText){e.flagModified=!0;const n=t.length-e.currentText.length;if(n>0){if(t.indexOf(e.iniChar)>=0){s=ft(i.get(-1));for(let i=0;i<n;i++){const i=t.indexOf(e.iniChar);if(i<0)break;t=t.substring(0,i)+t.substring(i+1),i<s&&s--}i.text(t),mt(i.get(-1),s,s)}t.length>e.maxLenResp&&(s=ft(i.get(-1)),t=t.substring(0,e.maxLenResp),s=Math.min(s,t.length),i.text(t),mt(i.get(-1),s,s))}else""===t&&(t=e.iniChar,i.text(t),mt(i.get(-1),0,0));e.currentText=t}}break;case"change":if(e&&e.$comboList)return e.currentText=e.$comboList.val(),e.flagModified=!0,!this.$checkButton&&this.checkTarget(e,!1,1)}return!0}}Object.assign(es.prototype,{locked:!0}),ts.Panel=es;const is=We.registerClass("@text.FillInBlanks",ts),ss="source-over";class ns{constructor(t,e){this.parent=t,this.ctx=e.get(-1).getContext("2d",{willReadFrequently:!0}),this.dim=new St(this.ctx.canvas.width,this.ctx.canvas.height),this.origin=new kt,this.dest=new kt,this.relativePos=new kt}moveBy(t,e){this.moveTo(kt(this.dest.x+t,this.dest.y+e))}moveTo(t,e){if(!this.active||!e&&this.dest.equals(t))return;this.bgRect&&(this.bgImg?this.ctx.putImageData(this.bgImg,0,0,this.bgRect.pos.x,this.bgRect.pos.y,this.bgRect.dim.width,this.bgRect.dim.height):this.parent&&this.parent.updateContent()),this.dest.moveTo(t);const i=new kt(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y);this.bgRect=new Et(i,this.bx?this.bx.dim:new St);const s=new kt(t.x-this.relativePos.x,t.y-this.relativePos.y);this.bgRect.add(new Et(s,this.bx?this.bx.dim:new St)),this.bgRect.grow(10,10),null!==this.bx?(this.bx.moveTo(new kt(t.x-this.relativePos.x,t.y-this.relativePos.y)),this.bx.setTemporaryHidden(!1),this.bx.update(this.ctx,null),this.bx.setTemporaryHidden(!0)):(this.drawLine(),this.linePainted=!0)}begin(t,e){this.active&&this.end(),this.origin.moveTo(t),this.dest.moveTo(t),this.linePainted=!1,this.active=!0,e&&(this.bx=e,this.relativePos.moveTo(t.x-e.pos.x,t.y-e.pos.y),this.bx.setFocused(!0),this.bx.setTemporaryHidden(!0),this.linePainted=!1,this.parent.invalidate().update());try{this.bgImg=this.ctx.getImageData(0,0,this.dim.width,this.dim.height)}catch(t){this.bgImg=null}this.bgRect=null,e&&this.moveTo(t,!0)}end(){this.active&&(this.active=!1,this.linePainted=!1,this.bgRect=null,this.bgImg=null,this.bx&&(this.bx.setFocused(!1),this.bx.moveTo(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y),this.bx.setTemporaryHidden(!1),this.bx=null,this.relativePos.moveTo(0,0)),this.ctx.clearRect(0,0,this.dim.width,this.dim.height),this.parent.invalidate().update())}drawLine(){if(this.compositeOp!==ss?(this.ctx.strokeStyle=this.xorColor,this.ctx.globalCompositeOperation=this.compositeOp):this.ctx.strokeStyle=this.lineColor,this.ctx.lineWidth=this.lineWidth,this.ctx.beginPath(),this.ctx.moveTo(this.origin.x,this.origin.y),this.ctx.lineTo(this.dest.x,this.dest.y),this.ctx.stroke(),this.arrow){const t=Math.atan2(this.origin.x-this.dest.x,this.dest.x-this.origin.x),e=new kt(this.dest.x-this.arrowLength*Math.cos(t+this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t+this.arrowAngle));this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),e.moveTo(this.dest.x-this.arrowLength*Math.cos(t-this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t-this.arrowAngle)),this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}this.compositeOp!==ss&&(this.ctx.globalCompositeOperation=ss)}}Object.assign(ns.prototype,{bgImg:null,bgRect:null,origin:null,dest:null,arrow:!1,active:!1,linePainted:!1,arrowLength:10,arrowAngle:Math.PI/6,lineColor:"black",xorColor:"white",compositeOp:"difference",DEFAULT_COMPOSITE_OP:ss,relativePos:null,bx:null,ctx:null,dim:null,parent:null,lineWidth:1.5});const rs=ns;class as extends Yi{constructor(t){super(t)}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}Object.assign(as.prototype,{amongParagraphs:!1,bc:null});class os extends Qi{constructor(t,e,i){super(t,e,i)}buildVisualComponents(){this.act.document.style.target.css.cursor="pointer",super.buildVisualComponents()}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.act.dragCells||(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0,"pointer-events":"none"}),this.$div.append(this.$canvas),this.bc=new rs(this,this.$canvas),this.bc.compositeOp=this.bc.DEFAULT_COMPOSITE_OP,this.invalidate().update())}$createTargetElement(t,e){super.$createTargetElement(t,e);const i="target".concat("000".concat(this.targets.length-1).slice(-3));return e.addClass("JClicTextTarget").bind("click",(e=>{e.textTarget=t,e.idLabel=i,this.processEvent(e)})),e}swapTargets(t,i){const s=t.$span,n=i.$span,r=e()("<span/>");r.insertAfter(n),n.detach(),n.insertAfter(s),s.detach(),s.insertAfter(r),r.remove();const a=t.pos,o=t.$p;t.pos=i.pos,t.$p=i.$p,i.pos=a,i.$p=o}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents()}startActivity(){if(super.startActivity(),!this.showingPrevScreen){if("orderWords"!==this.act.type||this.act.amongParagraphs)this.shuffleTargets(this.targets,this.act.shuffles);else{const t=[];let e=null,i=[];this.targets.forEach((s=>{null!==e&&e.$p!==s.$p&&(t.push(i),i=[]),i.push(s),e=s})),i.length>0&&t.push(i),t.forEach((t=>this.shuffleTargets(t,this.act.shuffles)))}this.playing=!0}this.setBounds(this)}shuffleTargets(t,e){const i=t.length;if(i>1){let s=100;for(let n=0;n<e;n++){const e=Math.floor(Math.random()*i),r=Math.floor(Math.random()*i);e!==r?this.swapTargets(t[e],t[r]):--s&&n++}}}setCurrentTarget(t){const e=this.act.document.getFullStyle("target").css;this.currentTarget&&this.currentTarget.$span&&this.currentTarget.$span.css(e),t&&t.$span&&t.$span.css({color:e["background-color"],"background-color":e.color}),this.currentTarget=t}countSolvedTargets(){return this.targets.filter((t=>{let{num:e,pos:i}=t;return e===i})).length}evaluatePanel(){this.bc&&this.bc.active&&this.bc.end(),this.setCurrentTarget(null);let t=0;return this.targets.forEach((e=>{const i=e.num===e.pos;e.targetStatus=i?"SOLVED":"WITH_ERROR",i&&t++,e.checkColors(),this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,i,t)})),t===this.targets.length?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}finishActivity(t){return e()(".JClicTextTarget").css("cursor","pointer"),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t))return!1;const e=t.textTarget;let i=null;if(this.bc&&this.playing&&!this.showingPrevScreen){if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new kt;else{const e=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new kt(e-this.$div.offset().left,s-this.$div.offset().top)}switch(t.type){case"click":if(e&&e!==this.currentTarget)if(this.currentTarget){if(this.bc&&this.bc.active&&this.bc.end(),this.swapTargets(e,this.currentTarget),this.setCurrentTarget(null),!this.$checkButton){const t=this.countSolvedTargets(),i=e.pos===e.num;this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,i,t),i&&t===this.targets.length?this.finishActivity(!0):this.playEvent(i?"actionOk":"actionError")}}else this.setCurrentTarget(e),this.bc.begin(i),this.playEvent("click");break;case"mousemove":this.bc.moveTo(i)}return t.preventDefault(),!0}}}Object.assign(os.prototype,{currentTarget:null,bc:null,events:["click","mousemove"]}),as.Panel=os;const cs=We.registerClass("@text.Order",as);class ls extends Yi{constructor(t){super(t)}}ls.Panel=class extends Qi{constructor(t,e,i){super(t,e,i)}$createTargetElement(t,e){return null}startActivity(){super.startActivity(),this.$div.find(".JClicTextDocument").attr("contenteditable","true").attr("spellcheck","false")}evaluatePanel(){const t=this.$div.find(".JClicTextDocument").text().trim(),e=this.act.document.getRawText(),i=this.act.ev.checkText(t,e);return this.ps.reportNewAction(this.act,"WRITE",t,e,i,this.targets.length),i?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}finishActivity(t){return this.$div.find(".JClicTextDocument").attr("contenteditable","false"),super.finishActivity(t)}};const hs=We.registerClass("@text.Complete",ls);class us extends Yi{constructor(t){super(t)}}class ds extends Qi{constructor(t,e,i){super(t,e,i),this.spanText=!0,this.spanChars="identifyChars"===t.type,this.spansChecked=new Set}$createTargetElement(t,e){super.$createTargetElement(t,e);const i="target".concat("000".concat(this.targets.length-1).slice(-3));return e.bind("click",(e=>{e.textTarget=t,e.idLabel=i,this.processEvent(e)})),e}$createSpanElement(t){return t.bind("click",(e=>{e.$spanElement=t,this.processEvent(e)})),t}initActivity(){super.initActivity(this),this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),this.$div.find(".JClicTextDocument > span").css("cursor","pointer"),this.spansChecked.forEach((t=>t.css(t.initialCSS||this.act.document.style.default.css))),this.spansChecked.clear(),this.playing=!0}countSolvedTargets(){return this.targets.filter((t=>{let{targetStatus:e}=t;return"SOLVED"===e})).length}evaluatePanel(){let t=0;return this.targets.forEach((e=>{const i="SOLVED"===e.targetStatus;i&&t++,e.checkColors(),this.ps.reportNewAction(this.act,"SELECT",e.text,e.pos,i,t)})),t===this.targets.length&&0===this.spansChecked.size?(this.finishActivity(!0),!0):(this.spansChecked.forEach((t=>t.css(this.act.document.style.targetError.css))),this.playEvent("finishedError"),!1)}finishActivity(t){return this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t)||t.timeStamp===this.lastTimeStamp)return!1;t.timeStamp&&(this.lastTimeStamp=t.timeStamp);const e=t.textTarget,i=t.$spanElement;if("click"===t.type){let s,n,r=!1;if(e?("SOLVED"===e.targetStatus?e.targetStatus="HIDDEN":(e.targetStatus="SOLVED",r=!0),s=e.text,n=e.pos,e.checkColors()):(i?(i.checked=!i.checked,i.checked?(this.spansChecked.add(i),i.css(this.act.document.style.target.css)):(this.spansChecked.delete(i),i.css(i.initialCSS||this.act.document.style.default.css)),s=i.text()):s="unknown",n=0),!this.$checkButton){const t=this.countSolvedTargets();this.ps.reportNewAction(this.act,"SELECT",s,n,r,t),r&&0===this.spansChecked.size&&t===this.targets.length?this.finishActivity(!0):this.playEvent(r?"actionOk":"actionError")}t.preventDefault()}return!0}}Object.assign(ds.prototype,{targetsMarked:!1,lastTimeStamp:0,spansChecked:new Set}),us.Panel=ds;const ps=We.registerClass("@text.Identify",us);class fs extends gi{constructor(t,e,i){super(t,e,i),this.preferredBounds=new Et,this.cells=[]}static layoutSingle(t,e,i){if(!e)return t;let s=e.getPreferredSize(),n=e.getMinimumSize(),r=t;r.width-=2*i,r.height-=2*i,(n.width>r.width||n.height>r.height)&&(r=n);let a=s.width>r.width?r.width/s.width:1;return a*s.height>r.height&&(a=r.height/s.height),s=e.getScaledSize(a),e.setBounds(i,i,s.width,s.height),s.width+=2*i,s.height+=2*i,s}static layoutDouble(t,e,i,s,n){let r=!1,a=1,o=1;switch(s){case"AB":case"BA":a=2,o=1,r=!0;break;case"AUB":case"BUA":a=1,o=2,r=!1}const c=e.getBounds(),l=i.getBounds();let h=e.getPreferredSize(),u=i.getPreferredSize();const d=new St(r?h.width+u.width:Math.max(h.width,u.width),r?Math.max(h.height,u.height):h.height+u.height),p=e.getMinimumSize(),f=i.getMinimumSize(),g=new St(r?p.width+f.width:Math.max(p.width,f.width),r?Math.max(p.height,f.height):p.height+f.height),m=t;m.width-=(1+a)*n,m.height-=(1+o)*n,(g.width>m.width||g.height>m.height)&&m.setDimension(g);let v=d.width>m.width?m.width/d.width:1;v*d.height>m.height&&(v=m.height/d.height),h=e.getScaledSize(v),u=i.getScaledSize(v);let b=u.width>h.width?(u.width-h.width)/2:0,y=h.width>u.width?(h.width-u.width)/2:0,w=u.height>h.height?(u.height-h.height)/2:0,A=h.height>u.height?(h.height-u.height)/2:0;switch(s){case"AB":e.setBounds(n,n+w,h.width,h.height),i.setBounds(2*n+h.width,n+A,u.width,u.height);break;case"BA":i.setBounds(n,n+A,u.width,u.height),e.setBounds(2*n+u.width,n+w,h.width,h.height);break;case"AUB":e.setBounds(n+b,n,h.width,h.height),i.setBounds(n+y,2*n+h.height,u.width,u.height);break;case"BUA":i.setBounds(n+y,n,u.width,u.height),e.setBounds(n+b,2*n+u.height,h.width,h.height);break;default:e.setBounds(Math.round(n+v*c.pos.x),Math.round(n+v*c.pos.y),h.width,h.height),i.setBounds(Math.round(n+v*l.pos.x),Math.round(n+v*l.pos.y),h.width,h.height)}const C=new Et(e.getBounds());return C.add(i.getBounds()),d.width=C.dim.width+2*n,d.height=C.dim.height+2*n,d}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){const t=this.getPreferredSize();return new St(Math.max(vt.MIN_CELL_SIZE,t.width),Math.max(vt.MIN_CELL_SIZE,t.height))}getScaledSize(t){const e=this.getPreferredSize();return new St(Math.round(t*e.width),Math.round(t*e.height))}addBox(t){this.cells.push(t),t.setParent(this),1===this.cells.length?Et.prototype.setBounds.call(this,t):this.add(t),this.preferredBounds.setBounds(this.getBounds())}boxIndex(t){return null===t?-1:this.cells.indexOf(t)}getBox(t){return t<0||t>=this.cells.length?null:this.cells[t]}getBackgroundBox(){return this.backgroundBox}setBackgroundBox(t){this.backgroundBox=t,null!==t&&(t.setParent(this),t.isBackground=!0),Et.prototype.add.call(this,t),this.preferredBounds.setBounds(this.getBounds())}recalcSize(){let t=this.backgroundBox?new Et(this.backgroundBox.pos,this.backgroundBox.dim):null;this.cells.forEach((e=>{t?t.add(e):t=new Et(e.pos,e.dim)})),t||(t=new Et(this.pos.x,this.pos.y,0,0)),this.preferredBounds.setRect(t),this.x=t.pos.x,this.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height}getNumCells(){return this.cells.length}setCellAttr(t,e){this.cells.forEach((i=>i[t]=e)),this.backgroundBox&&(this.backgroundBox[t]=e)}setBorder(t){this.cells.forEach((e=>e.setBorder(t)))}setVisible(t){this.cells.forEach((e=>e.setVisible(t)))}setAlternative(t){super.setAlternative(t),this.cells.forEach((e=>e.setAlternative(t)))}setBounds(t,e,i,s){if("number"==typeof t&&(t=new Et(t,e,i,s)),t.getSurface()>0&&!t.equals(this)){const e=t.dim.width/this.dim.width,i=t.dim.height/this.dim.height,s=t.pos.x-this.pos.x,n=t.pos.y-this.pos.y;if(this.cells.forEach((t=>{const r=new kt(t.pos.x-this.pos.x,t.pos.y-this.pos.y);t.setBounds(s+this.pos.x+e*r.x,n+this.pos.y+i*r.y,e*t.dim.width,i*t.dim.height),t.pos0=null})),null!==this.backgroundBox){const t=this.backgroundBox,r=new kt(t.pos.x-this.pos.x,t.pos.y-this.pos.y);t.setBounds(s+this.pos.x+e*r.x,n+this.pos.y+i*r.y,e*t.dim.width,i*t.dim.height)}}super.setBounds(t)}update(t,e){return!(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())&&(!(e&&!this.intersects(e))&&(null!==this.backgroundBox&&this.backgroundBox.update(t,e),this.cells.forEach((i=>{i.isMarked()||i.update(t,e)})),this.cells.forEach((i=>{i.isMarked()&&i.update(t,e)})),!0))}findBox(t){let e=null;for(let i=this.cells.length-1;i>=0;i--){const s=this.getBox(i);if(s.isVisible()&&s.contains(t)){e=s;break}}return e}countInactiveCells(){return this.cells.reduce(((t,e)=>e.isInactive()?++t:t),0)}}Object.assign(fs.prototype,{cells:[],preferredBounds:new Et,backgroundBox:null});const gs=fs;class ms extends gs{constructor(t,e,i){super(t,e,i)}addActiveBox(t){return t.idLoc=this.cells.length,t.idOrder=t.idLoc,this.addBox(t)}getActiveBox(t){return this.getBox(t)}getBackgroundActiveBox(){return this.getBackgroundBox()}setContent(t,e,i,s,n){i||(i=0),s||(s=0),n||(n=this.cells.length);for(let r=0;r<n;r++){const n=this.getActiveBox(s+r);n.setContent(t,i+r),n.setAlternative(!1),e&&n.setAltContent(e,i+r)}if(null!==t.backgroundContent&&null!==this.getBackgroundActiveBox()){const e=this.getBackgroundActiveBox();e.setContent(t.backgroundContent),t.style!==e.boxBase&&e.setBoxBase(t.style)}}findActiveBox(t){return this.findBox(t)}clearAllBoxes(){this.cells.forEach((t=>t.clear()))}clearAll(){this.clearAllBoxes(),null!==this.backgroundBox&&this.getBackgroundActiveBox().clear()}countCellsAtPlace(){return this.cells.reduce(((t,e)=>e.isAtPlace()?++t:t),0)}getActiveBoxWithIdLoc(t){return this.cells.find((e=>e.idLoc===t))||null}cellIsAtEquivalentPlace(t,e){return t.isAtPlace()||t.isEquivalent(this.getActiveBoxWithIdLoc(t.idOrder),e)}countCellsAtEquivalentPlace(t){return this.cells.reduce(((e,i)=>this.cellIsAtEquivalentPlace(i,t)?++e:e),0)}countCellsWithIdAss(t){return this.cells.reduce(((e,i)=>i.idAss===t?++e:e),0)}setDefaultIdAss(){this.cells.map((t=>t.setDefaultIdAss()))}shuffleCells(t,e){let i=this.cells.length;if(i>=2){const s=[],n=[],r=new kt;for(let t=0;t<i;t++){const e=this.getActiveBox(t);s[t]=new kt(e.pos),n[t]=e.idLoc}for(let e=0;e<t;e++){const t=Math.floor(Math.random()*i),e=Math.floor(Math.random()*i);if(t!==e){r.moveTo(s[t]),s[t].moveTo(s[e]),s[e].moveTo(r);const i=n[t];n[t]=n[e],n[e]=i}}for(let t=0;t<i;t++){const i=this.getActiveBox(t),r=s[t].x,a=s[t].y;i.moveTo(new kt(r,a)),e&&this.fitCellsInArea([i]),i.idLoc=n[t]}}}fitCellsInArea(t){const e=this.pos.x+this.dim.width,i=this.pos.y+this.dim.height;t.forEach((t=>{t.pos0||(t.pos0=new kt(t.pos));const s=Math.min(Math.max(t.pos.x,this.pos.x),e-t.dim.width),n=Math.min(Math.max(t.pos.y,this.pos.y),i-t.dim.height);s===t.pos.x&&n===t.pos.y||t.moveTo(new kt(s,n))}))}swapCellPositions(t,e,i){const s=new kt(e.pos),n=e.pos0,r=e.idLoc;e.moveTo(t.pos0||t.pos),e.pos0=t.pos0,e.idLoc=t.idLoc,t.moveTo(n||s),t.pos0=n,t.idLoc=r,i&&this.fitCellsInArea([t,e])}resetIds(){this.cells.forEach(((t,e)=>{t&&(t.idOrder=e,t.idAss=e,t.idLoc=e)}))}getNextItem(t,e){const i=-12345;e||(e=i);let s=t+1;for(;s<this.cells.length;s++){const t=this.cells[s];if(!t)break;if(e!==i){if(e===t.idAss)break}else if(t.idAss>=0)break}return s}buildAccessibleElements(t,i,s){return this.$accessibleDiv=""!==this.accessibleText?e()("<div/>",{"aria-label":this.accessibleText,tabindex:0}):null,t.append(this.$accessibleDiv),this.cells.map((t=>t)).sort(((t,e)=>t.idLoc>e.idLoc?1:-1)).forEach((e=>e.buildAccessibleElement(t,i,this.$accessibleDiv,s))),this.$accessibleDiv}}Object.assign(ms.prototype,{$accessibleDiv:null});const vs=ms;class bs extends vs{constructor(t,e,i,s,n,r,a,o){super(t,e,i),this.nCols=o.nCols,this.nRows=o.nRows;const c=new Et(new kt(s,n),new St(Math.round(r/this.nCols)*this.nCols,Math.round(a/this.nRows)*this.nRows));for(let t=0;t<o.nCells;t++){const s=o.getShape(t,c),n=new vi(this,e,i,t,s.getBounds());o.rectangularShapes||n.setShape(s),this.addActiveBox(n)}if(o.hasRemainder){const t=o.getRemainderShape(c),s=new vi(this,e,i,0,t.getBounds());s.setShape(t),this.setBackgroundBox(s)}}static createEmptyGrid(t,e,i,s,n,r,a){const o=n?new bs(t,e,a||n.style,i,s,n.getTotalWidth(),n.getTotalHeight(),r||n.getShaper()):null;return o&&o.setBorder(n.border),o}getMinimumSize(){return new St(vt.MIN_CELL_SIZE*this.nCols,vt.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new St(G(t*this.preferredBounds.dim.width,this.nCols),G(t*this.preferredBounds.dim.height,this.nRows))}getCoord(t){return new kt(t.idLoc%this.nCols,Math.floor(t.idLoc/this.nCols))}getCoordDist(t,e){const i=this.getCoord(t),s=this.getCoord(e);return new kt(s.x-i.x,s.y-i.y)}}Object.assign(bs.prototype,{nCols:1,nRows:1});const ys=bs;class ws extends He{constructor(t){super(t)}setProperties(t){super.setProperties(t),this.abc.primary.avoidAllIdsNull(this.abc.answers.getNumCells())}getMinNumActions(){return this.invAss?this.abc.answers.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}hasRandom(){return!0}needsKeyboard(){return!0}helpSolutionAllowed(){return!0}}Object.assign(ws.prototype,{nonAssignedCells:0,useIdAss:!0});class As extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.answers,s=this.act.abc.solvedPrimary;if(t&&i){if(this.act.invAss&&(this.invAssCheck=Array(i.getNumCells()).fill(!1)),t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e()("<span/>").css({"background-image":"url("+t.animatedGifFile+")","background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),s&&s.image&&s.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const e=[t,i];s&&e.push(s),this.act.acp.generateContent(t.nch,t.ncw,e,!1)}this.bgA=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);let r=i.w;"AUB"!==this.act.boxGridPos&&"BUA"!==this.act.boxGridPos||(r=t.getTotalWidth()),this.bgB=new ys(null,this,i.style,this.act.margin,this.act.margin,r,i.h,new Vi(1,1)),this.$form=e()("<form/>",{id:"form1"}),this.$form[0].addEventListener("submit",(t=>(t.preventDefault(),this.playing&&this.setCurrentCell(this.currentCell),!1))),this.$textField=e()("<input/>",{type:"text",size:200}).css(i.style.getCSS()).css({position:"absolute",top:0,left:0,border:0,padding:0,margin:0,"text-align":"center"}).attr({autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.$div.append(this.$form.append(this.$textField)),this.bgA.setContent(t,s||null),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.act.nonAssignedCells=0;for(let t=0;t<this.bgA.getNumCells();t++){var n=this.bgA.getActiveBox(t);-1===n.idAss&&(this.act.nonAssignedCells++,n.switchToAlt(this.ps))}this.bgA.setVisible(!0),this.bgB.setVisible(!1)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}activityReady(){super.activityReady(),this.setCurrentCell(0)}updateContent(t){if(super.updateContent(t),this.bgA&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?gs.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){const s=t.clone();if("AUB"===this.act.boxGridPos?s.height-=this.bgB.pos.y+this.act.margin/2:"AB"===this.act.boxGridPos&&(s.width-=this.bgB.pos.x+this.act.margin/2),this.$canvas=e()('<canvas width="'+s.dim.width+'" height="'+s.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.bgA&&this.$animatedBg){var i=this.bgA.getBounds();this.$animatedBg.css({left:i.pos.x,top:i.pos.y,width:i.dim.width+"px",height:i.dim.height+"px","background-size":i.dim.width+"px "+i.dim.height+"px"}),this.$canvas.insertAfter(this.$animatedBg)}else this.$div.prepend(this.$canvas);this.$textField&&this.$textField.css({top:this.bgB.pos.y,left:this.bgB.pos.x,width:this.bgB.dim.width,height:this.bgB.dim.height,zIndex:9}),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"click"))}checkInvAss(){return this.act.invAss&&this.invAssCheck&&this.invAssCheck.every((t=>t))}setCurrentCell(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.playing)return;let i=null,s=!1;if(-1!==this.currentCell){let t=!1;if(i=this.bgA?this.bgA.getActiveBoxWithIdLoc(this.currentCell):null,i){i.setMarked(!1);const n=i.getDescription(),r=i.idAss,a=r>=0?this.act.abc.answers.getActiveBoxContent(r).text:"",o=this.$textField.val().trim();if(Z(o,a,!1,this.act.numericContent)){t=!0,i.idAss=-1;const n=a.indexOf("|");n>=0&&this.$textField.val(a.substring(0,n)),this.act.abc.solvedPrimary?(i.switchToAlt(this.ps),s=i.playMedia(this.ps,e)):i.clear(),this.act.invAss&&r>=0&&r<this.invAssCheck.length&&(this.invAssCheck[r]=!0),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem))}const c=this.bgA.countCellsWithIdAss(-1);if(o.length>0&&this.ps.reportNewAction(this.act,"WRITE",n,o,t,c),t&&(this.checkInvAss()||c===this.bgA.getNumCells()))return this.finishActivity(!0),this.$textField.prop("disabled",!0),void this.invalidate().update();!s&&o.length>0&&this.playEvent(t?"actionOk":"actionError")}}if(i=this.bgA?this.act.useOrder?this.bgA.getBox(this.currentItem):this.bgA.getActiveBoxWithIdLoc(t):null,this.bgA&&(!i||-1===i.idAss)){for(var n=0;n<this.bgA.getNumCells()&&(i=this.bgA.getActiveBoxWithIdLoc(n),-1===i.idAss);n++);if(i&&-1===i.idAss)return this.finishActivity(!1),this.$textField.prop("disabled",!0),void this.invalidate().update()}i&&this.bgA&&this.bgA.getNumCells()>1&&i.setMarked(!0),i&&(this.currentCell=i.idLoc),this.$textField.val(""),this.$textField.focus(),this.invalidate().update(),i&&i.playMedia(this.ps,e)}processEvent(t){if(this.playing){const e=[];switch(t.type){case"click":t.preventDefault(),this.ps.stopMedia(1);const i=new kt(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);if(this.bgB.contains(i)){this.$textField.focus();break}const s=this.bgA?this.bgA.findActiveBox(i):null;s&&!s.isInactive()&&(s.getContent()&&null===s.getContent().mediaContent&&this.playEvent("CLICK"),this.setCurrentCell(s.idLoc,e));break;case"change":t.preventDefault(),this.setCurrentCell(this.currentCell,e)}return e.forEach((t=>t())),!1}}}Object.assign(As.prototype,{$textField:null,invAssCheck:null,bgA:null,bgB:null,currentCell:-1,events:["click","change"]}),ws.Panel=As;const Cs=He.registerClass("@text.WrittenAnswer",ws);class xs extends He{constructor(t){super(t),this.includeInReports=!1,this.reportActions=!1}}class ks extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),t.animatedGifFile&&!t.shaper.rectangularShapes&&(this.$animatedBg=e()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return this.getBounds().equals(t)?t:gs.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg){if(this.$canvas=e()('<canvas width="'+t.dim.width+'" height="'+t.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bg.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:"".concat(t.dim.width,"px"),height:"".concat(t.dim.height,"px"),"background-size":"".concat(t.dim.width,"px ").concat(t.dim.height,"px")})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout((()=>this.bg?this.bg.buildAccessibleElements(this.$canvas,this.$div):null),0)}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new kt(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];this.ps.stopMedia(1);const s=this.bg.findActiveBox(e);s&&(s.playMedia(this.ps,i)||this.playEvent("click")),i.forEach((t=>t())),t.preventDefault()}}}Object.assign(ks.prototype,{bg:null,events:["click"]}),xs.Panel=ks;const Ss=He.registerClass("@panels.InformationScreen",xs);class Ts extends He{constructor(t){super(t)}getMinNumActions(){return this.cellsToMatch}hasRandom(){return!0}}Object.assign(Ts.prototype,{nonAssignedCells:0,cellsToMatch:1});class Es extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.solvedPrimary;if(t){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i&&i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const e=[t];i&&(e.push(null),e.push(i)),this.act.acp.generateContent(t.nch,t.ncw,e,!1)}this.bg=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t,i||null),this.bg.setAlternative(!1),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setDefaultIdAss(),this.act.nonAssignedCells=0,this.act.cellsToMatch=0;const s=this.bg.getNumCells();for(let t=0;t<s;t++){const e=this.bg.getActiveBox(t),i=e.idAss;1===i?this.act.cellsToMatch++:-1===i&&(this.act.nonAssignedCells++,e.switchToAlt(this.ps))}this.bg.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.act.shuffleA&&this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return super.updateContent(t)}setDimension(t){return this.getBounds().equals(t)?t:gs.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg){if(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bg.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:"".concat(t.dim.width,"px"),height:"".concat(t.dim.height,"px"),"background-size":"".concat(t.dim.width,"px ").concat(t.dim.height,"px")})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout((()=>this.bg?this.bg.buildAccessibleElements(this.$canvas,this.$div):null),0)}}buildAccessibleComponents(){this.bg&&this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new kt(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);let i=!1;const s=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bg?this.bg.findActiveBox(e):null;if(t)if(-1!==t.idAss){let e=!1;const n=t.getDescription();i=i||t.playMedia(this.ps,s),1!==t.idAss||this.act.useOrder&&t.idOrder!==this.currentItem||(e=!0,t.idAss=-1,t.switchToAlt(this.ps)?i=i||t.playMedia(this.ps,s):t.clear(),this.act.useOrder&&(this.currentItem=this.bg.getNextItem(this.currentItem,1)));const r=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"SELECT",n,null,e,r-this.act.nonAssignedCells),e&&r===this.act.cellsToMatch+this.act.nonAssignedCells?this.finishActivity(!0):i||this.playEvent(e?"actionOk":"actionError"),this.update()}else this.playEvent("actionError")}s.forEach((t=>t())),t.preventDefault()}}}Object.assign(Es.prototype,{bg:null,events:["click"]}),Ts.Panel=Es;const Ps=He.registerClass("@panels.Identify",Ts);class Is extends He{constructor(t){super(t)}mustPauseSequence(){return!0}getMinNumActions(){return 0}hasRandom(){return!0}}class Bs extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.secondary;if(t&&i){t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t,i],!1),this.bgA=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);const s="AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?t.getTotalWidth():i.w;this.bgB=new ys(null,this,i.style,this.act.margin,this.act.margin,s,i.h,new Vi(1,1)),this.bgA.setContent(t),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.getActiveBox(0).setInactive(!1),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?gs.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){if(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bgA.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:"".concat(t.dim.width,"px"),height:"".concat(t.dim.height,"px"),"background-size":"".concat(t.dim.width,"px ").concat(t.dim.height,"px")})}this.$div.append(this.$canvas),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new kt(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bgA.findActiveBox(e);if(t){const e=this.bgB.getActiveBox(0);if(-1===t.idAss||this.act.useOrder&&t.idOrder!==this.currentItem)e.clear(),e.setInactive(!1);else if(e.setContent(this.act.abc.secondary,t.idAss),e.playMedia(this.ps,i)||t.playMedia(this.ps,i)||this.playEvent("CLICK"),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)),this.ps.reportNewAction(this.act,"SELECT",t.getDescription(),e.getDescription(),!0,0),0===t.idAss&&1===this.bgA.getNumCells()){const t=this.act.project.activitySequence,e=t.getCurrentAct();e&&t.hasNextAct(!0)&&e.delay>0&&"both"!==t.getNavButtonsFlag()&&"fwd"!==t.getNavButtonsFlag()&&this.finishActivity(!0)}this.update()}}i.forEach((t=>t())),t.preventDefault()}}}Object.assign(Bs.prototype,{bgA:null,bgB:null,events:["click"]}),Is.Panel=Bs;const _s=He.registerClass("@panels.Explore",Is);class Os extends He{constructor(t){super(t),this.menuElements=[],this.includeInReports=!1,this.reportActions=!1}}class Rs extends $e{constructor(t,e,i){super(t,e,i),e.lastProjectSkin=null}buildVisualComponents(){this.firstRun&&super.buildVisualComponents();const t=e()("<div/>").css({width:"100%","max-height":"100%",position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex","flex-wrap":"wrap","overflow-y":"auto","place-content":"center","overflow-y":"auto"});this.act.menuElements.forEach((i=>{const s=i.description||i.caption||"JClic",n=e()("<button/>",{class:"StockBtn",title:s,"aria-label":s}).css({"min-width":"80px","max-width":"200px","min-height":"80px",margin:"4px",padding:"4px",display:"flex","flex-direction":"column","justify-content":"center","align-items":"center"}),r=Rs.icons[i.icon||"@ico00.png"],a=e()("<img/>",{src:r||""}).css({"max-width":"180px","max-height":"100px",margin:"4px"});if(!r){this.act.project.mediaBag.getElement(i.icon,!0).getFullPathPromise().then((t=>a.attr("src",t)))}n.append(a),n.append(e()("<span/>").css({"max-width":"180px",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}).html(i.caption)),n[0].addEventListener("click",(t=>{const e=new Jt(i.projectPath?"RUN_CLIC_PACKAGE":"RUN_CLIC_ACTIVITY",i.sequence);i.projectPath&&(e.externalParam=i.projectPath),b("info","Launching ".concat(i.projectPath||""," ").concat(i.sequence||"")),this.ps.playMedia(e),t.preventDefault()})),t.append(n)})),this.$div.empty().append(t)}setDimension(t){return t}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.setAndPlayMsg("initial","start"),this.playing=!0}}Rs.icons={"@ico00.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAB1UExURUxpcZVZAGyAAGyAAJVZAJVZAJVZAIhmAJVZAJVZAJVZAIhmAGyAAGyAAGyAAGyAAGyAAJVZAJVZAGyAAJVZANj+AP+ZAMFzAPWSALVsANyEAM57AJ66AOiLALXVAM3xAK1nAI6oAIabAJWwAMTnAKFgAGyAAIlz9xYAAAAVdFJOUwB9oCIiZpkRRKq7M4BVu9VmVd1EzJvdA7gAAAE0SURBVDjLjZPZkoMgEEVFFsHdZBQR3M38/ycOKQ1gJKnpV051nwtNEPyrsjBNom9AqNSapxn8CBRjXY+DmjXkbQSXeq9tWJe7ByhVberXqzCY8yGM6GVK9FQ4SpVUxAwnJ+A+2wkLBLLppYgJRgZIrcJYBKxvdLUdFzE4mHBzFNDUvKoVdFfI7YQ1q7gD7LowXNRwaM4R6AzQEXNRWZrPT2jLA9YaQOIXQHV0WIbFvKZImPNGmLCMCwY0lJQQS6vAzEXFjY7Of5iORXwKySHe8+kWWwVeGQUnmW3QTMgDONUbhQ+ABAZwozkTqH1Ox8za3Jz3drLZDMABquuM9nFaKXZpwfFpp+j0ZiHJ21pifiIkQ++Lix+9nc+Z5/tQwrt2fxEBvN8vooQJLgTDX74xSi6z/wAoQC7hWsslMgAAAABJRU5ErkJggg==","@ico01.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAByUExURUxpcfzZt/rfw/pycvrcv/3UrJqf/QAAAP/hxPvOov9sbPqFhYmN/f7nz3V4+/3ky/+AgPrIl11g/P/Klf+Kiv9XV//q1vtHR/rCim1w//pcXISI//tfX5WY/VNT///Dh/86OvwhISUl/js7+klM+vq6e8H/VfEAAAABdFJOUwBA5thmAAABGElEQVQ4y62T23aCMBBFiU48iQlELoJW7b3//4udBIi0MqsvDU+w95yEGSiK/15YrlVhd1+C8Nk05+ribzcvCJlXklBV3u/8pToLAnMk3kiCh0Hkz4LA/NSC+YcgANTWYP4OqVGmtmAuC2St2Mn4EMbq9TaPvABpDborD+OB0QqG8hbo3HTNAikFCtEZBTcMx+t+ewC2U4IyMAFUTgVd5nukHYlrqYcxSBlw15k/gTlXx/ySPT5NLOkyP7IQq0PoOd/wSZLgmLtD5AMLsS70ZbnZEL+LTQmZv6aEQIkrpTUlwWX+FhNCyNzaOiVkHgXODyHzFr87ye/3g+NxGrTgJ6zNa8nXJ04zf4Ew88ylr8KM/At//sB88w0/sBcK3bRRzgAAAABJRU5ErkJggg==","@ico02.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUxpcQAAAP///8zMzJmZmfrdwP/hxPvOov3UrP3JlvzZt/zlzf/p0/zBh/rDjUN28cYAAAABdFJOUwBA5thmAAAAyklEQVQ4y6WT6w6DIAxG/YS2XHTv/7grLshF0C1r+KE5n6fFpMvybQHt6bldbXfQcazNsTD4MdCV+S+AQcBUBYa5M4BfHrcB8oNA08HLg0EeAiwOuGtBzoE0Mje4AO4S7QwhgDhlZrcISiNoqxzFoGbSb5Uyozhs4ckdD4M+OfQtUmeKcUsGnaQEyoSp/6YJIr2LXAPqp4OH4BzJtUXyZy7iBwbl8eSDALUc/Z/Sv1DxHfVm5ao5hjtIme+YbOnJMdlj/vCJoB5HX97wIgms7CtjdwAAAABJRU5ErkJggg==","@ico03.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAwUExURUxpcQAAAPrdwP/hxP7mz/8AAAAAmfvOov3UrAAA//3JlvzZtwCZAP8A//zCifq6e7UN6GsAAAABdFJOUwBA5thmAAABA0lEQVQ4y5WS2RbDIAhEHdyTJv3/vy2osVj1oR6zeYcBDcb8NV6v9fp1NV7mgq8cMs/cDWYHhrmomsM1pcj9pgS7FL3IZ6AI8nazsCiCnPOG3wf0QpArfDnoGATC6mwc9oi/AtMFgAFFLQhDCuZcQ0yAMghB+cuNUgJpSVM1zg7phGUFpv3VFdB5gqxolpwdTqYO5EaPJ57PgWOZWgvt0bl4u+LAbwmzv0Q7JxquJM2FSpwTBRHvRU7Mey/E16f4FwfeSkpUBD26CIQ+PMajODTmaw0Dr7/V1zRVQCNvAvNw6QbFb5iWwvRaWKE4Vh3H/6LxG+ueROfYdXXlb+zavg/++ADYLwfSmmk9oQAAAABJRU5ErkJggg==","@icofolder.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUxpcffvhP///2VlZczMZv//zPf39+/nc8zMzDMzmZmZZrW1tbWttcl3sA0AAAABdFJOUwBA5thmAAAAgklEQVQ4y9WSQQ6AIAwEsVtFwf+/14JGbcHeTHSuO9kFQggfBE8BFwLR+mBwFGYSZvh53zjzZTdkLTXCkS/ViDHBCLe8Gla48qpkGEHl+8pdYJo0yOouPA2GhLLiCCyC28DIcAXZ0IfsVKS3BTGUMDas0E9NfkO/ovmQBv2v0BJ+xAaYuQX2hCJNtwAAAABJRU5ErkJggg=="},Os.Panel=Rs;const Ds=He.registerClass("@panels.Menu",Os);class Ms extends He{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Ns extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;if(t){t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bgA=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgA.setContent(t),this.bgA.accessibleText=m("source"),this.bgB.accessibleText=m("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0);const e=this.bgA.getBackgroundActiveBox(),i=this.bgB.getBackgroundActiveBox();e&&i&&i.exchangeContent(e)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?gs.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),(this.bgA||this.bgB)&&(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new rs(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&(this.bgB.setCellAttr("accessibleAlwaysActive",!0),this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown")))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;const n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new kt;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new kt(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bgA.findActiveBox(this.bc.origin),i=this.bgB.findActiveBox(s),this.bc.end(),e&&i&&i.isInactive()){let t=!1;const s="".concat(e.getDescription()," (").concat(e.idOrder,")"),n="(".concat(i.idOrder,")"),r=this.act.abc.primary.getActiveBoxContent(i.idOrder);e.getContent().isEquivalent(r,!0)&&(t=!0,e.exchangeContent(i),e.setVisible(!1),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));const a=this.bgA.countInactiveCells();this.ps.reportNewAction(this.act,"PLACE",s,n,t,a),t&&a===this.bgA.getNumCells()?this.finishActivity(!0):this.playEvent(t?"actionOk":"actionError")}this.update(),this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(r)break;this.ps.stopMedia(1),e=this.bgA.findActiveBox(s),!e||e.isInactive()||this.act.useOrder&&e.idOrder!==this.currentItem||(this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s),e.playMedia(this.ps,n)||this.playEvent("click"),this.bgB.$accessibleDiv&&this.bgB.$accessibleDiv.focus())}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(Ns.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Ms.Panel=Ns;const Vs=He.registerClass("@puzzles.DoublePuzzle",Ms);class js extends He{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class qs extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return!this.bg||this.getBounds().equals(t)?t:gs.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new rs(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;const n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new kt;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new kt(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg.findActiveBox(this.bc.origin),this.bc.end(),i=this.bg.findActiveBox(s),e&&i){const t="".concat(e.getDescription()," (").concat(e.idOrder,")"),s="(".concat(i.idLoc,")");let n=e.idOrder===i.idLoc;this.bg.swapCellPositions(e,i,!0);const r=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"PLACE",t,s,n,r),n&&r===this.bg.getNumCells()?this.finishActivity(!0):this.playEvent(n?"actionOk":"actionError")}this.update()}else{if(r)break;this.ps.stopMedia(1),e=this.bg.findActiveBox(s),e&&(this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s),e.playMedia(this.ps,n)||this.playEvent("click"))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(qs.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),js.Panel=qs;const Ls=He.registerClass("@puzzles.ExchangePuzzle",js);class Fs extends He{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class zs extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null),this.parkBg&&(this.parkBg.end(),this.parkBg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0),this.hiddenBoxIndex=Math.floor(Math.random()*this.bg.getNumCells()),this.hiddenBox=this.bg.getActiveBox(this.hiddenBoxIndex),this.hiddenBox.setVisible(!1),this.parkBg=new ys(null,this,t.style,this.act.margin,this.act.margin,this.hiddenBox.dim.width,this.hiddenBox.dim.height,new Vi(1,1)),this.parkBg.setContent(t,null,this.hiddenBoxIndex,0,1),this.parkBg.setBorder(this.bg.hasBorder()),this.parkBg.setVisible(!0))}initActivity(){if(super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg){this.act.shuffles%2!=1&&this.act.shuffles++;for(var t=0;t<this.act.shuffles;t++){const t=this.bg.getCoord(this.hiddenBox),i=0===Math.floor(2*Math.random())?1:-1;0===Math.floor(2*Math.random())?(t.x+=i,(t.x<0||t.x>=this.bg.nCols)&&(t.x-=2*i)):(t.y+=i,(t.y<0||t.y>=this.bg.nRows)&&(t.y-=2*i));var e=this.bg.getActiveBoxWithIdLoc(t.y*this.bg.nCols+t.x);null!==e&&this.hiddenBox.exchangeLocation(e)}this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0}}updateContent(t){if(super.updateContent(t),this.bg&&this.parkBg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t),this.parkBg.update(i,t)}return this}setDimension(t){return this.bg&&this.parkBg&&!this.getBounds().equals(t)?gs.layoutDouble(t,this.bg,this.parkBg,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&this.parkBg&&(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new kt(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bg.findActiveBox(e);if(t)if(t.isVisible()){const e=this.bg.getCoordDist(t,this.hiddenBox);if(Math.abs(e.x)+Math.abs(e.y)===1){let e=t.playMedia(this.ps,i);const s="".concat(t.getDescription()," (").concat(t.idOrder,")"),n="(".concat(this.hiddenBox.idLoc,")");t.exchangeLocation(this.hiddenBox);const r=t.idOrder===t.idLoc,a=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"SELECT",s,n,r,a),r&&a===this.bg.getNumCells()?(this.hiddenBox.setVisible(!0),this.parkBg.setVisible(!1),this.finishActivity(!0)):e||this.playEvent("click")}this.update()}else this.playEvent("actionError")}i.forEach((t=>t())),t.preventDefault()}}}Object.assign(zs.prototype,{bg:null,parkBg:null,hiddenBox:null,hiddenBoxIndex:-1,events:["click"]}),Fs.Panel=zs;const Us=He.registerClass("@puzzles.HolePuzzle",Fs);class Hs extends He{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}}class $s extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.secondary;if(t){if(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),e&&e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const i=[t];e&&i.push(e),this.act.acp.generateContent(t.nch,t.ncw,i,!1)}let i=t.ncw,s=t.nch;"AB"===this.act.boxGridPos||"BA"===this.act.boxGridPos?i*=2:s*=2,this.bg=new ys(null,this,t.style,this.act.margin,this.act.margin,t.w*i,t.h*s,new Vi(i,s));const n=t.getNumCells();this.bg.setBorder(t.border),this.bg.setContent(t,null,0,0,n),this.bg.setContent(e||t,null,0,n,n);for(let t=0;t<2;t++)for(let e=0;e<n;e++){const i=this.bg.getActiveBox(t*n+e);i.idAss=e,i.setInactive(!0)}this.bg.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return!this.bg||this.getBounds().equals(t)?t:gs.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new rs(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.setCellAttr("accessibleAlwaysActive",!0),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null,n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new kt;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new kt(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":case"touchend":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg?this.bg.findActiveBox(this.bc.origin):null,this.bc.end(),i=this.bg?this.bg.findActiveBox(s):null,e&&-1!==e.idAss&&i&&-1!==i.idAss)if(e!==i){let t=!1;e.idAss===i.idAss||e.getContent().isEquivalent(i.getContent(),!0)?(t=!0,e.idAss=-1,e.setInactive(!1),i.idAss=-1,i.setInactive(!1)):(e.setInactive(!0),this.act.dragCells?i.setInactive(!0):(i.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s)));let r=i.playMedia(this.ps,n);if(this.bg){const s=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",e.getDescription(),i.getDescription(),t,s/2),t&&s===this.bg.getNumCells()?this.finishActivity(!0):r||this.playEvent(t?"actionOk":"actionError")}}else this.playEvent("CLICK"),e.setInactive(!0);else null!==e&&e.setInactive(!0);this.invalidate().update()}else{if(r)break;this.ps.stopMedia(1),e=this.bg?this.bg.findActiveBox(s):null,e&&-1!==e.idAss&&(e.playMedia(this.ps,n)||this.playEvent("click"),e.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign($s.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Hs.Panel=$s;const Ws=He.registerClass("@memory.MemoryGame",Hs);class Js extends He{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}Object.assign(Js.prototype,{useIdAss:!1});class Gs extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.secondary,s=this.act.abc.solvedPrimary;if(t&&i){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i.image&&(i.setImgContent(this.act.project.mediaBag,null,!1),!i.animatedGifFile||i.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBgB=e()("<span/>").css({"background-image":"url(".concat(i.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),s&&s.image&&s.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const e=[t,i];s&&e.push(s),this.act.acp.generateContent(t.nch,t.ncw,e,!1)}this.bgA=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,i),this.bgA.setContent(t,s||null),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.setContent(i),this.$animatedBgB&&this.bgB.setCellAttr("tmpTrans",!0),this.bgA.accessibleText=m("source"),this.bgB.accessibleText=m("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}initActivity(){if(super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB){const t=[];this.act.shuffleA&&t.push(this.bgA),this.act.shuffleB&&t.push(this.bgB),t.length>0&&this.shuffle(t,!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}}updateContent(t){if(super.updateContent(t),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?gs.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){if(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgA){const t=this.bgA.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:t.dim.width+"px",height:t.dim.height+"px","background-size":"".concat(t.dim.width,"px ").concat(t.dim.height,"px")})}if(this.$animatedBgB&&this.bgB){const t=this.bgB.getBounds();this.$animatedBgB.css({left:t.pos.x,top:t.pos.y,width:t.dim.width+"px",height:t.dim.height+"px","background-size":"".concat(t.dim.width,"px ").concat(t.dim.height,"px")})}this.$div.append(this.$canvas),this.bc=new rs(this,this.$canvas),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new kt;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new kt(e-this.$div.offset().left,i-this.$div.offset().top)}let n=!1,r=!1,a=!1,o=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;n=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.bc.origin;if(this.bc.end(),e=this.bgA?this.bgA.findActiveBox(t):null,e?i=this.bgB?this.bgB.findActiveBox(s):null:(i=this.bgB?this.bgB.findActiveBox(t):null,i&&(e=this.bgA?this.bgA.findActiveBox(s):null,a=!0)),e&&i&&-1!==e.idAss&&-1!==i.idAss&&this.act.abc.secondary){let t=!1;const s=e.getDescription(),n=i.getDescription(),c=this.act.abc.secondary.getActiveBoxContent(e.idOrder);(e.idOrder===i.idOrder||i.getContent().isEquivalent(c,!0))&&(t=!0,e.idAss=-1,i.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),r=r||e.playMedia(this.ps,o)):(r=a?r||e.playMedia(this.ps,o):r||i.playMedia(this.ps,o),e.clear()),i.clear(),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));const l=this.bgB?this.bgB.countCellsWithIdAss(-1):0;this.ps.reportNewAction(this.act,"MATCH",s,n,t,l),t&&l===this.bgB.getNumCells()?this.finishActivity(!0):r||this.playEvent(t?"actionOk":"actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(n)break;if(this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(s):null,i=this.bgB?this.bgB.findActiveBox(s):null,e&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&i&&-1!==i.idAss){this.act.dragCells?this.bc.begin(s,e||i):this.bc.begin(s),r=r||(e||i).playMedia(this.ps,o),r||this.playEvent("click");let t=e?this.bgA:this.bgB;t&&t.$accessibleDiv&&(t=e?this.bgB:this.bgA,t&&t.$accessibleDiv&&t.$accessibleDiv.focus())}}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}o.forEach((t=>t())),t.preventDefault()}}}Object.assign(Gs.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Js.Panel=Gs;const Ks=He.registerClass("@associations.SimpleAssociation",Js);class Zs extends Js{constructor(t){super(t),this.useIdAss=!0}setProperties(t){super.setProperties(t),this.abc.primary.avoidAllIdsNull(this.abc.secondary.getNumCells())}getMinNumActions(){return this.invAss?this.abc.secondary.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}}Object.assign(Zs.prototype,{nonAssignedCells:0,useIdAss:!1});class Ys extends Gs{constructor(t,e,i){super(t,e,i)}buildVisualComponents(){super.buildVisualComponents();const t=this.act.abc.primary,e=this.act.abc.secondary;t&&e&&(this.act.invAss&&(this.invAssCheck=Array(e.getNumCells()).fill(!1)),this.bgA.setDefaultIdAss(),this.act.nonAssignedCells=0,this.bgA.cells.forEach((t=>{-1===t.idAss&&(this.act.nonAssignedCells++,t.switchToAlt(this.ps))})))}checkInvAss(){return!(!this.act.invAss||!this.invAssCheck)&&this.invAssCheck.every((t=>t))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new kt;else{let e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new kt(e-this.$div.offset().left,i-this.$div.offset().top)}let n=!1,r=!1,a=!1,o=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;n=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.bc.origin;if(this.bc.end(),e=this.bgA?this.bgA.findActiveBox(t):null,e?i=this.bgB?this.bgB.findActiveBox(s):null:(i=this.bgB?this.bgB.findActiveBox(t):null,i&&(e=this.bgA?this.bgA.findActiveBox(s):null,a=!0)),e&&i&&-1!==e.idAss&&!i.isInactive()&&this.act.abc.secondary){const t=e.getDescription(),s=i.getDescription(),n=this.act.abc.secondary.getActiveBoxContent(e.idAss);let c=!1;if((e.idAss===i.idOrder||i.getContent().isEquivalent(n,!0))&&(c=!0,e.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),r=r||e.playMedia(this.ps,o)):(r=a?r||e.playMedia(this.ps,o):r||i.playMedia(this.ps,o),e.clear()),this.act.invAss&&(this.invAssCheck[i.idOrder]=!0,i.clear()),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem))),this.bgA){const e=this.bgA.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",t,s,c,e-this.act.nonAssignedCells),c&&(this.checkInvAss()||e===this.bgA.getNumCells())?this.finishActivity(!0):r||this.playEvent(c?"actionOk":"actionError")}}else if(this.bgB&&(a&&this.bgA&&this.bgA.contains(s)||!a&&this.bgB.contains(s))){const t=e?e.getDescription():i?i.getDescription():"null";this.ps.reportNewAction(this.act,"MATCH",t,"null",!1,this.bgB.countCellsWithIdAss(-1)),this.playEvent("actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(n)break;this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(s):null,i=this.bgB?this.bgB.findActiveBox(s):null,(e&&-1!==e.idAss&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&i)&&(this.act.dragCells?this.bc.begin(s,e||i):this.bc.begin(s),r=r||(e||i).playMedia(this.ps,o),r||this.playEvent("click"));let t=e?this.bgA:this.bgB;t&&t.$accessibleDiv&&(t=e?this.bgB:this.bgA,t&&t.$accessibleDiv&&t.$accessibleDiv.focus())}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}o.forEach((t=>t())),t.preventDefault()}}}Object.assign(Ys.prototype,{invAssCheck:null}),Zs.Panel=Ys;const Qs=We.registerClass("@associations.ComplexAssociation",Zs),Xs={MIN_CELL_SIZE:12,DEFAULT_CELL_SIZE:20,MIN_INTERNAL_MARGIN:2},tn={NORMAL:0,INVERTED:1,HIDDEN:2,LOCKED:4,MARKED:8,TRANSPARENT:16};class en extends gi{constructor(t,e,i,s,n,r,a,o,c,l){super(t,e,i),this.pos.x=s,this.pos.y=n,this.nCols=Math.max(1,r),this.nRows=Math.max(1,a),this.cellWidth=Math.max(o,Xs.MIN_CELL_SIZE),this.cellHeight=Math.max(c,Xs.MIN_CELL_SIZE),this.dim.width=o*this.nCols,this.dim.height=c*this.nRows,this.setChars(" "),this.preferredBounds=new Et(this.pos,this.dim),this.setBorder(l),this.cursorTimer=new Ot((()=>this.blink(0)),500,!1),this.cursorEnabled=!1,this.useCursor=!1,this.wildTransparent=!1,this.cursor=new kt}static createEmptyGrid(t,e,i,s,n,r){const a=new en(t,e,n.style,i,s,n.ncw,n.nch,n.w,n.h,n.border);return a.wild=n.wild,a.randomChars=n.randomChars,a.wildTransparent=r,a}setChars(t){this.chars=[],this.answers=[],this.attributes=[];for(let e=0;e<this.nRows;e++){const i=e<t.length?t[e]:"";this.chars[e]=i.split(""),this.answers[e]=[],this.attributes[e]=[];for(let t=0;t<this.nCols;t++)t>=i.length&&(this.chars[e][t]=" "),this.answers[e][t]=this.chars[e][t],this.attributes[e][t]=tn.NORMAL}}randomize(){for(let t=0;t<this.nRows;t++)for(let e=0;e<this.nCols;e++)this.chars[t][e]===this.wild&&(this.chars[t][e]=this.randomChars.charAt(Math.floor(Math.random()*this.randomChars.length)))}setCellAttributes(t,e){let i=tn.LOCKED;this.wildTransparent?i|=tn.TRANSPARENT:i|=tn.INVERTED|tn.HIDDEN;for(let s=0;s<this.nRows;s++)for(let n=0;n<this.nCols;n++)t&&this.chars[s][n]===this.wild?this.attributes[s][n]=i:(this.attributes[s][n]=tn.NORMAL,e&&(this.chars[s][n]=" "))}setCellLocked(t,e,i){t>=0&&t<this.nCols&&e>=0&&e<this.nRows&&(this.attributes[e][t]=i?tn.LOCKED|(this.wildTransparent?tn.TRANSPARENT:tn.INVERTED|tn.HIDDEN):tn.NORMAL)}getItemFor(t,e){if(!this.isValidCell(t,e))return null;const i=new kt;let s=!1,n=!1;for(let r=0;r<t;r++)this.attributes[e][r]&tn.LOCKED?s||(n&&i.x++,s=!0):(n=!0,s=!1);s=!1,n=!1;for(let r=0;r<e;r++)this.attributes[r][t]&tn.LOCKED?s||(n&&i.y++,s=!0):(n=!0,s=!1);return i}setCursorEnabled(t){this.cursorEnabled=t,!0===t?this.startCursorBlink():this.stopCursorBlink()}startCursorBlink(){this.useCursor&&this.cursorEnabled&&this.cursorTimer&&!this.cursorTimer.isRunning()&&(this.blink(1),this.cursorTimer.start())}stopCursorBlink(){this.cursorTimer&&this.cursorTimer.isRunning()&&(this.cursorTimer.stop(),this.blink(-1))}moveCursor(t,e,i){if(this.useCursor){const s=this.findNextCellWithAttr(this.cursor.x,this.cursor.y,i?tn.LOCKED:tn.NORMAL,t,e,!1);this.cursor.equals(s)||this.setCursorAt(s.x,s.y,i)}}findFreeCell(t,e,i){let s=null;if(t&&(0!==e||0!==i)){const n=new kt(t);for(;null===s&&(n.x+=e,n.y+=i,!(n.x<0||n.x>=this.nCols||n.y<0||n.y>=this.nRows));)this.getCellAttribute(n.x,n.y,tn.LOCKED)||(s=n)}return s}findNextCellWithAttr(t,e,i,s,n,r){const a=new kt(t+s,e+n);for(;a.x<0?(a.x=this.nCols-1,a.y>0?a.y--:a.y=this.nRows-1):a.x>=this.nCols&&(a.x=0,a.y<this.nRows-1?a.y++:a.y=0),a.y<0?(a.y=this.nRows-1,a.x>0?a.x--:a.x=this.nCols-1):a.y>=this.nRows&&(a.y=0,a.x<this.nCols-1?a.x++:a.x=0),(a.x!==t||a.y!==e)&&this.getCellAttribute(a.x,a.y,i)!==r;)a.x+=s,a.y+=n;return a}setCursorAt(t,e,i){this.stopCursorBlink(),this.isValidCell(t,e)&&(this.cursor.x=t,this.cursor.y=e,this.useCursor=!0,i&&this.getCellAttribute(t,e,tn.LOCKED)?this.moveCursor(1,0,i):this.cursorEnabled&&this.startCursorBlink())}setUseCursor(t){this.useCursor=t}getCursor(){return this.cursor}countCharsLike(t){let e=0;for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.chars[i][s]===t&&e++;return e}getNumCells(){return this.nRows*this.nCols}countCoincidences(t){let e=0;if(this.answers)for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.isCellOk(s,i,t)&&e++;return e}isCellOk(t,e,i){let s=!1;if(this.isValidCell(t,e)){const n=this.chars[e][t];if(n!==this.wild){const r=this.answers[e][t];(n===r||!i&&n.toUpperCase()===r.toUpperCase())&&(s=!0)}}return s}getLogicalCoords(t){if(!this.contains(t))return null;const e=Math.floor((t.x-this.pos.x)/this.cellWidth),i=Math.floor((t.y-this.pos.y)/this.cellHeight);return this.isValidCell(e,i)?new kt(e,i):null}isValidCell(t,e){return t<this.nCols&&e<this.nRows&&t>=0&&e>=0}setCharAt(t,e,i){this.isValidCell(t,e)&&(this.chars[e][t]=i,this.repaintCell(t,e))}getCharAt(t,e){return this.isValidCell(t,e)?this.chars[e][t]:" "}getStringBetween(t,e,i,s){let n="";if(this.isValidCell(t,e)&&this.isValidCell(i,s)){let r=i-t,a=s-e;if(0===r||0===a||Math.abs(r)===Math.abs(a)){const i=Math.max(Math.abs(r),Math.abs(a));i>0&&(r/=i,a/=i);for(let s=0;s<=i;s++)n+=this.getCharAt(t+r*s,e+a*s)}}return n}setAttributeBetween(t,e,i,s,n,r){if(this.isValidCell(t,e)&&this.isValidCell(i,s)){let a=i-t,o=s-e;if(0===a||0===o||Math.abs(a)===Math.abs(o)){const i=Math.max(Math.abs(a),Math.abs(o));i>0&&(a/=i,o/=i);for(let s=0;s<=i;s++)this.setAttribute(t+a*s,e+o*s,n,r)}}}setAttribute(t,e,i,s){this.isValidCell(t,e)&&(this.attribute!==tn.MARKED||s||this.repaintCell(t,e),this.attributes[e][t]&=~i,this.attributes[e][t]|=s?i:0,(i!==tn.MARKED||s)&&this.repaintCell(t,e))}setAllCellsAttribute(t,e){for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.setAttribute(s,i,t,e)}getCellAttribute(t,e,i){return!!this.isValidCell(t,e)&&!!(this.attributes[e][t]&i)}getCellRect(t,e){return new Et(this.pos.x+t*this.cellWidth,this.pos.y+e*this.cellHeight,this.cellWidth,this.cellHeight)}getCellBorderBounds(t,e){const i=this.getCellAttribute(t,e,tn.MARKED);if(!this.border&&!i)return this.getCellRect(t,e);const s=this.getBoxBaseResolve(),n=i?s.markerStroke:s.borderStroke;return this.getCellRect(t,e).grow(n.lineWidth,n.lineWidth)}repaintCell(t,e){this.container&&this.container.invalidate(this.getCellBorderBounds(t,e)).update()}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){return new St(Xs.MIN_CELL_SIZE*this.nCols,Xs.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new St(G(t*this.preferredBounds.dim.width,this.nCols),G(t*this.preferredBounds.dim.height,this.nRows))}setBounds(t,e,i,s){super.setBounds(t,e,i,s),this.cellWidth=this.dim.width/this.nCols,this.cellHeight=this.dim.height/this.nRows}updateContent(t,e){const i=this.getBoxBaseResolve();t.font=i.font.cssFont(),t.textBaseline="alphabetic",i.prepareText(t,"W",this.cellWidth-2*Xs.MIN_INTERNAL_MARGIN,this.cellHeight-2*Xs.MIN_INTERNAL_MARGIN);const s=[],n=(this.cellHeight-i.font.getHeight())/2+i.font.getMetrics().ascent;for(let r=0;r<this.nRows;r++)for(let a=0;a<this.nCols;a++){if(this.getCellBorderBounds(a,r).intersects(e)){const e=this.attributes[r][a];if(!(e&tn.TRANSPARENT)){const o=!!(e&tn.INVERTED),c=!!(e&tn.MARKED),l=this.useCursor&&this.cursor.x===a&&this.cursor.y===r,h=this.getCellRect(a,r);if(t.fillStyle=l&&this.cursorBlink?i.inactiveColor:o?i.textColor:i.backColor,h.fill(t),t.strokeStyle="black",!(e&tn.HIDDEN)&&(s[0]=this.chars[r][a],s[0])){const e=h.pos.x+(this.cellWidth-t.measureText(s[0]).width)/2,r=h.pos.y+n;if(i.shadow){const n=Math.max(1,i.font.size/10);t.fillStyle=i.shadowColor,t.fillText(s[0],e+n,r+n)}t.fillStyle=o?i.backColor:this.isAlternative()?i.alternativeColor:i.textColor,t.fillText(s[0],e,r)}(this.border||c)&&(t.strokeStyle=i.borderColor,i[c?"markerStroke":"borderStroke"].setStroke(t),c&&(t.globalCompositeOperation="xor"),h.stroke(t),c&&(t.globalCompositeOperation="source-over")),t.strokeStyle="black",xt.prototype.setStroke(t)}}}return!0}blink(t){this.useCursor&&(this.cursorBlink=1===t||-1!==t&&!this.cursorBlink,this.repaintCell(this.cursor.x,this.cursor.y))}end(){this.cursorTimer&&(this.cursorTimer.stop(),this.cursorTimer=null)}}Object.assign(en.prototype,{nRows:1,nCols:1,chars:null,answers:null,attributes:null,cellWidth:20,cellHeight:20,preferredBounds:null,wild:Oe.prototype.wild,randomChars:Oe.prototype.randomChars,cursorEnabled:!1,useCursor:!1,cursor:null,cursorBlink:!1,cursorTimer:null,wildTransparent:!1}),en.defaults=Xs,en.flags=tn;const sn=en;class nn extends He{constructor(t){super(t)}getMinNumActions(){return this.clues.length}helpSolutionAllowed(){return!0}hasRandom(){return!0}}Object.assign(nn.prototype,{clues:null,clueItems:null,shuffleA:!1,shuffleB:!1});class rn extends $e{constructor(t,e,i){super(t,e,i),this.resolvedClues=[]}clear(){this.grid&&(this.grid.end(),this.grid=null),this.bgAlt&&(this.bgAlt.end(),this.bgAlt=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.tgc,i=this.act.abc.secondary;i&&(i.image&&(i.setImgContent(this.act.project.mediaBag,null,!1),!i.animatedGifFile||i.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBg=e()("<span/>").css({"background-image":"url(".concat(i.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(0,0,[i],!1)),t&&(this.grid=sn.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,!1),i&&(this.bgAlt=ys.createEmptyGrid(null,this,this.act.margin,this.act.margin,i),this.$animatedBg&&this.bgAlt.backgroundBox&&(this.bgAlt.backgroundBox.tmpTrans=!0)),this.grid.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.grid.randomize(),this.grid.setAllCellsAttribute(sn.flags.INVERTED,!1),this.resolvedClues=Array(this.act.clueItems.length).fill(!1),this.bgAlt&&(this.bgAlt.setContent(this.act.abc.secondary),this.$animatedBg&&this.bgAlt.clearAllBoxes(),this.act.shuffleB&&this.shuffle([this.bgAlt],!0,!0),this.bgAlt.setVisible(null!==this.$animatedBg||this.act.invAss)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.grid&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.bgAlt&&this.bgAlt.update(i,t)}return this}setDimension(t){return!this.grid||this.getBounds().equals(t)?t:this.bgAlt?gs.layoutDouble(t,this.grid,this.bgAlt,this.act.boxGridPos,this.act.margin):gs.layoutSingle(t,this.grid,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.grid){if(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgAlt){const t=this.bgAlt.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:"".concat(t.dim.width,"px"),height:"".concat(t.dim.height,"px"),"background-size":"".concat(t.dim.width,"px ").concat(t.dim.height,"px")})}this.$div.append(this.$canvas),this.bc=new rs(this,this.$canvas),this.invalidate().update()}}getCurrentScore(){return this.resolvedClues.reduce(((t,e)=>e?++t:t),0)}processEvent(t){if(this.bc&&this.playing){let e=null;if("touchend"===t.type)e=this.bc.active?this.bc.dest.clone():new kt;else{const i=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;e=new kt(i-this.$div.offset().left,s-this.$div.offset().top)}let i=!1,s=!1;const n=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&e.distanceTo(this.bc.origin)<=3)break;i=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.grid.getLogicalCoords(this.bc.origin),e=this.grid.getLogicalCoords(this.bc.dest);this.bc.end();const i=this.grid.getStringBetween(t.x,t.y,e.x,e.y);if(null!==i&&i.length>0){let r=!1,a=0;for(;a<this.act.clues.length;a++)if(i===this.act.clues[a]){r=!0;break}const o=this.resolvedClues[a];if(r&&!o&&(this.resolvedClues[a]=!0,this.grid.setAttributeBetween(t.x,t.y,e.x,e.y,sn.flags.INVERTED,!0),null!==this.bgAlt)){const t=this.act.clueItems[a];if(t>=0&&t<this.bgAlt.getNumCells()){const t=this.bgAlt.getActiveBox(this.act.clueItems[a]);t&&(t.setVisible(null===this.$animatedBg&&!this.act.invAss),s=t.playMedia(this.ps,n))}}if(o)r||s||this.playEvent("actionError");else{const t=this.getCurrentScore();this.ps.reportNewAction(this.act,"ACTION_SELECT",i,null,r,t),t===this.act.clues.length?this.finishActivity(!0):s||this.playEvent(r?"actionOK":"actionError"),this.invalidate()}}else this.playEvent("actionError");this.update()}else{if(i)break;this.ps.stopMedia(1),this.grid.contains(e)&&(this.playEvent("click"),this.bc.begin(e))}break;case"mousemove":case"touchmove":this.bc.moveTo(e)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(rn.prototype,{grid:null,bgAlt:null,resolvedClues:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),nn.Panel=rn;const an=He.registerClass("@textGrid.WordSearch",nn);class on extends He{constructor(t){super(t)}getMinNumActions(){return this.tgc.getNumChars()-this.tgc.countWildChars()}needsKeyboard(){return!0}}Object.assign(on.prototype,{upperCase:!0,checkCase:!0,wildTransparent:!1});class cn extends $e{constructor(t,e,i){super(t,e,i)}clear(){this.grid&&(this.grid.end(),this.grid=null),this.style&&(this.style.end(),this.style=null)}createBoxBag(t){const i=new gs(null,this,null),s=new gi(i,this,this.icoBB);s.setBounds(0,0,this.LABEL_WIDTH,this.act.abc[t].h);const n=e()("<button/>",{class:"StockBtn"}).css({width:this.LABEL_WIDTH,height:this.act.abc[t].h,"background-image":"url(".concat("acrossClues"===t?this.hIcon:this.vIcon,")"),"background-repeat":"no-repeat","background-position":"center","border-radius":6,"z-index":10}).on("click",(()=>{this.advance="acrossClues"===t?"ADVANCE_RIGHT"===this.advance?"NO_ADVANCE":"ADVANCE_RIGHT":"ADVANCE_DOWN"===this.advance?"NO_ADVANCE":"ADVANCE_DOWN",this.setBtnStatus()})).on("keypress",(t=>{" "===String.fromCharCode(t.charCode||t.keyCode)&&t.stopPropagation()})).appendTo(this.$div);s.setHostedComponent(n),i.addBox(s);const r=new vi(i,null,null,t,new Et(this.LABEL_WIDTH+this.act.margin,0,this.act.abc[t].w,this.act.abc[t].h));return i.addBox(r),i.setBoxBase(this.act.abc[t].style),"acrossClues"===t?(this.hClue=r,this.hClueBtn=s):(this.vClue=r,this.vClueBtn=s),i}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.tgc,e=this.act.abc.acrossClues,i=this.act.abc.downClues;if(e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(0,0,this.act.abc,!1),t){this.grid=sn.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,this.act.wildTransparent),this.style=new gs(null,this,null);const e=this.createBoxBag("acrossClues"),i=this.createBoxBag("downClues");"AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?i.moveTo(new kt(e.dim.width+this.act.margin,0)):i.moveTo(new kt(0,e.dim.height+this.act.margin)),this.style.addBox(e),this.style.addBox(i),this.grid.setVisible(!0),this.style.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.numLetters=this.act.getMinNumActions(),this.grid.setCellAttributes(!0,!0),this.grid.setCursorEnabled(!0),this.setCursorAt(0,0),this.advance="ADVANCE_RIGHT",this.setBtnStatus(),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.$div.attr("tabindex",0),this.$div.focus(),this.playing=!0)}getCurrentScore(){return this.grid?this.grid.countCoincidences(this.act.checkCase):0}updateContent(t){if(super.updateContent(t),this.grid&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Et(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.style.update(i,t)}return this}setDimension(t){return this.grid&&this.style&&!this.getBounds().equals(t)?gs.layoutDouble(t,this.grid,this.style,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&(this.$canvas.remove(),this.$canvas=null),super.setBounds(t),this.grid&&(this.$canvas=e()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}processEvent(t){if(this.playing)switch(t.type){case"click":const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,s=new kt(e-this.$div.offset().left,i-this.$div.offset().top),n=[];if(this.ps.stopMedia(1),this.grid.contains(s)){const t=this.grid.getLogicalCoords(s);if(null!==t&&(this.setCursorAt(t.x,t.y),vt.TOUCH_DEVICE)){const t="ADVANCE_DOWN"===this.advance,e=window.prompt("".concat(t?"Vertical":"Horizontal"," word:"),"");this.writeChars(e)}}else if(this.hClue.contains(s))this.hClue.playMedia(this.ps,n);else{if(!this.vClue.contains(s))break;this.vClue.playMedia(this.ps,n)}this.update(),n.forEach((t=>t()));break;case"keypress":const r=t.charCode||t.keyCode;r&&this.grid.getCursor()&&(t.preventDefault(),this.writeChars(String.fromCharCode(r)));break;case"keydown":let a=0,o=0;switch(t.keyCode){case vt.VK.RIGHT:a=1;break;case vt.VK.LEFT:a=-1;break;case vt.VK.DOWN:o=1;break;case vt.VK.UP:o=-1}(a||o)&&(t.preventDefault(),this.moveCursor(a,o),this.update())}}moveCursor(t,e){this.grid&&(this.grid.moveCursor(t,e,!0),this.cursorPosChanged())}setCursorAt(t,e){this.grid.setCursorAt(t,e,!0),this.cursorPosChanged()}cursorPosChanged(){const t=this.grid.getCursor();if(null!==t&&null!==this.style){const e=this.grid.getItemFor(t.x,t.y);null!==e&&(this.hClue.setContent(this.act.abc.acrossClues.getActiveBoxContentWith(t.y,e.x)),this.vClue.setContent(this.act.abc.downClues.getActiveBoxContentWith(t.x,e.y)))}}writeChars(t){if(t&&t.length>0)for(let e=0;e<t.length;e++){const i=this.grid.getCursor();let s=t.charAt(e);this.act.upperCase&&(s=s.toLocaleUpperCase()),this.grid.setCharAt(i.x,i.y,s);const n=this.grid.isCellOk(i.x,i.y,this.act.checkCase),r=this.getCurrentScore();this.ps.reportNewAction(this.act,"WRITE",s,"X:".concat(i.x," Y:").concat(i.y),n,r),r===this.numLetters?(this.grid.setCursorEnabled(!1),this.grid.stopCursorBlink(),this.finishActivity(!0)):(this.playEvent("click"),"ADVANCE_DOWN"===this.advance?this.moveCursor(0,1):"ADVANCE_RIGHT"===this.advance&&this.moveCursor(1,0))}this.update()}setBtnStatus(){this.hClueBtn&&this.hClueBtn.setInactive("ADVANCE_RIGHT"!==this.advance),this.vClueBtn&&this.vClueBtn.setInactive("ADVANCE_DOWN"!==this.advance)}}Object.assign(cn.prototype,{LABEL_WIDTH:40,grid:null,style:null,numLetters:0,advance:"NO_ADVANCE",hClue:null,vClue:null,hClueBtn:null,vClueBtn:null,events:["click","keydown","keypress"],hIcon:ot('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),vIcon:ot('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),icoSize:{w:36,h:36},icoBB:(new Ae).set("backColor","#4285F4").set("inactiveColor","#70A2F6").set("dontFill",!0)}),on.Panel=cn;const ln=He.registerClass("@textGrid.CrossWord",on);class hn extends ui{constructor(t){super(t),this.tasks=[]}getProperty(t,e){return null!==this.dbProperties&&this.dbProperties.hasOwnProperty(t)?this.dbProperties[t]:e}addTask(t){this.processingTasks?null===this.waitingTasks?this.waitingTasks=[t]:this.waitingTasks.push(t):this.tasks.push(t)}flushTasksPromise(){if(this.processingTasks||null===this.currentSessionId||0===this.tasks.length||null===this.serviceUrl)return this.processingTasks&&(this.forceFlush=!0),Promise.resolve(!0);{this.processingTasks=!0;const t=new un("multiple");for(let e=0;e<this.tasks.length;e++)t.appendData(this.tasks[e].$bean);return b("debug","Reporting:",t.$bean[0]),new Promise(((e,i)=>{this.transaction(t.$bean).done(((t,i,s)=>{this.failCount=0,this.waitingTasks?(this.tasks=this.waitingTasks,this.waitingTasks=null):(this.forceFlush=!1,this.tasks=[]),this.forceFlush&&this.tasks.length>0?(this.forceFlush=!1,this.processingTasks=!1,this.flushTasksPromise().then((()=>{e(!0)}))):(this.forceFlush=!1,e(!0),this.processingTasks=!1)})).fail(((t,e,s)=>{++this.failCount>this.maxFails&&this.stopReporting().then(),i("Error reporting results to ".concat(this.serviceUrl," [").concat(e," ").concat(s,"]")),this.processingTasks=!1}))}))}}init(t){null==t&&(t=this.ps.options),super.init(t),this.initiated=!1,this.stopReporting(),this.serverPath=t.path||this.DEFAULT_SERVER_PATH,this.descriptionDetail=this.serverPath;let i=t.service||this.DEFAULT_SERVER_SERVICE;Q(i,"/")||(i="/".concat(i));const s=t.protocol||this.DEFAULT_SERVER_PROTOCOL;this.serviceUrl="".concat(s,"://").concat(this.serverPath).concat(i);const n=new un("get_properties");return new Promise(((i,s)=>{this.transaction(n.$bean).done(((n,r,a)=>{this.dbProperties={},e()(n).find("param").each(((t,i)=>{const s=e()(i);this.dbProperties[s.attr("name")]=s.attr("value")})),this.promptUserId(!1).then((e=>{this.userId=e;const s=t.lap||this.getProperty("TIME_LAP",this.DEFAULT_TIMER_LAP);this.timerLap=Math.min(30,Math.max(1,parseInt(s))),this.timer=window.setInterval((()=>this.flushTasksPromise().then()),1e3*this.timerLap),this.beforeUnloadFunction=t=>{if(null!==this.serviceUrl&&(this.tasks.length>0||this.processingTasks)){this.flushTasksPromise().then();const e=m("Please wait until the results of your activities are sent to the reports system");return t&&(t.returnValue=e),e}},window.addEventListener("beforeunload",this.beforeUnloadFunction),this.initiated=!0,i(!0)})).catch((t=>{this.stopReporting(),s("Error getting the user ID: ".concat(t))}))})).fail(((t,e,i)=>{this.stopReporting(),s("Error initializing reports service ".concat(this.serviceUrl," [").concat(e," ").concat(i,"]"))}))}))}newSession(t){super.newSession(t),this.serviceUrl&&null!==this.userId&&(this.currentSessionId=null)}createDBSession(t){return null===this.currentSessionId||t?new Promise(((t,i)=>{this.initiated&&null!==this.userId&&null!==this.currentSession?this.flushTasksPromise().then((()=>{this.currentSessionId=null;const s=new un("add session");s.setParam("project",this.currentSession.projectName),s.setParam("activities",Number(this.currentSession.reportableActs)),s.setParam("time",Number(this.currentSession.started)),s.setParam("code",this.currentSession.code),s.setParam("user",this.userId),s.setParam("key",this.sessionKey),s.setParam("context",this.sessionContext),this.transaction(s.$bean).done(((i,s,n)=>{this.currentSessionId=e()(i).find('param[name="session"]').attr("value"),t(this.currentSessionId)})).fail(((t,e,s)=>{this.stopReporting(),i("Error creating new reports session in ".concat(this.serviceUrl," [").concat(e," ").concat(s,"]"))}))})):i("Unable to start session in remote server!")})):Promise.resolve(this.currentSessionId)}end(){return this.reportActivity(!0),this.stopReporting().then(super.end())}transaction(t){return null===this.serviceUrl?null:e().ajax({method:"POST",url:this.serviceUrl,data:'<?xml version="1.0" encoding="UTF-8"?>'+(new XMLSerializer).serializeToString(t.get(0)).replace("minactions","minActions").replace("reportactions","reportActions"),contentType:"text/xml",dataType:"xml"})}getGroups(){return new Promise(((t,i)=>{if(this.userBased()){const s=new un("get groups");this.transaction(s.$bean).done(((i,s,n)=>{const r=[];e()(i).find("group").each(((t,i)=>{const s=e()(i);r.push({id:s.attr("id"),name:s.attr("name")})})),t(r)})).fail(((t,e,s)=>{i("Error retrieving groups list from ".concat(this.serviceUrl," [").concat(e," ").concat(s,"]"))}))}else i("This system does not manage users!")}))}getUsers(t){return new Promise(((i,s)=>{if(this.userBased()){const n=new un("get users");null!=t&&n.setParam("group",t),this.transaction(n.$bean).done(((t,s,n)=>{const r=[];e()(t).find("user").each(((t,i)=>{const s=e()(i),n={id:s.attr("id"),name:s.attr("name")};s.attr("pwd")&&(n.pwd=s.attr("pwd")),r.push(n)})),i(r)})).fail(((t,e,i)=>{s("Error retrieving users list from ".concat(this.serviceUrl," [").concat(e," ").concat(i,"]"))}))}else s("This system does not manage users!")}))}getUserData(t){return new Promise(((i,s)=>{if(this.userBased()){const n=new un("get user data");null!=t?n.setParam("user",t):s("Invalid user ID"),this.transaction(n.$bean).done(((t,s,n)=>{const r=e()(t).find("user");if(1!==r.length)window.alert(m("Invalid user")),i("Invalid user ID");else{const t={id:r.attr("id"),name:r.attr("name")};r.attr("pwd")&&(t.pwd=r.attr("pwd")),i(t)}})).fail(((t,e,i)=>{s("Error retrieving user data from ".concat(this.serviceUrl," [").concat(e," ").concat(i,"]"))}))}else s("This system does not manage users!")}))}stopReporting(){let t=null;return this.timer>=0&&(window.clearInterval(this.timer),this.timer=-1),this.beforeUnloadFunction&&(window.removeEventListener("beforeunload",this.beforeUnloadFunction),this.beforeUnloadFunction=null),this.initiated&&(t=this.flushTasksPromise().then((()=>{this.serviceUrl=null,this.descriptionDetail="".concat(this.serverPath," (").concat(m("not connected"),")"),this.initiated=!1}))),t||Promise.resolve(!0)}reportActivity(t){if(this.lastActivity){this.lastActivity.closed||this.lastActivity.closeActivity();const e=this.actCount++,i=this.lastActivity;this.createDBSession(!1).then((()=>{const s=new un("add activity");s.setParam("session",this.currentSessionId),s.setParam("num",e),s.appendData(i.$getXML()),this.addTask(s),t&&this.flushTasksPromise().then()}))}null!==this.currentSession&&null!==this.currentSession.currentSequence&&this.currentSession.currentSequence.currentActivity!==this.lastActivity?this.lastActivity=this.currentSession.currentSequence.currentActivity:this.lastActivity=null}newActivity(t){super.newActivity(t),this.reportActivity(!1)}endActivity(t,e,i){super.endActivity(t,e,i),this.reportActivity(!0)}}Object.assign(hn.prototype,{descriptionKey:"Reporting to remote server",descriptionDetail:"(not connected)",serverPath:"",beforeUnloadFunction:null,currentSessionId:"",lastActivity:null,actCount:0,serviceUrl:null,dbProperties:null,tasks:null,waitingTasks:null,processingTasks:!1,forceFlush:!1,timer:-1,timerLap:5,failCount:0,maxFails:5,DEFAULT_SERVER_PATH:"localhost:9000",DEFAULT_SERVER_SERVICE:"/JClicReportService",DEFAULT_SERVER_PROTOCOL:document&&document.location&&"http:"===document.location.protocol?"http":"https",DEFAULT_TIMER_LAP:20});class un{constructor(t,i){this.$bean=e()("<bean/>").attr({id:t}),i&&this.appendData(i)}appendData(t){t&&this.$bean.append(t)}setParam(t,i){null!=i&&this.appendData(e()("<param/>").attr({name:t,value:i}))}}Object.assign(un.prototype,{$bean:null}),hn.ReportBean=un;const dn=ui.registerClass("TCPReporter",hn);class pn extends ui{constructor(t){super(t),this.key="jclic_".concat((new Date).toISOString(),"#").concat(Math.ceil(1e3*Math.random()))}init(t){return null==t&&(t=this.ps.options),"local"===t.storage&&(this.storage=window.localStorage,this.descriptionKey="Reporting to local storage"),ui.prototype.init.call(this,t)}saveCurrentReport(){window.setTimeout((()=>{this.storage.setItem(this.key,JSON.stringify(this.getData()))}),0)}endSequence(){super.endSequence(),this.saveCurrentReport()}endActivity(t,e,i){super.endActivity(t,e,i),this.saveCurrentReport()}}Object.assign(pn.prototype,{storage:window.sessionStorage,descriptionKey:"Reporting to session storage",descriptionDetail:"(browser session)",key:null});const fn=ui.registerClass("SessionStorageReporter",pn);function gn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function mn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?gn(Object(i),!0).forEach((function(e){vn(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):gn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function vn(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const bn={Deps:{DefaultSkin:Ai,OrangeSkin:xi,GreenSkin:Si,BlueSkin:Ei,SimpleSkin:Ii,MiniSkin:_i,EmptySkin:Ri,CustomSkin:Mi,Rectangular:Vi,Holes:ji,JigSaw:qi,TriangularJigSaw:Li,ClassicJigSaw:zi,Arith:Ji,TextActivityBase:Xi,FillInBlanks:is,OrderText:cs,Complete:hs,IdentifyText:ps,WrittenAnswer:Cs,InformationScreen:Ss,Identify:Ps,Explore:_s,Menu:Ds,DoublePuzzle:Vs,ExchangePuzzle:Ls,HolePuzzle:Us,MemoryGame:Ws,SimpleAssociation:Ks,ComplexAssociation:Qs,WordSearch:an,CrossWord:ln,TCPReporter:dn,SessionStorageReporter:fn},JClicPlayer:pi,JClicProject:Ge,AWT:Dt,Utils:bt,$:e(),options:"undefined"==typeof JClicDataOptions?{}:JClicDataOptions,projectFiles:{},currentPlayers:[],loadProject:function(t,i){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s=g(mn(mn({},bn.options),s),!0,!1);let n=null;for(const e of bn.currentPlayers)if(e&&e.$topDiv&&e.$topDiv.get(-1)===t){b("debug","Existing JClicPlayer found in div. I will try to reuse it."),n=e;for(const t of Object.getOwnPropertyNames(s))if(!n.options.hasOwnProperty(t)||n.options[t]!==s[t]){b("debug","Existing JClicPlayer has diferent options! Creating a new one from scratch."),n=null;break}break}n?n.reset():(b("debug","Creating a new instance of JClicPlayer"),n=new pi(e()(t).empty(),s));i&&n.initReporter().then((()=>n.load(i))).catch((i=>{b("error","Unable to start reporting: ".concat(i.toString(),".\n JClicPlayer will be removed.'")),e()(t).empty().removeAttr("style").append(e()("<h2/>").html(n.getMsg("ERROR"))).append(e()("<p/>").html(i));const s=bn.currentPlayers.indexOf(n);s>=0&&bn.currentPlayers.splice(s,1),n=null}));n&&!1!==s.savePlayersRef&&-1===bn.currentPlayers.indexOf(n)&&bn.currentPlayers.push(n);return n}};if("undefined"!=typeof window){window.JClicObject=bn;const t=()=>bn.currentPlayers.forEach((t=>{t&&t.skin&&t.skin.fit()}));e()(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",t),e()(window).on("resize",t)}e()((function(){let t="undefined"==typeof JClicDataOptions?{}:JClicDataOptions;if(bn.options=t,!t.noInit){let i="string"==typeof JClicDataProject?JClicDataProject:"string"==typeof bn.projectFile?bn.projectFile:null;t.browserHistory=1===e()("body>div.JClic").length||t.browserHistory&&1===e()(".JClic").length,e()(".JClic").each(((s,n)=>{const r=e()(n),a=r.data("project");a&&(i=a);const o=r.data("options");o&&(t=e().extend(Object.create(t),o)),bn.loadProject(n,i,t)}))}}))})()})();
|
|
26
|
+
(()=>{var t={924(t){t.exports=function(){function t(e,i,s){function n(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){return n(e[a][1][t]||t)},c,c.exports,t,e,i,s)}return i[a].exports}for(var r=void 0,a=0;a<s.length;a++)n(s[a]);return n}return t}()({1:[function(t,e,i){function s(t){const e=t.createGain(),i=e._voltage=a(t),s=o(i),r=o(i),l=o(i);return e._startAmount=o(r),e._endAmount=o(l),e._multiplier=o(s),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=s.gain,e.startValue=r.gain,e.endValue=l.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,n),e}const n={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(t){const e=this._multiplier.gain,i=this._startAmount.gain,s=this._endAmount.gain;this._voltage.start(t),this._decayFrom=this._decayFrom=t+this.attack,this._startedAt=t;const n=this.sustain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),s.cancelScheduledValues(t),s.setValueAtTime(0,t),this.attack?(e.setValueAtTime(0,t),e.linearRampToValueAtTime(1,t+this.attack),i.setValueAtTime(1,t),i.linearRampToValueAtTime(0,t+this.attack)):(e.setValueAtTime(1,t),i.setValueAtTime(0,t)),this.decay&&e.setTargetAtTime(n,this._decayFrom,l(this.decay))}},stop:{value:function(t,e){e&&(t-=this.release);const i=t+this.release;if(this.release){const e=this._multiplier.gain,i=this._startAmount.gain,s=this._endAmount.gain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),s.cancelScheduledValues(t);const n=l(this.release);if(this.attack&&t<this._decayFrom){const s=c(0,1,this._startedAt,this._decayFrom,t);e.linearRampToValueAtTime(s,t),i.linearRampToValueAtTime(1-s,t),i.setTargetAtTime(0,t,n)}s.setTargetAtTime(1,t,n),e.setTargetAtTime(0,t,n)}return this._voltage.stop(i),i}},onended:{get:function(){return this._voltage.onended},set:function(t){this._voltage.onended=t}}},r=new Float32Array([1,1]);function a(t){const e=t.createBufferSource(),i=t.createBuffer(1,2,t.sampleRate);return i.getChannelData(0).set(r),e.buffer=i,e.loop=!0,e}function o(t){const e=t.context.createGain();return t.connect(e),e}function l(t){return Math.log(t+1)/Math.log(100)}function c(t,e,i,s,n){let r=t+(n-i)/(s-i)*(e-t);return r<=t&&(r=t),r>=e&&(r=e),r}e.exports=s},{}],2:[function(t,e,i){"use strict";function s(t){return t>64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:43===t?62:47===t?63:0}function n(t,e){const i=t.replace(/[^A-Za-z0-9\+\/]/g,""),n=i.length,r=e?Math.ceil((3*n+1>>2)/e)*e:3*n+1>>2,a=new Uint8Array(r);for(let t,e,o=0,l=0,c=0;c<n;c++)if(e=3&c,o|=s(i.charCodeAt(c))<<18-6*e,3===e||n-c===1){for(t=0;t<3&&l<r;t++,l++)a[l]=o>>>(16>>>t&24)&255;o=0}return a}e.exports={decode:n}},{}],3:[function(t,e,i){"use strict";e.exports=function(t,e){return new Promise(function(i,s){const n=new XMLHttpRequest;e&&(n.responseType=e),n.open("GET",t),n.onload=function(){200===n.status&&i(n.response),s(Error(n.statusText))},n.onerror=()=>s(Error("Network Error")),n.send()})}},{}],4:[function(t,e,i){"use strict";const s=t("./base64"),n=t("./fetch");function r(t){return function(e){return"string"==typeof e&&t.test(e)}}function a(t,e){return"string"==typeof t?t+e:"function"==typeof t?t(e):e}function o(t,e,i,s){const n=l(e)?c:h(e)?u:d(e)?p:f(e)?g:m(e)?v:b(e)?y:w(e)?A:C(e)?x:null;return n?n(t,e,i||{}):s?Promise.resolve(s):Promise.reject(`Source not valid (${e})`)}function l(t){return t instanceof ArrayBuffer}function c(t,e,i){return new Promise(function(i,s){t.decodeAudioData(e,function(t){i(t)},function(){s(`Can't decode audio data (${e.slice(0,30)}...)`)})})}o.fetch=n;const h=r(/\.(mp3|wav|ogg)(\?.*)?$/i);function u(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"arraybuffer"),i)}function d(t){return t&&"function"==typeof t.then}function p(t,e,i){return e.then(function(e){return o(t,e,i)})}const f=Array.isArray;function g(t,e,i){return Promise.all(e.map(e=>o(t,e,i,e)))}function m(t){return t&&"object"==typeof t}function v(t,e,i){const s={},n=Object.keys(e).map(function(n){if(i.only&&-1===i.only.indexOf(n))return null;const r=e[n];return o(t,r,i,r).then(t=>{s[n]=t})});return Promise.all(n).then(()=>s)}const b=r(/\.json(\?.*)?$/i);function y(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"text").then(JSON.parse),i)}const w=r(/^data:audio/);function A(t,e,i){const n=e.indexOf(",");return o(t,s.decode(e.slice(n+1)).buffer,i)}const C=r(/\.js(\?.*)?$/i);function x(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"text").then(k),i)}function k(t){let e=t.indexOf("MIDI.Soundfont.");if(e<0)throw Error("Invalid MIDI.js Soundfont format");e=t.indexOf("=",e)+2;const i=t.lastIndexOf(",");return JSON.parse(t.slice(e,i)+"}")}e.exports={load:o}},{"./base64":2,"./fetch":3}],5:[function(t,e,i){const s={VERSION:"2.0.4",NOTES:[],CIRCLE_OF_FOURTHS:["C","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","Bbb","Ebb","Abb"],CIRCLE_OF_FIFTHS:["C","G","D","A","E","B","F#","C#","G#","D#","A#","E#"]},n=[["C"],["C#","Db"],["D"],["D#","Eb"],["E"],["F"],["F#","Gb"],["G"],["G#","Ab"],["A"],["A#","Bb"],["B"]];let r=0;for(let t=-1;t<=9;t++)n.forEach(e=>{e.forEach(e=>s.NOTES[r]=e+t),r++});e.exports.Constants=s},{}],6:[function(t,e,i){const s=t("./player"),n=t("./soundfont-player/index");e.exports={Player:s.Player,Soundfont:n.Soundfont}},{"./player":8,"./soundfont-player/index":14}],7:[function(t,e,i){"use strict";const s=(t,e)=>Array(e+1).join(t),n=t=>"number"==typeof t,r=t=>"string"==typeof t,a=t=>void 0!==t,o=(t,e)=>Math.pow(2,(t-69)/12)*(e||440),l=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function c(){return l}const h=[0,2,4,5,7,9,11];function u(t,e,i){if("string"!=typeof t)return null;const s=l.exec(t);if(!s||!e&&s[4])return null;const n={letter:s[1].toUpperCase(),acc:s[2].replace(/x/g,"##")};n.pc=n.letter+n.acc,n.step=(n.letter.charCodeAt(0)+3)%7,n.alt="b"===n.acc[0]?-n.acc.length:n.acc.length;const r=h[n.step]+n.alt;return n.chroma=r<0?12+r:r%12,s[3]&&(n.oct=+s[3],n.midi=r+12*(n.oct+1),n.freq=o(n.midi,i)),e&&(n.tonicOf=s[4]),n}const d="CDEFGAB",p=t=>n(t)?t<0?s("b",-t):s("#",t):"",f=t=>n(t)?""+t:"";function g(t,e,i){return null==t?null:t.step?g(t.step,t.alt,t.oct):t<0||t>6?null:d.charAt(t)+p(e)+f(i)}function m(t){if((n(t)||r(t))&&t>=0&&t<128)return+t;const e=u(t);return e&&a(e.midi)?e.midi:null}function v(t,e){const i=m(t);return null===i?null:o(i,e)}const b=t=>(u(t)||{}).letter,y=t=>(u(t)||{}).acc,w=t=>(u(t)||{}).pc,A=t=>(u(t)||{}).step,C=t=>(u(t)||{}).alt,x=t=>(u(t)||{}).chroma,k=t=>(u(t)||{}).oct;e.exports={regex:c,parse:u,build:g,midi:m,freq:v,letter:b,acc:y,pc:w,step:A,alt:C,chroma:x,oct:k}},{}],8:[function(t,e,i){const s=t("./utils").Utils,n=t("./track").Track;Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach});class r{constructor(t,e){this.sampleRate=5,this.startTime=0,this.buffer=e||null,this.division,this.format,this.setIntervalId=!1,this.tracks=[],this.instruments=[],this.defaultTempo=120,this.tempo=null,this.startTick=0,this.tick=0,this.lastTick=null,this.inLoop=!1,this.totalTicks=0,this.events=[],this.totalEvents=0,this.eventListeners={},"function"==typeof t&&this.on("midiEvent",t)}loadFile(e){const i=t("fs");return this.buffer=i.readFileSync(e),this.fileLoaded()}loadArrayBuffer(t){return this.buffer=new Uint8Array(t),this.fileLoaded()}loadDataUri(t){const e=window.atob(t.split(",")[1]),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return this.buffer=i,this.fileLoaded()}getFilesize(){return this.buffer?this.buffer.length:0}fileLoaded(){if(!this.validate())throw"Invalid MIDI file; should start with MThd";return this.setTempo(this.defaultTempo).getDivision().getFormat().getTracks().dryRun()}validate(){return"MThd"===s.bytesToLetters(this.buffer.subarray(0,4))}getFormat(){return this.format=s.bytesToNumber(this.buffer.subarray(8,10)),this}getTracks(){this.tracks=[];let t=0;for(;t<this.buffer.length;){if("MTrk"==s.bytesToLetters(this.buffer.subarray(t,t+4))){let e=s.bytesToNumber(this.buffer.subarray(t+4,t+8));this.tracks.push(new n(this.tracks.length,this.buffer.subarray(t+8,t+8+e)))}t+=s.bytesToNumber(this.buffer.subarray(t+4,t+8))+8}return this}enableTrack(t){return this.tracks[t-1].enable(),this}disableTrack(t){return this.tracks[t-1].disable(),this}getDivision(){return this.division=s.bytesToNumber(this.buffer.subarray(12,14)),this}playLoop(t){this.inLoop||(this.inLoop=!0,this.tick=this.getCurrentTick(),this.tracks.forEach(function(e){if(!t&&this.endOfFile())this.triggerPlayerEvent("endOfFile"),this.stop();else{let i=e.handleEvent(this.tick,t);t&&i?(i.hasOwnProperty("name")&&"Set Tempo"===i.name&&this.setTempo(i.data),i.hasOwnProperty("name")&&"Program Change"===i.name&&(this.instruments.includes(i.value)||this.instruments.push(i.value))):i&&this.emitEvent(i)}},this),t||this.triggerPlayerEvent("playing",{tick:this.tick}),this.inLoop=!1)}setTempo(t){return this.tempo=t,this}setStartTime(t){this.startTime=t}play(){if(this.isPlaying())throw"Already playing...";return this.startTime||(this.startTime=(new Date).getTime()),this.setIntervalId=window.setInterval(this.playLoop.bind(this),this.sampleRate),this}pause(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=this.tick,this.startTime=0,this}stop(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=0,this.startTime=0,this.resetTracks(),this}skipToTick(t){return this.stop(),this.startTick=t,this.tracks.forEach(function(e){e.setEventIndexByTick(t)}),this}skipToPercent(t){if(t<0||t>100)throw"Percent must be number between 1 and 100.";return this.skipToTick(Math.round(t/100*this.totalTicks)),this}skipToSeconds(t){const e=this.getSongTime();if(t<0||t>e)throw`${t} seconds not within song time of ${e}`;return this.skipToPercent(t/e*100),this}isPlaying(){return this.setIntervalId>0||"object"==typeof this.setIntervalId}dryRun(){for(this.resetTracks();!this.endOfFile();)this.playLoop(!0);return this.events=this.getEvents(),this.totalEvents=this.getTotalEvents(),this.totalTicks=this.getTotalTicks(),this.startTick=0,this.startTime=0,this.resetTracks(),this.triggerPlayerEvent("fileLoaded",this),this}resetTracks(){return this.tracks.forEach(t=>t.reset()),this}getEvents(){return this.tracks.map(t=>t.events)}getTotalTicks(){return Math.max.apply(null,this.tracks.map(t=>t.delta))}getTotalEvents(){return this.tracks.reduce((t,e)=>({events:{length:t.events.length+e.events.length}}),{events:{length:0}}).events.length}getSongTime(){return this.totalTicks/this.division/this.tempo*60}getSongTimeRemaining(){return Math.round((this.totalTicks-this.tick)/this.division/this.tempo*60)}getSongPercentRemaining(){return Math.round(this.getSongTimeRemaining()/this.getSongTime()*100)}bytesProcessed(){return 14+8*this.tracks.length+this.tracks.reduce((t,e)=>({pointer:t.pointer+e.pointer}),{pointer:0}).pointer}eventsPlayed(){return this.tracks.reduce((t,e)=>({eventIndex:t.eventIndex+e.eventIndex}),{eventIndex:0}).eventIndex}endOfFile(){return this.isPlaying()?this.eventsPlayed()==this.totalEvents:this.bytesProcessed()==this.buffer.length}getCurrentTick(){return Math.round(((new Date).getTime()-this.startTime)/1e3*(this.division*(this.tempo/60)))+this.startTick}emitEvent(t){return this.triggerPlayerEvent("midiEvent",t),this}on(t,e){return this.eventListeners.hasOwnProperty(t)||(this.eventListeners[t]=[]),this.eventListeners[t].push(e),this}triggerPlayerEvent(t,e){return this.eventListeners.hasOwnProperty(t)&&this.eventListeners[t].forEach(t=>t(e||{})),this}}e.exports={Player:r}},{"./track":15,"./utils":16,fs:void 0}],9:[function(t,e,i){function s(t,e){return function(i,s,n,r){t(i,s,n,r),e(i,s,n,r)}}e.exports=function(t){return t.on=function(e,i){if(1===arguments.length&&"function"==typeof e)return t.on("event",e);var n="on"+e,r=t[n];return t[n]=r?s(r,i):i,t},t}},{}],10:[function(t,e,i){"use strict";const s=t("./player"),n=t("./events"),r=t("./notes"),a=t("./scheduler");function o(t,e,i){return a(r(n(s(t,e,i))))}e.exports={SamplePlayer:o}},{"./events":9,"./notes":11,"./player":12,"./scheduler":13}],11:[function(t,e,i){"use strict";var s=t("../note-parser/index"),n=function(t){return null!==t&&t!==[]&&t>=0&&t<129},r=function(t){return n(t)?+t:s.midi(t)};function a(t,e){return Object.keys(t).reduce(function(i,s){return i[e(s)]=t[s],i},{})}e.exports=function(t){if(t.buffers){var e=t.opts.map,i="function"==typeof e?e:r,s=function(t){return t?i(t)||t:null};t.buffers=a(t.buffers,s);var n=t.start;t.start=function(t,e,i){var r=s(t),a=r%1;return a&&(r=Math.floor(r),i=Object.assign(i||{},{cents:Math.floor(100*a)})),n(r,e,i)}}return t}},{"../note-parser/index":7}],12:[function(t,e,i){"use strict";const s=t("../adsr/index"),n={},r={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function a(t,e,i){let s=!1,a=0,o={};const l=t.createGain();l.gain.value=1;const u=Object.assign({},r,i),d={context:t,out:l,opts:u};return e instanceof AudioBuffer?d.buffer=e:d.buffers=e,d.start=function(e,i,r){if(d.buffer&&null!==e)return d.start(null,e,i);var a=e?d.buffers[e]:d.buffer;if(!a)return void console.warn(`Buffer ${e} not found.`);if(!s)return void console.warn("SamplePlayer not connected to any node.");const o=r||n;i=Math.max(t.currentTime,i||0),d.emit("start",i,e,o);var l=f(e,a,o);return l.id=p(e,l),l.env.start(i),l.source.start(i),d.emit("started",i,l.id,l),o.duration&&l.stop(i+o.duration),l},d.play=function(t,e,i){return d.start(t,e,i)},d.stop=function(t,e){return(e=e||Object.keys(o)).map(function(e){const i=o[e];return i?(i.stop(t),i.id):null})},d.connect=function(t){return s=!0,l.connect(t),d},d.emit=function(t,e,i,s){d.onevent&&d.onevent(t,e,i,s);const n=d["on"+t];n&&n(e,i,s)},d;function p(e,i){return i.id=a++,o[i.id]=i,i.source.onended=function(){const e=t.currentTime;i.source.disconnect(),i.env.disconnect(),i.disconnect(),d.emit("ended",e,i.id,i)},i.id}function f(e,i,s){const n=t.createGain();return n.gain.value=0,n.connect(l),n.env=c(t,s,u),n.env.connect(n.gain),n.source=t.createBufferSource(),n.source.buffer=i,n.source.connect(n),n.source.loop=s.loop||u.loop,n.source.playbackRate.value=h(s.cents||u.cents),n.source.loopStart=s.loopStart||u.loopStart,n.source.loopEnd=s.loopEnd||u.loopEnd,n.stop=function(i){const s=i||t.currentTime;d.emit("stop",s,e);const r=n.env.stop(s);n.source.stop(r)},n}}function o(t){return"number"==typeof t}const l=["attack","decay","sustain","release"];function c(t,e,i){const n=s(t),r=e.adsr||i.adsr;return l.forEach(function(t,s){n[t]=r?r[s]:e[t]||i[t]}),n.value.value=o(e.gain)?e.gain:o(i.gain)?i.gain:1,n}function h(t){return t?Math.pow(2,t/1200):1}e.exports=a},{"../adsr/index":1}],13:[function(t,e,i){"use strict";var s=Array.isArray,n=function(t){return t&&"object"==typeof t},r={};e.exports=function(t){return t.schedule=function(e,i){var a,o,l,c,h=t.context.currentTime,u=e<h?h:e;return t.emit("schedule",u,i),i.map(function(e){return e?(s(e)?(a=e[0],o=e[1]):(a=e.time,o=e),n(o)?(l=o.name||o.key||o.note||o.midi||null,c=o):(l=o,c=r),t.start(l,u+(a||0),c)):null})},t}},{}],14:[function(t,e,i){"use strict";const s=t("../audio-loader/index").load,n=t("../sample-player/index").SamplePlayer;function r(t,e,i={}){if(1===arguments.length)return function(e,i){return r(t,e,i)};let l="",c="";if("string"==typeof e){l=e;const t=i.isSoundfontURL||a,s=i.nameToUrl||o;c=t(e)?e:s(e,i.soundfont,i.format),e=c}return s(t,e,{only:i.only||i.notes}).then(e=>{const s=n(t,e,i).connect(i.destination?i.destination:t.destination);return s.url=c,s.name=l,s})}function a(t){return/\.js(\?.*)?$/i.test(t)}function o(t,e,i){return"https://gleitz.github.io/midi-js-soundfonts/"+(e="FluidR3_GM"===e?e:"MusyngKite")+"/"+t+"-"+(i="ogg"===i?i:"mp3")+".js"}const l={instrument:r,nameToUrl:o};e.exports={Soundfont:l}},{"../audio-loader/index":4,"../sample-player/index":10}],15:[function(t,e,i){const s=t("./constants").Constants,n=t("./utils").Utils;class r{constructor(t,e){this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.index=t,this.data=e,this.delta=0,this.runningDelta=0,this.events=[]}reset(){return this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.delta=0,this.runningDelta=0,this}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}setEventIndexByTick(t){t=t||0;for(let e in this.events)if(this.events[e].tick>=t)return this.eventIndex=e,this}getCurrentByte(){return this.data[this.pointer]}getDeltaByteCount(){let t=this.getCurrentByte(),e=1;for(;t>=128;)t=this.data[this.pointer+e],e++;return e}getDelta(){return n.readVarInt(this.data.subarray(this.pointer,this.pointer+this.getDeltaByteCount()))}handleEvent(t,e){if(e=e||!1){const i=t-this.lastTick>=this.getDelta();if(this.pointer<this.data.length&&(e||i)){const t=this.parseEvent();if(this.enabled)return t}}else if(this.events[this.eventIndex]&&this.events[this.eventIndex].tick<=t&&(this.eventIndex++,this.enabled))return this.events[this.eventIndex-1];return null}getStringData(t){const e=1,i=n.readVarInt(this.data.subarray(t+2,t+2+e));return n.bytesToLetters(this.data.subarray(t+e+2,t+e+i+2))}parseEvent(){const t=this.pointer+this.getDeltaByteCount(),e={},i=this.getDeltaByteCount();if(e.track=this.index+1,e.delta=this.getDelta(),this.lastTick=this.lastTick+e.delta,this.runningDelta+=e.delta,e.tick=this.runningDelta,e.byteIndex=this.pointer,255==this.data[t]){switch(this.data[t+1]){case 0:e.name="Sequence Number";break;case 1:e.name="Text Event",e.string=this.getStringData(t);break;case 2:e.name="Copyright Notice";break;case 3:e.name="Sequence/Track Name",e.string=this.getStringData(t);break;case 4:e.name="Instrument Name",e.string=this.getStringData(t);break;case 5:e.name="Lyric",e.string=this.getStringData(t);break;case 6:e.name="Marker";break;case 7:e.name="Cue Point",e.string=this.getStringData(t);break;case 9:e.name="Device Name",e.string=this.getStringData(t);break;case 32:e.name="MIDI Channel Prefix";break;case 33:e.name="MIDI Port",e.data=n.bytesToNumber([this.data[t+3]]);break;case 47:e.name="End of Track";break;case 81:e.name="Set Tempo",e.data=Math.round(6e7/n.bytesToNumber(this.data.subarray(t+3,t+6))),this.tempo=e.data;break;case 84:e.name="SMTPE Offset";break;case 88:e.name="Time Signature",e.data=this.data.subarray(t+3,t+7),e.timeSignature=e.data[0]+"/"+Math.pow(2,e.data[1]);break;case 89:e.name="Key Signature",e.data=this.data.subarray(t+3,t+5),e.data[0]>=0?e.keySignature=s.CIRCLE_OF_FIFTHS[e.data[0]]:e.data[0]<0&&(e.keySignature=s.CIRCLE_OF_FOURTHS[Math.abs(e.data[0])]),0==e.data[1]?e.keySignature+=" Major":1==e.data[1]&&(e.keySignature+=" Minor");break;case 127:e.name="Sequencer-Specific Meta-event";break;default:e.name=`Unknown: ${this.data[t+1].toString(16)}`}const r=this.data[this.pointer+i+2];this.pointer+=i+3+r}else if(240==this.data[t]){e.name="Sysex";const t=this.data[this.pointer+i+1];this.pointer+=i+2+t}else this.data[t]<128?(e.running=!0,e.noteNumber=this.data[t],e.noteName=s.NOTES[this.data[t]],e.velocity=this.data[t+1],this.lastStatus<=143?(e.name="Note off",e.channel=this.lastStatus-128+1):this.lastStatus<=159&&(e.name="Note on",e.channel=this.lastStatus-144+1),this.pointer+=i+2):(this.lastStatus=this.data[t],this.data[t]<=143?(e.name="Note off",e.channel=this.lastStatus-128+1,e.noteNumber=this.data[t+1],e.noteName=s.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=i+3):this.data[t]<=159?(e.name="Note on",e.channel=this.lastStatus-144+1,e.noteNumber=this.data[t+1],e.noteName=s.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=i+3):this.data[t]<=175?(e.name="Polyphonic Key Pressure",e.channel=this.lastStatus-160+1,e.note=s.NOTES[this.data[t+1]],e.pressure=event[2],this.pointer+=i+3):this.data[t]<=191?(e.name="Controller Change",e.channel=this.lastStatus-176+1,e.number=this.data[t+1],e.value=this.data[t+2],this.pointer+=i+3):this.data[t]<=207?(e.name="Program Change",e.channel=this.lastStatus-192+1,e.value=this.data[t+1],this.pointer+=i+2):this.data[t]<=223?(e.name="Channel Key Pressure",e.channel=this.lastStatus-208+1,this.pointer+=i+2):this.data[t]<=239?(e.name="Pitch Bend",e.channel=this.lastStatus-224+1,this.pointer+=i+3):e.name=`Unknown. Pointer: ${this.pointer.toString()} ${t.toString()} ${this.data.length}`);return this.delta+=e.delta,this.events.push(e),e}endOfTrack(){return 255==this.data[this.pointer+1]&&47==this.data[this.pointer+2]&&0==this.data[this.pointer+3]}}e.exports={Track:r}},{"./constants":5,"./utils":16}],16:[function(t,e,i){class s{static byteToHex(t){return`0${t.toString(16)}`.slice(-2)}static bytesToHex(t){const e=[];return t.forEach(t=>e.push(s.byteToHex(t))),e.join("")}static hexToNumber(t){return parseInt(t,16)}static bytesToNumber(t){return s.hexToNumber(s.bytesToHex(t))}static bytesToLetters(t){const e=[];return t.forEach(t=>e.push(String.fromCharCode(t))),e.join("")}static decToBinary(t){return(t>>>0).toString(2)}static readVarInt(t){let e=0;return t.forEach(t=>{128&t?(e+=127&t,e<<=7):e+=t}),e}}e.exports={Utils:s}},{}]},{},[6])(6)},9(t){"use strict";var e={};function i(){try{return new window.XMLHttpRequest}catch(t){}}e._getBinaryFromXHR=function(t){return t.response||t.responseText};var s="undefined"!=typeof window&&window.ActiveXObject?function(){return i()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:i;e.getBinaryContent=function(t,i){var n,r,a,o;i||(i={}),"function"==typeof i?(o=i,i={}):"function"==typeof i.callback&&(o=i.callback),o||"undefined"==typeof Promise?(r=function(t){o(null,t)},a=function(t){o(t,null)}):n=new Promise(function(t,e){r=t,a=e});try{var l=s();l.open("GET",t,!0),"responseType"in l&&(l.responseType="arraybuffer"),l.overrideMimeType&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.onreadystatechange=function(i){if(4===l.readyState)if(200===l.status||0===l.status)try{r(e._getBinaryFromXHR(l))}catch(t){a(new Error(t))}else a(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},i.progress&&(l.onprogress=function(e){i.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),l.send()}catch(t){a(new Error(t),null)}return n},t.exports=e},710(t){t.exports=function t(e,i,s){function n(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){return n(e[a][1][t]||t)},c,c.exports,t,e,i,s)}return i[a].exports}for(var r=void 0,a=0;a<s.length;a++)n(s[a]);return n}({1:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,n,a,o,l,c,h=[],u=0,d=t.length,p=d,f="string"!==s.getTypeOf(t);u<t.length;)p=d-u,n=f?(e=t[u++],i=u<d?t[u++]:0,u<d?t[u++]:0):(e=t.charCodeAt(u++),i=u<d?t.charCodeAt(u++):0,u<d?t.charCodeAt(u++):0),a=e>>2,o=(3&e)<<4|i>>4,l=1<p?(15&i)<<2|n>>6:64,c=2<p?63&n:64,h.push(r.charAt(a)+r.charAt(o)+r.charAt(l)+r.charAt(c));return h.join("")},i.decode=function(t){var e,i,s,a,o,l,c=0,h=0,u="data:";if(t.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var d,p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===r.charAt(64)&&p--,t.charAt(t.length-2)===r.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=n.uint8array?new Uint8Array(0|p):new Array(0|p);c<t.length;)e=r.indexOf(t.charAt(c++))<<2|(a=r.indexOf(t.charAt(c++)))>>4,i=(15&a)<<4|(o=r.indexOf(t.charAt(c++)))>>2,s=(3&o)<<6|(l=r.indexOf(t.charAt(c++))),d[h++]=e,64!==o&&(d[h++]=i),64!==l&&(d[h++]=s);return d}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var s=t("./external"),n=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,i,s,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=s,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new n(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,i){return t.pipe(new r).pipe(new a("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var s=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var s=t("./utils"),n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==s.getTypeOf(t)?function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}(0|e,t,t.length,0):function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length,0):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var s=null;s="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:s}},{lie:37}],7:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),r=t("./utils"),a=t("./stream/GenericWorker"),o=s?"uint8array":"array";function l(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(l,a),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(o,t.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function s(t,e){var i,s="";for(i=0;i<e;i++)s+=String.fromCharCode(255&t),t>>>=8;return s}function n(t,e,i,n,a,h){var u,d,p=t.file,f=t.compression,g=h!==o.utf8encode,m=r.transformTo("string",h(p.name)),v=r.transformTo("string",o.utf8encode(p.name)),b=p.comment,y=r.transformTo("string",h(b)),w=r.transformTo("string",o.utf8encode(b)),A=v.length!==p.name.length,C=w.length!==b.length,x="",k="",S="",T=p.dir,E=p.date,P={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(P.crc32=t.crc32,P.compressedSize=t.compressedSize,P.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),g||!A&&!C||(I|=2048);var B=0,_=0;T&&(B|=16),"UNIX"===a?(_=798,B|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,T)):(_=20,B|=function(t){return 63&(t||0)}(p.dosPermissions)),u=E.getUTCHours(),u<<=6,u|=E.getUTCMinutes(),u<<=5,u|=E.getUTCSeconds()/2,d=E.getUTCFullYear()-1980,d<<=4,d|=E.getUTCMonth()+1,d<<=5,d|=E.getUTCDate(),A&&(k=s(1,1)+s(l(m),4)+v,x+="up"+s(k.length,2)+k),C&&(S=s(1,1)+s(l(y),4)+w,x+="uc"+s(S.length,2)+S);var R="";return R+="\n\0",R+=s(I,2),R+=f.magic,R+=s(u,2),R+=s(d,2),R+=s(P.crc32,4),R+=s(P.compressedSize,4),R+=s(P.uncompressedSize,4),R+=s(m.length,2),R+=s(x.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+m+x,dirRecord:c.CENTRAL_FILE_HEADER+s(_,2)+R+s(y.length,2)+"\0\0\0\0"+s(B,4)+s(n,4)+m+x+y}}var r=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,i,s){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=s,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(h,a),h.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-s-1))/i:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+s(t.crc32,4)+s(t.compressedSize,4)+s(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i=this.bytesWritten-t,n=function(t,e,i,n,a){var o=r.transformTo("string",a(n));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(t,2)+s(t,2)+s(e,4)+s(i,4)+s(o.length,2)+o}(this.dirRecords.length,i,t,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()}),t.on("error",function(t){e.error(t)}),this},h.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(t){var e=this._sources;if(!a.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},h.prototype.lock=function(){a.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){"use strict";var s=t("../compressions"),n=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var r=new n(e.streamFiles,i,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,i){a++;var n=function(t,e){var i=t||e,n=s[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),o=i.options.compressionOptions||e.compressionOptions||{},l=i.dir,c=i.date;i._compressWorker(n,o).withStreamInfo("file",{name:t,dir:l,date:c,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(r)}),r.entriesCount=a}catch(t){r.error(t)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){"use strict";function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new s;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(t,e){return(new s).loadAsync(t,e)},s.external=t("./external"),e.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./external"),r=t("./utf8"),a=t("./zipEntries"),o=t("./stream/Crc32Probe"),l=t("./nodejsUtils");function c(t){return new n.Promise(function(e,i){var s=t.decompressed.getContentWorker().pipe(new o);s.on("error",function(t){i(t)}).on("end",function(){s.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}e.exports=function(t,e){var i=this;return e=s.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),l.isNode&&l.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var i=new a(e);return i.load(t),i}).then(function(t){var i=[n.Promise.resolve(t)],s=t.files;if(e.checkCRC32)for(var r=0;r<s.length;r++)i.push(c(s[r]));return n.Promise.all(i)}).then(function(t){for(var n=t.shift(),r=n.files,a=0;a<r.length;a++){var o=r[a],l=o.fileNameStr,c=s.resolve(o.fileNameStr);i.file(c,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders}),o.dir||(i.file(c).unsafeOriginalName=l)}return n.zipComment.length&&(i.comment=n.zipComment),i})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../stream/GenericWorker");function r(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}s.inherits(r,n),r.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){"use strict";var s=t("readable-stream").Readable;function n(t,e,i){s.call(this,e),this._helper=t;var n=this;t.on("data",function(t,e){n.push(t)||n._helper.pause(),i&&i(e)}).on("error",function(t){n.emit("error",t)}).on("end",function(){n.push(null)})}t("../utils").inherits(n,s),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){"use strict";function s(t,e,i){var s,n=r.getTypeOf(e),o=r.extend(i||{},l);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=g(t)),o.createFolders&&(s=f(t))&&m.call(this,s,!0);var u="string"===n&&!1===o.binary&&!1===o.base64;i&&void 0!==i.binary||(o.binary=!u),(e instanceof c&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",n="string");var v=null;v=e instanceof c||e instanceof a?e:d.isNode&&d.isStream(e)?new p(t,e):r.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var b=new h(t,v,o);this.files[t]=b}var n=t("./utf8"),r=t("./utils"),a=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),l=t("./defaults"),c=t("./compressedObject"),h=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),p=t("./nodejs/NodejsStreamInputAdapter"),f=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},g=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},m=function(t,e){return e=void 0!==e?e:l.createFolders,t=g(t),this.files[t]||s.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function v(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,s;for(e in this.files)s=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,s)},filter:function(t){var e=[];return this.forEach(function(i,s){t(i,s)&&e.push(s)}),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,s.call(this,t,e,i),this;if(v(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}var r=this.files[this.root+t];return r&&!r.dir?r:null},folder:function(t){if(!t)return this;if(v(t))return this.filter(function(e,i){return i.dir&&t.test(e)});var e=this.root+t,i=m.call(this,e),s=this.clone();return s.root=i.name,s},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter(function(e,i){return i.name.slice(0,t.length)===t}),s=0;s<i.length;s++)delete this.files[i[s].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");r.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var s=i.comment||this.comment||"";e=u.generateWorker(this,i,s)}catch(t){(e=new a("error")).error(t)}return new o(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.length-4;0<=r;--r)if(this.data[r]===e&&this.data[r+1]===i&&this.data[r+2]===s&&this.data[r+3]===n)return r-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.readData(4);return e===r[0]&&i===r[1]&&s===r[2]&&n===r[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var s=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return s.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,i){"use strict";var s=t("./Uint8ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var s=t("./ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../support"),r=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=s.getTypeOf(t);return s.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new o(t):n.uint8array?new l(s.transformTo("uint8array",t)):new r(s.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../utils");function r(t){s.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(r,s),r.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../crc32");function r(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,s),r.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}s.inherits(r,n),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=s.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}s.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function s(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.end()}),t.on("error",function(t){e.error(t)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=s},{}],29:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./ConvertWorker"),r=t("./GenericWorker"),a=t("../base64"),o=t("../support"),l=t("../external"),c=null;if(o.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e){return new l.Promise(function(i,n){var r=[],o=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",function(t,i){r.push(t),e&&e(i)}).on("error",function(t){r=[],n(t)}).on("end",function(){try{var t=function(t,e,i){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),i);case"base64":return a.encode(e);default:return s.transformTo(t,e)}}(l,function(t,e){var i,s=0,n=null,r=0;for(i=0;i<e.length;i++)r+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(r),i=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(o,r),c);i(t)}catch(t){n(t)}r=[]}).resume()})}function u(t,e,i){var a=e;switch(e){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=e,this._mimeType=i,s.checkSupport(a),this._worker=t.pipe(new n(a)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}u.prototype={accumulate:function(t){return h(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,function(t){e.call(i,t.data,t.meta)}):this._worker.on(t,function(){s.delay(e,arguments,i)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){"use strict";if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer="undefined"!=typeof Buffer,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=0===new Blob([s],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(s),i.blob=0===n.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){"use strict";for(var s=t("./utils"),n=t("./support"),r=t("./nodejsUtils"),a=t("./stream/GenericWorker"),o=new Array(256),l=0;l<256;l++)o[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function h(){a.call(this,"utf-8 encode")}o[254]=o[254]=1,i.utf8encode=function(t){return n.nodebuffer?r.newBufferFrom(t,"utf-8"):function(t){var e,i,s,r,a,o=t.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=n.uint8array?new Uint8Array(l):new Array(l),r=a=0;a<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e}(t)},i.utf8decode=function(t){return n.nodebuffer?s.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,n,r,a=t.length,l=new Array(2*a);for(e=i=0;e<a;)if((n=t[e++])<128)l[i++]=n;else if(4<(r=o[n]))l[i++]=65533,e+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&e<a;)n=n<<6|63&t[e++],r--;1<r?l[i++]=65533:n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|1023&n)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),s.applyFromCharCode(l)}(t=s.transformTo(n.uint8array?"uint8array":"array",t))},s.inherits(c,a),c.prototype.processChunk=function(t){var e=s.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}(e),l=e;a!==e.length&&(n.uint8array?(l=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(l=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=c,s.inherits(h,a),h.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var s=t("./support"),n=t("./base64"),r=t("./nodejsUtils"),a=t("./external");function o(t){return t}function l(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}t("setimmediate"),i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(t),s.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(t,e,i){var s=[],n=0,r=t.length;if(r<=i)return String.fromCharCode.apply(null,t);for(;n<r;)"array"===e||"nodebuffer"===e?s.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,r)))):s.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,r)))),n+=i;return s.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(t){return!1}}()}};function h(t){var e=65536,s=i.getTypeOf(t),n=!0;if("uint8array"===s?n=c.applyCanBeUsed.uint8array:"nodebuffer"===s&&(n=c.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return c.stringifyByChunk(t,s,e)}catch(t){e=Math.floor(e/2)}return c.stringifyByChar(t)}function u(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=h;var d={};d.string={string:o,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return d.string.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:function(t){return l(t,r.allocBuffer(t.length))}},d.array={string:h,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(t)}},d.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return u(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(new Uint8Array(t))}},d.uint8array={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return r.newBufferFrom(t)}},d.nodebuffer={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return d.nodebuffer.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:o},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var s=i.getTypeOf(e);return d[s][t](e)},i.resolve=function(t){for(var e=t.split("/"),i=[],s=0;s<e.length;s++){var n=e[s];"."===n||""===n&&0!==s&&s!==e.length-1||(".."===n?i.pop():i.push(n))}return i.join("/")},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&r.isBuffer(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!s[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,s="";for(i=0;i<(t||"").length;i++)s+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return s},i.delay=function(t,e,i){setImmediate(function(){t.apply(i||null,e||[])})},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,r,o,c){return a.Promise.resolve(e).then(function(t){return s.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new a.Promise(function(e,i){var s=new FileReader;s.onload=function(t){e(t.target.result)},s.onerror=function(t){i(t.target.error)},s.readAsArrayBuffer(t)}):t}).then(function(e){var h=i.getTypeOf(e);return h?("arraybuffer"===h?e=i.transformTo("uint8array",e):"string"===h&&(c?e=n.decode(e):r&&!0!==o&&(e=function(t){return l(t,s.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):a.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./signature"),a=t("./zipEntry"),o=t("./support");function l(t){this.files=[],this.loadOptions=t}l.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var s=this.reader.readString(4)===e;return this.reader.setIndex(i),s},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=o.uint8array?"uint8array":"array",i=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,s=this.zip64EndOfCentralSize-44;0<s;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var s=e-i;if(0<s)this.isSignature(e,r.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(t){this.reader=s(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./compressedObject"),a=t("./crc32"),o=t("./utf8"),l=t("./compressions"),c=t("./support");function h(t,e){this.options=t,this.loadOptions=e}h.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in l)if(Object.prototype.hasOwnProperty.call(l,e)&&l[e].magic===t)return l[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=s(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,i,s,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),i=t.readInt(2),s=t.readData(i),this.extraFields[e]={id:e,length:i,value:s};t.setIndex(n)},handleUTF8:function(){var t=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var s=this.findExtraFieldUnicodeComment();if(null!==s)this.fileCommentStr=s;else{var r=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=s(t.value);return 1!==e.readInt(1)||a(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=s(t.value);return 1!==e.readInt(1)||a(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null}},e.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){"use strict";function s(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var n=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),a=t("./utf8"),o=t("./compressedObject"),l=t("./stream/GenericWorker");s.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var s="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!s&&(e=e.pipe(new a.Utf8EncodeWorker)),!r&&s&&(e=e.pipe(new a.Utf8DecodeWorker))}catch(t){(e=new l("error")).error(t)}return new n(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof l?this._data:new r(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<c.length;u++)s.prototype[c[u]]=h;e.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,i){(function(t){"use strict";var i,s,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var r=0,a=new n(h),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){h(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(h,0)};else{var l=new t.MessageChannel;l.port1.onmessage=h,i=function(){l.port2.postMessage(0)}}var c=[];function h(){var t,e;s=!0;for(var i=c.length;i;){for(e=c,c=[],t=-1;++t<i;)e[t]();i=c.length}s=!1}e.exports=function(t){1!==c.push(t)||s||i()}}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){"use strict";var s=t("immediate");function n(){}var r={},a=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function u(t,e,i){s(function(){var s;try{s=e(i)}catch(s){return r.reject(t,s)}s===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,s)})}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var i=!1;function s(e){i||(i=!0,r.reject(t,e))}function n(e){i||(i=!0,r.resolve(t,e))}var a=f(function(){e(n,s)});"error"===a.status&&s(a.value)}function f(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=c).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(i){return e.resolve(t()).then(function(){return i})},function(i){return e.resolve(t()).then(function(){throw i})})},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var i=new this.constructor(n);return this.state!==l?u(i,this.state===o?t:e,this.outcome):this.queue.push(new h(i,t,e)),i},h.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){r.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=f(d,e);if("error"===i.status)return r.reject(t,i.value);var s=i.value;if(s)p(t,s);else{t.state=o,t.outcome=e;for(var n=-1,a=t.queue.length;++n<a;)t.queue[n].callFulfilled(e)}return t},r.reject=function(t,e){t.state=a,t.outcome=e;for(var i=-1,s=t.queue.length;++i<s;)t.queue[i].callRejected(e);return t},c.resolve=function(t){return t instanceof this?t:r.resolve(new this(n),t)},c.reject=function(t){var e=new this(n);return r.reject(e,t)},c.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var a=new Array(i),o=0,l=-1,c=new this(n);++l<i;)h(t[l],l);return c;function h(t,n){e.resolve(t).then(function(t){a[n]=t,++o!==i||s||(s=!0,r.resolve(c,a))},function(t){s||(s=!0,r.reject(c,t))})}},c.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var a,o=-1,l=new this(n);++o<i;)a=t[o],e.resolve(a).then(function(t){s||(s=!0,r.resolve(l,t))},function(t){s||(s=!0,r.reject(l,t))});return l}},{immediate:36}],38:[function(t,e,i){"use strict";var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){"use strict";var s=t("./zlib/deflate"),n=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/messages"),o=t("./zlib/zstream"),l=Object.prototype.toString,c=0,h=-1,u=0,d=8;function p(t){if(!(this instanceof p))return new p(t);this.options=n.assign({level:h,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var i=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==c)throw new Error(a[i]);if(e.header&&s.deflateSetHeader(this.strm,e.header),e.dictionary){var f;if(f="string"==typeof e.dictionary?r.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(i=s.deflateSetDictionary(this.strm,f))!==c)throw new Error(a[i]);this._dict_set=!0}}function f(t,e){var i=new p(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}p.prototype.push=function(t,e){var i,a,o=this.strm,h=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=r.string2buf(t):"[object ArrayBuffer]"===l.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new n.Buf8(h),o.next_out=0,o.avail_out=h),1!==(i=s.deflate(o,a))&&i!==c)return this.onEnd(i),!(this.ended=!0);0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(r.buf2binstring(n.shrinkBuf(o.output,o.next_out))):this.onData(n.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==i);return 4===a?(i=s.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===c):2!==a||(this.onEnd(c),!(o.avail_out=0))},p.prototype.onData=function(t){this.chunks.push(t)},p.prototype.onEnd=function(t){t===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=p,i.deflate=f,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,f(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var s=t("./zlib/inflate"),n=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/constants"),o=t("./zlib/messages"),l=t("./zlib/zstream"),c=t("./zlib/gzheader"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&!(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=s.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(o[i]);this.header=new c,s.inflateGetHeader(this.strm,this.header)}function d(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}u.prototype.push=function(t,e){var i,o,l,c,u,d,p=this.strm,f=this.options.chunkSize,g=this.options.dictionary,m=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?p.input=r.binstring2buf(t):"[object ArrayBuffer]"===h.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new n.Buf8(f),p.next_out=0,p.avail_out=f),(i=s.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&g&&(d="string"==typeof g?r.string2buf(g):"[object ArrayBuffer]"===h.call(g)?new Uint8Array(g):g,i=s.inflateSetDictionary(this.strm,d)),i===a.Z_BUF_ERROR&&!0===m&&(i=a.Z_OK,m=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&i!==a.Z_STREAM_END&&(0!==p.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(p.output,p.next_out),c=p.next_out-l,u=r.buf2string(p.output,l),p.next_out=c,p.avail_out=f-c,c&&n.arraySet(p.output,p.output,l,c,0),this.onData(u)):this.onData(n.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((0<p.avail_in||0===p.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(i=s.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(p.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=u,i.inflate=d,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},i.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,s,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+s),n);else for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){var e,i,s,n,r,a;for(e=s=0,i=t.length;e<i;e++)s+=t[e].length;for(a=new Uint8Array(s),e=n=0,i=t.length;e<i;e++)r=t[e],a.set(r,n),n+=r.length;return a}},r={arraySet:function(t,e,i,s,n){for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(s)},{}],42:[function(t,e,i){"use strict";var s=t("./common"),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){r=!1}for(var a=new s.Buf8(256),o=0;o<256;o++)a[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function l(t,e){if(e<65537&&(t.subarray&&r||!t.subarray&&n))return String.fromCharCode.apply(null,s.shrinkBuf(t,e));for(var i="",a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i}a[254]=a[254]=1,i.string2buf=function(t){var e,i,n,r,a,o=t.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=new s.Buf8(l),r=a=0;a<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new s.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,s,n,r,o=e||t.length,c=new Array(2*o);for(i=s=0;i<o;)if((n=t[i++])<128)c[s++]=n;else if(4<(r=a[n]))c[s++]=65533,i+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&i<o;)n=n<<6|63&t[i++],r--;1<r?c[s++]=65533:n<65536?c[s++]=n:(n-=65536,c[s++]=55296|n>>10&1023,c[s++]=56320|1023&n)}return l(c,s)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,s){for(var n=65535&t,r=t>>>16&65535,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;r=r+(n=n+e[s++]|0)|0,--a;);n%=65521,r%=65521}return n|r<<16}},{}],44:[function(t,e,i){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){"use strict";var s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,n){var r=s,a=n+i;t^=-1;for(var o=n;o<a;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}},{}],46:[function(t,e,i){"use strict";var s,n=t("../utils/common"),r=t("./trees"),a=t("./adler32"),o=t("./crc32"),l=t("./messages"),c=0,h=4,u=0,d=-2,p=-1,f=4,g=2,m=8,v=9,b=286,y=30,w=19,A=2*b+1,C=15,x=3,k=258,S=k+x+1,T=42,E=113,P=1,I=2,B=3,_=4;function R(t,e){return t.msg=l[e],e}function O(t){return(t<<1)-(4<t?9:0)}function D(t){for(var e=t.length;0<=--e;)t[e]=0}function M(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function N(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,M(t.strm)}function $(t,e){t.pending_buf[t.pending++]=e}function V(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function q(t,e){var i,s,n=t.max_chain_length,r=t.strstart,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-S?t.strstart-(t.w_size-S):0,c=t.window,h=t.w_mask,u=t.prev,d=t.strstart+k,p=c[r+a-1],f=c[r+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(c[(i=e)+a]===f&&c[i+a-1]===p&&c[i]===c[r]&&c[++i]===c[r+1]){r+=2,i++;do{}while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<d);if(s=k-(d-r),r=d-k,a<s){if(t.match_start=e,o<=(a=s))break;p=c[r+a-1],f=c[r+a]}}}while((e=u[e&h])>l&&0!=--n);return a<=t.lookahead?a:t.lookahead}function j(t){var e,i,s,r,l,c,h,u,d,p,f=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-S)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=i=t.hash_size;s=t.head[--e],t.head[e]=f<=s?s-f:0,--i;);for(e=i=f;s=t.prev[--e],t.prev[e]=f<=s?s-f:0,--i;);r+=f}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=r)<(p=c.avail_in)&&(p=d),i=0===p?0:(c.avail_in-=p,n.arraySet(h,c.input,c.next_in,p,u),1===c.state.wrap?c.adler=a(c.adler,h,p,u):2===c.state.wrap&&(c.adler=o(c.adler,h,p,u)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=x)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+x-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<x)););}while(t.lookahead<S&&0!==t.strm.avail_in)}function L(t,e){for(var i,s;;){if(t.lookahead<S){if(j(t),t.lookahead<S&&e===c)return P;if(0===t.lookahead)break}if(i=0,t.lookahead>=x&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-S&&(t.match_length=q(t,i)),t.match_length>=x)if(s=r._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else s=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(s&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=t.strstart<x-1?t.strstart:x-1,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}function F(t,e){for(var i,s,n;;){if(t.lookahead<S){if(j(t),t.lookahead<S&&e===c)return P;if(0===t.lookahead)break}if(i=0,t.lookahead>=x&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=x-1,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-S&&(t.match_length=q(t,i),t.match_length<=5&&(1===t.strategy||t.match_length===x&&4096<t.strstart-t.match_start)&&(t.match_length=x-1)),t.prev_length>=x&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-x,s=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=x-1,t.strstart++,s&&(N(t,!1),0===t.strm.avail_out))return P}else if(t.match_available){if((s=r._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return P}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(s=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<x-1?t.strstart:x-1,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}function z(t,e,i,s,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=s,this.func=n}function U(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(2*A),this.dyn_dtree=new n.Buf16(2*(2*y+1)),this.bl_tree=new n.Buf16(2*(2*w+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(C+1),this.heap=new n.Buf16(2*b+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*b+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function H(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=g,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?T:E,t.adler=2===e.wrap?0:1,e.last_flush=c,r._tr_init(e),u):R(t,d)}function J(t){var e=H(t);return e===u&&function(t){t.window_size=2*t.w_size,D(t.head),t.max_lazy_match=s[t.level].max_lazy,t.good_match=s[t.level].good_length,t.nice_match=s[t.level].nice_length,t.max_chain_length=s[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=x-1,t.match_available=0,t.ins_h=0}(t.state),e}function W(t,e,i,s,r,a){if(!t)return d;var o=1;if(e===p&&(e=6),s<0?(o=0,s=-s):15<s&&(o=2,s-=16),r<1||v<r||i!==m||s<8||15<s||e<0||9<e||a<0||f<a)return R(t,d);8===s&&(s=9);var l=new U;return(t.state=l).strm=t,l.wrap=o,l.gzhead=null,l.w_bits=s,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+x-1)/x),l.window=new n.Buf8(2*l.w_size),l.head=new n.Buf16(l.hash_size),l.prev=new n.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new n.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=a,l.method=i,J(t)}s=[new z(0,0,0,0,function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(j(t),0===t.lookahead&&e===c)return P;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var s=t.block_start+i;if((0===t.strstart||t.strstart>=s)&&(t.lookahead=t.strstart-s,t.strstart=s,N(t,!1),0===t.strm.avail_out))return P;if(t.strstart-t.block_start>=t.w_size-S&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?B:_):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),P)}),new z(4,4,8,4,L),new z(4,5,16,8,L),new z(4,6,32,32,L),new z(4,4,16,16,F),new z(8,16,32,32,F),new z(8,16,128,128,F),new z(8,32,128,256,F),new z(32,128,258,1024,F),new z(32,258,258,4096,F)],i.deflateInit=function(t,e){return W(t,e,m,15,8,0)},i.deflateInit2=W,i.deflateReset=J,i.deflateResetKeep=H,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?d:(t.state.gzhead=e,u):d},i.deflate=function(t,e){var i,n,a,l;if(!t||!t.state||5<e||e<0)return t?R(t,d):d;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&e!==h)return R(t,0===t.avail_out?-5:d);if(n.strm=t,i=n.last_flush,n.last_flush=e,n.status===T)if(2===n.wrap)t.adler=0,$(n,31),$(n,139),$(n,8),n.gzhead?($(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),$(n,255&n.gzhead.time),$(n,n.gzhead.time>>8&255),$(n,n.gzhead.time>>16&255),$(n,n.gzhead.time>>24&255),$(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),$(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&($(n,255&n.gzhead.extra.length),$(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=o(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):($(n,0),$(n,0),$(n,0),$(n,0),$(n,0),$(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),$(n,3),n.status=E);else{var p=m+(n.w_bits-8<<4)<<8;p|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(p|=32),p+=31-p%31,n.status=E,V(n,p),0!==n.strstart&&(V(n,t.adler>>>16),V(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending!==n.pending_buf_size));)$(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,$(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,$(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&M(t),n.pending+2<=n.pending_buf_size&&($(n,255&t.adler),$(n,t.adler>>8&255),t.adler=0,n.status=E)):n.status=E),0!==n.pending){if(M(t),0===t.avail_out)return n.last_flush=-1,u}else if(0===t.avail_in&&O(e)<=O(i)&&e!==h)return R(t,-5);if(666===n.status&&0!==t.avail_in)return R(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==c&&666!==n.status){var f=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(j(t),0===t.lookahead)){if(e===c)return P;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}(n,e):3===n.strategy?function(t,e){for(var i,s,n,a,o=t.window;;){if(t.lookahead<=k){if(j(t),t.lookahead<=k&&e===c)return P;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0<t.strstart&&(s=o[n=t.strstart-1])===o[++n]&&s===o[++n]&&s===o[++n]){a=t.strstart+k;do{}while(s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&n<a);t.match_length=k-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(i=r._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(N(t,!1),0===t.strm.avail_out))return P}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?B:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?P:I}(n,e):s[n.level].func(n,e);if(f!==B&&f!==_||(n.status=666),f===P||f===B)return 0===t.avail_out&&(n.last_flush=-1),u;if(f===I&&(1===e?r._tr_align(n):5!==e&&(r._tr_stored_block(n,0,0,!1),3===e&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),M(t),0===t.avail_out))return n.last_flush=-1,u}return e!==h?u:n.wrap<=0?1:(2===n.wrap?($(n,255&t.adler),$(n,t.adler>>8&255),$(n,t.adler>>16&255),$(n,t.adler>>24&255),$(n,255&t.total_in),$(n,t.total_in>>8&255),$(n,t.total_in>>16&255),$(n,t.total_in>>24&255)):(V(n,t.adler>>>16),V(n,65535&t.adler)),M(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?u:1)},i.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==T&&69!==e&&73!==e&&91!==e&&103!==e&&e!==E&&666!==e?R(t,d):(t.state=null,e===E?R(t,-3):u):d},i.deflateSetDictionary=function(t,e){var i,s,r,o,l,c,h,p,f=e.length;if(!t||!t.state)return d;if(2===(o=(i=t.state).wrap)||1===o&&i.status!==T||i.lookahead)return d;for(1===o&&(t.adler=a(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===o&&(D(i.head),i.strstart=0,i.block_start=0,i.insert=0),p=new n.Buf8(i.w_size),n.arraySet(p,e,f-i.w_size,i.w_size,0),e=p,f=i.w_size),l=t.avail_in,c=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,j(i);i.lookahead>=x;){for(s=i.strstart,r=i.lookahead-(x-1);i.ins_h=(i.ins_h<<i.hash_shift^i.window[s+x-1])&i.hash_mask,i.prev[s&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=s,s++,--r;);i.strstart=s,i.lookahead=x-1,j(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=x-1,i.match_available=0,t.next_in=c,t.input=h,t.avail_in=l,i.wrap=o,u},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){"use strict";e.exports=function(t,e){var i,s,n,r,a,o,l,c,h,u,d,p,f,g,m,v,b,y,w,A,C,x,k,S,T;i=t.state,s=t.next_in,S=t.input,n=s+(t.avail_in-5),r=t.next_out,T=t.output,a=r-(e-t.avail_out),o=r+(t.avail_out-257),l=i.dmax,c=i.wsize,h=i.whave,u=i.wnext,d=i.window,p=i.hold,f=i.bits,g=i.lencode,m=i.distcode,v=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;t:do{f<15&&(p+=S[s++]<<f,f+=8,p+=S[s++]<<f,f+=8),y=g[p&v];e:for(;;){if(p>>>=w=y>>>24,f-=w,0==(w=y>>>16&255))T[r++]=65535&y;else{if(!(16&w)){if(!(64&w)){y=g[(65535&y)+(p&(1<<w)-1)];continue e}if(32&w){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}A=65535&y,(w&=15)&&(f<w&&(p+=S[s++]<<f,f+=8),A+=p&(1<<w)-1,p>>>=w,f-=w),f<15&&(p+=S[s++]<<f,f+=8,p+=S[s++]<<f,f+=8),y=m[p&b];i:for(;;){if(p>>>=w=y>>>24,f-=w,!(16&(w=y>>>16&255))){if(!(64&w)){y=m[(65535&y)+(p&(1<<w)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(C=65535&y,f<(w&=15)&&(p+=S[s++]<<f,(f+=8)<w&&(p+=S[s++]<<f,f+=8)),l<(C+=p&(1<<w)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,f-=w,(w=r-a)<C){if(h<(w=C-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=d,(x=0)===u){if(x+=c-w,w<A){for(A-=w;T[r++]=d[x++],--w;);x=r-C,k=T}}else if(u<w){if(x+=c+u-w,(w-=u)<A){for(A-=w;T[r++]=d[x++],--w;);if(x=0,u<A){for(A-=w=u;T[r++]=d[x++],--w;);x=r-C,k=T}}}else if(x+=u-w,w<A){for(A-=w;T[r++]=d[x++],--w;);x=r-C,k=T}for(;2<A;)T[r++]=k[x++],T[r++]=k[x++],T[r++]=k[x++],A-=3;A&&(T[r++]=k[x++],1<A&&(T[r++]=k[x++]))}else{for(x=r-C;T[r++]=T[x++],T[r++]=T[x++],T[r++]=T[x++],2<(A-=3););A&&(T[r++]=T[x++],1<A&&(T[r++]=T[x++]))}break}}break}}while(s<n&&r<o);s-=A=f>>3,p&=(1<<(f-=A<<3))-1,t.next_in=s,t.next_out=r,t.avail_in=s<n?n-s+5:5-(s-n),t.avail_out=r<o?o-r+257:257-(r-o),i.hold=p,i.bits=f}},{}],49:[function(t,e,i){"use strict";var s=t("../utils/common"),n=t("./adler32"),r=t("./crc32"),a=t("./inffast"),o=t("./inftrees"),l=1,c=2,h=0,u=-2,d=1,p=852,f=592;function g(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=d,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new s.Buf32(p),e.distcode=e.distdyn=new s.Buf32(f),e.sane=1,e.back=-1,h):u}function b(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,v(t)):u}function y(t,e){var i,s;return t&&t.state?(s=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?u:(null!==s.window&&s.wbits!==e&&(s.window=null),s.wrap=i,s.wbits=e,b(t))):u}function w(t,e){var i,s;return t?(s=new m,(t.state=s).window=null,(i=y(t,e))!==h&&(t.state=null),i):u}var A,C,x=!0;function k(t){if(x){var e;for(A=new s.Buf32(512),C=new s.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(l,t.lens,0,288,A,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(c,t.lens,0,32,C,0,t.work,{bits:5}),x=!1}t.lencode=A,t.lenbits=9,t.distcode=C,t.distbits=5}function S(t,e,i,n){var r,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new s.Buf8(a.wsize)),n>=a.wsize?(s.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n<(r=a.wsize-a.wnext)&&(r=n),s.arraySet(a.window,e,i-n,r,a.wnext),(n-=r)?(s.arraySet(a.window,e,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}i.inflateReset=b,i.inflateReset2=y,i.inflateResetKeep=v,i.inflateInit=function(t){return w(t,15)},i.inflateInit2=w,i.inflate=function(t,e){var i,p,f,m,v,b,y,w,A,C,x,T,E,P,I,B,_,R,O,D,M,N,$,V,q=0,j=new s.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return u;12===(i=t.state).mode&&(i.mode=13),v=t.next_out,f=t.output,y=t.avail_out,m=t.next_in,p=t.input,b=t.avail_in,w=i.hold,A=i.bits,C=b,x=y,N=h;t:for(;;)switch(i.mode){case d:if(0===i.wrap){i.mode=13;break}for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(2&i.wrap&&35615===w){j[i.check=0]=255&w,j[1]=w>>>8&255,i.check=r(i.check,j,2,0),A=w=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&w)<<8)+(w>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&w)){t.msg="unknown compression method",i.mode=30;break}if(A-=4,M=8+(15&(w>>>=4)),0===i.wbits)i.wbits=M;else if(M>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<M,t.adler=i.check=1,i.mode=512&w?10:12,A=w=0;break;case 2:for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(i.flags=w,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=w>>8&1),512&i.flags&&(j[0]=255&w,j[1]=w>>>8&255,i.check=r(i.check,j,2,0)),A=w=0,i.mode=3;case 3:for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.head&&(i.head.time=w),512&i.flags&&(j[0]=255&w,j[1]=w>>>8&255,j[2]=w>>>16&255,j[3]=w>>>24&255,i.check=r(i.check,j,4,0)),A=w=0,i.mode=4;case 4:for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.head&&(i.head.xflags=255&w,i.head.os=w>>8),512&i.flags&&(j[0]=255&w,j[1]=w>>>8&255,i.check=r(i.check,j,2,0)),A=w=0,i.mode=5;case 5:if(1024&i.flags){for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.length=w,i.head&&(i.head.extra_len=w),512&i.flags&&(j[0]=255&w,j[1]=w>>>8&255,i.check=r(i.check,j,2,0)),A=w=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(b<(T=i.length)&&(T=b),T&&(i.head&&(M=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),s.arraySet(i.head.extra,p,m,T,M)),512&i.flags&&(i.check=r(i.check,p,T,m)),b-=T,m+=T,i.length-=T),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break t;for(T=0;M=p[m+T++],i.head&&M&&i.length<65536&&(i.head.name+=String.fromCharCode(M)),M&&T<b;);if(512&i.flags&&(i.check=r(i.check,p,T,m)),b-=T,m+=T,M)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===b)break t;for(T=0;M=p[m+T++],i.head&&M&&i.length<65536&&(i.head.comment+=String.fromCharCode(M)),M&&T<b;);if(512&i.flags&&(i.check=r(i.check,p,T,m)),b-=T,m+=T,M)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}A=w=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}t.adler=i.check=g(w),A=w=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){w>>>=7&A,A-=7&A,i.mode=27;break}for(;A<3;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}switch(i.last=1&w,A-=1,3&(w>>>=1)){case 0:i.mode=14;break;case 1:if(k(i),i.mode=20,6!==e)break;w>>>=2,A-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}w>>>=2,A-=2;break;case 14:for(w>>>=7&A,A-=7&A;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if((65535&w)!=(w>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&w,A=w=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(T=i.length){if(b<T&&(T=b),y<T&&(T=y),0===T)break t;s.arraySet(f,p,m,T,v),b-=T,m+=T,y-=T,v+=T,i.length-=T;break}i.mode=12;break;case 17:for(;A<14;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(i.nlen=257+(31&w),w>>>=5,A-=5,i.ndist=1+(31&w),w>>>=5,A-=5,i.ncode=4+(15&w),w>>>=4,A-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;A<3;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.lens[L[i.have++]]=7&w,w>>>=3,A-=3}for(;i.have<19;)i.lens[L[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,$={bits:i.lenbits},N=o(0,i.lens,0,19,i.lencode,0,i.work,$),i.lenbits=$.bits,N){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;B=(q=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(_<16)w>>>=I,A-=I,i.lens[i.have++]=_;else{if(16===_){for(V=I+2;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w>>>=I,A-=I,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}M=i.lens[i.have-1],T=3+(3&w),w>>>=2,A-=2}else if(17===_){for(V=I+3;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}A-=I,M=0,T=3+(7&(w>>>=I)),w>>>=3,A-=3}else{for(V=I+7;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}A-=I,M=0,T=11+(127&(w>>>=I)),w>>>=7,A-=7}if(i.have+T>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;T--;)i.lens[i.have++]=M}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,$={bits:i.lenbits},N=o(l,i.lens,0,i.nlen,i.lencode,0,i.work,$),i.lenbits=$.bits,N){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,$={bits:i.distbits},N=o(c,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,$),i.distbits=$.bits,N){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=b&&258<=y){t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,a(t,x),v=t.next_out,f=t.output,y=t.avail_out,m=t.next_in,p=t.input,b=t.avail_in,w=i.hold,A=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;B=(q=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(B&&!(240&B)){for(R=I,O=B,D=_;B=(q=i.lencode[D+((w&(1<<R+O)-1)>>R)])>>>16&255,_=65535&q,!(R+(I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}w>>>=R,A-=R,i.back+=R}if(w>>>=I,A-=I,i.back+=I,i.length=_,0===B){i.mode=26;break}if(32&B){i.back=-1,i.mode=12;break}if(64&B){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&B,i.mode=22;case 22:if(i.extra){for(V=i.extra;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.length+=w&(1<<i.extra)-1,w>>>=i.extra,A-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;B=(q=i.distcode[w&(1<<i.distbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(!(240&B)){for(R=I,O=B,D=_;B=(q=i.distcode[D+((w&(1<<R+O)-1)>>R)])>>>16&255,_=65535&q,!(R+(I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}w>>>=R,A-=R,i.back+=R}if(w>>>=I,A-=I,i.back+=I,64&B){t.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&B,i.mode=24;case 24:if(i.extra){for(V=i.extra;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.offset+=w&(1<<i.extra)-1,w>>>=i.extra,A-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===y)break t;if(T=x-y,i.offset>T){if((T=i.offset-T)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}E=T>i.wnext?(T-=i.wnext,i.wsize-T):i.wnext-T,T>i.length&&(T=i.length),P=i.window}else P=f,E=v-i.offset,T=i.length;for(y<T&&(T=y),y-=T,i.length-=T;f[v++]=P[E++],--T;);0===i.length&&(i.mode=21);break;case 26:if(0===y)break t;f[v++]=i.length,y--,i.mode=21;break;case 27:if(i.wrap){for(;A<32;){if(0===b)break t;b--,w|=p[m++]<<A,A+=8}if(x-=y,t.total_out+=x,i.total+=x,x&&(t.adler=i.check=i.flags?r(i.check,f,x,v-x):n(i.check,f,x,v-x)),x=y,(i.flags?w:g(w))!==i.check){t.msg="incorrect data check",i.mode=30;break}A=w=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}A=w=0}i.mode=29;case 29:N=1;break t;case 30:N=-3;break t;case 31:return-4;default:return u}return t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,(i.wsize||x!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&S(t,t.output,t.next_out,x-t.avail_out)?(i.mode=31,-4):(C-=t.avail_in,x-=t.avail_out,t.total_in+=C,t.total_out+=x,i.total+=x,i.wrap&&x&&(t.adler=i.check=i.flags?r(i.check,f,x,t.next_out-x):n(i.check,f,x,t.next_out-x)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==C&&0===x||4===e)&&N===h&&(N=-5),N)},i.inflateEnd=function(t){if(!t||!t.state)return u;var e=t.state;return e.window&&(e.window=null),t.state=null,h},i.inflateGetHeader=function(t,e){var i;return t&&t.state&&2&(i=t.state).wrap?((i.head=e).done=!1,h):u},i.inflateSetDictionary=function(t,e){var i,s=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?u:11===i.mode&&n(1,e,s,0)!==i.check?-3:S(t,e,s,s)?(i.mode=31,-4):(i.havedict=1,h):u},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){"use strict";var s=t("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,l,c,h,u,d){var p,f,g,m,v,b,y,w,A,C=d.bits,x=0,k=0,S=0,T=0,E=0,P=0,I=0,B=0,_=0,R=0,O=null,D=0,M=new s.Buf16(16),N=new s.Buf16(16),$=null,V=0;for(x=0;x<=15;x++)M[x]=0;for(k=0;k<l;k++)M[e[i+k]]++;for(E=C,T=15;1<=T&&0===M[T];T--);if(T<E&&(E=T),0===T)return c[h++]=20971520,c[h++]=20971520,d.bits=1,0;for(S=1;S<T&&0===M[S];S++);for(E<S&&(E=S),x=B=1;x<=15;x++)if(B<<=1,(B-=M[x])<0)return-1;if(0<B&&(0===t||1!==T))return-1;for(N[1]=0,x=1;x<15;x++)N[x+1]=N[x]+M[x];for(k=0;k<l;k++)0!==e[i+k]&&(u[N[e[i+k]]++]=k);if(b=0===t?(O=$=u,19):1===t?(O=n,D-=257,$=r,V-=257,256):(O=a,$=o,-1),x=S,v=h,I=k=R=0,g=-1,m=(_=1<<(P=E))-1,1===t&&852<_||2===t&&592<_)return 1;for(;;){for(y=x-I,A=u[k]<b?(w=0,u[k]):u[k]>b?(w=$[V+u[k]],O[D+u[k]]):(w=96,0),p=1<<x-I,S=f=1<<P;c[v+(R>>I)+(f-=p)]=y<<24|w<<16|A,0!==f;);for(p=1<<x-1;R&p;)p>>=1;if(0!==p?(R&=p-1,R+=p):R=0,k++,0==--M[x]){if(x===T)break;x=e[i+u[k]]}if(E<x&&(R&m)!==g){for(0===I&&(I=E),v+=S,B=1<<(P=x-I);P+I<T&&!((B-=M[P+I])<=0);)P++,B<<=1;if(_+=1<<P,1===t&&852<_||2===t&&592<_)return 1;c[g=R&m]=E<<24|P<<16|v-h}}return 0!==R&&(c[v+R]=x-I<<24|64<<16),d.bits=E,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var s=t("../utils/common"),n=0,r=1;function a(t){for(var e=t.length;0<=--e;)t[e]=0}var o=0,l=29,c=256,h=c+1+l,u=30,d=19,p=2*h+1,f=15,g=16,m=7,v=256,b=16,y=17,w=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],C=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(h+2));a(S);var T=new Array(2*u);a(T);var E=new Array(512);a(E);var P=new Array(256);a(P);var I=new Array(l);a(I);var B,_,R,O=new Array(u);function D(t,e,i,s,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=s,this.max_length=n,this.has_stree=t&&t.length}function M(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function N(t){return t<256?E[t]:E[256+(t>>>7)]}function $(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function V(t,e,i){t.bi_valid>g-i?(t.bi_buf|=e<<t.bi_valid&65535,$(t,t.bi_buf),t.bi_buf=e>>g-t.bi_valid,t.bi_valid+=i-g):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function q(t,e,i){V(t,i[2*e],i[2*e+1])}function j(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function L(t,e,i){var s,n,r=new Array(f+1),a=0;for(s=1;s<=f;s++)r[s]=a=a+i[s-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=j(r[o]++,o))}}function F(t){var e;for(e=0;e<h;e++)t.dyn_ltree[2*e]=0;for(e=0;e<u;e++)t.dyn_dtree[2*e]=0;for(e=0;e<d;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*v]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function z(t){8<t.bi_valid?$(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function U(t,e,i,s){var n=2*e,r=2*i;return t[n]<t[r]||t[n]===t[r]&&s[e]<=s[i]}function H(t,e,i){for(var s=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&U(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!U(e,s,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=s}function J(t,e,i){var s,n,r,a,o=0;if(0!==t.last_lit)for(;s=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],n=t.pending_buf[t.l_buf+o],o++,0===s?q(t,n,e):(q(t,(r=P[n])+c+1,e),0!==(a=A[r])&&V(t,n-=I[r],a),q(t,r=N(--s),i),0!==(a=C[r])&&V(t,s-=O[r],a)),o<t.last_lit;);q(t,v,e)}function W(t,e){var i,s,n,r=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=p,i=0;i<l;i++)0!==r[2*i]?(t.heap[++t.heap_len]=c=i,t.depth[i]=0):r[2*i+1]=0;for(;t.heap_len<2;)r[2*(n=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=a[2*n+1]);for(e.max_code=c,i=t.heap_len>>1;1<=i;i--)H(t,r,i);for(n=l;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],H(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=s,r[2*n]=r[2*i]+r[2*s],t.depth[n]=(t.depth[i]>=t.depth[s]?t.depth[i]:t.depth[s])+1,r[2*i+1]=r[2*s+1]=n,t.heap[1]=n++,H(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,s,n,r,a,o,l=e.dyn_tree,c=e.max_code,h=e.stat_desc.static_tree,u=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,g=e.stat_desc.extra_base,m=e.stat_desc.max_length,v=0;for(r=0;r<=f;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<p;i++)m<(r=l[2*l[2*(s=t.heap[i])+1]+1]+1)&&(r=m,v++),l[2*s+1]=r,c<s||(t.bl_count[r]++,a=0,g<=s&&(a=d[s-g]),o=l[2*s],t.opt_len+=o*(r+a),u&&(t.static_len+=o*(h[2*s+1]+a)));if(0!==v){do{for(r=m-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[m]--,v-=2}while(0<v);for(r=m;0!==r;r--)for(s=t.bl_count[r];0!==s;)c<(n=t.heap[--i])||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),s--)}}(t,e),L(r,c,t.bl_count)}function G(t,e,i){var s,n,r=-1,a=e[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),e[2*(i+1)+1]=65535,s=0;s<=i;s++)n=a,a=e[2*(s+1)+1],++o<l&&n===a||(o<c?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*b]++):o<=10?t.bl_tree[2*y]++:t.bl_tree[2*w]++,r=n,c=(o=0)===a?(l=138,3):n===a?(l=6,3):(l=7,4))}function K(t,e,i){var s,n,r=-1,a=e[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),s=0;s<=i;s++)if(n=a,a=e[2*(s+1)+1],!(++o<l&&n===a)){if(o<c)for(;q(t,n,t.bl_tree),0!=--o;);else 0!==n?(n!==r&&(q(t,n,t.bl_tree),o--),q(t,b,t.bl_tree),V(t,o-3,2)):o<=10?(q(t,y,t.bl_tree),V(t,o-3,3)):(q(t,w,t.bl_tree),V(t,o-11,7));r=n,c=(o=0)===a?(l=138,3):n===a?(l=6,3):(l=7,4)}}a(O);var Z=!1;function Y(t,e,i,n){V(t,(o<<1)+(n?1:0),3),function(t,e,i,n){z(t),n&&($(t,i),$(t,~i)),s.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i,!0)}i._tr_init=function(t){Z||(function(){var t,e,i,s,n,r=new Array(f+1);for(s=i=0;s<l-1;s++)for(I[s]=i,t=0;t<1<<A[s];t++)P[i++]=s;for(P[i-1]=s,s=n=0;s<16;s++)for(O[s]=n,t=0;t<1<<C[s];t++)E[n++]=s;for(n>>=7;s<u;s++)for(O[s]=n<<7,t=0;t<1<<C[s]-7;t++)E[256+n++]=s;for(e=0;e<=f;e++)r[e]=0;for(t=0;t<=143;)S[2*t+1]=8,t++,r[8]++;for(;t<=255;)S[2*t+1]=9,t++,r[9]++;for(;t<=279;)S[2*t+1]=7,t++,r[7]++;for(;t<=287;)S[2*t+1]=8,t++,r[8]++;for(L(S,h+1,r),t=0;t<u;t++)T[2*t+1]=5,T[2*t]=j(t,5);B=new D(S,A,c+1,h,f),_=new D(T,C,0,u,f),R=new D(new Array(0),x,0,d,m)}(),Z=!0),t.l_desc=new M(t.dyn_ltree,B),t.d_desc=new M(t.dyn_dtree,_),t.bl_desc=new M(t.bl_tree,R),t.bi_buf=0,t.bi_valid=0,F(t)},i._tr_stored_block=Y,i._tr_flush_block=function(t,e,i,s){var a,o,l=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return n;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return r;for(e=32;e<c;e++)if(0!==t.dyn_ltree[2*e])return r;return n}(t)),W(t,t.l_desc),W(t,t.d_desc),l=function(t){var e;for(G(t,t.dyn_ltree,t.l_desc.max_code),G(t,t.dyn_dtree,t.d_desc.max_code),W(t,t.bl_desc),e=d-1;3<=e&&0===t.bl_tree[2*k[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),a=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=a&&(a=o)):a=o=i+5,i+4<=a&&-1!==e?Y(t,e,i,s):4===t.strategy||o===a?(V(t,2+(s?1:0),3),J(t,S,T)):(V(t,4+(s?1:0),3),function(t,e,i,s){var n;for(V(t,e-257,5),V(t,i-1,5),V(t,s-4,4),n=0;n<s;n++)V(t,t.bl_tree[2*k[n]+1],3);K(t,t.dyn_ltree,e-1),K(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,l+1),J(t,t.dyn_ltree,t.dyn_dtree)),F(t),s&&z(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(P[i]+c+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){V(t,2,3),q(t,v,S),function(t){16===t.bi_valid?($(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var i,s,n,r,a=1,o={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,i="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick(function(){d(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(s=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,s.removeChild(e),e=null},s.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),s=0;s<e.length;s++)e[s]=arguments[s+1];var n={callback:t,args:e};return o[a]=n,i(a),a++},h.clearImmediate=u}function u(t){delete o[t]}function d(t){if(l)setTimeout(d,0,t);else{var i=o[t];if(i){l=!0;try{!function(t){var i=t.callback,s=t.args;switch(s.length){case 0:i();break;case 1:i(s[0]);break;case 2:i(s[0],s[1]);break;case 3:i(s[0],s[1],s[2]);break;default:i.apply(e,s)}}(i)}finally{u(t),l=!1}}}}function p(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&d(+e.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},371(t,e,i){var s;!function(){function n(t,e,i){return t.call.apply(t.bind,arguments)}function r(t,e,i){if(!t)throw Error();if(2<arguments.length){var s=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,s),t.apply(e,i)}}return function(){return t.apply(e,arguments)}}function a(t,e,i){return(a=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?n:r).apply(null,arguments)}var o=Date.now||function(){return+new Date};function l(t,e){this.a=t,this.o=e||t,this.c=this.o.document}var c=!!window.FontFace;function h(t,e,i,s){if(e=t.c.createElement(e),i)for(var n in i)i.hasOwnProperty(n)&&("style"==n?e.style.cssText=i[n]:e.setAttribute(n,i[n]));return s&&e.appendChild(t.c.createTextNode(s)),e}function u(t,e,i){(t=t.c.getElementsByTagName(e)[0])||(t=document.documentElement),t.insertBefore(i,t.lastChild)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t,e,i){e=e||[],i=i||[];for(var s=t.className.split(/\s+/),n=0;n<e.length;n+=1){for(var r=!1,a=0;a<s.length;a+=1)if(e[n]===s[a]){r=!0;break}r||s.push(e[n])}for(e=[],n=0;n<s.length;n+=1){for(r=!1,a=0;a<i.length;a+=1)if(s[n]===i[a]){r=!0;break}r||e.push(s[n])}t.className=e.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function f(t,e){for(var i=t.className.split(/\s+/),s=0,n=i.length;s<n;s++)if(i[s]==e)return!0;return!1}function g(t,e,i){function s(){o&&n&&r&&(o(a),o=null)}e=h(t,"link",{rel:"stylesheet",href:e,media:"all"});var n=!1,r=!0,a=null,o=i||null;c?(e.onload=function(){n=!0,s()},e.onerror=function(){n=!0,a=Error("Stylesheet failed to load"),s()}):setTimeout(function(){n=!0,s()},0),u(t,"head",e)}function m(t,e,i,s){var n=t.c.getElementsByTagName("head")[0];if(n){var r=h(t,"script",{src:e}),a=!1;return r.onload=r.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,i&&i(null),r.onload=r.onreadystatechange=null,"HEAD"==r.parentNode.tagName&&n.removeChild(r))},n.appendChild(r),setTimeout(function(){a||(a=!0,i&&i(Error("Script load timeout")))},s||5e3),r}return null}function v(){this.a=0,this.c=null}function b(t){return t.a++,function(){t.a--,w(t)}}function y(t,e){t.c=e,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function A(t){this.a=t||"-"}function C(t,e){this.c=t,this.f=4,this.a="n";var i=(e||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function x(t){var e=[];t=t.split(/,\s*/);for(var i=0;i<t.length;i++){var s=t[i].replace(/['"]/g,"");-1!=s.indexOf(" ")||/^\d/.test(s)?e.push("'"+s+"'"):e.push(s)}return e.join(",")}function k(t){return t.a+t.f}function S(t){var e="normal";return"o"===t.a?e="oblique":"i"===t.a&&(e="italic"),e}function T(t){var e=4,i="n",s=null;return t&&((s=t.match(/(normal|oblique|italic)/i))&&s[1]&&(i=s[1].substr(0,1).toLowerCase()),(s=t.match(/([1-9]00|normal|bold)/i))&&s[1]&&(/bold/i.test(s[1])?e=7:/[1-9]00/.test(s[1])&&(e=parseInt(s[1].substr(0,1),10)))),i+e}function E(t,e){this.c=t,this.f=t.o.document.documentElement,this.h=e,this.a=new A("-"),this.j=!1!==e.events,this.g=!1!==e.classes}function P(t){if(t.g){var e=f(t.f,t.a.c("wf","active")),i=[],s=[t.a.c("wf","loading")];e||i.push(t.a.c("wf","inactive")),p(t.f,i,s)}I(t,"inactive")}function I(t,e,i){t.j&&t.h[e]&&(i?t.h[e](i.c,k(i)):t.h[e]())}function B(){this.c={}}function _(t,e){this.c=t,this.f=e,this.a=h(this.c,"span",{"aria-hidden":"true"},this.f)}function R(t){u(t.c,"body",t.a)}function O(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+x(t.c)+";font-style:"+S(t)+";font-weight:"+t.f+"00;"}function D(t,e,i,s,n,r){this.g=t,this.j=e,this.a=s,this.c=i,this.f=n||3e3,this.h=r||void 0}function M(t,e,i,s,n,r,a){this.v=t,this.B=e,this.c=i,this.a=s,this.s=a||"BESbswy",this.f={},this.w=n||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new _(this.c,this.s),this.h=new _(this.c,this.s),this.j=new _(this.c,this.s),this.m=new _(this.c,this.s),t=O(t=new C(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=t,t=O(t=new C(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=t,t=O(t=new C("serif",k(this.a))),this.j.a.style.cssText=t,t=O(t=new C("sans-serif",k(this.a))),this.m.a.style.cssText=t,R(this.g),R(this.h),R(this.j),R(this.m)}A.prototype.c=function(t){for(var e=[],i=0;i<arguments.length;i++)e.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return e.join(this.a)},D.prototype.start=function(){var t=this.c.o.document,e=this,i=o(),s=new Promise(function(s,n){!function r(){o()-i>=e.f?n():t.fonts.load(function(t){return S(t)+" "+t.f+"00 300px "+x(t.c)}(e.a),e.h).then(function(t){1<=t.length?s():setTimeout(r,25)},function(){n()})}()}),n=null,r=new Promise(function(t,i){n=setTimeout(i,e.f)});Promise.race([r,s]).then(function(){n&&(clearTimeout(n),n=null),e.g(e.a)},function(){e.j(e.a)})};var N={D:"serif",C:"sans-serif"},$=null;function V(){if(null===$){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);$=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return $}function q(t,e,i){for(var s in N)if(N.hasOwnProperty(s)&&e===t.f[N[s]]&&i===t.f[N[s]])return!0;return!1}function j(t){var e,i=t.g.a.offsetWidth,s=t.h.a.offsetWidth;(e=i===t.f.serif&&s===t.f["sans-serif"])||(e=V()&&q(t,i,s)),e?o()-t.A>=t.w?V()&&q(t,i,s)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?L(t,t.v):L(t,t.B):function(t){setTimeout(a(function(){j(this)},t),50)}(t):L(t,t.v)}function L(t,e){setTimeout(a(function(){d(this.g.a),d(this.h.a),d(this.j.a),d(this.m.a),e(this.a)},t),0)}function F(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}M.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),j(this)};var z=null;function U(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&p(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),I(t,"active")):P(t.a))}function H(t){this.j=t,this.a=new B,this.h=0,this.f=this.g=!0}function J(t,e,i,s,n){var r=0==--t.h;(t.f||t.g)&&setTimeout(function(){var t=n||null,o=s||{};if(0===i.length&&r)P(e.a);else{e.f+=i.length,r&&(e.j=r);var l,c=[];for(l=0;l<i.length;l++){var h=i[l],u=o[h.c],d=e.a,f=h;if(d.g&&p(d.f,[d.a.c("wf",f.c,k(f).toString(),"loading")]),I(d,"fontloading",f),d=null,null===z)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var g=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);z=f?42<parseInt(f[1],10):!g}else z=!1;d=z?new D(a(e.g,e),a(e.h,e),e.c,h,e.s,u):new M(a(e.g,e),a(e.h,e),e.c,h,e.s,t,u),c.push(d)}for(l=0;l<c.length;l++)c[l].start()}},0)}function W(t,e){this.c=t,this.a=e}function G(t,e){this.c=t,this.a=e}function K(t,e){this.c=t||Z,this.a=[],this.f=[],this.g=e||""}F.prototype.g=function(t){var e=this.a;e.g&&p(e.f,[e.a.c("wf",t.c,k(t).toString(),"active")],[e.a.c("wf",t.c,k(t).toString(),"loading"),e.a.c("wf",t.c,k(t).toString(),"inactive")]),I(e,"fontactive",t),this.m=!0,U(this)},F.prototype.h=function(t){var e=this.a;if(e.g){var i=f(e.f,e.a.c("wf",t.c,k(t).toString(),"active")),s=[],n=[e.a.c("wf",t.c,k(t).toString(),"loading")];i||s.push(e.a.c("wf",t.c,k(t).toString(),"inactive")),p(e.f,s,n)}I(e,"fontinactive",t),U(this)},H.prototype.load=function(t){this.c=new l(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,e,i){var s=[],n=i.timeout;!function(t){t.g&&p(t.f,[t.a.c("wf","loading")]),I(t,"loading")}(e);s=function(t,e,i){var s,n=[];for(s in e)if(e.hasOwnProperty(s)){var r=t.c[s];r&&n.push(r(e[s],i))}return n}(t.a,i,t.c);var r=new F(t.c,e,n);for(t.h=s.length,e=0,i=s.length;e<i;e++)s[e].load(function(e,i,s){J(t,r,e,i,s)})}(this,new E(this.c,t),t)},W.prototype.load=function(t){function e(){if(r["__mti_fntLst"+s]){var i,n=r["__mti_fntLst"+s](),a=[];if(n)for(var o=0;o<n.length;o++){var l=n[o].fontfamily;null!=n[o].fontStyle&&null!=n[o].fontWeight?(i=n[o].fontStyle+n[o].fontWeight,a.push(new C(l,i))):a.push(new C(l))}t(a)}else setTimeout(function(){e()},50)}var i=this,s=i.a.projectId,n=i.a.version;if(s){var r=i.c.o;m(this.c,(i.a.api||"https://fast.fonts.net/jsapi")+"/"+s+".js"+(n?"?v="+n:""),function(n){n?t([]):(r["__MonotypeConfiguration__"+s]=function(){return i.a},e())}).id="__MonotypeAPIScript__"+s}else t([])},G.prototype.load=function(t){var e,i,s=this.a.urls||[],n=this.a.families||[],r=this.a.testStrings||{},a=new v;for(e=0,i=s.length;e<i;e++)g(this.c,s[e],b(a));var o=[];for(e=0,i=n.length;e<i;e++)if((s=n[e].split(":"))[1])for(var l=s[1].split(","),c=0;c<l.length;c+=1)o.push(new C(s[0],l[c]));else o.push(new C(s[0]));y(a,function(){t(o,r)})};var Z="https://fonts.googleapis.com/css";function Y(t){this.f=t,this.a=[],this.c={}}var Q={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},X={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},tt={i:"i",italic:"i",n:"n",normal:"n"},et=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function it(t,e){this.c=t,this.a=e}var st={Arimo:!0,Cousine:!0,Tinos:!0};function nt(t,e){this.c=t,this.a=e}function rt(t,e){this.c=t,this.f=e,this.a=[]}it.prototype.load=function(t){var e=new v,i=this.c,s=new K(this.a.api,this.a.text),n=this.a.families;!function(t,e){for(var i=e.length,s=0;s<i;s++){var n=e[s].split(":");3==n.length&&t.f.push(n.pop());var r="";2==n.length&&""!=n[1]&&(r=":"),t.a.push(n.join(r))}}(s,n);var r=new Y(n);!function(t){for(var e=t.f.length,i=0;i<e;i++){var s=t.f[i].split(":"),n=s[0].replace(/\+/g," "),r=["n4"];if(2<=s.length){var a;if(a=[],o=s[1])for(var o,l=(o=o.split(",")).length,c=0;c<l;c++){var h;if((h=o[c]).match(/^[\w-]+$/))if(null==(u=et.exec(h.toLowerCase())))h="";else{if(h=null==(h=u[2])||""==h?"n":tt[h],null==(u=u[1])||""==u)u="4";else var u=X[u]||(isNaN(u)?"4":u.substr(0,1));h=[h,u].join("")}else h="";h&&a.push(h)}0<a.length&&(r=a),3==s.length&&(a=[],0<(s=(s=s[2])?s.split(","):a).length&&(s=Q[s[0]])&&(t.c[n]=s))}for(t.c[n]||(s=Q[n])&&(t.c[n]=s),s=0;s<r.length;s+=1)t.a.push(new C(n,r[s]))}}(r),g(i,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var e=t.a.length,i=[],s=0;s<e;s++)i.push(t.a[s].replace(/ /g,"+"));return e=t.c+"?family="+i.join("%7C"),0<t.f.length&&(e+="&subset="+t.f.join(",")),0<t.g.length&&(e+="&text="+encodeURIComponent(t.g)),e}(s),b(e)),y(e,function(){t(r.a,r.c,st)})},nt.prototype.load=function(t){var e=this.a.id,i=this.c.o;e?m(this.c,(this.a.api||"https://use.typekit.net")+"/"+e+".js",function(e){if(e)t([]);else if(i.Typekit&&i.Typekit.config&&i.Typekit.config.fn){e=i.Typekit.config.fn;for(var s=[],n=0;n<e.length;n+=2)for(var r=e[n],a=e[n+1],o=0;o<a.length;o++)s.push(new C(r,a[o]));try{i.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}t(s)}},2e3):t([])},rt.prototype.load=function(t){var e=this.f.id,i=this.c.o,s=this;e?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[e]=function(e,i){for(var n=0,r=i.fonts.length;n<r;++n){var a=i.fonts[n];s.a.push(new C(a.name,T("font-weight:"+a.weight+";font-style:"+a.style)))}t(s.a)},m(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+e+".js",function(e){e&&t([])})):t([])};var at=new H(window);at.a.c.custom=function(t,e){return new G(e,t)},at.a.c.fontdeck=function(t,e){return new rt(e,t)},at.a.c.monotype=function(t,e){return new W(e,t)},at.a.c.typekit=function(t,e){return new nt(e,t)},at.a.c.google=function(t,e){return new it(e,t)};var ot={load:a(at.load,at)};void 0===(s=function(){return ot}.call(e,i,e,t))||(t.exports=s)}()}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=function(t,e){if(void 0===t||!t.document)throw new Error("jQuery requires a window with a document");var i=[],s=Object.getPrototypeOf,n=i.slice,r=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},a=i.push,o=i.indexOf,l={},c=l.toString,h=l.hasOwnProperty,u=h.toString,d=u.call(Object),p={};function f(t){return null==t?t+"":"object"==typeof t?l[c.call(t)]||"object":typeof t}function g(t){return null!=t&&t===t.window}function m(t){var e=!!t&&t.length,i=f(t);return"function"!=typeof t&&!g(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}var v=t.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function y(t,e,i){var s,n=(i=i||v).createElement("script");for(s in n.text=t,b)e&&e[s]&&(n[s]=e[s]);i.head.appendChild(n).parentNode&&n.parentNode.removeChild(n)}var w="4.0.0",A=/HTML$/i,C=function(t,e){return new C.fn.init(t,e)};function x(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}C.fn=C.prototype={jquery:w,constructor:C,length:0,toArray:function(){return n.call(this)},get:function(t){return null==t?n.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return C.each(this,t)},map:function(t){return this.pushStack(C.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(n.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(C.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(C.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()}},C.extend=C.fn.extend=function(){var t,e,i,s,n,r,a=arguments[0]||{},o=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[o]||{},o++),"object"!=typeof a&&"function"!=typeof a&&(a={}),o===l&&(a=this,o--);o<l;o++)if(null!=(t=arguments[o]))for(e in t)s=t[e],"__proto__"!==e&&a!==s&&(c&&s&&(C.isPlainObject(s)||(n=Array.isArray(s)))?(i=a[e],r=n&&!Array.isArray(i)?[]:n||C.isPlainObject(i)?i:{},n=!1,a[e]=C.extend(c,r,s)):void 0!==s&&(a[e]=s));return a},C.extend({expando:"jQuery"+(w+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==c.call(t))&&(!(e=s(t))||"function"==typeof(i=h.call(e,"constructor")&&e.constructor)&&u.call(i)===d)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){y(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,s=0;if(m(t))for(i=t.length;s<i&&!1!==e.call(t[s],s,t[s]);s++);else for(s in t)if(!1===e.call(t[s],s,t[s]))break;return t},text:function(t){var e,i="",s=0,n=t.nodeType;if(!n)for(;e=t[s++];)i+=C.text(e);return 1===n||11===n?t.textContent:9===n?t.documentElement.textContent:3===n||4===n?t.nodeValue:i},makeArray:function(t,e){var i=e||[];return null!=t&&(m(Object(t))?C.merge(i,"string"==typeof t?[t]:t):a.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:o.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!A.test(e||i&&i.nodeName||"HTML")},contains:function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))},merge:function(t,e){for(var i=+e.length,s=0,n=t.length;s<i;s++)t[n++]=e[s];return t.length=n,t},grep:function(t,e,i){for(var s=[],n=0,r=t.length,a=!i;n<r;n++)!e(t[n],n)!==a&&s.push(t[n]);return s},map:function(t,e,i){var s,n,a=0,o=[];if(m(t))for(s=t.length;a<s;a++)null!=(n=e(t[a],a,i))&&o.push(n);else for(a in t)null!=(n=e(t[a],a,i))&&o.push(n);return r(o)},guid:1,support:p}),"function"==typeof Symbol&&(C.fn[Symbol.iterator]=i[Symbol.iterator]),C.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){l["[object "+e+"]"]=e.toLowerCase()});var k=i.pop,S="[\\x20\\t\\r\\n\\f]",T=v.documentMode,E=T&&new RegExp(":enabled|:disabled|\\["+S+"*name"+S+"*="+S+"*(?:''|\"\")"),P=new RegExp("^"+S+"+|((?:^|[^\\\\])(?:\\\\.)*)"+S+"+$","g"),I="(?:\\\\[\\da-fA-F]{1,6}"+S+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",B=new RegExp("^"+S+"*([>+~]|"+S+")"+S+"*"),_=new RegExp(S+"|>"),R=/[+~]/,O=v.documentElement,D=O.matches||O.msMatchesSelector;function M(){var t=[];return function e(i,s){return t.push(i+" ")>C.expr.cacheLength&&delete e[t.shift()],e[i+" "]=s}}function N(t){return t&&void 0!==t.getElementsByTagName&&t}var $="\\["+S+"*("+I+")(?:"+S+"*([*^$|!~]?=)"+S+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+S+"*\\]",V=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+$+")*)|.*)\\)|)",q={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+$),PSEUDO:new RegExp("^"+V),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+S+"*(even|odd|(([+-]|)(\\d*)n|)"+S+"*(?:([+-]|)"+S+"*(\\d+)|))"+S+"*\\)|)","i")},j=new RegExp(V),L=new RegExp("\\\\[\\da-fA-F]{1,6}"+S+"?|\\\\([^\\r\\n\\f])","g"),F=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))};function z(t){return t.replace(L,F)}function U(t){C.error("Syntax error, unrecognized expression: "+t)}var H=new RegExp("^"+S+"*,"+S+"*"),J=M();function W(t,e){var i,s,n,r,a,o,l,c=J[t+" "];if(c)return e?0:c.slice(0);for(a=t,o=[],l=C.expr.preFilter;a;){for(r in i&&!(s=H.exec(a))||(s&&(a=a.slice(s[0].length)||a),o.push(n=[])),i=!1,(s=B.exec(a))&&(i=s.shift(),n.push({value:i,type:s[0].replace(P," ")}),a=a.slice(i.length)),q)!(s=C.expr.match[r].exec(a))||l[r]&&!(s=l[r](s))||(i=s.shift(),n.push({value:i,type:r,matches:s}),a=a.slice(i.length));if(!i)break}return e?a.length:a?U(t):J(t,o).slice(0)}var G={ATTR:function(t){return t[1]=z(t[1]),t[3]=z(t[3]||t[4]||t[5]||""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||U(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&U(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return q.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&j.test(i)&&(e=W(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}};function K(t){for(var e=0,i=t.length,s="";e<i;e++)s+=t[e].value;return s}function Z(t,e,i,s,n,r,a){var o=0,l=t.length,c=null==i;if("object"===f(i))for(o in n=!0,i)Z(t,e,o,i[o],!0,r,a);else if(void 0!==s&&(n=!0,"function"!=typeof s&&(a=!0),c&&(a?(e.call(t,s),e=null):(c=e,e=function(t,e,i){return c.call(C(t),i)})),e))for(;o<l;o++)e(t[o],i,a?s:s.call(t[o],o,e(t[o],i)));return n?t:c?e.call(t):l?e(t[0],i):r}var Y=/[^\x20\t\r\n\f]+/g;C.fn.extend({attr:function(t,e){return Z(this,C.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){C.removeAttr(this,t)})}}),C.extend({attr:function(t,e,i){var s,n,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?C.prop(t,e,i):(1===r&&C.isXMLDoc(t)||(n=C.attrHooks[e.toLowerCase()]),void 0!==i?null===i||!1===i&&0!==e.toLowerCase().indexOf("aria-")?void C.removeAttr(t,e):n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:(t.setAttribute(e,i),i):n&&"get"in n&&null!==(s=n.get(t,e))?s:null==(s=t.getAttribute(e))?void 0:s)},attrHooks:{},removeAttr:function(t,e){var i,s=0,n=e&&e.match(Y);if(n&&1===t.nodeType)for(;i=n[s++];)t.removeAttribute(i)}}),T&&(C.attrHooks.type={set:function(t,e){if("radio"===e&&x(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}});var Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function X(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}C.escapeSelector=function(t){return(t+"").replace(Q,X)};var tt,et=i.sort,it=i.splice;function st(t,e){if(t===e)return tt=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)?t==v||t.ownerDocument==v&&C.contains(v,t)?-1:e==v||e.ownerDocument==v&&C.contains(v,e)?1:0:4&i?-1:1)}C.uniqueSort=function(t){var e,i=[],s=0,n=0;if(tt=!1,et.call(t,st),tt){for(;e=t[n++];)e===t[n]&&(s=i.push(n));for(;s--;)it.call(t,i[s],1)}return t},C.fn.uniqueSort=function(){return this.pushStack(C.uniqueSort(n.apply(this)))};var nt,rt,at,ot,lt,ct=0,ht=0,ut=M(),dt=M(),pt=M(),ft=new RegExp(S+"+","g"),gt=new RegExp("^"+I+"$"),mt=C.extend({needsContext:new RegExp("^"+S+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+S+"*((?:-\\d)?\\d*)"+S+"*\\)|)(?=[^-]|$)","i")},q),vt=/^(?:input|select|textarea|button)$/i,bt=/^h\d$/i,yt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=function(){Pt()},At=Bt(function(t){return!0===t.disabled&&x(t,"fieldset")},{dir:"parentNode",next:"legend"});function Ct(t,e,i,s){var n,r,o,l,c,h,u,d=e&&e.ownerDocument,p=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return i;if(!s&&(Pt(e),e=e||at,lt)){if(11!==p&&(c=yt.exec(t)))if(n=c[1]){if(9===p)return(o=e.getElementById(n))&&a.call(i,o),i;if(d&&(o=d.getElementById(n))&&C.contains(e,o))return a.call(i,o),i}else{if(c[2])return a.apply(i,e.getElementsByTagName(t)),i;if((n=c[3])&&e.getElementsByClassName)return a.apply(i,e.getElementsByClassName(n)),i}if(!(pt[t+" "]||E&&E.test(t))){if(u=t,d=e,1===p&&(_.test(t)||B.test(t))){for(((d=R.test(t)&&N(e.parentNode)||e)!=e||T)&&((l=e.getAttribute("id"))?l=C.escapeSelector(l):e.setAttribute("id",l=C.expando)),r=(h=W(t)).length;r--;)h[r]=(l?"#"+l:":scope")+" "+K(h[r]);u=h.join(",")}try{return a.apply(i,d.querySelectorAll(u)),i}catch(e){pt(t,!0)}finally{l===C.expando&&e.removeAttribute("id")}}}return Nt(t.replace(P,"$1"),e,i,s)}function xt(t){return t[C.expando]=!0,t}function kt(t){return function(e){return x(e,"input")&&e.type===t}}function St(t){return function(e){return(x(e,"input")||x(e,"button"))&&e.type===t}}function Tt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&At(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function Et(t){return xt(function(e){return e=+e,xt(function(i,s){for(var n,r=t([],i.length,e),a=r.length;a--;)i[n=r[a]]&&(i[n]=!(s[n]=i[n]))})})}function Pt(t){var e,i=t?t.ownerDocument||t:v;i!=at&&9===i.nodeType&&(ot=(at=i).documentElement,lt=!C.isXMLDoc(at),T&&v!=at&&(e=at.defaultView)&&e.top!==e&&e.addEventListener("unload",wt))}for(nt in Ct.matches=function(t,e){return Ct(t,null,null,e)},Ct.matchesSelector=function(t,e){if(Pt(t),lt&&!pt[e+" "]&&(!E||!E.test(e)))try{return D.call(t,e)}catch(t){pt(e,!0)}return Ct(e,at,null,[t]).length>0},C.expr={cacheLength:50,createPseudo:xt,match:mt,find:{ID:function(t,e){if(void 0!==e.getElementById&<){var i=e.getElementById(t);return i?[i]:[]}},TAG:function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},CLASS:function(t,e){if(void 0!==e.getElementsByClassName&<)return e.getElementsByClassName(t)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:G,filter:{ID:function(t){var e=z(t);return function(t){return t.getAttribute("id")===e}},TAG:function(t){var e=z(t).toLowerCase();return"*"===t?function(){return!0}:function(t){return x(t,e)}},CLASS:function(t){var e=ut[t+" "];return e||(e=new RegExp("(^|"+S+")"+t+"("+S+"|$)"))&&ut(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,i){return function(s){var n=C.attr(s,t);return null==n?"!="===e:!e||(n+="","="===e?n===i:"!="===e?n!==i:"^="===e?i&&0===n.indexOf(i):"*="===e?i&&n.indexOf(i)>-1:"$="===e?i&&n.slice(-i.length)===i:"~="===e?(" "+n.replace(ft," ")+" ").indexOf(i)>-1:"|="===e&&(n===i||n.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,s,n){var r="nth"!==t.slice(0,3),a="last"!==t.slice(-4),o="of-type"===e;return 1===s&&0===n?function(t){return!!t.parentNode}:function(e,i,l){var c,h,u,d,p,f=r!==a?"nextSibling":"previousSibling",g=e.parentNode,m=o&&e.nodeName.toLowerCase(),v=!l&&!o,b=!1;if(g){if(r){for(;f;){for(u=e;u=u[f];)if(o?x(u,m):1===u.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&v){for(b=(d=(c=(h=g[C.expando]||(g[C.expando]={}))[t]||[])[0]===ct&&c[1])&&c[2],u=d&&g.childNodes[d];u=++d&&u&&u[f]||(b=d=0)||p.pop();)if(1===u.nodeType&&++b&&u===e){h[t]=[ct,d,b];break}}else if(v&&(b=d=(c=(h=e[C.expando]||(e[C.expando]={}))[t]||[])[0]===ct&&c[1]),!1===b)for(;(u=++d&&u&&u[f]||(b=d=0)||p.pop())&&(!(o?x(u,m):1===u.nodeType)||!++b||(v&&((h=u[C.expando]||(u[C.expando]={}))[t]=[ct,b]),u!==e)););return(b-=n)===s||b%s===0&&b/s>=0}}},PSEUDO:function(t,e){var i=C.expr.pseudos[t]||C.expr.setFilters[t.toLowerCase()]||U("unsupported pseudo: "+t);return i[C.expando]?i(e):i}},pseudos:{not:xt(function(t){var e=[],i=[],s=Mt(t.replace(P,"$1"));return s[C.expando]?xt(function(t,e,i,n){for(var r,a=s(t,null,n,[]),o=t.length;o--;)(r=a[o])&&(t[o]=!(e[o]=r))}):function(t,n,r){return e[0]=t,s(e,null,r,i),e[0]=null,!i.pop()}}),has:xt(function(t){return function(e){return Ct(t,e).length>0}}),contains:xt(function(t){return t=z(t),function(e){return(e.textContent||C.text(e)).indexOf(t)>-1}}),lang:xt(function(t){return gt.test(t||"")||U("unsupported lang: "+t),t=z(t).toLowerCase(),function(e){var i;do{if(i=lt?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===ot},focus:function(t){return t===at.activeElement&&at.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:Tt(!1),disabled:Tt(!0),checked:function(t){return x(t,"input")&&!!t.checked||x(t,"option")&&!!t.selected},selected:function(t){return T&&t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!C.expr.pseudos.empty(t)},header:function(t){return bt.test(t.nodeName)},input:function(t){return vt.test(t.nodeName)},button:function(t){return x(t,"input")&&"button"===t.type||x(t,"button")},text:function(t){return x(t,"input")&&"text"===t.type},first:Et(function(){return[0]}),last:Et(function(t,e){return[e-1]}),eq:Et(function(t,e,i){return[i<0?i+e:i]}),even:Et(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:Et(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:Et(function(t,e,i){var s;for(s=i<0?i+e:i>e?e:i;--s>=0;)t.push(s);return t}),gt:Et(function(t,e,i){for(var s=i<0?i+e:i;++s<e;)t.push(s);return t})}},C.expr.pseudos.nth=C.expr.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.expr.pseudos[nt]=kt(nt);for(nt in{submit:!0,reset:!0})C.expr.pseudos[nt]=St(nt);function It(){}function Bt(t,e,i){var s=e.dir,n=e.next,r=n||s,a=i&&"parentNode"===r,o=ht++;return e.first?function(e,i,n){for(;e=e[s];)if(1===e.nodeType||a)return t(e,i,n);return!1}:function(e,i,l){var c,h,u=[ct,o];if(l){for(;e=e[s];)if((1===e.nodeType||a)&&t(e,i,l))return!0}else for(;e=e[s];)if(1===e.nodeType||a)if(h=e[C.expando]||(e[C.expando]={}),n&&x(e,n))e=e[s]||e;else{if((c=h[r])&&c[0]===ct&&c[1]===o)return u[2]=c[2];if(h[r]=u,u[2]=t(e,i,l))return!0}return!1}}function _t(t){return t.length>1?function(e,i,s){for(var n=t.length;n--;)if(!t[n](e,i,s))return!1;return!0}:t[0]}function Rt(t,e,i,s,n){for(var r,a=[],o=0,l=t.length,c=null!=e;o<l;o++)(r=t[o])&&(i&&!i(r,s,n)||(a.push(r),c&&e.push(o)));return a}function Ot(t,e,i,s,n,r){return s&&!s[C.expando]&&(s=Ot(s)),n&&!n[C.expando]&&(n=Ot(n,r)),xt(function(r,l,c,h){var u,d,p,f,g=[],m=[],v=l.length,b=r||function(t,e,i){for(var s=0,n=e.length;s<n;s++)Ct(t,e[s],i);return i}(e||"*",c.nodeType?[c]:c,[]),y=!t||!r&&e?b:Rt(b,g,t,c,h);if(i?i(y,f=n||(r?t:v||s)?[]:l,c,h):f=y,s)for(u=Rt(f,m),s(u,[],c,h),d=u.length;d--;)(p=u[d])&&(f[m[d]]=!(y[m[d]]=p));if(r){if(n||t){if(n){for(u=[],d=f.length;d--;)(p=f[d])&&u.push(y[d]=p);n(null,f=[],u,h)}for(d=f.length;d--;)(p=f[d])&&(u=n?o.call(r,p):g[d])>-1&&(r[u]=!(l[u]=p))}}else f=Rt(f===l?f.splice(v,f.length):f),n?n(null,l,f,h):a.apply(l,f)})}function Dt(t){for(var e,i,s,n=t.length,r=C.expr.relative[t[0].type],a=r||C.expr.relative[" "],l=r?1:0,c=Bt(function(t){return t===e},a,!0),h=Bt(function(t){return o.call(e,t)>-1},a,!0),u=[function(t,i,s){var n=!r&&(s||i!=rt)||((e=i).nodeType?c(t,i,s):h(t,i,s));return e=null,n}];l<n;l++)if(i=C.expr.relative[t[l].type])u=[Bt(_t(u),i)];else{if((i=C.expr.filter[t[l].type].apply(null,t[l].matches))[C.expando]){for(s=++l;s<n&&!C.expr.relative[t[s].type];s++);return Ot(l>1&&_t(u),l>1&&K(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(P,"$1"),i,l<s&&Dt(t.slice(l,s)),s<n&&Dt(t=t.slice(s)),s<n&&K(t))}u.push(i)}return _t(u)}function Mt(t,e){var i,s=[],n=[],r=dt[t+" "];if(!r){for(e||(e=W(t)),i=e.length;i--;)(r=Dt(e[i]))[C.expando]?s.push(r):n.push(r);r=dt(t,function(t,e){var i=e.length>0,s=t.length>0,n=function(n,r,o,l,c){var h,u,d,p=0,f="0",g=n&&[],m=[],v=rt,b=n||s&&C.expr.find.TAG("*",c),y=ct+=null==v?1:Math.random()||.1;for(c&&(rt=r==at||r||c);null!=(h=b[f]);f++){if(s&&h){for(u=0,r||h.ownerDocument==at||(Pt(h),o=!lt);d=t[u++];)if(d(h,r||at,o)){a.call(l,h);break}c&&(ct=y)}i&&((h=!d&&h)&&p--,n&&g.push(h))}if(p+=f,i&&f!==p){for(u=0;d=e[u++];)d(g,m,r,o);if(n){if(p>0)for(;f--;)g[f]||m[f]||(m[f]=k.call(l));m=Rt(m)}a.apply(l,m),c&&!n&&m.length>0&&p+e.length>1&&C.uniqueSort(l)}return c&&(ct=y,rt=v),g};return i?xt(n):n}(n,s)),r.selector=t}return r}function Nt(t,e,i,s){var n,r,o,l,c,h="function"==typeof t&&t,u=!s&&W(t=h.selector||t);if(i=i||[],1===u.length){if((r=u[0]=u[0].slice(0)).length>2&&"ID"===(o=r[0]).type&&9===e.nodeType&<&&C.expr.relative[r[1].type]){if(!(e=(C.expr.find.ID(z(o.matches[0]),e)||[])[0]))return i;h&&(e=e.parentNode),t=t.slice(r.shift().value.length)}for(n=mt.needsContext.test(t)?0:r.length;n--&&(o=r[n],!C.expr.relative[l=o.type]);)if((c=C.expr.find[l])&&(s=c(z(o.matches[0]),R.test(r[0].type)&&N(e.parentNode)||e))){if(r.splice(n,1),!(t=s.length&&K(r)))return a.apply(i,s),i;break}}return(h||Mt(t,u))(s,e,!lt,i,!e||R.test(t)&&N(e.parentNode)||e),i}function $t(t,e,i){for(var s=[],n=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(n&&C(t).is(i))break;s.push(t)}return s}function Vt(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}It.prototype=C.expr.pseudos,C.expr.setFilters=new It,Pt(),C.find=Ct,Ct.compile=Mt,Ct.select=Nt,Ct.setDocument=Pt,Ct.tokenize=W;var qt=C.expr.match.needsContext,jt=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function Lt(t){return"<"===t[0]&&">"===t[t.length-1]&&t.length>=3}function Ft(t,e,i){return"function"==typeof e?C.grep(t,function(t,s){return!!e.call(t,s,t)!==i}):e.nodeType?C.grep(t,function(t){return t===e!==i}):"string"!=typeof e?C.grep(t,function(t){return o.call(e,t)>-1!==i}):C.filter(e,t,i)}C.filter=function(t,e,i){var s=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===s.nodeType?C.find.matchesSelector(s,t)?[s]:[]:C.find.matches(t,C.grep(e,function(t){return 1===t.nodeType}))},C.fn.extend({find:function(t){var e,i,s=this.length,n=this;if("string"!=typeof t)return this.pushStack(C(t).filter(function(){for(e=0;e<s;e++)if(C.contains(n[e],this))return!0}));for(i=this.pushStack([]),e=0;e<s;e++)C.find(t,n[e],i);return s>1?C.uniqueSort(i):i},filter:function(t){return this.pushStack(Ft(this,t||[],!1))},not:function(t){return this.pushStack(Ft(this,t||[],!0))},is:function(t){return!!Ft(this,"string"==typeof t&&qt.test(t)?C(t):t||[],!1).length}});var zt,Ut=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(t,e){var i,s;if(!t)return this;if(t.nodeType)return this[0]=t,this.length=1,this;if("function"==typeof t)return void 0!==zt.ready?zt.ready(t):t(C);if(Lt(i=t+""))i=[null,t,null];else{if("string"!=typeof t)return C.makeArray(t,this);i=Ut.exec(t)}if(!i||!i[1]&&e)return!e||e.jquery?(e||zt).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:v,!0)),jt.test(i[1])&&C.isPlainObject(e))for(i in e)"function"==typeof this[i]?this[i](e[i]):this.attr(i,e[i]);return this}return(s=v.getElementById(i[2]))&&(this[0]=s,this.length=1),this}).prototype=C.fn,zt=C(v);var Ht=/^(?:parents|prev(?:Until|All))/,Jt={children:!0,contents:!0,next:!0,prev:!0};function Wt(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function Gt(t){return t}function Kt(t){throw t}function Zt(t,e,i,s){var n;try{t&&"function"==typeof(n=t.promise)?n.call(t).done(e).fail(i):t&&"function"==typeof(n=t.then)?n.call(t,e,i):e.apply(void 0,[t].slice(s))}catch(t){i(t)}}C.fn.extend({has:function(t){var e=C(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(C.contains(this,e[t]))return!0})},closest:function(t,e){var i,s=0,n=this.length,r=[],a="string"!=typeof t&&C(t);if(!qt.test(t))for(;s<n;s++)for(i=this[s];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&C.find.matchesSelector(i,t))){r.push(i);break}return this.pushStack(r.length>1?C.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?o.call(C(t),this[0]):o.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),C.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return $t(t,"parentNode")},parentsUntil:function(t,e,i){return $t(t,"parentNode",i)},next:function(t){return Wt(t,"nextSibling")},prev:function(t){return Wt(t,"previousSibling")},nextAll:function(t){return $t(t,"nextSibling")},prevAll:function(t){return $t(t,"previousSibling")},nextUntil:function(t,e,i){return $t(t,"nextSibling",i)},prevUntil:function(t,e,i){return $t(t,"previousSibling",i)},siblings:function(t){return Vt((t.parentNode||{}).firstChild,t)},children:function(t){return Vt(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(x(t,"template")&&(t=t.content||t),C.merge([],t.childNodes))}},function(t,e){C.fn[t]=function(i,s){var n=C.map(this,e,i);return"Until"!==t.slice(-5)&&(s=i),s&&"string"==typeof s&&(n=C.filter(s,n)),this.length>1&&(Jt[t]||C.uniqueSort(n),Ht.test(t)&&n.reverse()),this.pushStack(n)}}),C.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return C.each(t.match(Y)||[],function(t,i){e[i]=!0}),e}(t):C.extend({},t);var e,i,s,n,r=[],a=[],o=-1,l=function(){for(n=n||t.once,s=e=!0;a.length;o=-1)for(i=a.shift();++o<r.length;)!1===r[o].apply(i[0],i[1])&&t.stopOnFalse&&(o=r.length,i=!1);t.memory||(i=!1),e=!1,n&&(r=i?[]:"")},c={add:function(){return r&&(i&&!e&&(o=r.length-1,a.push(i)),function e(i){C.each(i,function(i,s){"function"==typeof s?t.unique&&c.has(s)||r.push(s):s&&s.length&&"string"!==f(s)&&e(s)})}(arguments),i&&!e&&l()),this},remove:function(){return C.each(arguments,function(t,e){for(var i;(i=C.inArray(e,r,i))>-1;)r.splice(i,1),i<=o&&o--}),this},has:function(t){return t?C.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return n=a=[],r=i="",this},disabled:function(){return!r},lock:function(){return n=a=[],i||e||(r=i=""),this},locked:function(){return!!n},fireWith:function(t,i){return n||(i=[t,(i=i||[]).slice?i.slice():i],a.push(i),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!s}};return c},C.extend({Deferred:function(e){var i=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],s="pending",n={state:function(){return s},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return n.then(null,t)},pipe:function(){var t=arguments;return C.Deferred(function(e){C.each(i,function(i,s){var n="function"==typeof t[s[4]]&&t[s[4]];r[s[1]](function(){var t=n&&n.apply(this,arguments);t&&"function"==typeof t.promise?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[s[0]+"With"](this,n?[t]:arguments)})}),t=null}).promise()},then:function(e,s,n){var r=0;function a(e,i,s,n){return function(){var o=this,l=arguments,c=function(){var t,c;if(!(e<r)){if((t=s.apply(o,l))===i.promise())throw new TypeError("Thenable self-resolution");"function"==typeof(c=t&&("object"==typeof t||"function"==typeof t)&&t.then)?n?c.call(t,a(r,i,Gt,n),a(r,i,Kt,n)):(r++,c.call(t,a(r,i,Gt,n),a(r,i,Kt,n),a(r,i,Gt,i.notifyWith))):(s!==Gt&&(o=void 0,l=[t]),(n||i.resolveWith)(o,l))}},h=n?c:function(){try{c()}catch(t){C.Deferred.exceptionHook&&C.Deferred.exceptionHook(t,h.error),e+1>=r&&(s!==Kt&&(o=void 0,l=[t]),i.rejectWith(o,l))}};e?h():(C.Deferred.getErrorHook&&(h.error=C.Deferred.getErrorHook()),t.setTimeout(h))}}return C.Deferred(function(t){i[0][3].add(a(0,t,"function"==typeof n?n:Gt,t.notifyWith)),i[1][3].add(a(0,t,"function"==typeof e?e:Gt)),i[2][3].add(a(0,t,"function"==typeof s?s:Kt))}).promise()},promise:function(t){return null!=t?C.extend(t,n):n}},r={};return C.each(i,function(t,e){var a=e[2],o=e[5];n[e[1]]=a.add,o&&a.add(function(){s=o},i[3-t][2].disable,i[3-t][3].disable,i[0][2].lock,i[0][3].lock),a.add(e[3].fire),r[e[0]]=function(){return r[e[0]+"With"](this===r?void 0:this,arguments),this},r[e[0]+"With"]=a.fireWith}),n.promise(r),e&&e.call(r,r),r},when:function(t){var e=arguments.length,i=e,s=Array(i),r=n.call(arguments),a=C.Deferred(),o=function(t){return function(i){s[t]=this,r[t]=arguments.length>1?n.call(arguments):i,--e||a.resolveWith(s,r)}};if(e<=1&&(Zt(t,a.done(o(i)).resolve,a.reject,!e),"pending"===a.state()||"function"==typeof(r[i]&&r[i].then)))return a.then();for(;i--;)Zt(r[i],o(i),a.reject);return a.promise()}});var Yt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(e,i){e&&Yt.test(e.name)&&t.console.warn("jQuery.Deferred exception",e,i)},C.readyException=function(e){t.setTimeout(function(){throw e})};var Qt=C.Deferred();function Xt(){v.removeEventListener("DOMContentLoaded",Xt),t.removeEventListener("load",Xt),C.ready()}C.fn.ready=function(t){return Qt.then(t).catch(function(t){C.readyException(t)}),this},C.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==t&&--C.readyWait>0||Qt.resolveWith(v,[C]))}}),C.ready.then=Qt.then,"loading"!==v.readyState?t.setTimeout(C.ready):(v.addEventListener("DOMContentLoaded",Xt),t.addEventListener("load",Xt));var te=/-([a-z])/g;function ee(t,e){return e.toUpperCase()}function ie(t){return t.replace(te,ee)}function se(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType}function ne(){this.expando=C.expando+ne.uid++}ne.uid=1,ne.prototype={cache:function(t){var e=t[this.expando];return e||(e=Object.create(null),se(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var s,n=this.cache(t);if("string"==typeof e)n[ie(e)]=i;else for(s in e)n[ie(s)]=e[s];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][ie(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,s=t[this.expando];if(void 0!==s){if(void 0!==e){i=(e=Array.isArray(e)?e.map(ie):(e=ie(e))in s?[e]:e.match(Y)||[]).length;for(;i--;)delete s[e[i]]}(void 0===e||C.isEmptyObject(s))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!C.isEmptyObject(e)}};var re=new ne,ae=new ne,oe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,le=/[A-Z]/g;function ce(t,e,i){var s;if(void 0===i&&1===t.nodeType)if(s="data-"+e.replace(le,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(s))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:oe.test(t)?JSON.parse(t):t)}(i)}catch(t){}ae.set(t,e,i)}else i=void 0;return i}C.extend({hasData:function(t){return ae.hasData(t)||re.hasData(t)},data:function(t,e,i){return ae.access(t,e,i)},removeData:function(t,e){ae.remove(t,e)},_data:function(t,e,i){return re.access(t,e,i)},_removeData:function(t,e){re.remove(t,e)}}),C.fn.extend({data:function(t,e){var i,s,n,r=this[0],a=r&&r.attributes;if(void 0===t){if(this.length&&(n=ae.get(r),1===r.nodeType&&!re.get(r,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&0===(s=a[i].name).indexOf("data-")&&(s=ie(s.slice(5)),ce(r,s,n[s]));re.set(r,"hasDataAttrs",!0)}return n}return"object"==typeof t?this.each(function(){ae.set(this,t)}):Z(this,function(e){var i;if(r&&void 0===e)return void 0!==(i=ae.get(r,t))||void 0!==(i=ce(r,t))?i:void 0;this.each(function(){ae.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){ae.remove(this,t)})}}),C.extend({queue:function(t,e,i){var s;if(t)return e=(e||"fx")+"queue",s=re.get(t,e),i&&(!s||Array.isArray(i)?s=re.set(t,e,C.makeArray(i)):s.push(i)),s||[]},dequeue:function(t,e){e=e||"fx";var i=C.queue(t,e),s=i.length,n=i.shift(),r=C._queueHooks(t,e);"inprogress"===n&&(n=i.shift(),s--),n&&("fx"===e&&i.unshift("inprogress"),delete r.stop,n.call(t,function(){C.dequeue(t,e)},r)),!s&&r&&r.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return re.get(t,i)||re.set(t,i,{empty:C.Callbacks("once memory").add(function(){re.remove(t,[e+"queue",i])})})}}),C.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?C.queue(this[0],t):void 0===e?this:this.each(function(){var i=C.queue(this,t,e);C._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&C.dequeue(this,t)})},dequeue:function(t){return this.each(function(){C.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,s=1,n=C.Deferred(),r=this,a=this.length,o=function(){--s||n.resolveWith(r,[r])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=re.get(r[a],t+"queueHooks"))&&i.empty&&(s++,i.empty.add(o));return o(),n.promise(e)}});var he=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ue=new RegExp("^(?:([+-])=|)("+he+")([a-z%]*)$","i"),de=["Top","Right","Bottom","Left"];function pe(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&"none"===C.css(t,"display")}var fe=/^[a-z]/,ge=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;function me(t){return fe.test(t)&&ge.test(t[0].toUpperCase()+t.slice(1))}function ve(t,e,i,s){var n,r,a=20,o=s?function(){return s.cur()}:function(){return C.css(t,e,"")},l=o(),c=i&&i[3]||(me(e)?"px":""),h=t.nodeType&&(!me(e)||"px"!==c&&+l)&&ue.exec(C.css(t,e));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;a--;)C.style(t,e,h+c),(1-r)*(1-(r=o()/l||.5))<=0&&(a=0),h/=r;h*=2,C.style(t,e,h+c),i=i||[]}return i&&(h=+h||+l||0,n=i[1]?h+(i[1]+1)*i[2]:+i[2],s&&(s.unit=c,s.start=h,s.end=n)),n}var be=/^-ms-/;function ye(t){return ie(t.replace(be,"ms-"))}var we={};function Ae(t){var e,i=t.ownerDocument,s=t.nodeName,n=we[s];return n||(e=i.body.appendChild(i.createElement(s)),n=C.css(e,"display"),e.parentNode.removeChild(e),"none"===n&&(n="block"),we[s]=n,n)}function Ce(t,e){for(var i,s,n=[],r=0,a=t.length;r<a;r++)(s=t[r]).style&&(i=s.style.display,e?("none"===i&&(n[r]=re.get(s,"display")||null,n[r]||(s.style.display="")),""===s.style.display&&pe(s)&&(n[r]=Ae(s))):"none"!==i&&(n[r]="none",re.set(s,"display",i)));for(r=0;r<a;r++)null!=n[r]&&(t[r].style.display=n[r]);return t}C.fn.extend({show:function(){return Ce(this,!0)},hide:function(){return Ce(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){pe(this)?C(this).show():C(this).hide()})}});var xe=function(t){return C.contains(t.ownerDocument,t)||t.getRootNode(ke)===t.ownerDocument},ke={composed:!0};O.getRootNode||(xe=function(t){return C.contains(t.ownerDocument,t)});var Se=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Te={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr","tbody","table"]};function Ee(t,e){var s;return s=void 0!==t.getElementsByTagName?i.slice.call(t.getElementsByTagName(e||"*")):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&x(t,e)?C.merge([t],s):s}Te.tbody=Te.tfoot=Te.colgroup=Te.caption=Te.thead,Te.th=Te.td;var Pe=/^$|^module$|\/(?:java|ecma)script/i;function Ie(t,e){for(var i=0,s=t.length;i<s;i++)re.set(t[i],"globalEval",!e||re.get(e[i],"globalEval"))}var Be=/<|&#?\w+;/;function _e(t,e,s,n,r){for(var a,o,l,c,h,u,d=e.createDocumentFragment(),p=[],g=0,v=t.length;g<v;g++)if((a=t[g])||0===a)if("object"===f(a)&&(a.nodeType||m(a)))C.merge(p,a.nodeType?[a]:a);else if(Be.test(a)){for(o=o||d.appendChild(e.createElement("div")),l=(Se.exec(a)||["",""])[1].toLowerCase(),u=(c=Te[l]||i).length;--u>-1;)o=o.appendChild(e.createElement(c[u]));o.innerHTML=C.htmlPrefilter(a),C.merge(p,o.childNodes),(o=d.firstChild).textContent=""}else p.push(e.createTextNode(a));for(d.textContent="",g=0;a=p[g++];)if(n&&C.inArray(a,n)>-1)r&&r.push(a);else if(h=xe(a),o=Ee(d.appendChild(a),"script"),h&&Ie(o),s)for(u=0;a=o[u++];)Pe.test(a.type||"")&&s.push(a);return d}function Re(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Oe(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function De(t,e,i,s){e=r(e);var n,a,o,l,c,h,u=0,d=t.length,p=d-1,f=e[0];if("function"==typeof f)return t.each(function(n){var r=t.eq(n);e[0]=f.call(this,n,r.html()),De(r,e,i,s)});if(d&&(a=(n=_e(e,t[0].ownerDocument,!1,t,s)).firstChild,1===n.childNodes.length&&(n=a),a||s)){for(l=(o=C.map(Ee(n,"script"),Re)).length;u<d;u++)c=n,u!==p&&(c=C.clone(c,!0,!0),l&&C.merge(o,Ee(c,"script"))),i.call(t[u],c,u);if(l)for(h=o[o.length-1].ownerDocument,C.map(o,Oe),u=0;u<l;u++)c=o[u],Pe.test(c.type||"")&&!re.get(c,"globalEval")&&C.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?C._evalUrl&&!c.noModule&&C._evalUrl(c.src,{nonce:c.nonce,crossOrigin:c.crossOrigin},h):y(c.textContent,c,h))}return t}var Me=/^(?:checkbox|radio)$/i,Ne=/^([^.]*)(?:\.(.+)|)/;function $e(){return!0}function Ve(){return!1}function qe(t,e,i,s,n,r){var a,o;if("object"==typeof e){for(o in"string"!=typeof i&&(s=s||i,i=void 0),e)qe(t,o,i,s,e[o],r);return t}if(null==s&&null==n?(n=i,s=i=void 0):null==n&&("string"==typeof i?(n=s,s=void 0):(n=s,s=i,i=void 0)),!1===n)n=Ve;else if(!n)return t;return 1===r&&(a=n,n=function(t){return C().off(t),a.apply(this,arguments)},n.guid=a.guid||(a.guid=C.guid++)),t.each(function(){C.event.add(this,e,n,s,i)})}function je(t,e,i){i?(re.set(t,e,!1),C.event.add(t,e,{namespace:!1,handler:function(t){var i,s=re.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(C.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=n.call(arguments),re.set(this,e,s),this[e](),i=re.get(this,e),re.set(this,e,!1),s!==i)return t.stopImmediatePropagation(),t.preventDefault(),i&&i.value}else s.length&&(re.set(this,e,{value:C.event.trigger(s[0],s.slice(1),this)}),t.stopPropagation(),t.isImmediatePropagationStopped=$e)}})):void 0===re.get(t,e)&&C.event.add(t,e,$e)}C.event={add:function(t,e,i,s,n){var r,a,o,l,c,h,u,d,p,f,g,m=re.get(t);if(se(t))for(i.handler&&(i=(r=i).handler,n=r.selector),n&&C.find.matchesSelector(O,n),i.guid||(i.guid=C.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(e){return void 0!==C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(Y)||[""]).length;c--;)p=g=(o=Ne.exec(e[c])||[])[1],f=(o[2]||"").split(".").sort(),p&&(u=C.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,u=C.event.special[p]||{},h=C.extend({type:p,origType:g,data:s,handler:i,guid:i.guid,selector:n,needsContext:n&&C.expr.match.needsContext.test(n),namespace:f.join(".")},r),(d=l[p])||((d=l[p]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,s,f,a)||t.addEventListener&&t.addEventListener(p,a)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),n?d.splice(d.delegateCount++,0,h):d.push(h))},remove:function(t,e,i,s,n){var r,a,o,l,c,h,u,d,p,f,g,m=re.hasData(t)&&re.get(t);if(m&&(l=m.events)){for(c=(e=(e||"").match(Y)||[""]).length;c--;)if(p=g=(o=Ne.exec(e[c])||[])[1],f=(o[2]||"").split(".").sort(),p){for(u=C.event.special[p]||{},d=l[p=(s?u.delegateType:u.bindType)||p]||[],o=o[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=r=d.length;r--;)h=d[r],!n&&g!==h.origType||i&&i.guid!==h.guid||o&&!o.test(h.namespace)||s&&s!==h.selector&&("**"!==s||!h.selector)||(d.splice(r,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));a&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,f,m.handle)||C.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)C.event.remove(t,p+e[c],i,s,!0);C.isEmptyObject(l)&&re.remove(t,"handle events")}},dispatch:function(t){var e,i,s,n,r,a,o=new Array(arguments.length),l=C.event.fix(t),c=(re.get(this,"events")||Object.create(null))[l.type]||[],h=C.event.special[l.type]||{};for(o[0]=l,e=1;e<arguments.length;e++)o[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(a=C.event.handlers.call(this,l,c),e=0;(n=a[e++])&&!l.isPropagationStopped();)for(l.currentTarget=n.elem,i=0;(r=n.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==r.namespace&&!l.rnamespace.test(r.namespace)||(l.handleObj=r,l.data=r.data,void 0!==(s=((C.event.special[r.origType]||{}).handle||r.handler).apply(n.elem,o))&&!1===(l.result=s)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var i,s,n,r,a,o=[],l=e.delegateCount,c=t.target;if(l&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(r=[],a={},i=0;i<l;i++)void 0===a[n=(s=e[i]).selector+" "]&&(a[n]=s.needsContext?C(n,this).index(c)>-1:C.find(n,this,null,[c]).length),a[n]&&r.push(s);r.length&&o.push({elem:c,handlers:r})}return c=this,l<e.length&&o.push({elem:c,handlers:e.slice(l)}),o},addProp:function(t,e){Object.defineProperty(C.Event.prototype,t,{enumerable:!0,configurable:!0,get:"function"==typeof e?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[C.expando]?t:new C.Event(t)},special:C.extend(Object.create(null),{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return Me.test(e.type)&&e.click&&x(e,"input")&&je(e,"click",!0),!1},trigger:function(t){var e=this||t;return Me.test(e.type)&&e.click&&x(e,"input")&&je(e,"click"),!0},_default:function(t){var e=t.target;return Me.test(e.type)&&e.click&&x(e,"input")&&re.get(e,"click")||x(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.preventDefault()}}})},C.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},C.Event=function(t,e){if(!(this instanceof C.Event))return new C.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?$e:Ve,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&C.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[C.expando]=!0},C.Event.prototype={constructor:C.Event,isDefaultPrevented:Ve,isPropagationStopped:Ve,isImmediatePropagationStopped:Ve,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=$e,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=$e,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=$e,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},C.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},C.event.addProp),C.each({focus:"focusin",blur:"focusout"},function(t,e){function i(t){var e=C.event.fix(t);e.type="focusin"===t.type?"focus":"blur",e.isSimulated=!0,e.target===e.currentTarget&&re.get(this,"handle")(e)}C.event.special[t]={setup:function(){if(je(this,t,!0),!T)return!1;this.addEventListener(e,i)},trigger:function(){return je(this,t),!0},teardown:function(){if(!T)return!1;this.removeEventListener(e,i)},_default:function(e){return re.get(e.target,t)},delegateType:e}}),C.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){C.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,s=t.relatedTarget,n=t.handleObj;return s&&(s===this||C.contains(this,s))||(t.type=n.origType,i=n.handler.apply(this,arguments),t.type=e),i}}}),C.fn.extend({on:function(t,e,i,s){return qe(this,t,e,i,s)},one:function(t,e,i,s){return qe(this,t,e,i,s,1)},off:function(t,e,i){var s,n;if(t&&t.preventDefault&&t.handleObj)return s=t.handleObj,C(t.delegateTarget).off(s.namespace?s.origType+"."+s.namespace:s.origType,s.selector,s.handler),this;if("object"==typeof t){for(n in t)this.off(n,e,t[n]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Ve),this.each(function(){C.event.remove(this,t,i,e)})}});var Le=/<script|<style|<link/i;function Fe(t,e){return x(t,"table")&&x(11!==e.nodeType?e:e.firstChild,"tr")&&C(t).children("tbody")[0]||t}function ze(t,e){var i,s,n,r=re.get(t,"events");if(1===e.nodeType){if(r)for(i in re.remove(e,"handle events"),r)for(s=0,n=r[i].length;s<n;s++)C.event.add(e,i,r[i][s]);ae.hasData(t)&&ae.set(e,C.extend({},ae.get(t)))}}function Ue(t,e,i){for(var s,n=e?C.filter(e,t):t,r=0;null!=(s=n[r]);r++)i||1!==s.nodeType||C.cleanData(Ee(s)),s.parentNode&&(i&&xe(s)&&Ie(Ee(s,"script")),s.parentNode.removeChild(s));return t}C.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var s,n,r,a,o=t.cloneNode(!0),l=xe(t);if(T&&(1===t.nodeType||11===t.nodeType)&&!C.isXMLDoc(t))for(a=Ee(o),s=0,n=(r=Ee(t)).length;s<n;s++)x(a[s],"textarea")&&(a[s].defaultValue=r[s].defaultValue);if(e)if(i)for(r=r||Ee(t),a=a||Ee(o),s=0,n=r.length;s<n;s++)ze(r[s],a[s]);else ze(t,o);return(a=Ee(o,"script")).length>0&&Ie(a,!l&&Ee(t,"script")),o},cleanData:function(t){for(var e,i,s,n=C.event.special,r=0;void 0!==(i=t[r]);r++)if(se(i)){if(e=i[re.expando]){if(e.events)for(s in e.events)n[s]?C.event.remove(i,s):C.removeEvent(i,s,e.handle);i[re.expando]=void 0}i[ae.expando]&&(i[ae.expando]=void 0)}}}),C.fn.extend({detach:function(t){return Ue(this,t,!0)},remove:function(t){return Ue(this,t)},text:function(t){return Z(this,function(t){return void 0===t?C.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return De(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Fe(this,t).appendChild(t)})},prepend:function(){return De(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Fe(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return De(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return De(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(C.cleanData(Ee(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return C.clone(this,t,e)})},html:function(t){return Z(this,function(t){var e=this[0]||{},i=0,s=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Le.test(t)&&!Te[(Se.exec(t)||["",""])[1].toLowerCase()]){t=C.htmlPrefilter(t);try{for(;i<s;i++)1===(e=this[i]||{}).nodeType&&(C.cleanData(Ee(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return De(this,arguments,function(e){var i=this.parentNode;C.inArray(this,t)<0&&(C.cleanData(Ee(this)),i&&i.replaceChild(e,this))},t)}}),C.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){C.fn[t]=function(t){for(var i,s=[],n=C(t),r=n.length-1,o=0;o<=r;o++)i=o===r?this:this.clone(!0),C(n[o])[e](i),a.apply(s,i);return this.pushStack(s)}});var He=new RegExp("^("+he+")(?!px)[a-z%]+$","i"),Je=/^--/;function We(e){var i=e.ownerDocument.defaultView;return i||(i=t),i.getComputedStyle(e)}function Ge(t,e,i){var s,n=Je.test(e);return(i=i||We(t))&&(s=i.getPropertyValue(e)||i[e],n&&s&&(s=s.replace(P,"$1")||void 0),""!==s||xe(t)||(s=C.style(t,e))),void 0!==s?s+"":s}var Ke=["Webkit","Moz","ms"],Ze=v.createElement("div").style;function Ye(t){return t in Ze?t:function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=Ke.length;i--;)if((t=Ke[i]+e)in Ze)return t}(t)||t}var Qe,Xe,ti=v.createElement("table");function ei(){if(ti&&ti.style){var e,i=v.createElement("col"),s=v.createElement("tr"),n=v.createElement("td");ti.style.cssText="position:absolute;left:-11111px;border-collapse:separate;border-spacing:0",s.style.cssText="box-sizing:content-box;border:1px solid;height:1px",n.style.cssText="height:9px;width:9px;padding:0",i.span=2,O.appendChild(ti).appendChild(i).parentNode.appendChild(s).appendChild(n).parentNode.appendChild(n.cloneNode(!0)),0!==ti.offsetWidth?(e=t.getComputedStyle(s),Xe=T||18===Math.round(parseFloat(t.getComputedStyle(i).width)),Qe=Math.round(parseFloat(e.height)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth))===s.offsetHeight,O.removeChild(ti),ti=null):O.removeChild(ti)}}C.extend(p,{reliableTrDimensions:function(){return ei(),Qe},reliableColDimensions:function(){return ei(),Xe}});var ii={position:"absolute",visibility:"hidden",display:"block"},si={letterSpacing:"0",fontWeight:"400"};function ni(t,e,i){var s=ue.exec(e);return s?Math.max(0,s[2]-(i||0))+(s[3]||"px"):e}function ri(t,e,i,s,n,r){var a="width"===e?1:0,o=0,l=0,c=0;if(i===(s?"border":"content"))return 0;for(;a<4;a+=2)"margin"===i&&(c+=C.css(t,i+de[a],!0,n)),s?("content"===i&&(l-=C.css(t,"padding"+de[a],!0,n)),"margin"!==i&&(l-=C.css(t,"border"+de[a]+"Width",!0,n))):(l+=C.css(t,"padding"+de[a],!0,n),"padding"!==i?l+=C.css(t,"border"+de[a]+"Width",!0,n):o+=C.css(t,"border"+de[a]+"Width",!0,n));return!s&&r>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-l-o-.5))||0),l+c}function ai(t,e,i){var s=We(t),n=(T||i)&&"border-box"===C.css(t,"boxSizing",!1,s),r=n,a=Ge(t,e,s),o="offset"+e[0].toUpperCase()+e.slice(1);if(He.test(a)){if(!i)return a;a="auto"}return("auto"===a||T&&n||!p.reliableColDimensions()&&x(t,"col")||!p.reliableTrDimensions()&&x(t,"tr"))&&t.getClientRects().length&&(n="border-box"===C.css(t,"boxSizing",!1,s),(r=o in t)&&(a=t[o])),(a=parseFloat(a)||0)+ri(t,e,i||(n?"border":"content"),r,s,a)+"px"}function oi(t,e,i,s,n){return new oi.prototype.init(t,e,i,s,n)}C.extend({cssHooks:{},style:function(t,e,i,s){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var n,r,a,o=ye(e),l=Je.test(e),c=t.style;if(l||(e=Ye(o)),a=C.cssHooks[e]||C.cssHooks[o],void 0===i)return a&&"get"in a&&void 0!==(n=a.get(t,!1,s))?n:c[e];"string"===(r=typeof i)&&(n=ue.exec(i))&&n[1]&&(i=ve(t,e,n),r="number"),null!=i&&i==i&&("number"===r&&(i+=n&&n[3]||(me(o)?"px":"")),T&&""===i&&0===e.indexOf("background")&&(c[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,s))||(l?c.setProperty(e,i):c[e]=i))}},css:function(t,e,i,s){var n,r,a,o=ye(e);return Je.test(e)||(e=Ye(o)),(a=C.cssHooks[e]||C.cssHooks[o])&&"get"in a&&(n=a.get(t,!0,i)),void 0===n&&(n=Ge(t,e,s)),"normal"===n&&e in si&&(n=si[e]),""===i||i?(r=parseFloat(n),!0===i||isFinite(r)?r||0:n):n}}),C.each(["height","width"],function(t,e){C.cssHooks[e]={get:function(t,i,s){if(i)return"none"===C.css(t,"display")?function(t,e,i){var s,n,r={};for(n in e)r[n]=t.style[n],t.style[n]=e[n];for(n in s=i.call(t),e)t.style[n]=r[n];return s}(t,ii,function(){return ai(t,e,s)}):ai(t,e,s)},set:function(t,i,s){var n,r=We(t),a=s&&"border-box"===C.css(t,"boxSizing",!1,r),o=s?ri(t,e,s,a,r):0;return o&&(n=ue.exec(i))&&"px"!==(n[3]||"px")&&(t.style[e]=i,i=C.css(t,e)),ni(0,i,o)}}}),C.each({margin:"",padding:"",border:"Width"},function(t,e){C.cssHooks[t+e]={expand:function(i){for(var s=0,n={},r="string"==typeof i?i.split(" "):[i];s<4;s++)n[t+de[s]+e]=r[s]||r[s-2]||r[0];return n}},"margin"!==t&&(C.cssHooks[t+e].set=ni)}),C.fn.extend({css:function(t,e){return Z(this,function(t,e,i){var s,n,r={},a=0;if(Array.isArray(e)){for(s=We(t),n=e.length;a<n;a++)r[e[a]]=C.css(t,e[a],!1,s);return r}return void 0!==i?C.style(t,e,i):C.css(t,e)},t,e,arguments.length>1)}}),C.Tween=oi,oi.prototype={constructor:oi,init:function(t,e,i,s,n,r){this.elem=t,this.prop=i,this.easing=n||C.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=s,this.unit=r||(me(i)?"px":"")},cur:function(){var t=oi.propHooks[this.prop];return t&&t.get?t.get(this):oi.propHooks._default.get(this)},run:function(t){var e,i=oi.propHooks[this.prop];return this.options.duration?this.pos=e=C.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):oi.propHooks._default.set(this),this}},oi.prototype.init.prototype=oi.prototype,oi.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=C.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){C.fx.step[t.prop]?C.fx.step[t.prop](t):1!==t.elem.nodeType||!C.cssHooks[t.prop]&&null==t.elem.style[Ye(t.prop)]?t.elem[t.prop]=t.now:C.style(t.elem,t.prop,t.now+t.unit)}}},C.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},C.fx=oi.prototype.init,C.fx.step={};var li,ci,hi=/^(?:toggle|show|hide)$/,ui=/queueHooks$/;function di(){ci&&(!1===v.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(di):t.setTimeout(di,13),C.fx.tick())}function pi(){return t.setTimeout(function(){li=void 0}),li=Date.now()}function fi(t,e){var i,s=0,n={height:t};for(e=e?1:0;s<4;s+=2-e)n["margin"+(i=de[s])]=n["padding"+i]=t;return e&&(n.opacity=n.width=t),n}function gi(t,e,i){for(var s,n=(mi.tweeners[e]||[]).concat(mi.tweeners["*"]),r=0,a=n.length;r<a;r++)if(s=n[r].call(i,e,t))return s}function mi(t,e,i){var s,n,r=0,a=mi.prefilters.length,o=C.Deferred().always(function(){delete l.elem}),l=function(){if(n)return!1;for(var e=li||pi(),i=Math.max(0,c.startTime+c.duration-e),s=1-(i/c.duration||0),r=0,a=c.tweens.length;r<a;r++)c.tweens[r].run(s);return o.notifyWith(t,[c,s,i]),s<1&&a?i:(a||o.notifyWith(t,[c,1,0]),o.resolveWith(t,[c]),!1)},c=o.promise({elem:t,props:C.extend({},e),opts:C.extend(!0,{specialEasing:{},easing:C.easing._default},i),originalProperties:e,originalOptions:i,startTime:li||pi(),duration:i.duration,tweens:[],createTween:function(e,i){var s=C.Tween(t,c.opts,e,i,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(s),s},stop:function(e){var i=0,s=e?c.tweens.length:0;if(n)return this;for(n=!0;i<s;i++)c.tweens[i].run(1);return e?(o.notifyWith(t,[c,1,0]),o.resolveWith(t,[c,e])):o.rejectWith(t,[c,e]),this}}),h=c.props;for(!function(t,e){var i,s,n,r,a;for(i in t)if(n=e[s=ye(i)],r=t[i],Array.isArray(r)&&(n=r[1],r=t[i]=r[0]),i!==s&&(t[s]=r,delete t[i]),(a=C.cssHooks[s])&&"expand"in a)for(i in r=a.expand(r),delete t[s],r)i in t||(t[i]=r[i],e[i]=n);else e[s]=n}(h,c.opts.specialEasing);r<a;r++)if(s=mi.prefilters[r].call(c,t,h,c.opts))return"function"==typeof s.stop&&(C._queueHooks(c.elem,c.opts.queue).stop=s.stop.bind(s)),s;return C.map(h,gi,c),"function"==typeof c.opts.start&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),C.fx.timer(C.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}C.Animation=C.extend(mi,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return ve(i.elem,t,ue.exec(e),i),i}]},tweener:function(t,e){"function"==typeof t?(e=t,t=["*"]):t=t.match(Y);for(var i,s=0,n=t.length;s<n;s++)i=t[s],mi.tweeners[i]=mi.tweeners[i]||[],mi.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var s,n,r,a,o,l,c,h,u="width"in e||"height"in e,d=this,p={},f=t.style,g=t.nodeType&&pe(t),m=re.get(t,"fxshow");for(s in i.queue||(null==(a=C._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,o=a.empty.fire,a.empty.fire=function(){a.unqueued||o()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,C.queue(t,"fx").length||a.empty.fire()})})),e)if(n=e[s],hi.test(n)){if(delete e[s],r=r||"toggle"===n,n===(g?"hide":"show")){if("show"!==n||!m||void 0===m[s])continue;g=!0}p[s]=m&&m[s]||C.style(t,s)}if((l=!C.isEmptyObject(e))||!C.isEmptyObject(p))for(s in u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=m&&m.display)&&(c=re.get(t,"display")),"none"===(h=C.css(t,"display"))&&(c?h=c:(Ce([t],!0),c=t.style.display||c,h=C.css(t,"display"),Ce([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===C.css(t,"float")&&(l||(d.done(function(){f.display=c}),null==c&&(h=f.display,c="none"===h?"":h)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})),l=!1,p)l||(m?"hidden"in m&&(g=m.hidden):m=re.set(t,"fxshow",{display:c}),r&&(m.hidden=!g),g&&Ce([t],!0),d.done(function(){for(s in g||Ce([t]),re.remove(t,"fxshow"),p)C.style(t,s,p[s])})),l=gi(g?m[s]:0,s,d),s in m||(m[s]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?mi.prefilters.unshift(t):mi.prefilters.push(t)}}),C.speed=function(t,e,i){var s=t&&"object"==typeof t?C.extend({},t):{complete:i||e||"function"==typeof t&&t,duration:t,easing:i&&e||e&&"function"!=typeof e&&e};return C.fx.off?s.duration=0:"number"!=typeof s.duration&&(s.duration in C.fx.speeds?s.duration=C.fx.speeds[s.duration]:s.duration=C.fx.speeds._default),null!=s.queue&&!0!==s.queue||(s.queue="fx"),s.old=s.complete,s.complete=function(){"function"==typeof s.old&&s.old.call(this),s.queue&&C.dequeue(this,s.queue)},s},C.fn.extend({fadeTo:function(t,e,i,s){return this.filter(pe).css("opacity",0).show().end().animate({opacity:e},t,i,s)},animate:function(t,e,i,s){var n=C.isEmptyObject(t),r=C.speed(e,i,s),a=function(){var e=mi(this,C.extend({},t),r);(n||re.get(this,"finish"))&&e.stop(!0)};return a.finish=a,n||!1===r.queue?this.each(a):this.queue(r.queue,a)},stop:function(t,e,i){var s=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,n=null!=t&&t+"queueHooks",r=C.timers,a=re.get(this);if(n)a[n]&&a[n].stop&&s(a[n]);else for(n in a)a[n]&&a[n].stop&&ui.test(n)&&s(a[n]);for(n=r.length;n--;)r[n].elem!==this||null!=t&&r[n].queue!==t||(r[n].anim.stop(i),e=!1,r.splice(n,1));!e&&i||C.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,i=re.get(this),s=i[t+"queue"],n=i[t+"queueHooks"],r=C.timers,a=s?s.length:0;for(i.finish=!0,C.queue(this,t,[]),n&&n.stop&&n.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===t&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<a;e++)s[e]&&s[e].finish&&s[e].finish.call(this);delete i.finish})}}),C.each(["toggle","show","hide"],function(t,e){var i=C.fn[e];C.fn[e]=function(t,s,n){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(fi(e,!0),t,s,n)}}),C.each({slideDown:fi("show"),slideUp:fi("hide"),slideToggle:fi("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){C.fn[t]=function(t,i,s){return this.animate(e,t,i,s)}}),C.timers=[],C.fx.tick=function(){var t,e=0,i=C.timers;for(li=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||C.fx.stop(),li=void 0},C.fx.timer=function(t){C.timers.push(t),C.fx.start()},C.fx.start=function(){ci||(ci=!0,di())},C.fx.stop=function(){ci=null},C.fx.speeds={slow:600,fast:200,_default:400},C.fn.delay=function(e,i){return e=C.fx&&C.fx.speeds[e]||e,i=i||"fx",this.queue(i,function(i,s){var n=t.setTimeout(i,e);s.stop=function(){t.clearTimeout(n)}})};var vi=/^(?:input|select|textarea|button)$/i,bi=/^(?:a|area)$/i;function yi(t){return(t.match(Y)||[]).join(" ")}function wi(t){return t.getAttribute&&t.getAttribute("class")||""}function Ai(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(Y)||[]}C.fn.extend({prop:function(t,e){return Z(this,C.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[C.propFix[t]||t]})}}),C.extend({prop:function(t,e,i){var s,n,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&C.isXMLDoc(t)||(e=C.propFix[e]||e,n=C.propHooks[e]),void 0!==i?n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:t[e]=i:n&&"get"in n&&null!==(s=n.get(t,e))?s:t[e]},propHooks:{tabIndex:{get:function(t){var e=t.getAttribute("tabindex");return e?parseInt(e,10):vi.test(t.nodeName)||bi.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),T&&(C.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){C.propFix[this.toLowerCase()]=this}),C.fn.extend({addClass:function(t){var e,i,s,n,r,a;return"function"==typeof t?this.each(function(e){C(this).addClass(t.call(this,e,wi(this)))}):(e=Ai(t)).length?this.each(function(){if(s=wi(this),i=1===this.nodeType&&" "+yi(s)+" "){for(r=0;r<e.length;r++)n=e[r],i.indexOf(" "+n+" ")<0&&(i+=n+" ");a=yi(i),s!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,i,s,n,r,a;return"function"==typeof t?this.each(function(e){C(this).removeClass(t.call(this,e,wi(this)))}):arguments.length?(e=Ai(t)).length?this.each(function(){if(s=wi(this),i=1===this.nodeType&&" "+yi(s)+" "){for(r=0;r<e.length;r++)for(n=e[r];i.indexOf(" "+n+" ")>-1;)i=i.replace(" "+n+" "," ");a=yi(i),s!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,e){var i,s,n,r;return"function"==typeof t?this.each(function(i){C(this).toggleClass(t.call(this,i,wi(this),e),e)}):"boolean"==typeof e?e?this.addClass(t):this.removeClass(t):(i=Ai(t)).length?this.each(function(){for(r=C(this),n=0;n<i.length;n++)s=i[n],r.hasClass(s)?r.removeClass(s):r.addClass(s)}):this},hasClass:function(t){var e,i,s=0;for(e=" "+t+" ";i=this[s++];)if(1===i.nodeType&&(" "+yi(wi(i))+" ").indexOf(e)>-1)return!0;return!1}}),C.fn.extend({val:function(t){var e,i,s,n=this[0];return arguments.length?(s="function"==typeof t,this.each(function(i){var n;1===this.nodeType&&(null==(n=s?t.call(this,i,C(this).val()):t)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=C.map(n,function(t){return null==t?"":t+""})),(e=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,n,"value")||(this.value=n))})):n?(e=C.valHooks[n.type]||C.valHooks[n.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(n,"value"))?i:null==(i=n.value)?"":i:void 0}}),C.extend({valHooks:{select:{get:function(t){var e,i,s,n=t.options,r=t.selectedIndex,a="select-one"===t.type,o=a?null:[],l=a?r+1:n.length;for(s=r<0?l:a?r:0;s<l;s++)if((i=n[s]).selected&&!i.disabled&&(!i.parentNode.disabled||!x(i.parentNode,"optgroup"))){if(e=C(i).val(),a)return e;o.push(e)}return o},set:function(t,e){for(var i,s,n=t.options,r=C.makeArray(e),a=n.length;a--;)((s=n[a]).selected=C.inArray(C(s).val(),r)>-1)&&(i=!0);return i||(t.selectedIndex=-1),r}}}}),T&&(C.valHooks.option={get:function(t){var e=t.getAttribute("value");return null!=e?e:yi(C.text(t))}}),C.each(["radio","checkbox"],function(){C.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=C.inArray(C(t).val(),e)>-1}}});var Ci=/^(?:focusinfocus|focusoutblur)$/,xi=function(t){t.stopPropagation()};C.extend(C.event,{trigger:function(e,i,s,n){var r,a,o,l,c,u,d,p,f=[s||v],m=h.call(e,"type")?e.type:e,b=h.call(e,"namespace")?e.namespace.split("."):[];if(a=p=o=s=s||v,3!==s.nodeType&&8!==s.nodeType&&!Ci.test(m+C.event.triggered)&&(m.indexOf(".")>-1&&(b=m.split("."),m=b.shift(),b.sort()),c=m.indexOf(":")<0&&"on"+m,(e=e[C.expando]?e:new C.Event(m,"object"==typeof e&&e)).isTrigger=n?2:3,e.namespace=b.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=s),i=null==i?[e]:C.makeArray(i,[e]),d=C.event.special[m]||{},n||!d.trigger||!1!==d.trigger.apply(s,i))){if(!n&&!d.noBubble&&!g(s)){for(l=d.delegateType||m,Ci.test(l+m)||(a=a.parentNode);a;a=a.parentNode)f.push(a),o=a;o===(s.ownerDocument||v)&&f.push(o.defaultView||o.parentWindow||t)}for(r=0;(a=f[r++])&&!e.isPropagationStopped();)p=a,e.type=r>1?l:d.bindType||m,(u=(re.get(a,"events")||Object.create(null))[e.type]&&re.get(a,"handle"))&&u.apply(a,i),(u=c&&a[c])&&u.apply&&se(a)&&(e.result=u.apply(a,i),!1===e.result&&e.preventDefault());return e.type=m,n||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(f.pop(),i)||!se(s)||c&&"function"==typeof s[m]&&!g(s)&&((o=s[c])&&(s[c]=null),C.event.triggered=m,e.isPropagationStopped()&&p.addEventListener(m,xi),s[m](),e.isPropagationStopped()&&p.removeEventListener(m,xi),C.event.triggered=void 0,o&&(s[c]=o)),e.result}},simulate:function(t,e,i){var s=C.extend(new C.Event,i,{type:t,isSimulated:!0});C.event.trigger(s,null,e)}}),C.fn.extend({trigger:function(t,e){return this.each(function(){C.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return C.event.trigger(t,e,i,!0)}});var ki=t.location,Si={guid:Date.now()},Ti=/\?/;C.parseXML=function(e){var i,s;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return s=i&&i.getElementsByTagName("parsererror")[0],i&&!s||C.error("Invalid XML: "+(s?C.map(s.childNodes,function(t){return t.textContent}).join("\n"):e)),i};var Ei=/\[\]$/,Pi=/\r?\n/g,Ii=/^(?:submit|button|image|reset|file)$/i,Bi=/^(?:input|select|textarea|keygen)/i;function _i(t,e,i,s){var n;if(Array.isArray(e))C.each(e,function(e,n){i||Ei.test(t)?s(t,n):_i(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,s)});else if(i||"object"!==f(e))s(t,e);else for(n in e)_i(t+"["+n+"]",e[n],i,s)}C.param=function(t,e){var i,s=[],n=function(t,e){var i="function"==typeof e?e():e;s[s.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!C.isPlainObject(t))C.each(t,function(){n(this.name,this.value)});else for(i in t)_i(i,t[i],e,n);return s.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=C.prop(this,"elements");return t?C.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!C(this).is(":disabled")&&Bi.test(this.nodeName)&&!Ii.test(t)&&(this.checked||!Me.test(t))}).map(function(t,e){var i=C(this).val();return null==i?null:Array.isArray(i)?C.map(i,function(t){return{name:e.name,value:t.replace(Pi,"\r\n")}}):{name:e.name,value:i.replace(Pi,"\r\n")}}).get()}});var Ri=/%20/g,Oi=/#.*$/,Di=/([?&])_=[^&]*/,Mi=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ni=/^(?:GET|HEAD)$/,$i=/^\/\//,Vi={},qi={},ji="*/".concat("*"),Li=v.createElement("a");function Fi(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var s,n=0,r=e.toLowerCase().match(Y)||[];if("function"==typeof i)for(;s=r[n++];)"+"===s[0]?(s=s.slice(1)||"*",(t[s]=t[s]||[]).unshift(i)):(t[s]=t[s]||[]).push(i)}}function zi(t,e,i,s){var n={},r=t===qi;function a(o){var l;return n[o]=!0,C.each(t[o]||[],function(t,o){var c=o(e,i,s);return"string"!=typeof c||r||n[c]?r?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)}),l}return a(e.dataTypes[0])||!n["*"]&&a("*")}function Ui(t,e){var i,s,n=C.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((n[i]?t:s||(s={}))[i]=e[i]);return s&&C.extend(!0,t,s),t}Li.href=ki.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ki.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ki.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ji,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ui(Ui(t,C.ajaxSettings),e):Ui(C.ajaxSettings,t)},ajaxPrefilter:Fi(Vi),ajaxTransport:Fi(qi),ajax:function(e,i){"object"==typeof e&&(i=e,e=void 0),i=i||{};var s,n,r,a,o,l,c,h,u,d,p=C.ajaxSetup({},i),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?C(f):C.event,m=C.Deferred(),b=C.Callbacks("once memory"),y=p.statusCode||{},w={},A={},x="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Mi.exec(r);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?r:null},setRequestHeader:function(t,e){return null==c&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||x;return s&&s.abort(e),S(0,e),this}};if(m.promise(k),p.url=((e||p.url||ki.href)+"").replace($i,ki.protocol+"//"),p.type=i.method||i.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(Y)||[""],null==p.crossDomain){l=v.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Li.protocol+"//"+Li.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(zi(Vi,p,i,k),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=C.param(p.data,p.traditional)),c)return k;for(u in(h=C.event&&p.global)&&0===C.active++&&C.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ni.test(p.type),n=p.url.replace(Oi,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ri,"+")):(d=p.url.slice(n.length),p.data&&(p.processData||"string"==typeof p.data)&&(n+=(Ti.test(n)?"&":"?")+p.data,delete p.data),!1===p.cache&&(n=n.replace(Di,"$1"),d=(Ti.test(n)?"&":"?")+"_="+Si.guid+++d),p.url=n+d),p.ifModified&&(C.lastModified[n]&&k.setRequestHeader("If-Modified-Since",C.lastModified[n]),C.etag[n]&&k.setRequestHeader("If-None-Match",C.etag[n])),(p.data&&p.hasContent&&!1!==p.contentType||i.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+ji+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,k,p)||c))return k.abort();if(x="abort",b.add(p.complete),k.done(p.success),k.fail(p.error),s=zi(qi,p,i,k)){if(k.readyState=1,h&&g.trigger("ajaxSend",[k,p]),c)return k;p.async&&p.timeout>0&&(o=t.setTimeout(function(){k.abort("timeout")},p.timeout));try{c=!1,s.send(w,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(e,i,a,l){var u,d,v,w,A,x=i;c||(c=!0,o&&t.clearTimeout(o),s=void 0,r=l||"",k.readyState=e>0?4:0,u=e>=200&&e<300||304===e,a&&(w=function(t,e,i){for(var s,n,r,a,o=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===s&&(s=t.mimeType||e.getResponseHeader("Content-Type"));if(s)for(n in o)if(o[n]&&o[n].test(s)){l.unshift(n);break}if(l[0]in i)r=l[0];else{for(n in i){if(!l[0]||t.converters[n+" "+l[0]]){r=n;break}a||(a=n)}r=r||a}if(r)return r!==l[0]&&l.unshift(r),i[r]}(p,k,a)),!u&&C.inArray("script",p.dataTypes)>-1&&C.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,i,s){var n,r,a,o,l,c={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(r=h.shift();r;)if(t.responseFields[r]&&(i[t.responseFields[r]]=e),!l&&s&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=h.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(a=c[l+" "+r]||c["* "+r]))for(n in c)if((o=n.split(" "))[1]===r&&(a=c[l+" "+o[0]]||c["* "+o[0]])){!0===a?a=c[n]:!0!==c[n]&&(r=o[0],h.unshift(o[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}(p,w,k,u),u?(p.ifModified&&((A=k.getResponseHeader("Last-Modified"))&&(C.lastModified[n]=A),(A=k.getResponseHeader("etag"))&&(C.etag[n]=A)),204===e||"HEAD"===p.type?x="nocontent":304===e?x="notmodified":(x=w.state,d=w.data,u=!(v=w.error))):(v=x,!e&&x||(x="error",e<0&&(e=0))),k.status=e,k.statusText=(i||x)+"",u?m.resolveWith(f,[d,x,k]):m.rejectWith(f,[k,x,v]),k.statusCode(y),y=void 0,h&&g.trigger(u?"ajaxSuccess":"ajaxError",[k,p,u?d:v]),b.fireWith(f,[k,x]),h&&(g.trigger("ajaxComplete",[k,p]),--C.active||C.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,i){return C.get(t,e,i,"json")},getScript:function(t,e){return C.get(t,void 0,e,"script")}}),C.each(["get","post"],function(t,e){C[e]=function(t,i,s,n){return"function"!=typeof i&&null!==i||(n=n||s,s=i,i=void 0),C.ajax(C.extend({url:t,type:e,dataType:n,data:i,success:s},C.isPlainObject(t)&&t))}}),C.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),C._evalUrl=function(t,e,i){return C.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,scriptAttrs:e.crossOrigin?{crossOrigin:e.crossOrigin}:void 0,converters:{"text script":function(){}},dataFilter:function(t){C.globalEval(t,e,i)}})},C.fn.extend({wrapAll:function(t){var e;return this[0]&&("function"==typeof t&&(t=t.call(this[0])),e=C(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return"function"==typeof t?this.each(function(e){C(this).wrapInner(t.call(this,e))}):this.each(function(){var e=C(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e="function"==typeof t;return this.each(function(i){C(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){C(this).replaceWith(this.childNodes)}),this}}),C.expr.pseudos.hidden=function(t){return!C.expr.pseudos.visible(t)},C.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},C.ajaxSettings.xhr=function(){return new t.XMLHttpRequest};var Hi={0:200};function Ji(t){return t.scriptAttrs||!t.headers&&(t.crossDomain||t.async&&C.inArray("json",t.dataTypes)<0)}C.ajaxTransport(function(t){var e;return{send:function(i,s){var n,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(n in t.xhrFields)r[n]=t.xhrFields[n];for(n in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)r.setRequestHeader(n,i[n]);e=function(t){return function(){e&&(e=r.onload=r.onerror=r.onabort=r.ontimeout=null,"abort"===t?r.abort():"error"===t?s(r.status,r.statusText):s(Hi[r.status]||r.status,r.statusText,"text"===(r.responseType||"text")?{text:r.responseText}:{binary:r.response},r.getAllResponseHeaders()))}},r.onload=e(),r.onabort=r.onerror=r.ontimeout=e("error"),e=e("abort");try{r.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),C.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},converters:{"text script":function(t){return C.globalEval(t),t}}}),C.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),Ji(t)&&(t.type="GET")}),C.ajaxTransport("script",function(t){var e,i;if(Ji(t))return{send:function(s,n){e=C("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&n("error"===t.type?404:200,t.type)}),v.head.appendChild(e[0])},abort:function(){i&&i()}}});var Wi=[],Gi=/(=)\?(?=&|$)|\?\?/;C.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Wi.pop()||C.expando+"_"+Si.guid++;return this[t]=!0,t}}),C.ajaxPrefilter("jsonp",function(e,i,s){var n,r,a,o=!1!==e.jsonp&&(Gi.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gi.test(e.data)&&"data");return n=e.jsonpCallback="function"==typeof e.jsonpCallback?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(Gi,"$1"+n):!1!==e.jsonp&&(e.url+=(Ti.test(e.url)?"&":"?")+e.jsonp+"="+n),e.converters["script json"]=function(){return a||C.error(n+" was not called"),a[0]},e.dataTypes[0]="json",r=t[n],t[n]=function(){a=arguments},s.always(function(){void 0===r?C(t).removeProp(n):t[n]=r,e[n]&&(e.jsonpCallback=i.jsonpCallback,Wi.push(n)),a&&"function"==typeof r&&r(a[0]),a=r=void 0}),"script"}),C.ajaxPrefilter(function(e,i){"string"==typeof e.data||C.isPlainObject(e.data)||Array.isArray(e.data)||"processData"in i||(e.processData=!1),e.data instanceof t.FormData&&(e.contentType=!1)}),C.parseHTML=function(e,i,s){return"string"==typeof e||Lt(e+"")?("boolean"==typeof i&&(s=i,i=!1),i||(i=(new t.DOMParser).parseFromString("","text/html")),r=!s&&[],(n=jt.exec(e))?[i.createElement(n[1])]:(n=_e([e],i,r),r&&r.length&&C(r).remove(),C.merge([],n.childNodes))):[];var n,r},C.fn.load=function(t,e,i){var s,n,r,a=this,o=t.indexOf(" ");return o>-1&&(s=yi(t.slice(o)),t=t.slice(0,o)),"function"==typeof e?(i=e,e=void 0):e&&"object"==typeof e&&(n="POST"),a.length>0&&C.ajax({url:t,type:n||"GET",dataType:"html",data:e}).done(function(t){r=arguments,a.html(s?C("<div>").append(C.parseHTML(t)).find(s):t)}).always(i&&function(t,e){a.each(function(){i.apply(this,r||[t.responseText,e,t])})}),this},C.expr.pseudos.animated=function(t){return C.grep(C.timers,function(e){return t===e.elem}).length},C.offset={setOffset:function(t,e,i){var s,n,r,a,o,l,c=C.css(t,"position"),h=C(t),u={};"static"===c&&(t.style.position="relative"),o=h.offset(),r=C.css(t,"top"),l=C.css(t,"left"),("absolute"===c||"fixed"===c)&&(r+l).indexOf("auto")>-1?(a=(s=h.position()).top,n=s.left):(a=parseFloat(r)||0,n=parseFloat(l)||0),"function"==typeof e&&(e=e.call(t,i,C.extend({},o))),null!=e.top&&(u.top=e.top-o.top+a),null!=e.left&&(u.left=e.left-o.left+n),"using"in e?e.using.call(t,u):h.css(u)}},C.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){C.offset.setOffset(this,t,e)});var e,i,s=this[0];return s?s.getClientRects().length?(e=s.getBoundingClientRect(),i=s.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,s=this[0],n={top:0,left:0};if("fixed"===C.css(s,"position"))e=s.getBoundingClientRect();else{for(e=this.offset(),i=s.ownerDocument,t=s.offsetParent||i.documentElement;t&&t!==i.documentElement&&"static"===C.css(t,"position");)t=t.offsetParent||i.documentElement;t&&t!==s&&1===t.nodeType&&"static"!==C.css(t,"position")&&((n=C(t).offset()).top+=C.css(t,"borderTopWidth",!0),n.left+=C.css(t,"borderLeftWidth",!0))}return{top:e.top-n.top-C.css(s,"marginTop",!0),left:e.left-n.left-C.css(s,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===C.css(t,"position");)t=t.offsetParent;return t||O})}}),C.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;C.fn[t]=function(s){return Z(this,function(t,s,n){var r;if(g(t)?r=t:9===t.nodeType&&(r=t.defaultView),void 0===n)return r?r[e]:t[s];r?r.scrollTo(i?r.pageXOffset:n,i?n:r.pageYOffset):t[s]=n},t,s,arguments.length)}}),C.each({Height:"height",Width:"width"},function(t,e){C.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,s){C.fn[s]=function(n,r){var a=arguments.length&&(i||"boolean"!=typeof n),o=i||(!0===n||!0===r?"margin":"border");return Z(this,function(e,i,n){var r;return g(e)?0===s.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?C.css(e,i,o):C.style(e,i,n,o)},e,a?n:void 0,a)}})}),C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){C.fn[e]=function(t){return this.on(e,t)}}),C.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,s){return this.on(e,t,i,s)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),C.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){C.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),C.proxy=function(t,e){var i,s,r;if("string"==typeof e&&(i=t[e],e=t,t=i),"function"==typeof t)return s=n.call(arguments,2),r=function(){return t.apply(e||this,s.concat(n.call(arguments)))},r.guid=t.guid=t.guid||C.guid++,r},C.holdReady=function(t){t?C.readyWait++:C.ready(!0)},C.expr[":"]=C.expr.filters=C.expr.pseudos,"function"==typeof define&&define.amd&&define("jquery",[],function(){return C});var Ki=t.jQuery,Zi=t.$;return C.noConflict=function(e){return t.$===C&&(t.$=Zi),e&&t.jQuery===C&&(t.jQuery=Ki),C},void 0===e&&(t.jQuery=t.$=C),C}(window,!0);const e=t;var s=i(710),n=i.n(s),r=i(9),a=i.n(r);const o={version:"2.2.1 (2026-02-14)",languages:["en","ar","ast","bs","ca","ca_ES@valencia","cs","da","de","el","es","eu","fr","gl","he","hr","it","ja","nb_NO","nl","pl","pt","pt_BR","ro","ru","ta","tr","uk","vec","zh_TW"],messages:{ar:{Version:"الإصدار",time:"الوقت",actions:"المحاولات",score:"النتيجة","Next activity":"النشاط التالي","Previous activity":"النشاط السابق","Restart activity":"استئنف النشاط",Information:"المعلومة","Results are not currently being saved":"Results are not currently being saved","Current results":"تقارير المستخدم","Session started:":"Session started:","Reports system:":"Reports system:","User:":"المستخدم:","Projects:":"المشاريع:","Sequences:":"التسلسل","Activities done:":"Activities done:","Activities solved:":"Activities solved:","Global score:":"Global score:","(out of all project activities)":"(out of all project activities)","Total time in activities:":"Total time in activities:","Actions done:":"المحاولات","No activities done!":"No activities done!",Project:"المشروع:",sequence:"التسلسل",activity:"النشاط",OK:"موافق",YES:"YES",NO:"NO","Total:":"المجموع:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Partial score:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Activities played at least once:",Reports:"Reports","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"النشاط",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ast:{Version:"Versión",time:"tiempu",actions:"aiciones",score:"puntuación","Next activity":"Xera siguiente","Previous activity":"Xera previa","Restart activity":"Reaniciar xera",Information:"Información","Results are not currently being saved":"Anguaño los resultaos nun tán guardándose","Current results":"Resultaos actuales","Session started:":"Entamu de sesión:","Reports system:":"Sistema d'informes:","User:":"Usuariu:","Projects:":"Proyeutos:","Sequences:":"Secuencies:","Activities done:":"Xeres feches:","Activities solved:":"Xeres correutes:","Global score:":"Puntuación global:","(out of all project activities)":"Tiempu total en xeres:","Total time in activities:":"Tiempu total en xeres:","Actions done:":"Aiciones feches:","No activities done!":"¡Nun se fexo xera dala!",Project:"Proyeutu",sequence:"Secuencia",activity:"xera",OK:"Aceutar",YES:"SÍ",NO:"NON","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Puntuación global:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Xeres feches:",Reports:"Sistema d'informes:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Xeres feches:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},bs:{Version:"Verzija",time:"vrijeme",actions:"pokušaji",score:"rezultat","Next activity":"Sljedeća aktivnost","Previous activity":"Prethodna aktivnost","Restart activity":"Ponovno pokreni aktivnost",Information:"Informacije","Results are not currently being saved":"Results are not currently being saved","Current results":"Izvješća korisnika","Session started:":"Sesija započeta:","Reports system:":"Reports system:","User:":"Korisnik:","Projects:":"Projekti:","Sequences:":"Sekvenca","Activities done:":"Urađene aktivnosti:","Activities solved:":"Aktivnosti ok:","Global score:":"Ukupan rezultat:","(out of all project activities)":"Ukupno vrijeme aktivnosti:","Total time in activities:":"Ukupno vrijeme aktivnosti:","Actions done:":"Urađene aktivnosti:","No activities done!":"Urađene aktivnosti:",Project:"Projekt:",sequence:"Sekvenca",activity:"Aktivnost",OK:"Uredu",YES:"DA",NO:"NE","Total:":"Ukupno:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Ukupan rezultat:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Urađene aktivnosti:",Reports:"Reports","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Urađene aktivnosti:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ca:{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan desant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","(out of all project activities)":"(sobre totes les activitats del projecte)","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:","Select group:":"Seleccioneu el grup:","Select user:":"Seleccioneu l'usuari:",Cancel:"Cancel·la",Close:"Tanca","Copy data to clipboard":"Copia les dades al porta-retalls","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les dades s'han copiat en format HTML. Enganxeu-les a un full de càlcul o a un editor de text enriquit","The data has been copied to clipboard":"Les dades s'han copiat al porta-retalls","not connected":"no connectat","Please wait until the results of your activities are sent to the reports system":"Si us plau, espereu a que els resultats de les vostres activitats s'enviïn al servidor d'informes","Password:":"Contrasenya:","Incorrect password":"Contrasenya incorrecta","Invalid user":"Usuari/ària incorrecte","Partial score:":"Puntuació parcial:","(out of played activities)":"(sobre les activitats fetes)","Activities played at least once:":"Activitats fetes almenys una vegada:",Reports:"Informes","Toggle full screen":"Commuta pantalla completa","JClic logo":"Logotip del JClic",message:"missatge","Activity panel":"Tauler d'activitats",cell:"cel·la",image:"imatge",source:"origen",target:"destí","image fragment":"fragment d'imatge"},"ca_ES@valencia":{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan alçant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","(out of all project activities)":"(sobre totes les activitats del projecte)","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:","Select group:":"Seleccioneu el grup:","Select user:":"Seleccioneu l'usuari:",Cancel:"Cancel·la",Close:"Ix","Copy data to clipboard":"Copia les dades al porta-retalls","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les dades s'han copiat en format HTML. Enganxeu-les a un full de càlcul o a un editor de text enriquit","The data has been copied to clipboard":"Les dades s'han copiat al porta-retalls","not connected":"no connectat","Please wait until the results of your activities are sent to the reports system":"Espereu a que els resultats de les vostres activitats s'enviïn al servidor d'informes","Password:":"Contrasenya:","Incorrect password":"Contrasenya incorrecta","Invalid user":"Usuari/ària incorrecte","Partial score:":"Puntuació parcial:","(out of played activities)":"(sobre les activitats fetes)","Activities played at least once:":"Activitats fetes almenys una vegada:",Reports:"Informes","Toggle full screen":"Commuta pantalla completa","JClic logo":"Logotip del JClic",message:"missatge","Activity panel":"Tauler d'activitats",cell:"cel·la",image:"imatge",source:"origen",target:"destí","image fragment":"fragment d'imatge"},cs:{Version:"Verze",time:"čas",actions:"pokusů",score:"skóre","Next activity":"Další aktivita","Previous activity":"Předchozí aktivita","Restart activity":"Restartovat aktivitu",Information:"Informace","Results are not currently being saved":"Zpráva není zaregistrována v žádné DB","Current results":"Uživatelská sestava","Session started:":"Sezení spuštěno:","Reports system:":"Systém zprávy:","User:":"Uživatel:","Projects:":"Projekty:","Sequences:":"Sekvence:","Activities done:":"Dokončené aktivity:","Activities solved:":"Aktivity ok:","Global score:":"Celkové skóre:","(out of all project activities)":"Celkový čas aktivit:","Total time in activities:":"Celkový čas aktivit:","Actions done:":"Provedené akce:","No activities done!":"Nebyly nahlášeny žádné aktivity!",Project:"Projekt",sequence:"Sekvence",activity:"Aktivita",OK:"Ok",YES:"ANO",NO:"NE","Total:":"Celkem:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Celkové skóre:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Dokončené aktivity:",Reports:"Systém zprávy:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Dokončené aktivity:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},da:{Version:"Version",time:"tid",actions:"forsøg",score:"score","Next activity":"Næste aktivitet","Previous activity":"Forrige aktivitet","Restart activity":"Genstart aktivitet",Information:"Information","Results are not currently being saved":"Results are not currently being saved","Current results":"Bruger rapport","Session started:":"Session started:","Reports system:":"Reports system:","User:":"Bruger:","Projects:":"Projekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter udført:","Activities solved:":"Aktiviteter OK:","Global score:":"Global score:","(out of all project activities)":"(out of all project activities)","Total time in activities:":"Total time in activities:","Actions done:":"Aktiviteter udført:","No activities done!":"Ingen aktiviteter rapporteret!",Project:"Projekt",sequence:"Sequence",activity:"Aktivitet",OK:"Ok",YES:"JA",NO:"IKKE","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Global score:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Aktiviteter udført:",Reports:"Reports","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Aktiviteter udført:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},de:{Version:"Version",time:"Zeit",actions:"Versuche",score:"Ergebnis","Next activity":"Nächste Übung","Previous activity":"Vorherige Übung","Restart activity":"Übung neu starten",Information:"Informationen","Results are not currently being saved":"Bericht in keiner Datenbank eingetragen","Current results":"Benutzerberichte","Session started:":"Sitzung gestartet:","Reports system:":"Report system:","User:":"Benutzer:","Projects:":"Projekte:","Sequences:":"Sequenzen:","Activities done:":"Beendete Übungen:","Activities solved:":"Korrekte Übungen:","Global score:":"Gesamtpunktezahl:","(out of all project activities)":"Übungs-Gesamtzeit:","Total time in activities:":"Übungs-Gesamtzeit:","Actions done:":"Durchgeführte Aktionen:","No activities done!":"Keine Übungsberichte vorhanden!",Project:"Projekt",sequence:"Sequenz",activity:"Übung",OK:"OK",YES:"JA",NO:"NEIN","Total:":"Gesamt:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Gesamtpunktezahl:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Beendete Übungen:",Reports:"Report system:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Beendete Übungen:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},el:{Version:"Έκδοση",time:"χρόνος",actions:"προσπάθειες",score:"βαθμολογία","Next activity":"Επόμενη δραστηριότητα","Previous activity":"Προηγούμενη δραστηριότητα","Restart activity":"Επανεκκίνηση δραστηριότητας",Information:"Πληροφορίες","Results are not currently being saved":"Η αναφορά δεν εγγράφηκε στις βάσεις δεδομένων","Current results":"Αναφορές χρήστη","Session started:":"Έναρξη συνεδρίας:","Reports system:":"Σύστημα αναφορών:","User:":"Χρήστης:","Projects:":"Έργα:","Sequences:":"Αλληλουχίες:","Activities done:":"Ολοκληρωμένες δραστηριότητες:","Activities solved:":"Δραστηριότητες, εντάξει:","Global score:":"Συνολική βαθμολογία:","(out of all project activities)":"Συνολικός χρόνος δραστηριοτήτων:","Total time in activities:":"Συνολικός χρόνος δραστηριοτήτων:","Actions done:":"Οι ενέργειες ολοκληρώθηκαν:","No activities done!":"Για καμμία δραστηριότητα δεν έχει υποβληθεί αναφορά!",Project:"Έργο",sequence:"Αλληλουχία",activity:"Δραστηριότητα",OK:"Εντάξει",YES:"Ναί",NO:"όχι","Total:":"Σύνολο:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Συνολική βαθμολογία:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Ολοκληρωμένες δραστηριότητες:",Reports:"Σύστημα αναφορών:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Ολοκληρωμένες δραστηριότητες:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},es:{Version:"Versión",time:"tiempo",actions:"acciones",score:"aciertos","Next activity":"Actividad siguiente","Previous activity":"Actividad anterior","Restart activity":"Reiniciar actividad",Information:"Información","Results are not currently being saved":"Los resultados no se están guardando","Current results":"Resultados actuales","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario:","Projects:":"Proyectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades resueltas:","Global score:":"Puntuación global:","(out of all project activities)":"(sobre todas las actividades del proyecto)","Total time in activities:":"Tiempo total en las actividades:","Actions done:":"Acciones realizadas:","No activities done!":"¡No se ha realizado ninguna actividad!",Project:"Proyecto",sequence:"secuencia",activity:"actividad",OK:"OK",YES:"SI",NO:"NO","Total:":"Totales:","Select group:":"Seleccionar grupo:","Select user:":"Seleccionar usuario:",Cancel:"Cancelar",Close:"Cerrar","Copy data to clipboard":"Copiar datos al portapapeles","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Los datos se han copiado en formato HTML. Puedes pegarlos en una hoja de cálculo o en un editor de texto enriquecido","The data has been copied to clipboard":"Los datos se han copiado al portapapeles","not connected":"no conectado","Please wait until the results of your activities are sent to the reports system":"Por favor, espera mientras los resultados de las actividades se envian al servidor de informes","Password:":"Contraseña:","Incorrect password":"Contraseña incorrecta","Invalid user":"Usuario incorrecto","Partial score:":"Puntuación parcial:","(out of played activities)":"(sobre las actividades realizadas)","Activities played at least once:":"Actividades realizadas al menos una vez:",Reports:"Informes","Toggle full screen":"Conmutar pantalla completa","JClic logo":"Logotipo de JClic",message:"mensaje","Activity panel":"Panel de actividad",cell:"celda",image:"imagen",source:"origen",target:"destino","image fragment":"fragmento de imagen"},eu:{Version:"Bertsioa",time:"denbora",actions:"saiakerak",score:"puntuazioa","Next activity":"Hurrengo jarduera","Previous activity":"Aurreko jarduera","Restart activity":"Jarduera berriro hasi",Information:"Informazioa","Results are not currently being saved":"Txostena ez dago ezein datu-basetan","Current results":"Erabiltzailearen txostenak","Session started:":"Saio-hasiera:","Reports system:":"Txosten-sistema:","User:":"Erabiltzailea:","Projects:":"Proiektuak:","Sequences:":"Sekuentziak:","Activities done:":"Burututako ekinzak:","Activities solved:":"Jarduera zuzenak:","Global score:":"Jarduera zuzenak:","(out of all project activities)":"Jardueretan emandako denbora guztira:","Total time in activities:":"Jardueretan emandako denbora guztira:","Actions done:":"Burututako ekintzak:","No activities done!":"Ez da jardueren txostenik!",Project:"Proiektua",sequence:"Sekuentzia",activity:"Jarduera",OK:"Ados",YES:"BAI",NO:"EZ","Total:":"Guztira:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Jarduera zuzenak:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Burututako ekinzak:",Reports:"Txosten-sistema:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Burututako ekinzak:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},fr:{Version:"Version",time:"temps",actions:"essais",score:"résultat","Next activity":"Activité suivante","Previous activity":"Activité précédente","Restart activity":"Recommencer l'activité",Information:"Informations","Results are not currently being saved":"Le rapport n'est enregistré dans aucune base de données","Current results":"Rapports utilisateur","Session started:":"Session démarrée :","Reports system:":"Système de rapports :","User:":"Utilisateur :","Projects:":"Projets :","Sequences:":"Séquences :","Activities done:":"Activités réalisées :","Activities solved:":"Activités résolues :","Global score:":"Score global :","(out of all project activities)":"(sur toutes les activités du projet)","Total time in activities:":"Temps total sur les activités :","Actions done:":"Actions réalisées :","No activities done!":"Aucune activité réalisée !",Project:"Projet",sequence:"séquence",activity:"activité",OK:"OK",YES:"OUI",NO:"NON","Total:":"Total :","Select group:":"Sélectionner un groupe:","Select user:":"Sélectionner l'utilisateur:",Cancel:"Annuler",Close:"Fermer","Copy data to clipboard":"Copier les données dans le presse-papier","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les données ont été copiées au format HTML. Veuillez les coller dans une feuille de calcul ou dans un éditeur de texte","The data has been copied to clipboard":"Les données sont copier dans le presse-papier","not connected":"Non connecté ","Please wait until the results of your activities are sent to the reports system":"Veuillez patienter durant l'envoi de votre activité au rapport système","Password:":"Mot de passe: ","Incorrect password":"Mot de passe incorrect","Invalid user":"Utilisateur invalide","Partial score:":"Score partiel:","(out of played activities)":"(Hors activités jouées)","Activities played at least once:":"Les activités joué au moins une fois:",Reports:"Rapport","Toggle full screen":"Basculer en plein écran","JClic logo":"JClic logo",message:"message","Activity panel":"Groupe d'activités",cell:"cellule",image:"image",source:"source",target:"cible","image fragment":"fragment d'image"},gl:{Version:"Versión",time:"tempo",actions:"intentos",score:"acertos","Next activity":"Seguinte actividade","Previous activity":"Anterior actividade","Restart activity":"Reiniciar a actividade",Information:"Información","Results are not currently being saved":"O informe non está rexistrado en ningunha base de datos","Current results":"Informes de usuario","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario:","Projects:":"Proxectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Puntuación global:","(out of all project activities)":"Tempo total nas actividades:","Total time in activities:":"Tempo total nas actividades:","Actions done:":"Accións efectuadas:","No activities done!":"Non hai informada ningunha actividade!",Project:"Proxecto",sequence:"secuencia",activity:"actividade",OK:"Correcta",YES:"SI",NO:"NON","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Puntuación global:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Actividades realizadas:",Reports:"Sistema de informes:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Actividades realizadas:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},he:{Version:"גירסה",time:"זמן",actions:"נסיונות",score:"ניקוד","Next activity":"הפעילות הבאה","Previous activity":"הפעילות הקודמת","Restart activity":"התחל פעילות מחדש",Information:"מידע","Results are not currently being saved":"הדיווח אינו רשום במסד נתונים כלשהו","Current results":"דוחות משתמש","Session started:":"הפעלה החלה:","Reports system:":"מערכת דוחות:","User:":"משתמש:","Projects:":"פרוייקטים:","Sequences:":"רצפים:","Activities done:":"פעילויות שהושלמו:","Activities solved:":"פעילויות מאושרות:","Global score:":"ניקוד כללי:","(out of all project activities)":"משך הפעילויות המצטבר:","Total time in activities:":"משך הפעילויות המצטבר:","Actions done:":"פעולות שבוצעו:","No activities done!":"לא דווחו פעילויות!",Project:"פרוייקט",sequence:"רצף",activity:"פעילות",OK:"אישור",YES:"כן",NO:"לא","Total:":"סך הכל:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"ניקוד כללי:","(out of played activities)":"(out of played activities)","Activities played at least once:":"פעילויות שהושלמו:",Reports:"מערכת דוחות:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"פעילויות שהושלמו:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},hr:{Version:"Verzija",time:"vrijeme",actions:"radnje",score:"rezultat","Next activity":"Sljedeća aktivnost","Previous activity":"Prethodna aktivnost","Restart activity":"Ponovo pokreni aktivnost",Information:"Informacije","Results are not currently being saved":"Rezultati se trenutačno ne spremaju","Current results":"Trenutačni rezultati","Session started:":"Sesija započeta:","Reports system:":"Sustav izvještaja:","User:":"Korisnik:","Projects:":"Projekti:","Sequences:":"Slijedovi:","Activities done:":"Obavljene aktivnosti:","Activities solved:":"Riješene aktivnosti:","Global score:":"Ukupni rezultat:","(out of all project activities)":"(od svih projektnih aktivnosti)","Total time in activities:":"Ukupno vrijeme u aktivnostima:","Actions done:":"Izvršene radnje:","No activities done!":"Nema obavljenih aktivnosti!",Project:"Projekt",sequence:"slijed",activity:"aktivnost",OK:"U redu",YES:"DA",NO:"NE","Total:":"Ukupno:","Select group:":"Odaberi grupu:","Select user:":"Odaberi korisnika:",Cancel:"Odustani",Close:"Zatvori","Copy data to clipboard":"Kopiraj podatke u međuspremnik","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Podaci su kopirani u HTML formatu. Umetni ih u proračunsku tablicu ili u uređivač formatiranog teksta","The data has been copied to clipboard":"Podaci su kopirani u međuspremnik","not connected":"nepovezano","Please wait until the results of your activities are sent to the reports system":"Pričekaj da se rezultati tvojih aktivnosti pošalju sustavu izvještaja","Password:":"Lozinka:","Incorrect password":"Neispravna lozinka","Invalid user":"Korisnik ne postoji","Partial score:":"Prosjek:","(out of played activities)":"(od odigranih aktivnosti)","Activities played at least once:":"Barem jednom odigrane aktivnosti:",Reports:"Sustav izvještaja:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Obavljene aktivnosti:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},it:{Version:"Versione",time:"tempo",actions:"tentativi",score:"punteggio","Next activity":"Attività successiva","Previous activity":"Attività precedente","Restart activity":"Riavvia l'attività",Information:"Informazioni","Results are not currently being saved":"Rapporto non registrato in alcuna banca dati","Current results":"Rapporti utente","Session started:":"Sessione avviata:","Reports system:":"Sistema dei rapporti:","User:":"Utente:","Projects:":"Progetti:","Sequences:":"Sequenze:","Activities done:":"Attività eseguite:","Activities solved:":"Attività ok:","Global score:":"Punteggio globale:","(out of all project activities)":"Tempo totale nelle attività:","Total time in activities:":"Tempo totale nelle attività:","Actions done:":"Azioni compiute:","No activities done!":"Nessuna attività a rapporto!",Project:"Progetto",sequence:"sequenza",activity:"attività",OK:"Ok",YES:"SÌ",NO:"NO","Total:":"Totale:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Punteggio globale:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Attività eseguite:",Reports:"Sistema dei rapporti:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Attività eseguite:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ja:{Version:"バージョン",time:"時間",actions:"アクション",score:"スコア","Next activity":"次のアクティビティ","Previous activity":"前のアクティビティ","Restart activity":"アクティビティを再起動",Information:"情報","Results are not currently being saved":"結果は、現在保存されていません","Current results":"現在の結果","Session started:":"セッションが開始しました:","Reports system:":"レポート システム:","User:":"ユーザー:","Projects:":"プロジェクト:","Sequences:":"シーケンス:","Activities done:":"完了したアクティビティ:","Activities solved:":"解決したアクティビティ:","Global score:":"グローバル スコア:","(out of all project activities)":"(すべてのプロジェクト アクティビティの結果)","Total time in activities:":"アクティビティ時間の合計:","Actions done:":"完了したアクション:","No activities done!":"アクティビティは行われていません!",Project:"プロジェクト",sequence:"シーケンス",activity:"アクティビティ",OK:"OK",YES:"はい",NO:"いいえ","Total:":"合計:","Select group:":"グループを選択:","Select user:":"ユーザーを選択:",Cancel:"キャンセル",Close:"閉じる","Copy data to clipboard":"データをクリップボードにコピー","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"データは HTML 形式でコピーされます。リッチ テキスト エディターやスプレッドシートに貼り付けてください","The data has been copied to clipboard":"クリップボードにデータがコピーされました","not connected":"接続されていません","Please wait until the results of your activities are sent to the reports system":"アクティビティの結果がレポート システムに送信されるまでお待ちください","Password:":"パスワード:","Incorrect password":"パスワードが正しくありません","Invalid user":"無効なユーザー","Partial score:":"部分スコア:","(out of played activities)":"(プレイしたアクティビティの結果)","Activities played at least once:":"少なくとも一度プレイしたアクティビティ:",Reports:"レポート","Toggle full screen":"全画面の切り替え","JClic logo":"JClic ロゴ",message:"メッセージ","Activity panel":"アクティビティ パネル",cell:"セル",image:"画像",source:"ソース",target:"ターゲット","image fragment":"画像フラグメント"},nb_NO:{Version:"Versjon",time:"tid",actions:"forsøk",score:"poengsum","Next activity":"Neste aktivitet","Previous activity":"Forrige aktivitet","Restart activity":"Start aktivitet på nytt",Information:"Informasjon","Results are not currently being saved":"Resultater blir foreløpig ikke lagret","Current results":"Nåværende resultater","Session started:":"Økta startet:","Reports system:":"Rapportsystem:","User:":"Bruker:","Projects:":"Prosjekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter fullført:","Activities solved:":"Løste aktiviteter:","Global score:":"Global poengsum:","(out of all project activities)":"(av alle prosjektaktiviteter)","Total time in activities:":"Tidsforbruk på aktiviteter:","Actions done:":"Handlinger gjort:","No activities done!":"Ingen aktiviteter unnagjort.",Project:"Prosjekt",sequence:"sekvens",activity:"aktivitet",OK:"OK",YES:"JA",NO:"NEI","Total:":"Total:","Select group:":"Velg gruppe:","Select user:":"Velg bruker:",Cancel:"Avbryt",Close:"Lukk","Copy data to clipboard":"Kopier data til utklippstavle","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Dataen har blitt kopiert i HTML-format. Lim inn i et regneark eller en tekstbehandler med støtte for formatering","The data has been copied to clipboard":"Dataen har blitt kopier til utklippstavle","not connected":"ikke tilkoblet","Please wait until the results of your activities are sent to the reports system":"Vent mens resultatet av dine aktiviteter sendes til rapportsystemet","Password:":"Passord:","Incorrect password":"Feilaktig passord","Invalid user":"Ugyldig bruker","Partial score:":"Delvis poengsum:","(out of played activities)":"(av utførte aktiviteter)","Activities played at least once:":"Aktiviteter som har blitt utført minst én gang:",Reports:"Rapportsystem:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Aktiviteter fullført:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},nl:{Version:"Versie",time:"tijd",actions:"pogingen",score:"punten","Next activity":"Volgende activiteit","Previous activity":"Vorige activiteit","Restart activity":"Herstart activiteit",Information:"Informatie","Results are not currently being saved":"Rapport niet geregistreerd in een DB","Current results":"Gebruikers rapport","Session started:":"Reeks gestart:","Reports system:":"Rapporteer systeem:","User:":"Gebruiker:","Projects:":"Projecten:","Sequences:":"Reeksen:","Activities done:":"Activiteiten klaar:","Activities solved:":"Activiteiten ok:","Global score:":"Puntentotaal:","(out of all project activities)":"Totale tijd activiteiten:","Total time in activities:":"Totale tijd activiteiten:","Actions done:":"Einde activiteiten:","No activities done!":"Geen activiteiten gerapporteerd!",Project:"Project",sequence:"Volgorde",activity:"Activiteit",OK:"Ok",YES:"JA",NO:"NEE","Total:":"Totaal:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Puntentotaal:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Activiteiten klaar:",Reports:"Rapporteer systeem:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Activiteiten klaar:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},pl:{Version:"Wersja",time:"czas",actions:"działanie",score:"wynik","Next activity":"Następna aktywność","Previous activity":"Poprzednia aktywność","Restart activity":"Zrestartuj aktywność",Information:"Informacje","Results are not currently being saved":"Wyniki nie są obecnie zapisywane","Current results":"Aktualne wyniki","Session started:":"Sesja rozpoczęła się:","Reports system:":"System raportów:","User:":"Użytkownik:","Projects:":"Projektowanie:","Sequences:":"Sekwencje:","Activities done:":"Działania wykonane:","Activities solved:":"Działania rozwiązane:","Global score:":"Globalny wynik:","(out of all project activities)":"(poza wszystkimi działaniami projektu)","Total time in activities:":"Całkowity czas aktywności:","Actions done:":"Wykonane czynności:","No activities done!":"Nie wykonano żadnych czynności!",Project:"Projekt",sequence:"sekwencja",activity:"aktywność",OK:"OK",YES:"Tak",NO:"Nie","Total:":"Całkowity:","Select group:":"Wybierz grupę:","Select user:":"Wybierz użytkownika:",Cancel:"Anuluj",Close:"Zamknij","Copy data to clipboard":"Skopiuj dane do schowka","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Dane zostały skopiowane w formacie HTML. Wklej je do arkusza kalkulacyjnego lub edytora tekstu","The data has been copied to clipboard":"Dane zostały skopiowane do schowka","not connected":"nie połączony","Please wait until the results of your activities are sent to the reports system":"Poczekaj, aż wyniki Twoich działań zostaną przesłane do systemu raportów","Password:":"Hasło:","Incorrect password":"Niepoprawne hasło","Invalid user":"Nieprawidłowy użytkownik","Partial score:":"Wynik częściowy:","(out of played activities)":"(z granych zajęć)","Activities played at least once:":"Działania grane co najmniej raz:",Reports:"Raporty","Toggle full screen":"Przełącz tryb pełnoekranowy","JClic logo":"Logo JClic",message:"komunikat","Activity panel":"Panel aktywności",cell:"komórka",image:"obraz",source:"źródło",target:"miejsce docelowe","image fragment":"fragment obrazu"},pt:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"Actividade seguinte","Previous activity":"Actividade anterior","Restart activity":"Reiniciar a actividade",Information:"Informação","Results are not currently being saved":"O relatório não está registado em nenhuma base de dados","Current results":"Relatórios do utilizador","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Utilizador:","Projects:":"Projectos:","Sequences:":"Sequências:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Pontuação global:","(out of all project activities)":"Tempo total das actividades:","Total time in activities:":"Tempo total das actividades:","Actions done:":"Acções efectuadas:","No activities done!":"Nenhuma actividade registada!",Project:"Projecto",sequence:"sequência",activity:"Actividade",OK:"Correcta",YES:"sim",NO:"não","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Pontuação global:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Actividades realizadas:",Reports:"Sistema de relatórios:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Actividades realizadas:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},pt_BR:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"atividade seguinte","Previous activity":"atividade anterior","Restart activity":"Reiniciar a atividade",Information:"Informação","Results are not currently being saved":"O relatório não está registrando em nenhuma base de dados","Current results":"relatórios de usuário","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Usuário:","Projects:":"Projetos:","Sequences:":"Sequências:","Activities done:":"Atividades realizadas:","Activities solved:":"Atividades corretas:","Global score:":"Pontuação geral:","(out of all project activities)":"Tempo total das atividades:","Total time in activities:":"Tempo total das atividades:","Actions done:":"Ações efetuadas:","No activities done!":"Nenhuma atividade registrada!",Project:"Projeto",sequence:"sequência",activity:"atividade",OK:"Correta",YES:"sim",NO:"não","Total:":"Total:","Select group:":"Selecionar grupo:","Select user:":"Selecionar usuário:",Cancel:"Cancelar",Close:"Fechar","Copy data to clipboard":"Copiar dados para o clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Os dados foram copiados no formato HTML. Favor colá-los em uma planilha ou em um editor de texto com formatação","The data has been copied to clipboard":"Os dados foram copiados para o clipboard","not connected":"não conectado","Please wait until the results of your activities are sent to the reports system":"Favor aguardar até que os resultados das suas atividades sejam enviados ao sistema de relatórios","Password:":"Senha:","Incorrect password":"Senha errada","Invalid user":"Usuário inválido","Partial score:":"Pontuação geral:","(out of played activities)":"(das atividades realizadas)","Activities played at least once:":"Atividades realizadas:",Reports:"Sistema de relatórios:","Toggle full screen":"Modo tela cheia","JClic logo":"logo do JClic",message:"mensagem","Activity panel":"Atividades realizadas:",cell:"célula",image:"imagem",source:"fonte",target:"alvo","image fragment":"fragmento de imagem"},ro:{Version:"Versiune",time:"timp",actions:"acțiuni",score:"rezultat","Next activity":"Activitatea următoare","Previous activity":"Activitatea anterioară","Restart activity":"Restartează activitatea",Information:"Informații","Results are not currently being saved":"Rezultatul nu pare a fi salvat","Current results":"Rezultatul curent","Session started:":"Sesiune pornită la:","Reports system:":"Sistem raportare:","User:":"Utilizator","Projects:":"Proiecte:","Sequences:":"Secvențe:","Activities done:":"Activități realizate: ","Activities solved:":"Activități rezolvate: ","Global score:":"Rezultat global:","(out of all project activities)":"(în afara activităților din proiect)","Total time in activities:":"Timp total în activitate:","Actions done:":"Activități realizate: ","No activities done!":"Activități nerealizate: ",Project:"Proiect",sequence:"secvență",activity:"activitate",OK:"OK",YES:"DA",NO:"NU","Total:":"Total:","Select group:":"Alege grup:","Select user:":"Alege utilizator:",Cancel:"Anuleaza",Close:"Închide","Copy data to clipboard":"Copiază datele in clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Datele au fost copiate în format HTML. Vă rog lipiți-le într-o foaie de calcul sau într-un editor compatibil rich text","The data has been copied to clipboard":"Datele au fost copiate în clipboard","not connected":"neconectat","Please wait until the results of your activities are sent to the reports system":"Vă rugăm să așteptați până ce rezultatele activităților sunt trimise către sistemul de raportare","Password:":"Parolă:","Incorrect password":"Parolă incorectă","Invalid user":"Utilizator incorect","Partial score:":"Rezultat parțial:","(out of played activities)":"(în afara activități jucate) ","Activities played at least once:":"Activități jucate cel puțin o dată: ",Reports:"Rapoarte","Toggle full screen":"Comută în ecran plin","JClic logo":"Jclic logo",message:"mesaj","Activity panel":"Panou activități",cell:"celulă",image:"imagine",source:"sursă",target:"țintă","image fragment":"fragment de imagine "},ru:{Version:"Версия",time:"время",actions:"попытки",score:"счёт","Next activity":"Следующее действие","Previous activity":"Предыдущее действие","Restart activity":"Перезапуск действия",Information:"Информация","Results are not currently being saved":"Отчёт не зарегистрирован в БД","Current results":"Отчёты пользователя","Session started:":"Сессия начата:","Reports system:":"Система отчётов:","User:":"Пользователь:","Projects:":"Проекты:","Sequences:":"Последовательности:","Activities done:":"Совершенные действия:","Activities solved:":"Действия в порядке:","Global score:":"Общий счёт:","(out of all project activities)":"Общее время активности:","Total time in activities:":"Общее время активности:","Actions done:":"Завершено действий:","No activities done!":"Нет сообщенных действий!",Project:"Проект",sequence:"Последовательность",activity:"Активность",OK:"ОК",YES:"да",NO:"нет","Total:":"Итого:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Общий счёт:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Совершенные действия:",Reports:"Система отчётов:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Совершенные действия:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},ta:{Version:"பதிப்பு",time:"நேரம்",actions:"செயல்கள்",score:"கெலிப்பெண்","Next activity":"அடுத்த செயல்பாடு","Previous activity":"முந்தைய செயல்பாடு","Restart activity":"செயல்பாட்டை மறுதொடக்கம் செய்யுங்கள்",Information:"தகவல்","Results are not currently being saved":"முடிவுகள் தற்போது சேமிக்கப்படவில்லை","Current results":"தற்போதைய முடிவுகள்","Session started:":"சந்திப்பு தொடங்கியது:","Reports system:":"அறிக்கை அமைப்பு:","User:":"பயனர்:","Projects:":"திட்டங்கள்:","Sequences:":"தொடர்கள்:","Activities done:":"முடிந்த நடவடிக்கைகள்:","Activities solved:":"தீர்க்கப்பட்ட நடவடிக்கைகள்:","Global score:":"உலகளாவிய மதிப்பெண்:","(out of all project activities)":"(அனைத்து திட்ட நடவடிக்கைகளிலும்)","Total time in activities:":"நடவடிக்கைகளில் மொத்த நேரம்:","Actions done:":"செய்யப்பட்ட செயல்கள்:","No activities done!":"நடவடிக்கைகள் எதுவும் செய்யப்படவில்லை!",Project:"திட்டம்",sequence:"வரிசை",activity:"செய்கைப்பாடு",OK:"சரி",YES:"ஆம்",NO:"இல்லை","Total:":"மொத்தம்:","Select group:":"குழுவைத் தேர்ந்தெடுக்கவும்:","Select user:":"பயனரைத் தேர்ந்தெடுக்கவும்:",Cancel:"ரத்துசெய்",Close:"மூடு","Copy data to clipboard":"இடைநிலைப்பலகைக்கு தரவை நகலெடுக்கவும்","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"தரவு உஉகுமொ வடிவத்தில் நகலெடுக்கப்பட்டுள்ளது. தயவுசெய்து அவற்றை ஒரு விரிதாளில் அல்லது பணக்கார உரை திருத்தியில் ஒட்டவும்","The data has been copied to clipboard":"தரவு இடைநிலைப்பலகைக்கு நகலெடுக்கப்பட்டுள்ளது","not connected":"இணைக்கப்படவில்லை","Please wait until the results of your activities are sent to the reports system":"உங்கள் செயல்பாடுகளின் முடிவுகள் அறிக்கைகள் முறைக்கு அனுப்பப்படும் வரை காத்திருங்கள்","Password:":"கடவுச்சொல்:","Incorrect password":"தவறான கடவுச்சொல்","Invalid user":"தவறான பயனர்","Partial score:":"பகுதி மதிப்பெண்:","(out of played activities)":"(விளையாடிய நடவடிக்கைகளுக்கு வெளியே)","Activities played at least once:":"செயல்பாடுகள் ஒரு முறையாவது:",Reports:"அறிக்கை அமைப்பு:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"முடிந்த நடவடிக்கைகள்:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},tr:{Version:"Sürüm",time:"zaman",actions:"Denemeler",score:"sonuç","Next activity":"Sonraki etkinlik","Previous activity":"Önceki etkinlik","Restart activity":"Etkinliği yeniden başlat",Information:"Bilgi","Results are not currently being saved":"Sonuçlar şu anda kaydedilmiyor","Current results":"Geçerli sonuçlar","Session started:":"Oturum başlatıldı:","Reports system:":"Sistem raporları:","User:":"Kullanıcı:","Projects:":"Projeler:","Sequences:":"Sekanslar:","Activities done:":"Tamamlanan etkinlikler:","Activities solved:":"Çözülen etkinlikler:","Global score:":"Genel puan:","(out of all project activities)":"Toplam etkinlik süresi:","Total time in activities:":"Toplam etkinlik süresi:","Actions done:":"Tamamlanan işlemler:","No activities done!":"Tamamlanan etkinlik yok!",Project:"Proje",sequence:"Etkinlik dizisi",activity:"Etkinlik",OK:"Tamam",YES:"Evet",NO:"Hayır","Total:":"Toplam:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Genel puan:","(out of played activities)":"(out of played activities)","Activities played at least once:":"Tamamlanan etkinlikler:",Reports:"Sistem raporları:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Tamamlanan etkinlikler:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},uk:{Version:"Версія",time:"Час",actions:"спроби",score:"оцінка","Next activity":"Наступна діяльність","Previous activity":"Попередня діяльність","Restart activity":"Перезапуск діяльності",Information:"Інформація","Results are not currently being saved":"Звіт не зареєстровано в БД","Current results":"Звіти користувача","Session started:":"Сеанс розпочато:","Reports system:":"Система звітів:","User:":"Користувач:","Projects:":"Проєкти:","Sequences:":"Послідовності:","Activities done:":"Виконані діяльності:","Activities solved:":"Вирішені діяльності:","Global score:":"Загальна оцінка:","(out of all project activities)":"(з усіх діяльностей проєкту)","Total time in activities:":"Загальний час діяльності:","Actions done:":"Виконані дії:","No activities done!":"Жодних діяльностей не виконано!",Project:"Проєкт",sequence:"послідовність",activity:"активність",OK:"Гаразд",YES:"Так",NO:"Ні","Total:":"Підсумок:","Select group:":"Вибрати групу:","Select user:":"Виберіть користувача:",Cancel:"Скасувати",Close:"Закрити","Copy data to clipboard":"Копіювати дані в буфер обміну","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Дані скопійовані у форматі HTML. Будь ласка, вставте їх в електронну таблицю або у текстовий редактор","The data has been copied to clipboard":"Дані скопійовано до буферу обміну","not connected":"Немає з’єднання","Please wait until the results of your activities are sent to the reports system":"Будь ласка, зачекайте, поки результати вашої діяльності будуть надіслані до системи звітів","Password:":"Пароль:","Incorrect password":"Неправильний пароль","Invalid user":"Неприпустимий користувач","Partial score:":"Часткова оцінка:","(out of played activities)":"(поза відтвореними діяльностями)","Activities played at least once:":"Діяльності, які відтворювалися принаймні один раз:",Reports:"Система звітів:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Виконані діяльності:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},vec:{Version:"Version",time:"tenpo",actions:"tentadivi",score:"pontexio","Next activity":"Pròsima atività","Previous activity":"Atività presedente","Restart activity":"Invìa atività da novo",Information:"Informasion","Results are not currently being saved":"Report no registrà inte nisun database","Current results":"Reports utenti","Session started:":"Sesion inviada:","Reports system:":"Sistèma de report","User:":"Utente:","Projects:":"Proxèti:","Sequences:":"Secuense:","Activities done:":"Atività fate:","Activities solved:":"Atività ok:","Global score:":"Pontexio global","(out of all project activities)":"Tenpo total so ƚe atività","Total time in activities:":"Tenpo total so ƚe atività","Actions done:":"Asion exeguìe","No activities done!":"No xé stà reportà atività!",Project:"Proxèto:",sequence:"secuensa",activity:"Atività",OK:"Ok",YES:"SI",NO:"NO","Total:":"Total:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"Pontexio global","(out of played activities)":"(out of played activities)","Activities played at least once:":"Atività fate:",Reports:"Sistèma de report","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"Atività fate:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"},zh_TW:{Version:"版本",time:"時間",actions:"嘗試次數",score:"分數","Next activity":"下一個活動","Previous activity":"上一個活動","Restart activity":"重設活動",Information:"相關資訊","Results are not currently being saved":"回報在DB中無註冊","Current results":"使用者報告","Session started:":"工作開始:","Reports system:":"報告系統:","User:":"使用者:","Projects:":"專案:","Sequences:":"順序:","Activities done:":"活動結束:","Activities solved:":"活動完成:","Global score:":"總成績:","(out of all project activities)":"活動總時間:","Total time in activities:":"活動總時間:","Actions done:":"活動完成:","No activities done!":"沒有活動完成!",Project:"專案",sequence:"順序",activity:"活動",OK:"確定",YES:"是",NO:"否","Total:":"總計:","Select group:":"Select group:","Select user:":"Select user:",Cancel:"Cancel",Close:"Close","Copy data to clipboard":"Copy data to clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor","The data has been copied to clipboard":"The data has been copied to clipboard","not connected":"not connected","Please wait until the results of your activities are sent to the reports system":"Please wait until the results of your activities are sent to the reports system","Password:":"Password:","Incorrect password":"Incorrect password","Invalid user":"Invalid user","Partial score:":"總成績:","(out of played activities)":"(out of played activities)","Activities played at least once:":"活動結束:",Reports:"報告系統:","Toggle full screen":"Toggle full screen","JClic logo":"JClic logo",message:"message","Activity panel":"活動結束:",cell:"cell",image:"image",source:"source",target:"target","image fragment":"image fragment"}}},l={$:e,JSZip:n(),JSZipUtils:a()},c=["none","error","warn","info","debug","trace","all"],h=[" ","ERROR","WARN ","INFO ","DEBUG","TRACE","ALL "],u={level:2,prefix:"JClic",timestamp:!0,popupOnErrors:!1,chainTo:null,pipeTo:null};let d={};function p(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t=$(t),e&&(void 0!==t.logLevel&&g(t.logLevel),"function"==typeof t.chainLogTo&&(u.chainTo=t.chainLogTo),"function"==typeof t.pipeLogTo&&(u.pipeTo=t.pipeLogTo)),i){const e=t.lang,i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=-1,n=[];if(i){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[,e=null,i=null,s=null]=/^([a-zA-Z]{2,3})[_-]?([a-zA-Z]{2})?@?([a-zA-Z0-9]*)?$/.exec(t.trim())||[];return e?`${e.toLowerCase()}${i?`_${i.toUpperCase()}`:""}${s?`@${s.toLowerCase()}`:""}`:""}(i);t&&n.push(t)}window.navigator.languages&&(n=n.concat(window.navigator.languages));window.navigator.language&&n.push(window.navigator.language);n.push(e);for(let e=0;e<n.length;e++){let i=-1;for(let r in t)if(0===n[e].indexOf(t[r])&&(i=r,n[e]===t[r])){s=r;break}if(s>=0||(s=i)>=0)break}return t[s>=0?s:0]}(o.languages,"en",e);m("debug",`Language ${e?`requested: "${e}" `:""} used: "${i}"`),d="en"===i?{}:o.messages[i]}return t}function f(t){return d[t]||t}function g(t){const e=c.indexOf(t);e>=0&&(u.level=e)}function m(t,e){const i=c.indexOf(t),s=Array.prototype.slice.call(arguments);if(i<0||i<=u.level)if(u.pipeTo)u.pipeTo.apply(null,s);else{const t=`${u.prefix||""} ${h[i]} ${u.timestamp?x():""} ${e}`;console[1===i?"error":2===i?"warn":"log"].apply(console,[t].concat(s.slice(2))),u.chainTo&&u.chainTo.apply(null,s)}}function v(t){return"true"===t||"false"!==t&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1])}function b(t){return""===t||null==t?arguments.length>1&&void 0!==arguments[1]?arguments[1]:null:t}function y(t,e){return Number(b(t,e))}function w(t){return`${Math.round(100*t)}%`}function A(t){return`0${t}`.slice(-2)}function C(t){const e=new Date(t),i=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds();return`${i?i+"h ":""}${i||s?A(s)+"'":""}${A(n)}"`}function x(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return`${t.getFullYear()}/${A(t.getMonth()+1)}/${A(t.getDate())} ${A(t.getHours())}:${A(t.getMinutes())}:${A(t.getSeconds())}`}function k(t){let e=null;if(t){const i=t.trim().split("/");if(3===i.length){let t=parseInt(i[0])||0,s=parseInt(i[1])||0,n=parseInt(i[2])||0;if(t>12&&s<=12){const e=t;t=s,s=e}n<1980&&(n+=n<90?2e3:1900),s&&t&&n&&(e=new Date(Date.parse(`${t}/${s}/${n}`)))}}return e||new Date}function S(t){if(t){if(!t.match(/^[a-z][a-z][a-z]?$/)){const e=t.match(/\(([a-z][a-z][a-z]?)\)/);t=e&&2===e.length?e[1]:"--"}}else t="--";return t}function T(t){return"true"===t?1:"false"===t?0:arguments.length>1&&void 0!==arguments[1]?arguments[1]:2}function E(t){return Array(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).fill(t).join("")}function P(t){return null==t}function I(t,e){return null==t&&null==e||t===e}function B(t){let i="";return e(t).children("p").each((t,e)=>{i+=`<p>${e.textContent}</p>`}),i}function _(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i={};t.attributes&&ht(t.attributes,(t,e)=>i[t]=/^-?\d*$/.test(e)?Number(e):e);const s=[],n=Array.from(t.children||t.childNodes||[]),r=n.filter(t=>"p"===t.nodeName);if(r.length>0&&r.length===n.filter(t=>"#text"!==t.nodeName).length){const e=r.map(t=>t.textContent).join("\n");return t.attributes?(i.text=e,i):e}return n.forEach(t=>{if("#text"===t.nodeName&&!e)return;const n=_(t,e);if(i[t.nodeName]||(i[t.nodeName]={},s.push(t.nodeName)),n.id)i[t.nodeName][n.id]=n;else{const e=Object.keys(i[t.nodeName]).length;i[t.nodeName][e]=n}}),s.forEach(t=>{const e=Object.keys(i[t]);if(!e.find(t=>isNaN(t)))if(1===e.length)i[t]=i[t][0];else{const s=[];e.forEach(e=>s.push(i[t][e])),i[t]=s}}),0===n.length&&t.textContent&&(i.textContent=t.textContent),i}function R(t){const e=_(t);return"string"==typeof e?e:e.hasOwnProperty("text")?e.text:e.hasOwnProperty("textContent")?e.textContent:e}function O(t){if(t){Object.keys(t).forEach(e=>{const i=t[e];if("object"==typeof i){const s=Object.keys(i);1===s.length&&"text"===s[0]?t[e]=i.text:t[e]=O(i)}})}return t}function D(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gt.BoxBase.BACK_COLOR;if(null==t&&(t=e),"#"===(t=t.replace("0x","#")).charAt(0)&&t.length>7){const e=W(parseInt(t.substring(1,3),16)/255,2);t=`rgba(${parseInt(t.substring(3,5),16)},${parseInt(t.substring(5,7),16)},${parseInt(t.substring(7,9),16)},${e})`}return t}function M(t){if(Z(t,"rgba(")){var e=parseInt(t.substring(t.lastIndexOf(",")));return"number"==typeof e&&e<1}return!1}function N(t){return e.extend(!0,Object.create(Object.getPrototypeOf(t)),t)}function $(t){const i={};return t&&e.each(t,(t,e)=>{let s;"string"==typeof e&&""!==(s=e.trim().toLowerCase())&&(e="true"===s||"false"!==s&&(isNaN(s)?e:Number(s))),i[t]=e}),i}function V(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={};return e=e||Object.keys(t),e.forEach(e=>{const[s,n]=e.split("|");if(t.hasOwnProperty(s)&&void 0!==t[s]&&null!==t[s]&&t[s].toString()!==n){const e=q(t[s]);j(e)||(i[s]=e)}}),e=Object.keys(i),1===e.length&&"text"===e[0]&&(i=i.text),i}function q(t){return t.getAttributes?t.getAttributes():t instanceof Array?t.map(t=>q(t)):t instanceof Date?t.toISOString():t instanceof Object?V(t):t}function j(t){let e=null==t;if(!e)switch(typeof t){case"object":e=0===Object.keys(t).length;break;case"string":e=0===t.length}return e}function L(t,e,i){return i.forEach(i=>{if(i.key){const{key:s,fn:n,group:r,init:a,params:o}=i;if(!j(e[s])){const i=e[s];t[s]="object"===r?Object.keys(i).reduce((t,e)=>(t[e]=F(n,i[e],"key"===a?e:a,o),t),{}):"array"===r?i.map((t,e)=>F(n,t,"key"===a?e:a,o)):F(n,i,a,o)}}else j(e[i])||(t[i]=e[i])}),t}function F(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return t.factory?t.factory(e,i,s):new t(i).setAttributes(e,...s)}function z(t){return gt.SEPARATORS.includes(t)}function U(t){return gt.WORD_DELIMITERS.includes(t)}function H(t){const e=[];let i={text:"",sep:""},s=!0;for(let n=0;n<t.length;n++){const r=t.charAt(n),a=U(r);s?a?(s=!1,i.sep=r):i.text+=r:a?i.sep+=r:(e.push(i),i={text:r,sep:""},s=!0)}return e.push(i),e}function J(t,e){return Math.round(t/e)*e}function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return t.toFixed?Number(t.toFixed(e)):t}function G(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null===t||0===t.length||null===e||0===e.length)return!1;i||s||(t=t.toUpperCase()),t=t.trim(),s=s&&/\d/.test(t);for(let n of e.split("|"))if(s){if(Number.parseFloat(t.replace(/,/,"."))===Number.parseFloat(n.replace(/,/,".")))return!0}else if(t===(i?n:n.toUpperCase()).trim())return!0;return!1}function K(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&((arguments.length>2?arguments[2]:void 0)?t.trim():t).endsWith(e)}function Z(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&0===((arguments.length>2?arguments[2]:void 0)?t.trim():t).indexOf(e)}function Y(t){return t?t.replace(/\\/g,"/"):t}function Q(t){return/^(filesystem:)?(https?|file|data|ftps?):/i.test(t)}function X(t){const e=t.lastIndexOf("/");return e>=0?t.substring(0,e+1):""}function tt(t,e){return e&&""!==e&&0===t.indexOf(e)?t.substring(e.length):t}function et(t,e){return Q(e)?e:t+e}function it(t,e,i){if(i){const s=tt(t+e,i.zipBasePath);if(i.files[s])return new Promise((t,n)=>{i.file(s).async("base64").then(i=>{const s=e.toLowerCase().split(".").pop(),n=gt.MIME_TYPES[s]||"application/octet-stream";t(`data:${n};base64,${i}`)}).catch(n)})}return Promise.resolve(et(t,e))}const st={doubleCell:(t,i)=>e("<tr/>").append(e("<td/>").html(t)).append(e("<td/>").html(i)),p:t=>e("<p/>").html(t),td:(t,i)=>e("<td/>",i?{class:i}:null).html(t),th:(t,i)=>e("<th/>",i?{class:i}:null).html(t)};function nt(t,e,i,s){return e&&(t=t.replace(/width=\"\d*\"/,`width="${e}"`)),i&&(t=t.replace(/height=\"\d*\"/,`height="${i}"`)),s&&(t=t.replace(/fill=\"[#A-Za-z0-9]*\"/,`fill="${s}"`)),t}function rt(t,e,i,s){return"data:image/svg+xml;base64,"+window.btoa(nt(t,e,i,s))}function at(t,e,i,s){const n=null==t?null:isNaN(t)?t:t<0?`${Math.abs(t)}%`:`${t}px`;return e&&i&&(n||s)&&(e[i]=null!==n?n:s),n}function ot(t,e){const i=document.createElement("canvas");i.width=e.dim.width,i.height=e.dim.height;const s=i.getContext("2d");let n="";try{s.drawImage(t,e.pos.x,e.pos.y,e.dim.width,e.dim.height,0,0,e.dim.width,e.dim.height),n=i.toDataURL()}catch(t){m("error",t)}return n}function lt(t){if(t){for(;t.parentElement;)t=t.parentElement;t instanceof HTMLElement&&(t=t.parentNode||t),t=t.head||t}return t||document.head}function ct(t,e){const i=lt(e&&e.$topDiv?e.$topDiv[0]:null),s=document.createElement("style");return s.type="text/css",s.appendChild(document.createTextNode(t)),i.appendChild(s)}function ht(t,e){for(let i=0;i<t.length;i++)e(t[i].name,t[i].value)}function ut(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t[e]?i.push(t):Object.values(t).forEach(t=>{"object"==typeof t&&ut(t,e,i)}),i}function dt(t){let e=0;const i=t.ownerDocument||t.document,s=i.defaultView||i.parentWindow;let n;if(void 0!==s.getSelection){if(n=s.getSelection(),n.rangeCount>0){const i=s.getSelection().getRangeAt(0),n=i.cloneRange();n.selectNodeContents(t),n.setEnd(i.endContainer,i.endOffset),e=n.toString().length}}else if((n=i.selection)&&"Control"!==n.type){const s=n.createRange(),r=i.body.createTextRange();r.moveToElementText(t),r.setEndPoint("EndToEnd",s),e=r.text.length}return e}function pt(t){const e=[];if(3===t.nodeType)e.push(t);else{const i=t.childNodes;for(let t=0,s=i.length;t<s;++t)e.push.apply(e,pt(i[t]))}return e}function ft(t,e,i){if(P(i)&&(i=e),document.createRange&&window.getSelection){const s=document.createRange();s.selectNodeContents(t);const n=pt(t);let r,a,o=!1,l=0;for(let t=0;t<n.length;t++){if(a=n[t],r=l+a.length,!o&&e>=l&&(e<r||e===r&&t+1<=n.length)&&(s.setStart(a,e-l),o=!0),o&&i<=r){s.setEnd(a,i-l);break}l=r}const c=window.getSelection();c.removeAllRanges(),c.addRange(s)}else if(document.selection&&document.body.createTextRange){const s=document.body.createTextRange();s.moveToElementText(t),s.collapse(!0),s.moveEnd("character",i),s.moveStart("character",e),s.select()}}const gt={VERSION:o.version,NODEJS:"undefined"==typeof window||window?.navigator?.userAgent?.includes("jsdom"),AB:0,BA:1,AUB:2,BUA:3,LAYOUT_NAMES:["AB","BA","AUB","BUA"],DEFAULT_WIDTH:400,DEFAULT_HEIGHT:300,MINIMUM_WIDTH:40,MINIMUM_HEIGHT:40,DEFAULT_NAME:"---",DEFAULT_MARGIN:8,DEFAULT_SHUFFLES:31,DEFAULT_GRID_ELEMENT_SIZE:20,MIN_CELL_SIZE:10,DEFAULT_BG_COLOR:"#C0C0C0",ACTIONS:{ACTION_MATCH:"MATCH",ACTION_PLACE:"PLACE",ACTION_WRITE:"WRITE",ACTION_SELECT:"SELECT",ACTION_HELP:"HELP"},PREVIOUS:0,MAIN:1,END:2,END_ERROR:3,NUM_MSG:4,MSG_TYPE:["previous","initial","final","finalError"],RANDOM_CHARS:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",NUM_COUNTERS:3,MAX_RECORD_LENGTH:180,BoxBase:{REDUCE_FONT_STEP:1,MIN_FONT_SIZE:8,STROKE:1,AC_MARGIN:6,BACK_COLOR:"#C0C0C0",TEXT_COLOR:"black",SHADOW_COLOR:"gray",INACTIVE_COLOR:"gray",ALTERNATIVE_COLOR:"gray",BORDER_COLOR:"black",BORDER_STROKE_WIDTH:.75,MARKER_STROKE_WIDTH:2.75},FILE_TYPES:{image:"gif,jpg,png,jpeg,bmp,ico,svg",audio:"wav,mp3,ogg,oga,au,aiff,flac",video:"avi,mov,mpeg,mp4,ogv,m4v,webm",font:"ttf,otf,eot,woff,woff2",midi:"mid,midi",anim:"swf",xml:"xml"},MIME_TYPES:{xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",wav:"audio/wav",mp3:"audio/mpeg",mp4:"video/mp4",m4v:"video/mp4",ogg:"audio/ogg",oga:"audio/ogg",ogv:"video/ogg",webm:"video/webm",au:"audio/basic",aiff:"audio/x-aiff",flac:"audio/flac",avi:"video/avi",mov:"video/quicktime",mpeg:"video/mpeg",ttf:"application/font-sfnt",otf:"application/font-sfnt",eot:" application/vnd.ms-fontobject",woff:"application/font-woff",woff2:"application/font-woff2",swf:"application/x-shockwave-flash",mid:"audio/midi",midi:"audio/midi"},COMPRESS_IMAGES:!0,VK:{LEFT:37,UP:38,RIGHT:39,DOWN:40},TOUCH_DEVICE:!1,LOAD_TIMEOUT:1e4,BEZIER_POINTS:4,CANVAS_DRAW_FOCUS:"undefined"!=typeof window&&"function"==typeof window?.CanvasRenderingContext2D?.prototype?.drawFocusIfNeeded,WHITESPACES:" \f\n\r\t\v \u2028\u2029 \ufeff"};gt.SEPARATORS=`${gt.WHITESPACES}.,;-|`,gt.WORD_DELIMITERS=`${gt.SEPARATORS}…_<>"“”«»'´\`‘’•~+–—―=%¿?¡!:/\\()[]{}$£€`;const mt={pkg:l,settings:gt,getMsg:f,LOG_LEVELS:c,LOG_PRINT_LABELS:h,LOG_OPTIONS:u,init:p,setLogLevel:g,log:m,getBoolean:v,getVal:b,getNumber:y,getPercent:w,zp:A,getHMStime:C,getDateTime:x,parseOldDate:k,cleanOldLanguageTag:S,FALSE:0,TRUE:1,DEFAULT:2,getTriState:T,fillString:E,isNullOrUndef:P,isEquivalent:I,getXmlText:B,parseXmlNode:_,getXmlNodeText:R,reduceTextsToStrings:O,cssToString:function(t){return Object.keys(t).reduce((e,i)=>`${e}${i}:${t[i]};`,"")},checkColor:D,colorHasTransparency:M,cloneObject:N,normalizeObject:$,getAttr:V,getValue:q,isEmpty:j,setAttr:L,buildObj:F,isSeparator:z,isWordDelimiter:U,stringToWords:H,roundTo:J,fx:W,compareMultipleOptions:G,endsWith:K,startsWith:Z,nSlash:Y,isURL:Q,getBasePath:X,getRelativePath:tt,getPath:et,getPathPromise:it,$HTML:st,getSvg:nt,svgToURI:rt,toCssSize:at,getImgClipUrl:ot,getRootHead:lt,appendStyleAtHead:ct,attrForEach:ht,findParentsWithChild:ut,getCaretCharacterOffsetWithin:dt,getTextNodesIn:pt,setSelectionRange:ft};var vt=i(371),bt=i.n(vt);class yt{constructor(t,e,i,s,n){t&&(this.family=t),"number"==typeof e&&(this.size=e),i&&(this.bold=i),s&&(this.italic=s),n&&(this.variant=n),this._metrics={ascent:-1,descent:-1,height:-1}}static checkTree(t,i){let s=yt.SUBSTITUTIONS;i&&i.ownFonts&&i.ownFonts.forEach(t=>{yt.ALREADY_LOADED_FONTS.indexOf(t)<0&&bt()&&bt().load&&(bt().load({custom:{families:[t]}}),yt.ALREADY_LOADED_FONTS.push(t),delete s[t.trim().toLowerCase()])}),i&&i.fontSubstitutions&&(s=e.extend(Object.create(s),i.fontSubstitutions)),t.jquery?t.find("style[family],font[family]").each((t,i)=>{const n=e(i),r=n.attr("family").trim().toLowerCase();if(r in s){const t=s[r];""!==t&&(yt.loadGoogleFont(t),n.attr("family",t))}}):ut(t,"family").forEach(t=>{if("string"==typeof t.family){const e=t.family;if(yt.GOOGLEFONTS.includes(e))yt.loadGoogleFont(e);else{const i=s[e.trim().toLowerCase()];i&&(yt.loadGoogleFont(i),t.family=i)}}})}static loadGoogleFont(t){t&&!yt.ALREADY_LOADED_FONTS.includes(t)&&bt()&&bt().load&&(bt().load({google:{families:[t]}}),yt.ALREADY_LOADED_FONTS.push(t))}static loadGoogleFonts(t){t&&t.forEach&&t.forEach(t=>yt.loadGoogleFont(t))}setProperties(t){return t.attr("family")&&(this.family=t.attr("family")),t.attr("size")&&(this.size=Number(t.attr("size"))),t.attr("bold")&&(this.bold=v(t.attr("bold"))),t.attr("italic")&&(this.italic=v(t.attr("italic"))),t.attr("variant")&&(this.variant=t.attr("variant")),this}getAttributes(){return V(this,["family|Arial","size|17","bold|0","italic|0","variant"])}setAttributes(t){return L(this,t,["family","size","bold","italic","variant"])}setSize(t){const e=this.size;return this.size=t,e!==t&&(this._metrics.height=-1),this}zoom(t){return this.setSize(this.size+t)}getMetrics(){if(this._metrics.height<0){const t=yt.ALREADY_CALCULATED_FONTS.find(t=>t.equals(this));t&&Object.assign(this._metrics,t._metrics),this._metrics.height<0&&(this._calcHeight(),this._metrics.height>0&&yt.ALREADY_CALCULATED_FONTS.push(this))}return this._metrics}getHeight(){return this.getMetrics().height}toCss(t){return t||(t={}),t["font-family"]=this.family,t["font-size"]=`${this.size}px`,this.hasOwnProperty("bold")&&(t["font-weight"]=this.bold?"bold":"normal"),this.hasOwnProperty("italic")&&(t["font-style"]=this.italic?"italic":"normal"),this.hasOwnProperty("variant")&&(t["font-variant"]=this.variant),t}cssFont(){return`${this.italic?"italic ":"normal"} ${""===this.variant?"normal":this.variant} ${this.bold?"bold ":"normal"} ${this.size}px ${this.family}`}_calcHeight(){const t=e("<span/>").html("Hg").css(this.toCss()),i=e("<div/>").css({display:"inline-block",width:"1px",height:"0px"}),s=e("<div/>").append(t,i);e("body").append(s);try{i.css({verticalAlign:"baseline"}),this._metrics.ascent=i.offset().top-t.offset().top,i.css({verticalAlign:"bottom"}),this._metrics.height=i.offset().top-t.offset().top,this._metrics.descent=this._metrics.height-this._metrics.ascent}finally{s.remove()}return this}equals(t){return this.family===t.family&&this.size===t.size&&this.bold===t.bold&&this.italic===t.italic&&this.variant===t.variant}}yt.ALREADY_CALCULATED_FONTS=[],yt.ALREADY_LOADED_FONTS=["serif","sans-serif","monospace","cursive","fantasy"],yt.SUBSTITUTIONS={dialog:"sans-serif",dialoginput:"sans-serif",monospaced:"monospace",sansserif:"sans-serif",abc:"Kalam","a.c.m.e. secret agent":"Permanent Marker","comic sans ms":"Patrick Hand",impact:"Oswald",massallera:"Vibur",memima:"Vibur",memima_n1:"Vibur",memima_n2:"Vibur","memimas-regularalternate":"Vibur",palmemim:"Vibur",zurichcalligraphic:"Felipa"},yt.GOOGLEFONTS=["Kalam","Permanent Marker","Patrick Hand","Oswald","Vibur","Felipa"],Object.assign(yt.prototype,{family:"Arial",size:17,bold:0,italic:0,variant:"",_metrics:{ascent:-1,descent:-1,height:-1}});class wt{constructor(t,e,i,s){t&&(this.c1=t),e&&(this.c2=e),"number"==typeof i&&(this.angle=i%360),"number"==typeof s&&(this.cycles=s)}setProperties(t){return this.c1=D(t.attr("source"),"black"),this.c2=D(t.attr("dest"),"white"),this.angle=Number(t.attr("angle")||0)%360,this.cycles=Number(t.attr("cycles")||1),this}getAttributes(){return V(this,["c1","c2","angle|0","cycles|1"])}setAttributes(t){return L(this,t,["c1","c2","angle","cycles"])}getGradient(t,e){const i=e.getOppositeVertex(),s=t.createLinearGradient(e.pos.x,e.pos.y,i.x,i.y),n=1/Math.max(this.cycles,1);for(let t=0;t<=this.cycles;t++)s.addColorStop(t*n,t%2?this.c1:this.c2);return s}getCss(){let t=`linear-gradient(${this.angle+90}deg, ${this.c1}, ${this.c2}`;for(let e=1;e<this.cycles;e++)t=`${t}, ${e%2>0?this.c1:this.c2}`;return`${t})`}hasTransparency(){return M(this.c1)||M(this.c2)}}Object.assign(wt.prototype,{c1:"white",c2:"black",angle:0,cycles:1});class At{constructor(t,e,i,s){"number"==typeof t&&(this.lineWidth=t),e&&(this.lineCap=e),i&&(this.lineJoin=i),"number"==typeof s&&(this.miterLimit=s)}getAttributes(){return V(this,["lineWidth|1","lineCap|butt","lineJoin|miter","miterLimit|10"])}setAttributes(t){return L(this,t,["lineWidth","lineCap","lineJoin","miterLimit"])}setStroke(t){return t.lineWidth=this.lineWidth,t.lineCap=this.lineCap,t.lineJoin=this.lineJoin,t.miterLimit=this.miterLimit,t}}Object.assign(At.prototype,{lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10});class Ct{constructor(t,e){t instanceof Ct?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}setProperties(t){return this.x=Number(t.attr("x")),this.y=Number(t.attr("y")),this}getAttributes(){return V(this,["x","y"])}setAttributes(t){return L(this,t,["x","y"])}moveBy(t){return this.x+=t.x||t.width||0,this.y+=t.y||t.height||0,this}moveTo(t,e){return"number"==typeof t?(this.x=t,this.y=e):(this.x=t.x,this.y=t.y),this}multBy(t){return this.x*=t.x||t.width||0,this.y*=t.y||t.height||0,this}equals(t){return this.x===t.x&&this.y===t.y}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2),Math.pow(this.y-t.y,2))}clone(){return new Ct(this)}}Object.assign(Ct.prototype,{x:0,y:0});class xt{constructor(t,e){t instanceof Ct&&e instanceof Ct?(this.width=e.x-t.x,this.height=e.y-t.y):(this.width=t||0,this.height=e||0)}setProperties(t){return this.width=Number(t.attr("width")),this.height=Number(t.attr("height")),this}getAttributes(){return V(this,["width","height"])}setAttributes(t){return L(this,t,["width","height"])}equals(t){return this.width===t.width&&this.height===t.height}multBy(t){return this.width*=t.x||t.width||0,this.height*=t.y||t.height||0,this}setDimension(t,e){return t instanceof xt&&(e=t.height,t=t.width),this.width=t,this.height=e,this}getSurface(){return this.width*this.height}}Object.assign(xt.prototype,{width:0,height:0});class kt{constructor(t){this.pos=t||new Ct}moveBy(t){return this.pos.moveBy(t),this}moveTo(t){return this.pos.moveTo(t),this}getBounds(){return new St(this.pos)}equals(t){return this.pos.equals(t.pos)}scaleBy(t){return this}getShape(t){return this.clone().scaleBy(t.dim).moveBy(t.pos)}contains(t){return!1}intersects(t){return!1}fill(t,e){return t.save(),e&&e.getSurface()>0&&(t.beginPath(),t.rect(e.pos.x,e.pos.y,e.dim.width,e.dim.height),t.clip()),this.preparePath(t),t.fill(),t.restore(),t}stroke(t){return this.preparePath(t),t.stroke(),t}preparePath(t){return t}clip(t,e){return this.preparePath(t),t.clip(e||"nonzero"),t}isRect(){return!1}toString(){return`Shape enclosed in ${this.getBounds().getCoords()}`}setAttributes(t){return kt.buildShape(t)}static buildShape(t){const e="rect"===t.type&&St||"ellipse"===t.type&&Tt||"path"===t.type&&Et||null;if(e)return(new e).setAttributes(t);console.log("unknown shape:",t)}}Object.assign(kt.prototype,{type:"shape",pos:new Ct,type:"shape"});class St extends kt{constructor(t,e,i,s){let n=t,r=e;t instanceof St?(r=new xt(t.dim.width,t.dim.height),n=new Ct(t.pos.x,t.pos.y)):t instanceof Ct?(n=new Ct(t.x,t.y),e instanceof xt&&(r=new xt(e.width,e.height))):t instanceof Array?(n=new Ct(t[0],t[1]),r=new xt(t[2]-t[0],t[3]-t[1])):"number"==typeof i&&"number"==typeof s&&(n=new Ct(t,e),r=new xt(i,s)),super(n),this.dim=r instanceof xt?r:r instanceof Ct?new xt(r.x-this.pos.x,r.y-this.pos.y):new xt,this.type="rect"}getBounds(){return this}setBounds(t){return t||(t=new St),this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this}equals(t){return t instanceof St&&this.pos.equals(t.pos)&&this.dim.equals(t.dim)}clone(){return new St(this)}scaleBy(t){return this.pos.multBy(t),this.dim.multBy(t),this}grow(t,e){return this.pos.x-=t,this.pos.y-=e,this.dim.width+=2*t,this.dim.height+=2*e,this}getOppositeVertex(){return new Ct(this.pos.x+this.dim.width,this.pos.y+this.dim.height)}add(t){const e=this.getOppositeVertex(),i=t.getBounds().getOppositeVertex();return this.pos.moveTo(Math.min(this.pos.x,t.getBounds().pos.x),Math.min(this.pos.y,t.getBounds().pos.y)),this.dim.setDimension(Math.max(e.x,i.x)-this.pos.x,Math.max(e.y,i.y)-this.pos.y),this}contains(t){const e=this.getOppositeVertex();return t.x>=this.pos.x&&t.x<=e.x&&t.y>=this.pos.y&&t.y<=e.y}intersects(t){const e=this.pos,i=this.getOppositeVertex(),s=t.pos,n=t.getOppositeVertex();return n.x>=e.x&&s.x<=i.x&&n.y>=e.y&&s.y<=i.y}preparePath(t){return t.beginPath(),t.rect(this.pos.x,this.pos.y,this.dim.width,this.dim.height),t}getSurface(){return this.dim.getSurface()}isEmpty(){return 0===this.getSurface()}isRect(){return!0}toString(){return`Rectangle ${this.getCoords()}`}getCoords(){return`[${Math.round(this.pos.x)},${Math.round(this.pos.y)},${Math.round(this.pos.x+this.dim.width)},${Math.round(this.pos.y+this.dim.height)}]`}getAttributes(){return V(this,["type","pos","dim"])}setAttributes(t){return L(this,t,["type",{key:"pos",fn:Ct},{key:"dim",fn:xt}])}}Object.assign(St.prototype,{type:"rect",dim:new xt});class Tt extends St{constructor(t,e,i,s){super(t,e,i,s)}preparePath(t){const e=.5522848,i=e*this.dim.width/2,s=e*this.dim.height/2,n=this.pos.x+this.dim.width,r=this.pos.y+this.dim.height,a=this.pos.x+this.dim.width/2,o=this.pos.y+this.dim.height/2;return t.beginPath(),t.moveTo(this.pos.x,o),t.bezierCurveTo(this.pos.x,o-s,a-i,this.pos.y,a,this.pos.y),t.bezierCurveTo(a+i,this.pos.y,n,o-s,n,o),t.bezierCurveTo(n,o+s,a+i,r,a,r),t.bezierCurveTo(a-i,r,this.pos.x,o+s,this.pos.x,o),t.closePath(),t}contains(t){let e=super.contains(t);if(e){const i=this.dim.width/2,s=this.dim.height/2,n=this.pos.x+i,r=this.pos.y+s;e=Math.pow(t.x-n,2)/Math.pow(i,2)+Math.pow(t.y-r,2)/Math.pow(s,2)<=1}return e}getSurface(){return Math.PI*this.dim.width/2*this.dim.height/2}equals(t){return t instanceof Tt&&super.equals(t)}clone(){return new Tt(this.pos,this.dim)}isRect(){return!1}toString(){return`Ellipse enclosed in ${this.getCoords()}`}}Object.assign(Tt.prototype,{type:"ellipse"});class Et extends kt{constructor(t){super(),t&&this.setStrokes(t)}setStrokes(t){return this.strokes=[],t.forEach(t=>this.strokes.push(new Pt(t.type||t.action,t.points||t.data))),this.enclosing=new St,this.enclosingPoints=[],this.calcEnclosingRect(),this.pos=this.enclosing.pos,this}clone(){return new Et(this.strokes.map(t=>t.clone()))}addStroke(t){return this.strokes.push(t),this}calcEnclosingRect(){this.enclosingPoints=[];let t=new Ct;this.strokes.forEach(e=>{e.getEnclosingPoints(t).forEach(e=>{t=new Ct(e),this.enclosingPoints.push(t)})});let e=this.enclosingPoints.length;e>1&&this.enclosingPoints[0].equals(this.enclosingPoints[e-1])&&(this.enclosingPoints.pop(),e--);const i=new Ct(this.enclosingPoints[0]),s=new Ct(this.enclosingPoints[0]);for(let t=1;t<e;t++){const e=this.enclosingPoints[t];i.x=Math.min(e.x,i.x),i.y=Math.min(e.y,i.y),s.x=Math.max(e.x,s.x),s.y=Math.max(e.y,s.y)}return this.enclosing.setBounds(new St(i,new xt(i,s))),this.enclosing}getBounds(){return this.enclosing}moveBy(t){return this.strokes.forEach(e=>e.moveBy(t)),this.enclosingPoints.forEach(e=>e.moveBy(t)),this.enclosing.moveBy(t),this}moveTo(t){return this.moveBy(new xt(t.x-this.pos.x,t.y-this.pos.y))}equals(t){return!1}scaleBy(t){return this.strokes.forEach(e=>e.multBy(t)),this.enclosingPoints.forEach(e=>e.multBy(t)),this.enclosing.scaleBy(t),this}contains(t){let e=this.enclosing.contains(t);if(e){const i=this.enclosingPoints.length;let s=0,n=0,r=this.enclosingPoints[0];for(let e=1;e<=i;e++){const a=this.enclosingPoints[e%i];t.y>Math.min(r.y,a.y)&&t.y<=Math.max(r.y,a.y)&&t.x<=Math.max(r.x,a.x)&&r.y!==a.y&&(s=(t.y-r.y)*(a.x-r.x)/(a.y-r.y)+r.x,(r.x===a.x||t.x<=s)&&n++),r=a}n%2==0&&(e=!1)}return e}intersects(t){return this.enclosing.intersects(t)}preparePath(t){return t.beginPath(),this.strokes.forEach(e=>e.stroke(t)),t}getAttributes(){return{type:this.type,strokes:this.strokes.map(t=>t.getAttributes()).join("|")}}setAttributes(t){const e=t.strokes.split("|").map(t=>{const[e,i]=t.split(":");return new Pt(e,i?i.split(","):[])});return this.setStrokes(e)}}Object.assign(Et.prototype,{type:"path",strokes:[],enclosing:new St,enclosingPoints:[]});class Pt{constructor(t,e){if(this.type=t,e&&e.length>0)if(e[0]instanceof Ct)this.points=e.map(t=>new Ct(t));else{this.points=[];for(let t=0;t<e.length;t+=2)this.points.push(new Ct(e[t],e[t+1]))}}static getQuadraticPoints(t,e,i,s){s||(s=gt.BEZIER_POINTS);const n=[],r=new Ct,a=new Ct;for(let o=0;o<s;o++){const l=(o+1)/(s+1);r.x=t.x+(e.x-t.x)*l,r.y=t.y-(t.y-e.y)*l,a.x=e.x+(i.x-e.x)*l,a.y=e.y+(i.y-e.y)*l,n.push(new Ct(r.x+(a.x-r.x)*l,r.y-(r.y-a.y)*l))}return n}static getCubicPoints(t,e,i,s,n){const r=[];n||(n=gt.BEZIER_POINTS);const a=Pt.getQuadraticPoints(t,e,i,n),o=Pt.getQuadraticPoints(e,i,s,n);for(let t=0;t<n;t++){const e=(t+1)/(n+1);r.push(new Ct(a[t].x+(o[t].x-a[t].x)*e,a[t].y-(a[0].y-o[0].y)*e))}return r}clone(){return new Pt(this.type,this.points)}moveBy(t){return this.points&&this.points.forEach(e=>e.moveBy(t)),this}multBy(t){return this.points&&this.points.forEach(e=>e.multBy(t)),this}stroke(t){switch(this.type){case"M":t.moveTo(this.points[0].x,this.points[0].y);break;case"L":t.lineTo(this.points[0].x,this.points[0].y);break;case"Q":t.quadraticCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y);break;case"B":t.bezierCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y,this.points[2].x,this.points[2].y);break;case"X":t.closePath()}return t}getEnclosingPoints(t){let e=[];switch(this.type){case"M":case"L":e.push(this.points[0]);break;case"Q":e=Pt.getQuadraticPoints(t,this.points[0],this.points[1]),e.push(this.points[1]);break;case"B":e=Pt.getCubicPoints(t,this.points[0],this.points[1],this.points[2]),e.push(this.points[2])}return e}getAttributes(){return`${this.type}:${this.points?this.points.map(t=>`${W(t.x)},${W(t.y)}`).join(","):""}`}}Object.assign(Pt.prototype,{type:"X",points:null});class It{constructor(t,e){this.name=t,this.actionPerformed=e,this._statusListeners=[]}actionPerformed(t,e){return this}processEvent(t){return this.actionPerformed(this,t)}addStatusListener(t){this._statusListeners.push(t)}removeStatusListener(t){this._statusListeners=this._statusListeners.map(e=>e!==t)}setEnabled(t){return this.enabled=t,this._statusListeners.forEach(t=>t.call(this,this)),this}}Object.assign(It.prototype,{name:null,description:null,enabled:!1,_statusListeners:null});class Bt{constructor(t,e,i){this.actionPerformed=t,this.interval=e,this.setEnabled(!0===i)}actionPerformed(t){return this}processTimer(t){return this.ticks++,this.repeats||this.stop(),this.actionPerformed.call(this)}setEnabled(t,e){if(e||(this.ticks=0),!t||null===this.timer)return t?this.timer=window.setInterval(()=>this.processTimer(null),this.interval):null!==this.timer&&(window.clearInterval(this.timer),this.timer=null),this}isRunning(){return null!==this.timer}start(t){return this.setEnabled(!0,t)}stop(t){return this.setEnabled(!1,t)}}Object.assign(Bt.prototype,{interval:0,ticks:0,timer:null,repeats:!0});class _t extends St{constructor(t,e,i,s){super(t,e,i,s)}invalidate(t){return t?null===this.invalidatedRect?this.invalidatedRect=t.clone():this.invalidatedRect.add(t):this.invalidatedRect=null,this}update(){return this.updateContent(this.invalidatedRect),this.invalidatedRect=null,this}updateContent(t){return this}}Object.assign(_t.prototype,{invalidatedRect:null});const Rt={Font:yt,Gradient:wt,Stroke:At,Point:Ct,Dimension:xt,Shape:kt,Rectangle:St,Ellipse:Tt,Path:Et,PathStroke:Pt,Action:It,Timer:Bt,Container:_t};class Ot{constructor(t){this.player=t,this.sequenceStack=[],window&&window.history&&t.options.browserHistory&&(this.browserHistory=!0,e(window).on("popstate",t=>{const e=t.originalEvent.state;e&&this.processPopStateEvent(e)}))}processPopStateEvent(t){m("info","Processing History popstate event with state:",t),this.processingPop=!0,t.projectPath===this.player.project.path&&I(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}pushBrowserHistory(){if(this.browserHistory){if(this.processingPop)return void(this.processingPop=!1);const t=this.player.project.activitySequence,e=t.currentAct,i=this.player.actPanel.act.name||"No name",s=new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null);window.history.state?window.history.pushState(s,i):window.history.replaceState(s,i)}}storedElementsCount(){return this.sequenceStack.length}clearHistory(){this.sequenceStack=[0]}push(){if(null!==this.player.project&&null!==this.player.project.path){const t=this.player.project.activitySequence,e=t.currentAct;if(e>=0){if(this.sequenceStack.length>0){const t=this.sequenceStack[this.sequenceStack.length-1];if(t.projectPath===this.player.project.path&&t.activity===e)return}this.sequenceStack.push(new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null))}}}pop(){if(this.sequenceStack.length>0){const t=this.sequenceStack.pop();t.projectPath===this.player.project.path&&I(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.testMode&&null!==t.projectPath&&t.projectPath.length>0?m("info",`At this point, a jump to "${t.projectPath}" should be performed.`):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}return!0}processJump(t,e){let i=!1;if(null!==t&&null!==this.player.project)switch(t.action){case"STOP":break;case"RETURN":if(this.sequenceStack.length>0||!this.player.options.returnAsExit){i=this.pop();break}case"EXIT":this.testMode?m("info","At this point, the program should exit."):this.player.exit(t.sequence);break;case"JUMP":if(t.sequence||t.projectPath)this.testMode&&null!==t.projectPath&&t.projectPath.length>0?m("info",`At this point, a jump to "${t.projectPath}" should be performed.`):i=this.jumpToSequence(t.sequence,t.projectPath?et(this.player.project.basePath,t.projectPath):null,e);else{const s=this.player.project.activitySequence.getElement(t.actNum,!0);null!==s&&(e&&this.push(),this.player.load(null,null,s.activity),i=!0)}}return i}jumpToSequence(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(P(t)&&P(e))return!1;if(P(e)&&(e=this.player.project.path),this.sequenceStack.length>0){const i=this.sequenceStack[this.sequenceStack.length-1];if(!P(t)&&e===i.projectPath){let s=t===i.sequence;if(e===this.player.project.path){const e=this.player.project.activitySequence.getElement(i.activity,!1);s=null!==e&&t===e.tag}if(s)return this.pop()}}return i&&this.push(),e===this.player.project.path?this.player.load(null,t,null):this.player.load(e,t,null),!0}}Object.assign(Ot.prototype,{player:null,sequenceStack:[],testMode:!1,browserHistory:!1,processingPop:!1,HistoryElement:class{constructor(t,e,i,s){this.projectPath=t,this.sequence=e,this.activity=i,this.fullZipPath=s}}});const Dt=Ot;class Mt{constructor(t){navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&(this.enabled=!0),t&&(this.seconds=t),this.chunks=[]}play(){this.stop(),this.mediaPlayer?(this.mediaPlayer.currentTime=0,this.mediaPlayer.play()):this.playWhenFinished=!0}stop(){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.mediaPlayer&&!this.mediaPlayer.paused&&this.mediaPlayer.pause()}record(t){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.enabled&&(this.stop(),this.mediaPlayer=null,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(e=>{this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>this.chunks.push(t.data),this.mediaRecorder.onerror=t=>{m("error",`Error recording audio: ${t}`),this.mediaRecorder=null},this.mediaRecorder.onstart=()=>{m("debug","Recording audio started"),this.visualFeedbak(!0,t)},this.mediaRecorder.onstop=()=>{m("debug","Recording audio finished"),this.visualFeedbak(!1,t),this.timeoutID&&(window.clearTimeout(this.timeoutID),this.timeoutID=null);const e={};this.chunks.length>0&&this.chunks[0].type&&(e.type=this.chunks[0].type);const i=new Blob(this.chunks,e);this.chunks=[],this.mediaPlayer=document.createElement("audio"),this.mediaPlayer.src=URL.createObjectURL(i),this.mediaPlayer.pause(),this.mediaRecorder=null,this.playWhenFinished&&(this.playWhenFinished=!1,this.mediaPlayer.play())},this.mediaRecorder.onwarning=t=>m("warn",`Warning recording audio: ${t}`),this.playWhenFinished=!1,this.mediaRecorder.start(),this.timeoutID=window.setTimeout(()=>{this.mediaRecorder,this.mediaRecorder.stop()},1e3*this.seconds)}).catch(e=>{m("error",e.toString()),this.visualFeedbak(!1,t)}))}visualFeedbak(t,e){e&&e.css("cursor",t?"progress":"inherit")}clear(){this.stop(),this.mediaPlayer=null}}Object.assign(Mt.prototype,{enabled:!1,seconds:20,mediaRecorder:null,chunks:null,mediaPlayer:null,timeoutID:null,playWhenFinished:!1}),Mt.MAX_RECORD_LENGTH=180;const Nt=Mt;class $t{constructor(t,e,i){switch(this.mc=t,this.ps=i,t.type){case"RECORD_AUDIO":$t.AUDIO_BUFFERS&&(this.clearAudioBuffer(t.recBuffer),$t.AUDIO_BUFFERS[t.recBuffer]=new Nt(t.length));case"PLAY_RECORDED_AUDIO":this.useAudioBuffer=!0;break;case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":this.mbe=e.getElement(t.file,!0)}}realize(){this.mbe&&this.mbe.build(t=>{t.data&&t.data.pause&&!t.data.paused&&!t.data.ended&&t.data.currentTime&&t.data.pause(),"video"!==t.type&&"anim"!==t.type||!t.data||(this.$visualComponent=e(t.data),this.$visualComponent.css("z-index",20))},this.ps,!1,this.mc.level)}playNow(t){if(this.useAudioBuffer){if($t.AUDIO_BUFFERS){const t=this.ps&&this.ps.$div,e=$t.AUDIO_BUFFERS[this.mc.recBuffer];e&&("RECORD_AUDIO"===this.mc.type?e.record(t):e.play())}}else this.mbe&&this.mbe.build(()=>{if(this.mbe.data){if("midi"===this.mbe.type)this.mbe.data.playTo=this.mc.to||0;else{let t=!1;const i=e(this.mbe.data);i.off(),this.mc.to>0&&i.on("timeupdate",()=>{t&&this.mbe.data.currentTime>=this.mc.to/1e3&&(i.off("timeupdate"),this.mbe.data.pause())}),t=!0}this.mbe.data.paused||this.mbe.data.ended||!this.mbe.data.currentTime||this.mbe.data.pause(),this.mbe.data.currentTime=this.mc.from>0?this.mc.from/1e3:0,this.mbe.data.play()}},this.ps,!0,this.mc.level)}play(t){this.stopAllAudioBuffers(),this.playNow(t)}stop(){this.useAudioBuffer?this.stopAudioBuffer(this.mc.recBuffer):this.mbe&&this.mbe.data&&this.mbe.data.pause&&!this.mbe.data.paused&&!this.mbe.data.ended&&this.mbe.data.currentTime&&this.mbe.data.pause()}clear(){this.stop(),this.useAudioBuffer&&this.clearAudioBuffer(this.mc.recBuffer)}clearAudioBuffer(t){$t.AUDIO_BUFFERS&&t>=0&&t<$t.AUDIO_BUFFERS.length&&$t.AUDIO_BUFFERS[t]&&($t.AUDIO_BUFFERS[t].clear(),$t.AUDIO_BUFFERS[t]=null)}clearAllAudioBuffers(){$t.AUDIO_BUFFERS&&$t.AUDIO_BUFFERS.forEach((t,e)=>this.clearAudioBuffer(e))}countActiveBuffers(){return $t.AUDIO_BUFFERS?$t.AUDIO_BUFFERS.reduce((t,e)=>t+e?1:0,0):0}stopAllAudioBuffers(){$t.AUDIO_BUFFERS&&$t.AUDIO_BUFFERS.forEach(t=>t?t.stop():null)}stopAudioBuffer(t){$t.AUDIO_BUFFERS&&t>=0&&t<$t.AUDIO_BUFFERS.length&&$t.AUDIO_BUFFERS[t]&&$t.AUDIO_BUFFERS[t].stop()}checkVisualComponentBounds(t){}setVisualComponentVisible(t){}linkTo(t){this.bx=t,this.bx&&this.$visualComponent&&this.bx.setHostedComponent(this.$visualComponent)}}Object.assign($t.prototype,{mc:null,ps:null,bx:null,$visualComponent:null,useAudioBuffer:!1,mbe:null}),$t.REC_ENABLED="undefined"!=typeof MediaRecorder&&"undefined"!=typeof navigator,$t.REC_ENABLED&&(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia),$t.AUDIO_BUFFERS=$t.REC_ENABLED?[]:null;const Vt=$t;class qt{constructor(){this.players=[]}createActiveMediaPlayer(t,e,i){let s=null;switch(t.type){case"RECORD_AUDIO":if(t.length<=0||t.length>=gt.MAX_RECORD_LENGTH)break;case"PLAY_RECORDED_AUDIO":if(t.recBuffer<0||t.recBuffer>=10)break;case"PLAY_AUDIO":case"PLAY_MIDI":case"PLAY_VIDEO":s=new Vt(t,e,i)}return null!==s&&this.players.push(s),s}getActiveMediaPlayer(t,e,i){return this.players.find(e=>e.mc===t||e.mc.isEquivalent(t))||this.createActiveMediaPlayer(t,e,i)}removeActiveMediaPlayer(t){const e=this.players.findIndex(e=>e.mc===t);e>=0&&(this.players[e].clear(),this.players.splice(e,1))}realizeAll(){this.players.forEach(t=>t.realize())}stopAll(t){void 0===t&&(t=-1),this.players.forEach(e=>{(-1===t||null!==e.mc&&e.mc.level<=t)&&e.stop()})}removeAll(){this.players.forEach(t=>t.clear()),this.players.length=0,Vt.prototype.clearAllAudioBuffers()}}Object.assign(qt.prototype,{players:[]});const jt=qt;class Lt extends _t{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(),this.ps=t,null!==i&&(this.name=i),this.options=s,this.options.skinId&&(this.skinId=this.options.skinId),!Lt.registerStyleSheet(this.skinId,t)){let e=this._getStyleSheets("default"),i=this._getStyleSheets("twoThirds");i.length>0&&(e+=` @media (max-width:${this.twoThirdsMedia.width}px),(max-height:${this.twoThirdsMedia.height}px){${i}}`);let s=this._getStyleSheets("half");s.length>0&&(e+=` @media (max-width:${this.halfMedia.width}px),(max-height:${this.halfMedia.height}px){${s}}`),ct(e.replace(/\.ID/g,`.${this.skinId}`),t)}let n="";this.$div=e("<div/>",{class:this.skinId}),this.$playerCnt=e("<div/>",{class:"JClicPlayerCnt"}),this.$progress=e("<progress/>",{class:"progressBar"}).css({display:"none"}),this.$waitPanel=e("<div/>").css({display:"none","background-color":"rgba(255, 255, 255, .60)","z-index":99}).append(e("<div/>",{class:"waitPanel"}).css({display:"flex","flex-direction":"column"}).append(e("<div/>",{class:"animImgBox"}).append(e(this.waitImgBig),e(this.waitImgSmall))).append(this.$progress)),this.$playerCnt.append(this.$waitPanel),this.buttons=N(Lt.prototype.buttons),this.counters=N(Lt.prototype.counters),this.msgArea=N(Lt.prototype.msgArea),this.$dlgOverlay=e("<div/>",{class:"dlgOverlay"}).css({"z-index":98,position:"fixed",left:0,top:0,width:"100%",height:"100%",display:"none","background-color":"rgba(30,30,30,0.7)"}).on("click",()=>(this._isModalDlg||this._closeDlg(!0),!1));const r=e("<div/>",{class:"dlgDiv",role:"dialog","aria-labelledby":t.getUniqueId("ReportsLb"),"aria-describedby":t.getUniqueId("ReportsCnt")}).css({display:"inline-block",position:"relative",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}).on("click",()=>!1);this.$dlgMainPanel=e("<div/>",{class:"dlgMainPanel",id:t.getUniqueId("ReportsCnt")}),this.$dlgBottomPanel=e("<div/>",{class:"dlgBottomPanel",role:"navigation"}),this.$div.append(this.$playerCnt,this.$dlgOverlay.append(r.append(this.$dlgMainPanel,this.$dlgBottomPanel))),n=f("JClic logo"),this.$infoHead=e("<div/>",{class:"infoHead"}).append(e("<div/>",{class:"headTitle unselectableText"}).append(e(this.appLogo,{"aria-label":n}).css({width:"1.5em",height:"1.5em","vertical-align":"bottom"}).on("dblclick",()=>{g("all"),m("trace",'Log level set to "trace"')})).append(e("<span/>").html("JClic.js"))).append(e("<p/>").css({"margin-top":0,"margin-left":"3.5em"}).append(e("<a/>",{href:"https://projectes.xtec.cat/clic/"}).html("https://projectes.xtec.cat/clic/")).append(e("<br>")).append(e("<span/>").html(`${f("Version")} ${gt.VERSION}`))),this.$reportsPanel=e("<div/>",{class:"reportsPanel",role:"document"}),n=f("Copy data to clipboard"),this.$copyBtn=e("<button/>",{title:n,"aria-label":n}).append(e(this.copyIcon).css({width:"26px",height:"26px"})).on("click",()=>{const t=new ClipboardItem({"text/plain":new Blob([`===> ${f("The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor")} <===`],{type:"text/plain"}),"text/html":new Blob([this.$reportsPanel.html()],{type:"text/html"})});navigator.clipboard.write([t]).then(()=>this.$copyBtn.parent().append(e("<div/>",{class:"smallPopup"}).html(f("The data has been copied to clipboard")).fadeIn().delay(3e3).fadeOut(function(){e(this).remove()}))).catch(t=>this.$copyBtn.parent().append(e("<div/>",{class:"smallPopup"}).html(`ERROR: Unable to write data into the clipboard: ${t}`).fadeIn().delay(3e3).fadeOut(function(){e(this).remove()})))}),n=f("Close"),this.$closeDlgBtn=e("<button/>",{title:n,"aria-label":n}).append(e(this.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",()=>this._closeDlg(!0)),n=f("OK"),this.$okDlgBtn=e("<button/>",{title:n,"aria-label":n}).append(e(this.okDialogIcon).css({width:"26px",height:"26px"})).on("click",()=>this._closeDlg(!0)),n=f("Cancel"),this.$cancelDlgBtn=e("<button/>",{title:n,"aria-label":n}).append(e(this.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",()=>this._closeDlg(!1)),Lt.skinStack.push(this)}static registerClass(t,e){return Lt.CLASSES[t]=e,e}static registerStyleSheet(t,e){let i=!1;const s=lt(e);s.__JClicID||(s.__JClicID="SK"+Lt.lastId++);let n=Lt.rootStyles[s.__JClicID];return n||(n=[],Lt.rootStyles[s.__JClicID]=n),n.indexOf(t)<0?(m("trace",`Stylesheet "${t}" has been registered for root node labeled as "${s.__JClicID}"`),n.push(t)):i=!0,i}static getSkin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t=t||"default","@"===t.charAt(0,1)&&t.endsWith(".xml")&&(t=t.substring(1,t.length-4)),t&&e){const i=Lt.skinStack.find(i=>i.name===t&&i.ps===e);if(i)return i}let s=Lt.CLASSES[t];if(!s){const n=e.project.mediaBag.getElement(t,!1);n&&n.data&&(i=Object.assign({},i,n.data),i.skinId=`JClic-${t.replace(".xml","")}`),!e.zip&&"edu.xtec.jclic.skins.BasicSkin"===i.class&&i.image&&e.project.mediaBag.getElement(i.image,!1)&&e.project.mediaBag.getElement(i.image,!1).data?s=Lt.CLASSES.custom:(m("warn",`Unknown skin class: ${t}`),s=Lt.CLASSES.default)}return new s(e,t,i)}_getStyleSheets(){return"default"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default")?this.basicCSS+this.waitAnimCSS+this.reportsCSS:""}attach(t){this.detach(),null!==t&&null!==t.skin&&t.skin.detach(),this.player=t,this.$playerCnt.prepend(t.$div),this.setSkinSizes(),t.$mainContainer.append(this.$div)}setSkinSizes(t){const e={},i=this.player?.$topDiv.height()||0,s=this.player.fullScreenChecked?"inherit":null;void 0===t&&(t=!(!document||!document.fullscreenElement)),at(t?"100vw":this.ps.options.minWidth,e,"min-width",s),at(t?"100vh":this.ps.options.minHeight,e,"min-height",s),at(t?"100vw":this.ps.options.maxWidth,e,"max-width",s),at(t?"100vh":this.ps.options.maxHeight,e,"max-height",s),at(t?"100vw":this.ps.options.width,e,"width","100%"),at(t?"100vh":this.ps.options.height,e,"height",i>0?"100%":"100vh"),this.$div.css(e)}detach(){null!==this.player&&(this.player.$div.remove(),this.$div.detach(),this.player=null)}updateContent(t){if(this.$msgBoxDivCanvas){const e=this.$msgBoxDivCanvas.get(-1).getContext("2d");e.clearRect(0,0,e.canvas.clientWidth,e.canvas.clientHeight),this.msgBox.update(e,t)}return super.updateContent()}resetAllCounters(t){e.each(this.counters,(e,i)=>{null!==i&&(i.value=0,i.countDown=0,i.enabled=t,i.refreshDisplay())})}setWaitCursor(t){if(void 0===t)this.$waitPanel&&this.$waitPanel.css({display:this.waitCursorCount>0?"initial":"none"});else{switch(t){case!0:this.waitCursorCount++;break;case!1:--this.waitCursorCount<0&&(this.waitCursorCount=0);break;case"reset":this.waitCursorCount=0}this.setWaitCursor()}}setProgress(t,e){this.$progress&&(this.currentProgress=t,t<0?this.$progress.css({display:"none"}):(e&&(this.maxProgress=e,this.$progress.attr("max",e).css({display:"initial"})),this.$progress.attr("value",t)),m("trace",`Progress: ${this.currentProgress}/${this.maxProgress}`))}incProgress(t){this.currentProgress>=0&&this.setProgress(this.currentProgress+(t||1))}showHelp(t){}showDlg(t,e){return new Promise((i,s)=>{this._dlgOkValue="ok",this._dlgCancelValue="cancelled",this._isModalDlg=t,this.$dlgMainPanel.children().detach(),this.$dlgBottomPanel.children().detach(),e.main&&this.$dlgMainPanel.append(e.main),e.bottom&&this.$dlgBottomPanel.append(e.bottom),this._closeDlg=t=>{t&&i?i(this._dlgOkValue):!t&&s&&s(this._dlgCancelValue),this.$dlgOverlay.css({display:"none"}),this.enableMainButtons(!0),this._closeDlg=Lt.prototype._closeDlg},this.enableMainButtons(!1),this.$dlgOverlay.css({display:"initial"})})}enableMainButtons(t){this.$playerCnt.find("button").attr("tabindex",t?"0":"-1")}_closeDlg(){}showReports(t){return this.$reportsPanel.html(this.$printReport(t)),this.showDlg(!1,{main:[this.$infoHead,this.$reportsPanel],bottom:[this.$copyBtn,this.$closeDlgBtn]})}$printReport(t){let i=[];if(t){const s=t.getData(),n=new Date(s.started);i.push(e("<div/>",{class:"subTitle",id:this.ps.getUniqueId("ReportsLb")}).html(f("Current results")));const r=e("<table/>",{class:"JCGlobalResults"});r.append(st.doubleCell(f("Session started:"),`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`),st.doubleCell(f("Reports system:"),`${f(s.descriptionKey)} ${s.descriptionDetail}`)),s.userId?r.append(st.doubleCell(f("User:"),s.userId)):s.user&&r.append(st.doubleCell(f("User:"),s.user)),s.sequences>0?(s.sessions.length>1&&r.append(st.doubleCell(f("Projects:"),s.sessions.length)),r.append(st.doubleCell(f("Sequences:"),s.sequences),st.doubleCell(f("Activities done:"),s.activitiesDone),st.doubleCell(f("Activities played at least once:"),`${s.playedOnce}/${s.reportable} (${w(s.ratioPlayed/100)})`)),s.activitiesDone>0&&(r.append(st.doubleCell(f("Activities solved:"),`${s.activitiesSolved} (${w(s.ratioSolved/100)})`)),s.actScore>0&&r.append(st.doubleCell(f("Partial score:"),`${w(s.partialScore/100)} ${f("(out of played activities)")}`),st.doubleCell(f("Global score:"),`${w(s.globalScore/100)} ${f("(out of all project activities)")}`)),r.append(st.doubleCell(f("Total time in activities:"),C(1e3*s.time)),st.doubleCell(f("Actions done:"),s.actions))),i.push(r),s.sessions.forEach(t=>{if(t.sequences.length>0){const n=e("<table/>",{class:"JCDetailed"});i.push(e("<p/>").html(s.sessions.length>1?`${f("Project")} ${t.projectName}`:"")),n.append(e("<thead/>").append(e("<tr/>").append(st.th(f("sequence")),st.th(f("activity")),st.th(f("OK")),st.th(f("actions")),st.th(f("score")),st.th(f("time"))))),t.sequences.forEach(t=>{let i=e("<tr/>").append(e("<td/>",{rowspan:t.activities.length}).html(t.sequence));t.activities.forEach(t=>{if(t.closed)i.append(st.td(t.name)),i.append(t.solved?st.td(f("YES"),"ok"):st.td(f("NO"),"no")),i.append(st.td(t.actions)),i.append(st.td(w(t.precision/100))),i.append(st.td(C(1e3*t.time)));else{i.append(st.td(t.name,"incomplete"));for(let t=0;t<4;t++)i.append(st.td("-","incomplete"))}n.append(i),i=e("<tr/>")})}),n.append(e("<tr/>").append(st.td(f("Total:")),st.td(`${t.played} (${w(t.ratioPlayed/100)})`),st.td(`${t.solved} (${w(t.ratioSolved/100)})`),st.td(t.actions),st.td(w(t.score/100)),st.td(C(1e3*t.time)))),i.push(n)}},this)):i.push(e("<p/>").html(f("No activities done!")))}return i}enableCounter(t,e){this.counters[t]&&this.counters[t].setEnabled(e)}doLayout(){this.player.doLayout(),this.$msgBoxDiv&&window.setTimeout(()=>{this.$msgBoxDivCanvas&&this.$msgBoxDivCanvas.remove();const t=this.$msgBoxDiv.outerWidth(),i=this.$msgBoxDiv.outerHeight();null!==this.$msgBoxDivCanvas&&this.msgBox.dim.widht===t&&this.msgBox.dim.height===i||(this.$msgBoxDivCanvas=e(`<canvas width="${t}" height="${i}"/>`),this.msgBox.setBounds(new St(0,0,t+1,i)),this.msgBox.buildAccessibleElement(this.$msgBoxDivCanvas,this.$msgBoxDiv)),this.$msgBoxDiv.append(this.$msgBoxDivCanvas),this.updateContent()},0)}fit(){return this.doLayout(),new xt(this.$div.width(),this.$div.height())}setScreenFull(t){if(document&&document.fullscreenEnabled&&(!0===t&&!document.fullscreenElement||!1===t&&!document.fullscreenElement||!0!==t&&!1!==t)){const t=!!document.fullscreenElement;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen();else{const t=this.player.$mainContainer.get(-1);t&&t.requestFullscreen&&t.requestFullscreen()}this.player.fullScreenChecked=!0,this.setSkinSizes(!t)}}actionStatusChanged(t){t.name&&this.buttons[t.name]&&this.setEnabled(this.buttons[t.name],t.enabled)}setEnabled(t,e){t&&t.prop("disabled",!e||null)}equals(t){return t&&this.name===t.name&&this.ps===t.ps}getMsgBox(){return this.msgBox}}Lt.skinStack=[],Lt.rootStyles={},Lt.lastId=1,Lt.CLASSES={},Object.assign(Lt.prototype,{skinId:"JClicBasicSkin",$div:null,$playerCnt:null,name:"default",options:{},$waitPanel:null,$progress:null,currentProgress:-1,maxProgress:0,msgBox:null,$msgBoxDiv:null,$msgBoxDivCanvas:null,$dlgOverlay:null,$dlgMainPanel:null,$dlgBottomPanel:null,$infoHead:null,$copyBtn:null,$closeDlgBtn:null,$okDlgBtn:null,$cancelDlgBtn:null,_dlgOkValue:null,_dlgCancelValue:null,_isModalDlg:!1,$reportsPanel:null,buttons:{prev:null,next:null,return:null,reset:null,info:null,help:null,audio:null,about:null,fullscreen:null,close:null},counters:{actions:null,score:null,time:null},msgArea:{main:null,aux:null,mem:null},player:null,ps:null,waitCursorCount:0,basicCSS:".ID {\n width: 100%;\n background-color: #3F51B5;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-direction: column;\n flex-direction: column;\n}\n\n.ID .JClicPlayerCnt {\n background-color: lightblue;\n margin: 18px;\n -webkit-flex-grow: 1;\n flex-grow: 1;\n position: relative;\n}\n\n.ID .JClicPlayerCnt>div {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.ID button:not(.StockBtn) {\n background: transparent;\n padding: 0;\n border: none;\n box-shadow: none;\n text-shadow: none;\n}\n\n.ID .unselectableText {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ID .progressBar {\n width: 250px\n}\n",waitAnimCSS:".ID .waitPanel {\n display: -webkit-flex;\n display: flex;\n width: 100%;\n height: 100%;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-align-items: center;\n align-items: center;\n}\n\n.ID .animImgBox {\n position: relative;\n width: 300px;\n height: 300px;\n max-width: 80%;\n max-height: 80%;\n}\n\n.ID .animImgBox svg {\n position: absolute;\n width: 100%;\n height: 100%;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n.ID #waitImgBig {\n animation-duration: 0.8s;\n animation-name: rotate-right;\n}\n\n@keyframes rotate-right {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(1turn);\n }\n}\n\n.ID #waitImgSmall {\n animation-duration: 0.6s;\n animation-name: rotate-left;\n}\n\n@keyframes rotate-left {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(-1turn);\n }\n}\n",waitImgBig:'<svg id="waitImgBig" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 65.99,40.19 c -0.42,5.33 7.80,4.94 8.11,0.20 C 74.50,34.37 66.35,8.59 42.92,7.98 15.90,7.29 9.96,29.50 9.94,39.41 15.33,-1.66 68.61,7.048 65.99,40.19 Z" />\n</svg>\n',waitImgSmall:'<svg id="waitImgSmall" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 57.00,39.43 c -0.28,-3.53 5.16,-3.27 5.37,-0.13 0.26,3.99 -5.13,21.04 -20.63,21.44 C 23.85,61.19 19.93,46.50 19.92,39.94 23.48,67.11 58.73,61.35 57.00,39.43 Z" />\n</svg>\n',reportsCSS:".ID .dlgDiv {\n background-color: #efefef;\n color: #757575;\n font-family: Roboto, sans-serif;\n font-size: 10pt;\n line-height: normal;\n}\n\n.ID .dlgDiv a, a:visited, a:active, a:hover {\n text-decoration: none;\n color: inherit;\n}\n\n.ID .dlgMainPanel {\n padding: 1em 2em;\n max-height: calc(100vh - 8em);\n max-width: calc(100vw - 2em);\n min-width: 20em;\n overflow: auto;\n}\n\n.ID .dlgMainPanel .headTitle {\n font-size: 2.5em;\n font-weight: bold;\n margin: auto;\n}\n\n.ID .dlgMainPanel .subTitle {\n font-size: 1.4em;\n font-weight: bold;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel p {\n font-size: 1.1em;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel table {\n table-layout: fixed;\n width: 40em;\n margin: 0.5em 0 1.7em 0;\n border-collapse: collapse;\n}\n\n.ID .dlgMainPanel select {\n min-width: 20em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n color: #757575;\n}\n\n.ID .dlgMainPanel input {\n margin-left: 1em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n border-color: lightgray;\n}\n\n.ID .infoHead {\n padding: 1em 0em 0.5em;\n}\n\n.ID .JCGlobalResults td {\n padding: 0.4em;\n border-bottom: 1px solid #b6b6b6;\n}\n\n.ID .JCGlobalResults td:first-child {\n font-weight: 600;\n width: 14em;\n}\n\n.ID .JCDetailed td, th {\n border-bottom: 1px solid #b6b6b6;\n padding: 0.3em 0.4em;\n vertical-align: top;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ID .JCDetailed thead {\n font-weight: 600;\n}\n\n.ID .JCDetailed th:first-child {\n width: 7em;\n}\n\n.ID .JCDetailed th:nth-last-child(4) {\n width: 4em;\n}\n\n.ID .JCDetailed th:nth-last-child(-n+3) {\n width: 4.1em;\n text-align: right;\n}\n\n.ID .JCDetailed td:nth-last-child(-n+3) {\n text-align: right;\n}\n\n.ID .JCDetailed .ok {\n color: #4bae4f;\n font-weight: 600;\n}\n\n.ID .JCDetailed .no {\n color: #f34235;\n font-weight: 600;\n}\n\n.ID .JCDetailed tr:last-child {\n font-weight: bold;\n}\n\n.ID .JCDetailed .incomplete {\n font-style: italic;\n}\n\n.ID .dlgBottomPanel {\n height: 3.5em;\n background-color: white;\n padding: 0.5em;\n font-weight: bold;\n text-align: right;\n border-top: 1px solid #eee;\n position: relative;\n}\n\n.ID .dlgBottomPanel .smallPopup {\n background-color: #222;\n color: #ddd;\n padding: 0.5em;\n font-size: 0.9em;\n position: absolute;\n right: 6em;\n top: 1em;\n}\n\n.ID .dlgBottomPanel button {\n display: inline-block;\n padding: 10px;\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .dlgBottomPanel button:hover {\n background-color: #eee;\n border-radius: 80px;\n}\n\n.ID .dlgBottomPanel button:active {\n background-color: #b3e5fc;\n}\n",closeDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',okDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',copyIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />\n</svg>\n',appLogo:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">\n <g transform="matrix(.02081 0 0-.02081 5 62.33)">\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1999 519 3 11 999-266 999-266z" fill="none" stroke="#9d6329" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1998 519 3 11 999-266 999-266" fill="#f89c0e" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994z" fill="none" stroke="#86882b" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994" fill="#d9e70c" />\n </g>\n</svg>\n',halfMedia:{width:376,height:282},twoThirdsMedia:{width:420,height:315}});const Ft=Lt;class zt{constructor(t,e){this.type=t,e&&(this.file=e)}setProperties(t){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"type":this.type=e;break;case"file":this.file=Y(e);break;case"params":this.externalParam=Y(e);break;case"pFrom":this.absLocationFrom=e;break;case"buffer":this.recBuffer=Number(e);break;case"level":case"from":case"to":case"length":this[t]=Number(e);break;case"px":case"py":null===this.absLocation&&(this.absLocation=new Ct(0,0)),"px"===t?this.absLocation.x=Number(e):this.absLocation.y=Number(e);break;case"stretch":case"free":case"catchMouseEvents":case"loop":case"autostart":this[t]=v(e)}}),this}getAttributes(){return V(this,["type","file","externalParam","absLocation","absLocationFrom","recBuffer","level|1","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}setAttributes(t){return L(this,t,["type","file","externalParam",{key:"absLocation",fn:Ct},"absLocationFrom","recBuffer","level","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}isEquivalent(t){return this.type===t.type&&(this.file===t.file||null!==this.file&&null!==t.file&&this.file.toLocaleLowerCase()===t.file.toLocaleLowerCase())&&this.from===t.from&&this.to===t.to&&this.recBuffer===t.recBuffer}getDescription(){let t=`${this.type}`;return this.file?t=`${t} ${this.file}${this.from>=0?` from:${this.from}`:""}${this.to>=0?` to:${this.to}`:""}`:this.externalParam&&(t=`${t} ${this.externalParam}`),t}toString(){return`${this.type}${this.file?` ${this.file}`:""}`}getIcon(){let t=null;switch(this.type){case"PLAY_AUDIO":case"PLAY_RECORDED_AUDIO":t="audio";break;case"RECORD_AUDIO":t="mic";break;case"PLAY_VIDEO":t="movie";break;case"PLAY_MIDI":t="music";break;case"URL":t="url";break;default:t="generic"}return t?zt.ICONS[t]:null}}Object.assign(zt.prototype,{type:"UNKNOWN",level:1,file:null,externalParam:null,from:-1,to:-1,length:3,recBuffer:0,stretch:!1,free:!1,absLocation:null,absLocationFrom:null,catchMouseEvents:!1,loop:!1,autoStart:!1});const Ut={generic:'<svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M28.8 12L28 8H10v34h4V28h11.2l.8 4h14V12z" />\n</svg>\n',audio:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" />\n</svg>\n',movie:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z" />\n</svg>\n',mic:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" />\n</svg>\n',music:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" />\n</svg>\n',url:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" />\n</svg>\n'};zt.ICONS={},e.each(Ut,(t,e)=>{const i=new Image;i.src=rt(e),zt.ICONS[t]=i});const Ht=zt;class Jt{constructor(t,e){this.id=t,e&&(Z(e,"data:")?this.audio=new Audio(e):this.file=e)}setProperties(t){return this.file=t.attr("file"),this.enabled=T(t.attr("enabled")),this}getAttributes(){return V(this,["enabled|2","file"])}setAttributes(t){return L(this,t,["enabled","file"])}realize(t,e){this.audio||null!==this.player||null===this.file||(this.player=new Vt(new Ht("PLAY_AUDIO",this.file),e,t),this.player.realize())}play(){this.enabled&&(this.audio?(this.audio.currentTime=0,this.audio.play()):this.player&&this.player.play())}stop(){this.enabled&&(this.audio?this.audio.pause():this.player&&this.player.stop())}}Object.assign(Jt.prototype,{file:null,enabled:2,player:null,audio:null});const Wt=Jt;class Gt{constructor(t){t&&(this.elements=Object.assign({},this.elements,t.elements),this.enabled=t.enabled)}setProperties(t){return this.enabled=T(t.attr("enabled"),this.enabled),t.children().each((t,i)=>{const s=i.getAttribute("id");this.elements[s]=new Wt(s),this.elements[s].setProperties(e(i))}),this}getAttributes(){return V(this,["enabled|2","elements"])}setAttributes(t){return L(this,t,["enabled",{key:"elements",fn:Wt,group:"object"}])}realize(t,i){e.each(this.elements,(e,s)=>s.realize(t,i))}play(t){if(this.globalEnabled&&this.enabled){const e=this.elements[t];e&&e.enabled&&e.play()}}}Gt.MEDIA={start:"data:audio/mpeg;base64,//NAxAARGk5RdUEQANIEZEBAPGPyIAAYAKMY/6EaQn8hP+c/yEb//kITU7oc9Cf6nPnPoT/8nQhCKEEEnDizkAwM8ThYH1Bj/EAYEhyUGghyivv7fn0vtsLdYI0CiTQE+aaqfH3BW37/80LEFhl6nvZfj1ACplLtsfx19gOQfBp7iHeEWRj8WxiLLI6khikjEI9IvsePycfERCSpPJ9s95IbO1O/tRX70XQiOGX+n+hmeb+aMirKxN/IibInf//G3K9PVym7NoL/W2usCkcMT5T/80DEDBcivuJd0lADkXMLoGxcA7ENhPlAY8LMK280iLkhQq80ojkRQCwz/rEsTjjTlMPMu3RWZ2c3dmONON0NVDzDzDzP79Y9PFg9v//oqi4hHyp+7HGl2b///I8VcYAAls9qrCT1Mv/zQsQKFsrCvlzLRNa/FN/jd/HUrGLUa8tKonzDK8+t55alG5sbKYilBExD8Id1ugmp+eKIdSplGpaoxNZiznEU/J9KJmUsqBzPVjJ/+Aif//71QCdv+gE7f//6gICqPAAci1sbgH8/G//zQMQKFfF2qb9ZaAKU9PlY3uHFsAqAXfgZvyyhtTM2fC1zH/8+tFlslODFHjTHsClFqSTfprRCxdzMcppQ8yHsbbEkzpoLvZFBnWt1GBa/+8se/+SPdQe//FIIsAAAba7YbC65AQAf//NCxA0XMh6xv5OIAEIz0mVENAJ0DbwIQjpGYFNAvTSI1ePBuh+MwYk+xib0DA/K5YQadIk+o0Z0UyLmiv+h5bMD1Ro3/3/TSUggmu/+v/7KNL03CcLAh//5dpCqkltAAAqFFpldqAHI//NAxAwXGl7aXYxoABm/nTyF8EwhIPY/DSOKUIQ2WXUzAlFDQXzyRCXBUNUk33XoqQNhyeltWFUL6CKTImv7/vSZNZw0MP6v/v2oFQ5EUR7/1SVyb//E7FkIn9f9NXWQAg47vXRBbzv/80LEChbaYs5f2IAC9rPHK1z/yygqmvwSoaAGvNLr9jCagdVUGyxOpVqpp79lJPf9ZNEttWXTUvf/9azMUgOcZrZPMThF00d7//v///9SnpUlpJJJJJFeLhp3///yKi4QAHWdrdQE07P/80DEChTJvrI+Ro6Oalhjl3DYQyyMpMHHcIbTFNlqYvp6GKBJBYZ89G+PKyt/Q4oCbx9z9b//80CTA+F3zTlSqOz6G0PoVCIItC3/CnwN/xZAvcr/99VSIAEKz7+UABhWz01LyctXJv/zQsQRE5nOvl4WFHISWA9Ybn87+VaIKzA0kk7n33/KHo6qv1QKoNjMTHtX//ocaRCuGg2MP8jbueS9WIWU3NPcenOEv/CbcsVAKiIkATNv/9QAb60qFitrzbcZQ+ixX7169gCfAOpwHf/zQMQeE+Fasl4T0HJRrdobjyh8XBKr80WAqJQaiQPhY7vmJ4///ppkOhOaLMDbgVOwVdYt0SgqM/4hBQO+qglKQAFQM0aPnrrVvpRJLyCYt2amWVGBpcJrSl6ypI4hgoMQk5Di+Yv3//NCxCkP+IpANGYehC+92dkrPJ/1a+z+3/r/sL/6f+6G7BotKqkVeDWsJLMDPP8pf2a4///Jf+VgHuRkfn85h7MIeAY9RE3ZM3IRTyUaGvCJpep52lDPb0nCY5xRqRkEWzDKgw+8Ftdp//NAxEUS42YhgAhHHAG9ZCQjo0VONppYbQStB6qWUv5f591O8bze0/3y//62eUqnWzSn9vNsnOBzK8TN6urr6bcxGukbeqNZjuyIMO5FREnqzI6SVZVcahzgpCwMa561B4M8zjedy6v/80LEVBI7ViYoCEsdN5b7kv/+Rsub5P/X6yz0/JdhcZdZl+/hII/xFYdTSmc0ck3O0055fkc2R+ZgsyZsEagnMwRqkK1xle//6iZh/ITJmiF/yEKT4QyEKEP8hMQl/mNYxv+hn/lKZyn/80DEZxEbPiWICEc9StmmMZW0r1KXR/qYxnX0UpWMZAxQFqoapnCiQwqxihWDAQEBAQEKE6mZGZGTTMiMjTWZHa/aZkZlTRGXojIzL///////8yP85/5k1lspGrWRyNWCggYME4kGJf/zQsR9EkNiDAAARN1MNUkqTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/zQMSQDcslQAoAR1mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",click:"data:audio/mpeg;base64,//NAxAASsyJgIUEQAY///gX8///yfyHO/8hCEafoRp3nPQgAAEUAABBCEIT//QhCKQhNGyEIQhCNITU5//OQhCN7f/yEZQAAIynOc5CEIhGnABGY/4gAIQZ4h4h4d3Z2Z9Jba5XWhWP/80LEEBhJOxcfiUAC9BEda+oiKFQsViiMpvHFC98pLjySjUNeKoYxMpwIT21HmHlEhx83A9K5vDAuZUQxzq7nJPgEVWKQZ1Iu5oJH3UpGObWV/MfAgLC4Z/yhP/ULKnqHd/syOQenhOL/80DEChZpZs7rzBgAT3bBWub0T/xNtn9nY5bvQdCA0TvnpXNC7EJ3iRPtebJ//7xK4IAqIii2AKbfkBAJxATDLN7wiUGv6VANBNjqQwGCayGoaBAJaNC79/z5wP2IuJbfZsNFgBVo7P/zQsQLF0lGxvRJhlQVDyEmYldHXJGadquTRs6aYmq9VY1hqqt6xmqts2zGTvGNrl+u1IMBHREJREbkpaFQkFRoa2FYSDvBp6DwSf1lgFqfkQ0JcRCYlKxKg0eEw8sKqgaEogGBH3EZpv/zQMQJEyEudaoIBoAf+HV2UBjoOsP2/IwrkezQ1Y4e2wVxgxlVAqDQUSRUBRU6LrBY1lvxEdUBWBIOnZWOCrvlVnTsltWNOqPP4seUBcKgKpW44m3GkHLjaBS4ohHZdTGi6FXXVo6+//NCxBcNYAYyWAhEAJ3U+j3uXdl1z1Du30fCySCGablvUTrhwggLTomAAmrWsmWY9ym89ZcvlwX/zf+a95ZLwXOar/LNrJ60LUl25Hs58yKRWIjSbt9DCIs0UtF/TOlm2cyNTpKysuCB//NAxD0Rw1YliAhHPdmd9nYYQOsGCgAfmqIAXlnhbNZeUBQvyL/y6NlP/r1LLlEiSPL/7lE9SirM5zxZEwCseMDL330yrtl8/8jJs6mt5dTloYsvNSGbmTkYQhpVpRpCG1yr9YSfr1b/80LEURFLZiWQCEc8v/rLXPzys+Z9z8v+H9qyCMpGLn3bla9qtcxYZXk9cbOUjb8t0q2ytz79ImM1R0ht3QdWK11myihIpt8SZBRAlbWq3CDpDKWUte/VHgJDH6k+lsqSPbRj+pHWWrL/80DEZxKjYh2ICIfhxIKhMBeLPjgKlFRIKjCxIKjCukkFAKCSCxFtgTAQFIkisqIg2EngUVFg8FQCQUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsR3EnAF9kgARgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",actionOk:"data:audio/mpeg;base64,//NAxAAT+gKmPUFoAI81KAANYQZECuQAASjAD820006kC+buYDgGEGEKIcsCYAUQYA6JeI2JmS5wcY5yXL6b1IJpp6kG////9X+h/oaaaadAvpvBA5/9QIDQQOQ+cbQllsQQAKTggvn/80LECxdCcupdjFACwA8cFoNFZuosRJUe3E48kEhWIRueePjSdR4T9XMQ4SwB/BZ1GQNAtHHOPzOFryImV2zlb//rZV/6MYp56IY00sPgvi5vp1NN///3Q4ZlSUVV6wAAHLn//b/+Bv3/80DEChbo7s5fmGgA8cDgPEdPslrmVdkwdsV66+p2vZktFECYbF0sxMc6XTyGfU7omIDWqTLdIdocopcSHkqkN/1OLnGEiTI5lQIHz6F//h8+Aw////SWn6Ai////RQCALJttttthGP/zQsQJFgLXBl+PUAJpUBpuDr/a/Bn7vbuBpTSaJu9C26HLGnV05pymMa+52rjwoQl9HX5xkseQEWn/zR+C+CGcTN1IQsr/O/6N///////zyotv//Ulb+WNu/4a/G/DAGASAsBQ86QpAv/zQMQNFyqWqFWaUACorGJ3w70JwQXdB1Iw8FBR6w8BkLlXmCwSQKbRFEDGyFEFw/LiWNeT8eOSG/++3///5oEpv5wrF/RmoYsz////+yuLZ55GT//yosfyqj5gugANMBv///+Bt0Bw//NCxAsWul7hv49QAIAcsuZ3XnIKHgXVwYS+wjbgGuEvA8WjfAsaQmNk2QkZh5517ceH7uZegsm5y///0VTDzzDz09dev/6IIMKcL8i/5CSjE3/oqRMBZpmk7R/RgAAbjwkkcZrZNKRG//NAxAwW4j6pudpoAwwbDspelxARGBQ5l21KTHGz7RkyVSuLZ5l3/S9SQ1CutfuvPzIvF4HUFzRXNkiXJVH+pv//mvMTVRJGyT6S29LRao2Wqj///UbLJxLHVPBVD9SWyADnc5p6REf/80LECxb6Uoxe3A7SY0MyGLYtINLEx4dXVEEvywRGZ7pcZEtrkjRpam6yOArCCRZNX/W3WOoGKq04z/0I/nt/UCYZf6GfovMahvTn21oZ7KnY4oNhuRFQuLsBID8cKC5qSQAC9j29EzH/80DECxNZYoT+xuAyRLbuBA8WRBNAN0Eq+mboAV7G62xjgCvi7cM0Ov1kOELDyoy/75RGdB8iaMZJ//S9SaPWe8oonsV4o5NO40K5FG2xNQZo78WcFOwcZjQQYvlIW6mGkh0f0ZiOBv/zQsQYE8jiVBDfVogDF7hUFzGQhTgpeTFkKEeXlL8syjVHZ03ZCDR2nSxR7Pq7np3LRaHB9adBZ07r018kdy3tjTX1KiSqekjtoMGlaAKNEYCZkOHzpZziA0FmwmEDZhMwfvxGWFAY3P/zQMQkE5DaRAjW1ohECprRK1TRrKRtJsNpyJrNfLvndF7g+gSnAyt351B5obyX8r/u//////rqgBmlYGs01hNdBQpEQyNoHhEMuUtgytPS01oLy0hu6NVNabzryYxwzfIqvKPaRFls//NCxDAQ+FYw8gjSKH7tHbMxfJlUtVpIB16SI0SEXBsf68/+/L//zfLll/nmj7F/1pcpZ/+Z3Ur5Eq5WpbM9MfPljxeb9Lamv/nXIuOSkVXJVRmzRxLpVUlMiBhOahamKCgmCgSwVXHX//NAxEgRU1YcAABGvSNI0Nzzp5SNpUj5aE3ZUqAvIkhEnnq1D3/yxFqrceAgEVIho8WKlhKVGBUJHjzvOh0JndVbtdYykkFQmdDoaDqCIaLKTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqr/80LEXRFYBf5ICEYAqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",actionError:"data:audio/mpeg;base64,//M4xAAUuVJUAUgYARcXFz4DgFAeKHAeChiIie7u+iaIibgYuAYGcTz3OIhf/Xd38v+J6J7u+gGBiw8P8PDw8PDHRw8/+O6GADo/h78BEQz8HAHh5+v+A4A6H/8AAEfIiZmZBXlicwVCsWj1//M4xAwYWvL/H4goAHY5EADTzSBEDUpfz/OhTMPGC+NAMWAgfAcAgHFSjhZD1PCRAUQFBjMUxMhGGuOVyndnXzvlH2dGLp+jbHsUykMTTFkX/+ror2841v+k//+MIOdv/GUVmvrpkGSqAYta//M4xAkXMsLmN89oAg/iwxc/bCcqY374+ZYv8ms1WUWQHQlTUFCJgbIjvMcd6K1m71G+ttB9Pt32bR6OptTZxtV0l/ov20P3b9/1/1f0dSCkh7FjKTdSRbQKiRLyBKFroXi7uP0CAvGOAWNk//M4xAsXwr7a/mPUwS+O1HXtgEWD0qvqiuk8xOG4QoqkAU5eFUIMYl8WHoK3Hcq2dx5p5fTjLvlFtLucF2SuaciHhslc4JhNnm5XU2pCS6c3n6+3/9GyFsk+xwWUQmSTumm7e5ggAEWsUBor//M4xAsXCrLXHntO7NUoPTkrtfAzt+Vmc1QDhdvOk4mMiMaxzG9AERpgbNKfJVp0/lfOvjfl9SWj5XpoXfIYVep7R0WTaUAGDj1IkMHy1Oyrfnfq2e37/22fJduLdKpFmVawABglJaFVG03L//M4xA0XurK+5HnLTJeQXpCP4L6DAO1L6jOnPOCx/wVBu4nAIHEgOCbXJbP5R/74hGiwND1iw7BYtTsqM6viJ1aoa14o/kdXwsdo2K6nxravl7al1/t+rUDz4J+IDtW7bbVAX+3gDwiUL8lI//M4xA0Xgq7qVnoO+zaBvGmHeGt1WGsEPh7RWPKQT82FEhiWLGeUlRHjRERFE6UUhhATy9J5Lcv+PM+axpVIkaHDqqvi+yUHdjW3sp2vTv+rav9F/Kt+Lm9QJFdnwrvt7SXHLLMAFKoGoNaO//M4xA4UurLyXkDFT5XYo5iQ9ckoWFh61037WowPpb5NVRWlrUmVVqxmNV/b6q+xuJVfY1VVXfDHvnL7TGOFMb6ifdZf0etaP//lZH6FbyuK5MUAYWLKUvoamjS5tZpdNnrWz2ASUXdsckcS//M4xBoUcVJ4IisMydfHkiAUZzmoyajzSOzOf1T9qlFq+ORkFFeC//HxXOxf/PKPG/CNxYO4+WKbl+Lv4VBQU6KKhP/K/+vK3+WXVv/9SobSZ1b/lb9SshjN9S/Upahjf/LMahjv6qx/DpAR//M4xCcS40IEABDN5DMaqqrVVVjWLGPjH7GpWZ/7dqr47Eq/7HQds4duAxGfzkjUTpoLSIv///qn///YxTAwQIGhyP/u7O/3P2eqNZ2k4so4sp2NFAYhnZ2couBNTEFNRTMuOTkuNVVVVVVV//M4xDoKqz1wDACNy1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",finishedOk:"data:audio/mpeg;base64,//NAxAAQiXIEAUIQAPnfO/OdyAYGehP/U5Gqd+c/8785zoBi3QhCMpCVP+SpwM6AYGODH/8TvB+sPiMP5cMCcPygIAg7/lAff4IAgcBCD6ofD4diQbC0WaISi0SB3EAzA8WZgeALXg3/80LEGBoDGyZfglACgsRODRuWFcnMLm+eQEhRVQz5IePy5Icm/2Yn5GLY58hG3/J0JyAkq54WhVHosmkTmr//OYkIx+aejta5yObVf////fbcgJP/8oP//L/+w6tzSgKyRVuaO6jleQb/80DEDBdLJs4/2FABfMefV3NU1/Pu+MiMj5TGccdZM7mtR9poqDaj269WQ7clU5//OzTSgSRYFoL8eoeaaxhw+u9lq/9jn/NY7/3VPohqW+///////5ELQ+cqSm8F1QfSAHmkZP3Rz//zQsQJFgHCul9ZUACtuzlS2auXefrUxQUkTU+etjYpBz++SrehymLQlDIbPScu+uppsoFMTf/5uSiO7kpKKo1ONQ6/NbKkDv8iJj3OE/xEHRQl1Hv//4UPLBeWtoFTaaAttttstQEAgP/zQMQNF1PXDl+BUAJQhUAPuz0DJsKELcVBuf+NDz79ceCoSE/meeYSBfk6fQt91kZOYYxE3/+2YwtnyQxn////0JHMY+w/H5OSN/////zDGf5+p7///////kjSQxXTFGTyENw7gapG//NCxAoVUeLUAYKYABCegFrFga4BpxsoJJHKbdSSNc9rTRNTiRTtofSWUkUt1o19fWkoiIJAGaRYixFlM4yQ2FK7pDOlX6q0Ty0TFQNc910f521f//sEw5VqWAAa0xN/4IJysXXPUXWj//NAxBAYQc7CX9RQAD7L1moNjonkAxWFww4nWd9JCeciFDR6QsKgKiayKccZU7pWdi9jnzTd7C9HzWNZFE6VNY70udouzEPUInt/WdLG0YKntR5SDn/rBWjQpBIJjCnEADG403RAjmT/80LEChYx1rpfU2gCXkzXRRXSZBTHSfAUM4JVGmSJvr92ZalqJzOtY1C+n3qXd7ojHpJVph9KfTv2QF00S62UsnjyUkk+pbH0Uf+akuloBUN9eziVT/Kbf//1pSuJ/YIvIGDjaERizGT/80DEDRciBtzLgWgAnyaG0C1lwTMAJBpi0QiX27oskt/p2pJGx1aanoWQ9R1FMw1JVmtN1vSNE2ZKcL4kwhTIv+7hPkVpum9/54qQNoCB5od9Wc/WVZltv//9olVqRkBpkMgFbWp6pf/zQsQLFGGq0jfYOAJYZ33eO8O4ay/WUDUrPXKa0BSIWhEPEua1Jvfvd1CxL/0T7nGsppoSEjjaf6tN1ZTTR0SRqRO/+K/Ou/9CwVOnmrcSdMqBpY56yFdrrd+BUSsXF/De07+HriXkC//zQMQVEyIO7l9IOAINDw83zXmx47coMuc54Km6W6HL5VI1dHUoFS9CrJ/FZBL1apo8Bec67a3b/1JDQt4iEv/niXtWlQKNhcSXFrNXq9RoxmJPGjO8N0UWAZDR6hQZVGYs4HkcGtuz//NCxCMcqvMKX4VQAp6GEjERDVO0nICRTDDitdHYkPnkRhZTDzS5o/yvFTPc9GLCuTkX7OXt7fseehISK578TUFArC8lNQ06n//2Gg/Jy48bb9TWcmmH//93/Fyy29rQUkjgEwC74QXH//NAxAwTWb76X8xoAtGYil8Sf13FyrazOOzs66VgJUPYvJbKXWr+myS2SrPPf1KWiiiyOpLSWjRTZFlalf//omqn///Bl/gqd4NSP1sCtUboQAq2KfAZcuompqTyWlosplpidkw4Y4D/80LEGRRiJrZdUqAAgAJMBywG+KiSmxrWtlKfMj6SV386x0gTt/1OtvvS0CizI+umWkl/XUbP1ESayKkktX93dfzztT61SAEkgBQEjccjkciAYAa39zxcaPCYCFY9Q550fgIUwErGSDn/80DEIxwS+tZfhWgDSkw83gvvZTK1Iko2tI9rLpf1mZ+b1tMy4Nm06mXyUQY9ZLXyQUJTs9RmYhzjd0y+bppJEj+8v/+81fqQYzTN1ppIW/////+pA0UgaXaVuC5FVLzhMlMyKAyi3P/zQsQNF/I62AGBiABLhOwsg1FMBUmAa4LK0kU0GslRZGmpJb+3on0EzNJjN/Rt+6CJfdTUtj6KkvV+iRcjyBCdC2XzhNFUvstzFYtImJ1Ff9ZRIj59h0HQICe1It//pYprEApJJFaBDP/zQMQJFHJu5l/GaALvVEYd0Zlq2t/CXLznyPVFYKIeRsUnRSrZNn/r6CnqdQ5i8i3q1bKfpGtS0UV2JMeKP6knf2Nf0VaLGLbf//rR0WRKyF4MhrBplw9IE232uwC4QyFzCiYsW86d//NCxBIT0nLqXgpUxo9sRW7llTyJzaqvmIaPi3VgsG/mt9ykwfCQIU3OOY04ehw7/ppOC+OfQ45TbwRmsdOf9V//3NEgtEX//4aVAAFRFv32vuC0ePWVlkuksMhlhMTeSZcTTa6TL1tX//NAxB4T0m7aXgNUnlF5nDuaJdERvfmX6mCXNcKxO/V1USAU/9yGy3Aqp/1gZFJn/1f/82RAAwvUf/9n/4aVAAEIF91+vwCeBTp6TCmP9INghMQii720i+pAnlzzrUX1IHQtju2swb//80LEKRQCbtJeAJqGnOo/ai6SKYMAWbN+pyk9BZgJk//uSoi1brV+z//mZmmHNKZ13/4fAAEADstllgF/v972towZ0QXK8AA+PC5cN0PRTdbHW9k5M9zgqso/zibfk+1ZC/skJF/61jz/80DENROyfrpeA9qODemqMKr/rUHwRS1Nq9SKD//rZIcRZmT//kUEALSZ3D//6vAmzqOlAm8FwxbwFiX8VRMT/DEsPCqRbOw8Q1mIxxtBkkSi3qAOVm6F2/FRWYSyB/bF4bP/YoK6TP/zQsRBE7JuiRpulMRYCzO1V/Bgm+3///oVNQABURf9/bgBP/8U9MW42GQb/AyP4bURvzzGIYvAhJL0x3ooCTlFLZYWlmfqPt+PdVErEQz3RZKDyTFf60vWSP/2GMeX/qsr/+oxmB0RAP/zQMROEzJqxl4CWpcBmBvv9vwBTX/L98zdfopM4GlbpJtgUn1eHHhe8yxjmqcdp+upQEuTdtU3X9x6VTAMv2qIoiG/VYg/GN7/nhJgfH2Qf0qSKab/9STkueh1IDkmklAH5fflAZLq//NCxFwT8m7CXgPall7BM4igvw7JyAbmlbrY2Zmc95UkokD/dw4U/VNjZq2TcStZukKgZTDVrng8v/mRTZa8Yre35WIl+v9boo3/1pprJU2wFQAyBI5tJABr9/77Z/CdRCLoRWqEYrN6//NAxGgUEnKcfgPaq4nSU+eNbpg1JSTemhOK12Eir1L/WdGRPphACdmzWMj7GIgg/nV/2MkNzYiH1f+MUXviFwhf5ESNESoACMgKy22UAf/oZWmPclPEoiClH5cGwN0IZce9FABAWFr/80LEchQJ8p2+BhqSJMm0Y97b+IcHG7exHP1o1ozptGFJY96zeDFv2jvm5WapBNLZ6npCx39f9//xJxaUAGauYYNH0NxP49ytAzAugiwASDuCaDUpRXKKAro0F7oKjNigqK2bCimismz/80DEfRPCbrJeUYsW2bJs07zhUJE83J52vOGiuPNiokv/+//8tONhddJC82Fk8VX//+//+L/+X8vgX38/zyBLzXnwocMyMyN5mLPJsiIzhs/AZfSMyzTJX/zT7ykZlXbe+/dxn2i68f/zQsSJFBiqZBYAXknZ3GPTCDzzqqXjKRMJwaRC8G6IQU2nG4n4GGmXKsyZrv9S/Pz0LNbNUKz3/+L//YfmT5sn3CfNUKp/vzCv+a/PzXF+sMhBLEGQyJlrOq0Ao4kKJILAayo7MqEZp//zQMSUEvNmFAAIzcjp0sip/9jKz0mW6zFUj/RP6r+xkUjlR2Mj/dbbIrGRyodjWKh2MrGEVYys5TKUSGhweBQ8NIQysZWMrlRxEYLh0SRVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//NCxKMQi2IeUAhHXVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//NAxLwR22HQAAgKnVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",finishedError:"data:audio/mpeg;base64,/+MgxAAT5BX8AUEoAP///mNkc/////1Oc/6noc/9f///85/0O///r/kI2jf+pCf/Of/6HP/znOc7znPkIQgfFzvIRjhwOChCEIQOB8Ph853yHOc/zvEA4AAAAABF/UgSPmQKhhYBw4f/4yLECxVpXpgBmYgAKgCEXoz6Bj24G4gxlPDKhgAUoFxwtiGufjWFsGbKgF+Fh4noT/8i5uaFcZgLm1i2k0Mbam8ZAiwbYX0nExHIEEx2FBBP9J3S5vA6wAAltAA+pUwHS9e7B4EtiwD/4yDEERexdr1fz2ABlQrFTFPgXqqjQRzMFqGEeDUkEbrrMjtB+lU/tcuj+umyBDN1q/2GlFesgKLdHTqWo7RktruiRwdRlfa8J/BPRN+XHtgb0Y/AzC/2cZdiQgBuTa69W4S8bMAAXP/jIsQNF0k6wVZ5xSYzp4BvjV+T2Udd8R2+On01SiRpX5PGv6QjYpD1nBt8VZ0skMc9QHq1CpqJlnhoqVPKPHZYGqnIypEyWPAo8SPz0OhX//QJmyvHu/o8qM/6CtXSAhKu34FZMGcPy//jIMQLFcmeyX5pRy5R0BZEoNVh/FruKTVBRcR5rUTQpGyFqJx7CzcOcPjqoGcWJjOrcdzfsGXZAsFs2WdUKwcLiEIhWFB7w0GpuTa0XaMGgcqzrQsz/+kNKkIAFLvgP/OonDe+4DCL/+MixA4XgpK9XsKG9sYelKU8J/UGwRrm0l9/tjMjWMAOthrqK45iONNBfxi+hbllz+raE/If6Y91Y8jnb49Kxn0WeTT6ihhKnGOj8LGIiWQHuOogUc/66H/hHf+ZgAISpdgBncq6Fj3n/+MgxAwWYfa9fnqHEiCLPLVweu/9CIz6wGZbXVpry1Kg57ZhtwxXKh82K2giB2guGug/OyF9W1JuQftstdzJ1LPcEKLR5hTreUz/iBxskEVBY+CqAyCgQoz+yuNqlTn/4AmceACjmEH/4yLEDROBjtGfTFACEdnXxxr0lwp2+ghopgB4IjWCiAiL1Fns+pLqPWoKx2ncfG0InzW1JerftHxMpxQ801HHziUMvQeK6+SzxEliW+qFqaEByyhgQELpGQIgqtQ3JzIWch4kp17kEgX/4yDEGxrBdpwBmcgA2HbmH2R4LIKeMtsKwjCc/PT00y9l+qMGDIckAycFqvMfuJz7iPxLEzFQo5sngfD9d/3Lh+njFJYublz8Q5Rf////T2+4Yc+Lz9NurVqf9g+AKTd3AE4qU1E2vP/jIsQLFHFG1N/MMAKBuH8oS/ikp9KqlSqkwegTJgTLjeYlyndKcQSsCSPJJQRk9HC1Mj+l42THqWrK1khp0NFfwKks86SKw6IipGbLX60JBY92Jgpy/gAfjbqATePy62LBPlndI3QLQ//jIMQVEzHK0D5ITaKR7RryvYmOsx1fbM6V2JJnbpavk1iJiS8JPqV6qgWaY6uxhvzoBzN51ktGpofVlW2syZxMO0b3qgp3fgAeIb4DIseOluSeSAlQn7hrzAjZSZuJ1hX4vsT7jPQ//+MixCMTSZ7MPlmQ9/X6VzdY3edjF975aHZclh+kp0dpLevY334aVbI8HpNcncwNu/n4iv+WjdUp78AD9ctNSZuODC31N8HTqGeWmtBbEAMsHqNC8I2hSomoRqXy9S0ceUx3G2Xy1HlX/+MgxDETia7EHnnS35XKZuzIM1elCplWUbSZUyasFtQGBXZtvjOkd7fyKgXdgAP2BBZD9S9RP5NG79jO2pTIwZr7J8G1gzEtzOp2ieBOgOaBuVOqMyrSjT9MjQyjbxO0deP52eZM5EX/4yLEPRPR9rgeeccSHPRatU3MJQt+RHNLSiTFR+5aqgXbiAQBNtgMw1oA6FmGT6BBFIiJwdNzPHg4GwWjwaEZMdZCYHjSgwh4y0x3apZUmcmPvrb6vn+zvD/t5itoX1ejvi2HXytG9Pf/4yDESRRRirQZT1gDn6MGwmcJJfWqPBUiBf4SQhy0VHhgDRhoxv1ZsAhtWpzFYcHZOFihgb4zFC60dOmrlmXJiSomyBZ2YpiZigYKoIYAIGkiMAiwM8MMgCyIACjNhTPqzAnwKNMoKP/jIsRSJSlqhAma0AChCECX2WopEOPhhoiCKtdUFCCgKJA0W01lY2TxupC5HD8td2jhciVYlirC37fwM/kcmq9jHKMSipK977GKSz039KNFCnN8BxNkyKQ7PaifSU06ZWbLXIRrxeNesv/jIMQZFAk6zD/MMAKWQS5DeCUx/Y3lI4WvyH8L5+c/sB9iWul3X4R9zz7SwOgUyMBtTkhABBIUn1CLs///////9YC1KgVL/IbU4pxAdm9RCY22Fl3QDjRdhcbGgh/GwR2i7lo1CmY0/+MixCMT0ZasGMPKX2VNy3/JfvZB7an/a3fEB8Ky4hh6gJUlR8Y0bs8ZsysdHzOS5lQSpSjDL8SjagVdQAPkgaNhAzDy0U7Ny7ewjcdcD9uihn7LI+uRtxwzNFzBvzo+Dh1KUoG4nLxM/+MgxC8TQaK0HnnHLvdpTPyNVqWq8ps87Xc4tp+84odaBg0EhAGhAEm9SAVb+0XZfMCMzNKdBLCfWT9Cl5ZjyQd6VlAraiTVvTti91RulyZBkwXuoV3YXmOkKVn5U0rzPNMp1ltR6t7/4yLEPRQ5lqwYw1ETceczuhocBflPuWRyT5NPfTibxXsKc3HAHohRMAuHFwWYsiboQoSDQaBHij2BTtI1iU2jto6ycFqsuHDPAswsJlcSaDHBypOCRwT6zM81yPX/lTY4KIGgWSGQ4+n/4yDESBLppsg+SYaW///sUgodAxFs3LEahGcMIGORNKMFqJMRseA8gjpVF3QapN5RoQOoQ0DWBwiRkkW4R+n8dpREBICTA00IFzMpEJUo25plEqklOrq6VWSDH6/u3crqCEL0P4bJIP/jIsRXE9ECWADD0lknZeEGlVUAgUCFiDzDzCj4WjRpT2WWWUGKhkz4qKC1QsK/ioqLN9ISFhURmfWKi3//////////QDIVFBIHgZFaTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqv/jIMRjEaCVZAp5hlCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"},Object.assign(Gt.prototype,{elements:{start:new Wt("start",Gt.MEDIA.start),click:new Wt("click",Gt.MEDIA.click),actionOk:new Wt("actionOk",Gt.MEDIA.actionOk),actionError:new Wt("actionError",Gt.MEDIA.actionError),finishedOk:new Wt("finishedOk",Gt.MEDIA.finishedOk),finishedError:new Wt("finishedError",Gt.MEDIA.finishedError)},enabled:2,globalEnabled:!0});const Kt=Gt;class Zt{constructor(t){this.project=t,this.authors=[],this.organizations=[],this.revisions=[],this.languages=[],this.locales=[],this.description={},this.tags={}}setProperties(t){let i=null;const s=[];return t.children().each((t,n)=>{switch(n.nodeName){case"title":this.title=n.textContent;break;case"description":i=R(n);break;case"descriptions":e(n).children().each((t,e)=>s.push(_(e)));break;case"author":this.authors.push(O(_(n)));break;case"organization":this.organizations.push(O(_(n)));break;case"revision":const t=O(_(n));t.date&&(t.date=k(t.date)),this.revisions.push(t);break;case"language":this.languages.push(S(n.textContent));break;case"eventSounds":this.eventSounds=new Kt,this.eventSounds.setProperties(e(n));break;case"skin":this.skinFileName=e(n).attr("file");break;case"descriptors":this.tags=_(n,!0),this.tags["#text"]&&(this.tags.other=this.tags["#text"].textContent,delete this.tags["#text"]);break;case"license":this.license=R(n);break;case"cover":case"thumb":const r=R(n);r.file&&(this[n.nodeName]=r.file)}}),this.buildLocales(),s.forEach(t=>{t.language&&t.text&&(this.description[t.language]=t.text)}),i&&this.languages.length>0&&!this.description[this.languages[0]]&&(this.description[this.languages[0]]=i),this}buildLocales(){return this.languages.length>0&&window.Intl&&window.Intl.getCanonicalLocales&&(this.locales=[],this.languages.forEach(t=>{const e=/\(([a-z,A-Z,-]+)\)/.exec(t);if(e&&e.length>1)try{const t=window.Intl.getCanonicalLocales(e[1]);t&&(this.locales=this.locales.concat(t))}catch(e){m("error",`Invalid language: ${t}`)}})),this}getAttributes(){return V(this,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"])}setAttributes(t){return L(this,t,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"]),this.revisions&&this.revisions.forEach(t=>{t.date&&(t.date=new Date(t.date))}),this.buildLocales()}}Object.assign(Zt.prototype,{project:null,title:"Untitled",authors:null,organizations:null,revisions:null,description:null,languages:null,tags:null,cover:null,thumb:null,license:{type:"by-nc-sa",url:"https://creativecommons.org/licenses/by-nc-sa/4.0"},locales:null,skinFileName:null,eventSounds:new Kt});const Yt=Zt;class Qt{constructor(t,e){switch(this.action=t,typeof e){case"string":this.sequence=e;break;case"number":this.actNum=e}}setProperties(t){return this.id=t.attr("id"),this.action=t.attr("action")||"JUMP",t.attr("tag")&&(this.sequence=Y(t.attr("tag"))),t.attr("project")&&(this.projectPath=Y(t.attr("project"))),this}getAttributes(){return V(this,["id","action","actNum","sequence","projectPath"])}setAttributes(t){return["id","action","actNum","sequence","projectPath"].forEach(e=>{j(t[e])||(this[e]=t[e])}),this}}Object.assign(Qt.prototype,{id:null,action:null,actNum:-1,sequence:null,projectPath:null});const Xt=Qt;class te extends Xt{constructor(t,e,i,s){super(t,e),this.threshold="number"==typeof i?i:-1,this.time="number"==typeof i?s:-1}setProperties(t){return super.setProperties(t),void 0!==t.attr("threshold")&&(this.threshold=t.attr("threshold")),void 0!==t.attr("time")&&(this.time=t.attr("time")),this}getAttributes(){return Object.assign(super.getAttributes(),V(this,["threshold","time"]))}setAttributes(t){return super.setAttributes(t),["threshold","time"].forEach(e=>{j(t[e])||(this[e]=t[e])}),this}}Object.assign(te.prototype,{threshold:-1,time:-1});const ee=te;class ie extends Xt{constructor(t,e){super(t,e)}setProperties(t){return super.setProperties(t),t.children("jump").each((t,i)=>{const s=(new ee).setProperties(e(i));"upper"===s.id?this.upperJump=s:"lower"===s.id&&(this.lowerJump=s)}),this}getAttributes(){return Object.assign(super.getAttributes(),V(this,["upperJump","lowerJump"]))}setAttributes(t){return super.setAttributes(t),["upperJump","lowerJump"].forEach(e=>{t[e]&&(this[e]=(new ee).setAttributes(t[e]))}),this}resolveJump(t,e){let i=this;return t>=0&&e>=0&&(null!==this.upperJump&&t>this.upperJump.threshold&&(this.upperJump.time<=0||e<this.upperJump.time)?i=this.upperJump:null!==this.lowerJump&&(t<this.lowerJump.threshold||this.lowerJump.time>0&&e>this.lowerJump.time)&&(i=this.lowerJump)),i}}Object.assign(ie.prototype,{upperJump:null,lowerJump:null});const se=ie;class ne{constructor(){}setProperties(t){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"id":this.tag=Y(e);break;case"name":this.activity=e;break;case"description":case"navButtons":this[t]=e;break;case"delay":this[t]=Number(e)}}),t.children("jump").each((t,i)=>{const s=(new se).setProperties(e(i));"forward"===s.id?this.fwdJump=s:"back"===s.id&&(this.backJump=s)}),this}getAttributes(){return V(this,["tag","description","activity","fwdJump","backJump","navButtons","delay"])}setAttributes(t){return["tag","description","activity","navButtons","delay"].forEach(e=>{j(t[e])||(this[e]=t[e])}),["fwdJump","backJump"].forEach(e=>{t[e]&&(this[e]=(new se).setAttributes(t[e]))}),this}}Object.assign(ne.prototype,{tag:null,description:null,activity:"",fwdJump:null,backJump:null,navButtons:"both",delay:0});const re=ne;class ae{constructor(t){this.project=t,this.elements=[]}setProperties(t){return t.children("item").each((t,i)=>this.elements.push((new re).setProperties(e(i)))),this}getAttributes(){return this.elements.map(t=>t.getAttributes())}setAttributes(t){return t.forEach(t=>this.elements.push((new re).setAttributes(t))),this}getElementIndex(t){return null===t?-1:this.elements.indexOf(t)}getElement(t,e){let i=null;return t>=0&&t<this.elements.length&&(i=this.elements[t],e&&(this.currentAct=t)),i}getElementByTag(t,e){let i=null,s=-1;return t&&(t=Y(t),this.elements.some((e,n)=>(e.tag===t&&(i=e,s=n),-1!==s)),-1!==s&&e&&(this.currentAct=s)),i}getCurrentAct(){return this.getElement(this.currentAct,!1)}hasNextAct(t){let e=!1;const i=this.getCurrentAct();if(i)if(null===i.fwdJump)e=!0;else switch(i.fwdJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}hasPrevAct(t){let e=!1;const i=this.getCurrentAct();if(i)if(null===i.backJump)e=!0;else switch(i.backJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}getNavButtonsFlag(){let t="none";const e=this.getCurrentAct();return e&&(t=e.navButtons),t}getJump(t,e){const i=this.getCurrentAct();let s=null;if(i){const n=t?i.backJump:i.fwdJump;if(null===n){let e=this.currentAct+(t?-1:1);(e>=this.elements.length||e<0)&&(e=0),s=new Xt("JUMP",e)}else{let t=-1,i=-1;if(null!==e){const s=e.getCurrentSequenceInfo();null!==s&&(t=Math.round(s.tScore),i=Math.round(s.tTime/1e3))}s=n.resolveJump(t,i)}}return s}getSequenceForElement(t){let e=null;if(t>=0&&t<this.elements.length)for(let i=t;null===e&&i>=0;i--)e=this.getElement(i,!1).tag;return e}getElementByActivityName(t){let e=null;if(null!==t)for(let i=0;null===e&&i<this.elements.length;i++){const s=this.getElement(i,!1);s.activity.toLowerCase()===t.toLowerCase()&&(e=s)}return e}checkCurrentActivity(t){let e=this.getCurrentAct();if(null===e||e.activity.toUpperCase()!==t.toUpperCase()){for(let e=0;e<this.elements.length;e++)if(this.getElement(e,!1).activity.toUpperCase()===t.toUpperCase())return this.currentAct=e,!1;return e=new re,e.activity=t,e.fwdJump=new se("STOP"),e.backJump=new se("STOP"),this.elements.push(e),this.currentAct=this.elements.length-1,!1}return!0}}Object.assign(ae.prototype,{elements:null,project:null,currentAct:-1});const oe=ae;var le=i(924),ce=i.n(le);class he{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=window&&(window.AudioContext||window.webkitAudioContext);i&&(he.prepareInstrument(e,new i),this.data=t,this.player=new(ce().Player)(t=>this.playEvent(t)),this.player&&this.player.loadArrayBuffer(t))}static prepareInstrument(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;!1===he.loadingInstrument&&(he.loadingInstrument=!0,he.audioContext=e,ce().Soundfont.instrument(he.audioContext,t.MIDISoundFontObject||he.MIDISoundFontObject||`${t.MIDISoundFontBase||he.MIDISoundFontBase}/${t.MIDISoundFontName||he.MIDISoundFontName}${t.MIDISoundFontExtension||he.MIDISoundFontExtension}`).then(t=>{m("info","MIDI soundfont instrument loaded"),he.instrument=t}).catch(t=>{m("error",`Error loading soundfont base instrument: ${t}`)}))}pause(){this.player&&(this.player.pause(),this.startedNotes=[])}play(){this.player&&(this.startedNotes=[],this.player.play())}get paused(){return this.player&&!this.player.isPlaying()}get ended(){return this.player&&this.player.getSongTimeRemaining()<=0}get currentTime(){return this.player&&1e3*this.player.getSongTime()||0}set currentTime(t){this.player&&this.player.skipToSeconds(t/1e3)}playEvent(t){this.player&&he.instrument&&(this.playTo>0&&this.currentTime>=this.playTo?this.pause():"Controller Change"===t.name&&7===t.number?this.mainVolume=t.value/127:"Note on"===t.name&&t.velocity>0?this.startedNotes[t.noteNumber]=he.instrument.play(t.noteName,he.audioContext.currentTime,{gain:this.mainVolume*t.velocity/100*2}):"Note off"===t.name&&t.noteNumber&&this.startedNotes[t.noteNumber]&&(this.startedNotes[t.noteNumber].stop(),delete this.startedNotes[t.noteNumber]))}}Object.assign(he.prototype,{data:null,player:null,playTo:0,mainVolume:1,startedNotes:[]}),he.audioContext=null,he.instrument=null,he.loadingInstrument=!1,he.MIDISoundFontObject=null,he.MIDISoundFontBase="https://clic.xtec.cat/dist/jclic.js/soundfonts/MusyngKite",he.MIDISoundFontName="acoustic_grand_piano",he.MIDISoundFontExtension="-mp3.js";const ue=he;class de{constructor(t,e,i){t&&(this.basePath=t),e&&(this.file=Y(e),this.name=Y(e),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&this.checkAnimatedGif()),i&&(this.zip=i),this.timeout=Date.now()+gt.LOAD_TIMEOUT}static _audioPlayers=[];static getAudioPlayer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return de._audioPlayers[t]||(de._audioPlayers[t]=document.createElement("audio")),de._audioPlayers[t]}static _currentAudioElements=[];static resetAudioElements(){de._audioPlayers.fill(null),de._currentAudioElements.fill(null)}setProperties(t){if(this.name=Y(t.attr("name")),this.file=Y(t.attr("file")),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext){const e=t.attr("animated");void 0===e?this.checkAnimatedGif():this.animated="true"===e}return"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}getAttributes(){return V(this,["name","file","animated"])}setAttributes(t){return["name","file","animated"].forEach(e=>{j(t[e])||(this[e]=t[e])}),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&"undefined"===this.animated&&this.checkAnimatedGif(),"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}checkAnimatedGif(){const t=new XMLHttpRequest;t.addEventListener("load",()=>{const e=new Uint8Array(t.response),i=e.length;if(71===e[0]&&73===e[1]&&70===e[2]&&56===e[3]){for(let t=0,s=i-3,n=0;t<s&&n<2;++t)if(0===e[t]&&33===e[t+1]&&249===e[t+2]){const s=t+4+e[t+3];if(s+1<i&&0===e[s]&&(44===e[s+1]||33===e[s+1])&&++n>1){this.animated=!0,m("debug",`Animated GIF detected: ${this.file}`);break}}}else this.animated=!1}),this.getFullPathPromise().then(e=>{t.open("GET",e,!0),t.responseType="arraybuffer",t.send()})}isEmpty(){return null===this.data}getFileType(t){let e=null;for(let i in gt.FILE_TYPES)if(gt.FILE_TYPES[i].indexOf(t)>=0){e=i;break}return e}build(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return gt.NODEJS&&(this.data=[],this.ready=!0),t&&(this._whenReady||(this._whenReady=[]),this._whenReady.push(t)),this.data?this.ready&&this._onReady():this.getFullPathPromise().then(t=>{switch(this.type){case"font":const r="ttf"===this.ext?"truetype":"otf"===this.ext?"embedded-opentype":this.ext;ct(`@font-face{font-family:"${this.fontName}";src:url(${t}) format("${r}");}`,i),this.data=new yt(this.name),this.ready=!0;break;case"image":this.data=new Image,this.data.addEventListener("load",()=>{this._onReady.call(this)},{once:!0}),this.data.src=t;break;case"video":this.data=document.createElement(this.type),this.data.addEventListener("canplay",()=>{this._onReady.call(this)},{once:!0}),this.data.src=t,this.data.load(),this.data.pause();break;case"audio":if(s){const e=de._currentAudioElements[n];e&&e!==this&&(e.data=null,e.ready=!1),de._currentAudioElements[n]=this;const i=de.getAudioPlayer(n);i.src!==t?(m("trace",`Loading static player #${n} with new audio: ${t}`),this.data=i,this.ready=!1,i.addEventListener("canplay",()=>{this._onReady.call(this)},{once:!0}),i.src=t,i.load(),i.pause()):m("trace",`Reusing existing audio in player #${n}: ${t}`)}else this.ready=!0;break;case"anim":this.data=e(`<object type"application/x-shockwave-flash" width="300" height="200" data="${t}"/>`).get(-1),this.ready=!0;break;case"xml":e.get(t,null,null,"xml").done(t=>{const e=t?t.children||t.childNodes:null;this.data=e&&e.length>0?_(e[0]):null,this._onReady()}).fail(t=>{m("error",`Error loading ${this.name}: ${t}`),this._onReady()});break;case"midi":const a=new XMLHttpRequest;a.onreadystatechange=()=>{4===a.readyState&&(200===a.status?this.data=new ue(a.response,i&&i.options):m("error",`Error loading ${this.name}: ${a.statusText}`),this._onReady())},a.open("GET",t,!0),a.responseType="arraybuffer",a.send();break;default:m("trace",`Media currently not supported: ${this.name}`),this.ready=!0}this.ready&&this._onReady()}),this}checkReady(){if(this.data&&!this.ready)switch(this.type){case"image":this.ready=!0===this.data.complete;break;case"audio":case"video":case"anim":this.ready=this.data.readyState>=1;break;default:this.ready=!0}return this.ready}checkTimeout(){const t=Date.now()>this.timeout;return t&&m("warn",`Timeout while loading: ${this.name}`),t}_onReady(){this.ready=!0,this._whenReady&&(this._whenReady.forEach(t=>t.call(this,this)),this._whenReady=null)}getFullPath(){return this._fullPath}getFullPathPromise(){return it(this.basePath,this.file,this.zip).then(t=>(this._fullPath=gt.NODEJS?t:new URL(t,document.location.href).toString(),this._fullPath))}}Object.assign(de.prototype,{name:"",file:"",fontName:"",basePath:"",zip:null,data:null,ready:!1,_whenReady:null,ext:"",type:null,timeout:0,animated:!1,_fullPath:null});const pe=de;class fe{constructor(t){this.project=t,this.elements={}}setProperties(t){return t.children("media").each((t,i)=>{const s=new pe(this.project.basePath,null,this.project.zip);s.setProperties(e(i)),this.elements[s.name]=s}),this}getAttributes(){return Object.keys(this.elements).map(t=>this.elements[t].getAttributes())}setAttributes(t){return t&&t.length&&t.forEach(t=>{const e=new pe(this.project.basePath,null,this.project.zip);e.setAttributes(t),this.elements[e.name]=e}),this}getElement(t,e){t=Y(t);let i=this.elements[t];return e&&!i&&(i=this.getElementByFileName(t,e)),i}getElementByFileName(t,e){let i=null;if(t){t=Y(t);for(let e in this.elements)if(this.elements[e].file===t){i=this.elements[e];break}!i&&e&&(i=new pe(this.project.basePath,null,this.project.zip),i.name=t,i.file=t,i.ext=t.toLowerCase().split("#")[0].split(".").pop(),i.type=i.getFileType(i.ext),this.elements[i.name]=i)}return i}getElementsOfType(t){const i=[];return e.each(this.elements,(e,s)=>{s.type===t&&i.push("font"===t?s.fontName:e)}),i}buildAll(t,i,s){let n=0;return e.each(this.elements,(e,r)=>{t&&r.type!==t||(r.build(i,s,!1),n++)}),n}countWaitingElements(){let t=0,i=!0;return e.each(this.elements,(e,s)=>{!s.data||s.ready||s.checkReady()||s.checkTimeout()?t++:(m("debug","... waiting for: %s",e),i=!1)}),i?-1:t}getSkinElement(t,e){return Ft.getSkin(t,e)}}Object.assign(fe.prototype,{elements:null,project:null});const ge=fe,me=gt.BoxBase;class ve{constructor(t){this.parent=t||null}setProperties(t){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"shadow":case"transparent":this[t]=v(e,!1);break;case"margin":this[t]=Number(e);break;case"borderStroke":this.borderStroke=new At(Number(e));break;case"markerStroke":this.markerStroke=new At(Number(e))}}),t.children().each((t,i)=>{const s=e(i);switch(i.nodeName){case"font":this.font=(new yt).setProperties(s);break;case"gradient":this.bgGradient=(new wt).setProperties(s);break;case"color":this.textColor=D(s.attr("foreground"),this.textColor),this.backColor=D(s.attr("background"),this.backColor),this.shadowColor=D(s.attr("shadow"),this.shadowColor),this.inactiveColor=D(s.attr("inactive"),this.inactiveColor),this.alternativeColor=D(s.attr("alternative"),this.alternativeColor),this.borderColor=D(s.attr("border"),this.borderColor)}}),this}getAttributes(){return V(this,["shadow","transparent","margin","borderStroke","markerStroke","font","bgGradient",`textColor|${ve.prototype.textColor}`,`backColor|${ve.prototype.backColor}`,`shadowColor|${ve.prototype.shadowColor}`,`inactiveColor|${ve.prototype.inactiveColor}`,`alternativeColor|${ve.prototype.alternativeColor}`,`borderColor|${ve.prototype.borderColor}`])}setAttributes(t){return L(this,t,["shadow","transparent","margin",{key:"borderStroke",fn:At},{key:"markerStroke",fn:At},{key:"font",fn:yt},{key:"bgGradient",fn:wt},"textColor","backColor","shadowColor","inactiveColor","alternativeColor","borderColor"])}get(t){return this.hasOwnProperty(t)||null===this.parent?this[t]:this.parent.get(t)}set(t,e){return this[t]=e,this}getOwn(t){return this.hasOwnProperty(t)?this[t]:null!==this.parent?this.parent.getOwn(t):("object"==typeof this[t]?this[t]=N(ve.prototype[t]):this[t]=ve.prototype[t],this[t])}getCSS(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=this.get("font");(t=n.toCss(t)).color=i?this.get("backColor"):s?this.get("alternativeColor"):this.get("textColor");const r=this.get("transparent");t["background-color"]=r?"transparent":e?this.get("inactiveColor"):i?this.get("textColor"):this.get("backColor");const a=this.get("bgGradient");if(a&&!r&&(t["background-image"]=a.getCss()),1===this.shadow){const e=Math.max(1,Math.round(n.size/10)),i=this.get("shadowColor");t["text-shadow"]=`${e}px ${e}px 3px ${i}`}return t}prepareText(t,e,i,s){const n=[],r=this.get("font"),a=r.getHeight();let o=0;const l=e.trim().split("\n");t.font=r.cssFont();for(let c=0;c<l.length;c++){let h=l[c].trim(),u=t.measureText(h).width;if(u>i){let n=0,a=0;for(let e=0;e<h.length;e++)if(z(h[e])){const s=t.measureText(h.substring(0,e).trim()).width;if(s>i)break;n=e,a=s}if(n>0)l.splice(c+1,0,h.substring(n+1).trim()),h=l[c]=h.substring(0,n).trim(),u=a;else if(r.size>me.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,i,s)}if(n.push({text:h,size:new xt(u,a)}),o+=a,o>s&&r.size>me.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,i,s)}return n}}Object.assign(ve.prototype,{parent:null,default:me,font:new yt,dynFontSize:0,resetFontCounter:0,backColor:me.BACK_COLOR,bgGradient:null,textColor:me.TEXT_COLOR,shadowColor:me.SHADOW_COLOR,borderColor:me.BORDER_COLOR,inactiveColor:me.INACTIVE_COLOR,alternativeColor:me.ALTERNATIVE_COLOR,shadow:!1,transparent:!1,dontFill:!1,textMargin:me.AC_MARGIN,borderStroke:new At(me.BORDER_STROKE_WIDTH),markerStroke:new At(me.MARKER_STROKE_WIDTH)}),ve.DEFAULT_BOX_BASE=new ve;const be=ve;class ye{constructor(t,e){t&&(this.h=t),e&&(this.v=e)}getAttributes(){return V(this,["h|center","v|center"])}setAttributes(t){return L(this,t,["h","v"])}}Object.assign(ye.prototype,{h:"center",v:"center"});class we{constructor(t){void 0!==t&&(this.id=t),this.imgAlign=new ye,this.txtAlign=new ye}setProperties(t,i){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"id":case"item":this[t]=Number(e);break;case"width":case"height":null===this.dimension&&(this.dimension=new xt(0,0)),this.dimension[t]=Number(e);break;case"txtAlign":case"imgAlign":this[t]=this.readAlign(e);break;case"hAlign":this.txtAlign=this.readAlign(e+",center"),this.imgAlign=this.readAlign(e+",center");break;case"border":case"avoidOverlapping":this[t]=v(e);break;case"image":this.image=Y(e)}}),t.children().each((t,i)=>{const s=e(i);switch(i.nodeName){case"style":this.style=new be(null).setProperties(s);break;case"media":this.mediaContent=(new Ht).setProperties(s);break;case"p":null===this.text?this.text="":this.text+="\n",this.text+=i.textContent}}),i&&this.realizeContent(i),this}getAttributes(){return V(this,["id","item","dimension","border","avoidOverlapping","image","text","objectType","txtAlign","imgAlign","style","mediaContent"])}setAttributes(t,e){return"string"==typeof t?this.text=t:L(this,t,["id","item","border","avoidOverlapping","image","text","objectType",{key:"dimension",fn:xt},{key:"txtAlign",fn:ye},{key:"imgAlign",fn:ye},{key:"style",fn:be},{key:"mediaContent",fn:Ht}]),e&&this.realizeContent(e),this}readAlign(t){const e=new ye;if(t){const i=t.split(",");e.h=i[0].replace("middle","center"),e.v=i[1].replace("middle","center")}return e}isEmpty(){return null===this.text&&null===this.img}isEquivalent(t,e){if(t===this)return!0;let i=!1;return null!==t&&(i=this.isEmpty()&&t.isEmpty()?this.id===t.id:(null===this.text?null===t.text:e?this.text===t.text:this.text.toLocaleLowerCase()===t.text.toLocaleLowerCase())&&(null===this.mediaContent?null===t.mediaContent:this.mediaContent.isEquivalent(t.mediaContent))&&this.img===t.img&&(null===this.imgClip?null===t.imgClip:this.imgClip.equals(t.imgClip))),i}setTextContent(t){null!==t?(this.text=t,this.checkHtmlText()):(this.text=null,this.innerHtmlText=null)}checkHtmlText(){if(this.innerHtmlText=null,Z(this.text,"<html>",!0)){const t=this.text.trim(),e=t.toLocaleLowerCase();if(-1===e.indexOf("<body")){const i=e.indexOf("</html>");i>=0&&(this.innerHtmlText=t.substring(6,i))}}}setImgContent(t,e,i){this.img=t,this.image=null,this.imgClip=e,i&&(this.animatedGifFile=i)}prepareMedia(t){!this.amp&&this.mediaContent&&"PLAY_VIDEO"===this.mediaContent.type&&(this.amp=t.getActiveMediaPlayer(this.mediaContent),this.amp.realize())}realizeContent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null!==this.image&&this.image.length>0&&(this.mbe=t.getElement(this.image,!0),this.mbe&&this.mbe.build(()=>{this.img=this.mbe.data,this.animatedGifFile=this.mbe.animated?this.mbe.getFullPath():null},e,!0)),null!==this.mediaContent&&(null!==this.image||null!==this.text&&0!==this.text.length||(this.img=this.mediaContent.getIcon(),this.animatedGifFile=null)),this.checkHtmlText(t)}getDescription(){const t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push(`${f("image")} ${this.image}`),this.imgClip&&t.push(this.imgClip.toString()),this.mediaContent&&t.push(this.mediaContent.getDescription()),t.join(" ")}toString(){const t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push(`${f("image")} ${this.image}`),this.imgClip&&t.push(`${f("image fragment")} ${(this.id>=0?this.id:this.item)+1}`),t.join(" ")||f("cell")}}Object.assign(we.prototype,{style:null,dimension:null,border:null,text:null,image:null,imgClip:null,mediaContent:null,imgAlign:null,txtAlign:null,avoidOverlapping:!1,id:-1,item:-1,img:null,animatedGifFile:null,innerHtmlText:null,amp:null,mbe:null}),we.EMPTY_CONTENT=new we;const Ae=we;class Ce{constructor(t,e){this.reset(t,e)}static registerClass(t,e){return Ce.CLASSES[t]=e,e}static getShaper(t,e,i){const s=Ce.CLASSES[(t||"").replace(/^edu\.xtec\.jclic\.shapers\./,"@")];return s||m("error",`Unknown shaper: ${t}`),s?new s(e,i):null}reset(t,e){this.nCols=t,this.nRows=e,this.nCells=e*t,this.initiated=!1,this.shapeData=[];for(let t=0;t<this.nCells;t++)this.shapeData[t]=new kt}setProperties(t){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"class":this.className=e;break;case"cols":this.nCols=Number(e);break;case"rows":this.nRows=Number(e);break;case"baseWidthFactor":case"toothHeightFactor":case"scaleX":case"scaleY":this[t]=Number(e);break;case"randomLines":case"showEnclosure":this[t]=v(e,!0)}}),t.children("enclosing:first").each((t,i)=>{e(i).children("shape:first").each((t,e)=>{let i=Ce.readShapeData(e,this.scaleX,this.scaleY);this.enclosing=i,this.showEnclosure=!0,this.hasRemainder=!0})}),t.children("shape").each((t,e)=>{this.shapeData[t]=Ce.readShapeData(e,this.scaleX,this.scaleY)}),this.shapeData.length>0&&(this.nCells=this.shapeData.length),this}static readShapeData(t,i,s){const n=[];let r=null;return e.each(t.textContent.split("|"),(t,e)=>{const a=e.split(":");let o=a.length>1?a[1].split(","):null;switch(o&&(o=o.map((t,e)=>t/(e%2?s:i))),a[0]){case"rectangle":r=new St(o[0],o[1],o[2],o[3]);break;case"ellipse":r=new Tt(o[0],o[1],o[2],o[3]);break;default:n.push(new Pt(a[0],o))}}),!r&&n.length>0?new Et(n):r}getAttributes(){const t=["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines"];return this.customShapes&&["showEnclosure","hasRemainder","enclosing","shapeData"].forEach(e=>t.push(e)),V(this,t)}static factory(t){const e=Ce.getShaper(t.className,t.nCols,t.nRows);return L(e,t,["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines","showEnclosure","hasRemainder",{key:"enclosing",fn:kt},{key:"shapeData",fn:kt,group:"array"}]),e.nCells=e.shapeData.length||e.nCols*e.nRows,e}buildShapes(){}getShape(t,e){return this.initiated||this.buildShapes(),t>=this.nCells||null===this.shapeData[t]?null:this.shapeData[t].getShape(e)}getShapeData(t){return t>=0&&t<this.shapeData.length?this.shapeData[t]:null}getEnclosingShapeData(){return new St(0,0,1,1)}getRemainderShape(t){if(!this.hasRemainder)return null;this.initiated||this.buildShapes();const e=this.getEnclosingShapeData(),i=e?e.getShape(t):new St;for(let e=0;e<this.nCells;e++)this.shapeData[e]&&i.add(this.shapeData[e].getShape(t),!1);return i}}Object.assign(Ce.prototype,{className:"Shaper",nCols:0,nRows:0,nCells:0,shapeData:null,initiated:!1,baseWidthFactor:1/3,toothHeightFactor:1/6,randomLines:!1,scaleX:1,scaleY:1,enclosing:null,showEnclosure:!1,rectangularShapes:!1,hasRemainder:!1,customShapes:!1}),Ce.CLASSES={};const xe=Ce;class ke{constructor(t,e,i){t&&(this.id=t),this.cells=[],this.ncw=Math.max(1,e),this.nch=Math.max(1,i)}setProperties(t,i){let s=!1;if(ht(t.get(0).attributes,(t,e)=>{switch(t){case"id":this.id=e;break;case"image":this.image=Y(e);break;case"rows":this.nch=Number(e);break;case"columns":s=!0;case"cols":this.ncw=Number(e);break;case"cellWidth":this.w=Number(e);break;case"cellHeight":this.h=Number(e);break;case"border":this.border=v(e)}}),s){let t=this.ncw;this.ncw=this.nch,this.nch=t}t.children().each((t,s)=>{const n=e(s);switch(s.nodeName){case"style":this.style=new be(null).setProperties(n);break;case"shaper":const t=n.attr("class"),e=Math.max(1,n.attr("cols")),r=Math.max(1,n.attr("rows"));this.shaper=xe.getShaper(t,e,r),this.shaper.setProperties(n);break;case"ids":this.ids=s.textContent,this.ids.split(" ").forEach((t,e)=>{this.cells[e]=new Ae(Number(t))});break;case"cell":this.cells.push((new Ae).setProperties(n,i))}});let n=this.cells.length;if(0===n&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,n=this.shaper.nCells,this.getActiveBoxContent(n-1)),n>0){let t=!0;for(let e=0;e<n;e++){const i=this.getActiveBoxContent(e);if(-1!==i.id||-1!==i.item||!i.isEmpty()){t=!1;break}}if(t)for(let t=0;t<n;t++)this.getActiveBoxContent(t).id=t}return this.style&&this.cells.forEach(t=>{t.style&&(t.style.parent=this.style)}),this}getAttributes(){const t=["id","image","ncw","nch","w","h","border","style","shaper"];return this.initiallyEmptyCells||t.push(this.ids?"ids":"cells"),V(this,t)}setAttributes(t,e){L(this,t,["id","image","ncw","nch","w","h","border",{key:"style",fn:be},{key:"shaper",fn:xe},"ids",{key:"cells",fn:Ae,group:"array",params:[e]}]);let i=this.cells.length;if(0===i&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,i=this.shaper.nCells,this.getActiveBoxContent(i-1),this.ids&&this.ids.split(" ").forEach((t,e)=>{this.getActiveBoxContent(e).id=Number(t)})),i>0){let t=!0;for(let e=0;e<i;e++){const i=this.getActiveBoxContent(e);if(-1!==i.id||-1!==i.item||!i.isEmpty()){t=!1;break}}if(t)for(let t=0;t<i;t++)this.getActiveBoxContent(t).id=t}return this.style&&this.cells.forEach(t=>{t.style&&(t.style.parent=this.style)}),e&&this.cells.forEach(t=>t.realizeContent(e)),this}prepareMedia(t){this.cells.forEach(e=>e.prepareMedia(t))}getTotalWidth(){return this.w*this.ncw}getTotalHeight(){return this.h*this.nch}getNumCells(){return this.cells.length}isEmpty(){return 0===this.cells.length}getShaper(){return null===this.shaper&&(this.shaper=xe.getShaper("@Rectangular",this.ncw,this.nch)),this.shaper}getBoxBase(){return null===this.style&&(this.style=new be),this.style}addActiveBoxContent(t){this.cells.push(t),0!==this.ncw&&0!==this.nch||(this.ncw=this.nch=1)}getActiveBoxContent(t){if(t>=this.cells.length)for(let e=this.cells.length;e<=t;e++)this.cells.push(new Ae);return this.cells[t]}getActiveBoxContentWith(t,e){return this.cells.find(i=>i.id===t&&i.item===e)}setImgContent(t,e,i){e&&this.setShaper(e),"@Holes"===this.shaper.className&&(this.shaper.hasRemainder=!0),this.ncw=this.shaper.nCols,this.nch=this.shaper.nRows;const s=t.elements[this.image];t&&this.image&&s&&s.ready?(this.img=s.data,s.animated&&(this.animatedGifFile=s.getFullPath()),this.w=this.img.width/this.ncw,this.h=this.img.height/this.nch,i&&(this.w=Math.round(this.w),this.h=Math.round(this.h))):(this.img=null,this.w=Math.max(this.w,10),this.h=Math.max(this.h,10));const n=new St(0,0,this.w*this.ncw,this.h*this.nch);for(let t=0;t<this.shaper.nCells;t++)this.getActiveBoxContent(t).setImgContent(this.img,this.shaper.getShape(t,n),this.animatedGifFile);this.shaper.hasRemainder&&(this.backgroundContent=new Ae,this.backgroundContent.setImgContent(this.img,this.shaper.getRemainderShape(n)))}setTextContent(t,e,i){this.ncw=Math.max(1,e),this.nch=Math.max(1,i);const s=this.ncw*this.nch;for(let e=0;e<s;e++)this.getActiveBoxContent(e).setTextContent(e>=t.length||null===t[e]?"":t[e])}setIds(t){for(let e=0;e<t.length&&e<this.cells.length;e++)this.getActiveBoxContent(e).id=t[e]}setCellsAttribute(t,e){this.cells.forEach(i=>i[t]=e)}avoidAllIdsNull(t){this.cells.every(t=>-1===t.id)&&(t=Math.max(1,t),this.cells.forEach((e,i)=>{e.id=i%t}))}}Object.assign(ke.prototype,{id:"primary",image:null,img:null,animatedGifFile:null,ncw:1,nch:1,w:gt.DEFAULT_GRID_ELEMENT_SIZE,h:gt.DEFAULT_GRID_ELEMENT_SIZE,border:!0,style:null,shaper:null,backgroundContent:null,cells:null,defaultIdValue:-1,ids:null});const Se=ke;class Te{constructor(){}static getProvider(t){let e=null;if(t){const i=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),s=Te.CLASSES[i];s?(e=new s,e.setProperties(t)):m("error",`Unknown AutoContentProvider class: ${i}`)}return e}setProperties(t){return this.className=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),this}getAttributes(){return V(this,["className"])}static factory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(new(0,Te.CLASSES[t.className])).setAttributes(t,...e)}init(){}generateContent(t,e,i,s){return this.process(new Te.ActiveBagContentKit(t,e,i,s))}process(t){return!1}static registerClass(t,e){return Te.CLASSES[t]=e,e}}Object.assign(Te.prototype,{numericContent:!1}),Te.ActiveBagContentKit=class{constructor(t,e,i,s){this.nRows=t,this.nCols=e,this.content=i,this.useIds=s}},Te.CLASSES={"@tagreplace.TagReplace":Te},Te.registerClass("@tagreplace.TagReplace",Te);const Ee=Te;class Pe{constructor(){this.style=new be(null),this.text=[]}setProperties(t){ht(t.get(0).attributes,(t,e)=>{switch(t){case"rows":this.ncw=Number(e);break;case"columns":this.nch=Number(e);break;case"cellWidth":this.w=Number(e);break;case"cellHeight":this.h=Number(e);break;case"border":this.border=v(e);break;case"wild":case"randomChars":this[t]=e}}),t.children("style:first").each((t,i)=>{this.style=(new be).setProperties(e(i))}),t.find("text:first > row").each((t,e)=>this.text.push(e.textContent));for(let t=this.text.length;t<this.nch;t++)this.text[t]="";return this}getAttributes(){return V(this,["ncw","nch","w","h","text","style","border","wild|*",`randomChars|${gt.RANDOM_CHARS}`])}setAttributes(t){return L(this,t,["ncw","nch","w","h","text",{key:"style",fn:be},"border","wild","randomChars"])}countWildChars(){let t=0;if(this.text)for(let e=0;e<this.nch;e++)for(let i=0;i<this.ncw;i++)this.text[e].charAt(i)===this.wild&&t++;return t}getNumChars(){return this.ncw*this.nch}setCharAt(t,e,i){t>=0&&t<this.ncw&&e>=0&&e<this.nch&&(this.text[e]=this.text[e].substring(0,t)+i+this.text[e].substring(t+1))}}Object.assign(Pe.prototype,{ncw:1,nch:1,w:20,h:20,border:!1,style:null,text:null,wild:"*",randomChars:gt.RANDOM_CHARS});const Ie=Pe;class Be{constructor(t){this.className=t,this.collator=window.Intl&&window.Intl.Collator?new window.Intl.Collator:{compare:(t,e)=>this.checkCase?t===e:t.toUpperCase()===e.toUpperCase()}}static getEvaluator(t){let e=null;if(t){const i=t.attr("class"),s=Be.CLASSES[i];s?(e=new s(i),e.setProperties(t)):m("error",`Unknown evaluator class: "${i}"`)}return e}setProperties(t){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"class":this.className=e;break;case"checkCase":case"checkAccents":case"checkPunctuation":case"checkDoubleSpaces":case"detail":this[t]=v(e);break;case"checkSteps":case"checkScope":this[t]=Number(e)}}),this}static factory(t){const e=Be.CLASSES[t.className];if(e){return L(new e(t.className),t,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}return null}getAttributes(){return V(this,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}init(t){this.initiated=!0}checkText(t,e){return e instanceof Array?e.some(e=>this._checkText(t,e)):!!e&&this._checkText(t,e)}_checkText(t,e){return!1}evalText(t,e){return e instanceof Array||(e=[e]),this._evalText(t,e)}_evalText(t,e){return[]}isOk(t){return t&&t.length>0&&!t.some(t=>0!==t)}}Object.assign(Be.prototype,{className:null,initiated:!1,collator:null,checkCase:!1});class _e extends Be{constructor(t){super(t)}init(t){super.init([t]),window.Intl&&window.Intl.Collator&&(this.collator=new window.Intl.Collator(t,{sensitivity:this.checkAccents?this.checkCase?"case":"accent":"base",ignorePunctuation:!this.checkPunctuation}))}_checkText(t,e){return 0===this.collator.compare(this.getClearedText(t),this.getClearedText(e))}_evalText(t,e){return Array(t.length).fill(this._checkText(t,e[0])?0:1)}getClearedText(t,e){if(this.checkPunctuation&&this.checkDoubleSpaces)return t;e||(e=Array(t.length).fill(!1));let i="";for(let s=0,n=!1;s<t.length;s++){const r=t.charAt(s);this.PUNCTUATION.indexOf(r)>=0&&!this.checkPunctuation?(n?e[s]=!0:i+=" ",n=!0):" "===r?(this.checkDoubleSpaces||!n?i+=r:e[s]=!0,n=!0):(n=!1,i+=r)}return i}}Object.assign(_e.prototype,{checkAccents:!0,checkPunctuation:!0,checkDoubleSpaces:!1,PUNCTUATION:".,;:"});class Re extends _e{constructor(t){super(t)}_evalText(t,e){if(!this.detail)return super._evalText(t,e);const i=Array(t.length).fill(!1),s=this.getClearedText(t,i),n=Array(e.length),r=Array(e.length),a=Array(t.length);let o=-1,l=-1;for(let i=0;i<e.length;i++){r[i]=Array(t.length).fill(0);const a=this.compareSegment(s,s.length,e[i],e[i].length,r[i],!1);n[i]=this.countFlagsOk(r[i]),a&&(l=i,o=n[i])}if(-1===l)for(let t=0;t<e.length;t++)n[t]>o&&(o=n[t],l=t);for(let e=0,s=0;e<t.length;e++)a[e]=i[e]?0:r[l][s++];return a}countFlagsOk(t){return t.reduce((t,e)=>0==e?++t:t,0)}compareSegment(t,e,i,s,n,r){let a=0,o=0,l=0,c=!0,h=!0,u="",d="";if(0===e||0===s||null===t||null===i)return!1;for(;a<e;a++,o++)if(u=t.charAt(a),l=a,d=o>=0&&o<s?i.charAt(o):0,0===this.collator.compare(u,d))n[a]=0,c=!0;else if(h=!1,n[a]=1,!r&&c&&0!==d&&this.checkSteps>0&&this.checkScope>0){const n=2*this.checkSteps+1,r=[];let l=0,h=0;for(;h<n;h++){if(r[h]=0,l=o+Math.floor((h+1)/2)*(1&h?1:-1),l>=s)continue;const n=l<0?a-l:a;if(n>=e)continue;const c=Math.min(e-n,this.checkScope),u=l<0?0:l,d=Math.min(s-u,this.checkScope),p=Array(t.length-n).fill(0),f=this.compareSegment(t.substring(n),c,i.substring(u),d,p,!0);if(r[h]=this.countFlagsOk(p),f)break}if(h===n){let t=this.checkSteps;for(h=0;h<n;h++)r[h]>r[t]&&(t=h);l=o+Math.floor((t+1)/2)*(1&t?1:-1)}o=l,c=!1}return o!==s&&(h=!1,n[l]=1),h}}Object.assign(Re.prototype,{detail:!0,checkSteps:3,checkScope:6}),Be.CLASSES={"@BasicEvaluator":_e,"@ComplexEvaluator":Re};const Oe=Be;class De{constructor(){this.style={default:structuredClone(De.DEFAULT_DOC_STYLE)},this.p=[]}setProperties(t,i){return t.children("style").toArray().sort((t,e)=>{var i=t.getAttribute("name"),s=t.getAttribute("base")||null,n=e.getAttribute("name"),r=e.getAttribute("base")||null;return"default"===i?-1:"default"===n||s===n?1:r===i?-1:s?r?0:1:-1}).forEach(t=>{const i=this.readDocAttributes(e(t));this.style[i.name]="default"===i.name?e.extend(!0,this.style.default,i):i}),t.find("section > p").each((t,s)=>{const n={elements:[]};ht(s.attributes,(t,e)=>{switch(t){case"style":n[t]=e;break;case"bidiLevel":case"Alignment":n[t]=Number(e)}}),e(s).children().each((t,s)=>{let r;const a=e(s);switch(s.nodeName){case"cell":r=(new Ae).setProperties(a,i);break;case"text":r={text:s.textContent.replace(/\t/g,"	")};const t=this.readDocAttributes(a);e.isEmptyObject(t)||(r.attr=t);break;case"target":r=new Me(this,s.textContent.replace(/\t/g,"	")),r.setProperties(a,i),this.numTargets++;break;default:m("error",`Unknown object in activity document: "${s.nodeName}"`)}r&&(r.objectType=s.nodeName,n.elements.push(r))}),this.p.push(n)}),this}readDocAttributes(t){let i={},s={};return ht(t.get(0).attributes,(t,n)=>{switch(t){case"background":n=D(n,"white"),i[t]=n,s["background-color"]=n;break;case"foreground":n=D(n,"black"),i[t]=n,s.color=n;break;case"family":s["font-family"]=n;case"name":case"style":i[t]=n;break;case"base":i[t]=n,this.style[n]&&(i=e.extend(!0,{},this.style[n],i),this.style[n].css&&(s=e.extend({},this.style[n].css,s)));break;case"bold":n=v(n),i[t]=n,s["font-weight"]=n?"bold":"normal";break;case"italic":n=v(n),i[t]=n,s["font-style"]=n?"italic":"normal";break;case"target":i[t]=v(n);break;case"size":i[t]=Number(n),s["font-size"]=`${n}px`;break;case"tabWidth":this.tabSpc=n,s["tab-size"]=this.tabSpc,s["white-space"]="pre-wrap";break;default:m("warn",`Unknown text attribute: "${t}" = "${n}"`),i[t]=n}}),e.isEmptyObject(s)||(i.css=s),i}getAttributes(){return V(this,["style","tabSpc","targetType","p"])}setAttributes(t,e){return L(this,t,["style","tabSpc","targetType","p"]),this.p.forEach(t=>{t.elements?t.elements=t.elements.map(t=>"cell"===t.objectType?(new Ae).setAttributes(t,e):"target"===t.objectType?new Me(this).setAttributes(t,e):t):t.elements=[]}),this}getRawText(){const t=e("<div/>");return this.p.forEach(i=>{const s=e("<p/>");let n=!0;i.elements.forEach(t=>{switch(t.objectType){case"text":case"target":s.append(t.text)}n=!1}),n&&s.html(" "),t.append(s)}),t.text().trim()}getFullStyle(t){const i=e.extend(!0,{},this.style.default);return e.extend(!0,i,this.style[t]?this.style[t]:{})}}De.DEFAULT_DOC_STYLE={background:"0xFFFFFF",foreground:"0x000000",family:"Arial",bold:!1,italic:!1,size:17,css:{"background-color":"#FFFFFF",color:"#000000","font-family":"Arial","font-weight":"normal","font-style":"normal","font-size":"17px"}},Object.assign(De.prototype,{tabSpc:12,lastBoxId:0,tmb:null,numTargets:0,targetType:"TT_FREE",style:null,p:null});class Me{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.doc=t,this.text=e,this.numIniChars=e.length,this.answers=[e],this.maxLenResp=this.numIniChars}reset(t){this.targetStatus=t||"NOT_EDITED",this.flagModified=!1}setProperties(t,i){let s=!0;t.children().each((t,n)=>{const r=e(n);switch(n.nodeName){case"answer":s&&(s=!1,this.answers=[]),null===this.answers&&(this.answers=[]),this.answers.push(n.textContent);break;case"optionList":r.children("option").each((t,e)=>{this.isList=!0,null===this.options&&(this.options=[]),this.options.push(e.textContent)});break;case"response":this.iniChar=b(r.attr("fill"),this.iniChar).charAt(0),gt.WHITESPACES.indexOf(this.iniChar)>=0&&(this.iniChar="_"),this.numIniChars=y(r.attr("length"),this.numIniChars),this.maxLenResp=y(r.attr("maxLength"),this.maxLenResp),this.iniText=b(r.attr("show"),this.iniText);break;case"info":this.infoMode=b(r.attr("mode"),"always"),this.popupDelay=y(r.attr("delay"),this.popupDelay),this.popupMaxTime=y(r.attr("maxTime"),this.popupMaxTime),r.children("media").each((t,i)=>{this.onlyPlay=!0,this.popupContent=new Ae,this.popupContent.mediaContent=(new Ht).setProperties(e(i))}),this.popupContent||r.children("cell").each((t,s)=>{this.popupContent=(new Ae).setProperties(e(s),i)});break;case"text":this.text=n.textContent.replace(/\t/g,"	");const t=this.doc.readDocAttributes(e(n));e.isEmptyObject(t)||(this.attr=t)}})}getAttributes(){return V(this,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay","popupContent"])}setAttributes(t,e){return L(this,t,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay",{key:"popupContent",fn:Ae,params:[e]}])}getAnswers(){return this.answers?this.answers.join("|"):""}checkColors(){const t=this.$comboList||this.$span;if(t){const e=this.doc.style["WITH_ERROR"===this.targetStatus?"targetError":"HIDDEN"===this.targetStatus?"default":"target"];e&&e.css&&t.css(e.css)}}readCurrentText(){return this.$span?this.currentText=this.$span.text():this.$comboList&&(this.currentText=this.$comboList.val()),this.currentText}}Object.assign(Me.prototype,{doc:null,text:null,attr:null,isList:!1,numIniChars:1,iniChar:"_",maxLenResp:0,answers:null,options:null,iniText:null,infoMode:"no_info",popupKey:"F1",popupContent:null,popupDelay:0,popupMaxTime:0,onlyPlay:!1,$comboList:null,$span:null,$p:null,$popup:null,currentText:"",num:0,pos:0,targetStatus:"NOT_EDITED",flagModified:!1,parentPane:null}),De.TextTarget=Me;const Ne=De,$e="touchstart";class Ve{constructor(t){this.project=t,this.eventSounds=new Kt(this.project.settings.eventSounds),this.messages={},this.abc={}}static registerClass(t,e){return Ve.CLASSES[t]=e,e}static getActivity(t,e){let i=null;const s=t.jquery&&!0;if(t&&e){const n=s?(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.activities\./,"@"):t.className,r=Ve.CLASSES[n];r?(i=new r(e),s?i.setProperties(t):i.setAttributes(t)):m("error",`Unknown activity class: ${n}`)}return i}setProperties(t){return ht(t.get(0).attributes,(t,e)=>{switch(t){case"name":e=Y(e);case"code":case"type":case"description":this[t]=e;break;case"class":this.className=e.replace(/^edu\.xtec\.jclic\.activities\./,"@");break;case"inverse":this.invAss=v(e,!1);break;case"autoJump":case"forceOkToAdvance":case"amongParagraphs":this[t]=v(e,!1)}}),t.children().each((t,i)=>{const s=e(i);switch(i.nodeName){case"settings":ht(s.get(0).attributes,(t,e)=>{switch(t){case"infoUrl":case"infoCmd":this[t]=e;break;case"margin":case"maxTime":case"maxActions":this[t]=Number(e);break;case"report":this.includeInReports=v(e,!1);break;case"countDownTime":case"countDownActions":case"reportActions":case"useOrder":case"dragCells":this[t]=v(e,!1)}}),s.children().each((t,i)=>{const s=e(i);switch(i.nodeName){case"skin":this.skinFileName=s.attr("file");break;case"helpWindow":this.helpMsg=B(this),this.showSolution=v(s.attr("showSolution"),!1),this.helpWindow=null!==this.helpMsg||this.showSolution;break;case"container":this.bgColor=D(s.attr("bgColor"),gt.BoxBase.BACK_COLOR),s.children().each((t,i)=>{const s=e(i);switch(i.nodeName){case"image":this.bgImageFile=s.attr("name"),this.tiledBgImg=v(s.attr("tiled"),!1);break;case"counters":this.bTimeCounter=v(s.attr("time"),!0),this.bActionsCounter=v(s.attr("actions"),!0),this.bScoreCounter=v(s.attr("score"),!0);break;case"gradient":this.bgGradient=(new wt).setProperties(s)}});break;case"window":this.activityBgColor=D(s.attr("bgColor"),gt.DEFAULT_BG_COLOR),this.transparentBg=v(s.attr("transparent"),!1),this.border=v(s.attr("border"),!1),s.children().each((t,i)=>{const s=e(i);switch(i.nodeName){case"gradient":this.activityBgGradient=(new wt).setProperties(s);break;case"position":this.absolutePosition=(new Ct).setProperties(s),this.absolutePositioned=!0;break;case"size":this.windowSize=(new xt).setProperties(s)}});break;case"eventSounds":this.eventSounds.setProperties(s)}});break;case"messages":s.children("cell").each((t,i)=>{const s=this.readMessage(e(i));this.messages[s.type]=s});break;case"automation":this.acp=Ee.getProvider(s,this.project),this.acp&&(this.numericContent=this.acp.numericContent);break;case"cells":const t=(new Se).setProperties(s,this.project.mediaBag);this.abc[t.id]=t;break;case"scramble":this.shuffles=Number(s.attr("times")),this.shuffleA=v(s.attr("primary")),this.shuffleB=v(s.attr("secondary"));break;case"layout":ht(s.get(0).attributes,(t,e)=>{switch(t){case"position":this.boxGridPos=e;break;case"wildTransparent":case"upperCase":case"checkCase":this[t]=v(e)}});break;case"menuElement":this.menuElements.push({caption:s.attr("caption")||"",icon:s.attr("icon")||null,projectPath:s.attr("path")||null,sequence:s.attr("sequence")||null,description:s.attr("description")||""});break;case"textGrid":this.tgc=(new Ie).setProperties(s);break;case"clues":this.clues=[],this.clueItems=[],s.children("clue").each((t,i)=>{this.clueItems[t]=Number(e(i).attr("id")),this.clues[t]=i.textContent});break;case"checkButton":this.checkButtonText=i.textContent||"check";break;case"prevScreen":this.prevScreen=!0,this.prevScreenMaxTime=s.attr("maxTime")||-1,s.children().each((t,i)=>{switch(i.nodeName){case"style":this.prevScreenStyle=(new be).setProperties(e(i));break;case"p":null===this.prevScreenText&&(this.prevScreenText=""),this.prevScreenText+=`<p>${i.textContent}</p>`}});break;case"evaluator":this.ev=Oe.getEvaluator(s);break;case"document":this.document=(new Ne).setProperties(s,this.project.mediaBag)}}),this}readMessage(t){const e=(new Ae).setProperties(t,this.project.mediaBag);return e.type=t.attr("type"),P(e.style)&&(e.style=new be(null)),e}getAttributes(){return V(this,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd",`margin|${gt.DEFAULT_MARGIN}`,"maxTime","maxActions","includeInReports|true","reportActions|false","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution|false","helpMsg",`bgColor|${gt.DEFAULT_BG_COLOR}`,"bgImageFile","tiledBgImg","bTimeCounter|true","bActionsCounter|true","bScoreCounter|true",`activityBgColor|${gt.DEFAULT_BG_COLOR}`,"transparentBg|false","border|true","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText","bgGradient","activityBgGradient","absolutePosition","windowSize","eventSounds","messages","acp","abc","menuElements","tgc","clues","clueItems","prevScreenStyle","ev","document"])}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.project.mediaBag;return L(this,t,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd","margin","maxTime","maxActions","includeInReports","reportActions","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution","helpMsg","bgColor","bgImageFile","tiledBgImg","bTimeCounter","bActionsCounter","bScoreCounter","activityBgColor","transparentBg","border","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText",{key:"bgGradient",fn:wt},{key:"activityBgGradient",fn:wt},{key:"absolutePosition",fn:Ct},{key:"windowSize",fn:xt},{key:"messages",fn:Ae,group:"object",init:"key",params:[e]},{key:"abc",fn:Se,group:"object",init:"key",params:[e]},{key:"acp",fn:Ee,params:[e]},"menuElements",{key:"tgc",fn:Ie},"clues","clueItems",{key:"prevScreenStyle",fn:be},{key:"ev",fn:Oe},{key:"document",fn:Ne,params:[e]}]),t.eventSounds&&this.eventSounds.setAttributes(t.eventSounds),this.absolutePosition&&(this.absolutePositioned=!0),this}initAutoContentProvider(){null!==this.acp&&this.acp.init()}prepareMedia(t){return this.eventSounds.realize(t,this.project.mediaBag),e.each(this.messages,(e,i)=>{null!==i&&i.prepareMedia(t)}),e.each(this.abc,(e,i)=>{null!==i&&i.prepareMedia(t)}),!0}helpSolutionAllowed(){return!1}helpWindowAllowed(){return this.helpWindow&&(this.helpSolutionAllowed()&&this.showSolution||null!==this.helpMsg)}getMinNumActions(){return 0}mustPauseSequence(){return 0!==this.getMinNumActions()}canReinit(){return!0}hasInfo(){return null!==this.infoUrl&&this.infoUrl.length>0||null!==this.infoCmd&&this.infoCmd.length>0}hasRandom(){return!1}shuffleAlways(){return!1}needsKeyboard(){return!1}end(){this.eventSounds.close(),this.clear()}clear(){}getWindowSize(){return new xt(this.windowSize)}setWindowSize(t){this.windowSize=new xt(t)}getActivityPanel(t){return new this.constructor.Panel(this,t)}}Ve.CLASSES={"@panels.Menu":Ve},Object.assign(Ve.prototype,{project:null,name:gt.DEFAULT_NAME,className:null,code:null,type:null,description:null,margin:gt.DEFAULT_MARGIN,bgColor:gt.DEFAULT_BG_COLOR,bgGradient:null,tiledBgImg:!1,bgImageFile:null,border:!0,absolutePositioned:!1,absolutePosition:null,includeInReports:!0,reportActions:!1,helpWindow:!1,showSolution:!1,helpMsg:"",eventSounds:null,useOrder:!1,dragCells:!1,skinFileName:null,maxTime:0,countDownTime:!1,maxActions:0,countDownActions:!1,infoUrl:null,infoCmd:null,messages:null,windowSize:new xt(gt.DEFAULT_WIDTH,gt.DEFAULT_HEIGHT),transparentBg:!1,activityBgColor:gt.DEFAULT_BG_COLOR,activityBgGradient:null,bTimeCounter:!0,bScoreCounter:!0,bActionsCounter:!0,acp:null,abc:null,tgc:null,document:null,boxGridPos:"AB",shuffles:gt.DEFAULT_SHUFFLES,shuffleA:!0,shuffleB:!0,invAss:!1,menuElements:null,numericContent:!1});class qe extends _t{constructor(t,i,s){super(),this.act=t,this.ps=i,this.minimumSize=new xt(100,100),this.preferredSize=new xt(500,400),this.$div=s||e("<div/>",{class:"JClicActivity","aria-label":f("Activity panel")}),this.act.initAutoContentProvider()}setBounds(t){this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this.invalidate(t),this.$div.css({position:"relative",left:t.pos.x,top:t.pos.y,width:t.dim.width,height:t.dim.height})}buildVisualComponents(){if(this.playing=!1,this.skin=null,this.act.skinFileName&&this.act.skinFileName.length>0&&this.act.skinFileName!==this.act.project.settings.skinFileName&&(this.skin=this.act.project.mediaBag.getSkinElement(this.act.skinFileName,this.ps)),this.bgImage=null,this.act.bgImageFile&&this.act.bgImageFile.length>0){const t=this.act.project.mediaBag.getElement(this.act.bgImageFile,!0);t&&(this.bgImage=t.data)}this.backgroundColor=this.act.activityBgColor,this.act.transparentBg&&(this.backgroundTransparent=!0),this.act.border&&(this.border=!0);const t={display:"block","background-color":this.backgroundTransparent?"transparent":this.backgroundColor};this.border&&(t["box-shadow"]="0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)",t["border-radius"]="2px",t.color="#272727"),this.act.activityBgGradient&&(t["background-image"]=this.act.activityBgGradient.getCss()),this.$div.css(t)}updateContent(t){return super.updateContent(t)}playEvent(t){this.act.eventSounds.play(t)}initActivity(){this.playing&&(this.playing=!1,this.ps.reportEndActivity(this.act,this.solved)),this.solved=!1,this.ps.reportNewActivity(this.act,0),this.attachEvents(),this.enableCounters()}startActivity(){this.playing=!0}activityReady(){}showHelp(){}setDimension(t){return new xt(Math.min(t.width,this.act.windowSize.width),Math.min(t.height,this.act.windowSize.height))}attachEvents(){this.events.forEach(t=>this.attachEvent(this.$div,t)),gt.TOUCH_DEVICE||-1!==e.inArray($e,this.events)||this.attachEvent(this.$div,$e)}attachEvent(t,i){t.on(i,this,i=>{if(i.type!==$e||(gt.TOUCH_DEVICE||(gt.TOUCH_DEVICE=!0),-1!==e.inArray($e,this.events)))return i.data.processEvent.call(i.data,i);t.off($e)})}processEvent(t){return!1}fitTo(t,e){const i=new Ct;this.act.absolutePositioned&&null!==this.act.absolutePosition&&(i.x=Math.max(0,this.act.absolutePosition.x+t.pos.x),i.y=Math.max(0,this.act.absolutePosition.y+t.pos.y),t.dim.width-=this.act.absolutePosition.x,t.dim.height-=this.act.absolutePosition.y);const s=this.setDimension(new xt(Math.max(2*this.act.margin+gt.MINIMUM_WIDTH,t.dim.width),Math.max(2*this.act.margin+gt.MINIMUM_HEIGHT,t.dim.height)));this.act.absolutePositioned||i.moveTo(Math.max(0,t.pos.x+(t.dim.width-s.width)/2),Math.max(0,t.pos.y+(t.dim.height-s.height)/2)),i.x+s.width>e.dim.width&&(i.x=Math.max(0,e.dim.width-s.width)),i.y+s.height>e.dim.height&&(i.y=Math.max(0,e.dim.height-s.height)),this.setBounds(new St(i.x,i.y,s.width,s.height)),window.setTimeout(()=>this.buildAccessibleComponents(),0)}buildAccessibleComponents(){this.accessibleCanvas&&this.$canvas&&this.$canvas.children().length>0&&this.$canvas.empty()}forceFinishActivity(){}finishActivity(t){this.playing=!1,this.solved=t,null!==this.bc&&this.bc.end(),t?this.setAndPlayMsg("final","finishedOk"):this.setAndPlayMsg("finalError","finishedError"),this.ps.activityFinished(this.solved),this.ps.reportEndActivity(this.act,this.solved)}setAndPlayMsg(t,e){const i=this.act.messages[t]||null;this.ps.setMsg(i),null!==i&&null!==i.mediaContent||this.playEvent(e)}end(){this.forceFinishActivity(),this.playing&&(null!==this.bc&&this.bc.end(),this.ps.reportEndActivity(this.act,this.solved),this.playing=!1,this.solved=!1),this.clear()}clear(){}enableCounters(t,e,i){void 0===t&&(t=this.act.bTimeCounter),void 0===e&&(e=this.act.bScoreCounter),void 0===i&&(i=this.act.bActionsCounter),this.ps.setCounterEnabled("time",t),this.act.countDownTime&&this.ps.setCountDown("time",this.act.maxTime),this.ps.setCounterEnabled("score",e),this.ps.setCounterEnabled("actions",i),this.act.countDownActions&&this.ps.setCountDown("actions",this.act.maxActions)}shuffle(t,e,i){const s=this.act.shuffles;let n=s;for(;n>0;){const e=n>s?s:n;t.forEach(t=>{t&&t.shuffleCells(e,i)}),n-=s}}}Object.assign(qe.prototype,{act:null,$div:null,$canvas:null,accessibleCanvas:!0,skin:null,$animatedBg:null,$animatedBgB:null,solved:!1,bgImage:null,playing:!1,firstRun:!0,currentItem:0,bc:null,ps:null,minimumSize:null,preferredSize:null,events:["click"],backgroundColor:null,backgroundTransparent:!1,border:null}),Ve.Panel=qe;const je=Ve;class Le{constructor(){this.settings=new Yt(this),this.activitySequence=new oe(this),this._activities={},this.mediaBag=new ge(this)}setProperties(t,i,s,n){i&&(this.path=i,i.file?this.basePath=i:this.basePath=X(i)),this.zip=s,this.name=t.attr("name"),this.version=t.attr("version"),void 0!==t.attr("type")&&""!==t.attr("type")&&(this.type=t.attr("type")),void 0!==t.attr("code")&&""!==t.attr("code")&&(this.code=t.attr("code")),this.settings.setProperties(t.children("settings")),this.activitySequence.setProperties(t.children("sequence")),this.mediaBag.setProperties(t.children("mediaBag")),this.reportableActs=0,this._activities={};const r=t.children("activities").children("activity"),a=this.mediaBag.getElementsOfType("font");return a.length>0&&(n.ownFonts=(n.ownFonts||[]).concat(a)),gt.NODEJS||yt.checkTree(r,n),r.each((t,i)=>{const s=e(i);this._activities[Y(s.attr("name"))]=s,"true"===s.children("settings").attr("report")&&this.reportableActs++}),this}getAttributes(){const t=Object.keys(this._activities);return this.activities={},t.forEach(t=>{const e=this._activities[t];this.activities[t]=e.jquery?je.getActivity(e,this):e}),V(this,["name","version","type","code","settings","activitySequence","activities","mediaBag"])}getJSON(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return JSON.stringify(this.getAttributes(),(t,e)=>e.toFixed?Number(e.toFixed(4)):e,t)}setAttributes(t,e,i,s){e&&(this.path=e,e.file?this.basePath=e:this.basePath=X(e)),this.zip=i,this.name=t.name,this.version=t.version,t.type&&(this.type=t.type),t.code&&(this.code=t.code),this.settings.setAttributes(t.settings),this.activitySequence.setAttributes(t.activitySequence),this.mediaBag.setAttributes(t.mediaBag),this.reportableActs=0,this._activities=t.activities;const n=this.mediaBag.getElementsOfType("font");return n.length>0&&(s.ownFonts=(s.ownFonts||[]).concat(n)),yt.checkTree(this._activities,s),this.reportableActs=Object.keys(this._activities).filter(t=>this._activities[t].includeInReports).length,this}getActivity(t){return je.getActivity(this._activities[Y(t)],this)}realize(t){null===this.skin&&null!==this.settings.skinFileName&&this.settings.skinFileName.length>0&&(this.skin=this.mediaBag.getSkinElement(this.settings.skinFileName,t)),this.settings.eventSounds.realize(t,this.mediaBag),this.mediaBag.buildAll("font",null,t)}end(){}}Object.assign(Le.prototype,{name:"unknown",version:"0.1.3",type:null,code:null,settings:null,activitySequence:null,_activities:null,reportableActs:0,mediaBag:null,skin:null,basePath:"",path:null,zip:null});const Fe=Le;class ze{constructor(t,e,i,s){this.type=t,this.source=e||null,this.dest=i||null,this.ok=s||!1,this.time=(new Date).valueOf()}$getXML(){const t={ok:this.ok,time:this.time};return this.type&&(t.type=this.type),this.source&&(t.source=this.source),this.dest&&(t.dest=this.dest),e("<action/>",t)}setProperties(t){ht(t.get(0).attributes,(t,e)=>{switch(t){case"type":case"source":case"dest":this[t]=e;break;case"time":this[t]=Number(e);break;case"ok":this[t]=v(e,!1)}})}}Object.assign(ze.prototype,{type:"unknown",source:null,dest:null,time:0,isOk:!1});const Ue=ze;class He{constructor(t){this.name=t.name,this.code=t.code,this.actions=[],this.startTime=(new Date).valueOf(),this.minActions=t.getMinNumActions(),this.reportActions=t.reportActions}$getXML(){const t={start:this.startTime,time:this.totalTime,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions};this.name&&(t.name=this.name),this.code&&(t.code=this.code),this.closed||(t.closed=!1),this.reportActions&&(t.reportActions=!0);const i=e("<activity/>",t);return this.actions.forEach(t=>{i.append(t.$getXML())}),i}getData(){const t={name:this.name,time:Math.round(this.totalTime/10)/100,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions,precision:this.getPrecision(),closed:this.closed};return this.code&&(t.code=this.code),t}setProperties(t){ht(t.get(0).attributes,(t,e)=>{switch(t){case"name":case"code":this[t]=e;break;case"start":case"time":case"score":case"minActions":case"actions":this[t]=Number(e);break;case"solved":case"closed":case"reportActions":this[t]=v(e,!1)}}),t.children("action").each((t,i)=>{const s=new Ue;s.setProperties(e(i)),this.actions.push(s)})}newAction(t,e,i,s){this.closed||(this.lastAction=new Ue(t,e,i,s),this.actions.push(this.lastAction))}getActionReg(t){return t>=this.actions.length?null:this.actions[t]}closeActivity(){this.closed||(this.lastAction?this.totalTime=this.lastAction.time-this.startTime:this.totalTime=(new Date).valueOf()-this.startTime,this.closed=!0)}getPrecision(){let t=0;return this.closed&&this.minActions>0&&this.numActions>0&&(t=this.solved?this.numActions<this.minActions?100:Math.round(100*this.minActions/this.numActions):Math.round(this.score*this.score*100/(this.minActions*this.numActions))),t}endActivity(t,e,i){this.closed||(this.solved=i,this.numActions=e,this.score=t,this.closeActivity())}}Object.assign(He.prototype,{name:"",code:"",startTime:0,totalTime:0,actions:[],solved:!1,lastAction:null,score:0,minActions:0,closed:!1,reportActions:!1,numActions:0});const Je=He;class We{constructor(t){this.name=t.tag,this.description=t.description,this.activities=[],this.currentActivity=null,this.totalTime=0,this.closed=!1,this.info=new Ge(this)}getData(){const t={sequence:this.name,activities:[]};return this.activities.forEach(e=>t.activities.push(e.getData())),t}getInfo(){return this.info.recalc()}endSequence(){this.currentActivity&&this.activities.length>0&&(this.currentActivity.closed||this.currentActivity.closeActivity(),this.totalTime=this.currentActivity.startTime+this.currentActivity.totalTime-this.activities[0].startTime,this.info.valid=!1)}newActivity(t){this.closed||(this.currentActivity=new Je(t),this.activities.push(this.currentActivity),this.info.valid=!1)}endActivity(t,e,i){this.currentActivity&&(this.currentActivity.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentActivity&&(this.currentActivity.newAction(t,e,i,s),this.info.valid=!1)}}Object.assign(We.prototype,{name:"",description:"",activities:[],currentActivity:null,totalTime:0,closed:!1,info:null});class Ge{constructor(t){this.sqReg=t}clear(){this.nActivities=this.nActClosed=this.nActSolved=this.nActScore=0,this.ratioSolved=this.nActions=this.tScore=this.tTime=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.nActivities=this.sqReg.activities.length,this.nActivities>0&&(this.sqReg.activities.forEach(t=>{if(t.closed){this.nActClosed++,this.tTime+=t.totalTime,this.nActions+=t.numActions,t.solved&&this.nActSolved++;const e=t.getPrecision();e>=0&&(this.tScore+=e,this.nActScore++)}}),this.nActClosed>0&&(this.ratioSolved=this.nActSolved/this.nActClosed),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore))),this.valid=!0),this}}Object.assign(Ge.prototype,{sqReg:null,valid:!1,nActivities:0,nActClosed:0,nActSolved:0,nActScore:0,ratioSolved:0,nActions:0,tScore:0,tTime:0}),We.Info=Ge;const Ke=We;class Ze{constructor(t,e){this.projectName=t.name,this.code=e||t.code,this.sequences=[],this.actNames=[],this.started=new Date,this.info=new Ye(this),this.reportableActs=t.reportableActs}getData(t,e){t&&this.info.recalc();const i={projectName:this.projectName,played:this.info.nActivities,ratioPlayed:Math.round(100*this.info.ratioPlayed),solved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actions:this.info.nActions,score:this.info.tScore,time:Math.round(this.info.tTime/10)/100,sequences:[]};return this.sequences.forEach(t=>{const s=t.getData();(e||s.activities.length>0)&&i.sequences.push(s)}),i}getInfo(){return this.info.recalc()}end(){this.endSequence()}endSequence(){this.currentSequence&&0===this.currentSequence.totalTime&&this.currentSequence.endSequence(),this.currentSequence=null,this.info.valid=!1}newSequence(t){this.endSequence(),this.currentSequence=new Ke(t),this.sequences.push(this.currentSequence),this.info.valid=!1}newActivity(t){this.currentSequence&&(-1===this.actNames.indexOf(t.name)&&this.actNames.push(t.name),this.currentSequence.newActivity(t),this.info.valid=!1)}endActivity(t,e,i){this.currentSequence&&(this.currentSequence.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentSequence&&(this.currentSequence.newAction(t,e,i,s),this.info.valid=!1)}getCurrentSequenceTag(){return this.currentSequence?this.currentSequence.name:null}getCurrentSequenceInfo(){return this.currentSequence?this.currentSequence.getInfo():null}}Object.assign(Ze.prototype,{reportableActs:0,actNames:null,sequences:null,currentSequence:null,started:null,projectName:"",info:null,code:null});class Ye{constructor(t){this.sReg=t}clear(){this.numSequences=this.nActivities=this.nActSolved=this.nActScore=0,this.ratioSolved=this.ratioPlayed=this.nActions=this.tScore=this.tTime=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.sReg.sequences.forEach(t=>{const e=t.getInfo();e.nActivities>0&&(this.numSequences++,e.nActClosed>0&&(this.nActivities+=e.nActClosed,this.nActions+=e.nActions,e.nActScore>0&&(this.nActScore+=e.nActScore,this.tScore+=e.tScore*e.nActScore),this.tTime+=e.tTime,this.nActSolved+=e.nActSolved))}),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore)),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.sReg.reportableActs>0&&(this.ratioPlayed=this.sReg.actNames.length/this.sReg.reportableActs)),this.valid=!0),this}}Object.assign(Ye.prototype,{sReg:null,valid:!1,numSequences:0,nActivities:0,nActSolved:0,nActScore:0,ratioSolved:0,ratioPlayed:0,nActions:0,tScore:0,tTime:0}),Ze.Info=Ye;const Qe=Ze;class Xe{static Decrypt(t){if(null===t||0===t.length)return null;const e=Xe.decodify(t);return e===Xe.BLANK?"":e}static hexCharArrayToChar(t,e){let i=0;for(let s=0;s<=3;s++){const n=Number.parseInt(t[e+s],16);if(isNaN(n))throw"Invalid expression!";i=16*i+n}return String.fromCharCode(i)}static hexCharArrayToInt(t,e){let i=0;for(let s=0;s<=1;s++){const n=Number.parseInt(t[e+s],16);if(isNaN(n))throw"Invalid expression!";i=16*i+n}return i}static decodifyZerosField(t){let e="",i=Number.parseInt(t[0],32),s=0,n=0;for(n=0;0!==i;n++){for(;i>0;)e=e+t[3*n+1]+t[3*n+2],i--,s++;i=t.length>3*n+3?Number.parseInt(t[3*n+3],32):0}for(let i=3*n+1;i<t.length;i++)e+=t[i];return Number.parseInt(s,32)+e}static decompressZeros(t){t=Xe.decodifyZerosField(t);let e=Number.parseInt(t[0],32),i=2*e+1,s=!1,n="";for(let r=0;r<e&&!s;r++){let e=Xe.hexCharArrayToInt(t,1+2*r).toString(2);for(;e.length<8;)e="0"+e;for(let r=0;r<=7&&!s;r++)"1"===e[r]?n+="0":i<t.length?n+=t[i++]:s=!0}return n}static decodifyFromHex(t){let e="",i=0;for(let s=0;i<t.length;s++){e+=Xe.hexCharArrayToChar(t,i),i+=4}return e}static unchangeOrder(t){let e=0,i=t.length-1;const s=[];for(let e=0;e<t.length;e++)s[e]="";for(let n=0;n<t.length;n++)s[n]=n%2==0?t[e++]:t[i--];return s.join("")}static codify(t){if(t.length>24)throw"Password is too large!";return Xe.changeOrder(Xe.compressZeros(Xe.codifyToHexWord(t)))}static decodify(t){try{return Xe.decodifyFromHex(Xe.decompressZeros(Xe.unchangeOrder(t)))}catch(t){return""}}}Xe.BLANK="___blank___##";const ti=Xe;class ei{constructor(t,e){this.API=t,"function"==typeof t.Initialize?this.is2004=!0:(this.prefix="LMS",this.core="cmi.core."),this.reporter=e}static scanForAPI(t,e){return t.API_1484_11&&t.API_1184_11.Initialize&&t.API_1184_11.SetValue&&t.API_1184_11.Commit?t.API_1184_11:t.API&&t.API.LMSInitialize&&t.API.LMSSetValue&&t.API.LMSCommit?t.API:t.parent&&t.parent!==t&&e++<ei.DISCOVER_MAX_TRIES?ei.scanForAPI(t.parent,e):null}static getSCORM(t){let e=null;try{let i=ei.scanForAPI(window,0);null===i&&window.opener&&(i=ei.scanForAPI(window.opener,0)),i&&(e=new ei(i,t),e.initialize()||(e=null))}catch(t){e=null,m("warn","Unable to use SCORM: %s",t.toString())}return e}initialize(){let t=!1;try{t=this.API[this.prefix+"Initialize"](""),t&&(this.studentId=this.getValue(this.core+(this.is2004?"learner_id":"student_id")),this.studentName=this.getValue(this.core+(this.is2004?"learner_name":"student_name")),this.setValue(this.core+"score.min",0),this.setValue(this.core+"score.max",100),e(window).on("unload",()=>{this.commitInfo(),this.terminate(),this.API=null})),m("debug","SCORM initialized")}catch(t){m("error",`Error initializing SCORM API: ${t.message}`)}return t}terminate(){let t=!1;try{t=this.API[this.is2004?"Terminate":"LMSFinish"]("")}catch(t){m("error",`Error terminating SCORM API: ${t.message}`)}return t}commitInfo(){const t=this.reporter.getInfo(),e=Math.round(100*t.globalScore),i=this.getTimeExpression(t.tTime);this.setValue(this.core+"score.raw",e),this.setValue(this.core+"session_time",i),this.commit(),m("debug",`SCORM results reported: ${e} (${i})`)}commit(){let t=!1;try{t=this.API[this.prefix+"Commit"]("")}catch(t){m("error",`Error commiting data to the SCORM API: ${t.message}`)}return t}setValue(t,e){let i=!1;try{i=this.API[this.prefix+"SetValue"](t,e)}catch(i){m("error",`Error setting value "${e}" to "${t}" in SCORM API: ${i.message}`)}return i}getValue(t){let e=!1;try{e=this.API[this.prefix+"GetValue"](t)}catch(e){m("error",`Error retrieving "${t}" from SCORM API: ${e.message}`)}return e}getTimeExpression(t){const e=new Date(t),i=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds();return this.is2004?`PT${i}H${s}M${n}S`:`${("0000"+i).slice(-4)}:${("00"+s).slice(-2)}:${("00"+n).slice(-2)}`}getScormType(){return"SCORM "+(this.is2004?"2004":"1.2")}}Object.assign(ei.prototype,{is2004:!1,reporter:null,prefix:"",core:"cmi.",API:null,studentId:"",studentName:""}),ei.DISCOVER_MAX_TRIES=50;const ii=ei;class si{constructor(t){this.ps=t,this.sessions=[],this.started=new Date,this.initiated=!1,this.info=new ni(this)}static registerClass(t,e){return si.CLASSES[t]=e,e}static getReporter(t,e){let i=null;return null===t&&(t="Reporter",e.options.hasOwnProperty("reporter")&&(t=e.options.reporter)),si.CLASSES.hasOwnProperty(t)?i=new si.CLASSES[t](e):m("error","Unknown reporter class: %s",t),i}getInfo(){return this.info.recalc()}getProperty(t,e){return e}getBooleanProperty(t,e){const i=this.getProperty(t,!0===e?"true":"false");return null===t?e:"true"===i}getGroups(){return Promise.reject("No groups defined!")}getUsers(t){return Promise.reject("No users defined in "+t)}getUserData(t){return Promise.reject("Unknown user!")}getGroupData(t){return Promise.reject("Unknown group!")}userBased(){return null===this.bUserBased&&(this.bUserBased=this.getBooleanProperty("USER_TABLES",!1)),this.bUserBased}promptForNewGroup(){return Promise.reject("Remote creation of groups not yet implemented!")}promptForNewUser(){return Promise.reject("Remote creation of users not yet implemented!")}promptGroupId(){return new Promise((t,i)=>{this.userBased()?this.getGroups().then(s=>{if(!s||s.length<1)i("No groups defined!");else{let n=0;const r=e("<select/>").attr({size:Math.max(3,Math.min(15,s.length))});s.forEach(t=>r.append(e("<option/>").attr({value:t.id}).text(t.name))),r.change(t=>{n=t.target.selectedIndex}),this.ps.skin.showDlg(!0,{main:[e("<h2/>",{class:"subtitle"}).html(f("Select group:")),r],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then(()=>{t(s[n].id)}).catch(i)}}).catch(i):i("This system does not manage users!")})}promptUserId(t){return new Promise((i,s)=>{if(null===this.userId||t)if(this.userBased()){const t=e("<input/>",{type:"password",size:8,maxlength:64});if(this.getBooleanProperty("SHOW_USER_LIST",!0))this.promptGroupId().then(n=>{this.getUsers(n).then(r=>{if(!r||r.length<1)s("Group "+n+" has no users!");else{let n=-1;const a=e("<select/>").attr({size:Math.max(3,Math.min(15,r.length))});r.forEach(t=>a.append(e("<option/>").attr({value:t.id}).text(t.name))),a.change(t=>{n=t.target.selectedIndex}),this.ps.skin.showDlg(!0,{main:[e("<h2/>",{class:"subtitle"}).html(f("Select user:")),a,e("<h2/>",{class:"subtitle"}).html(f("Password:")).append(t)],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then(()=>{n>=0?r[n].pwd&&ti.Decrypt(r[n].pwd)!==t.val()?(window.alert(f("Incorrect password")),s("Incorrect password")):(this.userId=r[n].id,i(this.userId)):s("No user has been selected")}).catch(s)}}).catch(s)}).catch(s);else{const n=e("<input/>",{type:"text",size:8,maxlength:64});this.ps.skin.showDlg(!0,{main:[e("<div/>").css({"text-align":"right"}).append(e("<h2/>",{class:"subtitle"}).html(f("User:")).append(n)).append(e("<h2/>",{class:"subtitle"}).html(f("Password:")).append(t))],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then(()=>{this.getUserData(n.val()).then(e=>{e.pwd&&ti.Decrypt(e.pwd)!==t.val()?(window.alert(f("Incorrect password")),s("Incorrect password")):(this.userId=e.id,i(this.userId))}).catch(s)}).catch(s)}}else s("This system does not manage users!");else i(this.userId)})}getData(){this.info.recalc();const t={started:this.started.toISOString(),descriptionKey:this.descriptionKey,descriptionDetail:this.descriptionDetail,projects:this.info.numSessions,sequences:this.info.numSequences,activitiesDone:this.info.nActivities,playedOnce:this.info.nActPlayed,reportable:this.info.reportableActs,ratioPlayed:Math.round(100*this.info.ratioPlayed),activitiesSolved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actScore:this.info.nActScore,partialScore:Math.round(100*this.info.partialScore),globalScore:Math.round(100*this.info.globalScore),time:Math.round(this.info.tTime/10)/100,actions:this.info.nActions,sessions:[]};return this.userId?t.userId=this.userId:this.SCORM&&(t.user=this.SCORM.studentName+(""===this.SCORM.studentId?"":` (${this.SCORM.studentId})`)),this.sessions.forEach(e=>{e.getInfo().numSequences>0&&t.sessions.push(e.getData(!1,!1))}),t}init(t){return t||(t=this.ps.options),this.userId=b(t.user),this.sessionKey=b(t.key),this.sessionContext=b(t.context),this.groupCodeFilter=b(t.groupCodeFilter),this.userCodeFilter=b(t.userCodeFilter),!1!==t.SCORM&&(this.SCORM=ii.getSCORM(this),null!==this.SCORM&&this.descriptionKey===si.prototype.descriptionKey&&(this.descriptionKey=this.SCORM.getScormType())),this.initiated=!0,m("debug","Basic Reporter initialized"),Promise.resolve(!0)}end(){return m("debug","Basic Reporter ending"),this.endSession(),Promise.resolve(!0)}endSequence(){this.currentSession&&(this.currentSession.endSequence(),this.info.valid=!1)}endSession(){this.endSequence(),this.currentSession=null}newGroup(t){throw"No database!"}newUser(t){throw"No database!"}newSession(t){this.endSession(),this.currentSession=new Qe(t),this.sessions.push(this.currentSession),this.info.valid=!1}newSequence(t){this.currentSession&&(this.currentSession.newSequence(t),this.info.valid=!1,this.SCORM&&this.SCORM.commitInfo())}newActivity(t){this.currentSession&&(this.currentSession.newActivity(t),this.info.valid=!1)}endActivity(t,e,i){this.currentSession&&(this.currentSession.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentSession&&(this.currentSession.newAction(t,e,i,s),this.info.valid=!1)}getCurrentSequenceInfo(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceInfo()}getCurrentSequenceTag(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceTag()}}Object.assign(si.prototype,{info:null,ps:null,SCORM:null,userId:null,sessionKey:null,sessionContext:null,groupCodeFilter:null,userCodeFilter:null,descriptionKey:"Results are not currently being saved",descriptionDetail:"",started:null,sessions:[],currentSession:null,initiated:!1,bUserBased:null,MAX_USERID_PROMPT_ATTEMPTS:3});class ni{constructor(t){this.rep=t}clear(){this.numSessions=this.numSequences=this.nActivities=this.reportableActs=this.nActSolved=this.nActPlayed=this.nActScore=this.nActions=this.ratioSolved=this.ratioPlayed=this.tScore=this.tTime=this.partialScore=this.globalScore=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.rep.sessions.forEach(t=>{const e=t.getInfo();this.reportableActs+=e.sReg.reportableActs,e.numSequences>0&&(this.numSessions++,this.numSequences+=e.numSequences,e.nActivities>0&&(this.nActivities+=e.nActivities,this.nActPlayed+=e.sReg.actNames.length,this.nActSolved+=e.nActSolved,this.nActions+=e.nActions,e.nActScore>0&&(this.tScore+=e.tScore*e.nActScore,this.nActScore+=e.nActScore),this.tTime+=e.tTime))}),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.reportableActs>0&&(this.ratioPlayed=this.nActPlayed/this.reportableActs),this.partialScore=this.tScore/(100*this.nActScore),this.globalScore=this.partialScore*this.ratioPlayed),this.valid=!0),this}}Object.assign(ni.prototype,{rep:null,valid:!1,numSessions:0,numSequences:0,nActivities:0,reportableActs:0,nActSolved:0,nActPlayed:0,nActScore:0,nActions:0,ratioSolved:0,ratioPlayed:0,tScore:0,partialScore:0,tTime:0,globalScore:0}),si.Info=ni,si.CLASSES={Reporter:si};const ri=si;class ai extends _t{constructor(t,i){super(),i=p(i),this.options=e.extend(Object.create(this.options),i),this.id=`JC${(65536+Math.round(65535*Math.random())).toString(16).toUpperCase().substring(1)}`,this.$topDiv=t||e("<div/>"),this.$topDiv.css({"text-align":"initial"}),this.$topDiv.parent().is("td")&&this.$topDiv.css({width:at(this.options.width,null,null,"100%"),height:at(this.options.height,null,null,"100%")}),this.$mainContainer=e("<div/>",{class:"JClicContainer",id:this.id}).css({width:"100%",height:"100%"}).appendTo(this.$topDiv),this.localFS=location&&"file:"===location.protocol,this.$div=e("<div/>",{class:"JClicPlayer"}),this.project=new Fe,this.activeMediaBag=new jt,this.counterVal={score:0,actions:0,time:0},this.bgImageOrigin=new Ct,this.buildActions(),this.history=new Dt(this),this.audioEnabled=this.options.audioEnabled,this.navButtonsAlways=this.options.navButtonsAlways,this.defaultSkin=Ft.getSkin(this.options.skin,this),this.setSkin(Ft.getSkin("@empty.xml",this)),this.initTimers(),this.listenTouchEvents(),m("info","JClicPlayer ready")}listenTouchEvents(){let t=null,e=0,i=this.$div[0];const{minSwipeX:s,maxSwipeY:n,rightToLeft:r}=this.options,a=a=>{if(a.target===i&&a.changedTouches&&1===a.changedTouches.length){const i=a.changedTouches[0],o=t?i.clientX-t.clientX:0,l=t?i.clientY-t.clientY:0,c=Math.sqrt(o*o+l*l);switch(a.type){case"touchstart":const h=new Date;document&&document.fullscreenEnabled&&t&&e&&h-e<800&&c<s?(a.preventDefault(),m("info","Toggle full screen mode from double touch"),this.skin.setScreenFull(),t=null):(t=i,e=h);break;case"touchend":if(t&&Math.abs(o)>s&&Math.abs(l)<n){const e=o<0&&!r?"next":"prev",i=this.actions[e];i&&i.enabled&&(a.preventDefault(),m("info",`Performing action "${e}" from touch gesture`),i.actionPerformed(a)),t=null}else c>s&&(t=null);break;case"touchcancel":t=null}}else t=null};i.addEventListener("touchstart",a),i.addEventListener("touchend",a),i.addEventListener("touchcancel",a)}getUniqueId(t){return`${this.id}-${t}`}buildActions(){this.actions={next:new It("next",()=>this.history.processJump(this.project.activitySequence.getJump(!1,this.reporter),!1)),prev:new It("prev",()=>this.history.processJump(this.project.activitySequence.getJump(!0,this.reporter),!1)),return:new It("return",()=>this.history.pop()),reset:new It("reset",()=>{this.actPanel&&this.actPanel.act.canReinit()&&this.initActivity()}),help:new It("help",()=>{this.actPanel&&this.actPanel.showHelp()}),info:new It("info",()=>{this.actPanel&&this.actPanel.act.hasInfo()&&(this.actPanel.act.infoUrl?this.displayURL(this.act.infoUrl,!0):this.actPanel.act.infoCmd&&this.runCmd(this.actPanel.act.infoCmd))}),reports:new It("reports",()=>this.showReports()),audio:new It("audio",()=>{this.audioEnabled=!this.audioEnabled,this.audioEnabled||this.stopMedia(),Kt.prototype.globalEnabled=this.audioEnabled})},e.each(this.actions,(t,e)=>{e.addStatusListener(t=>{this.skin&&this.skin.actionStatusChanged(t)})})}reset(){m("info","Restoring player"),this.removeActivity(),this.end(),this.activeMediaBag=new jt,this.history.clearHistory(),this.setSkin(null),this.setMsg(null),this.setCounterValue("score",0),this.setCounterValue("actions",0),this.setCounterValue("time",0),this.skin&&this.skin.setWaitCursor("reset")}stop(){this.stopMedia(-1)}end(){let t=null;return this.stopMedia(),this.closeHelpWindow(),this.reporter&&(t=this.reporter.end(),this.reporter=null),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null),this.project&&(this.project.end(),this.project=null),this.activeMediaBag&&this.activeMediaBag.removeAll(),t||Promise.resolve(!0)}initReporter(){return this.reporter&&(this.reporter.end(),this.reporter=null),this.reporter=ri.getReporter(null,this),this.reporter.init()}initTimers(){this.timer&&this.timer.stop(),this.timer=new Bt(()=>{this.incCounterValue("time"),this.actPanel&&this.actPanel.act.maxTime>0&&this.actPanel.playing&&this.counterVal.time>=this.actPanel.act.maxTime&&this.actPanel.finishActivity(!1)},1e3,!1),this.delayedTimer&&this.delayedTimer.stop(),this.delayedTimer=new Bt(()=>{this.delayedAction&&this.delayedAction.processEvent(this.delayedAction,null)},1e3,!1),this.delayedTimer.repeats=!1}showReports(){this.skin&&this.skin.showReports(this.reporter)}closeHelpWindow(){this.skin&&this.skin._closeDlg(!1)}setSkin(t){!(t=t||(this.project&&this.project.skin?this.project.skin:this.defaultSkin))||null!==this.skin&&t.name===this.skin.name||(t.attach(this),this.skin=t,this.skin.doLayout())}setProject(t){this.project&&(this.project!==t&&this.project.end(),this.removeActivity()),this.project=t||new Fe,this.project.realize(this)}load(t,i,s){this.forceFinishActivity(),this.setWaitCursor(!0);let r=null;if(t){if("string"==typeof t){const r=et(this.basePath,t);if(r.endsWith("project.json"))return m("info",`Loading JSON info from: ${r}`),void e.getJSON(r).done(t=>{let{mainFile:e}=t;e&&K(e,".jclic")||K(e,".jclic.json")?this.load(et(X(r),e),i,s):m("error",`Invalid or null "mainFile" specified in ${r} - "project.json".`)}).fail((e,i,s)=>{const n=`${i} (${s}) while loading ${t}`;m(n),window.alert(`Error!\n${n}`)}).always(()=>this.setWaitCursor(!1));if(r.endsWith(".zip"))return this.zip=null,m("info",`Loading ZIP file: ${r}`),void a().getBinaryContent(r,(t,e)=>{if(t)return this.setWaitCursor(!1),void m("error",`Error loading ZIP file: ${t.toString()}`);(new(n())).loadAsync(e).then(t=>{this.zip=t,this.zip.fullZipPath=r,this.zip.zipBasePath=X(r);let e=null;this.zip.files["project.json"]?this.zip.files["project.json"].async("string").then(t=>{try{const e=JSON.parse(t);K(e.mainFile,".jclic")?this.load(et(this.zip.zipBasePath,e.mainFile),i,s):m("error",`Invalid or null "mainFile" specified in ${r} - "project.json".`)}catch(t){m("error",`Error reading "project.json" in ${r}: ${t?t.toString():"unknown error"}`)}}).catch(t=>{m("error",`Error reading ZIP file: ${t?t.toString():"unknown reason"}`)}):(e=Object.keys(this.zip.files).find(t=>t.endsWith(".jclic"))||null,e?this.load(et(this.zip.zipBasePath,e),i,s):m("error","This ZIP file does not contain any JClic project!")),this.setWaitCursor(!1)}).catch(t=>{m("error",`Error reading ZIP file: ${t?t.toString():"unknown reason"}`),this.setWaitCursor(!1)})});if(this.localFS&&window.JClicObject&&!window.JClicObject.projectFiles[r]){const e=document.createElement("script");return e.src=`${r}.js`,e.onload=()=>{var e,n;window.JClicObject.projectFiles[r]&&(window.JClicObject.projectFiles[r]=(e=[[/
/g,"\r"],[/
/g,"\n"],[/	/g,"\t"]],n=window.JClicObject.projectFiles[r],e.reduce((t,e)=>{let[i,s]=e;return t.replace(i,s)},n)),this.load(t,i,s))},document.head.appendChild(e),void this.setWaitCursor(!1)}const o=n=>{const a=0===n.indexOf("data:text/xml;")||n.endsWith(".jclic");(a?e.get(n,null,null,"xml"):e.getJSON(n)).done(n=>{if(null===n||"object"!=typeof n)return void m("error",`Bad data. Project not loaded: ${t}`);const o=new Fe;a?o.setProperties(e(n).find("JClicProject"),r,this.zip,this.options):o.setAttributes(n,r,this.zip,this.options),m("info",`Project file loaded and parsed: ${t}`);const l=o.mediaBag.buildAll(null,t=>{m("trace",`"${t.name}" ready.`),this.incProgress(1)},this);m("info",`Media elements to be loaded: ${l}`),this.setProgress(0,l);let c=0;this.setWaitCursor(!0);const h=window.setInterval(()=>{++c>this.options.maxWaitTime/500&&(window.clearInterval(h),this.setProgress(-1),this.setWaitCursor(!1),m("error","Error loading media"));-1===o.mediaBag.countWaitingElements()&&(window.clearInterval(h),this.setProgress(-1),this.setWaitCursor(!1),this.load(o,i,s))},500)}).fail((e,i,s)=>{const n=`${i} (${s}) while loading ${t}`;m(n),window.alert(`Error!\n${n}`)}).always(()=>this.setWaitCursor(!1))};m("info",`Loading project: ${t}`);let l=r;if(this.zip){const t=tt(l,this.zip.zipBasePath);if(this.zip.files[t])return void this.zip.file(t).async("string").then(e=>{o(`data:${t.endsWith(".jclic")?"text/xml":"application/json"};charset=UTF-8,${encodeURIComponent(e)}`)}).catch(e=>{m("error",`Unable to extract "${t}" from ZIP file because of: ${e?e.toString():"unknown reason"}`),this.setWaitCursor(!1)})}else if(this.localFS){if(!window.JClicObject||!window.JClicObject.projectFiles[r])return m("error",`Unable to load: ${r}.js`),void this.setWaitCursor(!1);l=`data:${r.endsWith(".jclic")?"text/xml":"application/json"};charset=UTF-8,${encodeURIComponent(window.JClicObject.projectFiles[r])}`}return void o(l)}this.setProject(t),i||s||(i="0"),this.reporter&&this.reporter.newSession(t)}if(!P(i)){m("info",`Loading sequence: ${i}`),this.navButtonsDisabled=!1;let t=null;if("string"==typeof i&&(t=this.project.activitySequence.getElementByTag(i,!0)),null===t){const e=parseInt(i,10);"number"==typeof e&&(t=this.project.activitySequence.getElement(e,!0))}null!==t&&(this.reporter&&this.reporter.newSequence(t),s=t.activity)}if(s){const t=this.project.getActivity(s);t?(m("info",`Loading activity: ${s}`),pe.resetAudioElements(),t.prepareMedia(this),this.project.activitySequence.checkCurrentActivity(t.name),r=t.getActivityPanel(this),r.buildVisualComponents()):m("error",`Missing activity: ${s}`)}if(null!==this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setCounterValue("time",0)),r){if(this.actPanel=r,this.options.fade>0&&this.actPanel.$div.css("display","none"),this.$div.prepend(this.actPanel.$div),this.skin&&this.skin.resetAllCounters(!1),this.actPanel.skin?this.setSkin(this.actPanel.skin):this.project.skin?(this.setSkin(this.project.skin),this.lastProjectSkin=this.project.skin):this.lastProjectSkin?this.setSkin(this.lastProjectSkin):this.setSkin(null),this.skin){const t=this.history.storedElementsCount()>0||this.options.returnAsExit,e=this.navButtonsAlways?"both":this.navButtonsDisabled?"none":this.project.activitySequence.getNavButtonsFlag();this.actions.next.setEnabled(("fwd"===e||"both"===e)&&this.project.activitySequence.hasNextAct(t)),this.actions.prev.setEnabled(("back"===e||"both"===e)&&this.project.activitySequence.hasPrevAct(t)),this.actions.return.setEnabled(t),this.actions.help.setEnabled(this.actPanel.act.helpWindowAllowed()),this.actions.reset.setEnabled(this.actPanel.act.canReinit()),this.actions.info.setEnabled(this.actPanel.act.hasInfo())}this.doLayout(),this.initActivity(),this.history.pushBrowserHistory(),this.actPanel.$div.fadeIn(this.options.fade,()=>this.activityReady())}this.setWaitCursor(!1)}forceFinishActivity(){this.timer.stop(),this.delayedTimer.stop(),this.actPanel&&(this.closeHelpWindow(),this.actPanel.forceFinishActivity(),this.stopMedia(),this.activeMediaBag.removeAll())}removeActivity(){this.forceFinishActivity(),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setMsg(null),this.doLayout())}initActivity(){this.setWaitCursor(!0),this.timer.stop(),this.delayedTimer.stop(),this.setCounterValue("time",0),this.stopMedia(),this.actPanel&&(this.actPanel.initActivity(),this.timer.start(),this.actPanel.act.mustPauseSequence()||this.startAutoPassTimer(),m("info",`Activity "${this.actPanel.act.name}" running`)),this.setWaitCursor(!1)}activityReady(){this.actPanel&&(this.actPanel.activityReady(),m("info","Activity ready"))}startActivity(){this.setWaitCursor(!0),this.actPanel&&this.actPanel.startActivity(),this.setWaitCursor(!1)}doLayout(){const t=this.dim.width=this.$div.width(),e=this.dim.height=this.$div.height(),i={"background-color":this.actPanel?this.actPanel.act.bgColor:"azure","background-image":""};if(this.actPanel){const s=this.actPanel.act;s.bgGradient&&(i["background-image"]=s.bgGradient.getCss()),s.bgImageFile&&s.bgImageFile.length>0&&this.project.mediaBag.getElement(s.bgImageFile,!0).getFullPathPromise().then(t=>{this.$div.css({"background-image":"url('"+t+"')","background-repeat":s.tiledBgImg?"repeat":"no-repeat","background-position":s.tiledBgImg?"":"center center"})});const n=gt.BoxBase.AC_MARGIN,r=new St(n,n,t-2*n,e-2*n);this.actPanel.bgImage&&!s.tiledBgImg&&s.absolutePositioned&&(this.bgImageOrigin.x=(t-this.actPanel.bgImage.width)/2,this.bgImageOrigin.y=(e-this.actPanel.bgImage.height)/2,r.pos.moveTo(this.bgImageOrigin),r.dim.width-=this.bgImageOrigin.x-n,r.dim.height-=this.bgImageOrigin.y-n,r.dim.width=Math.min(r.dim.width,t),r.dim.height=Math.min(r.dim.height,e)),this.actPanel.fitTo(r,this)}this.$div.css(i)}playMedia(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=null;const n=t.file;let r=null;switch(t.type){case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":case"RECORD_AUDIO":case"PLAY_RECORDED_AUDIO":if(this.audioEnabled){const i=this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this);i&&(r=()=>i.play(e))}break;case"RUN_CLIC_PACKAGE":s=new Xt("JUMP",n),t.externalParam&&(s.projectPath=t.externalParam),r=()=>this.history.processJump(s,!0);break;case"RUN_CLIC_ACTIVITY":this.history.push(),r=()=>this.load(null,null,n);break;case"RETURN":if(this.history.storedElementsCount()>0||!this.options.returnAsExit){r=()=>this.history.pop();break}case"EXIT":s=new Xt("EXIT",n),r=()=>this.history.processJump(s,!1);break;case"RUN_EXTERNAL":r=()=>this.runCmd(n);break;case"URL":n&&(r=()=>this.displayURL(n,t.level>1));break;default:m("error",`Unknown media type: ${t.type}`)}i&&r?i.push(r):r&&r()}stopMedia(t){"number"!=typeof t&&(t=-1),this.activeMediaBag.stopAll(t)}runCmd(t){m("warn",`Unsupported call to external command: "${t}"`)}activityFinished(t){this.closeHelpWindow(),m("info","Activity finished"),this.timer.stop(),this.startAutoPassTimer()}startAutoPassTimer(){const t=this.project.activitySequence.getCurrentAct();null!==t&&t.delay>0&&!this.delayedTimer.isRunning()&&!this.navButtonsDisabled&&(this.delayedAction=this.actions.next,this.delayedTimer.interval=1e3*t.delay,this.delayedTimer.start())}setMsg(t){const e=this.skin?this.skin.getMsgBox():null;e&&(e.clear(),this.skin.invalidate(e).update(),e.setContent(t||Ae.EMPTY_CONTENT),this.skin.invalidate(e).update(),e.playMedia(this))}playMsg(){this.skin&&this.skin.getMsgBox()&&this.skin.getMsgBox().playMedia(this)}setCounterValue(t,e){this.counterVal[t]=e,this.skin&&this.skin.counters[t]&&this.skin.counters[t].setValue(e)}getCounterValue(t){return this.counterVal[t]}setCounterEnabled(t,e){this.skin&&(this.skin.enableCounter(t,e),this.setCountDown(t,0))}incCounterValue(t){this.counterVal[t]++;const e=this.actPanel,i=this.skin?this.skin.counters[t]:null;i&&i.setValue(this.counterVal[t]),"actions"===t&&null!==e&&e.act.maxActions>0&&e.playing&&this.counterVal.actions>=e.act.maxActions&&window.setTimeout(()=>{e.finishActivity(e.solved)},0)}setCountDown(t,e){this.skin&&this.skin.counters[t]&&this.skin.counters[t].setCountDown(e)}setWaitCursor(t){this.skin&&this.skin.setWaitCursor(t)}setProgress(t,e){this.skin&&this.skin.setProgress(t,e)}incProgress(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.skin&&this.skin.incProgress(t)}getActiveMediaPlayer(t){return this.activeMediaBag&&t?this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this):null}reportNewActivity(t){const e=this.project.activitySequence.getCurrentAct();this.reporter&&(e.tag===this.reporter.getCurrentSequenceTag()&&this.reporter.newSequence(e),t.includeInReports&&this.reporter.newActivity(t)),this.setCounterValue("actions",0),this.setCounterValue("score",0)}reportNewAction(t,e,i,s,n,r){this.reporter&&t.includeInReports&&t.reportActions&&this.reporter.newAction(e,i,s,n),r>=0&&(this.incCounterValue("actions"),this.setCounterValue("score",r))}reportEndActivity(t,e){this.reporter&&t.includeInReports&&this.reporter.endActivity(this.counterVal.score,this.counterVal.actions,e)}showHelp(t){return!!this.skin&&this.skin.showHelp(t)}displayURL(t,e){t&&(e?window.open(t,this.options.infoUrlFrame):this.end().then(()=>{window.location.href=t}))}exit(t){this.displayURL(t||this.options.exitUrl,!1)}setWindowTitle(t){m("info",`running ${t}`)}}Object.assign(ai.prototype,{options:{maxWaitTime:12e4,infoUrlFrame:"_blank",exitUrl:null,returnAsExit:!1,audioEnabled:!0,navButtonsAlways:!1,fade:300,minSwipeX:40,maxSwipeY:100,rightToLeft:!1},id:"JC0000",$div:null,$topDiv:null,$mainContainer:null,fullScreenChecked:!1,project:null,basePath:"",zip:null,localFS:!1,actPanel:null,history:null,skin:null,defaultSkin:null,lastProjectSkin:null,activeMediaBag:null,reporter:null,actions:{},timer:null,delayedTimer:null,delayedAction:null,counterVal:{score:0,actions:0,time:0},bgImageOrigin:null,audioEnabled:!0,navButtonsDisabled:!1,navButtonsAlways:!1});const oi=ai;class li extends St{constructor(t,e,i){super(),this.container=e,this.parent=t,this.boxBase=i,this.shape=this,this.specialShape=!1,this.visible=!0}setParent(t){this.parent=t}getParent(){return this.parent}end(){}setContainer(t){this.container=t,this.$hostedComponent&&this.container&&this.container.$div&&(this.$hostedComponent.detach(),this.container.$div.append(this.$hostedComponent))}getContainerX(){return this.container}getContainerResolve(){let t=this;for(;null===t.container&&null!==t.parent;)t=t.parent;return t.container}invalidate(t){const e=this.getContainerResolve();e&&e.invalidate(t)}setBoxBase(t){this.boxBase=t,this.invalidate()}getBoxBaseResolve(){let t=this;for(;!t.boxBase&&t.parent;)t=t.parent;return t.boxBase||be.DEFAULT_BOX_BASE}setShape(t){this.shape=t,this.specialShape=!0,this.invalidate(),super.setBounds(t.getBounds()),this.invalidate()}getShape(){return this.shape}contains(t){return this.shape===this?super.contains(t):this.shape.contains(t)}setBounds(t,e,i,s){if("number"==typeof t&&(t=new St(t,e,i,s)),this.equals(t))return;const n=!this.dim.equals(t.dim);return this.specialShape?(n&&(this.shape.scaleBy(new xt(t.dim.width/this.dim.width,t.dim.height/this.dim.height)),this.setShape(this.shape)),this.pos.equals(t.pos)||this.shape.moveTo(t.pos),this.setShape(this.shape)):super.setBounds(t),this.$hostedComponent&&this.setHostedComponentBounds(n),this}moveTo(t,e){"number"==typeof t&&(t=new Ct(t,e)),this.setBounds(new St(this).moveTo(t))}moveBy(t,e){this.setBounds(new St(this).moveBy(t,e))}setSize(t,e){this.setBounds(new St(this.pos,new xt(t,e)))}hasBorder(){return this.border}setBorder(t){t||this.invalidate(),this.border=t,t&&this.invalidate()}isVisible(){return this.visible}setVisible(t){this.visible=t,this.setHostedComponentVisible(),this.invalidate()}setHostedComponentVisible(){this.$hostedComponent&&this.$hostedComponent.css("visibility",this.visible?"visible":"hidden")}isTemporaryHidden(){return this.temporaryHidden}setTemporaryHidden(t){this.temporaryHidden=t}isInactive(){return this.inactive}setInactive(t){if(this.inactive=t,this.$hostedComponent)this.setHostedComponentColors(),this.setHostedComponentVisible();else{if(this.$accessibleElement){const t=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement.prop({disabled:t,tabindex:t?-1:0})}this.invalidate()}}isInverted(){return this.inverted}setInverted(t){this.inverted=t,this.$hostedComponent?this.setHostedComponentColors():this.invalidate()}isMarked(){return this.marked}setMarked(t){t||this.invalidate(),this.marked=t,this.$hostedComponent?(this.setHostedComponentColors(),this.setHostedComponentBorder()):t&&this.invalidate()}isFocused(){return this.focused}setFocused(t){t||this.invalidate(),this.focused=t,t&&this.invalidate(),this.$hostedComponent&&this.$hostedComponent.css("z-index",this.focused?20:2)}isAlternative(){return this.alternative}setAlternative(t){this.alternative=t,this.invalidate()}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())return!1;if(e&&!this.shape.intersects(e))return!1;const i=this.getBoxBaseResolve();return i.transparent||i.dontFill||this.tmpTrans||(i.bgGradient&&!i.bgGradient.hasTransparency()||(t.fillStyle=this.inactive?i.inactiveColor:this.inverted?i.textColor:i.backColor,this.shape.fill(t,e)),i.bgGradient&&(t.fillStyle=i.bgGradient.getGradient(t,this.shape.getBounds()),this.shape.fill(t,e)),t.fillStyle="black"),this.$hostedComponent||this.updateContent(t,e),this.drawBorder(t),!0}updateContent(t,e){}drawBorder(t){if(this.border||this.marked){const e=this.getBoxBaseResolve();t.strokeStyle=e.borderColor,e[this.marked?"markerStroke":"borderStroke"].setStroke(t),this.marked&&(t.globalCompositeOperation="xor"),this.shape.stroke(t),this.marked&&(t.globalCompositeOperation="source-over"),t.strokeStyle="black",At.prototype.setStroke(t)}}getBorderBounds(){const t=new St(this.getBounds());if(this.border||this.marked){const e=this.getBoxBaseResolve()[this.marked?"markerStroke":"borderStroke"].lineWidth;t.moveBy(-e/2,-e/2),t.dim.width+=e,t.dim.height+=e}return t}setHostedComponent(t){this.$hostedComponent&&this.$hostedComponent.detach(),this.$hostedComponent=t,this.$hostedComponent&&(this.setContainer(this.container),this.setHostedComponentColors(),this.setHostedComponentBorder(),this.setHostedComponentBounds(!0),this.setHostedComponentVisible(),this.setFocused(this.focused))}getHostedComponent(){return this.$hostedComponent}setHostedComponentColors(){if(this.$hostedComponent){const t=this.getBoxBaseResolve().getCSS(null,this.inactive,this.inverted,this.alternative);this.$hostedComponent.data("background-image")&&t["background-image"]&&(t["background-image"]=`${this.$hostedComponent.data("background-image")},${t["background-image"]}`),this.$hostedComponent.css(t)}}setHostedComponentBorder(){if(this.$hostedComponent&&(this.border||this.marked)){const t=this.getBoxBaseResolve();this.$hostedComponent.css({"border-width":`${t.get(this.marked?"markerStroke":"borderStroke").lineWidth}px`,"border-style":"solid","border-color":t.get("borderColor")})}}setHostedComponentBounds(t){if(this.$hostedComponent){const t=this.getBounds(),e=this.border||this.marked?this.getBoxBaseResolve().get(this.marked?"markerStroke":"borderStroke").lineWidth:0;this.$hostedComponent.css({position:"absolute",width:t.dim.width-2*e+"px",height:t.dim.height-2*e+"px",top:t.pos.y+"px",left:t.pos.x+"px"})}}}Object.assign(li.prototype,{parent:null,container:null,boxBase:null,border:!1,shape:null,specialShape:!1,visible:!0,temporaryHidden:!1,tmpTrans:!1,inactive:!1,inverted:!1,alternative:!1,marked:!1,focused:!1,accessibleText:"",role:"cell",$accessibleElement:null,accessibleAlwaysActive:!1,$hostedComponent:null});const ci=li;class hi extends ci{constructor(t,e,i,s,n){super(t,e,i),this.clear(),"number"==typeof s&&(this.idLoc=s,this.idAss=0,this.idOrder=0),n&&this.setBounds(n)}static createCell(t,i){if(i&&i.dimension){const s=new hi,n=e('<canvas width="'+i.dimension.width+'" height="'+i.dimension.height+'"/>'),r=new St(0,0,i.dimension.width,i.dimension.height);return s.container=new _t,s.container.$div=t,s.setContent(i),s.setBounds(r),t.append(n),i.mediaContent&&s.buildAccessibleElement(n,t),s.update(n.get(-1).getContext("2d"),r),s}}getCurrentContent(){return this.isAlternative()?this.altContent:this.content}getContent(){return this.content||this.setContent(new Ae),this.content}clear(){this.content=null,this.altContent=null,this.idOrder=-1,this.setInactive(!0),this.hasHostedComponent||this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(""),this.tmpTrans&&(this.tmpTrans=!1),this.invalidate()}isEquivalent(t,e){return null!==t&&null!==this.content&&this.content.isEquivalent(t.content,e)}isCurrentContentEquivalent(t,e){return null!==t&&null!==this.getCurrentContent()&&this.getCurrentContent().isEquivalent(t.getCurrentContent(),e)}exchangeLocation(t){const e=new Ct(this.pos),i=this.idLoc;this.moveTo(t.pos),t.moveTo(e),this.idLoc=t.idLoc,t.idLoc=i}copyContent(t){this.idOrder=t.idOrder,this.idAss=t.idAss,this.content=t.content,this.altContent=t.altContent,this.content&&(this.content.style&&this.setBoxBase(this.content.style),null!==this.content.border&&t.hasBorder()!==this.content.border&&this.setBorder(this.content.border)),this.setInactive(t.isInactive()),this.setInverted(t.isInverted()),this.setAlternative(t.isAlternative()),this.setHostedComponent(t.getHostedComponent()),this.hasHostedComponent=t.hasHostedComponent,this.setHostedMediaPlayer(t.hostedMediaPlayer),this.hostedMediaPlayer&&this.hostedMediaPlayer.setVisualComponentVisible(!this.isInactive()&&this.isVisible()),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}exchangeContent(t){const e=new hi(this.getParent(),this.getContainerX(),this.boxBase);e.copyContent(this),this.copyContent(t),t.copyContent(e)}setTextContent(t){t||(t=""),this.content||(this.content=new Ae),this.content.text=t,this.content.mediaContent=null,this.content.img=null,this.setHostedComponent(null),this.setInactive(!1),this.checkHostedComponent(),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}setDefaultIdAss(){this.idAss=null===this.content?-1:this.content.id}isAtPlace(){return this.idOrder===this.idLoc}setContent(t,i){if(t instanceof Se){if(i<0&&(i=this.idOrder),i>=t.getNumCells())return;t.style!==this.boxBase&&this.setBoxBase(t.style),t=t.getActiveBoxContent(i)}if(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.content=t,t){if(t.animatedGifFile&&!this.specialShape){const i=`url(${t.animatedGifFile})`,s=e("<span/>").css({"background-image":i,"background-position":"center","background-repeat":"no-repeat"});s.data("background-image",i),null!==t.imgClip&&s.css({"background-origin":"border-box","background-position":`${-t.imgClip.pos.x}px ${-t.imgClip.pos.y}px`}),this.setHostedComponent(s)}t.style!==this.boxBase&&this.setBoxBase(t.style),t.innerHtmlText&&this.setHostedComponent(e("<div/>").html(t.innerHtmlText)),t.hasOwnProperty("border")&&this.hasBorder()!==t.border&&this.setBorder(t.border),this.setInactive(!1),t.amp&&this.setHostedMediaPlayer(t.amp),this.checkHostedComponent(),this.checkAutoStartMedia()}else this.clear();this.invalidate(),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}setAltContent(t,e){t instanceof Se&&(e<0&&(e=this.idOrder),t=t.getActiveBoxContent(e)),this.altContent=t,this.checkHostedComponent(),this.isAlternative()&&this.hostedMediaPlayer&&this.setHostedMediaPlayer(null),this.$accessibleElement&&(this.$accessibleElement.html(this.toString()),this.$accessibleElement.prop("disabled",!0))}setCurrentContent(t){this.isAlternative()?this.setAltContent(t):this.setContent(t),this.invalidate()}switchToAlt(){return!(this.isAlternative()||!this.altContent||this.altContent.isEmpty())&&(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.setAlternative(!0),this.tmpTrans=!1,this.checkHostedComponent(),this.checkAutoStartMedia(),this.$accessibleElement&&this.$accessibleElement.html(this.toString()),!0)}checkHostedComponent(){if(this.hasHostedComponent)return;const t=this.getCurrentContent(),e=this.getBoxBaseResolve();!this.isInactive()&&t&&t.innerHtmlText&&(e.getCSS()["text-align"]=t.txtAlign.h.replace("middle","center"))}checkAutoStartMedia(){const t=this.getContent();t&&t.mediaContent&&t.mediaContent.autoStart&&t.amp&&t.amp.playNow(this)}updateContent(t,e){const i=this.getCurrentContent(),s=this.getBoxBaseResolve();if(this.isInactive()||!i||this.dim.width<2||this.dim.height<2)return this._focusAccessibleElement(t),!0;if(e&&!this.intersects(e))return!1;let n=null;if(i.img&&!this.tmpTrans)try{if(i.imgClip){const e=i.imgClip.getBounds();let s=i.img;if(!i.imgClip.isRect()){const t=document.createElement("canvas");t.width=e.pos.x+e.dim.width,t.height=e.pos.y+e.dim.height;const n=t.getContext("2d");i.imgClip.clip(n),n.drawImage(i.img,0,0),s=t}t.drawImage(s,Math.max(0,e.pos.x),Math.max(0,e.pos.y),Math.min(s.width,e.dim.width),Math.min(s.height,e.dim.height),this.pos.x,this.pos.y,this.dim.width,this.dim.height)}else{let e=i.img.naturalWidth||this.dim.width,s=i.img.naturalHeight||this.dim.height,r=!1,a=1;gt.COMPRESS_IMAGES&&this.dim.width>0&&this.dim.height>0&&(e>this.dim.width||s>this.dim.height)&&(a=Math.min(this.dim.width/e,this.dim.height/s),e*=a,s*=a,r=!0);const o="left"===i.imgAlign.h?0:"right"===i.imgAlign.h?this.dim.width-e:(this.dim.width-e)/2,l="top"===i.imgAlign.v?0:"bottom"===i.imgAlign.v?this.dim.height-s:(this.dim.height-s)/2;r?t.drawImage(i.img,this.pos.x+o,this.pos.y+l,e,s):t.drawImage(i.img,this.pos.x+o,this.pos.y+l),i.avoidOverlapping&&i.text&&(n=new St(Math.max(0,o),Math.max(0,l),Math.min(this.dim.width,e),Math.min(this.dim.height,s)))}}catch(t){m("warn",`Unable to draw image "${i.image}": ${t.message}`)}if(i.text&&i.text.length>0){let e=this.pos.x,r=this.pos.y,a=this.dim.width,o=this.dim.height;if(n){const t=[0,n.pos.x,n.pos.x+n.dim.width,a],s=[0,n.pos.y,n.pos.y+n.dim.height,o],l=[new St(t[0],s[0],t[3],s[1]),new St(t[0],s[2],t[3],s[3]-s[2]),new St(t[0],s[0],t[1],s[3]),new St(t[2],s[0],t[3]-t[2],s[3])];let c=l[0],h=c.dim.width*c.dim.height;for(let t=1;t<l.length;t++){let e=l[t].dim.width*l[t].dim.height;if(e>h-1){if(Math.abs(e-h)<=1){let e=!1;switch(t){case 1:e="bottom"===i.txtAlign.v;break;case 2:e="left"===i.txtAlign.h;break;case 3:e="right"===i.txtAlign.h}if(!e)continue}h=e,c=l[t]}}e+=c.pos.x,r+=c.pos.y,a=c.dim.width,o=c.dim.height}const l=Math.max(5,a-2*s.textMargin),c=Math.max(5,o-2*s.textMargin),h=s.prepareText(t,i.text,l,c);t.font=s.font.cssFont(),t.textBaseline="alphabetic";const u=s.font.getHeight(),d=u*h.length;let p=r+s.textMargin+("top"===i.txtAlign.v?0:"bottom"===i.txtAlign.v?c-d:(c-d)/2)+s.font.getMetrics().ascent;for(let n=0;n<h.length;n++,p+=u){const r=e+s.textMargin+("left"===i.txtAlign.h?0:"right"===i.txtAlign.h?l-h[n].size.width:(l-h[n].size.width)/2);if(s.shadow){const e=Math.max(1,s.font.size/10);t.fillStyle=s.shadowColor,t.fillText(h[n].text,r+e,p+e)}t.fillStyle=this.isInverted()?s.backColor:this.isAlternative()?s.alternativeColor:s.textColor,t.fillText(h[n].text,r,p)}this._focusAccessibleElement(t)}return!0}_focusAccessibleElement(t){gt.CANVAS_DRAW_FOCUS&&this.$accessibleElement&&(this.shape.preparePath(t),t.drawFocusIfNeeded(this.$accessibleElement.get(-1)))}getDescription(){return this.content?this.content.getDescription():""}toString(){return("cell"!==this.role?f(this.role):"")+(this.getCurrentContent()||"-").toString()}playMedia(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.getCurrentContent();return!(!i||!i.mediaContent)&&(m("debug",`Playing: ${i.mediaContent.toString()}`),t.playMedia(i.mediaContent,this,e),!0)}setHostedMediaPlayer(t){const e=this.hostedMediaPlayer;this.hostedMediaPlayer=t,e&&e!==t&&e.linkTo(null),t&&t.linkTo(this)}setBounds(t,e,i,s){"number"==typeof t&&(t=new St(t,e,i,s)),this.equals(t)||(super.setBounds(t),this.hostedMediaPlayer&&this.hostedMediaPlayer.checkVisualComponentBounds(this))}setHostedComponentBounds(t){if(this.$hostedComponent){super.setHostedComponentBounds(t);const e=this.getCurrentContent();if(t&&e&&e.animatedGifFile&&e.img){const t=e.img,i=Math.max(t.naturalWidth,this.dim.width),s=Math.max(t.naturalHeight,this.dim.height);let n=1,r="";if(e.imgClip){const t=e.imgClip.getBounds();(this.dim.width<t.dim.width||this.dim.height<t.dim.height)&&(n=Math.min(this.dim.width/t.dim.width,this.dim.height/t.dim.height),r=`${i*n}px ${s*n}px`),this.$hostedComponent.css({"background-position":`${-e.imgClip.pos.x*n}px ${-e.imgClip.pos.y*n}px`,"background-size":r})}else(this.dim.width<i||this.dim.height<s)&&(n=Math.min(this.dim.width/i,this.dim.height/s),r=`${i*n}px ${s*n}px`),this.$hostedComponent.css({"background-size":r})}}}buildAccessibleElement(t,i,s,n){this.$accessibleElement&&this.$accessibleElement.remove();const r=t.get(-1);if(r.width>0&&r.height>0){const a=Math.round(1e5*Math.random()),o=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement=e("<button/>",{tabindex:o?-1:0,id:`AE${a}`}).prop("disabled",!!o||null).html(this.toString()).on("click",s=>{if(s.originalEvent&&(0!==s.originalEvent.pageX||0!==s.originalEvent.pageY))return!0;m("debug",`Click on accessible element: ${this.toString()}`);const r=e.Event(n||"click"),a=this.getBounds(),o=t.offset();return r.pageX=o.left+a.pos.x+a.dim.width/2,r.pageY=o.top+a.pos.y+a.dim.height/2,i.trigger(r),!1});(s||t).append(this.$accessibleElement),gt.CANVAS_DRAW_FOCUS&&this.$accessibleElement.on("focus blur",t=>{m("debug",`${t.type} accessible element: ${this.toString()}`),this.container&&this.container.update(),this.updateContent(r.getContext("2d"),null)})}return this.$accessibleElement}}Object.assign(hi.prototype,{idOrder:-1,idLoc:-1,idAss:-1,pos0:null,content:null,altContent:null,hasHostedComponent:!1,hostedMediaPlayer:null,isBackground:!1});const ui=hi;class di{constructor(t,e){t&&(this.id=t),e&&(this.$div=e)}getDisplayValue(){let t=this.countDown>0?this.countDown-this.value:this.value;return this.displayDiffFrom&&(t-=this.displayDiffFrom.value),Math.max(0,Math.min(this.MAX_DISPLAY_VALUE,t))}refreshDisplay(){this.$div&&this.$div.html(this.enabled?(this.getDisplayValue()+1e3).toString().substring(1):"000")}setEnabled(t){this.enabled!==t&&(this.enabled=t,this.$div&&(this.refreshDisplay(),this.$div.css("opacity",this.enabled?1:.3)))}setCountDown(t){this.countDown!==(this.countDown=t)&&this.refreshDisplay()}incValue(){this.value++,this.enabled&&this.refreshDisplay()}setValue(t){this.enabled&&this.value!==(this.value=t)&&this.refreshDisplay()}}Object.assign(di.prototype,{id:"",$div:null,value:0,countDown:0,enabled:!0,MAX_DISPLAY_VALUE:999,displayDiffFrom:null});const pi=di;class fi extends Ft{constructor(t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i);let s="";if(yt.loadGoogleFonts(this.cssFonts),this.$ctrlCnt=e("<div/>",{class:"JClicCtrlCnt unselectableText",role:"navigation"}),this.$div.append(this.$ctrlCnt),s=f("Previous activity"),this.buttons.prev=e("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e(nt(this.prevIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",t=>{this.ps&&this.ps.actions.prev.processEvent(t)}),this.$ctrlCnt.append(this.buttons.prev),this.msgBox=new ui,this.msgBox.role="message",this.$msgBoxDiv=e("<div/>",{class:"JClicMsgBox"}).on("click",()=>(this.msgBox.playMedia(t),!1)),this.$ctrlCnt.append(this.$msgBoxDiv),s=f("Next activity"),this.buttons.next=e("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e(nt(this.nextIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",t=>{this.ps&&this.ps.actions.next.processEvent(t)}),this.$ctrlCnt.append(this.buttons.next),!1!==this.ps.options.counters&&!1!==i.counters){s=f("Reports");const t=e("<button/>",{class:"JClicCountCnt","aria-label":s}).on("click",t=>{this.ps&&this.ps.actions.reports.processEvent(t)});e.each(Ft.prototype.counters,(i,n)=>{s=f(i),this.counters[i]=new pi(i,e("<div/>",{class:"JClicCounter",title:s,"aria-label":s}).css({"background-image":`url(${rt(this[i+"Icon"],this.counterIconWidth,this.counterIconHeight,this.counterIconFill)})`,color:this.counterIconFill}).html("000").appendTo(t))}),this.$ctrlCnt.append(t)}if(!0!==this.ps.options.info&&!0!==i.info||(s=f("Information"),this.buttons.info=e("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e(nt(this.infoIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",t=>{this.ps&&this.ps.actions.info.processEvent(t)}),this.$ctrlCnt.append(this.buttons.info)),!0!==this.ps.options.reportsBtn&&!0!==i.reportsBtn||(s=f("Reports"),this.buttons.about=e("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e(nt(this.reportsIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",t=>{this.ps&&this.ps.actions.reports.processEvent(t)}),this.$ctrlCnt.append(this.buttons.about)),document&&document.fullscreenEnabled&&(s=f("Toggle full screen"),this.buttons.fullscreen=e("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e("<img/>",{src:rt(this.fullScreenIcon,this.iconWidth,this.iconHeight,this.iconFill)})).on("click",()=>{this.setScreenFull(null)}),this.$ctrlCnt.append(this.buttons.fullscreen)),"function"==typeof this.ps.options.closeFn){s=f("Close");const t=this.ps.options.closeFn;this.buttons.close=e("<button/>",{class:"JClicBtn",title:s,"aria-label":s}).append(e(nt(this.closeIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",()=>{m("info","Closing the player"),t()}),this.$ctrlCnt.append(this.buttons.close)}let n=null;e.each(this.buttons,(t,e)=>{!e||"function"==typeof e[0].focus&&"function"==typeof e[0].blur||(null===n&&(n=()=>m("error",'"blur" and "focus" not defined for SVG objects in Explorer/Edge')),e[0].focus=e[0].blur=n)})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return`${super._getStyleSheets(t)}${"default"===t?this.mainCSS:"half"===t?this.mainCSSHalf:"twoThirds"===t?this.mainCSSTwoThirds:""}`}doLayout(){super.doLayout(),this.buttons.fullscreen&&(this.buttons.fullscreen.find("img").get(-1).src=rt(this[document&&document.fullscreenElement?"fullScreenExitIcon":"fullScreenIcon"],this.iconWidth,this.iconHeight,this.iconFill))}enableMainButtons(t){this.$ctrlCnt.find(".JClicBtn,.JClicCountCnt").attr("tabindex",t?"0":"-1")}}Object.assign(fi.prototype,{skinId:"JClicDefaultSkin",$ctrlCnt:null,margin:18,msgBoxHeight:60,countersWidth:60,countersHeight:20,mainCSS:".ID .JClicCtrlCnt {\n margin: 0 9px 18px 9px;\n display: -webkit-flex;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ID .JClicCountCnt {\n display: -webkit-flex;\n display: flex;\n flex-direction: column;\n}\n\n.ID .JClicMsgBox {\n height: 60px;\n flex-grow: 1;\n background-color: lightblue;\n}\n\n.ID .JClicBtn {\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .JClicBtn:disabled {\n cursor: inherit;\n opacity: 0.3;\n}\n\n.ID .JClicCounter {\n width: 40px;\n height: 20px;\n padding-left: 20px;\n color: white;\n cursor: pointer;\n font-family: Roboto, Sans-serif;\n font-size: 18px;\n text-align: center;\n background-repeat: no-repeat;\n background-position: left;\n box-sizing: content-box;\n}\n",mainCSSHalf:".ID .JClicPlayerCnt {\n margin: 9px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 4px 9px 4px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 18px;\n height: 18px;\n}\n\n.ID .JClicMsgBox {\n height: 30px;\n}\n\n.ID .JClicCounter {\n width: 20px;\n height: 10px;\n margin-left: -15px;\n transform: scale(0.5);\n}\n",mainCSSTwoThirds:".ID .JClicPlayerCnt {\n margin: 12px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 6px 12px 6px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 24px;\n height: 24px;\n}\n\n.ID .JClicMsgBox {\n height: 40px;\n}\n\n.ID .JClicCounter {\n width: 27px;\n height: 13px;\n margin-left: -10px;\n transform: scale(0.666);\n}\n",cssFonts:["Roboto"],iconWidth:36,iconHeight:36,iconFill:"#FFFFFF",prevIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" />\n</svg>\n',nextIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />\n</svg>\n',fullScreenIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" />\n</svg>\n',fullScreenExitIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" />\n</svg>\n',closeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',infoIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z" />\n</svg>\n',reportsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z" />\n</svg>\n',counterIconWidth:18,counterIconHeight:18,counterIconFill:"#FFFFFF",timeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />\n <path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />\n</svg>\n',scoreIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',actionsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.49 5.48c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-3.6 13.9l1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3c1.3 1.5 3.3 2.5 5.5 2.5v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1l-5.2 2.2v4.7h2v-3.4l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4z" />\n</svg>\n'});const gi=Ft.registerClass("default",fi);class mi extends gi{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(mi.prototype,{skinId:"JClicOrangeSkin",skinCSS:".ID {background-color:#FF8B19;}"});const vi=Ft.registerClass("orange",mi);class bi extends gi{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(bi.prototype,{skinId:"JClicGreenSkin",iconFill:"#20640E",counterIconFill:"#20640E",skinCSS:".ID {background-color:#4AFF19;}"});const yi=Ft.registerClass("green",bi);class wi extends gi{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(wi.prototype,{skinId:"JClicBlueSkin",skinCSS:".ID {background-color:#1990FF;}"});const Ai=Ft.registerClass("blue",wi);class Ci extends gi{constructor(t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Object.assign({},i,{counters:!1,reportsBtn:!0})),this.$ctrlCnt.detach().prependTo(this.$div),this.$msgBoxDiv.detach().appendTo(this.$div),e("<div/>").css({"flex-grow":1}).insertAfter(this.$ctrlCnt.children(":nth-child(2)"))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return`${super._getStyleSheets(t)}${"default"===t?this.skinCSS:"half"===t?this.skinCSSHalf:"twoThirds"===t?this.skinCSSTwoThirds:""}`}}Object.assign(Ci.prototype,{skinId:"JClicSimpleSkin",skinCSS:".ID {\n background-color: #888888;\n}\n\n.ID .JClicCtrlCnt {\n margin: 9px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 18px 18px;\n}\n\n.ID .JClicMsgBox {\n flex-grow: 0;\n margin: 0 18px 18px 18px;\n}\n",skinCSSHalf:".ID .JClicCtrlCnt {\n margin: 4px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 9px 9px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 9px 9px 9px;\n}\n",skinCSSTwoThirds:".ID .JClicCtrlCnt {\n margin: 6px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 12px 12px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 12px 12px 12px;\n}\n"});const xi=Ft.registerClass("simple",Ci);class ki extends gi{constructor(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Object.assign({},e,{counters:!1,reportsBtn:!0}))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(ki.prototype,{skinId:"JClicMiniSkin",iconWidth:18,iconHeight:18,iconFill:"#080808",counterIconFill:"#080808",margin:8,skinCSS:".ID {\n background-color: #F4F4F4;\n}\n\n.ID .JClicPlayerCnt {\n margin: 4px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 2px 4px 2px;\n}\n\n.ID .JClicMsgBox {\n height: 25px;\n}\n",mainCSSHalf:"",mainCSSTwoThirds:""});const Si=Ft.registerClass("mini",ki);class Ti extends Ft{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.msgBox=new ui,this.msgBox.role="message"}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.mainCSS:"")}}Object.assign(Ti.prototype,{skinId:"JClicEmptySkin",mainCSS:".ID .JClicPlayerCnt {margin:0;}"});const Ei=Ft.registerClass("empty",Ti);class Pi extends Ft{constructor(t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i),this.$mainPanel=e("<div/>",{class:"JClicCustomMainPanel"}),this.$gridPanel=e("<div/>",{class:"JClicGridPanel"});for(let t=0;t<9;t++)this.$gridPanel.append(e("<div/>",{class:`JClicCell JClicCell${t+1}`}));this.$mainPanel.append(this.$gridPanel),this.$playerCnt.detach().addClass("JClicPlayerCell").appendTo(this.$mainPanel),this.$div.prepend(this.$mainPanel),i.buttons&&Object.keys(i.buttons.button).forEach(i=>{const s="about"===i?"reports":i,n=f(this.msgKeys[s]||s);this.buttons[s]=e("<button/>",{class:`JClicBtn JClicTransform Btn-${s}`,title:n,"aria-label":n,disabled:void 0===this.msgKeys[s]}).on("click",e=>{t.actions[s]&&t.actions[s].processEvent(e)}),this.$mainPanel.append(this.buttons[s])}),i.rectangle.messages&&(this.msgBox=new ui,this.msgBox.role="message",this.$msgBoxDiv=e("<div/>",{class:"JClicMsgBox"}).on("click",()=>(this.msgBox.playMedia(t),!1)),this.$mainPanel.append(this.$msgBoxDiv)),!1!==this.ps.options.counters&&i.counters&&i.counters.counter&&e.each(Ft.prototype.counters,(t,s)=>{if(i.counters.counter[t]){const i=f(t);this.counters[t]=new pi(t,e("<div/>",{class:`JClicCounter JClicTransform Counter-${t}`,title:i,"aria-label":i}).html("000").appendTo(this.$mainPanel))}}),i.progressAnimation&&(this.$progressAnimation=e("<div/>",{class:"JClicProgressAnimation JClicTransform"}),this.$mainPanel.append(this.$progressAnimation))}enableMainButtons(t){this.$mainPanel.find(".JClicBtn").attr("tabindex",t?"0":"-1")}_computeStyleSheets(){const t=this.options.dimension.preferredSize.width,e=this.options.dimension.preferredSize.height;this.twoThirdsMedia={width:t,height:e},this.halfMedia={width:Math.round(2*t/3),height:Math.round(2*e/3)};const i=this.options.rectangle.frame.left,s=i+this.options.rectangle.player.left,n=i+this.options.slicer.left,r=i+this.options.slicer.right,a=s+this.options.rectangle.player.width,o=i+this.options.rectangle.frame.width,l=this.options.rectangle.frame.top,c=l+this.options.rectangle.player.top,h=l+this.options.slicer.top,u=l+this.options.slicer.bottom,d=c+this.options.rectangle.player.height,p=l+this.options.rectangle.frame.height,g=this.ps.project.mediaBag.getElement(this.options.image,!0),m=g.data&&g.data.src?g.data.src:"",v=g.data?ot(g.data,new St(i,l,n-i,h-l)):"",b=g.data?ot(g.data,new St(n-i,l,r-n,h-l)):"",y=g.data?ot(g.data,new St(r,l,o-r,h-l)):"",w=g.data?ot(g.data,new St(i,h-l,n-i,u-h)):"",A=g.data?ot(g.data,new St(r-i,h-l,o-r,u-h)):"",C=g.data?ot(g.data,new St(i,u-l,n-i,p-u)):"",x=g.data?ot(g.data,new St(n-i,u-l,r-n,p-u)):"",k=g.data?ot(g.data,new St(r,u-l,o-r,p-u)):"";let S=`\n.ID .JClicCustomMainPanel {flex-grow:1;position:relative;background-color: ${D(this.options.color.fill.value)};}\n.ID .JClicGridPanel {position:absolute;width:100%;height:100%;display:grid;grid-template-columns:${n-i}px 1fr ${o-r}px;grid-template-rows:${h-l}px 1fr ${p-u}px;}\n.ID .JClicCell {background-repeat:no-repeat;background-size:contain;}\n.ID .JClicPlayerCell {position:absolute;top:${c-l}px;right:${o-a}px;bottom:${p-d}px;left:${s-i}px;}\n.ID .JClicCell1 {background-image:url(${v});}\n.ID .JClicCell2 {background-image:url(${b});background-repeat:repeat-x;}\n.ID .JClicCell3 {background-image:url(${y});}\n.ID .JClicCell4 {background-image:url(${w});background-repeat:repeat-y;}\n.ID .JClicCell5 {}\n.ID .JClicCell6 {background-image:url(${A});background-repeat:repeat-y;}\n.ID .JClicCell7 {background-image:url(${C});}\n.ID .JClicCell8 {background-image:url(${x});background-repeat:repeat-x;}\n.ID .JClicCell9 {background-image:url(${k});}`,T=`\n.ID .JClicGridPanel {grid-template-columns:${Math.round((n-i)/2)}px 1fr ${Math.round((o-r)/2)}px;grid-template-rows:${Math.round((h-l)/2)}px 1fr ${Math.round((p-u)/2)}px;}\n.ID .JClicPlayerCell {top:${Math.round((c-l)/2)}px;right:${Math.round((o-a)/2)}px;bottom:${Math.round((p-d)/2)}px;left:${Math.round((s-i)/2)}px;}\n.ID .JClicTransform {transform: scale(0.5);}`,E=`\n.ID .JClicGridPanel {grid-template-columns:${Math.round(2*(n-i)/3)}px 1fr ${Math.round(2*(o-r)/3)}px;grid-template-rows:${Math.round(2*(h-l)/3)}px 1fr ${Math.round(2*(p-u)/3)}px;}\n.ID .JClicPlayerCell {top:${Math.round(2*(c-l)/3)}px;right:${Math.round(2*(o-a)/3)}px;bottom:${Math.round(2*(p-d)/3)}px;left:${Math.round(2*(s-i)/3)}px;}\n.ID .JClicTransform {transform: scale(0.666);}`;if(this.options.buttons){const t=this.options.buttons;let e=30,i=30,s={};t.settings&&(t.settings.dimension&&(e=t.settings.dimension.width||e,i=t.settings.dimension.height||i),t.settings.offset&&Object.assign(s,t.settings.offset)),Object.keys(this.options.buttons.button).forEach(r=>{const a=t.button[r],l="about"===r?"reports":r;let c=e,u=i,d=s;a.settings&&(a.settings.dimension&&(c=a.settings.dimension.width||c,u=a.settings.dimension.height||u),a.settings.offset&&(d=Object.assign({},s,a.settings.offset)));const f=a.point.pos.left,g=f<n?`left:${f}`:"right:"+(o-f-c),v=f<n?`left:${Math.round(f/2-c/4)}`:`right:${Math.round((o-f-c)/2-c/4)}`,b=f<n?`left:${Math.round(2*f/3-c/6)}`:`right:${Math.round(2*(o-f-c)/3-c/6)}`,y=a.point.pos.top,w=y<h?`top:${y}`:"bottom:"+(p-y-u),A=y<h?`top:${Math.round(y/2-u/4)}`:`bottom:${Math.round((p-y-u)/2-u/4)}`,C=y<h?`top:${Math.round(2*y/3-u/6)}`:`bottom:${Math.round(2*(p-y-u)/3-u/6)}`,x=a.point.source.left,k=a.point.source.top;S+=`.ID .Btn-${l} {position:absolute;${g}px;${w}px;width:${c}px;height:${u}px;background:url(${m}) !important;background-position:-${x}px -${k}px !important;}\n`,T+=`.ID .Btn-${l} {${v}px;${A}px;}\n`,E+=`.ID .Btn-${l} {${b}px;${C}px;}\n`,d.active&&(S+=`.ID .Btn-${l}:active {background-position:-${x+d.active.right}px -${k+d.active.down}px !important;}\n`),d.over&&(S+=`.ID .Btn-${l}:hover {background-position:-${x+d.over.right}px -${k+d.over.down}px !important;}\n`),d.disabled&&(S+=`.ID .Btn-${l}:disabled {background-position:-${x+d.disabled.right}px -${k+d.disabled.down}px !important;}\n`)})}if(this.options.counters&&this.options.counters.settings){const t=this.options.counters;let e=35,i=20;t.settings.dimension&&t.settings.dimension.counter&&(e=t.settings.dimension.counter.width||e,i=t.settings.dimension.counter.height||i);let s=37,r=14;t.settings.dimension&&t.settings.dimension.label&&(s=t.settings.dimension.label.width||s,r=t.settings.dimension.label.height||r);let a="black";t.style&&t.style.color&&t.style.color.foreground&&(a=D(t.style.color.foreground.value||a));let l=r-4,c="Roboto";t.style&&t.style.font&&t.style.font.label&&(l=Math.max(8,t.style.font.label.size||l),c=`${t.style.font.label.family||"Roboto"},Roboto,sans-serif`),S+=`.ID .JClicCounter {font-size:${i-2}px;color:${a}}\n`,Object.keys(this.options.counters.counter).forEach(a=>{const u=t.counter[a];let d=e,g=i;const m=u.point.counter.left,v=u.point.label.left||m-Math.round((s-e)/2),b=m<n?`left:${m}`:"right:"+(o-m-d),y=m<n?`left:${Math.round(m/2-d/4)}`:`right:${Math.round((o-m-d)/2-d/4)}`,w=m<n?`left:${Math.round(2*m/3-d/6)}`:`right:${Math.round(2*(o-m-d)/3-d/6)}`,A=u.point.counter.top,C=u.point.label.top||A-r,x=A<h?`top:${A}`:"bottom:"+(p-A-g),k=A<h?`top:${Math.round(A/2-g/4)}`:`bottom:${Math.round((p-A-g)/2-g/4)}`,P=A<h?`top:${Math.round(2*A/3-g/6)}`:`bottom:${Math.round(2*(p-A-g)/3-g/6)}`;S+=`.ID .Counter-${a} {position:absolute;${b}px;${x}px;width:${d}px;height:${g}px;line-height:${g}px;}\n`,S+=`.ID .Counter-${a}:before {content:"${f(a)}";font-size:${l}px;font-family:${c};width:${s}px;height:${r}px;line-height:${r}px;position:absolute;top:${C-A}px;left:${v-m}px;}`,T+=`.ID .Counter-${a} {${y}px;${k}px;}\n`,E+=`.ID .Counter-${a} {${w}px;${P}px;}\n`})}if(this.options.progressAnimation){const t=this.options.progressAnimation;let e=30,i=30;t.dimension&&(e=t.dimension.width||e,i=t.dimension.height||i);const s=t.point.pos.left,r=s<n?`left:${s}`:"right:"+(o-s-e),a=s<n?`left:${Math.round(s/2-e/4)}`:`right:${Math.round((o-s-e)/2-e/4)}`,l=s<n?`left:${Math.round(2*s/3-e/6)}`:`right:${Math.round(2*(o-s-e)/3-e/6)}`,c=t.point.pos.top,u=c<h?`top:${c}`:"bottom:"+(p-c-i),d=c<h?`top:${Math.round(c/2-i/4)}`:`bottom:${Math.round((p-c-i)/2-i/4)}`,f=c<h?`top:${Math.round(2*c/3-i/6)}`:`bottom:${Math.round(2*(p-c-i)/3-i/6)}`,g=t.point.source.left,v=t.point.source.top;if(S+=`.ID .JClicProgressAnimation {position:absolute;${r}px;${u}px;width:${e}px;height:${i}px;background:url(${m});background-position:-${g}px -${v}px;}\n`,T+=`.ID .JClicProgressAnimation {${a}px;${d}px;}\n`,E+=`.ID .JClicProgressAnimation {${l}px;${f}px;}\n`,t.frames&&t.direction){const s=(t.step||e)*("right"===t.direction?1:"left"===t.direction?-1:0),n=(t.step||i)*("down"===t.direction?1:"up"===t.direction?-1:0);S+=`\n@keyframes anim {100% {background-position:${-1*(g+s*t.frames)}px ${-1*(v+n*t.frames)}px;}}\n.ID .JClicProgressAnimation {animation: anim ${t.frames*t.delay}ms steps(${t.frames}) infinite;}`}}if(this.options.rectangle.messages){const t=this.options.rectangle.messages,e=i+t.left,s=o-t.width-t.left-i,n=t.top<h?`top:${t.top}`:"bottom:"+(p-t.height-t.top),r=t.top<h?`top:${Math.round(t.top/2)}`:`bottom:${Math.round((p-t.height-t.top)/2)}`,a=t.top<h?`top:${Math.round(2*t.top/3)}`:`bottom:${Math.round(2*(p-t.height-t.top)/3)}`;S+=`.ID .JClicMsgBox {position:absolute;left:${e}px;right:${s}px;height:${t.height}px;${n}px;}`,T+=`.ID .JClicMsgBox {left:${Math.round(e/2)}px;right:${Math.round(s/2)}px;height:${Math.round(t.height/2)}px;${r}px;}`,E+=`.ID .JClicMsgBox {left:${Math.round(2*e/3)}px;right:${Math.round(2*s/3)}px;height:${Math.round(2*t.height/3)}px;${a}px;}`}this.cssVariants={default:this.mainCSS+S,half:T,twoThirds:E}}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return this.cssVariants||this._computeStyleSheets(),`${super._getStyleSheets(t)}${this.cssVariants[t]||""}`}setWaitCursor(t){super.setWaitCursor(t),this.$progressAnimation&&this.$progressAnimation.css("animation-play-state",this.waitCursorCount>0?"running":"paused")}}Object.assign(Pi.prototype,{skinId:"JClicCustomSkin",image:null,mainCSS:".ID .JClicPlayerCnt {margin:0;}.ID .JClicBtn:focus {outline:0;}.ID .JClicCounter {font-family:Roboto,sans-serif;text-align:center;}",cssVariants:null,msgKeys:{next:"Next activity",prev:"Previous activity",info:"Information",help:"Help",reports:"Reports",audio:"Audio on/off",reset:"Reset activity"},$progressAnimation:null});const Ii=Ft.registerClass("custom",Pi);class Bi extends xe{constructor(t,e){super(t,e)}buildShapes(){const t=1/this.nCols,e=1/this.nRows;for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.shapeData[i*this.nCols+s]=new St(new Ct(s*t,i*e),new xt(t,e));this.initiated=!0}}Object.assign(Bi.prototype,{rectangularShapes:!0});const _i=xe.registerClass("@Rectangular",Bi);const Ri=xe.registerClass("@Holes",class extends xe{constructor(t,e){super(1,1),this.customShapes=!0,this.nCols=t,this.nRows=e,this.showEnclosure=!0}buildShapes(){this.nCells>0&&(this.initiated=!0)}getEnclosingShapeData(){return this.showEnclosure?this.enclosing||super.getEnclosingShapeData():null}});const Oi=xe.registerClass("@JigSaw",class extends xe{constructor(t,e){super(t,e)}buildShapes(){let t=[],e=[];for(let i=0;i<=this.nRows;i++)t[i]=[],e[i]=[];for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)t[i][s]=0===i?0:1+(this.randomLines?Math.round(9*Math.random()):i+s)%2,e[i][s]=0===s?0:1+(this.randomLines?Math.round(9*Math.random()):s+i+1)%2,s===this.nCols-1&&(e[i][s+1]=0),i===this.nRows-1&&(t[i+1][s]=0);const i=1/this.nCols,s=1/this.nRows;for(let n=0;n<this.nRows;n++)for(let r=0;r<this.nCols;r++){const a=i*r,o=s*n,l=new Et([new Pt("M",[a,o])]);this.hLine(l,t[n][r],a+0,o+0,i,s,!1),this.vLine(l,e[n][r+1],a+i,o+0,i,s,!1),this.hLine(l,t[n+1][r],a+i,o+s,i,s,!0),this.vLine(l,e[n][r],a+0,o+s,i,s,!0),l.addStroke(new Pt("X")),l.calcEnclosingRect(),this.shapeData[n*this.nCols+r]=l}this.initiated=!0}hLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Pt("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*this.baseWidthFactor*o;t.addStroke(new Pt("L",[e,s]));const c=r*this.toothHeightFactor*l;t.addStroke(new Pt("L",[e,s+c])),t.addStroke(new Pt("L",[e+a,s+c])),t.addStroke(new Pt("L",[e+a,s])),t.addStroke(new Pt("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Pt("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor*o;t.addStroke(new Pt("L",[i,e]));const c=n*this.toothHeightFactor*l;t.addStroke(new Pt("L",[i+c,e])),t.addStroke(new Pt("L",[i+c,e+a])),t.addStroke(new Pt("L",[i,e+a])),t.addStroke(new Pt("L",[i,s+r*o]))}}});const Di=xe.registerClass("@TriangularJigSaw",class extends Oi{constructor(t,e){super(t,e)}hLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Pt("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*this.baseWidthFactor*o;t.addStroke(new Pt("L",[e,s]));const c=r*this.toothHeightFactor*l;t.addStroke(new Pt("L",[e+a/2,s+c])),t.addStroke(new Pt("L",[e+a,s])),t.addStroke(new Pt("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Pt("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor*o;t.addStroke(new Pt("L",[i,e]));const c=n*this.toothHeightFactor*l;t.addStroke(new Pt("L",[i+c,e+a/2])),t.addStroke(new Pt("L",[i,e+a])),t.addStroke(new Pt("L",[i,s+r*o]))}}});class Mi extends Oi{constructor(t,e){super(t,e)}hLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Pt("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*(this.baseWidthFactor/12)*o;t.addStroke(new Pt("L",[e,s]));const c=r*this.toothHeightFactor*l/8;t.addStroke(new Pt("B",[e+4*a,s,e+6*a,s-c,e+4*a,s-3*c])),t.addStroke(new Pt("B",[e+2*a,s-5*c,e+10*a,s-5*c,e+8*a,s-3*c])),t.addStroke(new Pt("B",[e+6*a,s-1*c,e+8*a,s,e+12*a,s])),t.addStroke(new Pt("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Pt("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor/12*o;t.addStroke(new Pt("L",[i,e]));const c=n*this.toothHeightFactor*l/8;t.addStroke(new Pt("B",[i,e+4*a,i-c,e+6*a,i-3*c,e+4*a])),t.addStroke(new Pt("B",[i-5*c,e+2*a,i-5*c,e+10*a,i-3*c,e+8*a])),t.addStroke(new Pt("B",[i-1*c,e+6*a,i,e+8*a,i,e+12*a])),t.addStroke(new Pt("L",[i,s+r*o]))}}}Object.assign(Mi.prototype,{baseWidthFactor:3/4,toothHeightFactor:.6});const Ni=xe.registerClass("@ClassicJigSaw",Mi),$i=["+","-",String.fromCharCode(215),":"],Vi=-12345,qi=Intl&&Intl.NumberFormat().format(1.1).indexOf(",")>0;class ji extends Ee{constructor(){super(),this.className="@arith.Arith",this.numericContent=!0,this.opA=new ji.Operator,this.opB=new ji.Operator}static DecFormat(t,e,i){let s=t.toFixed(e);if(i){let t=s.indexOf(".");for(t<0&&(t=s.length);t<i;t++)s=`0${s}`}return s}setProperties(t){return t.children().each((t,i)=>{const s=e(i);let n="";switch(i.nodeName){case"operand":switch(s.attr("id")){case"A":this.opA.setProperties(s);break;case"B":this.opB.setProperties(s)}break;case"operations":this.use_add=v(s.attr("plus")),this.use_subst=v(s.attr("minus")),this.use_mult=v(s.attr("multiply")),this.use_div=v(s.attr("divide"));break;case"unknown":this.exp_abx=v(s.attr("result")),this.exp_xbc=v(s.attr("first")),this.exp_axc=v(s.attr("last")),this.exp_axbc=v(s.attr("operand")),this.exp_caxb=v(s.attr("inverse"));break;case"result":n=s.attr("from"),this.resultLimInf=y("x"===n?0:n,this.resultLimInf),n=s.attr("to"),this.resultLimSup=y("x"===n?0:n,this.resultLimSup),this.resultCarry=v(s.attr("notCarry"),this.resultCarry),this.resultNoDup=!v(s.attr("duplicates"),!this.resultNoDup);let t=s.attr("order");this.resultOrder="ascending"===t?"SORTASC":"descending"===t?"SORTDESC":"NOSORT",t=s.attr("condition"),this.opCond="firstBig"===t?"AGB":"lastBig"===t?"BGA":"INDIF"}}),this}getAttributes(){return V(this,["className","opA","opB","use_add","use_subst","use_mult","use_div","exp_abx|true","exp_axc|false","exp_xbc|false","exp_axbc|false","exp_caxb|false","resultLimInf|0","resultLimSup|9999","resultCarry|false","resultNoDup|false","resultOrder|NOSORT","opCond|INDIF"])}setAttributes(t){return L(this,t,["className",{key:"opA",fn:ji.Operator},{key:"opB",fn:ji.Operator},"use_add","use_subst","use_mult","use_div","exp_abx","exp_axc","exp_xbc","exp_axbc","exp_caxb","resultLimInf","resultLimSup","resultCarry","resultNoDup","resultOrder","opCond"])}genNum(t,e,i,s){let n=!1;t.c=e.numDec;const r=0===t.c?1:1===t.c?10:100;let a=e.limSup;s!==Vi&&s<a&&(a=s);let o=e.limInf;if(i!==Vi&&i>o&&(o=i),e.fromList>0&&(t.vf=e.lst[Math.floor(Math.random()*e.fromList)],n=!0),!n){const i=Math.floor(100*Math.random());e.wZero&&i<=10?(t.vf=0,n=!0):e.wOne&&i>10&&i<=20?(t.vf=1,n=!0):e.wMinusOne&&i>20&&i<=30&&(t.vf=-1,n=!0)}if(!n){if(o>a){const t=o;o=a,a=t}let e=Math.floor(a-o+1);e<0&&(e=1);let i=(Math.floor(Math.random()*e)+o)*r;r>1&&(i+=Math.floor(Math.random()*r)),t.vf=i/r}return!0}genOp(t){let e,i,s,n,r,a,o,l;const c=[],h=this.resultLimInf,u=this.resultLimSup;let d=0;this.use_add&&(c[d++]="SUM"),this.use_subst&&(c[d++]="REST"),this.use_mult&&(c[d++]="MULT"),this.use_div&&(c[d++]="DIV");switch(c[Math.floor(Math.random()*d)]){case"SUM":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,u),i=t.numA.vf<h?h-Math.floor(t.numA.vf):this.RES,s=u-Math.floor(t.numA.vf),this.opCond){case"AGB":(s===this.RES||s>t.numA.vf)&&(s=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf+t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=0,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0){for(n=2===t.numR.c?100:1===t.numR.c?10:1,o=ji.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=ji.DecFormat(Math.floor(t.numB.vf*n+.5),0,10).split(""),e=0;e<10&&("0"===o[e]&&"0"===l[e]);e++);for(;e<10;e++)if(r=parseInt(o[e]),a=parseInt(l[e]),!(r+a<10)){for(;r+a>9;)r>a?r=r>0?Math.floor(Math.random()*r):0:a=a>0?Math.floor(Math.random()*a):0;o[e]=r.toFixed(0),l[e]=a.toFixed(0)}t.numA.vf=parseInt(o.join(""))/n,t.numB.vf=parseInt(l.join(""))/n,t.numR.vf=Math.floor(t.numA.vf*n+t.numB.vf*n+.5)/n}break;case"REST":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,h,this.RES),i=t.numA.vf>u?Math.floor(t.numA.vf-u):this.RES,s=Math.floor(t.numA.vf-h),this.opCond){case"AGB":(s===this.RES||s>t.numA.vf)&&(s=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf-t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=1,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0&&t.numA.vf>=t.numB.vf){for(n=2===t.numR.c?100:1===t.numR.c?10:1,o=ji.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=ji.DecFormat(Math.floor(t.numB.vf*n+.5),0,10).split(""),e=0;e<10&&"0"===l[e];e++);for(;e<10;e++)r=parseInt(o[e]),a=parseInt(l[e]),r>=a||(a=r>0?Math.floor(Math.random()*r):0,l[e]=a.toFixed(0));t.numA.vf=parseInt(o.join(""))/n,t.numB.vf=parseInt(l.join(""))/n,t.numR.vf=Math.floor(t.numA.vf*n-t.numB.vf*n+.5)/n}break;case"MULT":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,s=this.opB.limSup,this.opCond){case"AGB":s>t.numA.vf&&(s=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf*t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}t.numR.c=t.numA.c+t.numB.c,t.op=2;break;case"DIV":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,s=this.opB.limSup,this.opCond){case"AGB":s>t.numA.vf&&(s=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),0!==t.numB.vf&&Math.abs(t.numA.vf)>=Math.abs(t.numB.vf)&&(t.numR.vf=t.numA.vf/t.numB.vf)>=h&&t.numR.vf<=u)break}0===t.numB.vf&&(t.numB.vf=1),t.numR.vf=t.numA.vf/t.numB.vf,e=t.numA.c-t.numB.c,n=Math.pow(10,e),t.numA.vf*=n,t.numR.vf*=n,t.numR.vf=Math.floor(t.numR.vf),t.numA.vf=t.numR.vf*t.numB.vf,t.numA.vf/=n,t.numR.vf/=n,t.numR.c=e>0?e:0,t.op=3;break;default:return!1}return!0}process(t){let e,i,s,n,r,a,o=t.nRows,l=t.nCols,c=t.content,h=t.useIds,u=[],d=[],p=this.exp_caxb,f="",g="",m="",v="",b=[],y=[],w=[],A=l,C=o,x=o*l,k=null;if(o<=0||l<=0||null===c||c.length<1||null===c[0])return!1;if(x<2)return!1;if(r=0,this.exp_abx&&(d[r++]="ABX"),this.exp_axc&&(d[r++]="AXC"),this.exp_xbc&&(d[r++]="XBC"),this.exp_axbc&&(d[r++]="AXBC"),0===r)return!1;for(e=0;e<x;e++){for(n=new ji.Operation,i=0;i<60&&(this.genOp(n),this.resultNoDup);i++){for(s=0;s<e&&n.numR.vf!==u[s].numR.vf;s++);if(s===e)break}u[e]=n}if(0!==this.resultOrder)for(e=x-1;e>0;e--)for(i=0;i<e;i++)("SORTASC"===this.resultOrder&&u[i].numR.vf>u[i+1].numR.vf||"SORTDESC"===this.resultOrder&&u[i].numR.vf<u[i+1].numR.vf)&&(n=u[i],u[i]=u[i+1],u[i+1]=n);for(e=0;e<x;e++)switch(a=d[Math.floor(Math.random()*r)],f=ji.DecFormat(u[e].numA.vf,u[0].numA.c),g=ji.DecFormat(u[e].numB.vf,u[0].numB.c),m=ji.DecFormat(u[e].numR.vf,u[0].numR.c),v=$i[u[e].op],w[e]=p?`${m} = ${f} ${v} ${g}`:`${f} ${v} ${g} = ${m}`,a){case"AXC":y[e]=g,b[e]=p?`${m} = ${f} ${v} ?`:`${f} ${v} ? = ${m}`;break;case"XBC":y[e]=f,b[e]=p?`${m} = ? ${v} ${g}`:`? ${v} ${g} = ${m}`;break;case"AXBC":y[e]=v,b[e]=p?`${m} = ${f} ? ${g}`:`${f} ? ${g} = ${m}`;break;default:y[e]=m,b[e]=p?`? = ${f} ${v} ${g}`:`${f} ${v} ${g} =`}if(h){k=[];let S=[];for(s=0,e=0;e<x;e++){for(i=0;i<s&&y[e]!==S[i];i++);i===s?(S[s]=y[e],k[e]=s,s++):k[e]=i}for(y=[],e=0;e<s;e++)y[e]=S[e];if(C*A!==s){let T=!1;switch(s){case 6:C=T?2:3,A=T?3:2;break;case 8:C=T?2:4,A=T?4:2;break;case 9:C=3,A=3;break;case 10:C=T?2:5,A=T?5:2;break;case 12:C=T?3:4,A=T?4:3;break;case 14:C=T?2:7,A=T?7:2;break;case 15:C=T?3:5,A=T?3:5;break;case 16:C=4,A=4;break;case 18:C=T?6:3,A=T?3:6;break;case 20:C=T?4:5,A=T?5:4;break;default:C=T?1:s,A=T?s:1}}}if(qi){function E(t){return t.replace(/\./g,",")}b=b.map(E),y=y.map(E),w=w.map(E)}return c[0].setTextContent(b,l,o),null!==k&&c[0].setIds(k),c.length>1&&null!==c[1]&&(c[1].setTextContent(y,A,C),c[1].getShaper().reset(A,C)),c.length>2&&null!==c[2]&&c[2].setTextContent(w,l,o),!0}}Object.assign(ji.prototype,{opA:null,opB:null,use_add:!0,use_subst:!1,use_mult:!1,use_div:!1,exp_abx:!0,exp_axc:!1,exp_xbc:!1,exp_axbc:!1,exp_caxb:!1,resultLimInf:0,resultLimSup:9999,resultCarry:!1,resultNoDup:!1,resultOrder:"NOSORT",opCond:"INDIF"}),ji.Operator=class{constructor(){}setProperties(t){return ht(t.get(0).attributes,(i,s)=>{switch(i){case"decimals":this.numDec=Number(s);break;case"values":this.lst=s.split(" ").map(t=>Number(t)),this.fromList=this.lst.length;break;case"from":this.limInf=Number("x"===s?0:s);break;case"to":this.limSup=Number("x"===s?0:s)}t.children().each((t,i)=>{const s=e(i);if("include"===i.nodeName)this.wZero=v(s.attr("zero")),this.wOne=v(s.attr("one")),this.wMinusOne=v(s.attr("minusOne"))})}),this}getAttributes(){return V(this,["limInf","limSup","numDec|0","wZero|false","wOne|false","wMinusOne|false","fromList|0","lst"])}setAttributes(t){return L(this,t,["limInf","limSup","numDec","wZero","wOne","wMinusOne","fromList","lst"])}},Object.assign(ji.Operator.prototype,{limInf:0,limSup:10,numDec:0,wZero:!1,wOne:!1,wMinusOne:!1,fromList:0,lst:[]}),ji.Num=class{constructor(){this.vf=0,this.c=0}format(){return ji.DecFormat(this.vf,this.c)}},ji.Operation=class{constructor(){this.numA=new ji.Num,this.numB=new ji.Num,this.numR=new ji.Num,this.op=0}};const Li=Ee.registerClass("@arith.Arith",ji);class Fi extends Ve{constructor(t){super(t)}getMinNumActions(){return this.document?this.document.numTargets:0}}Object.assign(Fi.prototype,{ev:null,checkButtonText:null,prevScreen:!1,prevScreenText:null,prevScreenStyle:null,prevScreenMaxTime:-1});class zi extends qe{constructor(t,e,i){super(t,e,i),this.targets=[]}setDocContent(t,i){t.empty().css(i.style.default.css).css({display:"flex","flex-direction":"column"});const s=e("<div/>").css({"flex-grow":1,overflow:"auto"}),n=e("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(i.style.default.css);let r=null;const a=[];return i.p.forEach(t=>{const s=e("<p/>").css({margin:0});let o=!0;if(t.style?(r=i.style[t.style].css,s.css(r)):r=null,t.Alignment){const e=Number(t.Alignment);s.css({"text-align":1===e?"center":2===e?"right":"left"})}t.elements.forEach(t=>{let n;switch(t.objectType){case"text":const o=e("<span/>").html(t.text).text();(this.spanText?H(o):[{text:o,sep:""}]).forEach(r=>{let{text:a,sep:o}=r,l={...this.act.document.style.default.css};t?.attr?.style&&(l={...l,...i.style[t.attr.style].css}),t?.attr?.css&&(l={...l,...t.attr.css});(this.spanChars?[...a]:[a]).forEach(i=>{t.attr?(n=e("<span/>").html(i).css(l),n.initialCSS=l,s.append(this.$createSpanElement(n))):this.spanText?(n=e("<span/>").html(i),s.append(this.$createSpanElement(n))):s.append(i)}),""!==o&&s.append(o)});break;case"cell":n=e("<span/>");const l=ui.createCell(n.css({position:"relative"}),t);n.css({display:"inline-block","vertical-align":"middle"}),t.mediaContent&&n.on("click",t=>(t.preventDefault(),this.ps.stopMedia(1),l.playMedia(this.ps),!1)),s.append(n);break;case"target":if(n=e("<span/>"),this.showingPrevScreen){n.text(t.text),s.append(n);break}const c=t;let h=null;if("no_info"!==c.infoMode&&c.popupContent){h=e("<span/>").css({position:"absolute","padding-top":"2pt",display:"none"});const t=ui.createCell(h,c.popupContent);c.popupContent.mediaContent&&h.on("click",e=>(e.preventDefault(),this.ps.stopMedia(1),t?t.playMedia(this.ps):c.popupContent.mediaContent&&this.ps.playMedia(c.popupContent.mediaContent),!1)),c.$popup=h,a.push({p:s,span:h,box:t})}n=this.$createTargetElement(c,n),c.num=this.targets.length,c.pos=c.num,this.targets.push(c),n&&(n.css(i.style.default.css),r&&n.css(r),this.targetsMarked?c.attr?(c.attr.style||(c.attr.style="target"),n.css(i.style[c.attr.style].css),c.attr.css&&n.css(c.attr.css)):i.style.target&&n.css(i.style.target.css):c.targetStatus="HIDDEN",null!==h&&"onDemand"===c.infoMode&&n.on("keydown",t=>{t.key===c.popupKey?(t.preventDefault(),this.showPopup(h,c.popupMaxTime,c.popupDelay)):"Escape"===t.key&&(t.preventDefault(),this.showPopup(null))})),h&&n?c.isList?s.append(n).append(h):s.append(h).append(n):n&&s.append(n),c.$p=s}o=!1}),o&&s.html(" "),n.append(s)}),t.append(s.append(n)),this.act.checkButtonText&&!this.showingPrevScreen&&(this.$checkButton=e("<button/>",{class:"StockBtn"}).html(this.act.checkButtonText).css({width:"100%","flex-shrink":0}).on("click",()=>this.evaluatePanel()),t.append(this.$checkButton)),a.forEach(t=>t.span.css({"margin-top":t.p.css("font-size")})),this.act.ev&&this.act.ev.init(this.act.project.settings.locales),t}$createTargetElement(t,e){return e.text(t.text),t.$span=e,e}$createSpanElement(t){return t}initActivity(){this.act.prevScreen?this.preInitActivity():this.startActivity()}startActivity(){super.initActivity(),this.setAndPlayMsg("initial","start"),this.setDocContent(this.$div,this.act.document),this.playing=!0}preInitActivity(){if(!this.act.prevScreen)return;const t=()=>(this.showingPrevScreen=!1,this.$div.off("click"),this.prevScreenTimer&&(window.clearTimeout(this.prevScreenTimer),this.prevScreenTimer=null),this.startActivity(),!0);if(this.showingPrevScreen=!0,this.$div.empty(),this.act.prevScreenText){this.act.prevScreenStyle||(this.act.prevScreenStyle=new be),this.$div.css(this.act.prevScreenStyle.getCSS()).css("overflow","auto");const t=e("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(this.act.prevScreenStyle.getCSS()).append(this.act.prevScreenText);this.$div.append(t)}else this.setDocContent(this.$div,this.act.document);this.enableCounters(!0,!1,!1),this.ps.setCounterValue("time",0),this.ps.setMsg(this.act.messages.previous),this.act.prevScreenMaxTime>0&&(this.ps.setCountDown("time",this.act.prevScreenMaxTime),this.prevScreenTimer=window.setTimeout(t,1e3*this.act.prevScreenMaxTime)),this.$div.on("click",t),this.ps.playMsg()}evaluatePanel(){return this.finishActivity(!0),!0}finishActivity(t){this.$checkButton&&this.$checkButton.prop("disabled",!0),this.targets.forEach(t=>{t.$comboList&&t.$comboList.prop("disabled",!0)}),this.showPopup(null),super.finishActivity(t)}processEvent(t){return this.playing}showPopup(t,e,i){this.$currentPopup&&(this.$currentPopup.css({display:"none"}),this.$currentPopup=null,this.currentPopupTimer&&(window.clearTimeout(this.currentPopupTimer),this.currentPopupTimer=0)),this.popupWaitTimer&&(window.clearTimeout(this.popupWaitTimer),this.popupWaitTimer=0),i?this.popupWaitTimer=window.setTimeout(()=>{this.showPopup(t,e)},1e3*i):t&&(t.css({display:""}),t.trigger("click"),this.$currentPopup=t,e&&(this.currentPopupTimer=window.setTimeout(()=>{t.css({display:"none"}),this.$currentPopup===t&&(this.$currentPopup=null,this.currentPopupTimer=0)},1e3*e)))}}Object.assign(zi.prototype,{targets:null,targetsMarked:!0,$checkButton:null,prevScreenTimer:null,$currentPopup:null,currentPopupTimer:0,popupWaitTimer:0,spanText:!1,spanChars:!1}),Fi.Panel=zi;const Ui=Fi;class Hi extends Fi{constructor(t){super(t)}needsKeyboard(){return!0}}Object.assign(Hi.prototype,{autoJump:!1,forceOkToAdvance:!1});class Ji extends zi{constructor(t,e,i){super(t,e,i)}$createTargetElement(t,i){i.addClass("JClicTextTarget");const s=`target${("000"+(this.targets.length-1)).slice(-3)}`;return t.isList&&t.options&&t.options.length>0?(i=e("<select/>",{id:s,name:s}),""!==t.options[0].trim()&&e("<option selected/>",{value:"",text:""}).appendTo(i),t.options.forEach(t=>e("<option/>",{value:t,text:t}).appendTo(i)),t.$comboList=i.on("focus change",e=>{e.textTarget=t,this.processEvent(e)})):(t.currentText=t.iniText?t.iniText:E(t.iniChar,t.numIniChars),t.$span=i.text(t.currentText).attr({contenteditable:"true",id:s,autocomplete:"off",spellcheck:"false"}).on("focus input blur",e=>{e.textTarget=t,this.processEvent(e)}).on("keydown keyup",e=>{13===e.keyCode&&(e.preventDefault(),"keydown"===e.type&&(e.textTarget=t,e.type="blur",this.processEvent(e)))})),i}evaluatePanel(){let t=0;const e=this.targets.length;return this.targets.forEach(e=>{const i=this.act.ev.evalText(e.readCurrentText(),e.answers),s=this.act.ev.isOk(i);e.targetStatus=s?"SOLVED":"WITH_ERROR",s&&t++,this.markTarget(e,i),this.ps.reportNewAction(this.act,"WRITE",e.currentText,e.getAnswers(),s,t)}),t===e?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}checkTarget(t,e,i){const s=this.act.ev.evalText(t.currentText,t.answers),n=this.act.ev.isOk(s);if(t.targetStatus=n?"SOLVED":"WITH_ERROR",e)return n;this.markTarget(t,s);const r=this.countSolvedTargets(!1,!1);if(t.currentText.length>0&&this.ps.reportNewAction(this.act,"WRITE",t.currentText,t.getAnswers(),n,r),n&&r===this.targets.length)return this.finishActivity(!0),n;if(t.currentText.length>0&&this.playEvent(n?"actionOk":"actionError"),i&&0!==i){let e=t.num+i;e>=this.targets.length?e=0:e<0&&(e=this.targets.length-1);const s=this.targets[e];s.$span?(s.$span.trigger("focus"),ft(s.$span.get(-1),0,0)):s.$comboList&&s.$comboList.trigger("focus")}return n}countSolvedTargets(t,e){return this.targets.reduce((i,s)=>(t&&(s.readCurrentText(),this.checkTarget(s,!e)),"SOLVED"===s.targetStatus?++i:i),0)}markTarget(t,i){if(t.$comboList||this.act.ev.isOk(i))t.checkColors();else if(t.$span){const s=t.currentText,n=[];let r=-1,a=-1,o=0;for(;o<i.length&&o<s.length;o++)i[o]!==r&&(n[++a]="",r=i[o]),n[a]+=s.charAt(o);o<s.length&&(n[a]+=s.substring(o)),t.$span.empty(),r=i[0],n.forEach(i=>{e("<span/>").text(i).css(t.doc.style[0===r?"target":"targetError"].css).appendTo(t.$span),r^=1})}t.flagModified=!1}activityReady(){super.activityReady(),e(".JClicTextTarget").css("white-space","normal"),this.targets.length>0&&this.targets[0].$span&&this.targets[0].$span.trigger("focus")}finishActivity(t){return this.targets.forEach(t=>{t.$span?t.$span.removeAttr("contenteditable").trigger("blur"):t.$comboList&&t.$comboList.prop("disabled",!0).trigger("blur")}),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t))return!1;const e=t.textTarget;let i=null,s=0;switch(t.type){case"focus":e&&(e.$span&&e.$span.children().length>0?(i=e.$span,s=Math.min(e.currentText.length,dt(i.get(-1))),i.empty(),i.text(e.currentText),ft(i.get(-1),s,s),e.flagModified=!0):e.$comboList&&e.$comboList.css(e.doc.style.target.css),e.$popup&&("always"===e.infoMode||"onError"===e.infoMode&&"WITH_ERROR"===e.targetStatus)?this.showPopup(e.$popup,e.popupMaxTime,e.popupDelay):this.showPopup(null));break;case"blur":e.flagModified&&!this.$checkButton&&this.checkTarget(e,!1,1);break;case"input":if(e&&e.$span){i=e.$span;let t=i.html();if(/(<br>|\n|\r)/.test(t))return t=t.replace(/(<br>|\n|\r)/g,""),i.html(t),e.currentText=i.text(),!this.$checkButton&&this.checkTarget(e,!1,1);if(t=i.text(),t!==e.currentText){e.flagModified=!0;const n=t.length-e.currentText.length;if(n>0){if(t.indexOf(e.iniChar)>=0){s=dt(i.get(-1));for(let i=0;i<n;i++){const i=t.indexOf(e.iniChar);if(i<0)break;t=t.substring(0,i)+t.substring(i+1),i<s&&s--}i.text(t),ft(i.get(-1),s,s)}t.length>e.maxLenResp&&(s=dt(i.get(-1)),t=t.substring(0,e.maxLenResp),s=Math.min(s,t.length),i.text(t),ft(i.get(-1),s,s))}else""===t&&(t=e.iniChar,i.text(t),ft(i.get(-1),0,0));e.currentText=t}}break;case"change":if(e&&e.$comboList)return e.currentText=e.$comboList.val(),e.flagModified=!0,!this.$checkButton&&this.checkTarget(e,!1,1)}return!0}}Object.assign(Ji.prototype,{locked:!0}),Hi.Panel=Ji;const Wi=je.registerClass("@text.FillInBlanks",Hi),Gi="source-over";class Ki{constructor(t,e){this.parent=t,this.ctx=e.get(-1).getContext("2d",{willReadFrequently:!0}),this.dim=new xt(this.ctx.canvas.width,this.ctx.canvas.height),this.origin=new Ct,this.dest=new Ct,this.relativePos=new Ct}moveBy(t,e){this.moveTo(Ct(this.dest.x+t,this.dest.y+e))}moveTo(t,e){if(!this.active||!e&&this.dest.equals(t))return;this.bgRect&&(this.bgImg?this.ctx.putImageData(this.bgImg,0,0,this.bgRect.pos.x,this.bgRect.pos.y,this.bgRect.dim.width,this.bgRect.dim.height):this.parent&&this.parent.updateContent()),this.dest.moveTo(t);const i=new Ct(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y);this.bgRect=new St(i,this.bx?this.bx.dim:new xt);const s=new Ct(t.x-this.relativePos.x,t.y-this.relativePos.y);this.bgRect.add(new St(s,this.bx?this.bx.dim:new xt)),this.bgRect.grow(10,10),null!==this.bx?(this.bx.moveTo(new Ct(t.x-this.relativePos.x,t.y-this.relativePos.y)),this.bx.setTemporaryHidden(!1),this.bx.update(this.ctx,null),this.bx.setTemporaryHidden(!0)):(this.drawLine(),this.linePainted=!0)}begin(t,e){this.active&&this.end(),this.origin.moveTo(t),this.dest.moveTo(t),this.linePainted=!1,this.active=!0,e&&(this.bx=e,this.relativePos.moveTo(t.x-e.pos.x,t.y-e.pos.y),this.bx.setFocused(!0),this.bx.setTemporaryHidden(!0),this.linePainted=!1,this.parent.invalidate().update());try{this.bgImg=this.ctx.getImageData(0,0,this.dim.width,this.dim.height)}catch(t){this.bgImg=null}this.bgRect=null,e&&this.moveTo(t,!0)}end(){this.active&&(this.active=!1,this.linePainted=!1,this.bgRect=null,this.bgImg=null,this.bx&&(this.bx.setFocused(!1),this.bx.moveTo(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y),this.bx.setTemporaryHidden(!1),this.bx=null,this.relativePos.moveTo(0,0)),this.ctx.clearRect(0,0,this.dim.width,this.dim.height),this.parent.invalidate().update())}drawLine(){if(this.compositeOp!==Gi?(this.ctx.strokeStyle=this.xorColor,this.ctx.globalCompositeOperation=this.compositeOp):this.ctx.strokeStyle=this.lineColor,this.ctx.lineWidth=this.lineWidth,this.ctx.beginPath(),this.ctx.moveTo(this.origin.x,this.origin.y),this.ctx.lineTo(this.dest.x,this.dest.y),this.ctx.stroke(),this.arrow){const t=Math.atan2(this.origin.x-this.dest.x,this.dest.x-this.origin.x),e=new Ct(this.dest.x-this.arrowLength*Math.cos(t+this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t+this.arrowAngle));this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),e.moveTo(this.dest.x-this.arrowLength*Math.cos(t-this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t-this.arrowAngle)),this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}this.compositeOp!==Gi&&(this.ctx.globalCompositeOperation=Gi)}}Object.assign(Ki.prototype,{bgImg:null,bgRect:null,origin:null,dest:null,arrow:!1,active:!1,linePainted:!1,arrowLength:10,arrowAngle:Math.PI/6,lineColor:"black",xorColor:"white",compositeOp:"difference",DEFAULT_COMPOSITE_OP:Gi,relativePos:null,bx:null,ctx:null,dim:null,parent:null,lineWidth:1.5});const Zi=Ki;class Yi extends Fi{constructor(t){super(t)}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}Object.assign(Yi.prototype,{amongParagraphs:!1,bc:null});class Qi extends zi{constructor(t,e,i){super(t,e,i)}buildVisualComponents(){this.act.document.style.target.css.cursor="pointer",super.buildVisualComponents()}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.act.dragCells||(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0,"pointer-events":"none"}),this.$div.append(this.$canvas),this.bc=new Zi(this,this.$canvas),this.bc.compositeOp=this.bc.DEFAULT_COMPOSITE_OP,this.invalidate().update())}$createTargetElement(t,e){super.$createTargetElement(t,e);const i=`target${("000"+(this.targets.length-1)).slice(-3)}`;return e.addClass("JClicTextTarget").on("click",e=>{e.textTarget=t,e.idLabel=i,this.processEvent(e)}),e}swapTargets(t,i){const s=t.$span,n=i.$span,r=e("<span/>");r.insertAfter(n),n.detach(),n.insertAfter(s),s.detach(),s.insertAfter(r),r.remove();const a=t.pos,o=t.$p;t.pos=i.pos,t.$p=i.$p,i.pos=a,i.$p=o}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents()}startActivity(){if(super.startActivity(),!this.showingPrevScreen){if("orderWords"!==this.act.type||this.act.amongParagraphs)this.shuffleTargets(this.targets,this.act.shuffles);else{const t=[];let e=null,i=[];this.targets.forEach(s=>{null!==e&&e.$p!==s.$p&&(t.push(i),i=[]),i.push(s),e=s}),i.length>0&&t.push(i),t.forEach(t=>this.shuffleTargets(t,this.act.shuffles))}this.playing=!0}this.setBounds(this)}shuffleTargets(t,e){const i=t.length;if(i>1){let s=100;for(let n=0;n<e;n++){const e=Math.floor(Math.random()*i),r=Math.floor(Math.random()*i);e!==r?this.swapTargets(t[e],t[r]):--s&&n++}}}setCurrentTarget(t){const e=this.act.document.getFullStyle("target").css;this.currentTarget&&this.currentTarget.$span&&this.currentTarget.$span.css(e),t&&t.$span&&t.$span.css({color:e["background-color"],"background-color":e.color}),this.currentTarget=t}countSolvedTargets(){return this.targets.filter(t=>{let{num:e,pos:i}=t;return e===i}).length}evaluatePanel(){this.bc&&this.bc.active&&this.bc.end(),this.setCurrentTarget(null);let t=0;return this.targets.forEach(e=>{const i=e.num===e.pos;e.targetStatus=i?"SOLVED":"WITH_ERROR",i&&t++,e.checkColors(),this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,i,t)}),t===this.targets.length?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}finishActivity(t){return e(".JClicTextTarget").css("cursor","pointer"),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t))return!1;const e=t.textTarget;let i=null;if(this.bc&&this.playing&&!this.showingPrevScreen){if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Ct;else{const e=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Ct(e-this.$div.offset().left,s-this.$div.offset().top)}switch(t.type){case"click":if(e&&e!==this.currentTarget)if(this.currentTarget){if(this.bc&&this.bc.active&&this.bc.end(),this.swapTargets(e,this.currentTarget),this.setCurrentTarget(null),!this.$checkButton){const t=this.countSolvedTargets(),i=e.pos===e.num;this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,i,t),i&&t===this.targets.length?this.finishActivity(!0):this.playEvent(i?"actionOk":"actionError")}}else this.setCurrentTarget(e),this.bc.begin(i),this.playEvent("click");break;case"mousemove":this.bc.moveTo(i)}return t.preventDefault(),!0}}}Object.assign(Qi.prototype,{currentTarget:null,bc:null,events:["click","mousemove"]}),Yi.Panel=Qi;const Xi=je.registerClass("@text.Order",Yi);class ts extends Fi{constructor(t){super(t)}}ts.Panel=class extends zi{constructor(t,e,i){super(t,e,i)}$createTargetElement(t,e){return null}startActivity(){super.startActivity(),this.$div.find(".JClicTextDocument").attr("contenteditable","true").attr("spellcheck","false")}evaluatePanel(){const t=this.$div.find(".JClicTextDocument").text().trim(),e=this.act.document.getRawText(),i=this.act.ev.checkText(t,e);return this.ps.reportNewAction(this.act,"WRITE",t,e,i,this.targets.length),i?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}finishActivity(t){return this.$div.find(".JClicTextDocument").attr("contenteditable","false"),super.finishActivity(t)}};const es=je.registerClass("@text.Complete",ts);class is extends Fi{constructor(t){super(t)}}class ss extends zi{constructor(t,e,i){super(t,e,i),this.spanText=!0,this.spanChars="identifyChars"===t.type,this.spansChecked=new Set}$createTargetElement(t,e){super.$createTargetElement(t,e);const i=`target${("000"+(this.targets.length-1)).slice(-3)}`;return e.on("click",e=>{e.textTarget=t,e.idLabel=i,this.processEvent(e)}),e}$createSpanElement(t){return t.on("click",e=>{e.$spanElement=t,this.processEvent(e)}),t}initActivity(){super.initActivity(this),this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),this.$div.find(".JClicTextDocument > span").css("cursor","pointer"),this.spansChecked.forEach(t=>t.css(t.initialCSS||this.act.document.style.default.css)),this.spansChecked.clear(),this.playing=!0}countSolvedTargets(){return this.targets.filter(t=>{let{targetStatus:e}=t;return"SOLVED"===e}).length}evaluatePanel(){let t=0;return this.targets.forEach(e=>{const i="SOLVED"===e.targetStatus;i&&t++,e.checkColors(),this.ps.reportNewAction(this.act,"SELECT",e.text,e.pos,i,t)}),t===this.targets.length&&0===this.spansChecked.size?(this.finishActivity(!0),!0):(this.spansChecked.forEach(t=>t.css(this.act.document.style.targetError.css)),this.playEvent("finishedError"),!1)}finishActivity(t){return this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t)||t.timeStamp===this.lastTimeStamp)return!1;t.timeStamp&&(this.lastTimeStamp=t.timeStamp);const e=t.textTarget,i=t.$spanElement;if("click"===t.type){let s,n,r=!1;if(e?("SOLVED"===e.targetStatus?e.targetStatus="HIDDEN":(e.targetStatus="SOLVED",r=!0),s=e.text,n=e.pos,e.checkColors()):(i?(i.checked=!i.checked,i.checked?(this.spansChecked.add(i),i.css(this.act.document.style.target.css)):(this.spansChecked.delete(i),i.css(i.initialCSS||this.act.document.style.default.css)),s=i.text()):s="unknown",n=0),!this.$checkButton){const t=this.countSolvedTargets();this.ps.reportNewAction(this.act,"SELECT",s,n,r,t),r&&0===this.spansChecked.size&&t===this.targets.length?this.finishActivity(!0):this.playEvent(r?"actionOk":"actionError")}t.preventDefault()}return!0}}Object.assign(ss.prototype,{targetsMarked:!1,lastTimeStamp:0,spansChecked:new Set}),is.Panel=ss;const ns=je.registerClass("@text.Identify",is);class rs extends ci{constructor(t,e,i){super(t,e,i),this.preferredBounds=new St,this.cells=[]}static layoutSingle(t,e,i){if(!e)return t;let s=e.getPreferredSize(),n=e.getMinimumSize(),r=t;r.width-=2*i,r.height-=2*i,(n.width>r.width||n.height>r.height)&&(r=n);let a=s.width>r.width?r.width/s.width:1;return a*s.height>r.height&&(a=r.height/s.height),s=e.getScaledSize(a),e.setBounds(i,i,s.width,s.height),s.width+=2*i,s.height+=2*i,s}static layoutDouble(t,e,i,s,n){let r=!1,a=1,o=1;switch(s){case"AB":case"BA":a=2,o=1,r=!0;break;case"AUB":case"BUA":a=1,o=2,r=!1}const l=e.getBounds(),c=i.getBounds();let h=e.getPreferredSize(),u=i.getPreferredSize();const d=new xt(r?h.width+u.width:Math.max(h.width,u.width),r?Math.max(h.height,u.height):h.height+u.height),p=e.getMinimumSize(),f=i.getMinimumSize(),g=new xt(r?p.width+f.width:Math.max(p.width,f.width),r?Math.max(p.height,f.height):p.height+f.height),m=t;m.width-=(1+a)*n,m.height-=(1+o)*n,(g.width>m.width||g.height>m.height)&&m.setDimension(g);let v=d.width>m.width?m.width/d.width:1;v*d.height>m.height&&(v=m.height/d.height),h=e.getScaledSize(v),u=i.getScaledSize(v);let b=u.width>h.width?(u.width-h.width)/2:0,y=h.width>u.width?(h.width-u.width)/2:0,w=u.height>h.height?(u.height-h.height)/2:0,A=h.height>u.height?(h.height-u.height)/2:0;switch(s){case"AB":e.setBounds(n,n+w,h.width,h.height),i.setBounds(2*n+h.width,n+A,u.width,u.height);break;case"BA":i.setBounds(n,n+A,u.width,u.height),e.setBounds(2*n+u.width,n+w,h.width,h.height);break;case"AUB":e.setBounds(n+b,n,h.width,h.height),i.setBounds(n+y,2*n+h.height,u.width,u.height);break;case"BUA":i.setBounds(n+y,n,u.width,u.height),e.setBounds(n+b,2*n+u.height,h.width,h.height);break;default:e.setBounds(Math.round(n+v*l.pos.x),Math.round(n+v*l.pos.y),h.width,h.height),i.setBounds(Math.round(n+v*c.pos.x),Math.round(n+v*c.pos.y),h.width,h.height)}const C=new St(e.getBounds());return C.add(i.getBounds()),d.width=C.dim.width+2*n,d.height=C.dim.height+2*n,d}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){const t=this.getPreferredSize();return new xt(Math.max(gt.MIN_CELL_SIZE,t.width),Math.max(gt.MIN_CELL_SIZE,t.height))}getScaledSize(t){const e=this.getPreferredSize();return new xt(Math.round(t*e.width),Math.round(t*e.height))}addBox(t){this.cells.push(t),t.setParent(this),1===this.cells.length?St.prototype.setBounds.call(this,t):this.add(t),this.preferredBounds.setBounds(this.getBounds())}boxIndex(t){return null===t?-1:this.cells.indexOf(t)}getBox(t){return t<0||t>=this.cells.length?null:this.cells[t]}getBackgroundBox(){return this.backgroundBox}setBackgroundBox(t){this.backgroundBox=t,null!==t&&(t.setParent(this),t.isBackground=!0),St.prototype.add.call(this,t),this.preferredBounds.setBounds(this.getBounds())}recalcSize(){let t=this.backgroundBox?new St(this.backgroundBox.pos,this.backgroundBox.dim):null;this.cells.forEach(e=>{t?t.add(e):t=new St(e.pos,e.dim)}),t||(t=new St(this.pos.x,this.pos.y,0,0)),this.preferredBounds.setRect(t),this.x=t.pos.x,this.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height}getNumCells(){return this.cells.length}setCellAttr(t,e){this.cells.forEach(i=>i[t]=e),this.backgroundBox&&(this.backgroundBox[t]=e)}setBorder(t){this.cells.forEach(e=>e.setBorder(t))}setVisible(t){this.cells.forEach(e=>e.setVisible(t))}setAlternative(t){super.setAlternative(t),this.cells.forEach(e=>e.setAlternative(t))}setBounds(t,e,i,s){if("number"==typeof t&&(t=new St(t,e,i,s)),t.getSurface()>0&&!t.equals(this)){const e=t.dim.width/this.dim.width,i=t.dim.height/this.dim.height,s=t.pos.x-this.pos.x,n=t.pos.y-this.pos.y;if(this.cells.forEach(t=>{const r=new Ct(t.pos.x-this.pos.x,t.pos.y-this.pos.y);t.setBounds(s+this.pos.x+e*r.x,n+this.pos.y+i*r.y,e*t.dim.width,i*t.dim.height),t.pos0=null}),null!==this.backgroundBox){const t=this.backgroundBox,r=new Ct(t.pos.x-this.pos.x,t.pos.y-this.pos.y);t.setBounds(s+this.pos.x+e*r.x,n+this.pos.y+i*r.y,e*t.dim.width,i*t.dim.height)}}super.setBounds(t)}update(t,e){return!(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())&&(!(e&&!this.intersects(e))&&(null!==this.backgroundBox&&this.backgroundBox.update(t,e),this.cells.forEach(i=>{i.isMarked()||i.update(t,e)}),this.cells.forEach(i=>{i.isMarked()&&i.update(t,e)}),!0))}findBox(t){let e=null;for(let i=this.cells.length-1;i>=0;i--){const s=this.getBox(i);if(s.isVisible()&&s.contains(t)){e=s;break}}return e}countInactiveCells(){return this.cells.reduce((t,e)=>e.isInactive()?++t:t,0)}}Object.assign(rs.prototype,{cells:[],preferredBounds:new St,backgroundBox:null});const as=rs;class os extends as{constructor(t,e,i){super(t,e,i)}addActiveBox(t){return t.idLoc=this.cells.length,t.idOrder=t.idLoc,this.addBox(t)}getActiveBox(t){return this.getBox(t)}getBackgroundActiveBox(){return this.getBackgroundBox()}setContent(t,e,i,s,n){i||(i=0),s||(s=0),n||(n=this.cells.length);for(let r=0;r<n;r++){const n=this.getActiveBox(s+r);n.setContent(t,i+r),n.setAlternative(!1),e&&n.setAltContent(e,i+r)}if(null!==t.backgroundContent&&null!==this.getBackgroundActiveBox()){const e=this.getBackgroundActiveBox();e.setContent(t.backgroundContent),t.style!==e.boxBase&&e.setBoxBase(t.style)}}findActiveBox(t){return this.findBox(t)}clearAllBoxes(){this.cells.forEach(t=>t.clear())}clearAll(){this.clearAllBoxes(),null!==this.backgroundBox&&this.getBackgroundActiveBox().clear()}countCellsAtPlace(){return this.cells.reduce((t,e)=>e.isAtPlace()?++t:t,0)}getActiveBoxWithIdLoc(t){return this.cells.find(e=>e.idLoc===t)||null}cellIsAtEquivalentPlace(t,e){return t.isAtPlace()||t.isEquivalent(this.getActiveBoxWithIdLoc(t.idOrder),e)}countCellsAtEquivalentPlace(t){return this.cells.reduce((e,i)=>this.cellIsAtEquivalentPlace(i,t)?++e:e,0)}countCellsWithIdAss(t){return this.cells.reduce((e,i)=>i.idAss===t?++e:e,0)}setDefaultIdAss(){this.cells.map(t=>t.setDefaultIdAss())}shuffleCells(t,e){let i=this.cells.length;if(i>=2){const s=[],n=[],r=new Ct;for(let t=0;t<i;t++){const e=this.getActiveBox(t);s[t]=new Ct(e.pos),n[t]=e.idLoc}for(let e=0;e<t;e++){const t=Math.floor(Math.random()*i),e=Math.floor(Math.random()*i);if(t!==e){r.moveTo(s[t]),s[t].moveTo(s[e]),s[e].moveTo(r);const i=n[t];n[t]=n[e],n[e]=i}}for(let t=0;t<i;t++){const i=this.getActiveBox(t),r=s[t].x,a=s[t].y;i.moveTo(new Ct(r,a)),e&&this.fitCellsInArea([i]),i.idLoc=n[t]}}}fitCellsInArea(t){const e=this.pos.x+this.dim.width,i=this.pos.y+this.dim.height;t.forEach(t=>{t.pos0||(t.pos0=new Ct(t.pos));const s=Math.min(Math.max(t.pos.x,this.pos.x),e-t.dim.width),n=Math.min(Math.max(t.pos.y,this.pos.y),i-t.dim.height);s===t.pos.x&&n===t.pos.y||t.moveTo(new Ct(s,n))})}swapCellPositions(t,e,i){const s=new Ct(e.pos),n=e.pos0,r=e.idLoc;e.moveTo(t.pos0||t.pos),e.pos0=t.pos0,e.idLoc=t.idLoc,t.moveTo(n||s),t.pos0=n,t.idLoc=r,i&&this.fitCellsInArea([t,e])}resetIds(){this.cells.forEach((t,e)=>{t&&(t.idOrder=e,t.idAss=e,t.idLoc=e)})}getNextItem(t,e){const i=-12345;e||(e=i);let s=t+1;for(;s<this.cells.length;s++){const t=this.cells[s];if(!t)break;if(e!==i){if(e===t.idAss)break}else if(t.idAss>=0)break}return s}buildAccessibleElements(t,i,s){return this.$accessibleDiv=""!==this.accessibleText?e("<div/>",{"aria-label":this.accessibleText,tabindex:0}):null,t.append(this.$accessibleDiv),this.cells.map(t=>t).sort((t,e)=>t.idLoc>e.idLoc?1:-1).forEach(e=>e.buildAccessibleElement(t,i,this.$accessibleDiv,s)),this.$accessibleDiv}}Object.assign(os.prototype,{$accessibleDiv:null});const ls=os;class cs extends ls{constructor(t,e,i,s,n,r,a,o){super(t,e,i),this.nCols=o.nCols,this.nRows=o.nRows;const l=new St(new Ct(s,n),new xt(Math.round(r/this.nCols)*this.nCols,Math.round(a/this.nRows)*this.nRows));for(let t=0;t<o.nCells;t++){const s=o.getShape(t,l),n=new ui(this,e,i,t,s.getBounds());o.rectangularShapes||n.setShape(s),this.addActiveBox(n)}if(o.hasRemainder){const t=o.getRemainderShape(l),s=new ui(this,e,i,0,t.getBounds());s.setShape(t),this.setBackgroundBox(s)}}static createEmptyGrid(t,e,i,s,n,r,a){const o=n?new cs(t,e,a||n.style,i,s,n.getTotalWidth(),n.getTotalHeight(),r||n.getShaper()):null;return o&&o.setBorder(n.border),o}getMinimumSize(){return new xt(gt.MIN_CELL_SIZE*this.nCols,gt.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new xt(J(t*this.preferredBounds.dim.width,this.nCols),J(t*this.preferredBounds.dim.height,this.nRows))}getCoord(t){return new Ct(t.idLoc%this.nCols,Math.floor(t.idLoc/this.nCols))}getCoordDist(t,e){const i=this.getCoord(t),s=this.getCoord(e);return new Ct(s.x-i.x,s.y-i.y)}}Object.assign(cs.prototype,{nCols:1,nRows:1});const hs=cs;class us extends Ve{constructor(t){super(t)}setProperties(t){super.setProperties(t),this.abc.primary.avoidAllIdsNull(this.abc.answers.getNumCells())}getMinNumActions(){return this.invAss?this.abc.answers.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}hasRandom(){return!0}needsKeyboard(){return!0}helpSolutionAllowed(){return!0}}Object.assign(us.prototype,{nonAssignedCells:0,useIdAss:!0});class ds extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.answers,s=this.act.abc.solvedPrimary;if(t&&i){if(this.act.invAss&&(this.invAssCheck=Array(i.getNumCells()).fill(!1)),t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e("<span/>").css({"background-image":"url("+t.animatedGifFile+")","background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),s&&s.image&&s.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const e=[t,i];s&&e.push(s),this.act.acp.generateContent(t.nch,t.ncw,e,!1)}this.bgA=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);let r=i.w;"AUB"!==this.act.boxGridPos&&"BUA"!==this.act.boxGridPos||(r=t.getTotalWidth()),this.bgB=new hs(null,this,i.style,this.act.margin,this.act.margin,r,i.h,new _i(1,1)),this.$form=e("<form/>",{id:"form1"}),this.$form[0].addEventListener("submit",t=>(t.preventDefault(),this.playing&&this.setCurrentCell(this.currentCell),!1)),this.$textField=e("<input/>",{type:"text",size:200}).css(i.style.getCSS()).css({position:"absolute",top:0,left:0,border:0,padding:0,margin:0,"text-align":"center"}).attr({autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.$div.append(this.$form.append(this.$textField)),this.bgA.setContent(t,s||null),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.act.nonAssignedCells=0;for(let t=0;t<this.bgA.getNumCells();t++){var n=this.bgA.getActiveBox(t);-1===n.idAss&&(this.act.nonAssignedCells++,n.switchToAlt(this.ps))}this.bgA.setVisible(!0),this.bgB.setVisible(!1)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}activityReady(){super.activityReady(),this.setCurrentCell(0)}updateContent(t){if(super.updateContent(t),this.bgA&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?as.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){const s=t.clone();if("AUB"===this.act.boxGridPos?s.height-=this.bgB.pos.y+this.act.margin/2:"AB"===this.act.boxGridPos&&(s.width-=this.bgB.pos.x+this.act.margin/2),this.$canvas=e('<canvas width="'+s.dim.width+'" height="'+s.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.bgA&&this.$animatedBg){var i=this.bgA.getBounds();this.$animatedBg.css({left:i.pos.x,top:i.pos.y,width:i.dim.width+"px",height:i.dim.height+"px","background-size":i.dim.width+"px "+i.dim.height+"px"}),this.$canvas.insertAfter(this.$animatedBg)}else this.$div.prepend(this.$canvas);this.$textField&&this.$textField.css({top:this.bgB.pos.y,left:this.bgB.pos.x,width:this.bgB.dim.width,height:this.bgB.dim.height,zIndex:9}),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"click"))}checkInvAss(){return this.act.invAss&&this.invAssCheck&&this.invAssCheck.every(t=>t)}setCurrentCell(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.playing)return;let i=null,s=!1;if(-1!==this.currentCell){let t=!1;if(i=this.bgA?this.bgA.getActiveBoxWithIdLoc(this.currentCell):null,i){i.setMarked(!1);const n=i.getDescription(),r=i.idAss,a=r>=0?this.act.abc.answers.getActiveBoxContent(r).text:"",o=this.$textField.val().trim();if(G(o,a,!1,this.act.numericContent)){t=!0,i.idAss=-1;const n=a.indexOf("|");n>=0&&this.$textField.val(a.substring(0,n)),this.act.abc.solvedPrimary?(i.switchToAlt(this.ps),s=i.playMedia(this.ps,e)):i.clear(),this.act.invAss&&r>=0&&r<this.invAssCheck.length&&(this.invAssCheck[r]=!0),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem))}const l=this.bgA.countCellsWithIdAss(-1);if(o.length>0&&this.ps.reportNewAction(this.act,"WRITE",n,o,t,l),t&&(this.checkInvAss()||l===this.bgA.getNumCells()))return this.finishActivity(!0),this.$textField.prop("disabled",!0),void this.invalidate().update();!s&&o.length>0&&this.playEvent(t?"actionOk":"actionError")}}if(i=this.bgA?this.act.useOrder?this.bgA.getBox(this.currentItem):this.bgA.getActiveBoxWithIdLoc(t):null,this.bgA&&(!i||-1===i.idAss)){for(var n=0;n<this.bgA.getNumCells()&&(i=this.bgA.getActiveBoxWithIdLoc(n),-1===i.idAss);n++);if(i&&-1===i.idAss)return this.finishActivity(!1),this.$textField.prop("disabled",!0),void this.invalidate().update()}i&&this.bgA&&this.bgA.getNumCells()>1&&i.setMarked(!0),i&&(this.currentCell=i.idLoc),this.$textField.val(""),this.$textField.trigger("focus"),this.invalidate().update(),i&&i.playMedia(this.ps,e)}processEvent(t){if(this.playing){const e=[];switch(t.type){case"click":t.preventDefault(),this.ps.stopMedia(1);const i=new Ct(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);if(this.bgB.contains(i)){this.$textField.trigger("focus");break}const s=this.bgA?this.bgA.findActiveBox(i):null;s&&!s.isInactive()&&(s.getContent()&&null===s.getContent().mediaContent&&this.playEvent("CLICK"),this.setCurrentCell(s.idLoc,e));break;case"change":t.preventDefault(),this.setCurrentCell(this.currentCell,e)}return e.forEach(t=>t()),!1}}}Object.assign(ds.prototype,{$textField:null,invAssCheck:null,bgA:null,bgB:null,currentCell:-1,events:["click","change"]}),us.Panel=ds;const ps=Ve.registerClass("@text.WrittenAnswer",us);class fs extends Ve{constructor(t){super(t),this.includeInReports=!1,this.reportActions=!1}}class gs extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),t.animatedGifFile&&!t.shaper.rectangularShapes&&(this.$animatedBg=e("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return this.getBounds().equals(t)?t:as.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg){if(this.$canvas=e('<canvas width="'+t.dim.width+'" height="'+t.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bg.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout(()=>this.bg?this.bg.buildAccessibleElements(this.$canvas,this.$div):null,0)}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new Ct(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];this.ps.stopMedia(1);const s=this.bg.findActiveBox(e);s&&(s.playMedia(this.ps,i)||this.playEvent("click")),i.forEach(t=>t()),t.preventDefault()}}}Object.assign(gs.prototype,{bg:null,events:["click"]}),fs.Panel=gs;const ms=Ve.registerClass("@panels.InformationScreen",fs);class vs extends Ve{constructor(t){super(t)}getMinNumActions(){return this.cellsToMatch}hasRandom(){return!0}}Object.assign(vs.prototype,{nonAssignedCells:0,cellsToMatch:1});class bs extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.solvedPrimary;if(t){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i&&i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const e=[t];i&&(e.push(null),e.push(i)),this.act.acp.generateContent(t.nch,t.ncw,e,!1)}this.bg=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t,i||null),this.bg.setAlternative(!1),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setDefaultIdAss(),this.act.nonAssignedCells=0,this.act.cellsToMatch=0;const s=this.bg.getNumCells();for(let t=0;t<s;t++){const e=this.bg.getActiveBox(t),i=e.idAss;1===i?this.act.cellsToMatch++:-1===i&&(this.act.nonAssignedCells++,e.switchToAlt(this.ps))}this.bg.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.act.shuffleA&&this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return super.updateContent(t)}setDimension(t){return this.getBounds().equals(t)?t:as.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg){if(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bg.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout(()=>this.bg?this.bg.buildAccessibleElements(this.$canvas,this.$div):null,0)}}buildAccessibleComponents(){this.bg&&this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new Ct(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);let i=!1;const s=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bg?this.bg.findActiveBox(e):null;if(t)if(-1!==t.idAss){let e=!1;const n=t.getDescription();i=i||t.playMedia(this.ps,s),1!==t.idAss||this.act.useOrder&&t.idOrder!==this.currentItem||(e=!0,t.idAss=-1,t.switchToAlt(this.ps)?i=i||t.playMedia(this.ps,s):t.clear(),this.act.useOrder&&(this.currentItem=this.bg.getNextItem(this.currentItem,1)));const r=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"SELECT",n,null,e,r-this.act.nonAssignedCells),e&&r===this.act.cellsToMatch+this.act.nonAssignedCells?this.finishActivity(!0):i||this.playEvent(e?"actionOk":"actionError"),this.update()}else this.playEvent("actionError")}s.forEach(t=>t()),t.preventDefault()}}}Object.assign(bs.prototype,{bg:null,events:["click"]}),vs.Panel=bs;const ys=Ve.registerClass("@panels.Identify",vs);class ws extends Ve{constructor(t){super(t)}mustPauseSequence(){return!0}getMinNumActions(){return 0}hasRandom(){return!0}}class As extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.secondary;if(t&&i){t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t,i],!1),this.bgA=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);const s="AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?t.getTotalWidth():i.w;this.bgB=new hs(null,this,i.style,this.act.margin,this.act.margin,s,i.h,new _i(1,1)),this.bgA.setContent(t),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.getActiveBox(0).setInactive(!1),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?as.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){if(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bgA.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new Ct(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bgA.findActiveBox(e);if(t){const e=this.bgB.getActiveBox(0);if(-1===t.idAss||this.act.useOrder&&t.idOrder!==this.currentItem)e.clear(),e.setInactive(!1);else if(e.setContent(this.act.abc.secondary,t.idAss),e.playMedia(this.ps,i)||t.playMedia(this.ps,i)||this.playEvent("CLICK"),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)),this.ps.reportNewAction(this.act,"SELECT",t.getDescription(),e.getDescription(),!0,0),0===t.idAss&&1===this.bgA.getNumCells()){const t=this.act.project.activitySequence,e=t.getCurrentAct();e&&t.hasNextAct(!0)&&e.delay>0&&"both"!==t.getNavButtonsFlag()&&"fwd"!==t.getNavButtonsFlag()&&this.finishActivity(!0)}this.update()}}i.forEach(t=>t()),t.preventDefault()}}}Object.assign(As.prototype,{bgA:null,bgB:null,events:["click"]}),ws.Panel=As;const Cs=Ve.registerClass("@panels.Explore",ws);class xs extends Ve{constructor(t){super(t),this.menuElements=[],this.includeInReports=!1,this.reportActions=!1}}class ks extends qe{constructor(t,e,i){super(t,e,i),e.lastProjectSkin=null}buildVisualComponents(){this.firstRun&&super.buildVisualComponents();const t=e("<div/>").css({width:"100%","max-height":"100%",position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex","flex-wrap":"wrap","overflow-y":"auto","place-content":"center","overflow-y":"auto"});this.act.menuElements.forEach(i=>{const s=i.description||i.caption||"JClic",n=e("<button/>",{class:"StockBtn",title:s,"aria-label":s}).css({"min-width":"80px","max-width":"200px","min-height":"80px",margin:"4px",padding:"4px",display:"flex","flex-direction":"column","justify-content":"center","align-items":"center"}),r=ks.icons[i.icon||"@ico00.png"],a=e("<img/>",{src:r||""}).css({"max-width":"180px","max-height":"100px",margin:"4px"});if(!r){this.act.project.mediaBag.getElement(i.icon,!0).getFullPathPromise().then(t=>a.attr("src",t))}n.append(a),n.append(e("<span/>").css({"max-width":"180px",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}).html(i.caption)),n[0].addEventListener("click",t=>{const e=new Ht(i.projectPath?"RUN_CLIC_PACKAGE":"RUN_CLIC_ACTIVITY",i.sequence);i.projectPath&&(e.externalParam=i.projectPath),m("info",`Launching ${i.projectPath||""} ${i.sequence||""}`),this.ps.playMedia(e),t.preventDefault()}),t.append(n)}),this.$div.empty().append(t)}setDimension(t){return t}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.setAndPlayMsg("initial","start"),this.playing=!0}}ks.icons={"@ico00.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAB1UExURUxpcZVZAGyAAGyAAJVZAJVZAJVZAIhmAJVZAJVZAJVZAIhmAGyAAGyAAGyAAGyAAGyAAJVZAJVZAGyAAJVZANj+AP+ZAMFzAPWSALVsANyEAM57AJ66AOiLALXVAM3xAK1nAI6oAIabAJWwAMTnAKFgAGyAAIlz9xYAAAAVdFJOUwB9oCIiZpkRRKq7M4BVu9VmVd1EzJvdA7gAAAE0SURBVDjLjZPZkoMgEEVFFsHdZBQR3M38/ycOKQ1gJKnpV051nwtNEPyrsjBNom9AqNSapxn8CBRjXY+DmjXkbQSXeq9tWJe7ByhVberXqzCY8yGM6GVK9FQ4SpVUxAwnJ+A+2wkLBLLppYgJRgZIrcJYBKxvdLUdFzE4mHBzFNDUvKoVdFfI7YQ1q7gD7LowXNRwaM4R6AzQEXNRWZrPT2jLA9YaQOIXQHV0WIbFvKZImPNGmLCMCwY0lJQQS6vAzEXFjY7Of5iORXwKySHe8+kWWwVeGQUnmW3QTMgDONUbhQ+ABAZwozkTqH1Ox8za3Jz3drLZDMABquuM9nFaKXZpwfFpp+j0ZiHJ21pifiIkQ++Lix+9nc+Z5/tQwrt2fxEBvN8vooQJLgTDX74xSi6z/wAoQC7hWsslMgAAAABJRU5ErkJggg==","@ico01.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAByUExURUxpcfzZt/rfw/pycvrcv/3UrJqf/QAAAP/hxPvOov9sbPqFhYmN/f7nz3V4+/3ky/+AgPrIl11g/P/Klf+Kiv9XV//q1vtHR/rCim1w//pcXISI//tfX5WY/VNT///Dh/86OvwhISUl/js7+klM+vq6e8H/VfEAAAABdFJOUwBA5thmAAABGElEQVQ4y62T23aCMBBFiU48iQlELoJW7b3//4udBIi0MqsvDU+w95yEGSiK/15YrlVhd1+C8Nk05+ribzcvCJlXklBV3u/8pToLAnMk3kiCh0Hkz4LA/NSC+YcgANTWYP4OqVGmtmAuC2St2Mn4EMbq9TaPvABpDborD+OB0QqG8hbo3HTNAikFCtEZBTcMx+t+ewC2U4IyMAFUTgVd5nukHYlrqYcxSBlw15k/gTlXx/ySPT5NLOkyP7IQq0PoOd/wSZLgmLtD5AMLsS70ZbnZEL+LTQmZv6aEQIkrpTUlwWX+FhNCyNzaOiVkHgXODyHzFr87ye/3g+NxGrTgJ6zNa8nXJ04zf4Ew88ylr8KM/At//sB88w0/sBcK3bRRzgAAAABJRU5ErkJggg==","@ico02.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUxpcQAAAP///8zMzJmZmfrdwP/hxPvOov3UrP3JlvzZt/zlzf/p0/zBh/rDjUN28cYAAAABdFJOUwBA5thmAAAAyklEQVQ4y6WT6w6DIAxG/YS2XHTv/7grLshF0C1r+KE5n6fFpMvybQHt6bldbXfQcazNsTD4MdCV+S+AQcBUBYa5M4BfHrcB8oNA08HLg0EeAiwOuGtBzoE0Mje4AO4S7QwhgDhlZrcISiNoqxzFoGbSb5Uyozhs4ckdD4M+OfQtUmeKcUsGnaQEyoSp/6YJIr2LXAPqp4OH4BzJtUXyZy7iBwbl8eSDALUc/Z/Sv1DxHfVm5ao5hjtIme+YbOnJMdlj/vCJoB5HX97wIgms7CtjdwAAAABJRU5ErkJggg==","@ico03.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAwUExURUxpcQAAAPrdwP/hxP7mz/8AAAAAmfvOov3UrAAA//3JlvzZtwCZAP8A//zCifq6e7UN6GsAAAABdFJOUwBA5thmAAABA0lEQVQ4y5WS2RbDIAhEHdyTJv3/vy2osVj1oR6zeYcBDcb8NV6v9fp1NV7mgq8cMs/cDWYHhrmomsM1pcj9pgS7FL3IZ6AI8nazsCiCnPOG3wf0QpArfDnoGATC6mwc9oi/AtMFgAFFLQhDCuZcQ0yAMghB+cuNUgJpSVM1zg7phGUFpv3VFdB5gqxolpwdTqYO5EaPJ57PgWOZWgvt0bl4u+LAbwmzv0Q7JxquJM2FSpwTBRHvRU7Mey/E16f4FwfeSkpUBD26CIQ+PMajODTmaw0Dr7/V1zRVQCNvAvNw6QbFb5iWwvRaWKE4Vh3H/6LxG+ueROfYdXXlb+zavg/++ADYLwfSmmk9oQAAAABJRU5ErkJggg==","@icofolder.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUxpcffvhP///2VlZczMZv//zPf39+/nc8zMzDMzmZmZZrW1tbWttcl3sA0AAAABdFJOUwBA5thmAAAAgklEQVQ4y9WSQQ6AIAwEsVtFwf+/14JGbcHeTHSuO9kFQggfBE8BFwLR+mBwFGYSZvh53zjzZTdkLTXCkS/ViDHBCLe8Gla48qpkGEHl+8pdYJo0yOouPA2GhLLiCCyC28DIcAXZ0IfsVKS3BTGUMDas0E9NfkO/ovmQBv2v0BJ+xAaYuQX2hCJNtwAAAABJRU5ErkJggg=="},xs.Panel=ks;const Ss=Ve.registerClass("@panels.Menu",xs);class Ts extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Es extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;if(t){t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bgA=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgA.setContent(t),this.bgA.accessibleText=f("source"),this.bgB.accessibleText=f("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0);const e=this.bgA.getBackgroundActiveBox(),i=this.bgB.getBackgroundActiveBox();e&&i&&i.exchangeContent(e)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?as.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),(this.bgA||this.bgB)&&(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Zi(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&(this.bgB.setCellAttr("accessibleAlwaysActive",!0),this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown")))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;const n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new Ct;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new Ct(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bgA.findActiveBox(this.bc.origin),i=this.bgB.findActiveBox(s),this.bc.end(),e&&i&&i.isInactive()){let t=!1;const s=`${e.getDescription()} (${e.idOrder})`,n=`(${i.idOrder})`,r=this.act.abc.primary.getActiveBoxContent(i.idOrder);e.getContent().isEquivalent(r,!0)&&(t=!0,e.exchangeContent(i),e.setVisible(!1),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));const a=this.bgA.countInactiveCells();this.ps.reportNewAction(this.act,"PLACE",s,n,t,a),t&&a===this.bgA.getNumCells()?this.finishActivity(!0):this.playEvent(t?"actionOk":"actionError")}this.update(),this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.trigger("focus")}else{if(r)break;this.ps.stopMedia(1),e=this.bgA.findActiveBox(s),!e||e.isInactive()||this.act.useOrder&&e.idOrder!==this.currentItem||(this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s),e.playMedia(this.ps,n)||this.playEvent("click"),this.bgB.$accessibleDiv&&this.bgB.$accessibleDiv.trigger("focus"))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach(t=>t()),t.preventDefault()}}}Object.assign(Es.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Ts.Panel=Es;const Ps=Ve.registerClass("@puzzles.DoublePuzzle",Ts);class Is extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Bs extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return!this.bg||this.getBounds().equals(t)?t:as.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Zi(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;const n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new Ct;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new Ct(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg.findActiveBox(this.bc.origin),this.bc.end(),i=this.bg.findActiveBox(s),e&&i){const t=`${e.getDescription()} (${e.idOrder})`,s=`(${i.idLoc})`;let n=e.idOrder===i.idLoc;this.bg.swapCellPositions(e,i,!0);const r=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"PLACE",t,s,n,r),n&&r===this.bg.getNumCells()?this.finishActivity(!0):this.playEvent(n?"actionOk":"actionError")}this.update()}else{if(r)break;this.ps.stopMedia(1),e=this.bg.findActiveBox(s),e&&(this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s),e.playMedia(this.ps,n)||this.playEvent("click"))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach(t=>t()),t.preventDefault()}}}Object.assign(Bs.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Is.Panel=Bs;const _s=Ve.registerClass("@puzzles.ExchangePuzzle",Is);class Rs extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Os extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null),this.parkBg&&(this.parkBg.end(),this.parkBg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0),this.hiddenBoxIndex=Math.floor(Math.random()*this.bg.getNumCells()),this.hiddenBox=this.bg.getActiveBox(this.hiddenBoxIndex),this.hiddenBox.setVisible(!1),this.parkBg=new hs(null,this,t.style,this.act.margin,this.act.margin,this.hiddenBox.dim.width,this.hiddenBox.dim.height,new _i(1,1)),this.parkBg.setContent(t,null,this.hiddenBoxIndex,0,1),this.parkBg.setBorder(this.bg.hasBorder()),this.parkBg.setVisible(!0))}initActivity(){if(super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg){this.act.shuffles%2!=1&&this.act.shuffles++;for(var t=0;t<this.act.shuffles;t++){const t=this.bg.getCoord(this.hiddenBox),i=0===Math.floor(2*Math.random())?1:-1;0===Math.floor(2*Math.random())?(t.x+=i,(t.x<0||t.x>=this.bg.nCols)&&(t.x-=2*i)):(t.y+=i,(t.y<0||t.y>=this.bg.nRows)&&(t.y-=2*i));var e=this.bg.getActiveBoxWithIdLoc(t.y*this.bg.nCols+t.x);null!==e&&this.hiddenBox.exchangeLocation(e)}this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0}}updateContent(t){if(super.updateContent(t),this.bg&&this.parkBg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t),this.parkBg.update(i,t)}return this}setDimension(t){return this.bg&&this.parkBg&&!this.getBounds().equals(t)?as.layoutDouble(t,this.bg,this.parkBg,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&this.parkBg&&(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new Ct(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bg.findActiveBox(e);if(t)if(t.isVisible()){const e=this.bg.getCoordDist(t,this.hiddenBox);if(Math.abs(e.x)+Math.abs(e.y)===1){let e=t.playMedia(this.ps,i);const s=`${t.getDescription()} (${t.idOrder})`,n=`(${this.hiddenBox.idLoc})`;t.exchangeLocation(this.hiddenBox);const r=t.idOrder===t.idLoc,a=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"SELECT",s,n,r,a),r&&a===this.bg.getNumCells()?(this.hiddenBox.setVisible(!0),this.parkBg.setVisible(!1),this.finishActivity(!0)):e||this.playEvent("click")}this.update()}else this.playEvent("actionError")}i.forEach(t=>t()),t.preventDefault()}}}Object.assign(Os.prototype,{bg:null,parkBg:null,hiddenBox:null,hiddenBoxIndex:-1,events:["click"]}),Rs.Panel=Os;const Ds=Ve.registerClass("@puzzles.HolePuzzle",Rs);class Ms extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}}class Ns extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.secondary;if(t){if(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),e&&e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const i=[t];e&&i.push(e),this.act.acp.generateContent(t.nch,t.ncw,i,!1)}let i=t.ncw,s=t.nch;"AB"===this.act.boxGridPos||"BA"===this.act.boxGridPos?i*=2:s*=2,this.bg=new hs(null,this,t.style,this.act.margin,this.act.margin,t.w*i,t.h*s,new _i(i,s));const n=t.getNumCells();this.bg.setBorder(t.border),this.bg.setContent(t,null,0,0,n),this.bg.setContent(e||t,null,0,n,n);for(let t=0;t<2;t++)for(let e=0;e<n;e++){const i=this.bg.getActiveBox(t*n+e);i.idAss=e,i.setInactive(!0)}this.bg.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return!this.bg||this.getBounds().equals(t)?t:as.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Zi(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.setCellAttr("accessibleAlwaysActive",!0),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null,n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new Ct;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new Ct(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":case"touchend":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg?this.bg.findActiveBox(this.bc.origin):null,this.bc.end(),i=this.bg?this.bg.findActiveBox(s):null,e&&-1!==e.idAss&&i&&-1!==i.idAss)if(e!==i){let t=!1;e.idAss===i.idAss||e.getContent().isEquivalent(i.getContent(),!0)?(t=!0,e.idAss=-1,e.setInactive(!1),i.idAss=-1,i.setInactive(!1)):(e.setInactive(!0),this.act.dragCells?i.setInactive(!0):(i.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s)));let r=i.playMedia(this.ps,n);if(this.bg){const s=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",e.getDescription(),i.getDescription(),t,s/2),t&&s===this.bg.getNumCells()?this.finishActivity(!0):r||this.playEvent(t?"actionOk":"actionError")}}else this.playEvent("CLICK"),e.setInactive(!0);else null!==e&&e.setInactive(!0);this.invalidate().update()}else{if(r)break;this.ps.stopMedia(1),e=this.bg?this.bg.findActiveBox(s):null,e&&-1!==e.idAss&&(e.playMedia(this.ps,n)||this.playEvent("click"),e.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach(t=>t()),t.preventDefault()}}}Object.assign(Ns.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Ms.Panel=Ns;const $s=Ve.registerClass("@memory.MemoryGame",Ms);class Vs extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}Object.assign(Vs.prototype,{useIdAss:!1});class qs extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,i=this.act.abc.secondary,s=this.act.abc.solvedPrimary;if(t&&i){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=e("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i.image&&(i.setImgContent(this.act.project.mediaBag,null,!1),!i.animatedGifFile||i.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBgB=e("<span/>").css({"background-image":`url(${i.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),s&&s.image&&s.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const e=[t,i];s&&e.push(s),this.act.acp.generateContent(t.nch,t.ncw,e,!1)}this.bgA=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,i),this.bgA.setContent(t,s||null),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.setContent(i),this.$animatedBgB&&this.bgB.setCellAttr("tmpTrans",!0),this.bgA.accessibleText=f("source"),this.bgB.accessibleText=f("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}initActivity(){if(super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB){const t=[];this.act.shuffleA&&t.push(this.bgA),this.act.shuffleB&&t.push(this.bgB),t.length>0&&this.shuffle(t,!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}}updateContent(t){if(super.updateContent(t),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?as.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){if(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgA){const t=this.bgA.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:t.dim.width+"px",height:t.dim.height+"px","background-size":`${t.dim.width}px ${t.dim.height}px`})}if(this.$animatedBgB&&this.bgB){const t=this.bgB.getBounds();this.$animatedBgB.css({left:t.pos.x,top:t.pos.y,width:t.dim.width+"px",height:t.dim.height+"px","background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.bc=new Zi(this,this.$canvas),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new Ct;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new Ct(e-this.$div.offset().left,i-this.$div.offset().top)}let n=!1,r=!1,a=!1,o=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;n=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.bc.origin;if(this.bc.end(),e=this.bgA?this.bgA.findActiveBox(t):null,e?i=this.bgB?this.bgB.findActiveBox(s):null:(i=this.bgB?this.bgB.findActiveBox(t):null,i&&(e=this.bgA?this.bgA.findActiveBox(s):null,a=!0)),e&&i&&-1!==e.idAss&&-1!==i.idAss&&this.act.abc.secondary){let t=!1;const s=e.getDescription(),n=i.getDescription(),l=this.act.abc.secondary.getActiveBoxContent(e.idOrder);(e.idOrder===i.idOrder||i.getContent().isEquivalent(l,!0))&&(t=!0,e.idAss=-1,i.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),r=r||e.playMedia(this.ps,o)):(r=a?r||e.playMedia(this.ps,o):r||i.playMedia(this.ps,o),e.clear()),i.clear(),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));const c=this.bgB?this.bgB.countCellsWithIdAss(-1):0;this.ps.reportNewAction(this.act,"MATCH",s,n,t,c),t&&c===this.bgB.getNumCells()?this.finishActivity(!0):r||this.playEvent(t?"actionOk":"actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.trigger("focus")}else{if(n)break;if(this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(s):null,i=this.bgB?this.bgB.findActiveBox(s):null,e&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&i&&-1!==i.idAss){this.act.dragCells?this.bc.begin(s,e||i):this.bc.begin(s),r=r||(e||i).playMedia(this.ps,o),r||this.playEvent("click");let t=e?this.bgA:this.bgB;t&&t.$accessibleDiv&&(t=e?this.bgB:this.bgA,t&&t.$accessibleDiv&&t.$accessibleDiv.trigger("focus"))}}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}o.forEach(t=>t()),t.preventDefault()}}}Object.assign(qs.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Vs.Panel=qs;const js=Ve.registerClass("@associations.SimpleAssociation",Vs);class Ls extends Vs{constructor(t){super(t),this.useIdAss=!0}setProperties(t){super.setProperties(t),this.abc.primary.avoidAllIdsNull(this.abc.secondary.getNumCells())}getMinNumActions(){return this.invAss?this.abc.secondary.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}}Object.assign(Ls.prototype,{nonAssignedCells:0,useIdAss:!1});class Fs extends qs{constructor(t,e,i){super(t,e,i)}buildVisualComponents(){super.buildVisualComponents();const t=this.act.abc.primary,e=this.act.abc.secondary;t&&e&&(this.act.invAss&&(this.invAssCheck=Array(e.getNumCells()).fill(!1)),this.bgA.setDefaultIdAss(),this.act.nonAssignedCells=0,this.bgA.cells.forEach(t=>{-1===t.idAss&&(this.act.nonAssignedCells++,t.switchToAlt(this.ps))}))}checkInvAss(){return!(!this.act.invAss||!this.invAssCheck)&&this.invAssCheck.every(t=>t)}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new Ct;else{let e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new Ct(e-this.$div.offset().left,i-this.$div.offset().top)}let n=!1,r=!1,a=!1,o=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;n=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.bc.origin;if(this.bc.end(),e=this.bgA?this.bgA.findActiveBox(t):null,e?i=this.bgB?this.bgB.findActiveBox(s):null:(i=this.bgB?this.bgB.findActiveBox(t):null,i&&(e=this.bgA?this.bgA.findActiveBox(s):null,a=!0)),e&&i&&-1!==e.idAss&&!i.isInactive()&&this.act.abc.secondary){const t=e.getDescription(),s=i.getDescription(),n=this.act.abc.secondary.getActiveBoxContent(e.idAss);let l=!1;if((e.idAss===i.idOrder||i.getContent().isEquivalent(n,!0))&&(l=!0,e.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),r=r||e.playMedia(this.ps,o)):(r=a?r||e.playMedia(this.ps,o):r||i.playMedia(this.ps,o),e.clear()),this.act.invAss&&(this.invAssCheck[i.idOrder]=!0,i.clear()),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem))),this.bgA){const e=this.bgA.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",t,s,l,e-this.act.nonAssignedCells),l&&(this.checkInvAss()||e===this.bgA.getNumCells())?this.finishActivity(!0):r||this.playEvent(l?"actionOk":"actionError")}}else if(this.bgB&&(a&&this.bgA&&this.bgA.contains(s)||!a&&this.bgB.contains(s))){const t=e?e.getDescription():i?i.getDescription():"null";this.ps.reportNewAction(this.act,"MATCH",t,"null",!1,this.bgB.countCellsWithIdAss(-1)),this.playEvent("actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.trigger("focus")}else{if(n)break;this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(s):null,i=this.bgB?this.bgB.findActiveBox(s):null,(e&&-1!==e.idAss&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&i)&&(this.act.dragCells?this.bc.begin(s,e||i):this.bc.begin(s),r=r||(e||i).playMedia(this.ps,o),r||this.playEvent("click"));let t=e?this.bgA:this.bgB;t&&t.$accessibleDiv&&(t=e?this.bgB:this.bgA,t&&t.$accessibleDiv&&t.$accessibleDiv.trigger("focus"))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}o.forEach(t=>t()),t.preventDefault()}}}Object.assign(Fs.prototype,{invAssCheck:null}),Ls.Panel=Fs;const zs=je.registerClass("@associations.ComplexAssociation",Ls),Us={MIN_CELL_SIZE:12,DEFAULT_CELL_SIZE:20,MIN_INTERNAL_MARGIN:2},Hs={NORMAL:0,INVERTED:1,HIDDEN:2,LOCKED:4,MARKED:8,TRANSPARENT:16};class Js extends ci{constructor(t,e,i,s,n,r,a,o,l,c){super(t,e,i),this.pos.x=s,this.pos.y=n,this.nCols=Math.max(1,r),this.nRows=Math.max(1,a),this.cellWidth=Math.max(o,Us.MIN_CELL_SIZE),this.cellHeight=Math.max(l,Us.MIN_CELL_SIZE),this.dim.width=o*this.nCols,this.dim.height=l*this.nRows,this.setChars(" "),this.preferredBounds=new St(this.pos,this.dim),this.setBorder(c),this.cursorTimer=new Bt(()=>this.blink(0),500,!1),this.cursorEnabled=!1,this.useCursor=!1,this.wildTransparent=!1,this.cursor=new Ct}static createEmptyGrid(t,e,i,s,n,r){const a=new Js(t,e,n.style,i,s,n.ncw,n.nch,n.w,n.h,n.border);return a.wild=n.wild,a.randomChars=n.randomChars,a.wildTransparent=r,a}setChars(t){this.chars=[],this.answers=[],this.attributes=[];for(let e=0;e<this.nRows;e++){const i=e<t.length?t[e]:"";this.chars[e]=i.split(""),this.answers[e]=[],this.attributes[e]=[];for(let t=0;t<this.nCols;t++)t>=i.length&&(this.chars[e][t]=" "),this.answers[e][t]=this.chars[e][t],this.attributes[e][t]=Hs.NORMAL}}randomize(){for(let t=0;t<this.nRows;t++)for(let e=0;e<this.nCols;e++)this.chars[t][e]===this.wild&&(this.chars[t][e]=this.randomChars.charAt(Math.floor(Math.random()*this.randomChars.length)))}setCellAttributes(t,e){let i=Hs.LOCKED;this.wildTransparent?i|=Hs.TRANSPARENT:i|=Hs.INVERTED|Hs.HIDDEN;for(let s=0;s<this.nRows;s++)for(let n=0;n<this.nCols;n++)t&&this.chars[s][n]===this.wild?this.attributes[s][n]=i:(this.attributes[s][n]=Hs.NORMAL,e&&(this.chars[s][n]=" "))}setCellLocked(t,e,i){t>=0&&t<this.nCols&&e>=0&&e<this.nRows&&(this.attributes[e][t]=i?Hs.LOCKED|(this.wildTransparent?Hs.TRANSPARENT:Hs.INVERTED|Hs.HIDDEN):Hs.NORMAL)}getItemFor(t,e){if(!this.isValidCell(t,e))return null;const i=new Ct;let s=!1,n=!1;for(let r=0;r<t;r++)0!==(this.attributes[e][r]&Hs.LOCKED)?s||(n&&i.x++,s=!0):(n=!0,s=!1);s=!1,n=!1;for(let r=0;r<e;r++)0!==(this.attributes[r][t]&Hs.LOCKED)?s||(n&&i.y++,s=!0):(n=!0,s=!1);return i}setCursorEnabled(t){this.cursorEnabled=t,!0===t?this.startCursorBlink():this.stopCursorBlink()}startCursorBlink(){this.useCursor&&this.cursorEnabled&&this.cursorTimer&&!this.cursorTimer.isRunning()&&(this.blink(1),this.cursorTimer.start())}stopCursorBlink(){this.cursorTimer&&this.cursorTimer.isRunning()&&(this.cursorTimer.stop(),this.blink(-1))}moveCursor(t,e,i){if(this.useCursor){const s=this.findNextCellWithAttr(this.cursor.x,this.cursor.y,i?Hs.LOCKED:Hs.NORMAL,t,e,!1);this.cursor.equals(s)||this.setCursorAt(s.x,s.y,i)}}findFreeCell(t,e,i){let s=null;if(t&&(0!==e||0!==i)){const n=new Ct(t);for(;null===s&&(n.x+=e,n.y+=i,!(n.x<0||n.x>=this.nCols||n.y<0||n.y>=this.nRows));)this.getCellAttribute(n.x,n.y,Hs.LOCKED)||(s=n)}return s}findNextCellWithAttr(t,e,i,s,n,r){const a=new Ct(t+s,e+n);for(;a.x<0?(a.x=this.nCols-1,a.y>0?a.y--:a.y=this.nRows-1):a.x>=this.nCols&&(a.x=0,a.y<this.nRows-1?a.y++:a.y=0),a.y<0?(a.y=this.nRows-1,a.x>0?a.x--:a.x=this.nCols-1):a.y>=this.nRows&&(a.y=0,a.x<this.nCols-1?a.x++:a.x=0),(a.x!==t||a.y!==e)&&this.getCellAttribute(a.x,a.y,i)!==r;)a.x+=s,a.y+=n;return a}setCursorAt(t,e,i){this.stopCursorBlink(),this.isValidCell(t,e)&&(this.cursor.x=t,this.cursor.y=e,this.useCursor=!0,i&&this.getCellAttribute(t,e,Hs.LOCKED)?this.moveCursor(1,0,i):this.cursorEnabled&&this.startCursorBlink())}setUseCursor(t){this.useCursor=t}getCursor(){return this.cursor}countCharsLike(t){let e=0;for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.chars[i][s]===t&&e++;return e}getNumCells(){return this.nRows*this.nCols}countCoincidences(t){let e=0;if(this.answers)for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.isCellOk(s,i,t)&&e++;return e}isCellOk(t,e,i){let s=!1;if(this.isValidCell(t,e)){const n=this.chars[e][t];if(n!==this.wild){const r=this.answers[e][t];(n===r||!i&&n.toUpperCase()===r.toUpperCase())&&(s=!0)}}return s}getLogicalCoords(t){if(!this.contains(t))return null;const e=Math.floor((t.x-this.pos.x)/this.cellWidth),i=Math.floor((t.y-this.pos.y)/this.cellHeight);return this.isValidCell(e,i)?new Ct(e,i):null}isValidCell(t,e){return t<this.nCols&&e<this.nRows&&t>=0&&e>=0}setCharAt(t,e,i){this.isValidCell(t,e)&&(this.chars[e][t]=i,this.repaintCell(t,e))}getCharAt(t,e){return this.isValidCell(t,e)?this.chars[e][t]:" "}getStringBetween(t,e,i,s){let n="";if(this.isValidCell(t,e)&&this.isValidCell(i,s)){let r=i-t,a=s-e;if(0===r||0===a||Math.abs(r)===Math.abs(a)){const i=Math.max(Math.abs(r),Math.abs(a));i>0&&(r/=i,a/=i);for(let s=0;s<=i;s++)n+=this.getCharAt(t+r*s,e+a*s)}}return n}setAttributeBetween(t,e,i,s,n,r){if(this.isValidCell(t,e)&&this.isValidCell(i,s)){let a=i-t,o=s-e;if(0===a||0===o||Math.abs(a)===Math.abs(o)){const i=Math.max(Math.abs(a),Math.abs(o));i>0&&(a/=i,o/=i);for(let s=0;s<=i;s++)this.setAttribute(t+a*s,e+o*s,n,r)}}}setAttribute(t,e,i,s){this.isValidCell(t,e)&&(this.attribute!==Hs.MARKED||s||this.repaintCell(t,e),this.attributes[e][t]&=~i,this.attributes[e][t]|=s?i:0,(i!==Hs.MARKED||s)&&this.repaintCell(t,e))}setAllCellsAttribute(t,e){for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.setAttribute(s,i,t,e)}getCellAttribute(t,e,i){return!!this.isValidCell(t,e)&&0!==(this.attributes[e][t]&i)}getCellRect(t,e){return new St(this.pos.x+t*this.cellWidth,this.pos.y+e*this.cellHeight,this.cellWidth,this.cellHeight)}getCellBorderBounds(t,e){const i=this.getCellAttribute(t,e,Hs.MARKED);if(!this.border&&!i)return this.getCellRect(t,e);const s=this.getBoxBaseResolve(),n=i?s.markerStroke:s.borderStroke;return this.getCellRect(t,e).grow(n.lineWidth,n.lineWidth)}repaintCell(t,e){this.container&&this.container.invalidate(this.getCellBorderBounds(t,e)).update()}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){return new xt(Us.MIN_CELL_SIZE*this.nCols,Us.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new xt(J(t*this.preferredBounds.dim.width,this.nCols),J(t*this.preferredBounds.dim.height,this.nRows))}setBounds(t,e,i,s){super.setBounds(t,e,i,s),this.cellWidth=this.dim.width/this.nCols,this.cellHeight=this.dim.height/this.nRows}updateContent(t,e){const i=this.getBoxBaseResolve();t.font=i.font.cssFont(),t.textBaseline="alphabetic",i.prepareText(t,"W",this.cellWidth-2*Us.MIN_INTERNAL_MARGIN,this.cellHeight-2*Us.MIN_INTERNAL_MARGIN);const s=[],n=(this.cellHeight-i.font.getHeight())/2+i.font.getMetrics().ascent;for(let r=0;r<this.nRows;r++)for(let a=0;a<this.nCols;a++){if(this.getCellBorderBounds(a,r).intersects(e)){const e=this.attributes[r][a];if(0===(e&Hs.TRANSPARENT)){const o=0!==(e&Hs.INVERTED),l=0!==(e&Hs.MARKED),c=this.useCursor&&this.cursor.x===a&&this.cursor.y===r,h=this.getCellRect(a,r);if(t.fillStyle=c&&this.cursorBlink?i.inactiveColor:o?i.textColor:i.backColor,h.fill(t),t.strokeStyle="black",0===(e&Hs.HIDDEN)&&(s[0]=this.chars[r][a],s[0])){const e=h.pos.x+(this.cellWidth-t.measureText(s[0]).width)/2,r=h.pos.y+n;if(i.shadow){const n=Math.max(1,i.font.size/10);t.fillStyle=i.shadowColor,t.fillText(s[0],e+n,r+n)}t.fillStyle=o?i.backColor:this.isAlternative()?i.alternativeColor:i.textColor,t.fillText(s[0],e,r)}(this.border||l)&&(t.strokeStyle=i.borderColor,i[l?"markerStroke":"borderStroke"].setStroke(t),l&&(t.globalCompositeOperation="xor"),h.stroke(t),l&&(t.globalCompositeOperation="source-over")),t.strokeStyle="black",At.prototype.setStroke(t)}}}return!0}blink(t){this.useCursor&&(this.cursorBlink=1===t||-1!==t&&!this.cursorBlink,this.repaintCell(this.cursor.x,this.cursor.y))}end(){this.cursorTimer&&(this.cursorTimer.stop(),this.cursorTimer=null)}}Object.assign(Js.prototype,{nRows:1,nCols:1,chars:null,answers:null,attributes:null,cellWidth:20,cellHeight:20,preferredBounds:null,wild:Ie.prototype.wild,randomChars:Ie.prototype.randomChars,cursorEnabled:!1,useCursor:!1,cursor:null,cursorBlink:!1,cursorTimer:null,wildTransparent:!1}),Js.defaults=Us,Js.flags=Hs;const Ws=Js;class Gs extends Ve{constructor(t){super(t)}getMinNumActions(){return this.clues.length}helpSolutionAllowed(){return!0}hasRandom(){return!0}}Object.assign(Gs.prototype,{clues:null,clueItems:null,shuffleA:!1,shuffleB:!1});class Ks extends qe{constructor(t,e,i){super(t,e,i),this.resolvedClues=[]}clear(){this.grid&&(this.grid.end(),this.grid=null),this.bgAlt&&(this.bgAlt.end(),this.bgAlt=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.tgc,i=this.act.abc.secondary;i&&(i.image&&(i.setImgContent(this.act.project.mediaBag,null,!1),!i.animatedGifFile||i.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBg=e("<span/>").css({"background-image":`url(${i.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(0,0,[i],!1)),t&&(this.grid=Ws.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,!1),i&&(this.bgAlt=hs.createEmptyGrid(null,this,this.act.margin,this.act.margin,i),this.$animatedBg&&this.bgAlt.backgroundBox&&(this.bgAlt.backgroundBox.tmpTrans=!0)),this.grid.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.grid.randomize(),this.grid.setAllCellsAttribute(Ws.flags.INVERTED,!1),this.resolvedClues=Array(this.act.clueItems.length).fill(!1),this.bgAlt&&(this.bgAlt.setContent(this.act.abc.secondary),this.$animatedBg&&this.bgAlt.clearAllBoxes(),this.act.shuffleB&&this.shuffle([this.bgAlt],!0,!0),this.bgAlt.setVisible(null!==this.$animatedBg||this.act.invAss)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.grid&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.bgAlt&&this.bgAlt.update(i,t)}return this}setDimension(t){return!this.grid||this.getBounds().equals(t)?t:this.bgAlt?as.layoutDouble(t,this.grid,this.bgAlt,this.act.boxGridPos,this.act.margin):as.layoutSingle(t,this.grid,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.grid){if(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgAlt){const t=this.bgAlt.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.bc=new Zi(this,this.$canvas),this.invalidate().update()}}getCurrentScore(){return this.resolvedClues.reduce((t,e)=>e?++t:t,0)}processEvent(t){if(this.bc&&this.playing){let e=null;if("touchend"===t.type)e=this.bc.active?this.bc.dest.clone():new Ct;else{const i=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;e=new Ct(i-this.$div.offset().left,s-this.$div.offset().top)}let i=!1,s=!1;const n=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&e.distanceTo(this.bc.origin)<=3)break;i=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.grid.getLogicalCoords(this.bc.origin),e=this.grid.getLogicalCoords(this.bc.dest);this.bc.end();const i=this.grid.getStringBetween(t.x,t.y,e.x,e.y);if(null!==i&&i.length>0){let r=!1,a=0;for(;a<this.act.clues.length;a++)if(i===this.act.clues[a]){r=!0;break}const o=this.resolvedClues[a];if(r&&!o&&(this.resolvedClues[a]=!0,this.grid.setAttributeBetween(t.x,t.y,e.x,e.y,Ws.flags.INVERTED,!0),null!==this.bgAlt)){const t=this.act.clueItems[a];if(t>=0&&t<this.bgAlt.getNumCells()){const t=this.bgAlt.getActiveBox(this.act.clueItems[a]);t&&(t.setVisible(null===this.$animatedBg&&!this.act.invAss),s=t.playMedia(this.ps,n))}}if(o)r||s||this.playEvent("actionError");else{const t=this.getCurrentScore();this.ps.reportNewAction(this.act,"ACTION_SELECT",i,null,r,t),t===this.act.clues.length?this.finishActivity(!0):s||this.playEvent(r?"actionOK":"actionError"),this.invalidate()}}else this.playEvent("actionError");this.update()}else{if(i)break;this.ps.stopMedia(1),this.grid.contains(e)&&(this.playEvent("click"),this.bc.begin(e))}break;case"mousemove":case"touchmove":this.bc.moveTo(e)}n.forEach(t=>t()),t.preventDefault()}}}Object.assign(Ks.prototype,{grid:null,bgAlt:null,resolvedClues:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Gs.Panel=Ks;const Zs=Ve.registerClass("@textGrid.WordSearch",Gs);class Ys extends Ve{constructor(t){super(t)}getMinNumActions(){return this.tgc.getNumChars()-this.tgc.countWildChars()}needsKeyboard(){return!0}}Object.assign(Ys.prototype,{upperCase:!0,checkCase:!0,wildTransparent:!1});class Qs extends qe{constructor(t,e,i){super(t,e,i)}clear(){this.grid&&(this.grid.end(),this.grid=null),this.style&&(this.style.end(),this.style=null)}createBoxBag(t){const i=new as(null,this,null),s=new ci(i,this,this.icoBB);s.setBounds(0,0,this.LABEL_WIDTH,this.act.abc[t].h);const n=e("<button/>",{class:"StockBtn"}).css({width:this.LABEL_WIDTH,height:this.act.abc[t].h,"background-image":`url(${"acrossClues"===t?this.hIcon:this.vIcon})`,"background-repeat":"no-repeat","background-position":"center","border-radius":"6px","z-index":10}).on("click",()=>{this.advance="acrossClues"===t?"ADVANCE_RIGHT"===this.advance?"NO_ADVANCE":"ADVANCE_RIGHT":"ADVANCE_DOWN"===this.advance?"NO_ADVANCE":"ADVANCE_DOWN",this.setBtnStatus()}).on("keypress",t=>{" "===String.fromCharCode(t.charCode||t.keyCode)&&t.stopPropagation()}).appendTo(this.$div);s.setHostedComponent(n),i.addBox(s);const r=new ui(i,null,null,t,new St(this.LABEL_WIDTH+this.act.margin,0,this.act.abc[t].w,this.act.abc[t].h));return i.addBox(r),i.setBoxBase(this.act.abc[t].style),"acrossClues"===t?(this.hClue=r,this.hClueBtn=s):(this.vClue=r,this.vClueBtn=s),i}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.tgc,e=this.act.abc.acrossClues,i=this.act.abc.downClues;if(e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(0,0,this.act.abc,!1),t){this.grid=Ws.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,this.act.wildTransparent),this.style=new as(null,this,null);const e=this.createBoxBag("acrossClues"),i=this.createBoxBag("downClues");"AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?i.moveTo(new Ct(e.dim.width+this.act.margin,0)):i.moveTo(new Ct(0,e.dim.height+this.act.margin)),this.style.addBox(e),this.style.addBox(i),this.grid.setVisible(!0),this.style.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.numLetters=this.act.getMinNumActions(),this.grid.setCellAttributes(!0,!0),this.grid.setCursorEnabled(!0),this.setCursorAt(0,0),this.advance="ADVANCE_RIGHT",this.setBtnStatus(),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.$div.attr("tabindex",0),this.$div.trigger("focus"),this.playing=!0)}getCurrentScore(){return this.grid?this.grid.countCoincidences(this.act.checkCase):0}updateContent(t){if(super.updateContent(t),this.grid&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new St(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.style.update(i,t)}return this}setDimension(t){return this.grid&&this.style&&!this.getBounds().equals(t)?as.layoutDouble(t,this.grid,this.style,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&(this.$canvas.remove(),this.$canvas=null),super.setBounds(t),this.grid&&(this.$canvas=e(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}processEvent(t){if(this.playing)switch(t.type){case"click":const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,s=new Ct(e-this.$div.offset().left,i-this.$div.offset().top),n=[];if(this.ps.stopMedia(1),this.grid.contains(s)){const t=this.grid.getLogicalCoords(s);if(null!==t&&(this.setCursorAt(t.x,t.y),gt.TOUCH_DEVICE)){const t="ADVANCE_DOWN"===this.advance,e=window.prompt((t?"Vertical":"Horizontal")+" word:","");this.writeChars(e)}}else if(this.hClue.contains(s))this.hClue.playMedia(this.ps,n);else{if(!this.vClue.contains(s))break;this.vClue.playMedia(this.ps,n)}this.update(),n.forEach(t=>t());break;case"keypress":const r=t.charCode||t.keyCode;r&&this.grid.getCursor()&&(t.preventDefault(),this.writeChars(String.fromCharCode(r)));break;case"keydown":let a=0,o=0;switch(t.keyCode){case gt.VK.RIGHT:a=1;break;case gt.VK.LEFT:a=-1;break;case gt.VK.DOWN:o=1;break;case gt.VK.UP:o=-1}(a||o)&&(t.preventDefault(),this.moveCursor(a,o),this.update())}}moveCursor(t,e){this.grid&&(this.grid.moveCursor(t,e,!0),this.cursorPosChanged())}setCursorAt(t,e){this.grid.setCursorAt(t,e,!0),this.cursorPosChanged()}cursorPosChanged(){const t=this.grid.getCursor();if(null!==t&&null!==this.style){const e=this.grid.getItemFor(t.x,t.y);null!==e&&(this.hClue.setContent(this.act.abc.acrossClues.getActiveBoxContentWith(t.y,e.x)),this.vClue.setContent(this.act.abc.downClues.getActiveBoxContentWith(t.x,e.y)))}}writeChars(t){if(t&&t.length>0)for(let e=0;e<t.length;e++){const i=this.grid.getCursor();let s=t.charAt(e);this.act.upperCase&&(s=s.toLocaleUpperCase()),this.grid.setCharAt(i.x,i.y,s);const n=this.grid.isCellOk(i.x,i.y,this.act.checkCase),r=this.getCurrentScore();this.ps.reportNewAction(this.act,"WRITE",s,`X:${i.x} Y:${i.y}`,n,r),r===this.numLetters?(this.grid.setCursorEnabled(!1),this.grid.stopCursorBlink(),this.finishActivity(!0)):(this.playEvent("click"),"ADVANCE_DOWN"===this.advance?this.moveCursor(0,1):"ADVANCE_RIGHT"===this.advance&&this.moveCursor(1,0))}this.update()}setBtnStatus(){this.hClueBtn&&this.hClueBtn.setInactive("ADVANCE_RIGHT"!==this.advance),this.vClueBtn&&this.vClueBtn.setInactive("ADVANCE_DOWN"!==this.advance)}}Object.assign(Qs.prototype,{LABEL_WIDTH:40,grid:null,style:null,numLetters:0,advance:"NO_ADVANCE",hClue:null,vClue:null,hClueBtn:null,vClueBtn:null,events:["click","keydown","keypress"],hIcon:rt('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),vIcon:rt('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),icoSize:{w:36,h:36},icoBB:(new be).set("backColor","#4285F4").set("inactiveColor","#70A2F6").set("dontFill",!0)}),Ys.Panel=Qs;const Xs=Ve.registerClass("@textGrid.CrossWord",Ys);class tn extends ri{constructor(t){super(t),this.tasks=[]}getProperty(t,e){return null!==this.dbProperties&&this.dbProperties.hasOwnProperty(t)?this.dbProperties[t]:e}addTask(t){this.processingTasks?null===this.waitingTasks?this.waitingTasks=[t]:this.waitingTasks.push(t):this.tasks.push(t)}flushTasksPromise(){if(this.processingTasks||null===this.currentSessionId||0===this.tasks.length||null===this.serviceUrl)return this.processingTasks&&(this.forceFlush=!0),Promise.resolve(!0);{this.processingTasks=!0;const t=new en("multiple");for(let e=0;e<this.tasks.length;e++)t.appendData(this.tasks[e].$bean);return m("debug","Reporting:",t.$bean[0]),new Promise((e,i)=>{this.transaction(t.$bean).done((t,i,s)=>{this.failCount=0,this.waitingTasks?(this.tasks=this.waitingTasks,this.waitingTasks=null):(this.forceFlush=!1,this.tasks=[]),this.forceFlush&&this.tasks.length>0?(this.forceFlush=!1,this.processingTasks=!1,this.flushTasksPromise().then(()=>{e(!0)})):(this.forceFlush=!1,e(!0),this.processingTasks=!1)}).fail((t,e,s)=>{++this.failCount>this.maxFails&&this.stopReporting().then(),i(`Error reporting results to ${this.serviceUrl} [${e} ${s}]`),this.processingTasks=!1})})}}init(t){null==t&&(t=this.ps.options),super.init(t),this.initiated=!1,this.stopReporting(),this.serverPath=t.path||this.DEFAULT_SERVER_PATH,this.descriptionDetail=this.serverPath;let i=t.service||this.DEFAULT_SERVER_SERVICE;Z(i,"/")||(i=`/${i}`);const s=t.protocol||this.DEFAULT_SERVER_PROTOCOL;this.serviceUrl=`${s}://${this.serverPath}${i}`;const n=new en("get_properties");return new Promise((i,s)=>{this.transaction(n.$bean).done((n,r,a)=>{this.dbProperties={},e(n).find("param").each((t,i)=>{const s=e(i);this.dbProperties[s.attr("name")]=s.attr("value")}),this.promptUserId(!1).then(e=>{this.userId=e;const s=t.lap||this.getProperty("TIME_LAP",this.DEFAULT_TIMER_LAP);this.timerLap=Math.min(30,Math.max(1,parseInt(s))),this.timer=window.setInterval(()=>this.flushTasksPromise().then(),1e3*this.timerLap),this.beforeUnloadFunction=t=>{if(null!==this.serviceUrl&&(this.tasks.length>0||this.processingTasks)){this.flushTasksPromise().then();const e=f("Please wait until the results of your activities are sent to the reports system");return t&&(t.returnValue=e),e}},window.addEventListener("beforeunload",this.beforeUnloadFunction),this.initiated=!0,i(!0)}).catch(t=>{this.stopReporting(),s(`Error getting the user ID: ${t}`)})}).fail((t,e,i)=>{this.stopReporting(),s(`Error initializing reports service ${this.serviceUrl} [${e} ${i}]`)})})}newSession(t){super.newSession(t),this.serviceUrl&&null!==this.userId&&(this.currentSessionId=null)}createDBSession(t){return null===this.currentSessionId||t?new Promise((t,i)=>{this.initiated&&null!==this.userId&&null!==this.currentSession?this.flushTasksPromise().then(()=>{this.currentSessionId=null;const s=new en("add session");s.setParam("project",this.currentSession.projectName),s.setParam("activities",Number(this.currentSession.reportableActs)),s.setParam("time",Number(this.currentSession.started)),s.setParam("code",this.currentSession.code),s.setParam("user",this.userId),s.setParam("key",this.sessionKey),s.setParam("context",this.sessionContext),this.transaction(s.$bean).done((i,s,n)=>{this.currentSessionId=e(i).find('param[name="session"]').attr("value"),t(this.currentSessionId)}).fail((t,e,s)=>{this.stopReporting(),i(`Error creating new reports session in ${this.serviceUrl} [${e} ${s}]`)})}):i("Unable to start session in remote server!")}):Promise.resolve(this.currentSessionId)}end(){return this.reportActivity(!0),this.stopReporting().then(super.end())}transaction(t){return null===this.serviceUrl?null:e.ajax({method:"POST",url:this.serviceUrl,data:'<?xml version="1.0" encoding="UTF-8"?>'+(new XMLSerializer).serializeToString(t.get(0)).replace("minactions","minActions").replace("reportactions","reportActions"),contentType:"text/xml",dataType:"xml"})}getGroups(){return new Promise((t,i)=>{if(this.userBased()){const s=new en("get groups");this.transaction(s.$bean).done((i,s,n)=>{const r=[];e(i).find("group").each((t,i)=>{const s=e(i);r.push({id:s.attr("id"),name:s.attr("name")})}),t(r)}).fail((t,e,s)=>{i(`Error retrieving groups list from ${this.serviceUrl} [${e} ${s}]`)})}else i("This system does not manage users!")})}getUsers(t){return new Promise((i,s)=>{if(this.userBased()){const n=new en("get users");null!=t&&n.setParam("group",t),this.transaction(n.$bean).done((t,s,n)=>{const r=[];e(t).find("user").each((t,i)=>{const s=e(i),n={id:s.attr("id"),name:s.attr("name")};s.attr("pwd")&&(n.pwd=s.attr("pwd")),r.push(n)}),i(r)}).fail((t,e,i)=>{s(`Error retrieving users list from ${this.serviceUrl} [${e} ${i}]`)})}else s("This system does not manage users!")})}getUserData(t){return new Promise((i,s)=>{if(this.userBased()){const n=new en("get user data");null!=t?n.setParam("user",t):s("Invalid user ID"),this.transaction(n.$bean).done((t,s,n)=>{const r=e(t).find("user");if(1!==r.length)window.alert(f("Invalid user")),i("Invalid user ID");else{const t={id:r.attr("id"),name:r.attr("name")};r.attr("pwd")&&(t.pwd=r.attr("pwd")),i(t)}}).fail((t,e,i)=>{s(`Error retrieving user data from ${this.serviceUrl} [${e} ${i}]`)})}else s("This system does not manage users!")})}stopReporting(){let t=null;return this.timer>=0&&(window.clearInterval(this.timer),this.timer=-1),this.beforeUnloadFunction&&(window.removeEventListener("beforeunload",this.beforeUnloadFunction),this.beforeUnloadFunction=null),this.initiated&&(t=this.flushTasksPromise().then(()=>{this.serviceUrl=null,this.descriptionDetail=`${this.serverPath} (${f("not connected")})`,this.initiated=!1})),t||Promise.resolve(!0)}reportActivity(t){if(this.lastActivity){this.lastActivity.closed||this.lastActivity.closeActivity();const e=this.actCount++,i=this.lastActivity;this.createDBSession(!1).then(()=>{const s=new en("add activity");s.setParam("session",this.currentSessionId),s.setParam("num",e),s.appendData(i.$getXML()),this.addTask(s),t&&this.flushTasksPromise().then()})}null!==this.currentSession&&null!==this.currentSession.currentSequence&&this.currentSession.currentSequence.currentActivity!==this.lastActivity?this.lastActivity=this.currentSession.currentSequence.currentActivity:this.lastActivity=null}newActivity(t){super.newActivity(t),this.reportActivity(!1)}endActivity(t,e,i){super.endActivity(t,e,i),this.reportActivity(!0)}}Object.assign(tn.prototype,{descriptionKey:"Reporting to remote server",descriptionDetail:"(not connected)",serverPath:"",beforeUnloadFunction:null,currentSessionId:"",lastActivity:null,actCount:0,serviceUrl:null,dbProperties:null,tasks:null,waitingTasks:null,processingTasks:!1,forceFlush:!1,timer:-1,timerLap:5,failCount:0,maxFails:5,DEFAULT_SERVER_PATH:"localhost:9000",DEFAULT_SERVER_SERVICE:"/JClicReportService",DEFAULT_SERVER_PROTOCOL:document&&document.location&&"http:"===document.location.protocol?"http":"https",DEFAULT_TIMER_LAP:20});class en{constructor(t,i){this.$bean=e("<bean/>").attr({id:t}),i&&this.appendData(i)}appendData(t){t&&this.$bean.append(t)}setParam(t,i){null!=i&&this.appendData(e("<param/>").attr({name:t,value:i}))}}Object.assign(en.prototype,{$bean:null}),tn.ReportBean=en;const sn=ri.registerClass("TCPReporter",tn);class nn extends ri{constructor(t){super(t),this.key=`jclic_${(new Date).toISOString()}#${Math.ceil(1e3*Math.random())}`}init(t){return null==t&&(t=this.ps.options),"local"===t.storage&&(this.storage=window.localStorage,this.descriptionKey="Reporting to local storage"),ri.prototype.init.call(this,t)}saveCurrentReport(){window.setTimeout(()=>{this.storage.setItem(this.key,JSON.stringify(this.getData()))},0)}endSequence(){super.endSequence(),this.saveCurrentReport()}endActivity(t,e,i){super.endActivity(t,e,i),this.saveCurrentReport()}}Object.assign(nn.prototype,{storage:window.sessionStorage,descriptionKey:"Reporting to session storage",descriptionDetail:"(browser session)",key:null});const rn=ri.registerClass("SessionStorageReporter",nn),an={Deps:{DefaultSkin:gi,OrangeSkin:vi,GreenSkin:yi,BlueSkin:Ai,SimpleSkin:xi,MiniSkin:Si,EmptySkin:Ei,CustomSkin:Ii,Rectangular:_i,Holes:Ri,JigSaw:Oi,TriangularJigSaw:Di,ClassicJigSaw:Ni,Arith:Li,TextActivityBase:Ui,FillInBlanks:Wi,OrderText:Xi,Complete:es,IdentifyText:ns,WrittenAnswer:ps,InformationScreen:ms,Identify:ys,Explore:Cs,Menu:Ss,DoublePuzzle:Ps,ExchangePuzzle:_s,HolePuzzle:Ds,MemoryGame:$s,SimpleAssociation:js,ComplexAssociation:zs,WordSearch:Zs,CrossWord:Xs,TCPReporter:sn,SessionStorageReporter:rn},JClicPlayer:oi,JClicProject:Fe,AWT:Rt,Utils:mt,$:e,options:"undefined"==typeof JClicDataOptions?{}:JClicDataOptions,projectFiles:{},currentPlayers:[],loadProject:function(t,i){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s=p({...an.options,...s},!0,!1);let n=null;for(const e of an.currentPlayers)if(e&&e.$topDiv&&e.$topDiv.get(-1)===t){m("debug","Existing JClicPlayer found in div. I will try to reuse it."),n=e;for(const t of Object.getOwnPropertyNames(s))if(!n.options.hasOwnProperty(t)||n.options[t]!==s[t]){m("debug","Existing JClicPlayer has diferent options! Creating a new one from scratch."),n=null;break}break}n?n.reset():(m("debug","Creating a new instance of JClicPlayer"),n=new oi(e(t).empty(),s));i&&n.initReporter().then(()=>n.load(i)).catch(i=>{m("error",`Unable to start reporting: ${i.toString()}.\n JClicPlayer will be removed.'`),e(t).empty().removeAttr("style").append(e("<h2/>").html(n.getMsg("ERROR"))).append(e("<p/>").html(i));const s=an.currentPlayers.indexOf(n);s>=0&&an.currentPlayers.splice(s,1),n=null});n&&!1!==s.savePlayersRef&&-1===an.currentPlayers.indexOf(n)&&an.currentPlayers.push(n);return n}};if("undefined"!=typeof window){window.JClicObject=an;const t=()=>an.currentPlayers.forEach(t=>{t&&t.skin&&t.skin.fit()});e(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",t),e(window).on("resize",t),document.currentScript&&document.currentScript.getAttribute("data-expose-jQuery")&&(window.jQuery=an.$)}e(function(){let t="undefined"==typeof JClicDataOptions?{}:JClicDataOptions;if(an.options=t,!t.noInit){let i="string"==typeof JClicDataProject?JClicDataProject:"string"==typeof an.projectFile?an.projectFile:null;t.browserHistory=1===e("body>div.JClic").length||t.browserHistory&&1===e(".JClic").length,e(".JClic").each((s,n)=>{const r=e(n),a=r.data("project");a&&(i=a);const o=r.data("options");o&&(t=e.extend(Object.create(t),o)),an.loadProject(n,i,t)})}})})()})();
|
|
27
27
|
//# sourceMappingURL=jclic.min.js.map
|