@gamelearn/arcade-components 3.4.1 → 3.4.2
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.
|
@@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
61
61
|
`).split(`
|
|
62
62
|
`),T="00:00.000",P=0,w=0,O=0,k=[],D,F=!0,G=new u.default;G.oncue=function(z){var W=p[S],ee=p.ccOffset;W&&W.new&&(w!==void 0?ee=p.ccOffset=W.start:y(p,S,O)),O&&(ee=O-p.presentationOffset),z.startTime+=ee-w,z.endTime+=ee-w,z.id=h(z.startTime.toString())+h(z.endTime.toString())+h(z.text),z.text=decodeURIComponent(encodeURIComponent(z.text)),z.endTime>0&&k.push(z)},G.onparsingerror=function(z){D=z},G.onflush=function(){if(D&&R){R(D);return}C(k)},A.forEach(function(z){if(F)if(f(z,"X-TIMESTAMP-MAP=")){F=!1,z.substr(16).split(",").forEach(function(W){f(W,"LOCAL:")?T=W.substr(6):f(W,"MPEGTS:")&&(P=parseInt(W.substr(7)))});try{_+(p[S].start*9e4||0)<0&&(_+=8589934592),P-=_,w=c(T)/1e3,O=P/9e4,w===-1&&(D=new Error("Malformed X-TIMESTAMP-MAP: "+z))}catch{D=new Error("Malformed X-TIMESTAMP-MAP: "+z)}return}else z===""&&(F=!1);G.parse(z+`
|
|
63
63
|
`)}),G.flush()}};t.default=E}).call(this,n("./src/polyfills/number.js").Number)},"./src/utils/xhr-loader.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),u=window.performance,l=window.XMLHttpRequest,f=function(){function c(h){h&&h.xhrSetup&&(this.xhrSetup=h.xhrSetup)}return c.prototype.destroy=function(){this.abort(),this.loader=null},c.prototype.abort=function(){var h=this.loader;h&&h.readyState!==4&&(this.stats.aborted=!0,h.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},c.prototype.load=function(h,y,E){this.context=h,this.config=y,this.callbacks=E,this.stats={trequest:u.now(),retry:0},this.retryDelay=y.retryDelay,this.loadInternal()},c.prototype.loadInternal=function(){var h,y=this.context;h=this.loader=new l;var E=this.stats;E.tfirst=0,E.loaded=0;var g=this.xhrSetup;try{if(g)try{g(h,y.url)}catch{h.open("GET",y.url,!0),g(h,y.url)}h.readyState||h.open("GET",y.url,!0)}catch(_){this.callbacks.onError({code:h.status,text:_.message},y,h);return}y.rangeEnd&&h.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=y.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),h.send()},c.prototype.readystatechange=function(h){var y=h.currentTarget,E=y.readyState,g=this.stats,_=this.context,p=this.config;if(!g.aborted&&E>=2)if(window.clearTimeout(this.requestTimeout),g.tfirst===0&&(g.tfirst=Math.max(u.now(),g.trequest)),E===4){var S=y.status;if(S>=200&&S<300){g.tload=Math.max(g.tfirst,u.now());var C=void 0,R=void 0;_.responseType==="arraybuffer"?(C=y.response,R=C.byteLength):(C=y.responseText,R=C.length),g.loaded=g.total=R;var x={url:y.responseURL,data:C};this.callbacks.onSuccess(x,g,_,y)}else g.retry>=p.maxRetry||S>=400&&S<499?(a.logger.error(S+" while loading "+_.url),this.callbacks.onError({code:S,text:y.statusText},_,y)):(a.logger.warn(S+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,p.maxRetryDelay),g.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),p.timeout)},c.prototype.loadtimeout=function(){a.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},c.prototype.loadprogress=function(h){var y=h.currentTarget,E=this.stats;E.loaded=h.loaded,h.lengthComputable&&(E.total=h.total);var g=this.callbacks.onProgress;g&&g(E,this.context,null,y)},c}();t.default=f}}).default})})(hls);var hlsExports=hls.exports;const Hls=getDefaultExportFromCjs(hlsExports);var propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=o,ReactPropTypesSecret_1}var checkPropTypes_1,hasRequiredCheckPropTypes;function requireCheckPropTypes(){if(hasRequiredCheckPropTypes)return checkPropTypes_1;hasRequiredCheckPropTypes=1;var o=function(){};if(process.env.NODE_ENV!=="production"){var e=requireReactPropTypesSecret(),r={},t=Function.call.bind(Object.prototype.hasOwnProperty);o=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function n(a,u,l,f,c){if(process.env.NODE_ENV!=="production"){for(var h in a)if(t(a,h)){var y;try{if(typeof a[h]!="function"){var E=Error((f||"React class")+": "+l+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.");throw E.name="Invariant Violation",E}y=a[h](u,h,f,l,null,e)}catch(_){y=_}if(y&&!(y instanceof Error)&&o((f||"React class")+": type specification of "+l+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof y+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),y instanceof Error&&!(y.message in r)){r[y.message]=!0;var g=c?c():"";o("Failed "+l+" type: "+y.message+(g??""))}}}}return n.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},checkPropTypes_1=n,checkPropTypes_1}var factoryWithTypeCheckers,hasRequiredFactoryWithTypeCheckers;function requireFactoryWithTypeCheckers(){if(hasRequiredFactoryWithTypeCheckers)return factoryWithTypeCheckers;hasRequiredFactoryWithTypeCheckers=1;var o=requireReactIs(),e=requireObjectAssign(),r=requireReactPropTypesSecret(),t=requireCheckPropTypes(),n=Function.call.bind(Object.prototype.hasOwnProperty),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(l){var f="Warning: "+l;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function u(){return null}return factoryWithTypeCheckers=function(l,f){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function y(I){var $=I&&(c&&I[c]||I[h]);if(typeof $=="function")return $}var E="<<anonymous>>",g={array:C("array"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:R(),arrayOf:x,element:A(),elementType:T(),instanceOf:P,node:D(),objectOf:O,oneOf:w,oneOfType:k,shape:F,exact:G};function _(I,$){return I===$?I!==0||1/I===1/$:I!==I&&$!==$}function p(I){this.message=I,this.stack=""}p.prototype=Error.prototype;function S(I){if(process.env.NODE_ENV!=="production")var $={},V=0;function X(J,ne,ae,Z,ie,oe,fe){if(Z=Z||E,oe=oe||ae,fe!==r){if(f){var de=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw de.name="Invariant Violation",de}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ce=Z+":"+ae;!$[ce]&&V<3&&(a("You are manually calling a React.PropTypes validation function for the `"+oe+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),$[ce]=!0,V++)}}return ne[ae]==null?J?ne[ae]===null?new p("The "+ie+" `"+oe+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new p("The "+ie+" `"+oe+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:I(ne,ae,Z,ie,oe)}var q=X.bind(null,!1);return q.isRequired=X.bind(null,!0),q}function C(I){function $(V,X,q,J,ne,ae){var Z=V[X],ie=ee(Z);if(ie!==I){var oe=Q(Z);return new p("Invalid "+J+" `"+ne+"` of type "+("`"+oe+"` supplied to `"+q+"`, expected ")+("`"+I+"`."))}return null}return S($)}function R(){return S(u)}function x(I){function $(V,X,q,J,ne){if(typeof I!="function")return new p("Property `"+ne+"` of component `"+q+"` has invalid PropType notation inside arrayOf.");var ae=V[X];if(!Array.isArray(ae)){var Z=ee(ae);return new p("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+q+"`, expected an array."))}for(var ie=0;ie<ae.length;ie++){var oe=I(ae,ie,q,J,ne+"["+ie+"]",r);if(oe instanceof Error)return oe}return null}return S($)}function A(){function I($,V,X,q,J){var ne=$[V];if(!l(ne)){var ae=ee(ne);return new p("Invalid "+q+" `"+J+"` of type "+("`"+ae+"` supplied to `"+X+"`, expected a single ReactElement."))}return null}return S(I)}function T(){function I($,V,X,q,J){var ne=$[V];if(!o.isValidElementType(ne)){var ae=ee(ne);return new p("Invalid "+q+" `"+J+"` of type "+("`"+ae+"` supplied to `"+X+"`, expected a single ReactElement type."))}return null}return S(I)}function P(I){function $(V,X,q,J,ne){if(!(V[X]instanceof I)){var ae=I.name||E,Z=U(V[X]);return new p("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+q+"`, expected ")+("instance of `"+ae+"`."))}return null}return S($)}function w(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),u;function $(V,X,q,J,ne){for(var ae=V[X],Z=0;Z<I.length;Z++)if(_(ae,I[Z]))return null;var ie=JSON.stringify(I,function(fe,de){var ce=Q(de);return ce==="symbol"?String(de):de});return new p("Invalid "+J+" `"+ne+"` of value `"+String(ae)+"` "+("supplied to `"+q+"`, expected one of "+ie+"."))}return S($)}function O(I){function $(V,X,q,J,ne){if(typeof I!="function")return new p("Property `"+ne+"` of component `"+q+"` has invalid PropType notation inside objectOf.");var ae=V[X],Z=ee(ae);if(Z!=="object")return new p("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+q+"`, expected an object."));for(var ie in ae)if(n(ae,ie)){var oe=I(ae,ie,q,J,ne+"."+ie,r);if(oe instanceof Error)return oe}return null}return S($)}function k(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var $=0;$<I.length;$++){var V=I[$];if(typeof V!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(V)+" at index "+$+"."),u}function X(q,J,ne,ae,Z){for(var ie=0;ie<I.length;ie++){var oe=I[ie];if(oe(q,J,ne,ae,Z,r)==null)return null}return new p("Invalid "+ae+" `"+Z+"` supplied to "+("`"+ne+"`."))}return S(X)}function D(){function I($,V,X,q,J){return z($[V])?null:new p("Invalid "+q+" `"+J+"` supplied to "+("`"+X+"`, expected a ReactNode."))}return S(I)}function F(I){function $(V,X,q,J,ne){var ae=V[X],Z=ee(ae);if(Z!=="object")return new p("Invalid "+J+" `"+ne+"` of type `"+Z+"` "+("supplied to `"+q+"`, expected `object`."));for(var ie in I){var oe=I[ie];if(oe){var fe=oe(ae,ie,q,J,ne+"."+ie,r);if(fe)return fe}}return null}return S($)}function G(I){function $(V,X,q,J,ne){var ae=V[X],Z=ee(ae);if(Z!=="object")return new p("Invalid "+J+" `"+ne+"` of type `"+Z+"` "+("supplied to `"+q+"`, expected `object`."));var ie=e({},V[X],I);for(var oe in ie){var fe=I[oe];if(!fe)return new p("Invalid "+J+" `"+ne+"` key `"+oe+"` supplied to `"+q+"`.\nBad object: "+JSON.stringify(V[X],null," ")+`
|
|
64
|
-
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var de=fe(ae,oe,q,J,ne+"."+oe,r);if(de)return de}return null}return S($)}function z(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(z);if(I===null||l(I))return!0;var $=y(I);if($){var V=$.call(I),X;if($!==I.entries){for(;!(X=V.next()).done;)if(!z(X.value))return!1}else for(;!(X=V.next()).done;){var q=X.value;if(q&&!z(q[1]))return!1}}else return!1;return!0;default:return!1}}function W(I,$){return I==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function ee(I){var $=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":W($,I)?"symbol":$}function Q(I){if(typeof I>"u"||I===null)return""+I;var $=ee(I);if($==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return $}function B(I){var $=Q(I);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function U(I){return!I.constructor||!I.constructor.name?E:I.constructor.name}return g.checkPropTypes=t,g.resetWarningCache=t.resetWarningCache,g.PropTypes=g,g},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var o=requireReactPropTypesSecret();function e(){}function r(){}return r.resetWarningCache=e,factoryWithThrowingShims=function(){function t(u,l,f,c,h,y){if(y!==o){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function n(){return t}var a={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},factoryWithThrowingShims}if(process.env.NODE_ENV!=="production"){var ReactIs=requireReactIs(),throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function BufferBar({time:o,setTimePoint:e,mandatory:r,mandatoryHasBeenViewed:t,viewed:n}){const a=Math.trunc(o.current*1e3/o.duration)/10,u=React$2.useRef(),[l,f]=React$2.useState(!1),c=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),h=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),y=(p,S)=>{f(!0);let C=p.offsetX;p.changedTouches&&(C=p.changedTouches[0].clientX);const R=S.offsetWidth+S.offsetLeft;C<=R&&C>=S.offsetLeft&&e(C,S.offsetWidth,S.offsetLeft)},E=()=>{window.onmousemove=null,window.onmouseup=null,f(!1)},g=p=>{window.onmousemove=S=>y(S,p),window.onmouseup=S=>E()},_=(p,S)=>{(!r||r&&t||n)&&(p.preventDefault(),e(p.clientX,S.offsetWidth,S.offsetLeft),g(S),f(!0))};return jsxRuntimeExports.jsx("div",{id:"buffer",ref:u,className:"video--controls__bar",onMouseDown:p=>{const S=u.current;_(p,S)},onTouchMove:p=>{const S=u.current;y(p,S)},onTouchStart:p=>{const S=u.current;f(!0),e(p.changedTouches[0].clientX,S.offsetWidth,S.offsetLeft)},children:jsxRuntimeExports.jsx("div",{className:"video--controls__progress",style:{width:`${a}%`},children:jsxRuntimeExports.jsx("span",{className:l?"video--controls__handle active":"video--controls__handle",children:l?jsxRuntimeExports.jsxs("div",{className:"video--current__time active",children:[c,":",h]}):null})})})}BufferBar.defaultProps={time:{current:0,duration:0},setTimePoint:()=>{}};BufferBar.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number}),setTimePoint:PropTypes.func};function Timer({time:o}){const e=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),r=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),t=Math.trunc(o.duration/60)<10?["0",Math.trunc(o.duration/60)].join("").trim():Math.trunc(o.duration/60),n=Math.trunc(o.duration%60)<10?["0",Math.trunc(o.duration%60)].join("").trim():Math.trunc(o.duration%60);return jsxRuntimeExports.jsxs("div",{className:"video--time",children:[jsxRuntimeExports.jsxs("span",{className:"time",children:[e,":",r]}),jsxRuntimeExports.jsxs("span",{className:"duration",children:[t,":",n]})]})}Timer.defaultProps={time:{current:0,duration:0}};Timer.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};function ControlButtons({pauseVideo:o,paused:e,translate:r}){return jsxRuntimeExports.jsx("div",{className:"video--controls__buttons",children:jsxRuntimeExports.jsx("button",{id:"playPause","aria-label":r(e?"storylines.misc.play":"storylines.misc.pause"),className:e?"unset-button icon-play":"unset-button icon-pause",type:"button",onClick:()=>{o(),document.querySelector("#playPause").blur()}})})}ControlButtons.defaultProps={paused:!1,pauseVideo:()=>{}};function FinishedVideoButtons({restart:o,translate:e}){return jsxRuntimeExports.jsx("div",{className:"video--extra__actions video--extra__actions--widthTransparencyLayer position--absolute z-index1",children:jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{o()},className:"gat--btn gat--btn__secondary","aria-label":e("video.replay"),children:[jsxRuntimeExports.jsx("span",{className:"icon-rewind"}),jsxRuntimeExports.jsx("span",{id:"video.replay"})]})})}FinishedVideoButtons.defaultProps={restart:()=>{},finished:!1};function PlayInitButton({play:o,finished:e,paused:r}){return e||!r?jsxRuntimeExports.jsx("div",{}):jsxRuntimeExports.jsx("div",{className:"video--extra__actions position--absolute z-index1",children:jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,"aria-label":"play video",onKeyUp:()=>{},onClick:()=>{o()},className:"play--video__button",children:jsxRuntimeExports.jsx("span",{className:"icon-play-outline"})})})}PlayInitButton.defaultProps={play:()=>{},finished:!1,paused:!1};function skipButton({viewed:o,mandatory:e,finished:r,skip:t,mandatoryHasBeenViewed:n,translate:a}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&o||!e||r||n?jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{className:"gat--btn__round gat--btn__close",type:"button","aria-label":a("storylines.misc.closePiece"),onKeyUp:()=>{},onClick:()=>{t()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}):null})}skipButton.defaultProps={mandatory:!1,viewed:!1,finished:!1,skip:()=>{}};function VolumeBar({volume:o,muted:e,setVolume:r,mute:t}){const n=React$2.useRef(),a=e?0:Math.floor(o*100),u=(h,y)=>{const E=y.offsetWidth+y.offsetLeft;let g=h.clientX;h.changedTouches&&(g=h.changedTouches[0].clientX),g<=E&&g>=y.offsetLeft&&r(g,y.offsetWidth,y.offsetLeft)},l=()=>{window.onmousemove=null,window.onmouseup=null},f=h=>{window.onmousemove=y=>u(y,h),window.onmouseup=y=>l()},c=(h,y)=>{h.preventDefault(),r(h.clientX,y.offsetWidth,y.offsetLeft),f(y)};return jsxRuntimeExports.jsxs("div",{className:"video--sound",children:[jsxRuntimeExports.jsx("span",{onClick:()=>t(),className:a===0?"icon-sound-off":"icon-sound"}),jsxRuntimeExports.jsx("div",{ref:n,onMouseDown:h=>{const y=n.current;c(h,y)},onTouchMove:h=>{const y=n.current;u(h,y)},onTouchStart:h=>{const y=n.current;r(h.changedTouches[0].clientX,y.offsetWidth,y.offsetLeft)},id:"volume",className:"video--sound__level",children:jsxRuntimeExports.jsx("span",{style:{width:`${a<10?10:a}%`},className:"video--sound__progress",children:jsxRuntimeExports.jsx("span",{className:"video--handle"})})})]})}VolumeBar.defaultProps={volume:0,muted:!1,setVolume:()=>{},mute:()=>{}};VolumeBar.propTypes={volume:PropTypes.number,setVolume:PropTypes.func,mute:PropTypes.func,muted:PropTypes.bool};function VideoControllers({pause:o,mandatory:e,viewed:r,skip:t,rewind:n,paused:a,time:u,finished:l,restart:f,volume:c,muted:h,mute:y,setVolume:E,setTimePoint:g,audioAnimation:_,mandatoryHasBeenViewed:p,translate:S,visibility:C}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(skipButton,{mandatory:e,finished:l,viewed:r,skip:t,rewind:n,mandatoryHasBeenViewed:p,translate:S}),jsxRuntimeExports.jsxs("div",{className:`video--controls-wrap ${C?"video--controls-wrap--hidden":""}`,children:[_?null:jsxRuntimeExports.jsx(PlayInitButton,{play:o,paused:a,finished:l}),l?jsxRuntimeExports.jsx(FinishedVideoButtons,{restart:f,translate:S}):null,jsxRuntimeExports.jsxs("div",{className:"video--controls",children:[jsxRuntimeExports.jsx(BufferBar,{mandatory:e,mandatoryHasBeenViewed:p,time:u,setTimePoint:g,finished:l,viewed:r}),jsxRuntimeExports.jsxs("div",{className:"video--controls__actions",children:[jsxRuntimeExports.jsx(Timer,{time:u}),_?jsxRuntimeExports.jsx("div",{className:"audio-animation-wrap",children:jsxRuntimeExports.jsx("div",{className:`audio-animation ${a?"audio-animation--notAnimate ":null}`})}):null,jsxRuntimeExports.jsx(ControlButtons,{paused:a,pauseVideo:o,translate:S}),jsxRuntimeExports.jsx(VolumeBar,{muted:h,mute:y,volume:c,setVolume:E})]})]})]})]})}VideoControllers.defaultProps={audioAnimation:!1,paused:!1,mandatory:!1,viewed:!1,volume:0,muted:!1,finished:!1,restart:()=>{},pause:()=>{},skip:()=>{},rewind:()=>{},setTimePoint:()=>{},setVolume:()=>{},mute:()=>{},time:{current:0,duration:0}};VideoControllers.propTypes={audioAnimation:PropTypes.bool,paused:PropTypes.bool,mandatory:PropTypes.bool,muted:PropTypes.bool,volume:PropTypes.number,viewed:PropTypes.bool,pause:PropTypes.func,finished:PropTypes.bool,restart:PropTypes.func,skip:PropTypes.func,rewind:PropTypes.func,mute:PropTypes.func,setTimePoint:PropTypes.func,setVolume:PropTypes.func,time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};const defaultBgImageForAudio="https://min.gamelearn.io/css-resources/gamelearn/resources/bgAudioPiece.jpg";function VideoVisor({documentType:o,url:e,required:r,viewed:t,backgroundImage:n,soundActions:a,endVideo:u,translate:l}){const[f,c]=React$2.useState(!1),[h]=a,[y,E]=React$2.useState(0),[g,_]=React$2.useState(0),[p,S]=React$2.useState(!1),[C,R]=React$2.useState(!0),[x,A]=React$2.useState(!1),[T,P]=React$2.useState(),[w,O]=React$2.useState(0),[k,D]=React$2.useState(!1),F=e&&e.match(/\.m3u8(\?.+=.+)*$/i)&&Hls.isSupported(),G=e&&(e.match(/youtube/i)||e.match(/vimeo/i)),z=e&&(e.match(/.mp3/i)||e.match(/.ogg/i)||e.match(/.wav/i)||e.match(/.m4a/i)),W={ref:fe=>{P(fe)},src:e,style:{height:"100%",width:"100%"}},ee=()=>{r&&c(!0),S(!1),T.pause(),R(!0),A(!0),D(!1),o!=="document"&&o!=="lesson"&&u()},Q=()=>{u()},B=()=>{R(!1),S(!1)},U=()=>{S(!0)},I=()=>{S(!1),E(T.duration)};React$2.useEffect(()=>{let fe;if(T){if(F){fe=new Hls;const de=`${e}?v=${Math.floor(Math.random()*99999999)}`;fe.loadSource(de),fe.attachMedia(T),fe.on(Hls.Events.FRAG_LOAD_PROGRESS,(ce,Se)=>{const{stats:Ce}=Se;_(Ce.loaded*100/Ce.total)})}return()=>{fe&&fe.destroy(),fe=null}}},[F,e,T]);const $=()=>{T.currentTime-=15},V=()=>{h("click-ui"),C?(T.play(),A(!1)):T.pause(),R(!C)},X=(fe,de,ce)=>{A(!1),T.currentTime=de?parseFloat((fe-ce)/de*T.duration):0},q=()=>{A(!1),T.currentTime=0,V()},J=()=>{h("click-ui"),T.muted=!T.muted},ne=(fe,de,ce)=>{T.muted=!1;const Se=fe-ce>=0?(fe-ce)/de:0;T.volume=Se*100>10?Se:0,O(T.volume)};React$2.useEffect(()=>{let fe;return!k&&!C&&(fe=setTimeout(()=>{D(!0),clearTimeout(fe)},3e3)),()=>clearTimeout(fe)},[k,C]);const ae=()=>{k&&D(!1)},Z=n||defaultBgImageForAudio,ie=Z===defaultBgImageForAudio?"cover":"contain",oe={backgroundImage:`url("${Z}")`,backgroundSize:ie,backgroundRepeat:"no-repeat",backgroundPosition:"center center"};return jsxRuntimeExports.jsx("div",{className:`video ${r&&!f&&!t?"forward-disabled":""}`,style:z?oe:null,children:G?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{type:"button","aria-label":l("storylines.misc.closePiece"),className:"gat--btn__round gat--btn__close",onClick:()=>{h("click-ui"),u()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}),jsxRuntimeExports.jsx("iframe",{className:"embeddedVideo",title:"title",...W})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(VideoControllers,{visibility:k,mandatoryHasBeenViewed:f,audioAnimation:!!z,skip:u,mandatory:r,viewed:t,volume:T?T.volume:0,mute:J,muted:T?T.muted:!1,paused:C,finished:x,restart:q,setTimePoint:X,time:{duration:y,current:T?T.currentTime:0},rewind:$,pause:V,volumeState:w,setVolume:ne,translate:l}),jsxRuntimeExports.jsx("video",{onMouseMove:()=>ae(),onClick:()=>{ae()},onFocus:()=>{ae()},onCanPlayThrough:I,onWaiting:U,onEnded:ee,onError:Q,onPlaying:B,...W,children:jsxRuntimeExports.jsx("track",{kind:"captions"})}),p?jsxRuntimeExports.jsxs("div",{className:"video-loading-container",style:{top:0,left:0},children:[jsxRuntimeExports.jsx("div",{className:"video-loading-container-bg opacity-wrapper"}),jsxRuntimeExports.jsx("div",{className:"popup-alert warning",children:jsxRuntimeExports.jsx("div",{className:"popup-message",children:jsxRuntimeExports.jsx("p",{children:Math.floor(g)})})})]}):null]})})}VideoVisor.defaultProps={url:"",name:"",backgroundImage:null,documentType:"",required:!1,viewed:!1,endVideo:()=>{}};function VideoComponent({emitEvent:o,name:e,documentType:r,document:t,documentId_labelId:n,soundActions:a,required:u,viewed:l,visible:f,img:c,imgId_labelId:h,keyboardControl:y}){const E=S=>o({type:"translate",payload:S}),{url:g}=t,_=React$2.useMemo(()=>({documentId:n,imgId:h,required:u,name:e,type:"video",viewed:l,documentType:r}),[n,h,u,e,l,r]),p=React$2.useCallback(()=>{o({type:"finishMedia",payload:_})},[o,_]);return React$2.useEffect(()=>{f||p()},[p,f]),f?(y(null,l?null:p,l?null:p),jsxRuntimeExports.jsx(VideoVisor,{backgroundImage:c==null?void 0:c.url,url:g,soundActions:a,documentType:r,required:u,viewed:l,endVideo:()=>p(),translate:E})):null}function ChangeCamera({targetUid:o,emitEvent:e,transition:r={type:"pan",speed:10}}){const{change:t}=arcadeThreeCore.CameraControls.useStore(),n=fiber.useThree(a=>a.camera);return React$2.useEffect(()=>{const a=()=>{e({type:"success"})};return n.addEventListener("transitionEnd",a),()=>{n.removeEventListener("transitionEnd",a)}},[]),React$2.useEffect(()=>{t(o,r)},[o,r]),null}var htmlReactParser={exports:{}},lib$4={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib$4,"__esModule",{value:!0});function _slicedToArray(o,e){return _arrayWithHoles(o)||_iterableToArrayLimit(o,e)||_unsupportedIterableToArray(o,e)||_nonIterableRest()}function _arrayWithHoles(o){if(Array.isArray(o))return o}function _iterableToArrayLimit(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t=[],n=!0,a=!1,u,l;try{for(r=r.call(o);!(n=(u=r.next()).done)&&(t.push(u.value),!(e&&t.length===e));n=!0);}catch(f){a=!0,l=f}finally{try{!n&&r.return!=null&&r.return()}finally{if(a)throw l}}return t}}function _unsupportedIterableToArray(o,e){if(o){if(typeof o=="string")return _arrayLikeToArray(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(o,e)}}function _arrayLikeToArray(o,e){(e==null||e>o.length)&&(e=o.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=o[r];return t}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
64
|
+
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var de=fe(ae,oe,q,J,ne+"."+oe,r);if(de)return de}return null}return S($)}function z(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(z);if(I===null||l(I))return!0;var $=y(I);if($){var V=$.call(I),X;if($!==I.entries){for(;!(X=V.next()).done;)if(!z(X.value))return!1}else for(;!(X=V.next()).done;){var q=X.value;if(q&&!z(q[1]))return!1}}else return!1;return!0;default:return!1}}function W(I,$){return I==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function ee(I){var $=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":W($,I)?"symbol":$}function Q(I){if(typeof I>"u"||I===null)return""+I;var $=ee(I);if($==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return $}function B(I){var $=Q(I);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function U(I){return!I.constructor||!I.constructor.name?E:I.constructor.name}return g.checkPropTypes=t,g.resetWarningCache=t.resetWarningCache,g.PropTypes=g,g},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var o=requireReactPropTypesSecret();function e(){}function r(){}return r.resetWarningCache=e,factoryWithThrowingShims=function(){function t(u,l,f,c,h,y){if(y!==o){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function n(){return t}var a={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},factoryWithThrowingShims}if(process.env.NODE_ENV!=="production"){var ReactIs=requireReactIs(),throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function BufferBar({time:o,setTimePoint:e,mandatory:r,mandatoryHasBeenViewed:t,viewed:n}){const a=Math.trunc(o.current*1e3/o.duration)/10,u=React$2.useRef(),[l,f]=React$2.useState(!1),c=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),h=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),y=(p,S)=>{f(!0);let C=p.offsetX;p.changedTouches&&(C=p.changedTouches[0].clientX);const R=S.offsetWidth+S.offsetLeft;C<=R&&C>=S.offsetLeft&&e(C,S.offsetWidth,S.offsetLeft)},E=()=>{window.onmousemove=null,window.onmouseup=null,f(!1)},g=p=>{window.onmousemove=S=>y(S,p),window.onmouseup=S=>E()},_=(p,S)=>{(!r||r&&t||n)&&(p.preventDefault(),e(p.clientX,S.offsetWidth,S.offsetLeft),g(S),f(!0))};return jsxRuntimeExports.jsx("div",{id:"buffer",ref:u,className:"video--controls__bar",onMouseDown:p=>{const S=u.current;_(p,S)},onTouchMove:p=>{const S=u.current;y(p,S)},onTouchStart:p=>{const S=u.current;f(!0),e(p.changedTouches[0].clientX,S.offsetWidth,S.offsetLeft)},children:jsxRuntimeExports.jsx("div",{className:"video--controls__progress",style:{width:`${a}%`},children:jsxRuntimeExports.jsx("span",{className:l?"video--controls__handle active":"video--controls__handle",children:l?jsxRuntimeExports.jsxs("div",{className:"video--current__time active",children:[c,":",h]}):null})})})}BufferBar.defaultProps={time:{current:0,duration:0},setTimePoint:()=>{}};BufferBar.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number}),setTimePoint:PropTypes.func};function Timer({time:o}){const e=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),r=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),t=Math.trunc(o.duration/60)<10?["0",Math.trunc(o.duration/60)].join("").trim():Math.trunc(o.duration/60),n=Math.trunc(o.duration%60)<10?["0",Math.trunc(o.duration%60)].join("").trim():Math.trunc(o.duration%60);return jsxRuntimeExports.jsxs("div",{className:"video--time",children:[jsxRuntimeExports.jsxs("span",{className:"time",children:[e,":",r]}),jsxRuntimeExports.jsxs("span",{className:"duration",children:[t,":",n]})]})}Timer.defaultProps={time:{current:0,duration:0}};Timer.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};function ControlButtons({pauseVideo:o,paused:e,translate:r}){return jsxRuntimeExports.jsx("div",{className:"video--controls__buttons",children:jsxRuntimeExports.jsx("button",{id:"playPause","aria-label":r(e?"storylines.misc.play":"storylines.misc.pause"),className:e?"unset-button icon-play":"unset-button icon-pause",type:"button",onClick:()=>{o(),document.querySelector("#playPause").blur()}})})}ControlButtons.defaultProps={paused:!1,pauseVideo:()=>{}};function FinishedVideoButtons({restart:o,translate:e}){return jsxRuntimeExports.jsx("div",{className:"video--extra__actions video--extra__actions--widthTransparencyLayer position--absolute z-index1",children:jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{o()},className:"gat--btn gat--btn__secondary","aria-label":e("video.replay"),children:[jsxRuntimeExports.jsx("span",{className:"icon-rewind"}),jsxRuntimeExports.jsx("span",{id:"video.replay"})]})})}FinishedVideoButtons.defaultProps={restart:()=>{},finished:!1};function PlayInitButton({play:o,finished:e,paused:r}){return e||!r?jsxRuntimeExports.jsx("div",{}):jsxRuntimeExports.jsx("div",{className:"video--extra__actions position--absolute z-index1",children:jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,"aria-label":"play video",onKeyUp:()=>{},onClick:()=>{o()},className:"play--video__button",children:jsxRuntimeExports.jsx("span",{className:"icon-play-outline"})})})}PlayInitButton.defaultProps={play:()=>{},finished:!1,paused:!1};function skipButton({viewed:o,mandatory:e,finished:r,skip:t,mandatoryHasBeenViewed:n,translate:a}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&o||!e||r||n?jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{className:"gat--btn__round gat--btn__close",type:"button","aria-label":a("storylines.misc.closePiece"),onKeyUp:()=>{},onClick:()=>{t()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}):null})}skipButton.defaultProps={mandatory:!1,viewed:!1,finished:!1,skip:()=>{}};function VolumeBar({volume:o,muted:e,setVolume:r,mute:t}){const n=React$2.useRef(),a=e?0:Math.floor(o*100),u=(h,y)=>{const E=y.offsetWidth+y.offsetLeft;let g=h.clientX;h.changedTouches&&(g=h.changedTouches[0].clientX),g<=E&&g>=y.offsetLeft&&r(g,y.offsetWidth,y.offsetLeft)},l=()=>{window.onmousemove=null,window.onmouseup=null},f=h=>{window.onmousemove=y=>u(y,h),window.onmouseup=y=>l()},c=(h,y)=>{h.preventDefault(),r(h.clientX,y.offsetWidth,y.offsetLeft),f(y)};return jsxRuntimeExports.jsxs("div",{className:"video--sound",children:[jsxRuntimeExports.jsx("span",{onClick:()=>t(),className:a===0?"icon-sound-off":"icon-sound"}),jsxRuntimeExports.jsx("div",{ref:n,onMouseDown:h=>{const y=n.current;c(h,y)},onTouchMove:h=>{const y=n.current;u(h,y)},onTouchStart:h=>{const y=n.current;r(h.changedTouches[0].clientX,y.offsetWidth,y.offsetLeft)},id:"volume",className:"video--sound__level",children:jsxRuntimeExports.jsx("span",{style:{width:`${a<10?10:a}%`},className:"video--sound__progress",children:jsxRuntimeExports.jsx("span",{className:"video--handle"})})})]})}VolumeBar.defaultProps={volume:0,muted:!1,setVolume:()=>{},mute:()=>{}};VolumeBar.propTypes={volume:PropTypes.number,setVolume:PropTypes.func,mute:PropTypes.func,muted:PropTypes.bool};function VideoControllers({pause:o,mandatory:e,viewed:r,skip:t,rewind:n,paused:a,time:u,finished:l,restart:f,volume:c,muted:h,mute:y,setVolume:E,setTimePoint:g,audioAnimation:_,mandatoryHasBeenViewed:p,translate:S,visibility:C}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(skipButton,{mandatory:e,finished:l,viewed:r,skip:t,rewind:n,mandatoryHasBeenViewed:p,translate:S}),jsxRuntimeExports.jsxs("div",{className:`video--controls-wrap ${C?"video--controls-wrap--hidden":""}`,children:[_?null:jsxRuntimeExports.jsx(PlayInitButton,{play:o,paused:a,finished:l}),l?jsxRuntimeExports.jsx(FinishedVideoButtons,{restart:f,translate:S}):null,jsxRuntimeExports.jsxs("div",{className:"video--controls",children:[jsxRuntimeExports.jsx(BufferBar,{mandatory:e,mandatoryHasBeenViewed:p,time:u,setTimePoint:g,finished:l,viewed:r}),jsxRuntimeExports.jsxs("div",{className:"video--controls__actions",children:[jsxRuntimeExports.jsx(Timer,{time:u}),_?jsxRuntimeExports.jsx("div",{className:"audio-animation-wrap",children:jsxRuntimeExports.jsx("div",{className:`audio-animation ${a?"audio-animation--notAnimate ":null}`})}):null,jsxRuntimeExports.jsx(ControlButtons,{paused:a,pauseVideo:o,translate:S}),jsxRuntimeExports.jsx(VolumeBar,{muted:h,mute:y,volume:c,setVolume:E})]})]})]})]})}VideoControllers.defaultProps={audioAnimation:!1,paused:!1,mandatory:!1,viewed:!1,volume:0,muted:!1,finished:!1,restart:()=>{},pause:()=>{},skip:()=>{},rewind:()=>{},setTimePoint:()=>{},setVolume:()=>{},mute:()=>{},time:{current:0,duration:0}};VideoControllers.propTypes={audioAnimation:PropTypes.bool,paused:PropTypes.bool,mandatory:PropTypes.bool,muted:PropTypes.bool,volume:PropTypes.number,viewed:PropTypes.bool,pause:PropTypes.func,finished:PropTypes.bool,restart:PropTypes.func,skip:PropTypes.func,rewind:PropTypes.func,mute:PropTypes.func,setTimePoint:PropTypes.func,setVolume:PropTypes.func,time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};const defaultBgImageForAudio="https://min.gamelearn.io/css-resources/gamelearn/resources/bgAudioPiece.jpg";function VideoVisor({documentType:o,url:e,required:r,viewed:t,backgroundImage:n,soundActions:a,endVideo:u,translate:l}){const[f,c]=React$2.useState(!1),[h]=a,[y,E]=React$2.useState(0),[g,_]=React$2.useState(0),[p,S]=React$2.useState(!1),[C,R]=React$2.useState(!0),[x,A]=React$2.useState(!1),[T,P]=React$2.useState(),[w,O]=React$2.useState(0),[k,D]=React$2.useState(!1),F=e&&e.match(/\.m3u8(\?.+=.+)*$/i)&&Hls.isSupported(),G=e&&(e.match(/youtube/i)||e.match(/vimeo/i)),z=e&&(e.match(/.mp3/i)||e.match(/.ogg/i)||e.match(/.wav/i)||e.match(/.m4a/i)),W={ref:fe=>{P(fe)},src:e,style:{height:"100%",width:"100%"}},ee=()=>{r&&c(!0),S(!1),T.pause(),R(!0),A(!0),D(!1),o!=="document"&&o!=="lesson"&&u()},Q=()=>{u()},B=()=>{R(!1),S(!1)},U=()=>{S(!0)},I=()=>{S(!1),E(T.duration)};React$2.useEffect(()=>{let fe;if(T){if(F){fe=new Hls;const de=`${e}?v=${Math.floor(Math.random()*99999999)}`;fe.loadSource(de),fe.attachMedia(T),fe.on(Hls.Events.FRAG_LOAD_PROGRESS,(ce,Se)=>{const{stats:Ce}=Se;_(Ce.loaded*100/Ce.total)})}return()=>{fe&&fe.destroy(),fe=null}}},[F,e,T]);const $=()=>{T.currentTime-=15},V=()=>{h("click-ui"),C?(T.play(),A(!1)):T.pause(),R(!C)},X=(fe,de,ce)=>{A(!1),T.currentTime=de?parseFloat((fe-ce)/de*T.duration):0},q=()=>{A(!1),T.currentTime=0,V()},J=()=>{h("click-ui"),T.muted=!T.muted},ne=(fe,de,ce)=>{T.muted=!1;const Se=fe-ce>=0?(fe-ce)/de:0;T.volume=Se*100>10?Se:0,O(T.volume)};React$2.useEffect(()=>{let fe;return!k&&!C&&(fe=setTimeout(()=>{D(!0),clearTimeout(fe)},3e3)),()=>clearTimeout(fe)},[k,C]);const ae=()=>{k&&D(!1)},Z=n||defaultBgImageForAudio,ie=Z===defaultBgImageForAudio?"cover":"contain",oe={backgroundImage:`url("${Z}")`,backgroundSize:ie,backgroundRepeat:"no-repeat",backgroundPosition:"center center"};return jsxRuntimeExports.jsx("div",{className:`video ${r&&!f&&!t?"forward-disabled":""}`,style:z?oe:null,children:G?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{type:"button","aria-label":l("storylines.misc.closePiece"),className:"gat--btn__round gat--btn__close",onClick:()=>{h("click-ui"),u()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}),jsxRuntimeExports.jsx("iframe",{className:"embeddedVideo",title:"title",...W})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(VideoControllers,{visibility:k,mandatoryHasBeenViewed:f,audioAnimation:!!z,skip:u,mandatory:r,viewed:t,volume:T?T.volume:0,mute:J,muted:T?T.muted:!1,paused:C,finished:x,restart:q,setTimePoint:X,time:{duration:y,current:T?T.currentTime:0},rewind:$,pause:V,volumeState:w,setVolume:ne,translate:l}),jsxRuntimeExports.jsx("video",{onMouseMove:()=>ae(),onClick:()=>{ae()},onFocus:()=>{ae()},onCanPlayThrough:I,onWaiting:U,onEnded:ee,onError:Q,onPlaying:B,...W,children:jsxRuntimeExports.jsx("track",{kind:"captions"})}),p?jsxRuntimeExports.jsxs("div",{className:"video-loading-container",style:{top:0,left:0},children:[jsxRuntimeExports.jsx("div",{className:"video-loading-container-bg opacity-wrapper"}),jsxRuntimeExports.jsx("div",{className:"popup-alert warning",children:jsxRuntimeExports.jsx("div",{className:"popup-message",children:jsxRuntimeExports.jsx("p",{children:Math.floor(g)})})})]}):null]})})}VideoVisor.defaultProps={url:"",name:"",backgroundImage:null,documentType:"",required:!1,viewed:!1,endVideo:()=>{}};function VideoComponent({emitEvent:o,name:e,documentType:r,document:t,documentId_labelId:n,soundActions:a,required:u,viewed:l,visible:f,img:c,imgId_labelId:h,keyboardControl:y}){const E=S=>o({type:"translate",payload:S}),{url:g}=t,_=React$2.useMemo(()=>({documentId:n,imgId:h,required:u,name:e,type:"video",viewed:l,documentType:r}),[n,h,u,e,l,r]),p=React$2.useCallback(()=>{o({type:"finishMedia",payload:_})},[o,_]);return React$2.useEffect(()=>{f||p()},[p,f]),f?(y(null,l?null:p,l?null:p),jsxRuntimeExports.jsx(VideoVisor,{backgroundImage:c==null?void 0:c.url,url:g,soundActions:a,documentType:r,required:u,viewed:l,endVideo:()=>p(),translate:E})):null}function ChangeCamera({targetUid:o,emitEvent:e,transition:r={type:"pan",speed:10}}){const{change:t}=arcadeThreeCore.CameraControls.useStore(),n=fiber.useThree(a=>a.camera);return React$2.useEffect(()=>{const a=()=>{e({type:"success"})};return n.addEventListener("transitionEnd",a),()=>{n.removeEventListener("transitionEnd",a)}},[]),React$2.useEffect(()=>{t&&t(o,r)},[o,r]),null}var htmlReactParser={exports:{}},lib$4={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib$4,"__esModule",{value:!0});function _slicedToArray(o,e){return _arrayWithHoles(o)||_iterableToArrayLimit(o,e)||_unsupportedIterableToArray(o,e)||_nonIterableRest()}function _arrayWithHoles(o){if(Array.isArray(o))return o}function _iterableToArrayLimit(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t=[],n=!0,a=!1,u,l;try{for(r=r.call(o);!(n=(u=r.next()).done)&&(t.push(u.value),!(e&&t.length===e));n=!0);}catch(f){a=!0,l=f}finally{try{!n&&r.return!=null&&r.return()}finally{if(a)throw l}}return t}}function _unsupportedIterableToArray(o,e){if(o){if(typeof o=="string")return _arrayLikeToArray(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(o,e)}}function _arrayLikeToArray(o,e){(e==null||e>o.length)&&(e=o.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=o[r];return t}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
65
65
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(o){return properties.hasOwnProperty(o)?properties[o]:null}function PropertyInfoRecord(o,e,r,t,n,a,u){this.acceptsBooleans=e===BOOLEANISH_STRING||e===BOOLEAN||e===OVERLOADED_BOOLEAN,this.attributeName=t,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=o,this.type=e,this.sanitizeURL=a,this.removeEmptyString=u}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(o){properties[o]=new PropertyInfoRecord(o,RESERVED,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var e=_slicedToArray(o,2),r=e[0],t=e[1];properties[r]=new PropertyInfoRecord(r,STRING,!1,t,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEANISH_STRING,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEANISH_STRING,!1,o,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEAN,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEAN,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,OVERLOADED_BOOLEAN,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,POSITIVE_NUMERIC,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,NUMERIC,!1,o.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function o(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,STRING,!1,o.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,STRING,!1,o.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(o,e){var r=possibleStandardNamesOptimized[e];return r===SAME?o[e]=e:r===CAMELCASE?o[e.toLowerCase()]=e:o[e]=r,o},{});lib$4.BOOLEAN=BOOLEAN;lib$4.BOOLEANISH_STRING=BOOLEANISH_STRING;lib$4.NUMERIC=NUMERIC;lib$4.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib$4.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib$4.RESERVED=RESERVED;lib$4.STRING=STRING;lib$4.getPropertyInfo=getPropertyInfo;lib$4.isCustomAttribute=isCustomAttribute;lib$4.possibleStandardNames=possibleStandardNames;var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
|
|
66
66
|
`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING$1="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(o,e){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];e=e||{};var r=1,t=1;function n(_){var p=_.match(NEWLINE_REGEX);p&&(r+=p.length);var S=_.lastIndexOf(NEWLINE);t=~S?_.length-S:t+_.length}function a(){var _={line:r,column:t};return function(p){return p.position=new u(_),c(),p}}function u(_){this.start=_,this.end={line:r,column:t},this.source=e.source}u.prototype.content=o;function l(_){var p=new Error(e.source+":"+r+":"+t+": "+_);if(p.reason=_,p.filename=e.source,p.line=r,p.column=t,p.source=o,!e.silent)throw p}function f(_){var p=_.exec(o);if(p){var S=p[0];return n(S),o=o.slice(S.length),p}}function c(){f(WHITESPACE_REGEX)}function h(_){var p;for(_=_||[];p=y();)p!==!1&&_.push(p);return _}function y(){var _=a();if(!(FORWARD_SLASH!=o.charAt(0)||ASTERISK!=o.charAt(1))){for(var p=2;EMPTY_STRING$1!=o.charAt(p)&&(ASTERISK!=o.charAt(p)||FORWARD_SLASH!=o.charAt(p+1));)++p;if(p+=2,EMPTY_STRING$1===o.charAt(p-1))return l("End of comment missing");var S=o.slice(2,p-2);return t+=2,n(S),o=o.slice(p),t+=2,_({type:TYPE_COMMENT,comment:S})}}function E(){var _=a(),p=f(PROPERTY_REGEX);if(p){if(y(),!f(COLON_REGEX))return l("property missing ':'");var S=f(VALUE_REGEX),C=_({type:TYPE_DECLARATION,property:trim(p[0].replace(COMMENT_REGEX,EMPTY_STRING$1)),value:S?trim(S[0].replace(COMMENT_REGEX,EMPTY_STRING$1)):EMPTY_STRING$1});return f(SEMICOLON_REGEX),C}}function g(){var _=[];h(_);for(var p;p=E();)p!==!1&&(_.push(p),h(_));return _}return c(),g()};function trim(o){return o?o.replace(TRIM_REGEX,EMPTY_STRING$1):EMPTY_STRING$1}var parse=inlineStyleParser;function StyleToObject(o,e){var r=null;if(!o||typeof o!="string")return r;for(var t,n=parse(o),a=typeof e=="function",u,l,f=0,c=n.length;f<c;f++)t=n[f],u=t.property,l=t.value,a?e(u,l,t):l&&(r||(r={}),r[u]=l);return r}var styleToObject=StyleToObject,utilities$4={};utilities$4.__esModule=!0;utilities$4.camelCase=void 0;var CUSTOM_PROPERTY_REGEX=/^--[a-zA-Z0-9-]+$/,HYPHEN_REGEX=/-([a-z])/g,NO_HYPHEN_REGEX=/^[^-]+$/,VENDOR_PREFIX_REGEX=/^-(webkit|moz|ms|o|khtml)-/,MS_VENDOR_PREFIX_REGEX=/^-(ms)-/,skipCamelCase=function(o){return!o||NO_HYPHEN_REGEX.test(o)||CUSTOM_PROPERTY_REGEX.test(o)},capitalize=function(o,e){return e.toUpperCase()},trimHyphen=function(o,e){return"".concat(e,"-")},camelCase=function(o,e){return e===void 0&&(e={}),skipCamelCase(o)?o:(o=o.toLowerCase(),e.reactCompat?o=o.replace(MS_VENDOR_PREFIX_REGEX,trimHyphen):o=o.replace(VENDOR_PREFIX_REGEX,trimHyphen),o.replace(HYPHEN_REGEX,capitalize))};utilities$4.camelCase=camelCase;(function(o){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};o.__esModule=!0;var r=e(styleToObject),t=utilities$4;function n(a,u){var l={};return!a||typeof a!="string"||(0,r.default)(a,function(f,c){f&&c&&(l[(0,t.camelCase)(f,u)]=c)}),l}o.default=n})(cjs);var React$1=React$2,styleToJS=cjs.default;function invertObject(o,e){if(!o||typeof o!="object")throw new TypeError("First argument must be an object");var r,t,n=typeof e=="function",a={},u={};for(r in o){if(t=o[r],n&&(a=e(r,t),a&&a.length===2)){u[a[0]]=a[1];continue}typeof t=="string"&&(u[t]=r)}return u}function isCustomComponent(o,e){if(o.indexOf("-")===-1)return e&&typeof e.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var styleToJSOptions={reactCompat:!0};function setStyleProp$1(o,e){if(o!=null)try{e.style=styleToJS(o,styleToJSOptions)}catch{e.style={}}}var PRESERVE_CUSTOM_ATTRIBUTES=React$1.version.split(".")[0]>=16,elementsWithNoTextChildren=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function canTextBeChildOfNode$1(o){return!elementsWithNoTextChildren.has(o.name)}var utilities$3={PRESERVE_CUSTOM_ATTRIBUTES,invertObject,isCustomComponent,setStyleProp:setStyleProp$1,canTextBeChildOfNode:canTextBeChildOfNode$1,elementsWithNoTextChildren},reactProperty=lib$4,utilities$2=utilities$3,attributesToProps$2=function o(e){e=e||{};var r={reset:!0,submit:!0},t,n,a,u,l,f={},c=e.type&&r[e.type];for(t in e){if(a=e[t],reactProperty.isCustomAttribute(t)){f[t]=a;continue}if(n=t.toLowerCase(),u=getPropName(n),u){switch(l=reactProperty.getPropertyInfo(u),(u==="checked"||u==="value")&&!c&&(u=getPropName("default"+n)),f[u]=a,l&&l.type){case reactProperty.BOOLEAN:f[u]=!0;break;case reactProperty.OVERLOADED_BOOLEAN:a===""&&(f[u]=!0);break}continue}utilities$2.PRESERVE_CUSTOM_ATTRIBUTES&&(f[t]=a)}return utilities$2.setStyleProp(e.style,f),f};function getPropName(o){return reactProperty.possibleStandardNames[o]}var React=React$2,attributesToProps$1=attributesToProps$2,utilities$1=utilities$3,setStyleProp=utilities$1.setStyleProp,canTextBeChildOfNode=utilities$1.canTextBeChildOfNode;function domToReact$1(o,e){e=e||{};for(var r=e.library||React,t=r.cloneElement,n=r.createElement,a=r.isValidElement,u=[],l,f,c=typeof e.replace=="function",h,y,E,g=e.trim,_=0,p=o.length;_<p;_++){if(l=o[_],c&&(h=e.replace(l),a(h))){p>1&&(h=t(h,{key:h.key||_})),u.push(h);continue}if(l.type==="text"){if(f=!l.data.trim().length,f&&l.parent&&!canTextBeChildOfNode(l.parent)||g&&f)continue;u.push(l.data);continue}switch(y=l.attribs,skipAttributesToProps(l)?setStyleProp(y.style,y):y&&(y=attributesToProps$1(y)),E=null,l.type){case"script":case"style":l.children[0]&&(y.dangerouslySetInnerHTML={__html:l.children[0].data});break;case"tag":l.name==="textarea"&&l.children[0]?y.defaultValue=l.children[0].data:l.children&&l.children.length&&(E=domToReact$1(l.children,e));break;default:continue}p>1&&(y.key=_),u.push(n(l.name,y,E))}return u.length===1?u[0]:u}function skipAttributesToProps(o){return utilities$1.PRESERVE_CUSTOM_ATTRIBUTES&&o.type==="tag"&&utilities$1.isCustomComponent(o.name,o.attribs)}var domToReact_1=domToReact$1,CASE_SENSITIVE_TAG_NAMES$1=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],constants$2={CASE_SENSITIVE_TAG_NAMES:CASE_SENSITIVE_TAG_NAMES$1},node={},lib$3={},hasRequiredLib$1;function requireLib$1(){return hasRequiredLib$1||(hasRequiredLib$1=1,function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Doctype=o.CDATA=o.Tag=o.Style=o.Script=o.Comment=o.Directive=o.Text=o.Root=o.isTag=o.ElementType=void 0;var e;(function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"})(e=o.ElementType||(o.ElementType={}));function r(t){return t.type===e.Tag||t.type===e.Script||t.type===e.Style}o.isTag=r,o.Root=e.Root,o.Text=e.Text,o.Directive=e.Directive,o.Comment=e.Comment,o.Script=e.Script,o.Style=e.Style,o.Tag=e.Tag,o.CDATA=e.CDATA,o.Doctype=e.Doctype}(lib$3)),lib$3}var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var o=function(e,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},o(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(o){for(var e,r=1,t=arguments.length;r<t;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n])}return o},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=requireLib$1(),nodeTypes=new Map([[domelementtype_1.ElementType.Tag,1],[domelementtype_1.ElementType.Script,1],[domelementtype_1.ElementType.Style,1],[domelementtype_1.ElementType.Directive,1],[domelementtype_1.ElementType.Text,3],[domelementtype_1.ElementType.CDATA,4],[domelementtype_1.ElementType.Comment,8],[domelementtype_1.ElementType.Root,9]]),Node$2=function(){function o(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(o.prototype,"nodeType",{get:function(){var e;return(e=nodeTypes.get(this.type))!==null&&e!==void 0?e:1},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),o.prototype.cloneNode=function(e){return e===void 0&&(e=!1),cloneNode(this,e)},o}();node.Node=Node$2;var DataNode=function(o){__extends(e,o);function e(r,t){var n=o.call(this,r)||this;return n.data=t,n}return Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),e}(Node$2);node.DataNode=DataNode;var Text$4=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Text,r)||this}return e}(DataNode);node.Text=Text$4;var Comment$1=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Comment,r)||this}return e}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(o){__extends(e,o);function e(r,t){var n=o.call(this,domelementtype_1.ElementType.Directive,t)||this;return n.name=r,n}return e}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(o){__extends(e,o);function e(r,t){var n=o.call(this,r)||this;return n.children=t,n}return Object.defineProperty(e.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),e}(Node$2);node.NodeWithChildren=NodeWithChildren;var Document=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Root,r)||this}return e}(NodeWithChildren);node.Document=Document;var Element$1=function(o){__extends(e,o);function e(r,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=r==="script"?domelementtype_1.ElementType.Script:r==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var u=o.call(this,a,n)||this;return u.name=r,u.attribs=t,u}return Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(t){var n,a;return{name:t,value:r.attribs[t],namespace:(n=r["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(a=r["x-attribsPrefix"])===null||a===void 0?void 0:a[t]}})},enumerable:!1,configurable:!0}),e}(NodeWithChildren);node.Element=Element$1;function isTag(o){return(0,domelementtype_1.isTag)(o)}node.isTag=isTag;function isCDATA(o){return o.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(o){return o.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(o){return o.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(o){return o.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(o){return o.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(o){return Object.prototype.hasOwnProperty.call(o,"children")}node.hasChildren=hasChildren;function cloneNode(o,e){e===void 0&&(e=!1);var r;if(isText(o))r=new Text$4(o.data);else if(isComment(o))r=new Comment$1(o.data);else if(isTag(o)){var t=e?cloneChildren(o.children):[],n=new Element$1(o.name,__assign({},o.attribs),t);t.forEach(function(f){return f.parent=n}),o.namespace!=null&&(n.namespace=o.namespace),o["x-attribsNamespace"]&&(n["x-attribsNamespace"]=__assign({},o["x-attribsNamespace"])),o["x-attribsPrefix"]&&(n["x-attribsPrefix"]=__assign({},o["x-attribsPrefix"])),r=n}else if(isCDATA(o)){var t=e?cloneChildren(o.children):[],a=new NodeWithChildren(domelementtype_1.ElementType.CDATA,t);t.forEach(function(c){return c.parent=a}),r=a}else if(isDocument(o)){var t=e?cloneChildren(o.children):[],u=new Document(t);t.forEach(function(c){return c.parent=u}),o["x-mode"]&&(u["x-mode"]=o["x-mode"]),r=u}else if(isDirective(o)){var l=new ProcessingInstruction$1(o.name,o.data);o["x-name"]!=null&&(l["x-name"]=o["x-name"],l["x-publicId"]=o["x-publicId"],l["x-systemId"]=o["x-systemId"]),r=l}else throw new Error("Not implemented yet: ".concat(o.type));return r.startIndex=o.startIndex,r.endIndex=o.endIndex,o.sourceCodeLocation!=null&&(r.sourceCodeLocation=o.sourceCodeLocation),r}node.cloneNode=cloneNode;function cloneChildren(o){for(var e=o.map(function(t){return cloneNode(t,!0)}),r=1;r<e.length;r++)e[r].prev=e[r-1],e[r-1].next=e[r];return e}var constants$1=constants$2,domhandler=node,CASE_SENSITIVE_TAG_NAMES=constants$1.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler.Comment,Element=domhandler.Element,ProcessingInstruction=domhandler.ProcessingInstruction,Text$3=domhandler.Text,caseSensitiveTagNamesMap={},tagName;for(var i$1=0,len=CASE_SENSITIVE_TAG_NAMES.length;i$1<len;i$1++)tagName=CASE_SENSITIVE_TAG_NAMES[i$1],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(o){return caseSensitiveTagNamesMap[o]}function formatAttributes(o){for(var e={},r,t=0,n=o.length;t<n;t++)r=o[t],e[r.name]=r.value;return e}function formatTagName(o){o=o.toLowerCase();var e=getCaseSensitiveTagName(o);return e||o}function formatDOM$1(o,e,r){e=e||null;for(var t=[],n=0,a=o.length;n<a;n++){var u=o[n],l;switch(u.nodeType){case 1:l=new Element(formatTagName(u.nodeName),formatAttributes(u.attributes)),l.children=formatDOM$1(u.childNodes,l);break;case 3:l=new Text$3(u.nodeValue);break;case 8:l=new Comment(u.nodeValue);break;default:continue}var f=t[n-1]||null;f&&(f.next=l),l.parent=e,l.prev=f,l.next=null,t.push(l)}return r&&(l=new ProcessingInstruction(r.substring(0,r.indexOf(" ")).toLowerCase(),r),l.next=t[0]||null,l.parent=e,t.unshift(l),t[1]&&(t[1].prev=t[0])),t}function isIE$1(){return/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}var utilities={formatAttributes,formatDOM:formatDOM$1,isIE:isIE$1},HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head.*>/i,BODY_TAG_REGEX=/<body.*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if(typeof window.DOMParser=="function"){var domParser=new window.DOMParser,mimeType="text/html";parseFromString=function(o,e){return e&&(o="<"+e+">"+o+"</"+e+">"),domParser.parseFromString(o,mimeType)},parseFromDocument=parseFromString}if(document.implementation){var isIE=utilities.isIE,doc=document.implementation.createHTMLDocument(isIE()?"html-dom-parser":void 0);parseFromDocument=function(o,e){return e?(doc.documentElement.getElementsByTagName(e)[0].innerHTML=o,doc):(doc.documentElement.innerHTML=o,doc)}}var template=document.createElement("template"),parseFromTemplate;template.content&&(parseFromTemplate=function(o){return template.innerHTML=o,template.content.childNodes});function domparser$1(o){var e,r=o.match(FIRST_TAG_REGEX);r&&r[1]&&(e=r[1].toLowerCase());var t,n,a;switch(e){case HTML:return t=parseFromString(o),HEAD_TAG_REGEX.test(o)||(n=t.getElementsByTagName(HEAD)[0],n&&n.parentNode.removeChild(n)),BODY_TAG_REGEX.test(o)||(n=t.getElementsByTagName(BODY)[0],n&&n.parentNode.removeChild(n)),t.getElementsByTagName(HTML);case HEAD:case BODY:return a=parseFromDocument(o).getElementsByTagName(e),BODY_TAG_REGEX.test(o)&&HEAD_TAG_REGEX.test(o)?a[0].parentNode.childNodes:a;default:return parseFromTemplate?parseFromTemplate(o):parseFromDocument(o,BODY).getElementsByTagName(BODY)[0].childNodes}}var domparser_1=domparser$1,domparser=domparser_1,formatDOM=utilities.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(o){if(typeof o!="string")throw new TypeError("First argument must be a string");if(o==="")return[];var e=o.match(DIRECTIVE_REGEX),r;return e&&e[1]&&(r=e[1]),formatDOM(domparser(o),null,r)}var htmlToDom=HTMLDOMParser,lib$2={},hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(o){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(f,c,h,y){y===void 0&&(y=h);var E=Object.getOwnPropertyDescriptor(c,h);(!E||("get"in E?!c.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(f,y,E)}:function(f,c,h,y){y===void 0&&(y=h),f[y]=c[h]}),r=commonjsGlobal&&commonjsGlobal.__exportStar||function(f,c){for(var h in f)h!=="default"&&!Object.prototype.hasOwnProperty.call(c,h)&&e(c,f,h)};Object.defineProperty(o,"__esModule",{value:!0}),o.DomHandler=void 0;var t=requireLib$1(),n=node;r(node,o);var a=/\s+/g,u={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function f(c,h,y){this.dom=[],this.root=new n.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof h=="function"&&(y=h,h=u),typeof c=="object"&&(h=c,c=void 0),this.callback=c??null,this.options=h??u,this.elementCB=y??null}return f.prototype.onparserinit=function(c){this.parser=c},f.prototype.onreset=function(){this.dom=[],this.root=new n.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(c){this.handleCallback(c)},f.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},f.prototype.onopentag=function(c,h){var y=this.options.xmlMode?t.ElementType.Tag:void 0,E=new n.Element(c,h,void 0,y);this.addNode(E),this.tagStack.push(E)},f.prototype.ontext=function(c){var h=this.options.normalizeWhitespace,y=this.lastNode;if(y&&y.type===t.ElementType.Text)h?y.data=(y.data+c).replace(a," "):y.data+=c,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{h&&(c=c.replace(a," "));var E=new n.Text(c);this.addNode(E),this.lastNode=E}},f.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===t.ElementType.Comment){this.lastNode.data+=c;return}var h=new n.Comment(c);this.addNode(h),this.lastNode=h},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var c=new n.Text(""),h=new n.NodeWithChildren(t.ElementType.CDATA,[c]);this.addNode(h),c.parent=h,this.lastNode=c},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(c,h){var y=new n.ProcessingInstruction(c,h);this.addNode(y)},f.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},f.prototype.addNode=function(c){var h=this.tagStack[this.tagStack.length-1],y=h.children[h.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),h.children.push(c),y&&(c.prev=y,y.next=c),c.parent=h,this.lastNode=null},f}();o.DomHandler=l,o.default=l}(lib$2)),lib$2}var domToReact=domToReact_1,attributesToProps=attributesToProps$2,htmlToDOM=htmlToDom;htmlToDOM=typeof htmlToDOM.default=="function"?htmlToDOM.default:htmlToDOM;var domParserOptions={lowerCaseAttributeNames:!1};function HTMLReactParser(o,e){if(typeof o!="string")throw new TypeError("First argument must be a string");return o===""?[]:(e=e||{},domToReact(htmlToDOM(o,e.htmlparser2||domParserOptions),e))}HTMLReactParser.domToReact=domToReact;HTMLReactParser.htmlToDOM=htmlToDOM;HTMLReactParser.attributesToProps=attributesToProps;HTMLReactParser.Element=requireLib().Element;htmlReactParser.exports=HTMLReactParser;htmlReactParser.exports.default=HTMLReactParser;var htmlReactParserExports=htmlReactParser.exports;const HTMLReactParser$1=getDefaultExportFromCjs(htmlReactParserExports);HTMLReactParser$1.domToReact;HTMLReactParser$1.htmlToDOM;HTMLReactParser$1.attributesToProps;HTMLReactParser$1.Element;function LectureButtons({goToLecture:o,close:e,minutes:r,seconds:t,btnText:n}){return jsxRuntimeExports.jsx("div",{className:"lectures--buttons",children:o?jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:()=>e(),"aria-label":n,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__count","data-testid":"countdown",children:jsxRuntimeExports.jsxs("span",{children:[r<10?`0${r}`:r,":",t<10?`0${t}`:t]})})})}LectureButtons.defaultProps={goToLecture:!1,close:()=>{},minutes:0,seconds:0};const noop$1=()=>{},useEkho=({voice:o,text:e,audioType:r,loop:t=!1,started:n=!0,slide:a=0,audio:u,soundActions:l,emitEvent:f,volume:c=.5,onFinish:h=noop$1,onError:y=noop$1,onStart:E=noop$1,pauseTTS:g})=>{const[_,p,S,C]=l,R=!u&&!o,[x,A]=React$2.useState(!1),T=React$2.useRef({url:"",cc:"tts"}),P=React$2.useCallback(F=>f({type:"translate",payload:F}),[f]),w=React$2.useCallback(({id:F,type:G="base"})=>{var ee;const z=P("usedVoices"),W=P("gameCharacters");return G==="base"?z==null?void 0:z[F]:G==="character"?(ee=W==null?void 0:W[F])==null?void 0:ee.voiceId:null},[P]),O=React$2.useCallback((F,G="tts")=>{T.current.url===F&&a===T.current.slide||(T.current={url:F,cc:G,slide:a},_(F,G,t,c,h,E))},[a,_,t,c,h,E]),k=React$2.useCallback(async F=>{if(x&&F.voiceId&&F.text){const G=await f({type:"getSpeech",payload:F});G?O(G):y()}else y()},[f,x,y,O]),D=React$2.useCallback(()=>{T.current.url&&p(T.current.cc)},[p]);return React$2.useEffect(()=>(A(!0),()=>{A(!1),D()}),[D]),React$2.useEffect(()=>{g?S():C()},[S,g,C]),React$2.useEffect(()=>{R&&D()},[R,D]),React$2.useEffect(()=>{if(x&&n)if(r==="voice"&&(o!=null&&o.id)){const F=w(o);k({voiceId:F,text:e})}else(r==="file"||!r)&&u?O(u==null?void 0:u.url):y()},[w,k,x,o,e,r,u==null?void 0:u.url,u,O,y,n]),D},READING_TIME=.2;function LecturesComponent({emitEvent:o,name:e,name_labelId:r,required:t,text:n,text_labelId:a,visible:u,documentType:l,viewed:f,soundActions:c,backgroundImage:h,keyboardControl:y,audio:E,audioType:g,audioVolume:_,voice:p,pause:S,styles:C}){const[R,x]=React$2.useState(),[A,T]=React$2.useState(!1),[P,w]=React$2.useState(0),O=n,k=Math.trunc(O.split(" ").length*READING_TIME),D=!t||t&&P>=k||t&&!u,[F]=c,G=/<\/p>|<\/h1>|<\/h2>|<\/h3>|<\/h4>|<\/h5>|<\/h6>|<\/li>/gi,z=/"|'/gi,Q=n.replace(G,". </p>").replace(z,"").replace(/(<([^>]+)>)/gi,""),B=`${e}. ${Q}`;useEkho({audioType:g,voice:p,text:B,audio:E,soundActions:c,emitEvent:o,volume:_,pauseTTS:S});const U=q=>o({type:"translate",payload:q}),I=React$2.useCallback(()=>{D&&(F("click-ui"),o({type:"finishMedia",payload:{name:r,type:"text",text:a,documentType:l}}))},[l,o,D,r,a,F]);y(null,f?null:I,f?null:I),React$2.useEffect(()=>{if(!u&&!A&&(I(),T(!0)),t&&u){const q=setInterval(()=>{w(J=>J+1)},1e3);return x(q),()=>{clearInterval(q)}}},[I,t,A,u]),React$2.useEffect(()=>{P===k&&clearInterval(R)},[R,P,k]);const $=k-P,V=Math.floor($/60),X=$%60;return u?jsxRuntimeExports.jsx("div",{className:`${f?"notes--results":`lectures--container lectures--container--${C}`} ${!f&&(h!=null&&h.url)?"lectures--container--with-custom-bg":""}`,style:!f&&(h!=null&&h.url)?{backgroundImage:`url('${h.url}')`}:{},children:jsxRuntimeExports.jsx("div",{className:f?"":"lectures__overlay",children:jsxRuntimeExports.jsxs("div",{className:f?"notes--results__text":`lectures lectures--${C}`,children:[jsxRuntimeExports.jsx("div",{className:"lectures--title",children:e}),jsxRuntimeExports.jsxs("div",{className:"lectures--text",dir:"auto",children:[jsxRuntimeExports.jsx("div",{children:O?HTMLReactParser$1(O):null}),f?null:jsxRuntimeExports.jsx(LectureButtons,{goToLecture:D,close:I,minutes:V,seconds:X,btnText:U("screens.continue")})]})]})})}):null}LecturesComponent.defaultProps={emitEvent:()=>{},name:"",text:"",visible:!1,documentType:"",viewed:!1,required:!1,context:{},styles:""};function Slot({character:o,active:e,slot:r,lowQuality:t}){var E;const n=o.type==="image",a=o.type==="character",u=o.type==="object",l=(E=o==null?void 0:o.resource)==null?void 0:E.url,f=()=>n?`url(${l})`:a&&t?`url(${l.replace("character.glb","face.png")})`:u&&t?`url(${l.replace("object.glb","thumbnail.png")})`:"",c=()=>n?"contain":a||u?"auto 95%":"",h=()=>n?"center":a||u?"center bottom":"",y=n||t?{backgroundImage:f(),backgroundRepeat:"no-repeat",backgroundPosition:h(),backgroundSize:c()}:{};return jsxRuntimeExports.jsx("div",{className:`conversation--character__item ${e?"active":""} ${r}`,style:y,children:e&&o.name?jsxRuntimeExports.jsx("span",{className:"conversation--character__name",children:o.name}):null},o.name)}Slot.propTypes={character:PropTypes.shape({name:PropTypes.string,url:PropTypes.string,type:PropTypes.string,emotion:PropTypes.string,uid:PropTypes.string,resource:PropTypes.shape({resourceId:PropTypes.string,url:PropTypes.string})}),active:PropTypes.bool,slot:PropTypes.number};Slot.defaultProps={character:{name:"",url:"",type:"",resource:{resourceId:""}},active:!1,slot:0};const defaultCamPos=[0,14.63,16],isMobile=DeviceDetection(),loader$1=new GLTFLoader;function Panel({character:o,ttsStarted:e,active:r,emitEvent:t}){var R,x,A,T,P;const n=React$2.useRef(null),a=React$2.useRef(null),u=o.type==="character",l=React$2.useRef(),f=React$2.useRef(new three.Box3),c=React$2.useRef(new three.Vector3),h=React$2.useRef(new three.Vector3),[y,E]=React$2.useState(!1),g=React$2.useMemo(()=>t({type:"currentLod"}),[t]),_=React$2.useRef(),p=React$2.useMemo(()=>{var w,O,k,D,F,G,z,W;return u?o.animationId&&((w=o.animation)!=null&&w.url)?o.animation:(D=(k=(O=o==null?void 0:o.resource)==null?void 0:O.animations)==null?void 0:k[o.emotion])!=null&&D.url?(G=(F=o==null?void 0:o.resource)==null?void 0:F.animations)==null?void 0:G[o.emotion]:(W=(z=o==null?void 0:o.resource)==null?void 0:z.animations)==null?void 0:W.neutral:{}},[o.emotion,o==null?void 0:o.animationId,o==null?void 0:o.animation,(R=o==null?void 0:o.resource)==null?void 0:R.animations,u]),S=React$2.useCallback(()=>{var w;if((w=_.current.userData)!=null&&w.animation){const{clipAction:O,defaultAnim:k}=_.current.userData.animation;k&&O(k,_.current)}},[]);React$2.useEffect(()=>{var w,O,k;if(_.current)if(r)if(e){const D=(k=(O=(w=o==null?void 0:o.resource)==null?void 0:w.animations)==null?void 0:O.talking)==null?void 0:k.url;D&&loader$1.load(D,({animations:F})=>{const{defaultAnim:G,clipAction:z}=_.current.userData.animation;z(mixWithTalkingClip(F[0],G),_.current),E(!0)})}else S();else y&&S()},[(T=(A=(x=o==null?void 0:o.resource)==null?void 0:x.animations)==null?void 0:A.talking)==null?void 0:T.url,e,r,S,y]);const C=React$2.useCallback(w=>{o.type==="character"?(f.current.setFromObject(w),f.current.getSize(c.current),_.current=w):o.type==="object"&&(f.current.makeEmpty(),cameraFitAnyObject(w,n.current),n.current.zoom=1),n.current.updateProjectionMatrix()},[o.type,o.emotion]);return fiber.useFrame(({gl:w})=>{if(n.current&&a.current){const O=document.getElementsByClassName("conversation--character__item")[o.slot];if(O){const k=O.getBoundingClientRect(),D=O.parentNode.getBoundingClientRect(),[F,G]=[k.right-k.left,k.bottom-k.top];if(n.current.aspect=F/G,o.type==="character"&&_.current){const ee=_.current.getObjectByName("Head_M",!0);if(ee){ee.getWorldPosition(h.current);const Q=h.current;n.current.lookAt(Q),n.current.position.set(Q.x-.5,Q.y-1,Q.z+c.current.z*5)}else n.current.position.setY(c.current.y-1.5*1.3);n.current.zoom=1.5}n.current.updateProjectionMatrix();const z={top:k.top-D.top,right:k.right-D.right,left:k.left-D.left,bottom:k.bottom-D.bottom},W=isMobile?24:40;z.bottom+=r?-W:W,w.setViewport(z.left,z.bottom,F,G),w.setScissor(z.left,z.bottom,F,G),w.render(a.current,n.current)}}},1),o.type==="image"?null:jsxRuntimeExports.jsxs("scene",{ref:a,children:[(P=o.resource)!=null&&P.url?jsxRuntimeExports.jsx(arcadeThreeCore.QualityManager,{lod:g,children:jsxRuntimeExports.jsx(arcadeThreeCore.SceneResource,{ref:l,name:`char_${o.uid}`,url:o.resource.url,animationUrl:p.url,type:o.type,position:[0,0,0],onLoad:C,interactive:!1})}):null,jsxRuntimeExports.jsx(drei.PerspectiveCamera,{name:`camera_${o.uid}`,fov:35,focus:10,ref:n,position:defaultCamPos,rotation:[0,0,0],onUpdate:w=>{w.layers.enableAll()},makeDefault:!0,defaultCamera:!0}),jsxRuntimeExports.jsx(LightSet,{})]})}const Panels=({characters:o,slots:e,ttsStarted:r,activeIndex:t,flex:n,lodSettings:a,emitEvent:u})=>e.map((l,f)=>{let c=null;const h=o.findIndex(y=>y&&y.uid===l.uid);if(h>=0){const y=n?h:f;return c={...o[h]},c.slot=y,jsxRuntimeExports.jsx(Panel,{character:c,active:t===y,lodSettings:a,ttsStarted:r,emitEvent:u},`${`${c.uid}_${f}`}_${h}`)}return null});function PanelsWrapper({characters:o,slots:e,ttsStarted:r,slotRefs:t,flex:n,currentMessage:a,emitEvent:u}){return fiber.useFrame(({gl:l})=>{l.setScissorTest(!1),l.clear(!0,!0),l.setScissorTest(!0)}),jsxRuntimeExports.jsx(Panels,{ttsStarted:r,characters:o,slots:e,slotRefs:t,flex:n,activeIndex:a.position,emitEvent:u})}function Scene(o){return o.lowQuality?null:jsxRuntimeExports.jsxs(arcadeThreeCore.Renderer,{className:"conversation--canvas",style:{position:"absolute",width:"100%",height:"100%"},gl:{antialias:!0},fullscreen:!1,onCreated:({gl:e})=>{e.setClearColor("white",0)},frameloop:"demand",children:[jsxRuntimeExports.jsx(arcadeThreeCore.SettingsController,{current:{animate:o.pause}}),jsxRuntimeExports.jsx(React$2.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(PanelsWrapper,{...o})})]})}function SlotList({characters:o,actors:e,lodSettings:r,ttsStarted:t,currentMessage:n,flex:a,slots:u,children:l,pause:f,emitEvent:c}){const h=({character:C,active:R,slot:x})=>({character:C,active:R,emotion:R?n.emotion:"neutral",slot:x}),E=React$2.useMemo(()=>c({type:"currentLod"}),[c])==="divideby64",g=u.reduce((C,R)=>{var T,P;const x=e==null?void 0:e.find(w=>w.uid===R.uid),A={...R};if(R.character)A.name=R.alias||R.character.name,A.resource=A.character.resource,A.position=A.position>=0?A.position:-1,delete A.character,A.type="character",C.push(A);else if(x){const{resource:w}=x;A.name=R.alias||R.name,A.position=A.position>=0?A.position:-1,A.resource=w,A.type=x.type,C.push(A)}else R.type?(A.name=R.alias||((T=R.character)==null?void 0:T.name)||R.name,A.resource=((P=A.character)==null?void 0:P.resource)||R.resource,A.position=A.position>=0?A.position:-1,delete A.character,A.type=R.type,C.push(A)):a||C.push(null);return C},[]),_=g.length&&g.some(C=>C),p=o.filter(C=>u.find(R=>C.uid===R.uid));function S(){return _?g.map((C,R)=>C?jsxRuntimeExports.jsx(Slot,{emitEvent:c,lowQuality:E,...h({character:C,active:n.position===C.position,slot:R})},`${C.uid+R}`):jsxRuntimeExports.jsx("div",{className:`conversation--character__item void ${R}`},`void_${0+R}`)):a?p.map((C,R)=>{const x=n.position===R;return jsxRuntimeExports.jsx(Slot,{...h({character:C,active:x,slot:R})},`${C.uid+R}`)}):u.length>0?u.map((C,R)=>{const x=o.find(A=>A.uid===C.uid);if(x){const A=n.position===R;return x.name=C.alias||x.name,jsxRuntimeExports.jsx(Slot,{...h({character:x,active:A,slot:R})},`${x.uid+R}`)}return jsxRuntimeExports.jsx("div",{className:`conversation--character__item void ${R}`},`${0+R}`)}):null}return jsxRuntimeExports.jsxs("div",{className:"conversation--characters",children:[jsxRuntimeExports.jsx(Scene,{characters:_?g:p,slots:u,flex:a,currentMessage:n,lodSettings:r,ttsStarted:t,pause:f,emitEvent:c,lowQuality:E}),l||jsxRuntimeExports.jsx(S,{})]})}SlotList.defaultProps={characters:[],currentMessage:{},flex:!0,slots:[]};function Options({inherited:o,options:e,selectedChoice:r,selectChoice:t,showingResults:n,simplifiedOptions:a,required:u}){const[l,f]=React$2.useState(null),c=y=>{a?(f(y.id),setTimeout(()=>{t(y)},1e3)):t(y)},h=y=>!!(n&&r.id===y.id||r.right===!0||n&&!u);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&e.filter(y=>y.text).map(y=>jsxRuntimeExports.jsxs("div",{className:`${o?"conversation--question custom-radio":"custom-radio"}
|
|
67
67
|
${l===y.id?"radio-text-clicked":""}`,children:[jsxRuntimeExports.jsx("input",{onChange:()=>{c(y)},className:"radio",type:"radio",id:y.text,name:y.id,defaultChecked:r.id===y.id,disabled:h(y)}),jsxRuntimeExports.jsx("label",{className:`${y.right?"radio-text-success":"radio-text-fail"}`,htmlFor:y.text,children:y.text})]},y.id))})}const noop=()=>{};function BasicDecision({children:o,question:e,showingResults:r,selected:t,required:n,failed:a,onNext:u,translate:l,hasRewards:f,options:c}){return jsxRuntimeExports.jsxs("div",{className:`popup popup__large popup__basicDecision ${r&&t.feedback?"popup__feedback":""}`,children:[jsxRuntimeExports.jsx("div",{className:"popup--info",children:r?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[o,!t.feedback&&f.length===0&&jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e!==""&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e})}),!t.feedback&&f.length>0&&jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e})]}):jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e})}),jsxRuntimeExports.jsx("div",{className:"popup__questions",dir:"auto",children:jsxRuntimeExports.jsx(Options,{...c})}),jsxRuntimeExports.jsx("div",{className:"popup--buttons",children:(n?!a:t.id!==void 0)?jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn__navigation ${t.id!==void 0?"":"disabled"}`,onClick:()=>t.id!==void 0&&u(),"aria-label":l("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null})]})}function ComplexDecision({question:o,inScene:e,disabled:r,onNext:t,children:n}){return jsxRuntimeExports.jsxs("div",{dir:"auto",className:`conversation--body ${e?"conversation--body--inScene":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"conversation--message",children:[o!==""&&jsxRuntimeExports.jsx("span",{className:"conversation--main__text",children:o}),n]}),jsxRuntimeExports.jsxs("div",{className:"conversation--controls conversation--controls--fixedbottom",children:[jsxRuntimeExports.jsx("div",{className:"gat--btn__round disabled",children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{className:`gat--btn__round ${r?"disabled":""}`,type:"button",onClick:()=>!r&&t(),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})}function DecisionBody({options:o,question:e,inherited:r,branched:t,changeOption:n,onNext:a,failed:u,showingResults:l,currentSelectedChoice:f,children:c,translate:h,hasRewards:y,inScene:E,required:g,simplifiedOptions:_}){const[p,S]=React$2.useState(f),C=A=>{S(A),l&&u&&n(A),a(A)},R=!l&&p.id!==void 0||!u,x={inherited:r,selectedChoice:p,selectChoice:(!g||t)&&p.id!==void 0||g&&!u?noop:C,options:o,showingResults:l,simplifiedOptions:_,required:g};return r?jsxRuntimeExports.jsx(ComplexDecision,{disabled:!R,question:e,inScene:E,onNext:()=>a(p),children:jsxRuntimeExports.jsx(Options,{...x})}):jsxRuntimeExports.jsx(BasicDecision,{question:e,showingResults:l,selected:p,required:g,failed:u,onNext:()=>a(p),translate:h,hasRewards:y,options:x,children:c})}function Wrapper({children:o,inherit:e,feedback:r}){return e?jsxRuntimeExports.jsx("div",{className:`conversation--feedback ${r?"":"only--rewards"}`,children:o}):r?o:jsxRuntimeExports.jsx("div",{className:"popup__basicDecision__only--rewards only--rewards",children:o})}function FeedBack({choice:o,inherited:e,question:r}){return o.feedback?jsxRuntimeExports.jsx(Wrapper,{inherit:e,feedback:o.feedback,children:o.feedback?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"conversation--feedback__title",children:r}),jsxRuntimeExports.jsxs("div",{className:"conversation--feedback__text",dir:"auto",children:[o.right?jsxRuntimeExports.jsx("span",{className:"icon-check-circle-black color--success"}):jsxRuntimeExports.jsx("span",{className:"icon-error-circle-black color--error"}),jsxRuntimeExports.jsx("p",{children:o.feedback})]})]}):null}):null}function DecisionComponent({emitEvent:o,soundActions:e,keyboardControl:r,inScene:t,...n}){const{inheritProps:a={},decisionNumber:u,required:l,question:f,onAddPoints:c,onFinish:h,branched:y,simplifiedOptions:E}=n,g=Object.keys(a).length>0,[_,p]=React$2.useState("options"),[S,C]=React$2.useState({}),[R]=e,x=l&&!S.right,A=z=>{var W;(W=z.audio)!=null&&W.url&&R(z.audio.url,"audio_file",!1,z.audioVolume)},T={...a,slots:a.slots?a.slots:a.characters,currentMessage:{position:null,emotion:""},emitEvent:o};a&&a.flex&&T.slots&&(T.characters=T.characters.filter(z=>T.slots.find(W=>W.uid===z.uid)));const P=z=>{o({type:"decisionJournal",payload:{choice:z,decisionNumber:u}})},w=z=>{!x&&_==="results"?(R("click-ui"),g?E?h&&(P(z),h(z,()=>{C({}),p("options")})):(c&&c(z),P(z),o({type:"addPoints",payload:z.rewards,finish:!1,complex:!0,onFinish:()=>{h?h(z,()=>{C({}),p("options")}):o({type:"success"}),C({}),p("options")}})):(P(z),o({type:"addPoints",payload:z.rewards,finish:!0,complex:!0}))):Object.keys(z).length>0&&(R("click-ui"),E?(P({...z,simplified:!0}),h(z,()=>{C({}),p("options")})):(z.right?R("score"):(R("fail"),y||(g||l?(P(z),o({type:"addPoints",payload:z.rewards,finish:!1,complex:!0})):l||(C({}),p("options")))),C(z),A(z),p("results")))},O={...n,selectView:p,selectedView:_,emitEvent:o,inherited:g,branched:y,soundActions:e,showingResults:_==="results",currentSelectedChoice:S,hasRewards:S.rewards||[],failed:x,inScene:t,required:l,simplifiedOptions:E,changeOption:z=>{R("click-ui"),C(z),p("options")},onNext:w,translate:z=>o({type:"translate",payload:z})};r(null,_==="results"&&!x?()=>{w(S)}:null);const k=({children:z})=>g?jsxRuntimeExports.jsx("div",{className:`conversation--layer
|
|
@@ -24525,7 +24525,7 @@ function ChangeCamera({ targetUid: o, emitEvent: e, transition: r = { type: "pan
|
|
|
24525
24525
|
n.removeEventListener("transitionEnd", a);
|
|
24526
24526
|
};
|
|
24527
24527
|
}, []), useEffect(() => {
|
|
24528
|
-
t(o, r);
|
|
24528
|
+
t && t(o, r);
|
|
24529
24529
|
}, [o, r]), null;
|
|
24530
24530
|
}
|
|
24531
24531
|
var htmlReactParser = { exports: {} }, lib$4 = {}, possibleStandardNamesOptimized$1 = {}, SAME$1 = 0;
|