jclic 2.1.21 → 2.1.22
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 +4 -0
- package/dist/jclic-node.js +1 -1
- package/dist/jclic-node.js.map +1 -1
- package/dist/jclic.min.js +2 -2
- package/dist/jclic.min.js.map +1 -1
- package/package.json +1 -1
- package/src/GlobalData.js +1 -1
- package/dist/1078.jclic-node.js +0 -282
- package/dist/1078.jclic-node.js.map +0 -1
- package/dist/1196.jclic-node.js +0 -808
- package/dist/1196.jclic-node.js.map +0 -1
- package/dist/1253.jclic-node.js +0 -1432
- package/dist/1253.jclic-node.js.map +0 -1
- package/dist/13.jclic-node.js +0 -103
- package/dist/13.jclic-node.js.map +0 -1
- package/dist/1567.jclic-node.js +0 -2313
- package/dist/1567.jclic-node.js.map +0 -1
- package/dist/1588.jclic-node.js +0 -602
- package/dist/1588.jclic-node.js.map +0 -1
- package/dist/1725.jclic-node.js +0 -836
- package/dist/1725.jclic-node.js.map +0 -1
- package/dist/1731.jclic-node.js +0 -438
- package/dist/1731.jclic-node.js.map +0 -1
- package/dist/1842.jclic-node.js +0 -651
- package/dist/1842.jclic-node.js.map +0 -1
- package/dist/2160.jclic-node.js +0 -1016
- package/dist/2160.jclic-node.js.map +0 -1
- package/dist/222.jclic-node.js +0 -129
- package/dist/222.jclic-node.js.map +0 -1
- package/dist/2316.jclic-node.js +0 -949
- package/dist/2316.jclic-node.js.map +0 -1
- package/dist/2355.jclic-node.js +0 -371
- package/dist/2355.jclic-node.js.map +0 -1
- package/dist/2366.jclic-node.js +0 -431
- package/dist/2366.jclic-node.js.map +0 -1
- package/dist/2379.jclic-node.js +0 -202
- package/dist/2379.jclic-node.js.map +0 -1
- package/dist/2437.jclic-node.js +0 -450
- package/dist/2437.jclic-node.js.map +0 -1
- package/dist/2531.jclic-node.js +0 -869
- package/dist/2531.jclic-node.js.map +0 -1
- package/dist/2608.jclic-node.js +0 -160
- package/dist/2608.jclic-node.js.map +0 -1
- package/dist/2715.jclic-node.js +0 -554
- package/dist/2715.jclic-node.js.map +0 -1
- package/dist/277.jclic-node.js +0 -22
- package/dist/277.jclic-node.js.map +0 -1
- package/dist/2921.jclic-node.js +0 -660
- package/dist/2921.jclic-node.js.map +0 -1
- package/dist/2952.jclic-node.js +0 -101
- package/dist/2952.jclic-node.js.map +0 -1
- package/dist/3018.jclic-node.js +0 -421
- package/dist/3018.jclic-node.js.map +0 -1
- package/dist/3019.jclic-node.js +0 -682
- package/dist/3019.jclic-node.js.map +0 -1
- package/dist/3231.jclic-node.js +0 -274
- package/dist/3231.jclic-node.js.map +0 -1
- package/dist/331.jclic-node.js +0 -115
- package/dist/331.jclic-node.js.map +0 -1
- package/dist/3391.jclic-node.js +0 -276
- package/dist/3391.jclic-node.js.map +0 -1
- package/dist/3502.jclic-node.js +0 -671
- package/dist/3502.jclic-node.js.map +0 -1
- package/dist/3653.jclic-node.js +0 -982
- package/dist/3653.jclic-node.js.map +0 -1
- package/dist/371.jclic.min.js +0 -2
- package/dist/371.jclic.min.js.map +0 -1
- package/dist/3856.jclic-node.js +0 -575
- package/dist/3856.jclic-node.js.map +0 -1
- package/dist/4112.jclic-node.js +0 -659
- package/dist/4112.jclic-node.js.map +0 -1
- package/dist/4123.jclic-node.js +0 -910
- package/dist/4123.jclic-node.js.map +0 -1
- package/dist/427.jclic-node.js +0 -894
- package/dist/427.jclic-node.js.map +0 -1
- package/dist/4483.jclic-node.js +0 -327
- package/dist/4483.jclic-node.js.map +0 -1
- package/dist/4548.jclic-node.js +0 -1078
- package/dist/4548.jclic-node.js.map +0 -1
- package/dist/466.jclic-node.js +0 -99
- package/dist/466.jclic-node.js.map +0 -1
- package/dist/485.jclic-node.js +0 -783
- package/dist/485.jclic-node.js.map +0 -1
- package/dist/4921.jclic-node.js +0 -500
- package/dist/4921.jclic-node.js.map +0 -1
- package/dist/5091.jclic-node.js +0 -239
- package/dist/5091.jclic-node.js.map +0 -1
- package/dist/520.jclic-node.js +0 -550
- package/dist/520.jclic-node.js.map +0 -1
- package/dist/5312.jclic-node.js +0 -1126
- package/dist/5312.jclic-node.js.map +0 -1
- package/dist/5338.jclic-node.js +0 -212
- package/dist/5338.jclic-node.js.map +0 -1
- package/dist/5344.jclic-node.js +0 -229
- package/dist/5344.jclic-node.js.map +0 -1
- package/dist/5550.jclic-node.js +0 -238
- package/dist/5550.jclic-node.js.map +0 -1
- package/dist/5626.jclic-node.js +0 -614
- package/dist/5626.jclic-node.js.map +0 -1
- package/dist/5977.jclic-node.js +0 -1081
- package/dist/5977.jclic-node.js.map +0 -1
- package/dist/6148.jclic-node.js +0 -345
- package/dist/6148.jclic-node.js.map +0 -1
- package/dist/6176.jclic-node.js +0 -481
- package/dist/6176.jclic-node.js.map +0 -1
- package/dist/6221.jclic-node.js +0 -1072
- package/dist/6221.jclic-node.js.map +0 -1
- package/dist/6238.jclic-node.js +0 -718
- package/dist/6238.jclic-node.js.map +0 -1
- package/dist/6454.jclic-node.js +0 -1413
- package/dist/6454.jclic-node.js.map +0 -1
- package/dist/6565.jclic-node.js +0 -294
- package/dist/6565.jclic-node.js.map +0 -1
- package/dist/6579.jclic-node.js +0 -719
- package/dist/6579.jclic-node.js.map +0 -1
- package/dist/6715.jclic-node.js +0 -148
- package/dist/6715.jclic-node.js.map +0 -1
- package/dist/6777.jclic-node.js +0 -171
- package/dist/6777.jclic-node.js.map +0 -1
- package/dist/6782.jclic-node.js +0 -1611
- package/dist/6782.jclic-node.js.map +0 -1
- package/dist/6847.jclic-node.js +0 -601
- package/dist/6847.jclic-node.js.map +0 -1
- package/dist/6856.jclic-node.js +0 -252
- package/dist/6856.jclic-node.js.map +0 -1
- package/dist/696.jclic-node.js +0 -1821
- package/dist/696.jclic-node.js.map +0 -1
- package/dist/698.jclic-node.js +0 -583
- package/dist/698.jclic-node.js.map +0 -1
- package/dist/704.jclic-node.js +0 -80
- package/dist/704.jclic-node.js.map +0 -1
- package/dist/7046.jclic-node.js +0 -735
- package/dist/7046.jclic-node.js.map +0 -1
- package/dist/7220.jclic-node.js +0 -156
- package/dist/7220.jclic-node.js.map +0 -1
- package/dist/7257.jclic-node.js +0 -931
- package/dist/7257.jclic-node.js.map +0 -1
- package/dist/743.jclic-node.js +0 -583
- package/dist/743.jclic-node.js.map +0 -1
- package/dist/757.jclic-node.js +0 -1072
- package/dist/757.jclic-node.js.map +0 -1
- package/dist/7781.jclic-node.js +0 -202
- package/dist/7781.jclic-node.js.map +0 -1
- package/dist/7912.jclic-node.js +0 -2103
- package/dist/7912.jclic-node.js.map +0 -1
- package/dist/827.jclic-node.js +0 -708
- package/dist/827.jclic-node.js.map +0 -1
- package/dist/8276.jclic-node.js +0 -409
- package/dist/8276.jclic-node.js.map +0 -1
- package/dist/8322.jclic-node.js +0 -498
- package/dist/8322.jclic-node.js.map +0 -1
- package/dist/8641.jclic-node.js +0 -360
- package/dist/8641.jclic-node.js.map +0 -1
- package/dist/8837.jclic-node.js +0 -651
- package/dist/8837.jclic-node.js.map +0 -1
- package/dist/8895.jclic-node.js +0 -151
- package/dist/8895.jclic-node.js.map +0 -1
- package/dist/9072.jclic-node.js +0 -1285
- package/dist/9072.jclic-node.js.map +0 -1
- package/dist/9078.jclic-node.js +0 -935
- package/dist/9078.jclic-node.js.map +0 -1
- package/dist/9103.jclic-node.js +0 -718
- package/dist/9103.jclic-node.js.map +0 -1
- package/dist/9359.jclic-node.js +0 -145
- package/dist/9359.jclic-node.js.map +0 -1
- package/dist/9409.jclic-node.js +0 -921
- package/dist/9409.jclic-node.js.map +0 -1
- package/dist/9513.jclic-node.js +0 -720
- package/dist/9513.jclic-node.js.map +0 -1
- package/dist/9704.jclic-node.js +0 -81
- package/dist/9704.jclic-node.js.map +0 -1
- package/dist/9950.jclic-node.js +0 -827
- package/dist/9950.jclic-node.js.map +0 -1
package/dist/jclic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
JClic.js version 2.1.
|
|
2
|
+
JClic.js version 2.1.22 (2024-10-16)
|
|
3
3
|
HTML5 player for JClic activities
|
|
4
4
|
https://projectestac.github.io/jclic.js
|
|
5
5
|
|
|
@@ -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={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:x(e)?C: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 x=r(/\.js(\?.*)?$/i);function C(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,x=t=>(u(t)||{}).alt,C=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:x,chroma:C,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)},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,l=r.flat?function(t){return r.flat.call(t)}:function(t){return r.concat.apply([],t)},c=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 x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[d.call(t)]||"object":typeof t}var C="3.7.1",k=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,i=x(t);return!v(t)&&!b(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:C,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:c,sort:r.sort,splice:r.splice},S.extend=S.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||v(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&&(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(c,r,s)):void 0!==s&&(a[e]=s));return a},S.extend({expando:"jQuery"+(C+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(E(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&&(E(Object(t))?S.merge(i,"string"==typeof t?[t]:t):c.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(E(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 l(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 B=r.pop,I=r.sort,P=r.splice,_="[\\x20\\t\\r\\n\\f]",R=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 D=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function O(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(D,O)};var M=y,N=c;!function(){var t,e,i,n,a,l,c,u,d,f,g=N,v=S.expando,b=0,y=0,w=tt(),A=tt(),x=tt(),C=tt(),k=function(t,e){return t===e&&(a=!0),0},E="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",D="(?:\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",O="\\["+_+"*("+D+")(?:"+_+"*([*^$|!~]?=)"+_+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+D+"))|)"+_+"*\\]",$=":("+D+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",V=new RegExp(_+"+","g"),q=new RegExp("^"+_+"*,"+_+"*"),L=new RegExp("^"+_+"*([>+~]|"+_+")"+_+"*"),j=new RegExp(_+"|>"),F=new RegExp($),z=new RegExp("^"+D+"$"),U={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,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(){lt()},Q=dt((function(t){return!0===t.disabled&&T(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,c,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&&(lt(e),e=e||l,u)){if(11!==b&&(c=G.exec(t)))if(n=c[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(c[2])return g.apply(i,e.getElementsByTagName(t)),i;if((n=c[3])&&e.getElementsByClassName)return g.apply(i,e.getElementsByClassName(n)),i}if(!(C[t+" "]||d&&d.test(t))){if(p=t,f=e,1===b&&(j.test(t)||L.test(t))){for((f=J.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){C(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(R,"$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=l.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 T(e,"input")&&e.type===t}}function nt(t){return function(e){return(T(e,"input")||T(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 lt(t){var i,s=t?t.ownerDocument||t:M;return s!=l&&9===s.nodeType&&s.documentElement?(c=(l=s).documentElement,u=!S.isXMLDoc(l),f=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&M!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",Y),m.getById=it((function(t){return c.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),m.disconnectedMatch=it((function(t){return f.call(t,"*")})),m.scope=it((function(){return l.querySelectorAll(":scope")})),m.cssHas=it((function(){try{return l.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;c.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|"+E+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.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===l||t.ownerDocument==M&&X.contains(M,t)?-1:e===l||e.ownerDocument==M&&X.contains(M,e)?1:n?h.call(n,t)-h.call(n,e):0:4&i?-1:1)},l):l}for(t in X.matches=function(t,e){return X(t,null,null,e)},X.matchesSelector=function(t,e){if(lt(t),u&&!C[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){C(e,!0)}return X(e,l,null,[t]).length>0},X.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},X.attr=function(t,i){(t.ownerDocument||t)!=l&<(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--;)P.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:U,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 U.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&F.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 T(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(V," ")+" ").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(),y=!l&&!o,w=!1;if(g){if(r){for(;f;){for(u=e;u=u[f];)if(o?T(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=(c=(h=g[v]||(g[v]={}))[t]||[])[0]===b&&c[1])&&c[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=(c=(h=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(u=++d&&u&&u[f]||(w=d=0)||p.pop())&&(!(o?T(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(R,"$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 z.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===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:rt(!1),disabled:rt(!0),checked:function(t){return T(t,"input")&&!!t.checked||T(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 H.test(t.nodeName)},button:function(t){return T(t,"input")&&"button"===t.type||T(t,"button")},text:function(t){var e;return T(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 ct(){}function ht(t,i){var s,n,r,a,o,l,c,h=A[t+" "];if(h)return i?0:h.slice(0);for(o=t,l=[],c=e.preFilter;o;){for(a in s&&!(n=q.exec(o))||(n&&(o=o.slice(n[0].length)||o),l.push(r=[])),s=!1,(n=L.exec(o))&&(s=n.shift(),r.push({value:s,type:n[0].replace(R," ")}),o=o.slice(s.length)),e.filter)!(n=U[a].exec(o))||c[a]&&!(n=c[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,l).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,l){var c,h,u=[b,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[v]||(e[v]={}),n&&T(e,n))e=e[s]||e;else{if((c=h[r])&&c[0]===b&&c[1]===o)return u[2]=c[2];if(h[r]=u,u[2]=t(e,i,l))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,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 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,l){var c,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,l);if(i?i(y,p=n||(r?t:v||s)?[]:a,o,l):p=y,s)for(c=ft(p,m),s(c,[],o,l),u=c.length;u--;)(d=c[u])&&(p[m[u]]=!(y[m[u]]=d));if(r){if(n||t){if(n){for(c=[],u=p.length;u--;)(d=p[u])&&c.push(y[u]=d);n(null,p=[],c,l)}for(u=p.length;u--;)(d=p[u])&&(c=n?h.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else p=ft(p===a?p.splice(v,p.length):p),n?n(null,a,p,l):g.apply(a,p)}))}function mt(t){for(var s,n,r,a=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,u=dt((function(t){return t===s}),l,!0),d=dt((function(t){return h.call(s,t)>-1}),l,!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}];c<a;c++)if(n=e.relative[t[c].type])p=[dt(pt(p),n)];else{if((n=e.filter[t[c].type].apply(null,t[c].matches))[v]){for(r=++c;r<a&&!e.relative[t[r].type];r++);return gt(c>1&&pt(p),c>1&&ut(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(R,"$1"),n,c<r&&mt(t.slice(c,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=x[t+" "];if(!o){for(s||(s=ht(t)),n=s.length;n--;)(o=mt(s[n]))[v]?r.push(o):a.push(o);o=x(t,function(t,s){var n=s.length>0,r=t.length>0,a=function(a,o,c,h,d){var p,f,m,v=0,y="0",w=a&&[],A=[],x=i,C=a||r&&e.find.TAG("*",d),k=b+=null==x?1:Math.random()||.1,E=C.length;for(d&&(i=o==l||o||d);y!==E&&null!=(p=C[y]);y++){if(r&&p){for(f=0,o||p.ownerDocument==l||(lt(p),c=!u);m=t[f++];)if(m(p,o||l,c)){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,c);if(a){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=B.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=x),w};return n?et(a):a}(a,r)),o.selector=t}return o}function bt(t,i,s,n){var r,a,o,l,c,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=U.needsContext.test(t)?0:a.length;r--&&(o=a[r],!e.relative[l=o.type]);)if((c=e.find[l])&&(n=c(o.matches[0].replace(K,Z),J.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||J.test(t)&&ot(i.parentNode)||i),s}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,m.sortStable=v.split("").sort(k).join("")===v,lt(),m.sortDetached=it((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=X,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,X.compile=vt,X.select=bt,X.setDocument=lt,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 $=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},V=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 j(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(j(this,t||[],!1))},not:function(t){return this.pushStack(j(this,t||[],!0))},is:function(t){return!!j(this,"string"==typeof t&&q.test(t)?S(t):t||[],!1).length}});var F,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var s,n;if(!t)return this;if(i=i||F,"string"==typeof t){if(!(s="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:z.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,F=S(y);var U=/^(?:parents|prev(?:Until|All))/,H={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 $(t,"parentNode")},parentsUntil:function(t,e,i){return $(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return $(t,"nextSibling")},prevAll:function(t){return $(t,"previousSibling")},nextUntil:function(t,e,i){return $(t,"nextSibling",i)},prevUntil:function(t,e,i){return $(t,"previousSibling",i)},siblings:function(t){return V((t.parentNode||{}).firstChild,t)},children:function(t){return V(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(T(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&&(H[t]||S.uniqueSort(n),U.test(t)&&n.reverse()),this.pushStack(n)}}));var G=/[^\x20\t\r\n\f]+/g;function J(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(G)||[],(function(t,i){e[i]=!0})),e}(t):S.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){S.each(i,(function(i,s){v(s)?t.unique&&c.has(s)||r.push(s):s&&s.length&&"string"!==x(s)&&e(s)}))}(arguments),i&&!e&&l()),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||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!s}};return c},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,l=arguments,c=function(){var s,c;if(!(t<r)){if((s=i.apply(o,l))===e.promise())throw new TypeError("Thenable self-resolution");c=s&&("object"==typeof s||"function"==typeof s)&&s.then,v(c)?n?c.call(s,a(r,e,J,n),a(r,e,K,n)):(r++,c.call(s,a(r,e,J,n),a(r,e,K,n),a(r,e,J,e.notifyWith))):(i!==J&&(o=void 0,l=[s]),(n||e.resolveWith)(o,l))}},h=n?c:function(){try{c()}catch(s){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(s,h.error),t+1>=r&&(i!==K&&(o=void 0,l=[s]),e.rejectWith(o,l))}};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:J,s.notifyWith)),e[1][3].add(a(0,s,v(t)?t:J)),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,l=t.length,c=null==i;if("object"===x(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),c&&(a?(e.call(t,s),e=null):(c=e,e=function(t,e,i){return c.call(S(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},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(G)||[]).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,lt=new at,ct=/^(?:\{[\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:ct.test(t)?JSON.parse(t):t)}(i)}catch(t){}lt.set(t,e,i)}else i=void 0;return i}S.extend({hasData:function(t){return lt.hasData(t)||ot.hasData(t)},data:function(t,e,i){return lt.access(t,e,i)},removeData:function(t,e){lt.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=lt.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(){lt.set(this,t)})):tt(this,(function(e){var i;if(r&&void 0===e)return void 0!==(i=lt.get(r,t))||void 0!==(i=ut(r,t))?i:void 0;this.each((function(){lt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){lt.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,"")},l=o(),c=i&&i[3]||(S.cssNumber[e]?"":"px"),h=t.nodeType&&(S.cssNumber[e]||"px"!==c&&+l)&&pt.exec(S.css(t,e));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;a--;)S.style(t,e,h+c),(1-r)*(1-(r=o()/l||.5))<=0&&(a=0),h/=r;h*=2,S.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 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 xt(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 xt(this,!0)},hide:function(){return xt(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 Ct,kt,St=/^(?:checkbox|radio)$/i,Et=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Tt=/^$|^module$|\/(?:java|ecma)script/i;Ct=y.createDocumentFragment().appendChild(y.createElement("div")),(kt=y.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),Ct.appendChild(kt),m.checkClone=Ct.cloneNode(!0).cloneNode(!0).lastChild.checked,Ct.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!Ct.cloneNode(!0).lastChild.defaultValue,Ct.innerHTML="<option></option>",m.option=!!Ct.lastChild;var Bt={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&&T(t,e)?S.merge([t],i):i}function Pt(t,e){for(var i=0,s=t.length;i<s;i++)ot.set(t[i],"globalEval",!e||ot.get(e[i],"globalEval"))}Bt.tbody=Bt.tfoot=Bt.colgroup=Bt.caption=Bt.thead,Bt.th=Bt.td,m.option||(Bt.optgroup=Bt.option=[1,"<select multiple='multiple'>","</select>"]);var _t=/<|&#?\w+;/;function Rt(t,e,i,s,n){for(var r,a,o,l,c,h,u=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((r=t[p])||0===r)if("object"===x(r))S.merge(d,r.nodeType?[r]:r);else if(_t.test(r)){for(a=a||u.appendChild(e.createElement("div")),o=(Et.exec(r)||["",""])[1].toLowerCase(),l=Bt[o]||Bt._default,a.innerHTML=l[1]+S.htmlPrefilter(r)+l[2],h=l[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(c=mt(r),a=It(u.appendChild(r),"script"),c&&Pt(a),i)for(h=0;r=a[h++];)Tt.test(r.type||"")&&i.push(r);return u}var Dt=/^([^.]*)(?:\.(.+)|)/;function Ot(){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 $t(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=Ot)}})):void 0===ot.get(t,e)&&S.event.add(t,e,Ot)}S.event={global:{},add:function(t,e,i,s,n){var r,a,o,l,c,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++),(l=m.events)||(l=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}),c=(e=(e||"").match(G)||[""]).length;c--;)p=g=(o=Dt.exec(e[c])||[])[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=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),S.event.global[p]=!0)},remove:function(t,e,i,s,n){var r,a,o,l,c,h,u,d,p,f,g,m=ot.hasData(t)&&ot.get(t);if(m&&(l=m.events)){for(c=(e=(e||"").match(G)||[""]).length;c--;)if(p=g=(o=Dt.exec(e[c])||[])[1],f=(o[2]||"").split(".").sort(),p){for(u=S.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)||S.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[c],i,s,!0);S.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,i,s,n,r,a,o=new Array(arguments.length),l=S.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],h=S.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=S.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=((S.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&&c.nodeType&&!("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?S(n,this).index(c)>-1:S.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(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&&T(e,"input")&&$t(e,"click",!0),!1},trigger:function(t){var e=this||t;return St.test(e.type)&&e.click&&T(e,"input")&&$t(e,"click"),!0},_default:function(t){var e=t.target;return St.test(e.type)&&e.click&&T(e,"input")&&ot.get(e,"click")||T(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?Ot: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=Ot,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Ot,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Ot,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($t(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 $t(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 Vt=/<script|<style|<link/i,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function jt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ft(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function zt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ut(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]);lt.hasData(t)&&(r=lt.access(t),a=S.extend({},r),lt.set(e,a))}}function Ht(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=l(e);var n,r,a,o,c,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=Rt(e,t[0].ownerDocument,!1,t,s)).firstChild,1===n.childNodes.length&&(n=r),r||s)){for(o=(a=S.map(It(n,"script"),Ft)).length;u<d;u++)c=n,u!==p&&(c=S.clone(c,!0,!0),o&&S.merge(a,It(c,"script"))),i.call(t[u],c,u);if(o)for(h=a[a.length-1].ownerDocument,S.map(a,zt),u=0;u<o;u++)c=a[u],Tt.test(c.type||"")&&!ot.access(c,"globalEval")&&S.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):A(c.textContent.replace(Lt,""),c,h))}return t}function Gt(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)&&Pt(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),l=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++)Ht(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++)Ut(r[s],a[s]);else Ut(t,o);return(a=It(o,"script")).length>0&&Pt(a,!l&&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[lt.expando]&&(i[lt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Gt(this,t,!0)},remove:function(t){return Gt(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||jt(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=jt(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&&!Vt.test(t)&&!Bt[(Et.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),c.apply(s,i.get());return this.pushStack(s)}}));var Jt=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),l=t.style;return(i=i||Zt(t))&&(a=i.getPropertyValue(e)||i[e],o&&a&&(a=a.replace(R,"$1")||void 0),""!==a||mt(t)||(a=S.style(t,e)),!m.pixelBoxStyles()&&Jt.test(a)&&Qt.test(e)&&(s=l.width,n=l.minWidth,r=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=i.width,l.width=s,l.minWidth=n,l.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){c.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(c).appendChild(h);var t=s.getComputedStyle(h);i="1%"!==t.top,l=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(c),h=null}}function e(t){return Math.round(parseFloat(t))}var i,n,r,a,o,l,c=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(),l},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 le(t,e,i){var s=pt.exec(e);return s?Math.max(0,s[2]-(i||0))+(s[3]||"px"):e}function ce(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+=S.css(t,i+ft[a],!0,n)),s?("content"===i&&(l-=S.css(t,"padding"+ft[a],!0,n)),"margin"!==i&&(l-=S.css(t,"border"+ft[a]+"Width",!0,n))):(l+=S.css(t,"padding"+ft[a],!0,n),"padding"!==i?l+=S.css(t,"border"+ft[a]+"Width",!0,n):o+=S.css(t,"border"+ft[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 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(Jt.test(a)){if(!i)return a;a="auto"}return(!m.boxSizingReliable()&&n||!m.reliableTrDimensions()&&T(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)+ce(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),l=Kt.test(e),c=t.style;if(l||(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:c[e];"string"===(r=typeof i)&&(n=pt.exec(i))&&n[1]&&(i=yt(t,e,n),r="number"),null!=i&&i==i&&("number"!==r||l||(i+=n&&n[3]||(S.cssNumber[o]?"":"px")),m.clearCloneStyle||""!==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=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),l=s?ce(t,e,s,o,r):0;return o&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-ce(t,e,"border",!1,r)-.5)),l&&(n=pt.exec(i))&&"px"!==(n[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),le(0,i,l)}}})),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=le)})),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 l.elem})),l=function(){if(n)return!1;for(var e=de||ve(),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: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,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=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,c.opts.specialEasing);r<a;r++)if(s=we.prefilters[r].call(c,t,h,c.opts))return v(s.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=s.stop.bind(s)),s;return S.map(h,ye,c),v(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),S.fx.timer(S.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}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(G);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,l,c,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((l=!S.isEmptyObject(e))||!S.isEmptyObject(p))for(s in u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=m&&m.display)&&(c=ot.get(t,"display")),"none"===(h=S.css(t,"display"))&&(c?h=c:(xt([t],!0),c=t.style.display||c,h=S.css(t,"display"),xt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===S.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=ot.access(t,"fxshow",{display:c}),r&&(m.hidden=!g),g&&xt([t],!0),d.done((function(){for(s in g||xt([t]),ot.remove(t,"fxshow"),p)S.style(t,s,p[s])}))),l=ye(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?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,xe=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&&T(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(G);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=xe[e]||S.find.attr;xe[e]=function(t,e,s){var n,r,a=e.toLowerCase();return s||(r=xe[a],xe[a]=n,n=null!=i(t,e,s)?a:null,xe[a]=r),n}}));var Ce=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function Se(t){return(t.match(G)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function Te(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(G)||[]}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):Ce.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,Ee(this)))})):(e=Te(t)).length?this.each((function(){if(s=Ee(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,Ee(this)))})):arguments.length?(e=Te(t)).length?this.each((function(){if(s=Ee(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,Ee(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(i=Te(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=Ee(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(Ee(i))+" ").indexOf(e)>-1)return!0;return!1}});var Be=/\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(Be,""):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:[],l=a?r+1:n.length;for(s=r<0?l:a?r:0;s<l;s++)if(((i=n[s]).selected||s===r)&&!i.disabled&&(!i.parentNode.disabled||!T(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,Pe={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 Re=/^(?:focusinfocus|focusoutblur)$/,De=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,n){var r,a,o,l,c,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&&!Re.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),c=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(l=u.delegateType||g,Re.test(l+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?l:u.bindType||g,(h=(ot.get(a,"events")||Object.create(null))[t.type]&&ot.get(a,"handle"))&&h.apply(a,e),(h=c&&a[c])&&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)||c&&v(i[g])&&!b(i)&&((o=i[c])&&(i[c]=null),S.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,De),i[g](),t.isPropagationStopped()&&d.removeEventListener(g,De),S.event.triggered=void 0,o&&(i[c]=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 Oe=/\[\]$/,Me=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,$e=/^(?:input|select|textarea|keygen)/i;function Ve(t,e,i,s){var n;if(Array.isArray(e))S.each(e,(function(e,n){i||Oe.test(t)?s(t,n):Ve(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,s)}));else if(i||"object"!==x(e))s(t,e);else for(n in e)Ve(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)Ve(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")&&$e.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=/#.*$/,je=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,ze=/^(?:GET|HEAD)$/,Ue=/^\/\//,He={},We={},Ge="*/".concat("*"),Je=y.createElement("a");function Ke(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var s,n=0,r=e.toLowerCase().match(G)||[];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 l;return n[o]=!0,S.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 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}Je.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:{"*":Ge,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(He),ajaxTransport:Ke(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,n,r,a,o,l,c,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={},x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Fe.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)C.always(t[C.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return i&&i.abort(e),k(0,e),this}};if(m.promise(C),p.url=((t||p.url||Ie.href)+"").replace(Ue,Ie.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){l=y.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Je.protocol+"//"+Je.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze(He,p,e,C),c)return C;for(u in(h=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!ze.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(je,"$1"),d=(_e.test(n)?"&":"?")+"_="+Pe.guid+++d),p.url=n+d),p.ifModified&&(S.lastModified[n]&&C.setRequestHeader("If-Modified-Since",S.lastModified[n]),S.etag[n]&&C.setRequestHeader("If-None-Match",S.etag[n])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ge+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,C,p)||c))return C.abort();if(x="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),i=Ze(We,p,e,C)){if(C.readyState=1,h&&g.trigger("ajaxSend",[C,p]),c)return C;p.async&&p.timeout>0&&(o=s.setTimeout((function(){C.abort("timeout")}),p.timeout));try{c=!1,i.send(w,k)}catch(t){if(c)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,a,l){var u,d,y,w,A,x=e;c||(c=!0,o&&s.clearTimeout(o),i=void 0,r=l||"",C.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,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,C,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,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,C,u),u?(p.ifModified&&((A=C.getResponseHeader("Last-Modified"))&&(S.lastModified[n]=A),(A=C.getResponseHeader("etag"))&&(S.etag[n]=A)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=w.state,d=w.data,u=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),C.status=t,C.statusText=(e||x)+"",u?m.resolveWith(f,[d,x,C]):m.rejectWith(f,[C,x,y]),C.statusCode(b),b=void 0,h&&g.trigger(u?"ajaxSuccess":"ajaxError",[C,p,u?d:y]),v.fireWith(f,[C,x]),h&&(g.trigger("ajaxComplete",[C,p]),--S.active||S.event.trigger("ajaxStop")))}return C},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+"_"+Pe.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=Rt([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,l,c=S.css(t,"position"),h=S(t),u={};"static"===c&&(t.style.position="relative"),o=h.offset(),r=S.css(t,"top"),l=S.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),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),Jt.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=T,S.isFunction=v,S.isWindow=b,S.camelCase=nt,S.type=x,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}))},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,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 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~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 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,x=w.length!==b.length,C="",k="",S="",E=p.dir,T=p.date,B={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(B.crc32=t.crc32,B.compressedSize=t.compressedSize,B.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),g||!A&&!x||(I|=2048);var P=0,_=0;E&&(P|=16),"UNIX"===a?(_=798,P|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,E)):(_=20,P|=function(t){return 63&(t||0)}(p.dosPermissions)),u=T.getUTCHours(),u<<=6,u|=T.getUTCMinutes(),u<<=5,u|=T.getUTCSeconds()/2,d=T.getUTCFullYear()-1980,d<<=4,d|=T.getUTCMonth()+1,d<<=5,d|=T.getUTCDate(),A&&(k=s(1,1)+s(l(m),4)+v,C+="up"+s(k.length,2)+k),x&&(S=s(1,1)+s(l(y),4)+w,C+="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(B.crc32,4),R+=s(B.compressedSize,4),R+=s(B.uncompressedSize,4),R+=s(m.length,2),R+=s(C.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+m+C,dirRecord:c.CENTRAL_FILE_HEADER+s(_,2)+R+s(y.length,2)+"\0\0\0\0"+s(P,4)+s(n,4)+m+C+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,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 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,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"],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~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,x=15,C=3,k=258,S=k+C+1,E=42,T=113,B=1,I=2,P=3,_=4;function R(t,e){return t.msg=l[e],e}function D(t){return(t<<1)-(4<t?9:0)}function O(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 L(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>=C)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+C-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<C)););}while(t.lookahead<S&&0!==t.strm.avail_in)}function j(t,e){for(var i,s;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===c)return B;if(0===t.lookahead)break}if(i=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-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>=C)if(s=r._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-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 B}return t.insert=t.strstart<C-1?t.strstart:C-1,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}function F(t,e){for(var i,s,n;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===c)return B;if(0===t.lookahead)break}if(i=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-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=C-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===C&&4096<t.strstart-t.match_start)&&(t.match_length=C-1)),t.prev_length>=C&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-C,s=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),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+C-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=C-1,t.strstart++,s&&(N(t,!1),0===t.strm.avail_out))return B}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 B}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<C-1?t.strstart:C-1,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B: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)),O(this.dyn_ltree),O(this.dyn_dtree),O(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(x+1),this.heap=new n.Buf16(2*b+1),O(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*b+1),O(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?E:T,t.adler=2===e.wrap?0:1,e.last_flush=c,r._tr_init(e),u):R(t,d)}function W(t){var e=H(t);return e===u&&function(t){t.window_size=2*t.w_size,O(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=C-1,t.match_available=0,t.ins_h=0}(t.state),e}function G(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+C-1)/C),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,W(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(L(t),0===t.lookahead&&e===c)return B;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 B;if(t.strstart-t.block_start>=t.w_size-S&&(N(t,!1),0===t.strm.avail_out))return B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),B)})),new z(4,4,8,4,j),new z(4,5,16,8,j),new z(4,6,32,32,j),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 G(t,e,m,15,8,0)},i.deflateInit2=G,i.deflateReset=W,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===E)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=T);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=T,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=T)):n.status=T),0!==n.pending){if(M(t),0===t.avail_out)return n.last_flush=-1,u}else if(0===t.avail_in&&D(e)<=D(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&&(L(t),0===t.lookahead)){if(e===c)return B;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 B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B: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===c)return B;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=C&&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>=C?(i=r._tr_tally(t,1,t.match_length-C),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 B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}(n,e):s[n.level].func(n,e);if(f!==P&&f!==_||(n.status=666),f===B||f===P)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&&(O(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)!==E&&69!==e&&73!==e&&91!==e&&103!==e&&e!==T&&666!==e?R(t,d):(t.state=null,e===T?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!==E||i.lookahead)return d;for(1===o&&(t.adler=a(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===o&&(O(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,L(i);i.lookahead>=C;){for(s=i.strstart,r=i.lookahead-(C-1);i.ins_h=(i.ins_h<<i.hash_shift^i.window[s+C-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=C-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=C-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,x,C,k,S,E;i=t.state,s=t.next_in,S=t.input,n=s+(t.avail_in-5),r=t.next_out,E=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))E[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(x=65535&y,f<(w&=15)&&(p+=S[s++]<<f,(f+=8)<w&&(p+=S[s++]<<f,f+=8)),l<(x+=p&(1<<w)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,f-=w,(w=r-a)<x){if(h<(w=x-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=d,(C=0)===u){if(C+=c-w,w<A){for(A-=w;E[r++]=d[C++],--w;);C=r-x,k=E}}else if(u<w){if(C+=c+u-w,(w-=u)<A){for(A-=w;E[r++]=d[C++],--w;);if(C=0,u<A){for(A-=w=u;E[r++]=d[C++],--w;);C=r-x,k=E}}}else if(C+=u-w,w<A){for(A-=w;E[r++]=d[C++],--w;);C=r-x,k=E}for(;2<A;)E[r++]=k[C++],E[r++]=k[C++],E[r++]=k[C++],A-=3;A&&(E[r++]=k[C++],1<A&&(E[r++]=k[C++]))}else{for(C=r-x;E[r++]=E[C++],E[r++]=E[C++],E[r++]=E[C++],2<(A-=3););A&&(E[r++]=E[C++],1<A&&(E[r++]=E[C++]))}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,x,C=!0;function k(t){if(C){var e;for(A=new s.Buf32(512),x=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,x,0,t.work,{bits:5}),C=!1}t.lencode=A,t.lenbits=9,t.distcode=x,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,x,C,E,T,B,I,P,_,R,D,O,M,N,$,V,q=0,L=new s.Buf8(4),j=[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,x=b,C=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<(E=i.length)&&(E=b),E&&(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,E,M)),512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,i.length-=E),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break t;for(E=0;M=p[m+E++],i.head&&M&&i.length<65536&&(i.head.name+=String.fromCharCode(M)),M&&E<b;);if(512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,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(E=0;M=p[m+E++],i.head&&M&&i.length<65536&&(i.head.comment+=String.fromCharCode(M)),M&&E<b;);if(512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,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(E=i.length){if(b<E&&(E=b),y<E&&(E=y),0===E)break t;s.arraySet(f,p,m,E,v),b-=E,m+=E,y-=E,v+=E,i.length-=E;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[j[i.have++]]=7&w,w>>>=3,A-=3}for(;i.have<19;)i.lens[j[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(;P=(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],E=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,E=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,E=11+(127&(w>>>=I)),w>>>=7,A-=7}if(i.have+E>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;E--;)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,C),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;P=(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(P&&!(240&P)){for(R=I,D=P,O=_;P=(q=i.lencode[O+((w&(1<<R+D)-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===P){i.mode=26;break}if(32&P){i.back=-1,i.mode=12;break}if(64&P){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&P,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(;P=(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&P)){for(R=I,D=P,O=_;P=(q=i.distcode[O+((w&(1<<R+D)-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&P){t.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&P,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(E=C-y,i.offset>E){if((E=i.offset-E)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}T=E>i.wnext?(E-=i.wnext,i.wsize-E):i.wnext-E,E>i.length&&(E=i.length),B=i.window}else B=f,T=v-i.offset,E=i.length;for(y<E&&(E=y),y-=E,i.length-=E;f[v++]=B[T++],--E;);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(C-=y,t.total_out+=C,i.total+=C,C&&(t.adler=i.check=i.flags?r(i.check,f,C,v-C):n(i.check,f,C,v-C)),C=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||C!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&S(t,t.output,t.next_out,C-t.avail_out)?(i.mode=31,-4):(x-=t.avail_in,C-=t.avail_out,t.total_in+=x,t.total_out+=C,i.total+=C,i.wrap&&C&&(t.adler=i.check=i.flags?r(i.check,f,C,t.next_out-C):n(i.check,f,C,t.next_out-C)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==x&&0===C||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,x=d.bits,C=0,k=0,S=0,E=0,T=0,B=0,I=0,P=0,_=0,R=0,D=null,O=0,M=new s.Buf16(16),N=new s.Buf16(16),$=null,V=0;for(C=0;C<=15;C++)M[C]=0;for(k=0;k<l;k++)M[e[i+k]]++;for(T=x,E=15;1<=E&&0===M[E];E--);if(E<T&&(T=E),0===E)return c[h++]=20971520,c[h++]=20971520,d.bits=1,0;for(S=1;S<E&&0===M[S];S++);for(T<S&&(T=S),C=P=1;C<=15;C++)if(P<<=1,(P-=M[C])<0)return-1;if(0<P&&(0===t||1!==E))return-1;for(N[1]=0,C=1;C<15;C++)N[C+1]=N[C]+M[C];for(k=0;k<l;k++)0!==e[i+k]&&(u[N[e[i+k]]++]=k);if(b=0===t?(D=$=u,19):1===t?(D=n,O-=257,$=r,V-=257,256):(D=a,$=o,-1),C=S,v=h,I=k=R=0,g=-1,m=(_=1<<(B=T))-1,1===t&&852<_||2===t&&592<_)return 1;for(;;){for(y=C-I,A=u[k]<b?(w=0,u[k]):u[k]>b?(w=$[V+u[k]],D[O+u[k]]):(w=96,0),p=1<<C-I,S=f=1<<B;c[v+(R>>I)+(f-=p)]=y<<24|w<<16|A,0!==f;);for(p=1<<C-1;R&p;)p>>=1;if(0!==p?(R&=p-1,R+=p):R=0,k++,0==--M[C]){if(C===E)break;C=e[i+u[k]]}if(T<C&&(R&m)!==g){for(0===I&&(I=T),v+=S,P=1<<(B=C-I);B+I<E&&!((P-=M[B+I])<=0);)B++,P<<=1;if(_+=1<<B,1===t&&852<_||2===t&&592<_)return 1;c[g=R&m]=T<<24|B<<16|v-h}}return 0!==R&&(c[v+R]=C-I<<24|64<<16),d.bits=T,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],x=[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],C=[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 E=new Array(2*u);a(E);var T=new Array(512);a(T);var B=new Array(256);a(B);var I=new Array(l);a(I);var P,_,R,D=new Array(u);function O(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?T[t]:T[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 L(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function j(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 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 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=B[n])+c+1,e),0!==(a=A[r])&&V(t,n-=I[r],a),q(t,r=N(--s),i),0!==(a=x[r])&&V(t,s-=D[r],a)),o<t.last_lit;);q(t,v,e)}function G(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),j(r,c,t.bl_count)}function J(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(D);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++)B[i++]=s;for(B[i-1]=s,s=n=0;s<16;s++)for(D[s]=n,t=0;t<1<<x[s];t++)T[n++]=s;for(n>>=7;s<u;s++)for(D[s]=n<<7,t=0;t<1<<x[s]-7;t++)T[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(j(S,h+1,r),t=0;t<u;t++)E[2*t+1]=5,E[2*t]=L(t,5);P=new O(S,A,c+1,h,f),_=new O(E,x,0,u,f),R=new O(new Array(0),C,0,d,m)}(),Z=!0),t.l_desc=new M(t.dyn_ltree,P),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)),G(t,t.l_desc),G(t,t.d_desc),l=function(t){var e;for(J(t,t.dyn_ltree,t.l_desc.max_code),J(t,t.dyn_dtree,t.d_desc.max_code),G(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),W(t,S,E)):(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),W(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*(B[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,s){(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,void 0!==i.g?i.g:"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 x(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 C(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 E(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 T(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 B(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 P(){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 D(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:"+C(t.c)+";font-style:"+S(t)+";font-weight:"+t.f+"00;"}function O(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=D(t=new x(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=t,t=D(t=new x(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=t,t=D(t=new x("serif",k(this.a))),this.j.a.style.cssText=t,t=D(t=new x("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)},O.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 "+C(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 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=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))?j(t,t.v):j(t,t.B):function(t){setTimeout(a((function(){L(this)}),t),50)}(t):j(t,t.v)}function j(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(),L(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")):B(t.a))}function H(t){this.j=t,this.a=new P,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)B(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 O(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 G(t,e){this.c=t,this.a=e}function J(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){W(t,r,e,i,s)}))}(this,new T(this.c,t),t)},G.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 x(l,i))):a.push(new x(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([])},J.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 x(s[0],l[c]));else o.push(new x(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 x(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 x(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 x(a.name,E("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 J(e,t)},at.a.c.fontdeck=function(t,e){return new rt(e,t)},at.a.c.monotype=function(t,e){return new G(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].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.21 (2024-10-16)",languages:["en","ar","ast","bs","ca","ca_ES@valencia","cs","da","de","el","es","eu","fr","gl","he","it","ja","nl","pl","pt","pt_BR","ro","ru","tr","vec","zh_TW"],messages:{ar:{Version:"الإصدار",time:"الوقت",actions:"المحاولات",score:"النتيجة","Next activity":"النشاط التالي","Previous activity":"النشاط السابق","Restart activity":"استئنف النشاط",Information:"المعلومة","Current results":"تقارير المستخدم","User:":"المستخدم:","Projects:":"المشاريع:",Project:"المشروع:",sequence:"التسلسل",activity:"النشاط",OK:"موافق","Total:":"المجموع:"},ast:{Version:"Versión",time:"tiempu",actions:"intentos",score:"marcador","Next activity":"Xera siguiente","Previous activity":"Xera anterior","Restart activity":"Reaniciar xera",Information:"Información","Results are not currently being saved":"L'informe nun ta rexistráu en nenguna base de datos","Current results":"Informes d'usuariu","Session started:":"Entamu de sesión:","Reports system:":"Sistema d'informes:","User:":"Usuariu:","Projects:":"Proyeutos:","Sequences:":"Secuencies:","Activities done:":"Xeres feches:","Activities solved:":"Xeres correctes:","Global score:":"Puntuación global:","Total time in activities:":"Tiempu total en xeres:","Actions done:":"Aiciones feches:","No activities done!":"¡Nenguna información sobre xeres!",Project:"Proyeutu:",sequence:"Secuencia",activity:"Xera",OK:"OK",YES:"SI",NO:"NON","Total:":"Total:"},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","Current results":"Izvješća korisnika","Session started:":"Sesija započeta:","User:":"Korisnik:","Projects:":"Projekti:","Activities done:":"Urađene aktivnosti:","Activities solved:":"Aktivnosti ok:","Global score:":"Ukupan rezultat:","Total time in activities:":"Ukupno vrijeme aktivnosti:","Actions done:":"Urađene aktivnosti:",Project:"Projekt:",sequence:"Sekvenca",activity:"Aktivnost",OK:"Uredu",YES:"DA",NO:"NE","Total:":"Ukupno:"},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/ària:","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/ària:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","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:"},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:","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:"},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","Current results":"Bruger rapport","User:":"Bruger:","Projects:":"Projekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter udført:","Activities solved:":"Aktiviteter OK:","Global score:":"Global score:","No activities done!":"Ingen aktiviteter rapporteret!",Project:"Projekt",sequence:"Sequence",activity:"Aktivitet",OK:"Ok",YES:"JA",NO:"IKKE","Total:":"Total:"},de:{Version:"Version",time:"Zeit",actions:"Versuche",score:"Ergebnis","Next activity":"Nächste Übung","Previous activity":"Vorherige Übung","Restart activity":"Übung neu starten",Information:"Information","Results are not currently being saved":"Bericht in keiner Datenbank eingetragen","Current results":"Benutzerberichte","Session started:":"Sitzung gestartet:","Reports system:":"Report system:","User:":"User:","Projects:":"Projekte:","Sequences:":"Sequenzen:","Activities done:":"Beendete Übungen:","Activities solved:":"Korrekte Übungen:","Global score:":"Gesamtpunktezahl:","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:"},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:":"Συνολική βαθμολογία:","Total time in activities:":"Συνολικός χρόνος δραστηριοτήτων:","Actions done:":"Οι ενέργειες ολοκληρώθηκαν:","No activities done!":"Για καμμία δραστηριότητα δεν έχει υποβληθεί αναφορά!",Project:"Έργο",sequence:"Αλληλουχία",activity:"Δραστηριότητα",OK:"Εντάξει",YES:"Ναί",NO:"όχι","Total:":"Σύνολο:"},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/aria:","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 rico.","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:","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:"},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:"Information","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:":"Report système:","User:":"Utilisateur:","Projects:":"Projets:","Sequences:":"Séquences:","Activities done:":"Activités faites:","Activities solved:":"Activités ok:","Global score:":"Score global:","(out of all project activities)":"(Hors de toutes les activités du projet)","Total time in activities:":"Temps total sur les activités:","Actions done:":"Actions faites:","No activities done!":"Pas d'activités rapportées!",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:","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:"},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:":"ניקוד כללי:","Total time in activities:":"משך הפעילויות המצטבר:","Actions done:":"פעולות שבוצעו:","No activities done!":"לא דווחו פעילויות!",Project:"פרוייקט",sequence:"רצף",activity:"פעילות",OK:"אישור",YES:"כן",NO:"לא","Total:":"סך הכל:"},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 alcun database","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:","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:"SI",NO:"NO","Total:":"Totale:"},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":"画像フラグメント"},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:","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:"},pl:{Version:"Wersja",time:"czas",actions:"działania",score:"wynik","Next activity":"Następne działanie","Previous activity":"Poprzednia aktywność","Restart activity":"Restartuj 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:":"Projekty:","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:"kolejność",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 działań)","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:","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:"},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:","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:"},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:":"Общий счёт:","Total time in activities:":"Общее время активности:","Actions done:":"Завершено действий:","No activities done!":"Нет сообщенных действий!",Project:"Проект",sequence:"Последовательность",activity:"Активность",OK:"ОК",YES:"да",NO:"нет","Total:":"Итого:"},tr:{Version:"Sürüm",time:"zaman",actions:"Denemeler",score:"sonuç","Next activity":"Bir sonraki etkinlik","Previous activity":"Bir önceki etkinlik","Restart activity":"Etkinliği tekrar başlat",Information:"Bilgi","Results are not currently being saved":"Rapor herhangi bir veritabanında kaydedilmedi","Current results":"Kullanıcı raporları","Session started:":"Oturum başlatıldı","Reports system:":"Sistem raporu:","User:":"Kullanıcı:","Projects:":"Projeler:","Sequences:":"Etkinlik dizisi","Activities done:":"Etkinlikler başlatılıyor:","Activities solved:":"Etkinlikler tamam:","Global score:":"Genel sonuç:","Total time in activities:":"Etkinlikde geçirilen toplam zaman:","Actions done:":"Eylem gerçekleştiriliyor:","No activities done!":"Etkinlik raporu yok!",Project:"Proje",sequence:"Etkinlik dizisi",activity:"Etkinlik",OK:"Tamam",YES:"Evet",NO:"hiçbir","Total:":"Toplam:"},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","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:"},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:":"總成績:","Total time in activities:":"活動總時間:","Actions done:":"活動完成:","No activities done!":"沒有活動報告",Project:"專案:",sequence:"順序",activity:"活動",OK:"確定",YES:"是",NO:"否","Total:":"總計:"}}},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?C():""} ${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 x(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 C(){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 E(t){return"true"===t?1:"false"===t?0:arguments.length>1&&void 0!==arguments[1]?arguments[1]:2}function T(t){return Array(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).fill(t).join("")}function B(t){return null==t}function I(t,e){return null==t&&null==e||t===e}function P(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 D(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]=D(i)}}))}return t}function O(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=G(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]);L(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 L(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 j(t,e,i){return i.forEach((i=>{if(i.key){const{key:s,fn:n,group:r,init:a,params:o}=i;if(!L(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 L(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 W(t,e){return Math.round(t/e)*e}function G(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return t.toFixed?Number(t.toFixed(e)):t}function J(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(B(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:x,getDateTime:C,parseOldDate:k,cleanOldLanguageTag:S,FALSE:0,TRUE:1,DEFAULT:2,getTriState:E,fillString:T,isNullOrUndef:B,isEquivalent:I,getXmlText:P,parseXmlNode:_,getXmlNodeText:R,reduceTextsToStrings:D,cssToString:function(t){return Object.keys(t).reduce(((e,i)=>`${e}${i}:${t[i]};`),"")},checkColor:O,colorHasTransparency:M,cloneObject:N,normalizeObject:$,getAttr:V,getValue:q,isEmpty:L,setAttr:j,buildObj:F,isSeparator:z,isWordDelimiter:U,stringToWords:H,roundTo:W,fx:G,compareMultipleOptions:J,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 j(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=O(t.attr("source"),"black"),this.c2=O(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 j(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 j(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 xt{constructor(t,e){t instanceof xt?(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 j(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 xt(this)}}Object.assign(xt.prototype,{x:0,y:0});class Ct{constructor(t,e){t instanceof xt&&e instanceof xt?(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 j(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 Ct&&(e=t.height,t=t.width),this.width=t,this.height=e,this}getSurface(){return this.width*this.height}}Object.assign(Ct.prototype,{width:0,height:0});class kt{constructor(t){this.pos=t||new xt}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&&Et||"path"===t.type&&Tt||null;if(e)return(new e).setAttributes(t);console.log("unknown shape:",t)}}Object.assign(kt.prototype,{type:"shape",pos:new xt,type:"shape"});class St extends kt{constructor(t,e,i,s){let n=t,r=e;t instanceof St?(r=new Ct(t.dim.width,t.dim.height),n=new xt(t.pos.x,t.pos.y)):t instanceof xt?(n=new xt(t.x,t.y),e instanceof Ct&&(r=new Ct(e.width,e.height))):t instanceof Array?(n=new xt(t[0],t[1]),r=new Ct(t[2]-t[0],t[3]-t[1])):"number"==typeof i&&"number"==typeof s&&(n=new xt(t,e),r=new Ct(i,s)),super(n),this.dim=r instanceof Ct?r:r instanceof xt?new Ct(r.x-this.pos.x,r.y-this.pos.y):new Ct,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 xt(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 j(this,t,["type",{key:"pos",fn:xt},{key:"dim",fn:Ct}])}}Object.assign(St.prototype,{type:"rect",dim:new Ct});class Et 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 Et&&super.equals(t)}clone(){return new Et(this.pos,this.dim)}isRect(){return!1}toString(){return`Ellipse enclosed in ${this.getCoords()}`}}Object.assign(Et.prototype,{type:"ellipse"});class Tt extends kt{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 St,this.enclosingPoints=[],this.calcEnclosingRect(),this.pos=this.enclosing.pos,this}clone(){return new Tt(this.strokes.map((t=>t.clone())))}addStroke(t){return this.strokes.push(t),this}calcEnclosingRect(){this.enclosingPoints=[];let t=new xt;this.strokes.forEach((e=>{e.getEnclosingPoints(t).forEach((e=>{t=new xt(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 xt(this.enclosingPoints[0]),s=new xt(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 Ct(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 Ct(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(Tt.prototype,{type:"path",strokes:[],enclosing:new St,enclosingPoints:[]});class Bt{constructor(t,e){if(this.type=t,e&&e.length>0)if(e[0]instanceof xt)this.points=e.map((t=>new xt(t)));else{this.points=[];for(let t=0;t<e.length;t+=2)this.points.push(new xt(e[t],e[t+1]))}}static getQuadraticPoints(t,e,i,s){s||(s=gt.BEZIER_POINTS);const n=[],r=new xt,a=new xt;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 xt(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=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 xt(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`${this.type}:${this.points?this.points.map((t=>`${G(t.x)},${G(t.y)}`)).join(","):""}`}}Object.assign(Bt.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 Pt{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(Pt.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:xt,Dimension:Ct,Shape:kt,Rectangle:St,Ellipse:Et,Path:Tt,PathStroke:Bt,Action:It,Timer:Pt,Container:_t};class Dt{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(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(Dt.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 Ot=Dt;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 Lt=qt;class jt 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),!jt.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(jt.prototype.buttons),this.counters=N(jt.prototype.counters),this.msgArea=N(jt.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))),jt.skinStack.push(this)}static registerClass(t,e){return jt.CLASSES[t]=e,e}static registerStyleSheet(t,e){let i=!1;const s=lt(e);s.__JClicID||(s.__JClicID="SK"+jt.lastId++);let n=jt.rootStyles[s.__JClicID];return n||(n=[],jt.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=jt.skinStack.find((i=>i.name===t&&i.ps===e));if(i)return i}let s=jt.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=jt.CLASSES.custom:(m("warn",`Unknown skin class: ${t}`),s=jt.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=jt.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:"),x(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(x(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(x(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 Ct(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}}jt.skinStack=[],jt.rootStyles={},jt.lastId=1,jt.CLASSES={},Object.assign(jt.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=jt;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 xt(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 j(this,t,["type","file","externalParam",{key:"absLocation",fn:xt},"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 Wt{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=E(t.attr("enabled")),this}getAttributes(){return V(this,["enabled|2","file"])}setAttributes(t){return j(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(Wt.prototype,{file:null,enabled:2,player:null,audio:null});const Gt=Wt;class Jt{constructor(t){t&&(this.elements=Object.assign({},this.elements,t.elements),this.enabled=t.enabled)}setProperties(t){return this.enabled=E(t.attr("enabled"),this.enabled),t.children().each(((t,i)=>{const s=i.getAttribute("id");this.elements[s]=new Gt(s),this.elements[s].setProperties(e()(i))})),this}getAttributes(){return V(this,["enabled|2","elements"])}setAttributes(t){return j(this,t,["enabled",{key:"elements",fn:Gt,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()}}}Jt.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(Jt.prototype,{elements:{start:new Gt("start",Jt.MEDIA.start),click:new Gt("click",Jt.MEDIA.click),actionOk:new Gt("actionOk",Jt.MEDIA.actionOk),actionError:new Gt("actionError",Jt.MEDIA.actionError),finishedOk:new Gt("finishedOk",Jt.MEDIA.finishedOk),finishedError:new Gt("finishedError",Jt.MEDIA.finishedError)},enabled:2,globalEnabled:!0});const Kt=Jt;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(D(_(n)));break;case"organization":this.organizations.push(D(_(n)));break;case"revision":const t=D(_(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 j(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=>{L(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=>{L(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=>{L(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=>{L(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.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=O(s.attr("foreground"),this.textColor),this.backColor=O(s.attr("background"),this.backColor),this.shadowColor=O(s.attr("shadow"),this.shadowColor),this.inactiveColor=O(s.attr("inactive"),this.inactiveColor),this.alternativeColor=O(s.attr("alternative"),this.alternativeColor),this.borderColor=O(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 j(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 Ct(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 j(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 Ct(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:j(this,t,["id","item","border","avoidOverlapping","image","text","objectType",{key:"dimension",fn:Ct},{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 xe{constructor(t,e){this.reset(t,e)}static registerClass(t,e){return xe.CLASSES[t]=e,e}static getShaper(t,e,i){const s=xe.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=xe.readShapeData(e,this.scaleX,this.scaleY);this.enclosing=i,this.showEnclosure=!0,this.hasRemainder=!0}))})),t.children("shape").each(((t,e)=>{this.shapeData[t]=xe.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 Et(o[0],o[1],o[2],o[3]);break;default:n.push(new Bt(a[0],o))}})),!r&&n.length>0?new Tt(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=xe.getShaper(t.className,t.nCols,t.nRows);return j(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(xe.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}),xe.CLASSES={};const Ce=xe;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=Ce.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){j(this,t,["id","image","ncw","nch","w","h","border",{key:"style",fn:be},{key:"shaper",fn:Ce},"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=Ce.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 Ee{constructor(){}static getProvider(t){let e=null;if(t){const i=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),s=Ee.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,Ee.CLASSES[t.className])).setAttributes(t,...e)}init(){}generateContent(t,e,i,s){return this.process(new Ee.ActiveBagContentKit(t,e,i,s))}process(t){return!1}static registerClass(t,e){return Ee.CLASSES[t]=e,e}}Object.assign(Ee.prototype,{numericContent:!1}),Ee.ActiveBagContentKit=class{constructor(t,e,i,s){this.nRows=t,this.nCols=e,this.content=i,this.useIds=s}},Ee.CLASSES={"@tagreplace.TagReplace":Ee},Ee.registerClass("@tagreplace.TagReplace",Ee);const Te=Ee;class Be{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 j(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(Be.prototype,{ncw:1,nch:1,w:20,h:20,border:!1,style:null,text:null,wild:"*",randomChars:gt.RANDOM_CHARS});const Ie=Be;class Pe{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=Pe.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=Pe.CLASSES[t.className];if(e){return j(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(Pe.prototype,{className:null,initiated:!1,collator:null,checkCase:!1});class _e extends Pe{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}),Pe.CLASSES={"@BasicEvaluator":_e,"@ComplexEvaluator":Re};const De=Pe;class Oe{constructor(){this.style={default:{...Oe.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=O(n,"white"),i[t]=n,s["background-color"]=n;break;case"foreground":n=O(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 j(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]:{})}}Oe.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(Oe.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 j(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}),Oe.TextTarget=Me;const Ne=Oe,$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=P(this),this.showSolution=v(s.attr("showSolution"),!1),this.helpWindow=null!==this.helpMsg||this.showSolution;break;case"container":this.bgColor=O(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=O(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 xt).setProperties(s),this.absolutePositioned=!0;break;case"size":this.windowSize=(new Ct).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=Te.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=De.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"),B(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 j(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:xt},{key:"windowSize",fn:Ct},{key:"messages",fn:Ae,group:"object",init:"key",params:[e]},{key:"abc",fn:Se,group:"object",init:"key",params:[e]},{key:"acp",fn:Te,params:[e]},"menuElements",{key:"tgc",fn:Ie},"clues","clueItems",{key:"prevScreenStyle",fn:be},{key:"ev",fn:De},{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 Ct(this.windowSize)}setWindowSize(t){this.windowSize=new Ct(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 Ct(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 Ct(100,100),this.preferredSize=new Ct(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 Ct(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 xt;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 Ct(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 Le=Ve;class je{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?Le.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 Le.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(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 Fe=je;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 We=He;class Ge{constructor(t){this.name=t.tag,this.description=t.description,this.activities=[],this.currentActivity=null,this.totalTime=0,this.closed=!1,this.info=new Je(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 We(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(Ge.prototype,{name:"",description:"",activities:[],currentActivity:null,totalTime:0,closed:!1,info:null});class Je{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(Je.prototype,{sqReg:null,valid:!1,nActivities:0,nActClosed:0,nActSolved:0,nActScore:0,ratioSolved:0,nActions:0,tScore:0,tTime:0}),Ge.Info=Je;const Ke=Ge;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 Lt,this.counterVal={score:0,actions:0,time:0},this.bgImageOrigin=new xt,this.buildActions(),this.history=new Ot(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 Lt,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 Pt((()=>{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 Pt((()=>{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,${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,${window.JClicObject.projectFiles[r]}`}return void o(l)}this.setProject(t),i||s||(i="0"),this.reporter&&this.reporter.newSession(t)}if(!B(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 Ct(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 xt(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 Ct(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 xt(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}`,disabled:o}).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 xi 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(xi.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 Ci=Ft.registerClass("simple",xi);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 Ei 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(Ei.prototype,{skinId:"JClicEmptySkin",mainCSS:".ID .JClicPlayerCnt {margin:0;}"});const Ti=Ft.registerClass("empty",Ei);class Bi 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)):"",x=g.data?ot(g.data,new St(i,u-l,n-i,p-u)):"",C=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: ${O(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(${x});}\n.ID .JClicCell8 {background-image:url(${C});background-repeat:repeat-x;}\n.ID .JClicCell9 {background-image:url(${k});}`,E=`\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);}`,T=`\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)}`,x=y<h?`top:${Math.round(2*y/3-u/6)}`:`bottom:${Math.round(2*(p-y-u)/3-u/6)}`,C=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:-${C}px -${k}px !important;}\n`,E+=`.ID .Btn-${l} {${v}px;${A}px;}\n`,T+=`.ID .Btn-${l} {${b}px;${x}px;}\n`,d.active&&(S+=`.ID .Btn-${l}:active {background-position:-${C+d.active.right}px -${k+d.active.down}px !important;}\n`),d.over&&(S+=`.ID .Btn-${l}:hover {background-position:-${C+d.over.right}px -${k+d.over.down}px !important;}\n`),d.disabled&&(S+=`.ID .Btn-${l}:disabled {background-position:-${C+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=O(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,x=u.point.label.top||A-r,C=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)}`,B=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;${C}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:${x-A}px;left:${v-m}px;}`,E+=`.ID .Counter-${a} {${y}px;${k}px;}\n`,T+=`.ID .Counter-${a} {${w}px;${B}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`,E+=`.ID .JClicProgressAnimation {${a}px;${d}px;}\n`,T+=`.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;}`,E+=`.ID .JClicMsgBox {left:${Math.round(e/2)}px;right:${Math.round(s/2)}px;height:${Math.round(t.height/2)}px;${r}px;}`,T+=`.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:E,twoThirds:T}}_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(Bi.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",Bi);class Pi extends Ce{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 xt(s*t,i*e),new Ct(t,e));this.initiated=!0}}Object.assign(Pi.prototype,{rectangularShapes:!0});const _i=Ce.registerClass("@Rectangular",Pi);const Ri=Ce.registerClass("@Holes",class extends Ce{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 Di=Ce.registerClass("@JigSaw",class extends Ce{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 Tt([new Bt("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 Bt("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 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 c=r*this.toothHeightFactor*l;t.addStroke(new Bt("L",[e,s+c])),t.addStroke(new Bt("L",[e+a,s+c])),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,l=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 c=n*this.toothHeightFactor*l;t.addStroke(new Bt("L",[i+c,e])),t.addStroke(new Bt("L",[i+c,e+a])),t.addStroke(new Bt("L",[i,e+a])),t.addStroke(new Bt("L",[i,s+r*o]))}}});const Oi=Ce.registerClass("@TriangularJigSaw",class extends Di{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 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 c=r*this.toothHeightFactor*l;t.addStroke(new Bt("L",[e+a/2,s+c])),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,l=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 c=n*this.toothHeightFactor*l;t.addStroke(new Bt("L",[i+c,e+a/2])),t.addStroke(new Bt("L",[i,e+a])),t.addStroke(new Bt("L",[i,s+r*o]))}}});class Mi extends Di{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 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 c=r*this.toothHeightFactor*l/8;t.addStroke(new Bt("B",[e+4*a,s,e+6*a,s-c,e+4*a,s-3*c])),t.addStroke(new Bt("B",[e+2*a,s-5*c,e+10*a,s-5*c,e+8*a,s-3*c])),t.addStroke(new Bt("B",[e+6*a,s-1*c,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,l=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 c=n*this.toothHeightFactor*l/8;t.addStroke(new Bt("B",[i,e+4*a,i-c,e+6*a,i-3*c,e+4*a])),t.addStroke(new Bt("B",[i-5*c,e+2*a,i-5*c,e+10*a,i-3*c,e+8*a])),t.addStroke(new Bt("B",[i-1*c,e+6*a,i,e+8*a,i,e+12*a])),t.addStroke(new Bt("L",[i,s+r*o]))}}}Object.assign(Mi.prototype,{baseWidthFactor:3/4,toothHeightFactor:.6});const Ni=Ce.registerClass("@ClassicJigSaw",Mi),$i=["+","-",String.fromCharCode(215),":"],Vi=-12345,qi=Intl&&Intl.NumberFormat().format(1.1).indexOf(",")>0;class Li extends Te{constructor(){super(),this.className="@arith.Arith",this.numericContent=!0,this.opA=new Li.Operator,this.opB=new Li.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 j(this,t,["className",{key:"opA",fn:Li.Operator},{key:"opB",fn:Li.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=Li.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=Li.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=Li.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=Li.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,x=o,C=o*l,k=null;if(o<=0||l<=0||null===c||c.length<1||null===c[0])return!1;if(C<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<C;e++){for(n=new Li.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=C-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<C;e++)switch(a=d[Math.floor(Math.random()*r)],f=Li.DecFormat(u[e].numA.vf,u[0].numA.c),g=Li.DecFormat(u[e].numB.vf,u[0].numB.c),m=Li.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<C;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(x*A!==s){let E=!1;switch(s){case 6:x=E?2:3,A=E?3:2;break;case 8:x=E?2:4,A=E?4:2;break;case 9:x=3,A=3;break;case 10:x=E?2:5,A=E?5:2;break;case 12:x=E?3:4,A=E?4:3;break;case 14:x=E?2:7,A=E?7:2;break;case 15:x=E?3:5,A=E?3:5;break;case 16:x=4,A=4;break;case 18:x=E?6:3,A=E?3:6;break;case 20:x=E?4:5,A=E?5:4;break;default:x=E?1:s,A=E?s:1}}}if(qi){function T(t){return t.replace(/\./g,",")}b=b.map(T),y=y.map(T),w=w.map(T)}return c[0].setTextContent(b,l,o),null!==k&&c[0].setIds(k),c.length>1&&null!==c[1]&&(c[1].setTextContent(y,A,x),c[1].getShaper().reset(A,x)),c.length>2&&null!==c[2]&&c[2].setTextContent(w,l,o),!0}}Object.assign(Li.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"}),Li.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 j(this,t,["limInf","limSup","numDec","wZero","wOne","wMinusOne","fromList","lst"])}},Object.assign(Li.Operator.prototype,{limInf:0,limSup:10,numDec:0,wZero:!1,wOne:!1,wMinusOne:!1,fromList:0,lst:[]}),Li.Num=class{constructor(){this.vf=0,this.c=0}format(){return Li.DecFormat(this.vf,this.c)}},Li.Operation=class{constructor(){this.numA=new Li.Num,this.numB=new Li.Num,this.numR=new Li.Num,this.op=0}};const ji=Te.registerClass("@arith.Arith",Li);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.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.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 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.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(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 Wi 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.bind("focus change",(e=>{e.textTarget=t,this.processEvent(e)}))):(t.currentText=t.iniText?t.iniText:T(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(),ft(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,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(Wi.prototype,{locked:!0}),Hi.Panel=Wi;const Gi=Le.registerClass("@text.FillInBlanks",Hi),Ji="source-over";class Ki{constructor(t,e){this.parent=t,this.ctx=e.get(-1).getContext("2d",{willReadFrequently:!0}),this.dim=new Ct(this.ctx.canvas.width,this.ctx.canvas.height),this.origin=new xt,this.dest=new xt,this.relativePos=new xt}moveBy(t,e){this.moveTo(xt(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 xt(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y);this.bgRect=new St(i,this.bx?this.bx.dim:new Ct);const s=new xt(t.x-this.relativePos.x,t.y-this.relativePos.y);this.bgRect.add(new St(s,this.bx?this.bx.dim:new Ct)),this.bgRect.grow(10,10),null!==this.bx?(this.bx.moveTo(new xt(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!==Ji?(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 xt(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!==Ji&&(this.ctx.globalCompositeOperation=Ji)}}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:Ji,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").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 xt;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 xt(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=Le.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=Le.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.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(ss.prototype,{targetsMarked:!1,lastTimeStamp:0,spansChecked:new Set}),is.Panel=ss;const ns=Le.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 Ct(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 Ct(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 x=new St(e.getBounds());return x.add(i.getBounds()),d.width=x.dim.width+2*n,d.height=x.dim.height+2*n,d}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){const t=this.getPreferredSize();return new Ct(Math.max(gt.MIN_CELL_SIZE,t.width),Math.max(gt.MIN_CELL_SIZE,t.height))}getScaledSize(t){const e=this.getPreferredSize();return new Ct(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 xt(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 xt(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 xt;for(let t=0;t<i;t++){const e=this.getActiveBox(t);s[t]=new xt(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 xt(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 xt(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 xt(s,n))}))}swapCellPositions(t,e,i){const s=new xt(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 xt(s,n),new Ct(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 Ct(gt.MIN_CELL_SIZE*this.nCols,gt.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new Ct(W(t*this.preferredBounds.dim.width,this.nCols),W(t*this.preferredBounds.dim.height,this.nRows))}getCoord(t){return new xt(t.idLoc%this.nCols,Math.floor(t.idLoc/this.nCols))}getCoordDist(t,e){const i=this.getCoord(t),s=this.getCoord(e);return new xt(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(J(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.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 xt(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(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 xt(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 xt(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 xt(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 xs=Ve.registerClass("@panels.Explore",ws);class Cs 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=="},Cs.Panel=ks;const Ss=Ve.registerClass("@panels.Menu",Cs);class Es extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Ts 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 xt;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 xt(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.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(Ts.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Es.Panel=Ts;const Bs=Ve.registerClass("@puzzles.DoublePuzzle",Es);class Is extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Ps 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 xt;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 xt(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(Ps.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Is.Panel=Ps;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 Ds 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 xt(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(Ds.prototype,{bg:null,parkBg:null,hiddenBox:null,hiddenBoxIndex:-1,events:["click"]}),Rs.Panel=Ds;const Os=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 xt;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 xt(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 xt;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 xt(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.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(qs.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Vs.Panel=qs;const Ls=Ve.registerClass("@associations.SimpleAssociation",Vs);class js 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(js.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 xt;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 xt(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.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(Fs.prototype,{invAssCheck:null}),js.Panel=Fs;const zs=Le.registerClass("@associations.ComplexAssociation",js),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 Ws 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 Pt((()=>this.blink(0)),500,!1),this.cursorEnabled=!1,this.useCursor=!1,this.wildTransparent=!1,this.cursor=new xt}static createEmptyGrid(t,e,i,s,n,r){const a=new Ws(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 xt;let s=!1,n=!1;for(let r=0;r<t;r++)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++)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 xt(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 xt(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 xt(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)&&!!(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 Ct(Us.MIN_CELL_SIZE*this.nCols,Us.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new Ct(W(t*this.preferredBounds.dim.width,this.nCols),W(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(!(e&Hs.TRANSPARENT)){const o=!!(e&Hs.INVERTED),l=!!(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",!(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(Ws.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}),Ws.defaults=Us,Ws.flags=Hs;const Gs=Ws;class Js extends Ve{constructor(t){super(t)}getMinNumActions(){return this.clues.length}helpSolutionAllowed(){return!0}hasRandom(){return!0}}Object.assign(Js.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=Gs.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(Gs.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 xt;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 xt(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,Gs.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"]}),Js.Panel=Ks;const Zs=Ve.registerClass("@textGrid.WordSearch",Js);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":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 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=Gs.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 xt(e.dim.width+this.act.margin,0)):i.moveTo(new xt(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 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 xt(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:Ci,MiniSkin:Si,EmptySkin:Ti,CustomSkin:Ii,Rectangular:_i,Holes:Ri,JigSaw:Di,TriangularJigSaw:Oi,ClassicJigSaw:Ni,Arith:ji,TextActivityBase:Ui,FillInBlanks:Gi,OrderText:Xi,Complete:es,IdentifyText:ns,WrittenAnswer:ps,InformationScreen:ms,Identify:ys,Explore:xs,Menu:Ss,DoublePuzzle:Bs,ExchangePuzzle:_s,HolePuzzle:Os,MemoryGame:$s,SimpleAssociation:Ls,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)}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)}))}}))})()})();
|
|
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:x(e)?C: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 x=r(/\.js(\?.*)?$/i);function C(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,x=t=>(u(t)||{}).alt,C=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:x,chroma:C,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)},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,l=r.flat?function(t){return r.flat.call(t)}:function(t){return r.concat.apply([],t)},c=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 x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[d.call(t)]||"object":typeof t}var C="3.7.1",k=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,i=x(t);return!v(t)&&!b(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:C,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:c,sort:r.sort,splice:r.splice},S.extend=S.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||v(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&&(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(c,r,s)):void 0!==s&&(a[e]=s));return a},S.extend({expando:"jQuery"+(C+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(E(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&&(E(Object(t))?S.merge(i,"string"==typeof t?[t]:t):c.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(E(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 l(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 B=r.pop,I=r.sort,P=r.splice,_="[\\x20\\t\\r\\n\\f]",R=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 D=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function O(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(D,O)};var M=y,N=c;!function(){var t,e,i,n,a,l,c,u,d,f,g=N,v=S.expando,b=0,y=0,w=tt(),A=tt(),x=tt(),C=tt(),k=function(t,e){return t===e&&(a=!0),0},E="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",D="(?:\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",O="\\["+_+"*("+D+")(?:"+_+"*([*^$|!~]?=)"+_+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+D+"))|)"+_+"*\\]",$=":("+D+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",V=new RegExp(_+"+","g"),q=new RegExp("^"+_+"*,"+_+"*"),L=new RegExp("^"+_+"*([>+~]|"+_+")"+_+"*"),j=new RegExp(_+"|>"),F=new RegExp($),z=new RegExp("^"+D+"$"),U={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,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(){lt()},Q=dt((function(t){return!0===t.disabled&&T(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,c,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&&(lt(e),e=e||l,u)){if(11!==b&&(c=G.exec(t)))if(n=c[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(c[2])return g.apply(i,e.getElementsByTagName(t)),i;if((n=c[3])&&e.getElementsByClassName)return g.apply(i,e.getElementsByClassName(n)),i}if(!(C[t+" "]||d&&d.test(t))){if(p=t,f=e,1===b&&(j.test(t)||L.test(t))){for((f=J.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){C(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(R,"$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=l.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 T(e,"input")&&e.type===t}}function nt(t){return function(e){return(T(e,"input")||T(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 lt(t){var i,s=t?t.ownerDocument||t:M;return s!=l&&9===s.nodeType&&s.documentElement?(c=(l=s).documentElement,u=!S.isXMLDoc(l),f=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&M!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",Y),m.getById=it((function(t){return c.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),m.disconnectedMatch=it((function(t){return f.call(t,"*")})),m.scope=it((function(){return l.querySelectorAll(":scope")})),m.cssHas=it((function(){try{return l.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;c.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|"+E+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.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===l||t.ownerDocument==M&&X.contains(M,t)?-1:e===l||e.ownerDocument==M&&X.contains(M,e)?1:n?h.call(n,t)-h.call(n,e):0:4&i?-1:1)},l):l}for(t in X.matches=function(t,e){return X(t,null,null,e)},X.matchesSelector=function(t,e){if(lt(t),u&&!C[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){C(e,!0)}return X(e,l,null,[t]).length>0},X.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},X.attr=function(t,i){(t.ownerDocument||t)!=l&<(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--;)P.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:U,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 U.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&F.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 T(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(V," ")+" ").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(),y=!l&&!o,w=!1;if(g){if(r){for(;f;){for(u=e;u=u[f];)if(o?T(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=(c=(h=g[v]||(g[v]={}))[t]||[])[0]===b&&c[1])&&c[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=(c=(h=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(u=++d&&u&&u[f]||(w=d=0)||p.pop())&&(!(o?T(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(R,"$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 z.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===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:rt(!1),disabled:rt(!0),checked:function(t){return T(t,"input")&&!!t.checked||T(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 H.test(t.nodeName)},button:function(t){return T(t,"input")&&"button"===t.type||T(t,"button")},text:function(t){var e;return T(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 ct(){}function ht(t,i){var s,n,r,a,o,l,c,h=A[t+" "];if(h)return i?0:h.slice(0);for(o=t,l=[],c=e.preFilter;o;){for(a in s&&!(n=q.exec(o))||(n&&(o=o.slice(n[0].length)||o),l.push(r=[])),s=!1,(n=L.exec(o))&&(s=n.shift(),r.push({value:s,type:n[0].replace(R," ")}),o=o.slice(s.length)),e.filter)!(n=U[a].exec(o))||c[a]&&!(n=c[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,l).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,l){var c,h,u=[b,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[v]||(e[v]={}),n&&T(e,n))e=e[s]||e;else{if((c=h[r])&&c[0]===b&&c[1]===o)return u[2]=c[2];if(h[r]=u,u[2]=t(e,i,l))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,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 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,l){var c,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,l);if(i?i(y,p=n||(r?t:v||s)?[]:a,o,l):p=y,s)for(c=ft(p,m),s(c,[],o,l),u=c.length;u--;)(d=c[u])&&(p[m[u]]=!(y[m[u]]=d));if(r){if(n||t){if(n){for(c=[],u=p.length;u--;)(d=p[u])&&c.push(y[u]=d);n(null,p=[],c,l)}for(u=p.length;u--;)(d=p[u])&&(c=n?h.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else p=ft(p===a?p.splice(v,p.length):p),n?n(null,a,p,l):g.apply(a,p)}))}function mt(t){for(var s,n,r,a=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,u=dt((function(t){return t===s}),l,!0),d=dt((function(t){return h.call(s,t)>-1}),l,!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}];c<a;c++)if(n=e.relative[t[c].type])p=[dt(pt(p),n)];else{if((n=e.filter[t[c].type].apply(null,t[c].matches))[v]){for(r=++c;r<a&&!e.relative[t[r].type];r++);return gt(c>1&&pt(p),c>1&&ut(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(R,"$1"),n,c<r&&mt(t.slice(c,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=x[t+" "];if(!o){for(s||(s=ht(t)),n=s.length;n--;)(o=mt(s[n]))[v]?r.push(o):a.push(o);o=x(t,function(t,s){var n=s.length>0,r=t.length>0,a=function(a,o,c,h,d){var p,f,m,v=0,y="0",w=a&&[],A=[],x=i,C=a||r&&e.find.TAG("*",d),k=b+=null==x?1:Math.random()||.1,E=C.length;for(d&&(i=o==l||o||d);y!==E&&null!=(p=C[y]);y++){if(r&&p){for(f=0,o||p.ownerDocument==l||(lt(p),c=!u);m=t[f++];)if(m(p,o||l,c)){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,c);if(a){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=B.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=x),w};return n?et(a):a}(a,r)),o.selector=t}return o}function bt(t,i,s,n){var r,a,o,l,c,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=U.needsContext.test(t)?0:a.length;r--&&(o=a[r],!e.relative[l=o.type]);)if((c=e.find[l])&&(n=c(o.matches[0].replace(K,Z),J.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||J.test(t)&&ot(i.parentNode)||i),s}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,m.sortStable=v.split("").sort(k).join("")===v,lt(),m.sortDetached=it((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=X,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,X.compile=vt,X.select=bt,X.setDocument=lt,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 $=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},V=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 j(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(j(this,t||[],!1))},not:function(t){return this.pushStack(j(this,t||[],!0))},is:function(t){return!!j(this,"string"==typeof t&&q.test(t)?S(t):t||[],!1).length}});var F,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var s,n;if(!t)return this;if(i=i||F,"string"==typeof t){if(!(s="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:z.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,F=S(y);var U=/^(?:parents|prev(?:Until|All))/,H={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 $(t,"parentNode")},parentsUntil:function(t,e,i){return $(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return $(t,"nextSibling")},prevAll:function(t){return $(t,"previousSibling")},nextUntil:function(t,e,i){return $(t,"nextSibling",i)},prevUntil:function(t,e,i){return $(t,"previousSibling",i)},siblings:function(t){return V((t.parentNode||{}).firstChild,t)},children:function(t){return V(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(T(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&&(H[t]||S.uniqueSort(n),U.test(t)&&n.reverse()),this.pushStack(n)}}));var G=/[^\x20\t\r\n\f]+/g;function J(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(G)||[],(function(t,i){e[i]=!0})),e}(t):S.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){S.each(i,(function(i,s){v(s)?t.unique&&c.has(s)||r.push(s):s&&s.length&&"string"!==x(s)&&e(s)}))}(arguments),i&&!e&&l()),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||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!s}};return c},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,l=arguments,c=function(){var s,c;if(!(t<r)){if((s=i.apply(o,l))===e.promise())throw new TypeError("Thenable self-resolution");c=s&&("object"==typeof s||"function"==typeof s)&&s.then,v(c)?n?c.call(s,a(r,e,J,n),a(r,e,K,n)):(r++,c.call(s,a(r,e,J,n),a(r,e,K,n),a(r,e,J,e.notifyWith))):(i!==J&&(o=void 0,l=[s]),(n||e.resolveWith)(o,l))}},h=n?c:function(){try{c()}catch(s){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(s,h.error),t+1>=r&&(i!==K&&(o=void 0,l=[s]),e.rejectWith(o,l))}};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:J,s.notifyWith)),e[1][3].add(a(0,s,v(t)?t:J)),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,l=t.length,c=null==i;if("object"===x(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),c&&(a?(e.call(t,s),e=null):(c=e,e=function(t,e,i){return c.call(S(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},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(G)||[]).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,lt=new at,ct=/^(?:\{[\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:ct.test(t)?JSON.parse(t):t)}(i)}catch(t){}lt.set(t,e,i)}else i=void 0;return i}S.extend({hasData:function(t){return lt.hasData(t)||ot.hasData(t)},data:function(t,e,i){return lt.access(t,e,i)},removeData:function(t,e){lt.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=lt.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(){lt.set(this,t)})):tt(this,(function(e){var i;if(r&&void 0===e)return void 0!==(i=lt.get(r,t))||void 0!==(i=ut(r,t))?i:void 0;this.each((function(){lt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){lt.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,"")},l=o(),c=i&&i[3]||(S.cssNumber[e]?"":"px"),h=t.nodeType&&(S.cssNumber[e]||"px"!==c&&+l)&&pt.exec(S.css(t,e));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;a--;)S.style(t,e,h+c),(1-r)*(1-(r=o()/l||.5))<=0&&(a=0),h/=r;h*=2,S.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 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 xt(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 xt(this,!0)},hide:function(){return xt(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 Ct,kt,St=/^(?:checkbox|radio)$/i,Et=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Tt=/^$|^module$|\/(?:java|ecma)script/i;Ct=y.createDocumentFragment().appendChild(y.createElement("div")),(kt=y.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),Ct.appendChild(kt),m.checkClone=Ct.cloneNode(!0).cloneNode(!0).lastChild.checked,Ct.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!Ct.cloneNode(!0).lastChild.defaultValue,Ct.innerHTML="<option></option>",m.option=!!Ct.lastChild;var Bt={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&&T(t,e)?S.merge([t],i):i}function Pt(t,e){for(var i=0,s=t.length;i<s;i++)ot.set(t[i],"globalEval",!e||ot.get(e[i],"globalEval"))}Bt.tbody=Bt.tfoot=Bt.colgroup=Bt.caption=Bt.thead,Bt.th=Bt.td,m.option||(Bt.optgroup=Bt.option=[1,"<select multiple='multiple'>","</select>"]);var _t=/<|&#?\w+;/;function Rt(t,e,i,s,n){for(var r,a,o,l,c,h,u=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((r=t[p])||0===r)if("object"===x(r))S.merge(d,r.nodeType?[r]:r);else if(_t.test(r)){for(a=a||u.appendChild(e.createElement("div")),o=(Et.exec(r)||["",""])[1].toLowerCase(),l=Bt[o]||Bt._default,a.innerHTML=l[1]+S.htmlPrefilter(r)+l[2],h=l[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(c=mt(r),a=It(u.appendChild(r),"script"),c&&Pt(a),i)for(h=0;r=a[h++];)Tt.test(r.type||"")&&i.push(r);return u}var Dt=/^([^.]*)(?:\.(.+)|)/;function Ot(){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 $t(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=Ot)}})):void 0===ot.get(t,e)&&S.event.add(t,e,Ot)}S.event={global:{},add:function(t,e,i,s,n){var r,a,o,l,c,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++),(l=m.events)||(l=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}),c=(e=(e||"").match(G)||[""]).length;c--;)p=g=(o=Dt.exec(e[c])||[])[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=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),S.event.global[p]=!0)},remove:function(t,e,i,s,n){var r,a,o,l,c,h,u,d,p,f,g,m=ot.hasData(t)&&ot.get(t);if(m&&(l=m.events)){for(c=(e=(e||"").match(G)||[""]).length;c--;)if(p=g=(o=Dt.exec(e[c])||[])[1],f=(o[2]||"").split(".").sort(),p){for(u=S.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)||S.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[c],i,s,!0);S.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,i,s,n,r,a,o=new Array(arguments.length),l=S.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],h=S.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=S.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=((S.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&&c.nodeType&&!("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?S(n,this).index(c)>-1:S.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(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&&T(e,"input")&&$t(e,"click",!0),!1},trigger:function(t){var e=this||t;return St.test(e.type)&&e.click&&T(e,"input")&&$t(e,"click"),!0},_default:function(t){var e=t.target;return St.test(e.type)&&e.click&&T(e,"input")&&ot.get(e,"click")||T(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?Ot: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=Ot,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Ot,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Ot,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($t(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 $t(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 Vt=/<script|<style|<link/i,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function jt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ft(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function zt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ut(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]);lt.hasData(t)&&(r=lt.access(t),a=S.extend({},r),lt.set(e,a))}}function Ht(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=l(e);var n,r,a,o,c,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=Rt(e,t[0].ownerDocument,!1,t,s)).firstChild,1===n.childNodes.length&&(n=r),r||s)){for(o=(a=S.map(It(n,"script"),Ft)).length;u<d;u++)c=n,u!==p&&(c=S.clone(c,!0,!0),o&&S.merge(a,It(c,"script"))),i.call(t[u],c,u);if(o)for(h=a[a.length-1].ownerDocument,S.map(a,zt),u=0;u<o;u++)c=a[u],Tt.test(c.type||"")&&!ot.access(c,"globalEval")&&S.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):A(c.textContent.replace(Lt,""),c,h))}return t}function Gt(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)&&Pt(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),l=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++)Ht(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++)Ut(r[s],a[s]);else Ut(t,o);return(a=It(o,"script")).length>0&&Pt(a,!l&&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[lt.expando]&&(i[lt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Gt(this,t,!0)},remove:function(t){return Gt(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||jt(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=jt(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&&!Vt.test(t)&&!Bt[(Et.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),c.apply(s,i.get());return this.pushStack(s)}}));var Jt=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),l=t.style;return(i=i||Zt(t))&&(a=i.getPropertyValue(e)||i[e],o&&a&&(a=a.replace(R,"$1")||void 0),""!==a||mt(t)||(a=S.style(t,e)),!m.pixelBoxStyles()&&Jt.test(a)&&Qt.test(e)&&(s=l.width,n=l.minWidth,r=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=i.width,l.width=s,l.minWidth=n,l.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){c.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(c).appendChild(h);var t=s.getComputedStyle(h);i="1%"!==t.top,l=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(c),h=null}}function e(t){return Math.round(parseFloat(t))}var i,n,r,a,o,l,c=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(),l},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 le(t,e,i){var s=pt.exec(e);return s?Math.max(0,s[2]-(i||0))+(s[3]||"px"):e}function ce(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+=S.css(t,i+ft[a],!0,n)),s?("content"===i&&(l-=S.css(t,"padding"+ft[a],!0,n)),"margin"!==i&&(l-=S.css(t,"border"+ft[a]+"Width",!0,n))):(l+=S.css(t,"padding"+ft[a],!0,n),"padding"!==i?l+=S.css(t,"border"+ft[a]+"Width",!0,n):o+=S.css(t,"border"+ft[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 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(Jt.test(a)){if(!i)return a;a="auto"}return(!m.boxSizingReliable()&&n||!m.reliableTrDimensions()&&T(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)+ce(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),l=Kt.test(e),c=t.style;if(l||(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:c[e];"string"===(r=typeof i)&&(n=pt.exec(i))&&n[1]&&(i=yt(t,e,n),r="number"),null!=i&&i==i&&("number"!==r||l||(i+=n&&n[3]||(S.cssNumber[o]?"":"px")),m.clearCloneStyle||""!==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=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),l=s?ce(t,e,s,o,r):0;return o&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-ce(t,e,"border",!1,r)-.5)),l&&(n=pt.exec(i))&&"px"!==(n[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),le(0,i,l)}}})),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=le)})),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 l.elem})),l=function(){if(n)return!1;for(var e=de||ve(),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: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,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=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,c.opts.specialEasing);r<a;r++)if(s=we.prefilters[r].call(c,t,h,c.opts))return v(s.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=s.stop.bind(s)),s;return S.map(h,ye,c),v(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),S.fx.timer(S.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}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(G);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,l,c,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((l=!S.isEmptyObject(e))||!S.isEmptyObject(p))for(s in u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=m&&m.display)&&(c=ot.get(t,"display")),"none"===(h=S.css(t,"display"))&&(c?h=c:(xt([t],!0),c=t.style.display||c,h=S.css(t,"display"),xt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===S.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=ot.access(t,"fxshow",{display:c}),r&&(m.hidden=!g),g&&xt([t],!0),d.done((function(){for(s in g||xt([t]),ot.remove(t,"fxshow"),p)S.style(t,s,p[s])}))),l=ye(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?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,xe=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&&T(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(G);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=xe[e]||S.find.attr;xe[e]=function(t,e,s){var n,r,a=e.toLowerCase();return s||(r=xe[a],xe[a]=n,n=null!=i(t,e,s)?a:null,xe[a]=r),n}}));var Ce=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function Se(t){return(t.match(G)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function Te(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(G)||[]}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):Ce.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,Ee(this)))})):(e=Te(t)).length?this.each((function(){if(s=Ee(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,Ee(this)))})):arguments.length?(e=Te(t)).length?this.each((function(){if(s=Ee(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,Ee(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(i=Te(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=Ee(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(Ee(i))+" ").indexOf(e)>-1)return!0;return!1}});var Be=/\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(Be,""):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:[],l=a?r+1:n.length;for(s=r<0?l:a?r:0;s<l;s++)if(((i=n[s]).selected||s===r)&&!i.disabled&&(!i.parentNode.disabled||!T(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,Pe={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 Re=/^(?:focusinfocus|focusoutblur)$/,De=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,n){var r,a,o,l,c,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&&!Re.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),c=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(l=u.delegateType||g,Re.test(l+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?l:u.bindType||g,(h=(ot.get(a,"events")||Object.create(null))[t.type]&&ot.get(a,"handle"))&&h.apply(a,e),(h=c&&a[c])&&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)||c&&v(i[g])&&!b(i)&&((o=i[c])&&(i[c]=null),S.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,De),i[g](),t.isPropagationStopped()&&d.removeEventListener(g,De),S.event.triggered=void 0,o&&(i[c]=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 Oe=/\[\]$/,Me=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,$e=/^(?:input|select|textarea|keygen)/i;function Ve(t,e,i,s){var n;if(Array.isArray(e))S.each(e,(function(e,n){i||Oe.test(t)?s(t,n):Ve(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,s)}));else if(i||"object"!==x(e))s(t,e);else for(n in e)Ve(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)Ve(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")&&$e.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=/#.*$/,je=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,ze=/^(?:GET|HEAD)$/,Ue=/^\/\//,He={},We={},Ge="*/".concat("*"),Je=y.createElement("a");function Ke(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var s,n=0,r=e.toLowerCase().match(G)||[];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 l;return n[o]=!0,S.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 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}Je.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:{"*":Ge,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(He),ajaxTransport:Ke(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,n,r,a,o,l,c,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={},x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Fe.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)C.always(t[C.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return i&&i.abort(e),k(0,e),this}};if(m.promise(C),p.url=((t||p.url||Ie.href)+"").replace(Ue,Ie.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){l=y.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Je.protocol+"//"+Je.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze(He,p,e,C),c)return C;for(u in(h=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!ze.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(je,"$1"),d=(_e.test(n)?"&":"?")+"_="+Pe.guid+++d),p.url=n+d),p.ifModified&&(S.lastModified[n]&&C.setRequestHeader("If-Modified-Since",S.lastModified[n]),S.etag[n]&&C.setRequestHeader("If-None-Match",S.etag[n])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ge+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,C,p)||c))return C.abort();if(x="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),i=Ze(We,p,e,C)){if(C.readyState=1,h&&g.trigger("ajaxSend",[C,p]),c)return C;p.async&&p.timeout>0&&(o=s.setTimeout((function(){C.abort("timeout")}),p.timeout));try{c=!1,i.send(w,k)}catch(t){if(c)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,a,l){var u,d,y,w,A,x=e;c||(c=!0,o&&s.clearTimeout(o),i=void 0,r=l||"",C.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,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,C,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,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,C,u),u?(p.ifModified&&((A=C.getResponseHeader("Last-Modified"))&&(S.lastModified[n]=A),(A=C.getResponseHeader("etag"))&&(S.etag[n]=A)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=w.state,d=w.data,u=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),C.status=t,C.statusText=(e||x)+"",u?m.resolveWith(f,[d,x,C]):m.rejectWith(f,[C,x,y]),C.statusCode(b),b=void 0,h&&g.trigger(u?"ajaxSuccess":"ajaxError",[C,p,u?d:y]),v.fireWith(f,[C,x]),h&&(g.trigger("ajaxComplete",[C,p]),--S.active||S.event.trigger("ajaxStop")))}return C},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+"_"+Pe.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=Rt([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,l,c=S.css(t,"position"),h=S(t),u={};"static"===c&&(t.style.position="relative"),o=h.offset(),r=S.css(t,"top"),l=S.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),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),Jt.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=T,S.isFunction=v,S.isWindow=b,S.camelCase=nt,S.type=x,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}))},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,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 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~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 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,x=w.length!==b.length,C="",k="",S="",E=p.dir,T=p.date,B={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(B.crc32=t.crc32,B.compressedSize=t.compressedSize,B.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),g||!A&&!x||(I|=2048);var P=0,_=0;E&&(P|=16),"UNIX"===a?(_=798,P|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,E)):(_=20,P|=function(t){return 63&(t||0)}(p.dosPermissions)),u=T.getUTCHours(),u<<=6,u|=T.getUTCMinutes(),u<<=5,u|=T.getUTCSeconds()/2,d=T.getUTCFullYear()-1980,d<<=4,d|=T.getUTCMonth()+1,d<<=5,d|=T.getUTCDate(),A&&(k=s(1,1)+s(l(m),4)+v,C+="up"+s(k.length,2)+k),x&&(S=s(1,1)+s(l(y),4)+w,C+="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(B.crc32,4),R+=s(B.compressedSize,4),R+=s(B.uncompressedSize,4),R+=s(m.length,2),R+=s(C.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+m+C,dirRecord:c.CENTRAL_FILE_HEADER+s(_,2)+R+s(y.length,2)+"\0\0\0\0"+s(P,4)+s(n,4)+m+C+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,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 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,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"],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~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,x=15,C=3,k=258,S=k+C+1,E=42,T=113,B=1,I=2,P=3,_=4;function R(t,e){return t.msg=l[e],e}function D(t){return(t<<1)-(4<t?9:0)}function O(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 L(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>=C)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+C-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<C)););}while(t.lookahead<S&&0!==t.strm.avail_in)}function j(t,e){for(var i,s;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===c)return B;if(0===t.lookahead)break}if(i=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-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>=C)if(s=r._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-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 B}return t.insert=t.strstart<C-1?t.strstart:C-1,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}function F(t,e){for(var i,s,n;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===c)return B;if(0===t.lookahead)break}if(i=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-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=C-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===C&&4096<t.strstart-t.match_start)&&(t.match_length=C-1)),t.prev_length>=C&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-C,s=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),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+C-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=C-1,t.strstart++,s&&(N(t,!1),0===t.strm.avail_out))return B}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 B}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<C-1?t.strstart:C-1,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B: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)),O(this.dyn_ltree),O(this.dyn_dtree),O(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(x+1),this.heap=new n.Buf16(2*b+1),O(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*b+1),O(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?E:T,t.adler=2===e.wrap?0:1,e.last_flush=c,r._tr_init(e),u):R(t,d)}function W(t){var e=H(t);return e===u&&function(t){t.window_size=2*t.w_size,O(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=C-1,t.match_available=0,t.ins_h=0}(t.state),e}function G(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+C-1)/C),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,W(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(L(t),0===t.lookahead&&e===c)return B;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 B;if(t.strstart-t.block_start>=t.w_size-S&&(N(t,!1),0===t.strm.avail_out))return B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),B)})),new z(4,4,8,4,j),new z(4,5,16,8,j),new z(4,6,32,32,j),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 G(t,e,m,15,8,0)},i.deflateInit2=G,i.deflateReset=W,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===E)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=T);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=T,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=T)):n.status=T),0!==n.pending){if(M(t),0===t.avail_out)return n.last_flush=-1,u}else if(0===t.avail_in&&D(e)<=D(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&&(L(t),0===t.lookahead)){if(e===c)return B;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 B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B: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===c)return B;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=C&&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>=C?(i=r._tr_tally(t,1,t.match_length-C),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 B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}(n,e):s[n.level].func(n,e);if(f!==P&&f!==_||(n.status=666),f===B||f===P)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&&(O(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)!==E&&69!==e&&73!==e&&91!==e&&103!==e&&e!==T&&666!==e?R(t,d):(t.state=null,e===T?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!==E||i.lookahead)return d;for(1===o&&(t.adler=a(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===o&&(O(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,L(i);i.lookahead>=C;){for(s=i.strstart,r=i.lookahead-(C-1);i.ins_h=(i.ins_h<<i.hash_shift^i.window[s+C-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=C-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=C-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,x,C,k,S,E;i=t.state,s=t.next_in,S=t.input,n=s+(t.avail_in-5),r=t.next_out,E=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))E[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(x=65535&y,f<(w&=15)&&(p+=S[s++]<<f,(f+=8)<w&&(p+=S[s++]<<f,f+=8)),l<(x+=p&(1<<w)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,f-=w,(w=r-a)<x){if(h<(w=x-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=d,(C=0)===u){if(C+=c-w,w<A){for(A-=w;E[r++]=d[C++],--w;);C=r-x,k=E}}else if(u<w){if(C+=c+u-w,(w-=u)<A){for(A-=w;E[r++]=d[C++],--w;);if(C=0,u<A){for(A-=w=u;E[r++]=d[C++],--w;);C=r-x,k=E}}}else if(C+=u-w,w<A){for(A-=w;E[r++]=d[C++],--w;);C=r-x,k=E}for(;2<A;)E[r++]=k[C++],E[r++]=k[C++],E[r++]=k[C++],A-=3;A&&(E[r++]=k[C++],1<A&&(E[r++]=k[C++]))}else{for(C=r-x;E[r++]=E[C++],E[r++]=E[C++],E[r++]=E[C++],2<(A-=3););A&&(E[r++]=E[C++],1<A&&(E[r++]=E[C++]))}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,x,C=!0;function k(t){if(C){var e;for(A=new s.Buf32(512),x=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,x,0,t.work,{bits:5}),C=!1}t.lencode=A,t.lenbits=9,t.distcode=x,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,x,C,E,T,B,I,P,_,R,D,O,M,N,$,V,q=0,L=new s.Buf8(4),j=[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,x=b,C=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<(E=i.length)&&(E=b),E&&(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,E,M)),512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,i.length-=E),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break t;for(E=0;M=p[m+E++],i.head&&M&&i.length<65536&&(i.head.name+=String.fromCharCode(M)),M&&E<b;);if(512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,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(E=0;M=p[m+E++],i.head&&M&&i.length<65536&&(i.head.comment+=String.fromCharCode(M)),M&&E<b;);if(512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,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(E=i.length){if(b<E&&(E=b),y<E&&(E=y),0===E)break t;s.arraySet(f,p,m,E,v),b-=E,m+=E,y-=E,v+=E,i.length-=E;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[j[i.have++]]=7&w,w>>>=3,A-=3}for(;i.have<19;)i.lens[j[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(;P=(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],E=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,E=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,E=11+(127&(w>>>=I)),w>>>=7,A-=7}if(i.have+E>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;E--;)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,C),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;P=(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(P&&!(240&P)){for(R=I,D=P,O=_;P=(q=i.lencode[O+((w&(1<<R+D)-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===P){i.mode=26;break}if(32&P){i.back=-1,i.mode=12;break}if(64&P){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&P,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(;P=(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&P)){for(R=I,D=P,O=_;P=(q=i.distcode[O+((w&(1<<R+D)-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&P){t.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&P,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(E=C-y,i.offset>E){if((E=i.offset-E)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}T=E>i.wnext?(E-=i.wnext,i.wsize-E):i.wnext-E,E>i.length&&(E=i.length),B=i.window}else B=f,T=v-i.offset,E=i.length;for(y<E&&(E=y),y-=E,i.length-=E;f[v++]=B[T++],--E;);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(C-=y,t.total_out+=C,i.total+=C,C&&(t.adler=i.check=i.flags?r(i.check,f,C,v-C):n(i.check,f,C,v-C)),C=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||C!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&S(t,t.output,t.next_out,C-t.avail_out)?(i.mode=31,-4):(x-=t.avail_in,C-=t.avail_out,t.total_in+=x,t.total_out+=C,i.total+=C,i.wrap&&C&&(t.adler=i.check=i.flags?r(i.check,f,C,t.next_out-C):n(i.check,f,C,t.next_out-C)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==x&&0===C||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,x=d.bits,C=0,k=0,S=0,E=0,T=0,B=0,I=0,P=0,_=0,R=0,D=null,O=0,M=new s.Buf16(16),N=new s.Buf16(16),$=null,V=0;for(C=0;C<=15;C++)M[C]=0;for(k=0;k<l;k++)M[e[i+k]]++;for(T=x,E=15;1<=E&&0===M[E];E--);if(E<T&&(T=E),0===E)return c[h++]=20971520,c[h++]=20971520,d.bits=1,0;for(S=1;S<E&&0===M[S];S++);for(T<S&&(T=S),C=P=1;C<=15;C++)if(P<<=1,(P-=M[C])<0)return-1;if(0<P&&(0===t||1!==E))return-1;for(N[1]=0,C=1;C<15;C++)N[C+1]=N[C]+M[C];for(k=0;k<l;k++)0!==e[i+k]&&(u[N[e[i+k]]++]=k);if(b=0===t?(D=$=u,19):1===t?(D=n,O-=257,$=r,V-=257,256):(D=a,$=o,-1),C=S,v=h,I=k=R=0,g=-1,m=(_=1<<(B=T))-1,1===t&&852<_||2===t&&592<_)return 1;for(;;){for(y=C-I,A=u[k]<b?(w=0,u[k]):u[k]>b?(w=$[V+u[k]],D[O+u[k]]):(w=96,0),p=1<<C-I,S=f=1<<B;c[v+(R>>I)+(f-=p)]=y<<24|w<<16|A,0!==f;);for(p=1<<C-1;R&p;)p>>=1;if(0!==p?(R&=p-1,R+=p):R=0,k++,0==--M[C]){if(C===E)break;C=e[i+u[k]]}if(T<C&&(R&m)!==g){for(0===I&&(I=T),v+=S,P=1<<(B=C-I);B+I<E&&!((P-=M[B+I])<=0);)B++,P<<=1;if(_+=1<<B,1===t&&852<_||2===t&&592<_)return 1;c[g=R&m]=T<<24|B<<16|v-h}}return 0!==R&&(c[v+R]=C-I<<24|64<<16),d.bits=T,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],x=[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],C=[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 E=new Array(2*u);a(E);var T=new Array(512);a(T);var B=new Array(256);a(B);var I=new Array(l);a(I);var P,_,R,D=new Array(u);function O(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?T[t]:T[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 L(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function j(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 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 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=B[n])+c+1,e),0!==(a=A[r])&&V(t,n-=I[r],a),q(t,r=N(--s),i),0!==(a=x[r])&&V(t,s-=D[r],a)),o<t.last_lit;);q(t,v,e)}function G(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),j(r,c,t.bl_count)}function J(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(D);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++)B[i++]=s;for(B[i-1]=s,s=n=0;s<16;s++)for(D[s]=n,t=0;t<1<<x[s];t++)T[n++]=s;for(n>>=7;s<u;s++)for(D[s]=n<<7,t=0;t<1<<x[s]-7;t++)T[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(j(S,h+1,r),t=0;t<u;t++)E[2*t+1]=5,E[2*t]=L(t,5);P=new O(S,A,c+1,h,f),_=new O(E,x,0,u,f),R=new O(new Array(0),C,0,d,m)}(),Z=!0),t.l_desc=new M(t.dyn_ltree,P),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)),G(t,t.l_desc),G(t,t.d_desc),l=function(t){var e;for(J(t,t.dyn_ltree,t.l_desc.max_code),J(t,t.dyn_dtree,t.d_desc.max_code),G(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),W(t,S,E)):(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),W(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*(B[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,s){(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,void 0!==i.g?i.g:"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 x(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 C(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 E(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 T(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 B(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 P(){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 D(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:"+C(t.c)+";font-style:"+S(t)+";font-weight:"+t.f+"00;"}function O(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=D(t=new x(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=t,t=D(t=new x(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=t,t=D(t=new x("serif",k(this.a))),this.j.a.style.cssText=t,t=D(t=new x("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)},O.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 "+C(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 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=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))?j(t,t.v):j(t,t.B):function(t){setTimeout(a((function(){L(this)}),t),50)}(t):j(t,t.v)}function j(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(),L(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")):B(t.a))}function H(t){this.j=t,this.a=new P,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)B(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 O(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 G(t,e){this.c=t,this.a=e}function J(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){W(t,r,e,i,s)}))}(this,new T(this.c,t),t)},G.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 x(l,i))):a.push(new x(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([])},J.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 x(s[0],l[c]));else o.push(new x(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 x(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 x(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 x(a.name,E("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 J(e,t)},at.a.c.fontdeck=function(t,e){return new rt(e,t)},at.a.c.monotype=function(t,e){return new G(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].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.22 (2024-10-16)",languages:["en","ar","ast","bs","ca","ca_ES@valencia","cs","da","de","el","es","eu","fr","gl","he","it","ja","nl","pl","pt","pt_BR","ro","ru","tr","vec","zh_TW"],messages:{ar:{Version:"الإصدار",time:"الوقت",actions:"المحاولات",score:"النتيجة","Next activity":"النشاط التالي","Previous activity":"النشاط السابق","Restart activity":"استئنف النشاط",Information:"المعلومة","Current results":"تقارير المستخدم","User:":"المستخدم:","Projects:":"المشاريع:",Project:"المشروع:",sequence:"التسلسل",activity:"النشاط",OK:"موافق","Total:":"المجموع:"},ast:{Version:"Versión",time:"tiempu",actions:"intentos",score:"marcador","Next activity":"Xera siguiente","Previous activity":"Xera anterior","Restart activity":"Reaniciar xera",Information:"Información","Results are not currently being saved":"L'informe nun ta rexistráu en nenguna base de datos","Current results":"Informes d'usuariu","Session started:":"Entamu de sesión:","Reports system:":"Sistema d'informes:","User:":"Usuariu:","Projects:":"Proyeutos:","Sequences:":"Secuencies:","Activities done:":"Xeres feches:","Activities solved:":"Xeres correctes:","Global score:":"Puntuación global:","Total time in activities:":"Tiempu total en xeres:","Actions done:":"Aiciones feches:","No activities done!":"¡Nenguna información sobre xeres!",Project:"Proyeutu:",sequence:"Secuencia",activity:"Xera",OK:"OK",YES:"SI",NO:"NON","Total:":"Total:"},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","Current results":"Izvješća korisnika","Session started:":"Sesija započeta:","User:":"Korisnik:","Projects:":"Projekti:","Activities done:":"Urađene aktivnosti:","Activities solved:":"Aktivnosti ok:","Global score:":"Ukupan rezultat:","Total time in activities:":"Ukupno vrijeme aktivnosti:","Actions done:":"Urađene aktivnosti:",Project:"Projekt:",sequence:"Sekvenca",activity:"Aktivnost",OK:"Uredu",YES:"DA",NO:"NE","Total:":"Ukupno:"},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/ària:","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/ària:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","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:"},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:","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:"},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","Current results":"Bruger rapport","User:":"Bruger:","Projects:":"Projekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter udført:","Activities solved:":"Aktiviteter OK:","Global score:":"Global score:","No activities done!":"Ingen aktiviteter rapporteret!",Project:"Projekt",sequence:"Sequence",activity:"Aktivitet",OK:"Ok",YES:"JA",NO:"IKKE","Total:":"Total:"},de:{Version:"Version",time:"Zeit",actions:"Versuche",score:"Ergebnis","Next activity":"Nächste Übung","Previous activity":"Vorherige Übung","Restart activity":"Übung neu starten",Information:"Information","Results are not currently being saved":"Bericht in keiner Datenbank eingetragen","Current results":"Benutzerberichte","Session started:":"Sitzung gestartet:","Reports system:":"Report system:","User:":"User:","Projects:":"Projekte:","Sequences:":"Sequenzen:","Activities done:":"Beendete Übungen:","Activities solved:":"Korrekte Übungen:","Global score:":"Gesamtpunktezahl:","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:"},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:":"Συνολική βαθμολογία:","Total time in activities:":"Συνολικός χρόνος δραστηριοτήτων:","Actions done:":"Οι ενέργειες ολοκληρώθηκαν:","No activities done!":"Για καμμία δραστηριότητα δεν έχει υποβληθεί αναφορά!",Project:"Έργο",sequence:"Αλληλουχία",activity:"Δραστηριότητα",OK:"Εντάξει",YES:"Ναί",NO:"όχι","Total:":"Σύνολο:"},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/aria:","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 rico.","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:","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:"},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:"Information","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:":"Report système:","User:":"Utilisateur:","Projects:":"Projets:","Sequences:":"Séquences:","Activities done:":"Activités faites:","Activities solved:":"Activités ok:","Global score:":"Score global:","(out of all project activities)":"(Hors de toutes les activités du projet)","Total time in activities:":"Temps total sur les activités:","Actions done:":"Actions faites:","No activities done!":"Pas d'activités rapportées!",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:","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:"},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:":"ניקוד כללי:","Total time in activities:":"משך הפעילויות המצטבר:","Actions done:":"פעולות שבוצעו:","No activities done!":"לא דווחו פעילויות!",Project:"פרוייקט",sequence:"רצף",activity:"פעילות",OK:"אישור",YES:"כן",NO:"לא","Total:":"סך הכל:"},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 alcun database","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:","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:"SI",NO:"NO","Total:":"Totale:"},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":"画像フラグメント"},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:","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:"},pl:{Version:"Wersja",time:"czas",actions:"działania",score:"wynik","Next activity":"Następne działanie","Previous activity":"Poprzednia aktywność","Restart activity":"Restartuj 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:":"Projekty:","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:"kolejność",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 działań)","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:","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:"},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:","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:"},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:":"Общий счёт:","Total time in activities:":"Общее время активности:","Actions done:":"Завершено действий:","No activities done!":"Нет сообщенных действий!",Project:"Проект",sequence:"Последовательность",activity:"Активность",OK:"ОК",YES:"да",NO:"нет","Total:":"Итого:"},tr:{Version:"Sürüm",time:"zaman",actions:"Denemeler",score:"sonuç","Next activity":"Bir sonraki etkinlik","Previous activity":"Bir önceki etkinlik","Restart activity":"Etkinliği tekrar başlat",Information:"Bilgi","Results are not currently being saved":"Rapor herhangi bir veritabanında kaydedilmedi","Current results":"Kullanıcı raporları","Session started:":"Oturum başlatıldı","Reports system:":"Sistem raporu:","User:":"Kullanıcı:","Projects:":"Projeler:","Sequences:":"Etkinlik dizisi","Activities done:":"Etkinlikler başlatılıyor:","Activities solved:":"Etkinlikler tamam:","Global score:":"Genel sonuç:","Total time in activities:":"Etkinlikde geçirilen toplam zaman:","Actions done:":"Eylem gerçekleştiriliyor:","No activities done!":"Etkinlik raporu yok!",Project:"Proje",sequence:"Etkinlik dizisi",activity:"Etkinlik",OK:"Tamam",YES:"Evet",NO:"hiçbir","Total:":"Toplam:"},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","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:"},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:":"總成績:","Total time in activities:":"活動總時間:","Actions done:":"活動完成:","No activities done!":"沒有活動報告",Project:"專案:",sequence:"順序",activity:"活動",OK:"確定",YES:"是",NO:"否","Total:":"總計:"}}},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?C():""} ${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 x(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 C(){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 E(t){return"true"===t?1:"false"===t?0:arguments.length>1&&void 0!==arguments[1]?arguments[1]:2}function T(t){return Array(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).fill(t).join("")}function B(t){return null==t}function I(t,e){return null==t&&null==e||t===e}function P(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 D(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]=D(i)}}))}return t}function O(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=G(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]);L(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 L(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 j(t,e,i){return i.forEach((i=>{if(i.key){const{key:s,fn:n,group:r,init:a,params:o}=i;if(!L(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 L(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 W(t,e){return Math.round(t/e)*e}function G(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return t.toFixed?Number(t.toFixed(e)):t}function J(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(B(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:x,getDateTime:C,parseOldDate:k,cleanOldLanguageTag:S,FALSE:0,TRUE:1,DEFAULT:2,getTriState:E,fillString:T,isNullOrUndef:B,isEquivalent:I,getXmlText:P,parseXmlNode:_,getXmlNodeText:R,reduceTextsToStrings:D,cssToString:function(t){return Object.keys(t).reduce(((e,i)=>`${e}${i}:${t[i]};`),"")},checkColor:O,colorHasTransparency:M,cloneObject:N,normalizeObject:$,getAttr:V,getValue:q,isEmpty:L,setAttr:j,buildObj:F,isSeparator:z,isWordDelimiter:U,stringToWords:H,roundTo:W,fx:G,compareMultipleOptions:J,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 j(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=O(t.attr("source"),"black"),this.c2=O(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 j(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 j(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 xt{constructor(t,e){t instanceof xt?(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 j(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 xt(this)}}Object.assign(xt.prototype,{x:0,y:0});class Ct{constructor(t,e){t instanceof xt&&e instanceof xt?(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 j(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 Ct&&(e=t.height,t=t.width),this.width=t,this.height=e,this}getSurface(){return this.width*this.height}}Object.assign(Ct.prototype,{width:0,height:0});class kt{constructor(t){this.pos=t||new xt}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&&Et||"path"===t.type&&Tt||null;if(e)return(new e).setAttributes(t);console.log("unknown shape:",t)}}Object.assign(kt.prototype,{type:"shape",pos:new xt,type:"shape"});class St extends kt{constructor(t,e,i,s){let n=t,r=e;t instanceof St?(r=new Ct(t.dim.width,t.dim.height),n=new xt(t.pos.x,t.pos.y)):t instanceof xt?(n=new xt(t.x,t.y),e instanceof Ct&&(r=new Ct(e.width,e.height))):t instanceof Array?(n=new xt(t[0],t[1]),r=new Ct(t[2]-t[0],t[3]-t[1])):"number"==typeof i&&"number"==typeof s&&(n=new xt(t,e),r=new Ct(i,s)),super(n),this.dim=r instanceof Ct?r:r instanceof xt?new Ct(r.x-this.pos.x,r.y-this.pos.y):new Ct,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 xt(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 j(this,t,["type",{key:"pos",fn:xt},{key:"dim",fn:Ct}])}}Object.assign(St.prototype,{type:"rect",dim:new Ct});class Et 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 Et&&super.equals(t)}clone(){return new Et(this.pos,this.dim)}isRect(){return!1}toString(){return`Ellipse enclosed in ${this.getCoords()}`}}Object.assign(Et.prototype,{type:"ellipse"});class Tt extends kt{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 St,this.enclosingPoints=[],this.calcEnclosingRect(),this.pos=this.enclosing.pos,this}clone(){return new Tt(this.strokes.map((t=>t.clone())))}addStroke(t){return this.strokes.push(t),this}calcEnclosingRect(){this.enclosingPoints=[];let t=new xt;this.strokes.forEach((e=>{e.getEnclosingPoints(t).forEach((e=>{t=new xt(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 xt(this.enclosingPoints[0]),s=new xt(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 Ct(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 Ct(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(Tt.prototype,{type:"path",strokes:[],enclosing:new St,enclosingPoints:[]});class Bt{constructor(t,e){if(this.type=t,e&&e.length>0)if(e[0]instanceof xt)this.points=e.map((t=>new xt(t)));else{this.points=[];for(let t=0;t<e.length;t+=2)this.points.push(new xt(e[t],e[t+1]))}}static getQuadraticPoints(t,e,i,s){s||(s=gt.BEZIER_POINTS);const n=[],r=new xt,a=new xt;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 xt(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=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 xt(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`${this.type}:${this.points?this.points.map((t=>`${G(t.x)},${G(t.y)}`)).join(","):""}`}}Object.assign(Bt.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 Pt{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(Pt.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:xt,Dimension:Ct,Shape:kt,Rectangle:St,Ellipse:Et,Path:Tt,PathStroke:Bt,Action:It,Timer:Pt,Container:_t};class Dt{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(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(Dt.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 Ot=Dt;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 Lt=qt;class jt 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),!jt.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(jt.prototype.buttons),this.counters=N(jt.prototype.counters),this.msgArea=N(jt.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))),jt.skinStack.push(this)}static registerClass(t,e){return jt.CLASSES[t]=e,e}static registerStyleSheet(t,e){let i=!1;const s=lt(e);s.__JClicID||(s.__JClicID="SK"+jt.lastId++);let n=jt.rootStyles[s.__JClicID];return n||(n=[],jt.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=jt.skinStack.find((i=>i.name===t&&i.ps===e));if(i)return i}let s=jt.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=jt.CLASSES.custom:(m("warn",`Unknown skin class: ${t}`),s=jt.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=jt.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:"),x(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(x(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(x(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 Ct(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}}jt.skinStack=[],jt.rootStyles={},jt.lastId=1,jt.CLASSES={},Object.assign(jt.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=jt;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 xt(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 j(this,t,["type","file","externalParam",{key:"absLocation",fn:xt},"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 Wt{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=E(t.attr("enabled")),this}getAttributes(){return V(this,["enabled|2","file"])}setAttributes(t){return j(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(Wt.prototype,{file:null,enabled:2,player:null,audio:null});const Gt=Wt;class Jt{constructor(t){t&&(this.elements=Object.assign({},this.elements,t.elements),this.enabled=t.enabled)}setProperties(t){return this.enabled=E(t.attr("enabled"),this.enabled),t.children().each(((t,i)=>{const s=i.getAttribute("id");this.elements[s]=new Gt(s),this.elements[s].setProperties(e()(i))})),this}getAttributes(){return V(this,["enabled|2","elements"])}setAttributes(t){return j(this,t,["enabled",{key:"elements",fn:Gt,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()}}}Jt.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(Jt.prototype,{elements:{start:new Gt("start",Jt.MEDIA.start),click:new Gt("click",Jt.MEDIA.click),actionOk:new Gt("actionOk",Jt.MEDIA.actionOk),actionError:new Gt("actionError",Jt.MEDIA.actionError),finishedOk:new Gt("finishedOk",Jt.MEDIA.finishedOk),finishedError:new Gt("finishedError",Jt.MEDIA.finishedError)},enabled:2,globalEnabled:!0});const Kt=Jt;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(D(_(n)));break;case"organization":this.organizations.push(D(_(n)));break;case"revision":const t=D(_(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 j(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=>{L(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=>{L(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=>{L(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=>{L(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.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=O(s.attr("foreground"),this.textColor),this.backColor=O(s.attr("background"),this.backColor),this.shadowColor=O(s.attr("shadow"),this.shadowColor),this.inactiveColor=O(s.attr("inactive"),this.inactiveColor),this.alternativeColor=O(s.attr("alternative"),this.alternativeColor),this.borderColor=O(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 j(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 Ct(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 j(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 Ct(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:j(this,t,["id","item","border","avoidOverlapping","image","text","objectType",{key:"dimension",fn:Ct},{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 xe{constructor(t,e){this.reset(t,e)}static registerClass(t,e){return xe.CLASSES[t]=e,e}static getShaper(t,e,i){const s=xe.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=xe.readShapeData(e,this.scaleX,this.scaleY);this.enclosing=i,this.showEnclosure=!0,this.hasRemainder=!0}))})),t.children("shape").each(((t,e)=>{this.shapeData[t]=xe.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 Et(o[0],o[1],o[2],o[3]);break;default:n.push(new Bt(a[0],o))}})),!r&&n.length>0?new Tt(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=xe.getShaper(t.className,t.nCols,t.nRows);return j(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(xe.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}),xe.CLASSES={};const Ce=xe;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=Ce.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){j(this,t,["id","image","ncw","nch","w","h","border",{key:"style",fn:be},{key:"shaper",fn:Ce},"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=Ce.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 Ee{constructor(){}static getProvider(t){let e=null;if(t){const i=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),s=Ee.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,Ee.CLASSES[t.className])).setAttributes(t,...e)}init(){}generateContent(t,e,i,s){return this.process(new Ee.ActiveBagContentKit(t,e,i,s))}process(t){return!1}static registerClass(t,e){return Ee.CLASSES[t]=e,e}}Object.assign(Ee.prototype,{numericContent:!1}),Ee.ActiveBagContentKit=class{constructor(t,e,i,s){this.nRows=t,this.nCols=e,this.content=i,this.useIds=s}},Ee.CLASSES={"@tagreplace.TagReplace":Ee},Ee.registerClass("@tagreplace.TagReplace",Ee);const Te=Ee;class Be{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 j(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(Be.prototype,{ncw:1,nch:1,w:20,h:20,border:!1,style:null,text:null,wild:"*",randomChars:gt.RANDOM_CHARS});const Ie=Be;class Pe{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=Pe.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=Pe.CLASSES[t.className];if(e){return j(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(Pe.prototype,{className:null,initiated:!1,collator:null,checkCase:!1});class _e extends Pe{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}),Pe.CLASSES={"@BasicEvaluator":_e,"@ComplexEvaluator":Re};const De=Pe;class Oe{constructor(){this.style={default:{...Oe.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=O(n,"white"),i[t]=n,s["background-color"]=n;break;case"foreground":n=O(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 j(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]:{})}}Oe.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(Oe.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 j(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}),Oe.TextTarget=Me;const Ne=Oe,$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=P(this),this.showSolution=v(s.attr("showSolution"),!1),this.helpWindow=null!==this.helpMsg||this.showSolution;break;case"container":this.bgColor=O(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=O(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 xt).setProperties(s),this.absolutePositioned=!0;break;case"size":this.windowSize=(new Ct).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=Te.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=De.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"),B(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 j(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:xt},{key:"windowSize",fn:Ct},{key:"messages",fn:Ae,group:"object",init:"key",params:[e]},{key:"abc",fn:Se,group:"object",init:"key",params:[e]},{key:"acp",fn:Te,params:[e]},"menuElements",{key:"tgc",fn:Ie},"clues","clueItems",{key:"prevScreenStyle",fn:be},{key:"ev",fn:De},{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 Ct(this.windowSize)}setWindowSize(t){this.windowSize=new Ct(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 Ct(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 Ct(100,100),this.preferredSize=new Ct(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 Ct(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 xt;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 Ct(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 Le=Ve;class je{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?Le.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 Le.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(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 Fe=je;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 We=He;class Ge{constructor(t){this.name=t.tag,this.description=t.description,this.activities=[],this.currentActivity=null,this.totalTime=0,this.closed=!1,this.info=new Je(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 We(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(Ge.prototype,{name:"",description:"",activities:[],currentActivity:null,totalTime:0,closed:!1,info:null});class Je{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(Je.prototype,{sqReg:null,valid:!1,nActivities:0,nActClosed:0,nActSolved:0,nActScore:0,ratioSolved:0,nActions:0,tScore:0,tTime:0}),Ge.Info=Je;const Ke=Ge;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 Lt,this.counterVal={score:0,actions:0,time:0},this.bgImageOrigin=new xt,this.buildActions(),this.history=new Ot(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 Lt,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 Pt((()=>{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 Pt((()=>{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,${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,${window.JClicObject.projectFiles[r]}`}return void o(l)}this.setProject(t),i||s||(i="0"),this.reporter&&this.reporter.newSession(t)}if(!B(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 Ct(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 xt(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 Ct(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 xt(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}`,disabled:o}).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 xi 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(xi.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 Ci=Ft.registerClass("simple",xi);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 Ei 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(Ei.prototype,{skinId:"JClicEmptySkin",mainCSS:".ID .JClicPlayerCnt {margin:0;}"});const Ti=Ft.registerClass("empty",Ei);class Bi 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)):"",x=g.data?ot(g.data,new St(i,u-l,n-i,p-u)):"",C=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: ${O(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(${x});}\n.ID .JClicCell8 {background-image:url(${C});background-repeat:repeat-x;}\n.ID .JClicCell9 {background-image:url(${k});}`,E=`\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);}`,T=`\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)}`,x=y<h?`top:${Math.round(2*y/3-u/6)}`:`bottom:${Math.round(2*(p-y-u)/3-u/6)}`,C=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:-${C}px -${k}px !important;}\n`,E+=`.ID .Btn-${l} {${v}px;${A}px;}\n`,T+=`.ID .Btn-${l} {${b}px;${x}px;}\n`,d.active&&(S+=`.ID .Btn-${l}:active {background-position:-${C+d.active.right}px -${k+d.active.down}px !important;}\n`),d.over&&(S+=`.ID .Btn-${l}:hover {background-position:-${C+d.over.right}px -${k+d.over.down}px !important;}\n`),d.disabled&&(S+=`.ID .Btn-${l}:disabled {background-position:-${C+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=O(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,x=u.point.label.top||A-r,C=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)}`,B=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;${C}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:${x-A}px;left:${v-m}px;}`,E+=`.ID .Counter-${a} {${y}px;${k}px;}\n`,T+=`.ID .Counter-${a} {${w}px;${B}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`,E+=`.ID .JClicProgressAnimation {${a}px;${d}px;}\n`,T+=`.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;}`,E+=`.ID .JClicMsgBox {left:${Math.round(e/2)}px;right:${Math.round(s/2)}px;height:${Math.round(t.height/2)}px;${r}px;}`,T+=`.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:E,twoThirds:T}}_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(Bi.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",Bi);class Pi extends Ce{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 xt(s*t,i*e),new Ct(t,e));this.initiated=!0}}Object.assign(Pi.prototype,{rectangularShapes:!0});const _i=Ce.registerClass("@Rectangular",Pi);const Ri=Ce.registerClass("@Holes",class extends Ce{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 Di=Ce.registerClass("@JigSaw",class extends Ce{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 Tt([new Bt("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 Bt("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 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 c=r*this.toothHeightFactor*l;t.addStroke(new Bt("L",[e,s+c])),t.addStroke(new Bt("L",[e+a,s+c])),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,l=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 c=n*this.toothHeightFactor*l;t.addStroke(new Bt("L",[i+c,e])),t.addStroke(new Bt("L",[i+c,e+a])),t.addStroke(new Bt("L",[i,e+a])),t.addStroke(new Bt("L",[i,s+r*o]))}}});const Oi=Ce.registerClass("@TriangularJigSaw",class extends Di{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 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 c=r*this.toothHeightFactor*l;t.addStroke(new Bt("L",[e+a/2,s+c])),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,l=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 c=n*this.toothHeightFactor*l;t.addStroke(new Bt("L",[i+c,e+a/2])),t.addStroke(new Bt("L",[i,e+a])),t.addStroke(new Bt("L",[i,s+r*o]))}}});class Mi extends Di{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 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 c=r*this.toothHeightFactor*l/8;t.addStroke(new Bt("B",[e+4*a,s,e+6*a,s-c,e+4*a,s-3*c])),t.addStroke(new Bt("B",[e+2*a,s-5*c,e+10*a,s-5*c,e+8*a,s-3*c])),t.addStroke(new Bt("B",[e+6*a,s-1*c,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,l=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 c=n*this.toothHeightFactor*l/8;t.addStroke(new Bt("B",[i,e+4*a,i-c,e+6*a,i-3*c,e+4*a])),t.addStroke(new Bt("B",[i-5*c,e+2*a,i-5*c,e+10*a,i-3*c,e+8*a])),t.addStroke(new Bt("B",[i-1*c,e+6*a,i,e+8*a,i,e+12*a])),t.addStroke(new Bt("L",[i,s+r*o]))}}}Object.assign(Mi.prototype,{baseWidthFactor:3/4,toothHeightFactor:.6});const Ni=Ce.registerClass("@ClassicJigSaw",Mi),$i=["+","-",String.fromCharCode(215),":"],Vi=-12345,qi=Intl&&Intl.NumberFormat().format(1.1).indexOf(",")>0;class Li extends Te{constructor(){super(),this.className="@arith.Arith",this.numericContent=!0,this.opA=new Li.Operator,this.opB=new Li.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 j(this,t,["className",{key:"opA",fn:Li.Operator},{key:"opB",fn:Li.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=Li.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=Li.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=Li.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=Li.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,x=o,C=o*l,k=null;if(o<=0||l<=0||null===c||c.length<1||null===c[0])return!1;if(C<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<C;e++){for(n=new Li.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=C-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<C;e++)switch(a=d[Math.floor(Math.random()*r)],f=Li.DecFormat(u[e].numA.vf,u[0].numA.c),g=Li.DecFormat(u[e].numB.vf,u[0].numB.c),m=Li.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<C;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(x*A!==s){let E=!1;switch(s){case 6:x=E?2:3,A=E?3:2;break;case 8:x=E?2:4,A=E?4:2;break;case 9:x=3,A=3;break;case 10:x=E?2:5,A=E?5:2;break;case 12:x=E?3:4,A=E?4:3;break;case 14:x=E?2:7,A=E?7:2;break;case 15:x=E?3:5,A=E?3:5;break;case 16:x=4,A=4;break;case 18:x=E?6:3,A=E?3:6;break;case 20:x=E?4:5,A=E?5:4;break;default:x=E?1:s,A=E?s:1}}}if(qi){function T(t){return t.replace(/\./g,",")}b=b.map(T),y=y.map(T),w=w.map(T)}return c[0].setTextContent(b,l,o),null!==k&&c[0].setIds(k),c.length>1&&null!==c[1]&&(c[1].setTextContent(y,A,x),c[1].getShaper().reset(A,x)),c.length>2&&null!==c[2]&&c[2].setTextContent(w,l,o),!0}}Object.assign(Li.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"}),Li.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 j(this,t,["limInf","limSup","numDec","wZero","wOne","wMinusOne","fromList","lst"])}},Object.assign(Li.Operator.prototype,{limInf:0,limSup:10,numDec:0,wZero:!1,wOne:!1,wMinusOne:!1,fromList:0,lst:[]}),Li.Num=class{constructor(){this.vf=0,this.c=0}format(){return Li.DecFormat(this.vf,this.c)}},Li.Operation=class{constructor(){this.numA=new Li.Num,this.numB=new Li.Num,this.numR=new Li.Num,this.op=0}};const ji=Te.registerClass("@arith.Arith",Li);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.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.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 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.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(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 Wi 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.bind("focus change",(e=>{e.textTarget=t,this.processEvent(e)}))):(t.currentText=t.iniText?t.iniText:T(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(),ft(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,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(Wi.prototype,{locked:!0}),Hi.Panel=Wi;const Gi=Le.registerClass("@text.FillInBlanks",Hi),Ji="source-over";class Ki{constructor(t,e){this.parent=t,this.ctx=e.get(-1).getContext("2d",{willReadFrequently:!0}),this.dim=new Ct(this.ctx.canvas.width,this.ctx.canvas.height),this.origin=new xt,this.dest=new xt,this.relativePos=new xt}moveBy(t,e){this.moveTo(xt(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 xt(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y);this.bgRect=new St(i,this.bx?this.bx.dim:new Ct);const s=new xt(t.x-this.relativePos.x,t.y-this.relativePos.y);this.bgRect.add(new St(s,this.bx?this.bx.dim:new Ct)),this.bgRect.grow(10,10),null!==this.bx?(this.bx.moveTo(new xt(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!==Ji?(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 xt(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!==Ji&&(this.ctx.globalCompositeOperation=Ji)}}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:Ji,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").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 xt;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 xt(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=Le.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=Le.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.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(ss.prototype,{targetsMarked:!1,lastTimeStamp:0,spansChecked:new Set}),is.Panel=ss;const ns=Le.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 Ct(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 Ct(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 x=new St(e.getBounds());return x.add(i.getBounds()),d.width=x.dim.width+2*n,d.height=x.dim.height+2*n,d}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){const t=this.getPreferredSize();return new Ct(Math.max(gt.MIN_CELL_SIZE,t.width),Math.max(gt.MIN_CELL_SIZE,t.height))}getScaledSize(t){const e=this.getPreferredSize();return new Ct(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 xt(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 xt(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 xt;for(let t=0;t<i;t++){const e=this.getActiveBox(t);s[t]=new xt(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 xt(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 xt(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 xt(s,n))}))}swapCellPositions(t,e,i){const s=new xt(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 xt(s,n),new Ct(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 Ct(gt.MIN_CELL_SIZE*this.nCols,gt.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new Ct(W(t*this.preferredBounds.dim.width,this.nCols),W(t*this.preferredBounds.dim.height,this.nRows))}getCoord(t){return new xt(t.idLoc%this.nCols,Math.floor(t.idLoc/this.nCols))}getCoordDist(t,e){const i=this.getCoord(t),s=this.getCoord(e);return new xt(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(J(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.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 xt(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(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 xt(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 xt(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 xt(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 xs=Ve.registerClass("@panels.Explore",ws);class Cs 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=="},Cs.Panel=ks;const Ss=Ve.registerClass("@panels.Menu",Cs);class Es extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Ts 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 xt;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 xt(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.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(Ts.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Es.Panel=Ts;const Bs=Ve.registerClass("@puzzles.DoublePuzzle",Es);class Is extends Ve{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Ps 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 xt;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 xt(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(Ps.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Is.Panel=Ps;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 Ds 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 xt(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(Ds.prototype,{bg:null,parkBg:null,hiddenBox:null,hiddenBoxIndex:-1,events:["click"]}),Rs.Panel=Ds;const Os=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 xt;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 xt(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 xt;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 xt(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.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(qs.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Vs.Panel=qs;const Ls=Ve.registerClass("@associations.SimpleAssociation",Vs);class js 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(js.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 xt;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 xt(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.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(Fs.prototype,{invAssCheck:null}),js.Panel=Fs;const zs=Le.registerClass("@associations.ComplexAssociation",js),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 Ws 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 Pt((()=>this.blink(0)),500,!1),this.cursorEnabled=!1,this.useCursor=!1,this.wildTransparent=!1,this.cursor=new xt}static createEmptyGrid(t,e,i,s,n,r){const a=new Ws(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 xt;let s=!1,n=!1;for(let r=0;r<t;r++)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++)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 xt(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 xt(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 xt(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)&&!!(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 Ct(Us.MIN_CELL_SIZE*this.nCols,Us.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new Ct(W(t*this.preferredBounds.dim.width,this.nCols),W(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(!(e&Hs.TRANSPARENT)){const o=!!(e&Hs.INVERTED),l=!!(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",!(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(Ws.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}),Ws.defaults=Us,Ws.flags=Hs;const Gs=Ws;class Js extends Ve{constructor(t){super(t)}getMinNumActions(){return this.clues.length}helpSolutionAllowed(){return!0}hasRandom(){return!0}}Object.assign(Js.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=Gs.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(Gs.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 xt;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 xt(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,Gs.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"]}),Js.Panel=Ks;const Zs=Ve.registerClass("@textGrid.WordSearch",Js);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":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 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=Gs.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 xt(e.dim.width+this.act.margin,0)):i.moveTo(new xt(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 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 xt(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:Ci,MiniSkin:Si,EmptySkin:Ti,CustomSkin:Ii,Rectangular:_i,Holes:Ri,JigSaw:Di,TriangularJigSaw:Oi,ClassicJigSaw:Ni,Arith:ji,TextActivityBase:Ui,FillInBlanks:Gi,OrderText:Xi,Complete:es,IdentifyText:ns,WrittenAnswer:ps,InformationScreen:ms,Identify:ys,Explore:xs,Menu:Ss,DoublePuzzle:Bs,ExchangePuzzle:_s,HolePuzzle:Os,MemoryGame:$s,SimpleAssociation:Ls,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)}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
|