diff --git a/dist/assets/css/popup.css b/dist/assets/css/popup.css index f6984df..36186b0 100644 --- a/dist/assets/css/popup.css +++ b/dist/assets/css/popup.css @@ -2687,105 +2687,6 @@ /*# sourceMappingURL=primeflex.css.map */ -body { - margin: 0; - padding: 10px; - overflow-x: hidden; -} - -#container { - position: relative; - width: 350px; -} - -@supports (-moz-appearance: none) { - #container { - margin-right: 18px; - } -} - -.loader-overlay { - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background: rgba(255, 255, 255, 0.7); - z-index: 1; -} - -.loader-wrapper { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); -} - -.p-accordion-header-text .pi { - margin: 0 .5em; -} - -.p-field { - margin-bottom: .5rem; -} - -.p-field > h4 { - white-space: nowrap; -} - -.p-field > h4 > .p-text-normal { - font-size: .825em; -} - -.p-field:nth-child(even) { - background: #f4f4f4; - margin-left: -1em; - margin-right: -1em; - padding-left: .5em; - padding-right: .5em; -} - -.p-button + .p-slider { - flex: 1; - margin: 1rem; -} - -@keyframes p-progress-spinner-color { - 100%, 0% { - stroke: #1cb0f6; - } - - 33% { - stroke: #fec701; - } - - 66% { - stroke: #ff4b4b; - } -} - -.p-field .p-togglebutton { - margin-left: 10px; - transform: scale(0.75); - transform-origin: right; -} - -.p-accordion-content { - padding: 0 !important; -} - -.p-setting-tab-header { - flex: 1; -} - -.p-setting-tab-header .p-tabview-nav-link { - justify-content: center; -} - -.p-button-icon.pi-volume-up { - font-size: 1.25em; -} - @font-face { font-family: 'primeicons'; font-display: auto; @@ -3648,4 +3549,103 @@ body { .pi-spinner:before { content: "\e926"; +} + +body { + margin: 0; + padding: 10px; + overflow-x: hidden; +} + +#container { + position: relative; + width: 350px; +} + +@supports (-moz-appearance: none) { + #container { + margin-right: 18px; + } +} + +.loader-overlay { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: rgba(255, 255, 255, 0.7); + z-index: 1; +} + +.loader-wrapper { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + +.p-accordion-header-text .pi { + margin: 0 .5em; +} + +.p-field { + margin-bottom: .5rem; +} + +.p-field > h4 { + white-space: nowrap; +} + +.p-field > h4 > .p-text-normal { + font-size: .825em; +} + +.p-field:nth-child(even) { + background: #f4f4f4; + margin-left: -1em; + margin-right: -1em; + padding-left: .5em; + padding-right: .5em; +} + +.p-button + .p-slider { + flex: 1; + margin: 1rem; +} + +@keyframes p-progress-spinner-color { + 100%, 0% { + stroke: #1cb0f6; + } + + 33% { + stroke: #fec701; + } + + 66% { + stroke: #ff4b4b; + } +} + +.p-field .p-togglebutton { + margin-left: 10px; + transform: scale(0.75); + transform-origin: right; +} + +.p-accordion-content { + padding: 0 !important; +} + +.p-setting-tab-header { + flex: 1; +} + +.p-setting-tab-header .p-tabview-nav-link { + justify-content: center; +} + +.p-button-icon.pi-volume-up { + font-size: 1.25em; } \ No newline at end of file diff --git a/dist/manifest.json b/dist/manifest.json index df10abf..22e4a75 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,6 +1,6 @@ { "name": "Duolingo Sound Controls", - "version": "1.1.0", + "version": "1.2.0", "description": "Provides fine-grained sound controls for Duolingo.", "permissions": [ "activeTab", diff --git a/dist/src/background.js b/dist/src/background.js index cf39e7c..3f7e085 100644 --- a/dist/src/background.js +++ b/dist/src/background.js @@ -1 +1 @@ -!function(){"use strict";const e=(e,t,...r)=>new Promise(((n,o)=>{r.push((e=>{chrome.runtime.lastError?o(chrome.runtime.lastError):n(e)})),e[t](...r)})),t={onChanged:e=>chrome.storage.sync.onChanged(e),clear:()=>e(chrome.storage.sync,"clear"),get:t=>e(chrome.storage.sync,"get",t),getBytesInUse:t=>e(chrome.storage.sync,"getBytesInUse",t),remove:t=>e(chrome.storage.sync,"remove",t),set:t=>e(chrome.storage.sync,"set",t)},r=()=>{},n=e=>"number"==typeof e&&Number.isFinite(e),o=Array.isArray,i=e=>"object"==typeof e&&!!e&&!o(e),a=e=>"function"==typeof e,u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c=()=>{chrome.runtime.lastError},l=e=>{null!=e&&e.id&&((e.url||"").match(/^https:\/\/.*duolingo\.com\//)?chrome.pageAction.show(e.id,c):chrome.pageAction.hide(e.id,c),chrome.runtime.lastError&&setTimeout((()=>l(e)),50))},s=(e,t)=>chrome.tabs.get(e,(r=>{var n;return"Tabs cannot be edited right now (user may be dragging a tab)."!==(null===(n=chrome.runtime.lastError)||void 0===n?void 0:n.message)?t(r):setTimeout((()=>s(e,t)),100)})),f=e=>`__duo-toolbox__-${e}`,d=f("global_variables"),h=(e,t,r)=>{const n=t(((e,t)=>(i(window[d])||(window[d]={}),u(window[d],e)?window[d][e]:t))(e,r));return((e,t)=>{i(window[d])||(window[d]={}),window[d][e]=t})(e,n),n},v=f("original_function"),p=f("override_version"),y=(e,t,n,o=1)=>((e,t,r,n,o=1)=>{u(window,e)&&t(window[e])?r(window[e]):h("pending_global_listeners",((i={})=>{var a;if(!i[e]){i[e]={};let r=window[e];Object.defineProperty(window,e,{get:()=>r,set:n=>{t(n)?(Object.defineProperty(window,e,{value:n,configurable:!0,enumerable:!0,writable:!0}),Object.values(i[e]).forEach((e=>e.callback(n)))):r=n},configurable:!0})}return o>(Number(null===(a=i[e][n])||void 0===a?void 0:a.version)||0)&&(i[e][n]={callback:r,version:o}),i}))})(e,a,(e=>((e,t,n,o=1)=>{var a;if(i(e)&&o>(Number(null===(a=e[t])||void 0===a?void 0:a[p])||0)){var u;const i=(null===(u=e[t])||void 0===u?void 0:u[v])||e[t]||r;e[t]=n(i),e[t][v]=i,e[t][p]=o}})(null==e?void 0:e.prototype,t,n,o)),`instance_method:${t}`,o),_=f("action_request"),b=f("background_event_notification");var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var m,w,j,O=(m=function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[o]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var s="object"==typeof g&&g&&g.Object===Object&&g,f="object"==typeof self&&self&&self.Object===Object&&self,d=s||f||Function("return this")(),h=t&&!t.nodeType&&t,v=h&&e&&!e.nodeType&&e,p=v&&v.exports===h,y=p&&s.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function m(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var w,j,O,A=Array.prototype,z=Function.prototype,x=Object.prototype,E=d["__core-js_shared__"],K=z.toString,$=x.hasOwnProperty,V=(w=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",q=x.toString,P=K.call(Object),U=RegExp("^"+K.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=p?d.Buffer:void 0,T=d.Symbol,M=d.Uint8Array,R=k?k.allocUnsafe:void 0,S=(j=Object.getPrototypeOf,O=Object,function(e){return j(O(e))}),I=Object.create,F=x.propertyIsEnumerable,B=A.splice,L=T?T.toStringTag:void 0,N=function(){try{var e=pe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),C=k?k.isBuffer:void 0,D=Math.max,H=Date.now,Q=pe(d,"Map"),G=pe(Object,"create"),W=function(){function e(){}return function(t){if(!Ee(t))return{};if(I)return I(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function J(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},X.prototype.set=function(e,t){var r=this.__data__,n=ne(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(Q||X),string:new J}},Y.prototype.delete=function(e){var t=ve(this,e).delete(e);return this.size-=t?1:0,t},Y.prototype.get=function(e){return ve(this,e).get(e)},Y.prototype.has=function(e){return ve(this,e).has(e)},Y.prototype.set=function(e,t){var r=ve(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new X,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var r=this.__data__;if(r instanceof X){var n=r.__data__;if(!Q||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Y(n)}return r.set(e,t),this.size=r.size,this};var ie,ae=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var u=i[ie?a:++n];if(!1===t(o[u],u,o))break}return e};function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?function(e){var t=$.call(e,L),r=e[L];try{e[L]=void 0;var n=!0}catch(e){}var o=q.call(e);return n&&(t?e[L]=r:delete e[L]),o}(e):function(e){return q.call(e)}(e)}function ce(e){return Ke(e)&&ue(e)==o}function le(e){return!(!Ee(e)||function(e){return!!V&&V in e}(e))&&(ze(e)?U:u).test(function(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function se(e){if(!Ee(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=_e(e),r=[];for(var n in e)("constructor"!=n||!t&&$.call(e,n))&&r.push(n);return r}function fe(e,t,r,n,o){e!==t&&ae(t,(function(i,u){if(o||(o=new Z),Ee(i))!function(e,t,r,n,o,i,u){var c=be(e,r),l=be(t,r),s=u.get(l);if(s)te(e,r,s);else{var f,d,h,v,p,y=i?i(c,l,r+"",e,t,u):void 0,_=void 0===y;if(_){var b=je(l),g=!b&&Ae(l),m=!b&&!g&&$e(l);y=l,b||g||m?je(c)?y=c:Ke(p=c)&&Oe(p)?y=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(he);function me(e,t){return e===t||e!=e&&t!=t}var we=ce(function(){return arguments}())?ce:function(e){return Ke(e)&&$.call(e,"callee")&&!F.call(e,"callee")},je=Array.isArray;function Oe(e){return null!=e&&xe(e.length)&&!ze(e)}var Ae=C||function(){return!1};function ze(e){if(!Ee(e))return!1;var t=ue(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ke(e){return null!=e&&"object"==typeof e}var $e=b?function(e){return function(t){return e(t)}}(b):function(e){return Ke(e)&&xe(e.length)&&!!l[ue(e)]};function Ve(e){return Oe(e)?ee(e,!0):se(e)}var qe,Pe=(qe=function(e,t,r){fe(e,t,r)},de((function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(o=qe.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(e,t,r){if(!Ee(r))return!1;var n=typeof t;return!!("number"==n?Oe(r)&&ye(t,r.length):"string"==n&&t in r)&&me(r[t],e)}(t[0],t[1],i)&&(o=n<3?void 0:o,n=1),e=Object(e);++ri(e)&&!!e[K],V=e=>e.value,q=e=>({[K]:!0,value:e}),P=(e,t)=>x===e&&n(t)||E===e&&t>=0&&t<=1,U=(e,t)=>((e,t,r,n=1)=>{if(!i(e))return;const o=f(`${t}_override_version`);n>(Number(e[o])||0)&&Object.defineProperty(e,t,r(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,t,(t=>({...t,set:function(r){const o=M[e];n(r)?(this[o.originalValueKey]=r,u(this,o.valueKey)&&(r=this[o.isRelativeKey]?S(e,r*this[o.valueKey]):this[o.valueKey])):$(r)&&(r=V(r)),n(r)&&(this[o.listenerValueKey]=r),t.set.call(this,r)}}))),k=(e,t)=>y("Howl",t,(r=>function(){const n=this,o=arguments,i=M[e];let a=!1;const c=n._queue.length;(1===o.length||2===o.length&&void 0===o[1])&&-1===n._getSoundIds().indexOf(o[0])&&($(o[0])?(a=!0,o[0]=V(o[0])):P(e,o[0])&&(n[i.originalValueKey]=o[0],u(n,i.valueKey)&&(a=!0,n[i.isRelativeKey]?o[0]=S(e,o[0]*n[i.valueKey]):o[0]=n[i.valueKey])),a&&(n[i.listenerValueKey]=o[0]));const l=r.apply(n,arguments);return a&&c({...n,functions:{audio:{applyOverride:()=>U(e,r),getter:e=>e[t],setter:(e,r)=>e[t]=r,hasQueuedUpdate:()=>!1},howler:{applyOverride:()=>k(e,r),getter:e=>e[r](),setter:(e,t)=>e[r](t),hasQueuedUpdate:e=>e._queue.find((e=>e.event===r))}},priorityKey:f(`${e}_priority`),isRelativeKey:f(`${e}_is_relative`),valueKey:f(`forced_${e}_value`),originalValueKey:f(`original_${e}_value`),listenerValueKey:f(`${e}_value`)}),M={[x]:T(x,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[E]:T(E,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},R=e=>(e=>{const t=M[e];if(!t)throw new Error(`Unknown sound setting: "${e}".`);return t})(e).defaultValue,S=(e,t)=>M[e]?Math.max(M[e].minValue,Math.min(t,M[e].maxValue)):t,I=["listening_challenge","other_challenge","story","forum_discussion","dictionary","unknown"],F="default",B="main",L=[E,x],N=e=>E===e,C=(e,t=null,r=null)=>({effect:{[A]:t},tts_sentence:{[A]:t,[z]:t},tts_word:{[A]:t,[z]:t},unknown:{[A]:t},...N(e)?{[B]:r}:{}}),D=(e,t)=>Object.fromEntries([[F,C(e,{value:t,isRelative:!0},{value:t})],...I.map((t=>[t,C(e)]))]),H=Object.fromEntries(L.map((e=>[e,D(e,R(e))]))),Q=(e,t,r,n,o,a)=>{return u=r,c=n,i(H.volume.default[u][c])?O({},e,{[t]:{[null!=o?o:F]:{[r]:{[n]:a}}}}):e;var u,c},G=e=>L.includes(e.setting)&&u(e,"value")&&(!e.context||I.includes(e.context)),W=(e,t)=>{if(!G(t))return e;const{setting:r,context:n,value:o,soundType:i=null,soundSpeed:a=null}=t;return i&&a?Q(e,r,i,a,n,o):((e,t,r,n)=>N(t)?O({},e,{[t]:{[null!=r?r:F]:{[B]:n}}}):e)(e,r,n,o)},J="profiles",X=async(e,r)=>{if(i(e)&&i(e.updateRequest)&&G(e.updateRequest)){const i=(await t.get(J)).profiles||{};i[0]=W(i[0]||H,e.updateRequest),await t.set({[J]:i}),r(i[0]),n="current_profile_changed",o=i[0],chrome.runtime.sendMessage({type:b,event:n,value:o}),chrome.tabs.query({url:"https://*.duolingo.com/*"},(e=>e.forEach((e=>chrome.tabs.sendMessage(e.id,{type:b,event:n,value:o})))))}var n,o};var Y;Y=async(e,r,n,o)=>{switch(e){case"get_current_profile":await(async e=>{e(((await t.get(J)).profiles||{})[0]||H)})(o);break;case"update_current_profile":await X(r,o)}},chrome.runtime.onMessage.addListener(((e,t,r)=>{if(_===e.type){let n=!1;const o=e=>{n=!0,r({type:"success",value:e})},i=e=>{n=!0,r({type:"failure",error:e})};try{Promise.resolve(Y(e.action,e.value,t,o,i)).then((()=>{if(!n)throw new Error(`Could not handle action request: "${e.action}".`)})).catch((e=>{n||i(e)}))}catch(e){!n&&i(e)}return!0}})),chrome.tabs.onUpdated.addListener(((e,t)=>e&&(null!=t&&t.id?l(t):s(e,l)))),chrome.tabs.onActivated.addListener((({tabId:e})=>e&&s(e,l)))}(); +!function(){"use strict";const e=(e,t,...r)=>new Promise(((n,o)=>{r.push((e=>{chrome.runtime.lastError?o(chrome.runtime.lastError):n(e)})),e[t](...r)})),t={onChanged:e=>chrome.storage.sync.onChanged(e),clear:()=>e(chrome.storage.sync,"clear"),get:t=>e(chrome.storage.sync,"get",t),getBytesInUse:t=>e(chrome.storage.sync,"getBytesInUse",t),remove:t=>e(chrome.storage.sync,"remove",t),set:t=>e(chrome.storage.sync,"set",t)},r=()=>{},n=e=>"number"==typeof e&&Number.isFinite(e),o=Array.isArray,i=e=>"object"==typeof e&&!!e&&!o(e),a=e=>"function"==typeof e,u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c=()=>{chrome.runtime.lastError},l=e=>{null!=e&&e.id&&((e.url||"").match(/^https:\/\/.*duolingo\.com\//)?chrome.pageAction.show(e.id,c):chrome.pageAction.hide(e.id,c),chrome.runtime.lastError&&setTimeout((()=>l(e)),50))},s=(e,t)=>chrome.tabs.get(e,(r=>{var n;return"Tabs cannot be edited right now (user may be dragging a tab)."!==(null===(n=chrome.runtime.lastError)||void 0===n?void 0:n.message)?t(r):setTimeout((()=>s(e,t)),100)})),f=e=>`__duo-toolbox__-${e}`,d=f("global_variables"),h=(e,t,r)=>{const n=t(((e,t)=>(i(window[d])||(window[d]={}),u(window[d],e)?window[d][e]:t))(e,r));return((e,t)=>{i(window[d])||(window[d]={}),window[d][e]=t})(e,n),n},v=f("original_function"),p=f("override_version"),y=(e,t,n,o=1)=>((e,t,r,n,o=1)=>{u(window,e)&&t(window[e])?r(window[e]):h("pending_global_listeners",((i={})=>{var a;if(!i[e]){i[e]={};let r=window[e];Object.defineProperty(window,e,{get:()=>r,set:n=>{t(n)?(Object.defineProperty(window,e,{value:n,configurable:!0,enumerable:!0,writable:!0}),Object.values(i[e]).forEach((e=>e.callback(n)))):r=n},configurable:!0})}return o>(Number(null===(a=i[e][n])||void 0===a?void 0:a.version)||0)&&(i[e][n]={callback:r,version:o}),i}))})(e,a,(e=>((e,t,n,o=1)=>{var a;if(i(e)&&o>(Number(null===(a=e[t])||void 0===a?void 0:a[p])||0)){var u;const i=(null===(u=e[t])||void 0===u?void 0:u[v])||e[t]||r;e[t]=n(i),e[t][v]=i,e[t][p]=o}})(null==e?void 0:e.prototype,t,n,o)),`instance_method:${t}`,o),_=f("action_request"),b=f("background_event_notification");var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var m,w,j,O=(m=function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[o]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var s="object"==typeof g&&g&&g.Object===Object&&g,f="object"==typeof self&&self&&self.Object===Object&&self,d=s||f||Function("return this")(),h=t&&!t.nodeType&&t,v=h&&e&&!e.nodeType&&e,p=v&&v.exports===h,y=p&&s.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function m(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var w,j,O,A=Array.prototype,z=Function.prototype,x=Object.prototype,E=d["__core-js_shared__"],K=z.toString,$=x.hasOwnProperty,V=(w=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",q=x.toString,P=K.call(Object),U=RegExp("^"+K.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=p?d.Buffer:void 0,T=d.Symbol,M=d.Uint8Array,R=k?k.allocUnsafe:void 0,S=(j=Object.getPrototypeOf,O=Object,function(e){return j(O(e))}),I=Object.create,F=x.propertyIsEnumerable,B=A.splice,L=T?T.toStringTag:void 0,N=function(){try{var e=pe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),C=k?k.isBuffer:void 0,D=Math.max,H=Date.now,Q=pe(d,"Map"),G=pe(Object,"create"),W=function(){function e(){}return function(t){if(!Ee(t))return{};if(I)return I(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function J(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},X.prototype.set=function(e,t){var r=this.__data__,n=ne(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(Q||X),string:new J}},Y.prototype.delete=function(e){var t=ve(this,e).delete(e);return this.size-=t?1:0,t},Y.prototype.get=function(e){return ve(this,e).get(e)},Y.prototype.has=function(e){return ve(this,e).has(e)},Y.prototype.set=function(e,t){var r=ve(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new X,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var r=this.__data__;if(r instanceof X){var n=r.__data__;if(!Q||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Y(n)}return r.set(e,t),this.size=r.size,this};var ie,ae=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var u=i[ie?a:++n];if(!1===t(o[u],u,o))break}return e};function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?function(e){var t=$.call(e,L),r=e[L];try{e[L]=void 0;var n=!0}catch(e){}var o=q.call(e);return n&&(t?e[L]=r:delete e[L]),o}(e):function(e){return q.call(e)}(e)}function ce(e){return Ke(e)&&ue(e)==o}function le(e){return!(!Ee(e)||function(e){return!!V&&V in e}(e))&&(ze(e)?U:u).test(function(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function se(e){if(!Ee(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=_e(e),r=[];for(var n in e)("constructor"!=n||!t&&$.call(e,n))&&r.push(n);return r}function fe(e,t,r,n,o){e!==t&&ae(t,(function(i,u){if(o||(o=new Z),Ee(i))!function(e,t,r,n,o,i,u){var c=be(e,r),l=be(t,r),s=u.get(l);if(s)te(e,r,s);else{var f,d,h,v,p,y=i?i(c,l,r+"",e,t,u):void 0,_=void 0===y;if(_){var b=je(l),g=!b&&Ae(l),m=!b&&!g&&$e(l);y=l,b||g||m?je(c)?y=c:Ke(p=c)&&Oe(p)?y=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(he);function me(e,t){return e===t||e!=e&&t!=t}var we=ce(function(){return arguments}())?ce:function(e){return Ke(e)&&$.call(e,"callee")&&!F.call(e,"callee")},je=Array.isArray;function Oe(e){return null!=e&&xe(e.length)&&!ze(e)}var Ae=C||function(){return!1};function ze(e){if(!Ee(e))return!1;var t=ue(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ke(e){return null!=e&&"object"==typeof e}var $e=b?function(e){return function(t){return e(t)}}(b):function(e){return Ke(e)&&xe(e.length)&&!!l[ue(e)]};function Ve(e){return Oe(e)?ee(e,!0):se(e)}var qe,Pe=(qe=function(e,t,r){fe(e,t,r)},de((function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(o=qe.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(e,t,r){if(!Ee(r))return!1;var n=typeof t;return!!("number"==n?Oe(r)&&ye(t,r.length):"string"==n&&t in r)&&me(r[t],e)}(t[0],t[1],i)&&(o=n<3?void 0:o,n=1),e=Object(e);++ri(e)&&!!e[E],$=e=>e.value,V=e=>({[E]:!0,value:e}),q=(e,t)=>z===e&&n(t)||x===e&&t>=0&&t<=1,P=(e,t)=>((e,t,r,n=1)=>{if(!i(e))return;const o=f(`${t}_override_version`);n>(Number(e[o])||0)&&Object.defineProperty(e,t,r(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,t,(t=>({...t,set:function(r){const o=T[e];n(r)?(this[o.originalValueKey]=r,u(this,o.valueKey)&&(r=this[o.isRelativeKey]?R(e,r*this[o.valueKey]):this[o.valueKey])):K(r)&&(r=$(r)),n(r)&&(this[o.listenerValueKey]=r),t.set.call(this,r)}}))),U=(e,t)=>y("Howl",t,(r=>function(){const n=this,o=arguments,i=T[e];let a=!1;const c=n._queue.length;(1===o.length||2===o.length&&void 0===o[1])&&-1===n._getSoundIds().indexOf(o[0])&&(K(o[0])?(a=!0,o[0]=$(o[0])):q(e,o[0])&&(n[i.originalValueKey]=o[0],u(n,i.valueKey)&&(a=!0,n[i.isRelativeKey]?o[0]=R(e,o[0]*n[i.valueKey]):o[0]=n[i.valueKey])),a&&(n[i.listenerValueKey]=o[0]));const l=r.apply(n,arguments);return a&&c({...n,functions:{audio:{applyOverride:()=>P(e,r),getter:e=>e[t],setter:(e,r)=>e[t]=r,hasQueuedUpdate:()=>!1},howler:{applyOverride:()=>U(e,r),getter:e=>e[r](),setter:(e,t)=>e[r](t),hasQueuedUpdate:e=>e._queue.find((e=>e.event===r))}},priorityKey:f(`${e}_priority`),isRelativeKey:f(`${e}_is_relative`),valueKey:f(`forced_${e}_value`),originalValueKey:f(`original_${e}_value`),listenerValueKey:f(`${e}_value`)}),T={[z]:k(z,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[x]:k(x,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},M=e=>(e=>{const t=T[e];if(!t)throw new Error(`Unknown sound setting: "${e}".`);return t})(e).defaultValue,R=(e,t)=>T[e]?Math.max(T[e].minValue,Math.min(t,T[e].maxValue)):t,S=["listening_challenge","other_challenge","story","forum_discussion","dictionary","unknown"],I="default",F="main",B=[x,z],L=e=>x===e,N=(e,t=null,r=null)=>({effect:{[A]:t},tts_sentence:{[A]:t,slow:t},tts_word:{[A]:t},unknown:{[A]:t},...L(e)?{[F]:r}:{}}),C=(e,t)=>Object.fromEntries([[I,N(e,{value:t,isRelative:!0},{value:t})],...S.map((t=>[t,N(e)]))]),D=Object.fromEntries(B.map((e=>[e,C(e,M(e))]))),H=(e,t,r,n,o,a)=>{return u=r,c=n,i(D.volume.default[u][c])?O({},e,{[t]:{[null!=o?o:I]:{[r]:{[n]:a}}}}):e;var u,c},Q=e=>B.includes(e.setting)&&u(e,"value")&&(!e.context||S.includes(e.context)),G=(e,t)=>{if(!Q(t))return e;const{setting:r,context:n,value:o,soundType:i=null,soundSpeed:a=null}=t;return i&&a?H(e,r,i,a,n,o):((e,t,r,n)=>L(t)?O({},e,{[t]:{[null!=r?r:I]:{[F]:n}}}):e)(e,r,n,o)},W="profiles",J=async(e,r)=>{if(i(e)&&i(e.updateRequest)&&Q(e.updateRequest)){const i=(await t.get(W)).profiles||{};i[0]=G(i[0]||D,e.updateRequest),await t.set({[W]:i}),r(i[0]),n="current_profile_changed",o=i[0],chrome.runtime.sendMessage({type:b,event:n,value:o}),chrome.tabs.query({url:"https://*.duolingo.com/*"},(e=>e.forEach((e=>chrome.tabs.sendMessage(e.id,{type:b,event:n,value:o})))))}var n,o};var X;X=async(e,r,n,o)=>{switch(e){case"get_current_profile":await(async e=>{e(((await t.get(W)).profiles||{})[0]||D)})(o);break;case"update_current_profile":await J(r,o)}},chrome.runtime.onMessage.addListener(((e,t,r)=>{if(_===e.type){let n=!1;const o=e=>{n=!0,r({type:"success",value:e})},i=e=>{n=!0,r({type:"failure",error:e})};try{Promise.resolve(X(e.action,e.value,t,o,i)).then((()=>{if(!n)throw new Error(`Could not handle action request: "${e.action}".`)})).catch((e=>{n||i(e)}))}catch(e){!n&&i(e)}return!0}})),chrome.tabs.onUpdated.addListener(((e,t)=>e&&(null!=t&&t.id?l(t):s(e,l)))),chrome.tabs.onActivated.addListener((({tabId:e})=>e&&s(e,l)))}(); diff --git a/dist/src/observer.js b/dist/src/observer.js index 5ac97cb..b7d34ad 100644 --- a/dist/src/observer.js +++ b/dist/src/observer.js @@ -1 +1 @@ -!function(){"use strict";const e=()=>{},t=e=>"number"==typeof e&&Number.isFinite(e),n=e=>"string"==typeof e,r=Array.isArray,o=e=>"object"==typeof e&&!!e&&!r(e),a=e=>"function"==typeof e,i=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l=e=>{for(let t in e)if(i(e,t))return!1;return!0},u=e=>{let t=null;if("/"===e.charAt(0)&&("/"===e.charAt(1)?e=`https://${e}`:t=e),null===t)try{t=new URL(e).pathname}catch(n){t=e}return t},s=e=>`__duo-toolbox__-${e}`,c=s("global_variables"),d=(e,t)=>(o(window[c])||(window[c]={}),i(window[c],e)?window[c][e]:t),f=(e,t)=>{o(window[c])||(window[c]={}),window[c][e]=t},p=(e,t,n)=>{const r=t(d(e,n));return f(e,r),r},v=s("original_function"),_=s("override_version"),h=(t,n,r,l=1)=>((e,t,n,r,o=1)=>{i(window,e)&&t(window[e])?n(window[e]):p("pending_global_listeners",((a={})=>{var i;if(!a[e]){a[e]={};let n=window[e];Object.defineProperty(window,e,{get:()=>n,set:r=>{t(r)?(Object.defineProperty(window,e,{value:r,configurable:!0,enumerable:!0,writable:!0}),Object.values(a[e]).forEach((e=>e.callback(r)))):n=r},configurable:!0})}return o>(Number(null===(i=a[e][r])||void 0===i?void 0:i.version)||0)&&(a[e][r]={callback:n,version:o}),a}))})(t,a,(t=>((t,n,r,a=1)=>{var i;if(o(t)&&a>(Number(null===(i=t[n])||void 0===i?void 0:i[_])||0)){var l;const o=(null===(l=t[n])||void 0===l?void 0:l[v])||t[n]||e;t[n]=r(o),t[n][v]=o,t[n][_]=a}})(null==t?void 0:t.prototype,n,r,l)),`instance_method:${n}`,l),y=s("logging_iframe"),g=s("action_request"),m=s("action_result"),b=s("background_event_notification"),w=()=>(()=>{let e=document.getElementById(y);return e&&e.isConnected||(e=document.createElement("iframe"),e.id=y,e.style.display="none",document.body.appendChild(e)),e})().contentWindow.console,j=(...e)=>w().error(...e),O="listen",k="listenComprehension",x="listenTap",A=["characterIntro","characterMatch","characterSelect","completeReverseTranslation","definition","dialogue","form","freeResponse","gapFill","judge",O,k,x,"name","readComprehension","select","selectPronunciation","selectTranscription","speak","tapCloze","tapClozeTable","tapComplete","tapCompleteTable","tapDescribe","translate","typeCloze","typeClozeTable","typeCompleteTable"],z=[O,k,x],K=e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t.source_language)||e.sourceLanguage||(null===(n=e.metadata)||void 0===n?void 0:n.learning_language)},T=e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.target_language)||e.targetLanguage||K(e)},$="none",E=Number.MAX_SAFE_INTEGER,S=Math.round(E/4),C="effect",R="tts_sentence",V="tts_word",M="unknown",q="normal",L="slow",P="audio",I="howler",U=[P,I],N="rate",F="volume",D=s("forced_setting"),B=e=>o(e)&&!!e[D],H=e=>e.value,Q=e=>({[D]:!0,value:e}),X=(e,n)=>N===e&&t(n)||F===e&&n>=0&&n<=1,G=(e,n)=>((e,t,n,r=1)=>{if(!o(e))return;const a=s(`${t}_override_version`);r>(Number(e[a])||0)&&Object.defineProperty(e,t,n(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,n,(n=>({...n,set:function(r){const o=Y[e];t(r)?(this[o.originalValueKey]=r,i(this,o.valueKey)&&(r=this[o.isRelativeKey]?te(e,r*this[o.valueKey]):this[o.valueKey])):B(r)&&(r=H(r)),t(r)&&(this[o.listenerValueKey]=r),n.set.call(this,r)}}))),W=(e,t)=>h("Howl",t,(n=>function(){const r=this,o=arguments,a=Y[e];let l=!1;const u=r._queue.length;(1===o.length||2===o.length&&void 0===o[1])&&-1===r._getSoundIds().indexOf(o[0])&&(B(o[0])?(l=!0,o[0]=H(o[0])):X(e,o[0])&&(r[a.originalValueKey]=o[0],i(r,a.valueKey)&&(l=!0,r[a.isRelativeKey]?o[0]=te(e,o[0]*r[a.valueKey]):o[0]=r[a.valueKey])),l&&(r[a.listenerValueKey]=o[0]));const s=n.apply(r,arguments);return l&&u({...r,functions:{[P]:{applyOverride:()=>G(e,n),getter:e=>e[t],setter:(e,n)=>e[t]=n,hasQueuedUpdate:()=>!1},[I]:{applyOverride:()=>W(e,n),getter:e=>e[n](),setter:(e,t)=>e[n](t),hasQueuedUpdate:e=>e._queue.find((e=>e.event===n))}},priorityKey:s(`${e}_priority`),isRelativeKey:s(`${e}_is_relative`),valueKey:s(`forced_${e}_value`),originalValueKey:s(`original_${e}_value`),listenerValueKey:s(`${e}_value`)}),Y={[N]:J(N,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[F]:J(F,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},Z=e=>{const t=Y[e];if(!t)throw new Error(`Unknown sound setting: "${e}".`);return t},ee=e=>Z(e).defaultValue,te=(e,t)=>Y[e]?Math.max(Y[e].minValue,Math.min(t,Y[e].maxValue)):t,ne=(e,t,n,r,o=!1,a=1)=>{const l=Z(e);if(a>=(Number(n[l.priorityKey])||0)){const u=te(e,t),s=((e,t)=>{if(-1===U.indexOf(t))throw new Error(`Unknown sound playback strategy: "${t}".`);return Z(e).functions[t]})(e,r);s.applyOverride(),n[l.valueKey]=u,n[l.priorityKey]=a,n[l.isRelativeKey]=o,i(n,l.originalValueKey)||(n[l.originalValueKey]=s.getter(n)),s.hasQueuedUpdate(n)||s.setter(n,Q(te(e,u*(o?n[l.originalValueKey]:1))))}},re="event_listeners",oe=()=>{return`__listener::${e="last_event_listener_id",p(`__counter::${e}__`,(e=>e+1),0)}__`;var e},ae=e=>{var t;return(null===(t=d(re,{}))||void 0===t?void 0:t[e])||{}},ie=(e,t)=>{p(re,(n=>Object.assign(n||{},{[e]:t})))},le=!l((e=>ae(e))),ue=(e,t)=>{const n=ae(e);return l(n)?null:t(Object.values(n))},se=(e,t,n=oe())=>{const r=ae(e);return r[n]=t,ie(e,r),()=>de(e,n)},ce=(e,t,n,o,a=se,i=oe())=>{const l=`__${t}::${e}__`;var u;u=l,ae(t)[u]||a(t,((...t)=>{const n=o(...t);r(n)&&fe(e,...n)}),l);const s=se(e,n,i);return()=>{s(),le(e)||de(t,l)}},de=(e,t)=>{const n=ae(e);delete n[t],ie(e,n)},fe=(e,...t)=>ue(e,(e=>e.flatMap((e=>{try{return[e(...t)]}catch(e){return[]}})))),pe="practice_session_loaded",ve="story_loaded",_e="forum_discussion_loaded",he="dictionary_lexeme_loaded",ye="sound_playback_requested",ge="sound_playback_confirmed",me="sound_playback_cancelled",be={[he]:/\/api\/1\/dictionary_page/g,[_e]:/\/comments\/([\d]+)/g,[pe]:/\/[\d]{4}-[\d]{2}-[\d]{2}\/sessions/g,[ve]:/\/api2\/stories/g,user_data_loaded:/\/[\d]{4}-[\d]{2}-[\d]{2}\/users\/[\d]+/g},we=(e,t,n=oe())=>(h("XMLHttpRequest","open",(e=>function(t,n,r,a,i){let l;for(const[e,t]of Object.entries(be))if(n.match(t)){l=e;break}return l&&ue(l,(e=>{this.addEventListener("load",(()=>{try{const t=o(this.response)?this.response:JSON.parse(this.responseText);e.forEach((e=>e(t)))}catch(e){j(e,`Could not handle the XHR result (event: ${l}): `)}}))})),e.call(this,t,n,r,a,i)})),se(e,t,n)),je=(e,t)=>({url:e,type:R,speed:q,language:t}),Oe=(e,t)=>({url:e,type:V,speed:q,language:t}),ke=Object.fromEntries(["/sounds/7abe057dc8446ad325229edd6d8fd250.mp3","/sounds/2aae0ea735c8e9ed884107d6f0a09e35.mp3","/sounds/421d48c53ad6d52618dba715722278e0.mp3","/sounds/37d8f0b39dcfe63872192c89653a93f6.mp3","/sounds/0a27c1ee63dd220647e8410a0029aed2.mp3","/sounds/a28ff0a501ef5f33ca78c0afc45ee53e.mp3","/sounds/2e4669d8cf839272f0731f8afa488caf.mp3","/sounds/f0b6ab4396d5891241ef4ca73b4de13a.mp3"].map((e=>{return[e,(t=e,{url:t,type:C,speed:q,language:null})];var t}))),xe=/\/duolingo-data\/tts\/(?[a-z-_]+)\/token\//i,Ae="sound_type_map",ze=()=>d(Ae,ke),Ke=e=>{const t=ze()||{};for(const n of e)t[u(n.url)]=n;f(Ae,t)},Te="sound_detection_unregistration_callbacks",$e=(e,t,n)=>{var r;return{url:e.url,type:t,speed:(null===(r=e.speed)||void 0===r?void 0:r.value)||q,language:n}},Ee=()=>{var e,t,a,i;d(Te)||f(Te,[(i=e=>(e=>{const t=e.learningLanguage;r(e.elements)&&Ke(e.elements.map((e=>{var t;return(null==e||null===(t=e.line)||void 0===t?void 0:t.content)||(null==e?void 0:e.learningLanguageTitleContent)})).flatMap((e=>[null==e?void 0:e.audio,null==e?void 0:e.audioPrefix,null==e?void 0:e.audioSuffix])).map((e=>null==e?void 0:e.url)).filter(n).map((e=>je(e,t))))})(e),we(ve,i)),(a=e=>{var t;n((t=e).tts_url)&&Ke([je(t.tts_url,t.sentence_language)])},we(_e,a)),(t=e=>(e=>{const t=[],o=e.learning_language;n(e.tts)&&t.push(Oe(e.tts,o)),r(e.alternative_forms)&&t.push(e.alternative_forms.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>je(e,o)))),Ke(t.flat())})(e),we(he,t)),(e=e=>(e=>{const t=[];for(const u of e){var a;const e=K(u),s=T(u);if(n(u.tts)&&t.push(je(u.tts,e)),n(u.slowTts)&&t.push({url:u.slowTts,type:R,speed:L,language:e}),n(u.solutionTts)&&t.push(je(u.solutionTts,s)),r(u.choices)&&t.push(u.choices.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>Oe(e,s)))),r(u.tokens)&&t.push(u.tokens.map((e=>null==e?void 0:e.tts)).filter(n).map((t=>Oe(t,e)))),r(u.questionTokens)&&t.push(u.questionTokens.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>Oe(e,s)))),r(null===(a=u.metadata)||void 0===a?void 0:a.speakers))for(const e of u.metadata.speakers){var i,l;o(null===(i=e.tts)||void 0===i?void 0:i.tokens)&&t.push(Object.values(e.tts.tokens).filter((e=>n(e.url))).map((e=>$e(e,V,s)))),r(null===(l=e.tts)||void 0===l?void 0:l.sentence)&&t.push(e.tts.sentence.filter((e=>n(e.url))).map((e=>$e(e,R,s))))}r(u.pairs)&&t.push(u.pairs.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>Oe(e,s))))}Ke(t.flat())})(e.challenges),ce("practice_challenges_loaded",pe,e,(e=>{let t;var n;o(e)&&(t=[{challenges:[e.challenges,e.adaptiveChallenges,null===(n=e.adaptiveInterleavedChallenges)||void 0===n?void 0:n.challenges].filter(r).flat(),sessionMetaData:e.metadata||{}}]);return t}),we))])},Se=(e,t,n)=>{const r=(e=>{const t=ze()[e];if(o(t))return t;const n=e.match(xe);return n?Oe(e,n.language):null})(u(t));return{url:t,type:(null==r?void 0:r.type)||M,speed:(null==r?void 0:r.speed)||q,language:null==r?void 0:r.language,playbackStrategy:n,sound:e}},Ce=(e,t)=>{h("Howl","play",(e=>function(t){var n;f("is_howler_used",!0);const r=String(this._src||(null===(n=this._parent)||void 0===n?void 0:n._src)||"").trim();return""!==r?((e,t,n,r)=>{const o=Se(e,t,n);let a=!1;try{var i;a=null===(i=fe(ye,o))||void 0===i?void 0:i.some((e=>!1===e)),fe(a?me:ge,o)}catch(e){j(e,`Could not handle playback for sound "${t}" (using "${n}"): `)}return a?null:r()})(this,r,I,(()=>e.call(this,t))):e.call(this,t)})),Ee();const n=se(e,t);return()=>{n(),(()=>{const e=d(Te);!r(e)||le("sound_initialized")||le(ye)||le(me)||le(ge)||(e.forEach((e=>e())),f(Te,null))})()}},Re="challenge",Ve="story",Me="forum_discussion",qe="dictionary",Le="unknown",Pe=/duolingo\.com\/stories\/(?[^/]+)/,Ie=/forum\.duolingo\.com\/comment\/(?[\d]+)/,Ue=/duolingo\.com\/dictionary\/(?.+)\/(?.+)\/(?[\w]+)\/?/,Ne="listening_challenge",Fe="other_challenge",De=[Ne,Fe,Ve,Me,qe,Le],Be=()=>{const e=(()=>{const e=document.location.href;let t=e.match(Ie);if(r(t))return{type:Me,commentId:Number(t.comment_id)||null};var n;if(t=e.match(Pe),r(t)||document.querySelector('[data-test="stories-element"]'))return{type:Ve,storyKey:null===(n=t)||void 0===n?void 0:n.story_key};if(t=e.match(Ue),r(t))return{type:qe,languageName:t.language,lexeme:t.lexeme,lexemeId:t.lexeme_id};const o=document.querySelector('[data-test*="challenge"]');if(o){let e=null;for(const t of(null===(a=o.getAttribute("data-test"))||void 0===a?void 0:a.split(/\s+/))||[]){var a,i;const n=null===(i=t.match(/challenge-(?[a-z]+)/i))||void 0===i?void 0:i.groups.type.trim();if(A.indexOf(n)>=0){e=n;break}}let t=$;const n=document.querySelector("._2Fc1K ._1tuLI");return n&&(t=n.classList.contains("_3e9O1")?"correct":"incorrect"),{type:Re,challengeType:e,result:t,isCompleted:$!==t}}return{type:Le}})();let t=e.type;return Re===t&&(t=-1===z.indexOf(e.challengeType)?Fe:Ne),t};var He,Qe,Xe,Ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};He=function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Function]",i="[object Object]",l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[o]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s[a]=s["[object Map]"]=s["[object Number]"]=s[i]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var c="object"==typeof Ge&&Ge&&Ge.Object===Object&&Ge,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),p=t&&!t.nodeType&&t,v=p&&e&&!e.nodeType&&e,_=v&&v.exports===p,h=_&&c.process,y=function(){try{var e=v&&v.require&&v.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(e){}}(),g=y&&y.isTypedArray;function m(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var b,w,j,O=Array.prototype,k=Function.prototype,x=Object.prototype,A=f["__core-js_shared__"],z=k.toString,K=x.hasOwnProperty,T=(b=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",$=x.toString,E=z.call(Object),S=RegExp("^"+z.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=_?f.Buffer:void 0,R=f.Symbol,V=f.Uint8Array,M=C?C.allocUnsafe:void 0,q=(w=Object.getPrototypeOf,j=Object,function(e){return w(j(e))}),L=Object.create,P=x.propertyIsEnumerable,I=O.splice,U=R?R.toStringTag:void 0,N=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),F=C?C.isBuffer:void 0,D=Math.max,B=Date.now,H=ve(f,"Map"),Q=ve(Object,"create"),X=function(){function e(){}return function(t){if(!Ae(t))return{};if(L)return L(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},W.prototype.set=function(e,t){var n=this.__data__,r=ne(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(H||W),string:new G}},J.prototype.delete=function(e){var t=pe(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return pe(this,e).get(e)},J.prototype.has=function(e){return pe(this,e).has(e)},J.prototype.set=function(e,t){var n=pe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Y.prototype.clear=function(){this.__data__=new W,this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Y.prototype.get=function(e){return this.__data__.get(e)},Y.prototype.has=function(e){return this.__data__.has(e)},Y.prototype.set=function(e,t){var n=this.__data__;if(n instanceof W){var r=n.__data__;if(!H||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new J(r)}return n.set(e,t),this.size=n.size,this};var oe,ae=function(e,t,n){for(var r=-1,o=Object(e),a=n(e),i=a.length;i--;){var l=a[oe?i:++r];if(!1===t(o[l],l,o))break}return e};function ie(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=K.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch(e){}var o=$.call(e);return r&&(t?e[U]=n:delete e[U]),o}(e):function(e){return $.call(e)}(e)}function le(e){return ze(e)&&ie(e)==o}function ue(e){return!(!Ae(e)||function(e){return!!T&&T in e}(e))&&(ke(e)?S:l).test(function(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function se(e){if(!Ae(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=he(e),n=[];for(var r in e)("constructor"!=r||!t&&K.call(e,r))&&n.push(r);return n}function ce(e,t,n,r,o){e!==t&&ae(t,(function(a,l){if(o||(o=new Y),Ae(a))!function(e,t,n,r,o,a,l){var u=ye(e,n),s=ye(t,n),c=l.get(s);if(c)ee(e,n,c);else{var d,f,p,v,_,h=a?a(u,s,n+"",e,t,l):void 0,y=void 0===h;if(y){var g=we(s),m=!g&&Oe(s),b=!g&&!m&&Ke(s);h=s,g||m||b?we(u)?h=u:ze(_=u)&&je(_)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function me(e,t){return e===t||e!=e&&t!=t}var be=le(function(){return arguments}())?le:function(e){return ze(e)&&K.call(e,"callee")&&!P.call(e,"callee")},we=Array.isArray;function je(e){return null!=e&&xe(e.length)&&!ke(e)}var Oe=F||function(){return!1};function ke(e){if(!Ae(e))return!1;var t=ie(e);return t==a||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ze(e){return null!=e&&"object"==typeof e}var Ke=g?function(e){return function(t){return e(t)}}(g):function(e){return ze(e)&&xe(e.length)&&!!s[ie(e)]};function Te(e){return je(e)?Z(e,!0):se(e)}var $e,Ee=($e=function(e,t,n){ce(e,t,n)},de((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=$e.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!Ae(n))return!1;var r=typeof t;return!!("number"==r?je(n)&&_e(t,n.length):"string"==r&&t in n)&&me(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++nF===e,et=(e,t=null,n=null)=>({[C]:{[q]:t},[R]:{[q]:t,[L]:t},[V]:{[q]:t,[L]:t},[M]:{[q]:t},...Ze(e)?{[Je]:n}:{}}),tt=(e,t)=>Object.fromEntries([[We,et(e,{value:t,isRelative:!0},{value:t})],...De.map((t=>[t,et(e)]))]),nt=Object.fromEntries(Ye.map((e=>[e,tt(e,ee(e))]))),rt=(e,t)=>o(nt.volume.default[e][t]),ot=(e,t,n,r=!0)=>{var a,i;if(!Ze(t))return;const l=null==e||null===(a=e[t])||void 0===a||null===(i=a[null!=n?n:We])||void 0===i?void 0:i.main;return o(l)?l:null===n?ee(t):r?ot(e,t,null):null},at=(e,t,n,r,a,i=!0)=>{var l,u,s;if(!rt(n,r))return;const c=null==e||null===(l=e[t])||void 0===l||null===(u=l[null!=a?a:We])||void 0===u||null===(s=u[n])||void 0===s?void 0:s[r];return o(c)?c:null===a?ee(t):i?at(e,t,n,r,null):null},it=(e,t,n,r,o)=>{if(!rt(n,r))return;const a=at(e,t,n,r,o);if(!Ze(t))return a;const i=ot(e,t,o);return{isRelative:a.isRelative,value:i.value*a.value}};let lt=null;const ut=e=>lt=e;((e,t)=>{var n;const a=r(t)?e=>t.indexOf(e)>=0:()=>!0,i=t=>{const n=o(t.data)?t.data:t;return n&&b===n.type&&a(n.event)&&e(n.event,n.value)};"undefined"!=typeof chrome&&null!==(n=chrome.runtime)&&void 0!==n&&n.onMessage?chrome.runtime.onMessage.addListener(i):window.addEventListener("message",i)})(((e,t)=>{"current_profile_changed"===e&&ut(t)})),(async(e,t)=>new Promise(((n,r)=>{const a=t=>{t.source===window&&o(t.data)&&m===t.data.type&&e===t.data.action&&("success"===t.data.result?n(t.data.value):r(t.data.error),t.stopPropagation(),window.removeEventListener("message",a))};window.addEventListener("message",a),window.postMessage({type:g,action:e,value:t},"*")})))("get_current_profile").catch((()=>null)).then(ut),Ce(ge,(({sound:e,type:t,speed:n,playbackStrategy:r})=>{if(o(lt)){const o=Be(),a=it(lt,N,t,n,o),i=it(lt,F,t,n,o);a&&ne(N,a.value,e,r,a.isRelative,S),i&&ne(F,i.value,e,r,i.isRelative,S)}}))}(); +!function(){"use strict";const e=()=>{},t=e=>"number"==typeof e&&Number.isFinite(e),n=e=>"string"==typeof e,r=Array.isArray,o=e=>"object"==typeof e&&!!e&&!r(e),a=e=>"function"==typeof e,i=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l=e=>{for(let t in e)if(i(e,t))return!1;return!0},u=e=>{let t=null;if("/"===e.charAt(0)&&("/"===e.charAt(1)?e=`https://${e}`:t=e),null===t)try{t=new URL(e).pathname}catch(n){t=e}return t},s=e=>`__duo-toolbox__-${e}`,c=s("global_variables"),d=(e,t)=>(o(window[c])||(window[c]={}),i(window[c],e)?window[c][e]:t),f=(e,t)=>{o(window[c])||(window[c]={}),window[c][e]=t},p=(e,t,n)=>{const r=t(d(e,n));return f(e,r),r},v=s("original_function"),_=s("override_version"),h=(t,n,r,l=1)=>((e,t,n,r,o=1)=>{i(window,e)&&t(window[e])?n(window[e]):p("pending_global_listeners",((a={})=>{var i;if(!a[e]){a[e]={};let n=window[e];Object.defineProperty(window,e,{get:()=>n,set:r=>{t(r)?(Object.defineProperty(window,e,{value:r,configurable:!0,enumerable:!0,writable:!0}),Object.values(a[e]).forEach((e=>e.callback(r)))):n=r},configurable:!0})}return o>(Number(null===(i=a[e][r])||void 0===i?void 0:i.version)||0)&&(a[e][r]={callback:n,version:o}),a}))})(t,a,(t=>((t,n,r,a=1)=>{var i;if(o(t)&&a>(Number(null===(i=t[n])||void 0===i?void 0:i[_])||0)){var l;const o=(null===(l=t[n])||void 0===l?void 0:l[v])||t[n]||e;t[n]=r(o),t[n][v]=o,t[n][_]=a}})(null==t?void 0:t.prototype,n,r,l)),`instance_method:${n}`,l),y=s("logging_iframe"),g=s("action_request"),m=s("action_result"),b=s("background_event_notification"),w=()=>(()=>{let e=document.getElementById(y);return e&&e.isConnected||(e=document.createElement("iframe"),e.id=y,e.style.display="none",document.body.appendChild(e)),e})().contentWindow.console,j=(...e)=>w().error(...e),O="listen",k="listenComprehension",x="listenTap",A=["characterIntro","characterMatch","characterSelect","completeReverseTranslation","definition","dialogue","form","freeResponse","gapFill","judge",O,k,x,"name","readComprehension","select","selectPronunciation","selectTranscription","speak","tapCloze","tapClozeTable","tapComplete","tapCompleteTable","tapDescribe","translate","typeCloze","typeClozeTable","typeCompleteTable"],z=[O,k,x],K=e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t.source_language)||e.sourceLanguage||(null===(n=e.metadata)||void 0===n?void 0:n.learning_language)},T=e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.target_language)||e.targetLanguage||K(e)},$="none",E=Number.MAX_SAFE_INTEGER,S=Math.round(E/4),C="effect",R="tts_sentence",V="tts_word",M="unknown",q="normal",L="slow",P="audio",I="howler",U=[P,I],N="rate",F="volume",D=s("forced_setting"),B=e=>o(e)&&!!e[D],H=e=>e.value,Q=e=>({[D]:!0,value:e}),X=(e,n)=>N===e&&t(n)||F===e&&n>=0&&n<=1,G=(e,n)=>((e,t,n,r=1)=>{if(!o(e))return;const a=s(`${t}_override_version`);r>(Number(e[a])||0)&&Object.defineProperty(e,t,n(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,n,(n=>({...n,set:function(r){const o=Y[e];t(r)?(this[o.originalValueKey]=r,i(this,o.valueKey)&&(r=this[o.isRelativeKey]?te(e,r*this[o.valueKey]):this[o.valueKey])):B(r)&&(r=H(r)),t(r)&&(this[o.listenerValueKey]=r),n.set.call(this,r)}}))),W=(e,t)=>h("Howl",t,(n=>function(){const r=this,o=arguments,a=Y[e];let l=!1;const u=r._queue.length;(1===o.length||2===o.length&&void 0===o[1])&&-1===r._getSoundIds().indexOf(o[0])&&(B(o[0])?(l=!0,o[0]=H(o[0])):X(e,o[0])&&(r[a.originalValueKey]=o[0],i(r,a.valueKey)&&(l=!0,r[a.isRelativeKey]?o[0]=te(e,o[0]*r[a.valueKey]):o[0]=r[a.valueKey])),l&&(r[a.listenerValueKey]=o[0]));const s=n.apply(r,arguments);return l&&u({...r,functions:{[P]:{applyOverride:()=>G(e,n),getter:e=>e[t],setter:(e,n)=>e[t]=n,hasQueuedUpdate:()=>!1},[I]:{applyOverride:()=>W(e,n),getter:e=>e[n](),setter:(e,t)=>e[n](t),hasQueuedUpdate:e=>e._queue.find((e=>e.event===n))}},priorityKey:s(`${e}_priority`),isRelativeKey:s(`${e}_is_relative`),valueKey:s(`forced_${e}_value`),originalValueKey:s(`original_${e}_value`),listenerValueKey:s(`${e}_value`)}),Y={[N]:J(N,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[F]:J(F,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},Z=e=>{const t=Y[e];if(!t)throw new Error(`Unknown sound setting: "${e}".`);return t},ee=e=>Z(e).defaultValue,te=(e,t)=>Y[e]?Math.max(Y[e].minValue,Math.min(t,Y[e].maxValue)):t,ne=(e,t,n,r,o=!1,a=1)=>{const l=Z(e);if(a>=(Number(n[l.priorityKey])||0)){const u=te(e,t),s=((e,t)=>{if(-1===U.indexOf(t))throw new Error(`Unknown sound playback strategy: "${t}".`);return Z(e).functions[t]})(e,r);s.applyOverride(),n[l.valueKey]=u,n[l.priorityKey]=a,n[l.isRelativeKey]=o,i(n,l.originalValueKey)||(n[l.originalValueKey]=s.getter(n)),s.hasQueuedUpdate(n)||s.setter(n,Q(te(e,u*(o?n[l.originalValueKey]:1))))}},re="event_listeners",oe=()=>{return`__listener::${e="last_event_listener_id",p(`__counter::${e}__`,(e=>e+1),0)}__`;var e},ae=e=>{var t;return(null===(t=d(re,{}))||void 0===t?void 0:t[e])||{}},ie=(e,t)=>{p(re,(n=>Object.assign(n||{},{[e]:t})))},le=!l((e=>ae(e))),ue=(e,t)=>{const n=ae(e);return l(n)?null:t(Object.values(n))},se=(e,t,n=oe())=>{const r=ae(e);return r[n]=t,ie(e,r),()=>de(e,n)},ce=(e,t,n,o,a=se,i=oe())=>{const l=`__${t}::${e}__`;var u;u=l,ae(t)[u]||a(t,((...t)=>{const n=o(...t);r(n)&&fe(e,...n)}),l);const s=se(e,n,i);return()=>{s(),le(e)||de(t,l)}},de=(e,t)=>{const n=ae(e);delete n[t],ie(e,n)},fe=(e,...t)=>ue(e,(e=>e.flatMap((e=>{try{return[e(...t)]}catch(e){return[]}})))),pe="practice_session_loaded",ve="story_loaded",_e="forum_discussion_loaded",he="dictionary_lexeme_loaded",ye="sound_playback_requested",ge="sound_playback_confirmed",me="sound_playback_cancelled",be={[he]:/\/api\/1\/dictionary_page/g,[_e]:/\/comments\/([\d]+)/g,[pe]:/\/[\d]{4}-[\d]{2}-[\d]{2}\/sessions/g,[ve]:/\/api2\/stories/g,user_data_loaded:/\/[\d]{4}-[\d]{2}-[\d]{2}\/users\/[\d]+/g},we=(e,t,n=oe())=>(h("XMLHttpRequest","open",(e=>function(t,n,r,a,i){let l;for(const[e,t]of Object.entries(be))if(n.match(t)){l=e;break}return l&&ue(l,(e=>{this.addEventListener("load",(()=>{try{const t=o(this.response)?this.response:JSON.parse(this.responseText);e.forEach((e=>e(t)))}catch(e){j(e,`Could not handle the XHR result (event: ${l}): `)}}))})),e.call(this,t,n,r,a,i)})),se(e,t,n)),je=(e,t)=>({url:e,type:R,speed:q,language:t}),Oe=(e,t)=>({url:e,type:V,speed:q,language:t}),ke=Object.fromEntries(["/sounds/7abe057dc8446ad325229edd6d8fd250.mp3","/sounds/2aae0ea735c8e9ed884107d6f0a09e35.mp3","/sounds/421d48c53ad6d52618dba715722278e0.mp3","/sounds/37d8f0b39dcfe63872192c89653a93f6.mp3","/sounds/0a27c1ee63dd220647e8410a0029aed2.mp3","/sounds/a28ff0a501ef5f33ca78c0afc45ee53e.mp3","/sounds/2e4669d8cf839272f0731f8afa488caf.mp3","/sounds/f0b6ab4396d5891241ef4ca73b4de13a.mp3"].map((e=>{return[e,(t=e,{url:t,type:C,speed:q,language:null})];var t}))),xe=/\/duolingo-data\/tts\/(?[a-z-_]+)\/token\//i,Ae="sound_type_map",ze=()=>d(Ae,ke),Ke=e=>{const t=ze()||{};for(const n of e)t[u(n.url)]=n;f(Ae,t)},Te="sound_detection_unregistration_callbacks",$e=(e,t,n)=>{var r;return{url:e.url,type:t,speed:(null===(r=e.speed)||void 0===r?void 0:r.value)||q,language:n}},Ee=()=>{var e,t,a,i;d(Te)||f(Te,[(i=e=>(e=>{const t=e.learningLanguage;r(e.elements)&&Ke(e.elements.map((e=>{var t;return(null==e||null===(t=e.line)||void 0===t?void 0:t.content)||(null==e?void 0:e.learningLanguageTitleContent)})).flatMap((e=>[null==e?void 0:e.audio,null==e?void 0:e.audioPrefix,null==e?void 0:e.audioSuffix])).map((e=>null==e?void 0:e.url)).filter(n).map((e=>je(e,t))))})(e),we(ve,i)),(a=e=>{var t;n((t=e).tts_url)&&Ke([je(t.tts_url,t.sentence_language)])},we(_e,a)),(t=e=>(e=>{const t=[],o=e.learning_language;n(e.tts)&&t.push(Oe(e.tts,o)),r(e.alternative_forms)&&t.push(e.alternative_forms.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>je(e,o)))),Ke(t.flat())})(e),we(he,t)),(e=e=>(e=>{const t=[];for(const u of e){var a;const e=K(u),s=T(u);if(n(u.tts)&&t.push(je(u.tts,e)),n(u.slowTts)&&t.push({url:u.slowTts,type:R,speed:L,language:e}),n(u.solutionTts)&&t.push(je(u.solutionTts,s)),r(u.choices)&&t.push(u.choices.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>Oe(e,s)))),r(u.tokens)&&t.push(u.tokens.map((e=>null==e?void 0:e.tts)).filter(n).map((t=>Oe(t,e)))),r(u.questionTokens)&&t.push(u.questionTokens.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>Oe(e,s)))),r(null===(a=u.metadata)||void 0===a?void 0:a.speakers))for(const e of u.metadata.speakers){var i,l;o(null===(i=e.tts)||void 0===i?void 0:i.tokens)&&t.push(Object.values(e.tts.tokens).filter((e=>n(e.url))).map((e=>$e(e,V,s)))),r(null===(l=e.tts)||void 0===l?void 0:l.sentence)&&t.push(e.tts.sentence.filter((e=>n(e.url))).map((e=>$e(e,R,s))))}r(u.pairs)&&t.push(u.pairs.map((e=>null==e?void 0:e.tts)).filter(n).map((e=>Oe(e,s))))}Ke(t.flat())})(e.challenges),ce("practice_challenges_loaded",pe,e,(e=>{let t;var n;o(e)&&(t=[{challenges:[e.challenges,e.adaptiveChallenges,null===(n=e.adaptiveInterleavedChallenges)||void 0===n?void 0:n.challenges].filter(r).flat(),sessionMetaData:e.metadata||{}}]);return t}),we))])},Se=(e,t,n)=>{const r=(e=>{const t=ze()[e];if(o(t))return t;const n=e.match(xe);return n?Oe(e,n.language):null})(u(t));return{url:t,type:(null==r?void 0:r.type)||M,speed:(null==r?void 0:r.speed)||q,language:null==r?void 0:r.language,playbackStrategy:n,sound:e}},Ce=(e,t)=>{h("Howl","play",(e=>function(t){var n;f("is_howler_used",!0);const r=String(this._src||(null===(n=this._parent)||void 0===n?void 0:n._src)||"").trim();return""!==r?((e,t,n,r)=>{const o=Se(e,t,n);let a=!1;try{var i;a=null===(i=fe(ye,o))||void 0===i?void 0:i.some((e=>!1===e)),fe(a?me:ge,o)}catch(e){j(e,`Could not handle playback for sound "${t}" (using "${n}"): `)}return a?null:r()})(this,r,I,(()=>e.call(this,t))):e.call(this,t)})),Ee();const n=se(e,t);return()=>{n(),(()=>{const e=d(Te);!r(e)||le("sound_initialized")||le(ye)||le(me)||le(ge)||(e.forEach((e=>e())),f(Te,null))})()}},Re="challenge",Ve="story",Me="forum_discussion",qe="dictionary",Le="unknown",Pe=/duolingo\.com\/stories\/(?[^/]+)/,Ie=/forum\.duolingo\.com\/comment\/(?[\d]+)/,Ue=/duolingo\.com\/dictionary\/(?.+)\/(?.+)\/(?[\w]+)\/?/,Ne="listening_challenge",Fe="other_challenge",De=[Ne,Fe,Ve,Me,qe,Le],Be=()=>{const e=(()=>{const e=document.location.href;let t=e.match(Ie);if(r(t))return{type:Me,commentId:Number(t.comment_id)||null};var n;if(t=e.match(Pe),r(t)||document.querySelector('[data-test="stories-element"]'))return{type:Ve,storyKey:null===(n=t)||void 0===n?void 0:n.story_key};if(t=e.match(Ue),r(t))return{type:qe,languageName:t.language,lexeme:t.lexeme,lexemeId:t.lexeme_id};const o=document.querySelector('[data-test*="challenge"]');if(o){let e=null;for(const t of(null===(a=o.getAttribute("data-test"))||void 0===a?void 0:a.split(/\s+/))||[]){var a,i;const n=null===(i=t.match(/challenge-(?[a-z]+)/i))||void 0===i?void 0:i.groups.type.trim();if(A.indexOf(n)>=0){e=n;break}}let t=$;const n=document.querySelector("._2Fc1K ._1tuLI");return n&&(t=n.classList.contains("_3e9O1")?"correct":"incorrect"),{type:Re,challengeType:e,result:t,isCompleted:$!==t}}return{type:Le}})();let t=e.type;return Re===t&&(t=-1===z.indexOf(e.challengeType)?Fe:Ne),t};var He,Qe,Xe,Ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};He=function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Function]",i="[object Object]",l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[o]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s[a]=s["[object Map]"]=s["[object Number]"]=s[i]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var c="object"==typeof Ge&&Ge&&Ge.Object===Object&&Ge,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),p=t&&!t.nodeType&&t,v=p&&e&&!e.nodeType&&e,_=v&&v.exports===p,h=_&&c.process,y=function(){try{var e=v&&v.require&&v.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(e){}}(),g=y&&y.isTypedArray;function m(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var b,w,j,O=Array.prototype,k=Function.prototype,x=Object.prototype,A=f["__core-js_shared__"],z=k.toString,K=x.hasOwnProperty,T=(b=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",$=x.toString,E=z.call(Object),S=RegExp("^"+z.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=_?f.Buffer:void 0,R=f.Symbol,V=f.Uint8Array,M=C?C.allocUnsafe:void 0,q=(w=Object.getPrototypeOf,j=Object,function(e){return w(j(e))}),L=Object.create,P=x.propertyIsEnumerable,I=O.splice,U=R?R.toStringTag:void 0,N=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),F=C?C.isBuffer:void 0,D=Math.max,B=Date.now,H=ve(f,"Map"),Q=ve(Object,"create"),X=function(){function e(){}return function(t){if(!Ae(t))return{};if(L)return L(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},W.prototype.set=function(e,t){var n=this.__data__,r=ne(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(H||W),string:new G}},J.prototype.delete=function(e){var t=pe(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return pe(this,e).get(e)},J.prototype.has=function(e){return pe(this,e).has(e)},J.prototype.set=function(e,t){var n=pe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Y.prototype.clear=function(){this.__data__=new W,this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Y.prototype.get=function(e){return this.__data__.get(e)},Y.prototype.has=function(e){return this.__data__.has(e)},Y.prototype.set=function(e,t){var n=this.__data__;if(n instanceof W){var r=n.__data__;if(!H||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new J(r)}return n.set(e,t),this.size=n.size,this};var oe,ae=function(e,t,n){for(var r=-1,o=Object(e),a=n(e),i=a.length;i--;){var l=a[oe?i:++r];if(!1===t(o[l],l,o))break}return e};function ie(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=K.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch(e){}var o=$.call(e);return r&&(t?e[U]=n:delete e[U]),o}(e):function(e){return $.call(e)}(e)}function le(e){return ze(e)&&ie(e)==o}function ue(e){return!(!Ae(e)||function(e){return!!T&&T in e}(e))&&(ke(e)?S:l).test(function(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function se(e){if(!Ae(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=he(e),n=[];for(var r in e)("constructor"!=r||!t&&K.call(e,r))&&n.push(r);return n}function ce(e,t,n,r,o){e!==t&&ae(t,(function(a,l){if(o||(o=new Y),Ae(a))!function(e,t,n,r,o,a,l){var u=ye(e,n),s=ye(t,n),c=l.get(s);if(c)ee(e,n,c);else{var d,f,p,v,_,h=a?a(u,s,n+"",e,t,l):void 0,y=void 0===h;if(y){var g=we(s),m=!g&&Oe(s),b=!g&&!m&&Ke(s);h=s,g||m||b?we(u)?h=u:ze(_=u)&&je(_)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function me(e,t){return e===t||e!=e&&t!=t}var be=le(function(){return arguments}())?le:function(e){return ze(e)&&K.call(e,"callee")&&!P.call(e,"callee")},we=Array.isArray;function je(e){return null!=e&&xe(e.length)&&!ke(e)}var Oe=F||function(){return!1};function ke(e){if(!Ae(e))return!1;var t=ie(e);return t==a||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ze(e){return null!=e&&"object"==typeof e}var Ke=g?function(e){return function(t){return e(t)}}(g):function(e){return ze(e)&&xe(e.length)&&!!s[ie(e)]};function Te(e){return je(e)?Z(e,!0):se(e)}var $e,Ee=($e=function(e,t,n){ce(e,t,n)},de((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=$e.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!Ae(n))return!1;var r=typeof t;return!!("number"==r?je(n)&&_e(t,n.length):"string"==r&&t in n)&&me(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++nF===e,et=(e,t=null,n=null)=>({[C]:{[q]:t},[R]:{[q]:t,[L]:t},[V]:{[q]:t},[M]:{[q]:t},...Ze(e)?{[Je]:n}:{}}),tt=(e,t)=>Object.fromEntries([[We,et(e,{value:t,isRelative:!0},{value:t})],...De.map((t=>[t,et(e)]))]),nt=Object.fromEntries(Ye.map((e=>[e,tt(e,ee(e))]))),rt=(e,t)=>o(nt.volume.default[e][t]),ot=(e,t,n,r=!0)=>{var a,i;if(!Ze(t))return;const l=null==e||null===(a=e[t])||void 0===a||null===(i=a[null!=n?n:We])||void 0===i?void 0:i.main;return o(l)?l:null===n?ee(t):r?ot(e,t,null):null},at=(e,t,n,r,a,i=!0)=>{var l,u,s;if(!rt(n,r))return;const c=null==e||null===(l=e[t])||void 0===l||null===(u=l[null!=a?a:We])||void 0===u||null===(s=u[n])||void 0===s?void 0:s[r];return o(c)?c:null===a?ee(t):i?at(e,t,n,r,null):null},it=(e,t,n,r,o)=>{if(!rt(n,r))return;const a=at(e,t,n,r,o);if(!Ze(t))return a;const i=ot(e,t,o);return{isRelative:a.isRelative,value:i.value*a.value}};let lt=null;const ut=e=>lt=e;((e,t)=>{var n;const a=r(t)?e=>t.indexOf(e)>=0:()=>!0,i=t=>{const n=o(t.data)?t.data:t;return n&&b===n.type&&a(n.event)&&e(n.event,n.value)};"undefined"!=typeof chrome&&null!==(n=chrome.runtime)&&void 0!==n&&n.onMessage?chrome.runtime.onMessage.addListener(i):window.addEventListener("message",i)})(((e,t)=>{"current_profile_changed"===e&&ut(t)})),(async(e,t)=>new Promise(((n,r)=>{const a=t=>{t.source===window&&o(t.data)&&m===t.data.type&&e===t.data.action&&("success"===t.data.result?n(t.data.value):r(t.data.error),t.stopPropagation(),window.removeEventListener("message",a))};window.addEventListener("message",a),window.postMessage({type:g,action:e,value:t},"*")})))("get_current_profile").catch((()=>null)).then(ut),Ce(ge,(({sound:e,type:t,speed:n,playbackStrategy:r})=>{if(o(lt)){const o=Be(),a=it(lt,N,t,n,o),i=it(lt,F,t,n,o);a&&ne(N,a.value,e,r,a.isRelative,S),i&&ne(F,i.value,e,r,i.isRelative,S)}}))}(); diff --git a/dist/src/popup.js b/dist/src/popup.js index b843695..c2e8c70 100644 --- a/dist/src/popup.js +++ b/dist/src/popup.js @@ -1,7 +1,7 @@ -!function(){"use strict";var e,t,n,r,o,i,a,s,l={},u=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(e,t){for(var n in t)e[n]=t[n];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function d(t,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return h(t,s,o,i,null)}function h(e,r,o,i,a){var s={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null!=t.vnode&&t.vnode(s),s}function y(e){return e.children}function m(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?h(_.type,_.props,_.key,null,_.__v):_)){if(_.__=n,_.__b=n.__b+1,null===(m=C[f])||m&&_.key==m.key&&_.type===m.type)C[f]=void 0;else for(d=0;d2&&(s.children=arguments.length>3?e.call(arguments,2):r),h(t.type,s,o||t.key,i||t.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(g)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n},get options(){return t}}),F=0,U=[],W=t.__b,B=t.__r,V=t.diffed,K=t.__c,z=t.unmount;function $(e,n){t.__h&&t.__h(D,e,F||n),F=0;var r=D.__H||(D.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Y(e){return F=1,G(ie,e)}function G(e,t,n){var r=$(I++,2);return r.t=e,r.__c||(r.__=[n?n(t):ie(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=D),r.__}function X(e,n){var r=$(I++,3);!t.__s&&oe(r.__H,n)&&(r.__=e,r.__H=n,D.__H.__h.push(r))}function q(e,n){var r=$(I++,4);!t.__s&&oe(r.__H,n)&&(r.__=e,r.__H=n,D.__h.push(r))}function Z(e){return F=5,J((function(){return{current:e}}),[])}function J(e,t){var n=$(I++,7);return oe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Q(e,t){return F=8,J((function(){return e}),t)}function ee(){U.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(ne),e.__H.__h.forEach(re),e.__H.__h=[]}catch(n){e.__H.__h=[],t.__e(n,e.__v)}})),U=[]}t.__b=function(e){D=null,W&&W(e)},t.__r=function(e){B&&B(e),I=0;var t=(D=e.__c).__H;t&&(t.__h.forEach(ne),t.__h.forEach(re),t.__h=[])},t.diffed=function(e){V&&V(e);var n=e.__c;n&&n.__H&&n.__H.__h.length&&(1!==U.push(n)&&H===t.requestAnimationFrame||((H=t.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),te&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);te&&(t=requestAnimationFrame(n))})(ee)),D=void 0},t.__c=function(e,n){n.some((function(e){try{e.__h.forEach(ne),e.__h=e.__h.filter((function(e){return!e.__||re(e)}))}catch(r){n.some((function(e){e.__h&&(e.__h=[])})),n=[],t.__e(r,e.__v)}})),K&&K(e,n)},t.unmount=function(e){z&&z(e);var n=e.__c;if(n&&n.__H)try{n.__H.__.forEach(ne)}catch(e){t.__e(e,n.__v)}};var te="function"==typeof requestAnimationFrame;function ne(e){var t=D;"function"==typeof e.__c&&e.__c(),D=t}function re(e){var t=D;e.__c=e.__(),D=t}function oe(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ie(e,t){return"function"==typeof t?t(e):t}var ae=Object.freeze({__proto__:null,useState:Y,useReducer:G,useEffect:X,useLayoutEffect:q,useRef:Z,useImperativeHandle:function(e,t,n){F=6,q((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:J,useCallback:Q,useContext:function(e){var t=D.context[e.__c],n=$(I++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(D)),t.props.value):e.__},useDebugValue:function(e,n){t.useDebugValue&&t.useDebugValue(n?n(e):e)},useErrorBoundary:function(e){var t=$(I++,10),n=Y();return t.__=e,D.componentDidCatch||(D.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}}),se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function le(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}function ue(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}var ce=ue(ae),pe=ue(M),fe=le((function(e,t){var n=ce,r=pe;function o(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function a(e){this.props=e}function s(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:i(this.props,e)}function o(t){return this.shouldComponentUpdate=n,r.createElement(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(a.prototype=new r.Component).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)};var l=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),l&&l(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function c(e){function t(t,n){var r=o({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:r.toChildArray(r.toChildArray(e).map(t))},f={map:p,forEach:p,count:function(e){return e?r.toChildArray(e).length:0},only:function(e){var t=r.toChildArray(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},d=r.options.__e;r.options.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);d(e,t,n)};var h=r.options.unmount;function y(){this.__u=0,this.t=null,this.__b=null}function m(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function v(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return r.createElement(n,i)}return i.displayName="Lazy",i.__f=!0,i}function _(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),h&&h(e)},(y.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=m(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},y.prototype.componentWillUnmount=function(){this.t=[]},y.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=o({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,i.__O=i.__P)}this.__b=null}var a=t.__e&&r.createElement(r.Fragment,null,e.fallback);return a&&(a.__h=null),[r.createElement(r.Fragment,null,t.__e?null:e.children),a]};var g=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),r.render(r.createElement(b,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function O(e,t){return r.createElement(E,{__v:e,i:t})}(_.prototype=new r.Component).__e=function(e){var t=this,n=m(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),g(t,e,r)):o()};n?n(i):i()}},_.prototype.render=function(e){this.u=null,this.o=new Map;var t=r.toChildArray(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},_.prototype.componentDidUpdate=_.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){g(e,n,t)}))};var w="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,C=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,k=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function x(e,t,n){return null==t.__k&&(t.textContent=""),r.render(e,t),"function"==typeof n&&n(),e?e.__c:null}function S(e,t,n){return r.hydrate(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var T=r.options.event;function N(){}function R(){return this.cancelBubble}function P(){return this.defaultPrevented}r.options.event=function(e){return T&&(e=T(e)),e.persist=N,e.isPropagationStopped=R,e.isDefaultPrevented=P,e.nativeEvent=e};var A,L={configurable:!0,get:function(){return this.class}},j=r.options.vnode;r.options.vnode=function(e){var t=e.type,n=e.props,o=n;if("string"==typeof t){for(var i in o={},n){var a=n[i];"value"===i&&"defaultValue"in n&&null==a||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===a?a="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!k(n.type)?i="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():C.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),o[i]=a)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=r.toChildArray(n.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=r.toChildArray(n.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o}t&&n.class!=n.className&&(L.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",L)),e.$$typeof=w,j&&j(e)};var I=r.options.__r;r.options.__r=function(e){I&&I(e),A=e.__c};var D={ReactCurrentDispatcher:{current:{readContext:function(e){return A.__n[e.__c].props.value}}}};function H(e){return r.createElement.bind(null,e)}function M(e){return!!e&&e.$$typeof===w}function F(e){return M(e)?r.cloneElement.apply(null,arguments):e}function U(e){return!!e.__k&&(r.render(null,e),!0)}function W(e){return e&&(e.base||1===e.nodeType&&e)||null}var B=function(e,t){return e(t)},V=function(e,t){return e(t)},K=r.Fragment,z={useState:n.useState,useReducer:n.useReducer,useEffect:n.useEffect,useLayoutEffect:n.useLayoutEffect,useRef:n.useRef,useImperativeHandle:n.useImperativeHandle,useMemo:n.useMemo,useCallback:n.useCallback,useContext:n.useContext,useDebugValue:n.useDebugValue,version:"17.0.2",Children:f,render:x,hydrate:S,unmountComponentAtNode:U,createPortal:O,createElement:r.createElement,createContext:r.createContext,createFactory:H,cloneElement:F,createRef:r.createRef,Fragment:r.Fragment,isValidElement:M,findDOMNode:W,Component:r.Component,PureComponent:a,memo:s,forwardRef:c,flushSync:V,unstable_batchedUpdates:B,StrictMode:K,Suspense:y,SuspenseList:_,lazy:v,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:D};Object.keys(n).forEach((function(e){t[e]=n[e]})),t.createElement=r.createElement,t.createContext=r.createContext,t.createRef=r.createRef,t.Fragment=r.Fragment,t.Component=r.Component,t.version="17.0.2",t.Children=f,t.render=x,t.hydrate=S,t.unmountComponentAtNode=U,t.createPortal=O,t.createFactory=H,t.cloneElement=F,t.isValidElement=M,t.findDOMNode=W,t.PureComponent=a,t.memo=s,t.forwardRef=c,t.flushSync=V,t.unstable_batchedUpdates=B,t.StrictMode=K,t.Suspense=y,t.SuspenseList=_,t.lazy=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.default=z}));function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var he=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};de(he,"ripple",!1),de(he,"locale","en"),de(he,"autoZIndex",!0),de(he,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),de(he,"appendTo",null);var ye=Object.freeze({ALIGN_CENTER:"pi pi-align-center",ALIGN_JUSTIFY:"pi pi-align-justify",ALIGN_LEFT:"pi pi-align-left",ALIGN_RIGHT:"pi pi-align-right",AMAZON:"pi pi-amazon",ANDROID:"pi pi-android",ANGLE_DOUBLE_DOWN:"pi pi-angle-double-down",ANGLE_DOUBLE_LEFT:"pi pi-angle-double-left",ANGLE_DOUBLE_RIGHT:"pi pi-angle-double-right",ANGLE_DOUBLE_UP:"pi pi-angle-double-up",ANGLE_DOWN:"pi pi-angle-down",ANGLE_LEFT:"pi pi-angle-left",ANGLE_RIGHT:"pi pi-angle-right",ANGLE_UP:"pi pi-angle-up",APPLE:"pi pi-apple",ARROW_CIRCLE_DOWN:"pi pi-arrow-circle-down",ARROW_CIRCLE_LEFT:"pi pi-arrow-circle-left",ARROW_CIRCLE_RIGHT:"pi pi-arrow-circle-right",ARROW_CIRCLE_UP:"pi pi-arrow-circle-up",ARROW_DOWN:"pi pi-arrow-down",ARROW_LEFT:"pi pi-arrow-left",ARROW_RIGHT:"pi pi-arrow-right",ARROW_UP:"pi pi-arrow-up",BACKWARD:"pi pi-backward",BAN:"pi pi-ban",BARS:"pi pi-bars",BELL:"pi pi-bell",BOOK:"pi pi-book",BOOKMARK:"pi pi-bookmark",BRIEFCASE:"pi pi-briefcase",CALENDAR_MINUS:"pi pi-calendar-minus",CALENDAR_PLUS:"pi pi-calendar-plus",CALENDAR_TIMES:"pi pi-calendar-times",CALENDAR:"pi pi-calendar",CAMERA:"pi pi-camera",CARET_DOWN:"pi pi-caret-down",CARET_LEFT:"pi pi-caret-left",CARET_RIGHT:"pi pi-caret-right",CARET_UP:"pi pi-caret-up",CHART_BAR:"pi pi-chart-bar",CHART_LINE:"pi pi-chart-line",CHECK_CIRCLE:"pi pi-check-circle",CHECK_SQUARE:"pi pi-check-square",CHECK:"pi pi-check",CHEVRON_CIRCLE_DOWN:"pi pi-chevron-circle-down",CHEVRON_CIRCLE_LEFT:"pi pi-chevron-circle-left",CHEVRON_CIRCLE_RIGHT:"pi pi-chevron-circle-right",CHEVRON_CIRCLE_UP:"pi pi-chevron-circle-up",CHEVRON_DOWN:"pi pi-chevron-down",CHEVRON_LEFT:"pi pi-chevron-left",CHEVRON_RIGHT:"pi pi-chevron-right",CHEVRON_UP:"pi pi-chevron-up",CLOCK:"pi pi-clock",CLONE:"pi pi-clone",CLOUD_DOWNLOAD:"pi pi-cloud-download",CLOUD_UPLOAD:"pi pi-cloud-upload",CLOUD:"pi pi-cloud",COG:"pi pi-cog",COMMENT:"pi pi-comment",COMMENTS:"pi pi-comments",COMPASS:"pi pi-compass",COPY:"pi pi-copy",CREDIT_CARD:"pi pi-credit-card",DESKTOP:"pi pi-desktop",DISCORD:"pi pi-discord",DIRECTIONS_ALT:"pi pi-directions-alt",DIRECTIONS:"pi pi-directions",DOLLAR:"pi pi-dollar",DOWNLOAD:"pi pi-download",EJECT:"pi pi-eject",ELLIPSIS_H:"pi pi-ellipsis-h",ELLIPSIS_V:"pi pi-ellipsis-v",ENVELOPE:"pi pi-envelope",EXCLAMATION_CIRCLE:"pi pi-exclamation-circle",EXCLAMATION_TRIANGLE:"pi pi-exclamation-triangle ",EXTERNAL_LINK:"pi pi-external-link",EYE_SLASH:"pi pi-eye-slash",EYE:"pi pi-eye",FACEBOOK:"pi pi-facebook",FAST_BACKWARD:"pi pi-fast-backward",FAST_FORWARD:"pi pi-fast-forward",FILE_EXCEL:"pi pi-file-excel",FILE_O:"pi pi-file-o",FILE_PDF:"pi pi-file-pdf",FILE:"pi pi-file",FILTER:"pi pi-filter",FILTER_SLASH:"pi pi-filter-slash",FLAG:"pi pi-flag",FOLDER_OPEN:"pi pi-folder-open",FOLDER:"pi pi-folder",FORWARD:"pi pi-forward",GITHUB:"pi pi-github",GLOBE:"pi pi-globe",GOOGLE:"pi pi-google",HEART:"pi pi-heart",HOME:"pi pi-home",ID_CARD:"pi pi-id-card",IMAGE:"pi pi-image",IMAGES:"pi pi-images",INBOX:"pi pi-inbox",INFO_CIRCLE:"pi pi-info-circle",INFO:"pi pi-info",KEY:"pi pi-key",LINK:"pi pi-link",LIST:"pi pi-list",LOCK_OPEN:"pi pi-lock-open",LOCK:"pi pi-lock",MAP:"pi pi-map",MAP_MARKER:"pi pi-map-marker",MICROSOFT:"pi pi-microsoft",MINUS_CIRCLE:"pi pi-minus-circle",MINUS:"pi pi-minus",MOBILE:"pi pi-mobile",MONEY_BILL:"pi pi-money-bill",MOON:"pi pi-moon",PALETTE:"pi pi-palette",PAPERCLIP:"pi pi-paperclip",PAUSE:"pi pi-pause",PAYPAL:"pi pi-paypal",PENCIL:"pi pi-pencil",PERCENTAGE:"pi pi-percentage",PHONE:"pi pi-phone",PLAY:"pi pi-play",PLUS_CIRCLE:"pi pi-plus-circle",PLUS:"pi pi-plus",POWER_OFF:"pi pi-power-off",PRINT:"pi pi-print",QUESTION_CIRCLE:"pi pi-question-circle",QUESTION:"pi pi-question",RADIO_OFF:"pi pi-radio-off",RADIO_ON:"pi pi-radio-on",REFRESH:"pi pi-refresh",REPLAY:"pi pi-replay",REPLY:"pi pi-reply",SAVE:"pi pi-save",SEARCH_MINUS:"pi pi-search-minus",SEARCH_PLUS:"pi pi-search-plus",SEARCH:"pi pi-search",SEND:"pi pi-send",SHARE_ALT:"pi pi-share-alt",SHIELD:"pi pi-shield",SHOPPING_CART:"pi pi-shopping-cart",SIGN_IN:"pi pi-sign-in",SIGN_OUT:"pi pi-sign-out",SITEMAP:"pi pi-sitemap",SLACK:"pi pi-slack",SLIDERS_H:"pi pi-sliders-h",SLIDERS_V:"pi pi-sliders-v",SORT_ALPHA_ALT_DOWN:"pi pi-sort-alpha-alt-down",SORT_ALPHA_ALT_UP:"pi pi-sort-alpha-alt-up",SORT_ALPHA_DOWN:"pi pi-sort-alpha-down",SORT_ALPHA_UP:"pi pi-sort-alpha-up",SORT_ALT:"pi pi-sort-alt",SORT_AMOUNT_DOWN_ALT:"pi pi-sort-amount-down-alt",SORT_AMOUNT_DOWN:"pi pi-sort-amount-down",SORT_AMOUNT_UP_ALT:"pi pi-sort-amount-up-alt",SORT_AMOUNT_UP:"pi pi-sort-amount-up",SORT_DOWN:"pi pi-sort-down",SORT_NUMERIC_ALT_DOWN:"pi pi-sort-numeric-alt-down",SORT_NUMERIC_ALT_UP:"pi pi-sort-numeric-alt-up",SORT_NUMERIC_DOWN:"pi pi-sort-numeric-down",SORT_NUMERIC_UP:"pi pi-sort-numeric-up",SORT_UP:"pi pi-sort-up",SORT:"pi pi-sort",SPINNER:"pi pi-spinner",STAR_O:"pi pi-star-o",STAR:"pi pi-star",STEP_BACKWARD_ALT:"pi pi-step-backward-alt",STEP_BACKWARD:"pi pi-step-backward",STEP_FORWARD_ALT:"pi pi-step-forward-alt",STEP_FORWARD:"pi pi-step-forward",SUN:"pi pi-sun",TABLE:"pi pi-table",TABLET:"pi pi-tablet",TAG:"pi pi-tag",TAGS:"pi pi-tags",TH_LARGE:"pi pi-th-large",THUMBS_DOWN:"pi pi-thumbs-down",THUMBS_UP:"pi pi-thumbs-up",TICKET:"pi pi-ticket",TIMES_CIRCLE:"pi pi-times-circle",TIMES:"pi pi-times",TRASH:"pi pi-trash",TWITTER:"pi pi-twitter",UNDO:"pi pi-undo",UNLOCK:"pi pi-unlock",UPLOAD:"pi pi-upload",USER_EDIT:"pi pi-user-edit",USER_MINUS:"pi pi-user-minus",USER_PLUS:"pi pi-user-plus",USER:"pi pi-user",USERS:"pi pi-users",VIDEO:"pi pi-video",VIMEO:"pi pi-vimeo",VOLUME_DOWN:"pi pi-volume-down",VOLUME_OFF:"pi pi-volume-off",VOLUME_UP:"pi pi-volume-up",YOUTUBE:"pi pi-youtube",WALLET:"pi pi-wallet",WIFI:"pi pi-wifi",WINDOW_MAXIMIZE:"pi pi-window-maximize",WINDOW_MINIMIZE:"pi pi-window-minimize"});function me(){return me=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function _e(e,t){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(e,t)}function ge(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_e(e,t)}Object.freeze({SUCCESS:"success",INFO:"info",WARN:"warn",ERROR:"error"});function be(){}function Ee(){}Ee.resetWarningCache=be;function Oe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}le((function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ee,resetWarningCache:be};return n.PropTypes=n,n}()}));var we=!1,Ce=fe.createContext(null),ke="unmounted",xe="exited",Se="entering",Te="entered",Ne="exiting",Re=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=xe,r.appearStatus=Se):o=Te:o=t.unmountOnExit||t.mountOnEnter?ke:xe,r.state={status:o},r.nextCallback=null,r}ge(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ke?{status:xe}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Se&&n!==Te&&(t=Se):n!==Se&&n!==Te||(t=Ne)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===Se?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===xe&&this.setState({status:ke})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[fe.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||we?this.safeSetState({status:Te},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Se},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:Te},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:fe.findDOMNode(this);t&&!we?(this.props.onExit(r),this.safeSetState({status:Ne},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:xe},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:xe},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:fe.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ke)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=ve(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return fe.createElement(Ce.Provider,{value:null},"function"==typeof n?n(e,r):fe.cloneElement(fe.Children.only(n),r))},t}(fe.Component);function Pe(){}Re.contextType=Ce,Re.propTypes={},Re.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Pe,onEntering:Pe,onEntered:Pe,onExit:Pe,onExiting:Pe,onExited:Pe},Re.UNMOUNTED=ke,Re.EXITED=xe,Re.ENTERING=Se,Re.ENTERED=Te,Re.EXITING=Ne;var Ae=Re,Le=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},je=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Oe(n.className,r):n.setAttribute("class",Oe(n.className&&n.className.baseVal||"",r)));var n,r}))},Ie=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nf.height?((n=u.top+c-i)<0&&(n=c),e.style.transformOrigin="bottom"):(n=s+u.top+c,e.style.transformOrigin="top"),r=u.left+l+a>f.width?Math.max(0,u.left+p+l-a):u.left+p,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"relativePosition",value:function(e,t){if(e){var n,r,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=t.offsetHeight,a=t.getBoundingClientRect(),s=this.getViewport();a.top+i+o.height>s.height?(n=-1*o.height,a.top+n<0&&(n=-1*a.top),e.style.transformOrigin="bottom"):(n=i,e.style.transformOrigin="top"),r=o.width>s.width?-1*a.left:a.left+o.width>s.width?-1*(a.left+o.width-s.width):0,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"flipfitCollision",value:function(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",a=arguments.length>4?arguments[4]:void 0,s=n.getBoundingClientRect(),l=this.getViewport(),u=o.split(" "),c=i.split(" "),p=function(e,t){return t?+e.substring(e.search(/(\+|-)/g))||0:e.substring(0,e.search(/(\+|-)/g))||e},f={my:{x:p(u[0]),y:p(u[1]||u[0]),offsetX:p(u[0],!0),offsetY:p(u[1]||u[0],!0)},at:{x:p(c[0]),y:p(c[1]||c[0]),offsetX:p(c[0],!0),offsetY:p(c[1]||c[0],!0)}},d={left:function(){return f.my.offsetX+f.at.offsetX+s.left+("left"===f.my.x?0:-1*("center"===f.my.x?r.getOuterWidth(t)/2:r.getOuterWidth(t)))},top:function(){return f.my.offsetY+f.at.offsetY+s.top+("top"===f.my.y?0:-1*("center"===f.my.y?r.getOuterHeight(t)/2:r.getOuterHeight(t)))}},h={count:{x:0,y:0},left:function(){var n=d.left(),r=e.getWindowScrollLeft();t.style.left=n+r+"px",2===this.count.x?(t.style.left=r+"px",this.count.x=0):n<0&&(this.count.x++,f.my.x="left",f.at.x="right",f.my.offsetX*=-1,f.at.offsetX*=-1,this.right())},right:function(){var r=d.left()+e.getOuterWidth(n),o=e.getWindowScrollLeft();t.style.left=r+o+"px",2===this.count.x?(t.style.left=l.width-e.getOuterWidth(t)+o+"px",this.count.x=0):r+e.getOuterWidth(t)>l.width&&(this.count.x++,f.my.x="right",f.at.x="left",f.my.offsetX*=-1,f.at.offsetX*=-1,this.left())},top:function(){var n=d.top(),r=e.getWindowScrollTop();t.style.top=n+r+"px",2===this.count.y?(t.style.left=r+"px",this.count.y=0):n<0&&(this.count.y++,f.my.y="top",f.at.y="bottom",f.my.offsetY*=-1,f.at.offsetY*=-1,this.bottom())},bottom:function(){var r=d.top()+e.getOuterHeight(n),o=e.getWindowScrollTop();t.style.top=r+o+"px",2===this.count.y?(t.style.left=l.height-e.getOuterHeight(t)+o+"px",this.count.y=0):r+e.getOuterHeight(n)>l.height&&(this.count.y++,f.my.y="bottom",f.at.y="top",f.my.offsetY*=-1,f.at.offsetY*=-1,this.top())},center:function(r){if("y"===r){var o=d.top()+e.getOuterHeight(n)/2;t.style.top=o+e.getWindowScrollTop()+"px",o<0?this.bottom():o+e.getOuterHeight(n)>l.height&&this.top()}else{var i=d.left()+e.getOuterWidth(n)/2;t.style.left=i+e.getWindowScrollLeft()+"px",i<0?this.left():i+e.getOuterWidth(t)>l.width&&this.right()}}};h[f.at.x]("x"),h[f.at.y]("y"),this.isFunction(a)&&a(f)}},{key:"findCollisionPosition",value:function(e){if(e){var t="left"===e?"right":"left";return"top"===e||"bottom"===e?{axis:"y",my:"center ".concat("top"===e?"bottom":"top"),at:"center ".concat(e)}:{axis:"x",my:"".concat(t," center"),at:"".concat(e," center")}}}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t=[];if(e){var n,r=this.getParents(e),o=/(auto|scroll)/,i=function(e){var t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))},a=qe(r);try{for(a.s();!(n=a.n()).done;){var s=n.value,l=1===s.nodeType&&s.dataset.scrollselectors;if(l){var u,c=qe(l.split(","));try{for(c.s();!(u=c.n()).done;){var p=u.value,f=this.findSingle(s,p);f&&i(f)&&t.push(f)}}catch(e){c.e(e)}finally{c.f()}}9!==s.nodeType&&i(s)&&t.push(s)}}catch(e){a.e(e)}finally{a.f()}}return t}},{key:"getHiddenElementOuterHeight",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="",e.style.visibility="",t}return 0}},{key:"getHiddenElementOuterWidth",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="",e.style.visibility="",t}return 0}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="",e.style.visibility=""),t}},{key:"fadeIn",value:function(e,t){if(e){e.style.opacity=0;var n=+new Date,r=0;!function o(){r=+e.style.opacity+((new Date).getTime()-n)/t,e.style.opacity=r,n=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))}()}}},{key:"fadeOut",value:function(e,t){if(e)var n=1,r=50/t,o=setInterval((function(){(n-=r)<=0&&(n=0,clearInterval(o)),e.style.opacity=n}),50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"removeChild",value:function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot remove "+e+" from "+t);t.el.nativeElement.removeChild(e)}}},{key:"isElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":ze(HTMLElement))?e instanceof HTMLElement:e&&"object"===ze(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"scrollInView",value:function(e,t){var n=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=n?parseFloat(n):0,o=getComputedStyle(e).getPropertyValue("paddingTop"),i=o?parseFloat(o):0,a=e.getBoundingClientRect(),s=t.getBoundingClientRect().top+document.body.scrollTop-(a.top+document.body.scrollTop)-r-i,l=e.scrollTop,u=e.clientHeight,c=this.getOuterHeight(t);s<0?e.scrollTop=l+s:s+c>u&&(e.scrollTop=l+s-u+c)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}},{key:"calculateScrollbarWidth",value:function(e){if(e){var t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var n=document.createElement("div");n.className="p-scrollbar-measure",document.body.appendChild(n);var r=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),this.calculatedScrollbarWidth=r,r}},{key:"getBrowser",value:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}},{key:"isVisible",value:function(e){return e&&null!=e.offsetParent}},{key:"getFocusableElements",value:function(t){var n,r=[],o=qe(e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'));try{for(o.s();!(n=o.n()).done;){var i=n.value;"none"!==getComputedStyle(i).display&&"hidden"!==getComputedStyle(i).visibility&&r.push(i)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"getFirstFocusableElement",value:function(t){var n=e.getFocusableElements(t);return n.length>0?n[0]:null}},{key:"getLastFocusableElement",value:function(t){var n=e.getFocusableElements(t);return n.length>0?n[n.length-1]:null}},{key:"getCursorOffset",value:function(e,t,n,r){if(e){var o=getComputedStyle(e),i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.overflow=o.overflow,i.style.width=o.width,i.style.height=o.height,i.style.padding=o.padding,i.style.border=o.border,i.style.overflowWrap=o.overflowWrap,i.style.whiteSpace=o.whiteSpace,i.style.lineHeight=o.lineHeight,i.innerHTML=t.replace(/\r\n|\r|\n/g,"
");var a=document.createElement("span");a.textContent=r,i.appendChild(a);var s=document.createTextNode(n);i.appendChild(s),document.body.appendChild(i);var l=a.offsetLeft,u=a.offsetTop,c=a.clientHeight;return document.body.removeChild(i),{left:Math.abs(l-e.scrollLeft),top:Math.abs(u-e.scrollTop)+c}}return{top:"auto",left:"auto"}}}]),e}(),Qe=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Ye(this,e),this.element=t,this.listener=n}return Xe(e,[{key:"bindScrollListener",value:function(){this.scrollableParents=Je.getScrollableParents(this.element);for(var e=0;e=e.length)for(r=n-e.length;1+r--;)e.push(void 0);e.splice(n,0,e.splice(t,1)[0])}}},{key:"findIndexInList",value:function(e,t,n){var r=this;return t?n?t.findIndex((function(t){return r.equals(t,e,n)})):t.findIndex((function(t){return t===e})):-1}},{key:"getJSXElement",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"isEmpty",value:function(e){return null==e||""===e||Array.isArray(e)&&0===e.length||"object"===ze(e)&&0===Object.keys(e).length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}}]),e}();function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nt=0;function rt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_";return nt++,"".concat(e).concat(nt)}var ot,it,at,st=(ot=[],it=function(e){return he.zIndex[e]||999},at=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ot||[]).reverse().find((function(t){return!!he.autoZIndex||t.key===e}))||{key:e,value:t}},{get:function(e){return e&&parseInt(e.style.zIndex,10)||0},set:function(e,t,n){t&&(t.style.zIndex=String(function(e,t){t=t||it(e);var n=at(e,t),r=n.value+(n.key===e?0:t)+1;return ot.push({key:e,value:r}),r}(e,n)))},clear:function(e){var t;e&&(t=st.get(e),ot=ot.filter((function(e){return e.value!==t})),e.style.zIndex="")},getBase:function(e){return it(e)},getCurrent:function(e){return function(e){return at(e).value}(e)}});function lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ut(e,t){return ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ut(e,t)}function ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ut(e,t)}function pt(e,t){return!t||"object"!==ze(t)&&"function"!=typeof t?lt(e):t}function ft(e){return ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ft(e)}function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ft(e);if(t){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}var ht=function(e){ct(n,e);var t=dt(n);function n(e){var r;return Ye(this,n),(r=t.call(this,e)).onMouseDown=r.onMouseDown.bind(lt(r)),r}return Xe(n,[{key:"getTarget",value:function(){return this.ink&&this.ink.parentElement}},{key:"bindEvents",value:function(){this.target&&this.target.addEventListener("mousedown",this.onMouseDown)}},{key:"unbindEvents",value:function(){this.target&&this.target.removeEventListener("mousedown",this.onMouseDown)}},{key:"onMouseDown",value:function(e){if(this.ink&&"none"!==getComputedStyle(this.ink,null).display){if(Je.removeClass(this.ink,"p-ink-active"),!Je.getHeight(this.ink)&&!Je.getWidth(this.ink)){var t=Math.max(Je.getOuterWidth(this.target),Je.getOuterHeight(this.target));this.ink.style.height=t+"px",this.ink.style.width=t+"px"}var n=Je.getOffset(this.target),r=e.pageX-n.left+document.body.scrollTop-Je.getWidth(this.ink)/2,o=e.pageY-n.top+document.body.scrollLeft-Je.getHeight(this.ink)/2;this.ink.style.top=o+"px",this.ink.style.left=r+"px",Je.addClass(this.ink,"p-ink-active")}}},{key:"onAnimationEnd",value:function(e){Je.removeClass(e.currentTarget,"p-ink-active")}},{key:"componentDidMount",value:function(){this.ink&&(this.target=this.getTarget(),this.bindEvents())}},{key:"componentDidUpdate",value:function(){this.ink&&!this.target&&(this.target=this.getTarget(),this.bindEvents())}},{key:"componentWillUnmount",value:function(){this.ink&&(this.target=null,this.unbindEvents())}},{key:"render",value:function(){var e=this;return he.ripple&&fe.createElement("span",{ref:function(t){return e.ink=t},className:"p-ink",onAnimationEnd:this.onAnimationEnd})}}]),n}(fe.Component),yt=function(){function e(){Ye(this,e)}return Xe(e,null,[{key:"isNavKeyPress",value:function(t){var n=t.keyCode;return(n=Je.getBrowser().safari&&e.SAFARI_KEYS[n]||n)>=33&&n<=40||n===e.KEYS.RETURN||n===e.KEYS.TAB||n===e.KEYS.ESC}},{key:"isSpecialKey",value:function(e){var t=e.keyCode;return 9===t||13===t||27===t||16===t||17===t||t>=18&&t<=20||Je.getBrowser().opera&&!e.shiftKey&&(8===t||t>=33&&t<=35||t>=36&&t<=39||t>=44&&t<=45)}},{key:"getKey",value:function(t){var n=t.keyCode||t.charCode;return Je.getBrowser().safari&&e.SAFARI_KEYS[n]||n}},{key:"getCharCode",value:function(e){return e.charCode||e.keyCode||e.which}},{key:"onKeyPress",value:function(t,n,r){if(!r){var o=e.DEFAULT_MASKS[n]?e.DEFAULT_MASKS[n]:n,i=Je.getBrowser();if(!t.ctrlKey&&!t.altKey){var a=this.getKey(t);if(!i.mozilla||!(this.isNavKeyPress(t)||a===e.KEYS.BACKSPACE||a===e.KEYS.DELETE&&0===t.charCode)){var s=this.getCharCode(t),l=String.fromCharCode(s);(!i.mozilla||!this.isSpecialKey(t)&&l)&&(o.test(l)||t.preventDefault())}}}}},{key:"validate",value:function(e,t){var n=e.target.value,r=!0;return n&&!t.test(n)&&(r=!1),r}}]),e}();function mt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ft(e);if(t){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}tt(yt,"DEFAULT_MASKS",{pint:/[\d]/,int:/[\d\-]/,pnum:/[\d\.]/,money:/[\d\.\s,]/,num:/[\d\-\.]/,hex:/[0-9a-f]/i,email:/[a-z0-9_\.\-@]/i,alpha:/[a-z_]/i,alphanum:/[a-z0-9_]/i}),tt(yt,"KEYS",{TAB:9,RETURN:13,ESC:27,BACKSPACE:8,DELETE:46}),tt(yt,"SAFARI_KEYS",{63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35});var vt=function(e){ct(n,e);var t=mt(n);function n(e){var r;return Ye(this,n),(r=t.call(this,e)).state={mounted:e.visible},r}return Xe(n,[{key:"hasDOM",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"componentDidMount",value:function(){this.hasDOM()&&!this.state.mounted&&this.setState({mounted:!0},this.props.onMounted)}},{key:"componentWillUnmount",value:function(){this.props.onUnmounted&&this.props.onUnmounted()}},{key:"render",value:function(){if(this.props.element&&this.state.mounted){var e=this.props.appendTo||he.appendTo||document.body;return"self"===e?this.props.element:fe.createPortal(this.props.element,e)}return null}}]),n}(fe.Component);function _t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ft(e);if(t){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;ti.width?(this.containerEl.style.left="0px",this.containerEl.style.right=window.innerWidth-i.width-r+"px"):(this.containerEl.style.right="",this.containerEl.style.left=r+"px"),this.containerEl.style.top=o+"px",Je.addClass(this.containerEl,"p-tooltip-active")}else{var u=Je.findCollisionPosition(this.state.position),c=this.getTargetOption(e,"my")||this.props.my||u.my,p=this.getTargetOption(e,"at")||this.props.at||u.at;this.containerEl.style.padding="0px",Je.flipfitCollision(this.containerEl,e,c,p,(function(e){var t=e.at,r=t.x,o=t.y,i=e.my.x,a=n.props.at?"center"!==r&&r!==i?r:o:e.at["".concat(u.axis)];n.containerEl.style.padding="",n.setState({position:a},(function(){n.updateContainerPosition(),Je.addClass(n.containerEl,"p-tooltip-active")}))}))}}},{key:"updateContainerPosition",value:function(){if(this.containerEl){var e=getComputedStyle(this.containerEl);"left"===this.state.position?this.containerEl.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===this.state.position&&(this.containerEl.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}}},{key:"onMouseEnter",value:function(){this.isAutoHide()||(this.allowHide=!1)}},{key:"onMouseLeave",value:function(e){this.isAutoHide()||(this.allowHide=!0,this.hide(e))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener=function(t){Je.isAndroid()||e.hide(t)},window.addEventListener("resize",this.documentResizeListener)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Qe(this.currentTarget,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindTargetEvent",value:function(e){if(e){var t=this.getEvents(e),n=t.showEvent,r=t.hideEvent;e.addEventListener(n,this.show),e.addEventListener(r,this.hide)}}},{key:"unbindTargetEvent",value:function(e){if(e){var t=this.getEvents(e),n=t.showEvent,r=t.hideEvent;e.removeEventListener(n,this.show),e.removeEventListener(r,this.hide)}}},{key:"applyDelay",value:function(e,t){this.clearTimeouts();var n=this.getTargetOption(this.currentTarget,e.toLowerCase())||this.props[e];n?this["".concat(e,"Timeout")]=setTimeout((function(){return t()}),n):t()}},{key:"sendCallback",value:function(e){if(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n{},sn=e=>"number"==typeof e&&Number.isFinite(e),ln=Array.isArray,un=e=>"object"==typeof e&&!!e&&!ln(e),cn=e=>"function"==typeof e,pn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fn=e=>`__duo-toolbox__-${e}`,dn=fn("global_variables"),hn=(e,t,n)=>{const r=t(((e,t)=>(un(window[dn])||(window[dn]={}),pn(window[dn],e)?window[dn][e]:t))(e,n));return((e,t)=>{un(window[dn])||(window[dn]={}),window[dn][e]=t})(e,r),r},yn=fn("original_function"),mn=fn("override_version"),vn=(e,t,n,r=1)=>((e,t,n,r,o=1)=>{pn(window,e)&&t(window[e])?n(window[e]):hn("pending_global_listeners",((i={})=>{var a;if(!i[e]){i[e]={};let n=window[e];Object.defineProperty(window,e,{get:()=>n,set:r=>{t(r)?(Object.defineProperty(window,e,{value:r,configurable:!0,enumerable:!0,writable:!0}),Object.values(i[e]).forEach((e=>e.callback(r)))):n=r},configurable:!0})}return o>(Number(null===(a=i[e][r])||void 0===a?void 0:a.version)||0)&&(i[e][r]={callback:n,version:o}),i}))})(e,cn,(e=>((e,t,n,r=1)=>{var o;if(un(e)&&r>(Number(null===(o=e[t])||void 0===o?void 0:o[mn])||0)){var i;const o=(null===(i=e[t])||void 0===i?void 0:i[yn])||e[t]||an;e[t]=n(o),e[t][yn]=o,e[t][mn]=r}})(null==e?void 0:e.prototype,t,n,r)),`instance_method:${t}`,r),_n=fn("logging_iframe"),gn=()=>(()=>{let e=document.getElementById(_n);return e&&e.isConnected||(e=document.createElement("iframe"),e.id=_n,e.style.display="none",document.body.appendChild(e)),e})().contentWindow.console,bn=(...e)=>gn().error(...e),En=fn("action_request"),On=async(e,t)=>wn({type:En,action:e,value:t}).then((t=>{if("success"===(null==t?void 0:t.type))return t.value||null;throw new Error((null==t?void 0:t.error)||`An error occurred while processing a "${e}" action.`)})),wn=async e=>new Promise(((t,n)=>{if("undefined"==typeof chrome)return browser.runtime.sendMessage(e);chrome.runtime.sendMessage(e,(e=>{chrome.runtime.lastError?n(chrome.runtime.lastError):t(e)}))}));var Cn=le((function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[o]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof se&&se&&se.Object===Object&&se,p="object"==typeof self&&self&&self.Object===Object&&self,f=c||p||Function("return this")(),d=t&&!t.nodeType&&t,h=d&&e&&!e.nodeType&&e,y=h&&h.exports===d,m=y&&c.process,v=function(){try{var e=h&&h.require&&h.require("util").types;return e||m&&m.binding&&m.binding("util")}catch(e){}}(),_=v&&v.isTypedArray;function g(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var b,E,O,w=Array.prototype,C=Function.prototype,k=Object.prototype,x=f["__core-js_shared__"],S=C.toString,T=k.hasOwnProperty,N=(b=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",R=k.toString,P=S.call(Object),A=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=y?f.Buffer:void 0,j=f.Symbol,I=f.Uint8Array,D=L?L.allocUnsafe:void 0,H=(E=Object.getPrototypeOf,O=Object,function(e){return E(O(e))}),M=Object.create,F=k.propertyIsEnumerable,U=w.splice,W=j?j.toStringTag:void 0,B=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),V=L?L.isBuffer:void 0,K=Math.max,z=Date.now,$=ye(f,"Map"),Y=ye(Object,"create"),G=function(){function e(){}return function(t){if(!Se(t))return{};if(M)return M(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},q.prototype.set=function(e,t){var n=this.__data__,r=ne(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Z.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new($||q),string:new X}},Z.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},Z.prototype.get=function(e){return he(this,e).get(e)},Z.prototype.has=function(e){return he(this,e).has(e)},Z.prototype.set=function(e,t){var n=he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},J.prototype.clear=function(){this.__data__=new q,this.size=0},J.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var n=this.__data__;if(n instanceof q){var r=n.__data__;if(!$||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Z(r)}return n.set(e,t),this.size=n.size,this};var oe,ie=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[oe?a:++r];if(!1===t(o[s],s,o))break}return e};function ae(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W in Object(e)?function(e){var t=T.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(e){}var o=R.call(e);r&&(t?e[W]=n:delete e[W]);return o}(e):function(e){return R.call(e)}(e)}function le(e){return Te(e)&&ae(e)==o}function ue(e){return!(!Se(e)||function(e){return!!N&&N in e}(e))&&(ke(e)?A:s).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ce(e){if(!Se(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ve(e),n=[];for(var r in e)("constructor"!=r||!t&&T.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&ie(t,(function(i,s){if(o||(o=new J),Se(i))!function(e,t,n,r,o,i,s){var l=_e(e,n),u=_e(t,n),c=s.get(u);if(c)return void ee(e,n,c);var p=i?i(l,u,n+"",e,t,s):void 0,f=void 0===p;if(f){var d=Oe(u),h=!d&&Ce(u),y=!d&&!h&&Ne(u);p=u,d||h||y?Oe(l)?p=l:!function(e){return Te(e)&&we(e)}(l)?h?(f=!1,p=function(e,t){if(t)return e.slice();var n=e.length,r=D?D(n):new e.constructor(n);return e.copy(r),r}(u,!0)):y?(f=!1,m=u,v=!0?(_=m.buffer,g=new _.constructor(_.byteLength),new I(g).set(new I(_)),g):m.buffer,p=new m.constructor(v,m.byteOffset,m.length)):p=[]:p=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(de);function be(e,t){return e===t||e!=e&&t!=t}var Ee=le(function(){return arguments}())?le:function(e){return Te(e)&&T.call(e,"callee")&&!F.call(e,"callee")},Oe=Array.isArray;function we(e){return null!=e&&xe(e.length)&&!ke(e)}var Ce=V||function(){return!1};function ke(e){if(!Se(e))return!1;var t=ae(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Se(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Ne=_?function(e){return function(t){return e(t)}}(_):function(e){return Te(e)&&xe(e.length)&&!!u[ae(e)]};function Re(e){return we(e)?Q(e,!0):ce(e)}var Pe,Ae=(Pe=function(e,t,n){pe(e,t,n)},fe((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Pe.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Se(n))return!1;var r=typeof t;return!!("number"==r?we(n)&&me(t,n.length):"string"==r&&t in n)&&be(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++nun(e)&&!!e[In],Hn=e=>e.value,Mn=e=>({[In]:!0,value:e}),Fn=(e,t)=>Ln===e&&sn(t)||jn===e&&t>=0&&t<=1,Un=(e,t)=>((e,t,n,r=1)=>{if(!un(e))return;const o=fn(`${t}_override_version`);r>(Number(e[o])||0)&&Object.defineProperty(e,t,n(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,t,(t=>({...t,set:function(n){const r=Vn[e];sn(n)?(this[r.originalValueKey]=n,pn(this,r.valueKey)&&(n=this[r.isRelativeKey]?Gn(e,n*this[r.valueKey]):this[r.valueKey])):Dn(n)&&(n=Hn(n)),sn(n)&&(this[r.listenerValueKey]=n),t.set.call(this,n)}}))),Wn=(e,t)=>vn("Howl",t,(n=>function(){const r=this,o=arguments,i=Vn[e];let a=!1;const s=r._queue.length;(1===o.length||2===o.length&&void 0===o[1])&&-1===r._getSoundIds().indexOf(o[0])&&(Dn(o[0])?(a=!0,o[0]=Hn(o[0])):Fn(e,o[0])&&(r[i.originalValueKey]=o[0],pn(r,i.valueKey)&&(a=!0,r[i.isRelativeKey]?o[0]=Gn(e,o[0]*r[i.valueKey]):o[0]=r[i.valueKey])),a&&(r[i.listenerValueKey]=o[0]));const l=n.apply(r,arguments);return a&&s({...r,functions:{audio:{applyOverride:()=>Un(e,n),getter:e=>e[t],setter:(e,n)=>e[t]=n,hasQueuedUpdate:()=>!1},howler:{applyOverride:()=>Wn(e,n),getter:e=>e[n](),setter:(e,t)=>e[n](t),hasQueuedUpdate:e=>e._queue.find((e=>e.event===n))}},priorityKey:fn(`${e}_priority`),isRelativeKey:fn(`${e}_is_relative`),valueKey:fn(`forced_${e}_value`),originalValueKey:fn(`original_${e}_value`),listenerValueKey:fn(`${e}_value`)}),Vn={[Ln]:Bn(Ln,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[jn]:Bn(jn,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},Kn=e=>{const t=Vn[e];if(!t)throw new Error(`Unknown sound setting: "${e}".`);return t},zn=e=>Kn(e).minValue,$n=e=>Kn(e).maxValue,Yn=e=>Kn(e).defaultValue,Gn=(e,t)=>Vn[e]?Math.max(Vn[e].minValue,Math.min(t,Vn[e].maxValue)):t,Xn="story",qn="forum_discussion",Zn="dictionary",Jn="unknown",Qn="listening_challenge",er="other_challenge",tr=[Qn,er,Xn,qn,Zn,Jn],nr="default",rr="main",or=[jn,Ln],ir=e=>jn===e,ar=(e,t=null,n=null)=>({[kn]:{[Rn]:t},[xn]:{[Rn]:t,[Pn]:t},[Sn]:{[Rn]:t,[Pn]:t},[Tn]:{[Rn]:t},...ir(e)?{[rr]:n}:{}}),sr=(e,t)=>Object.fromEntries([[nr,ar(e,{value:t,isRelative:!0},{value:t})],...tr.map((t=>[t,ar(e)]))]),lr=Object.fromEntries(or.map((e=>[e,sr(e,Yn(e))]))),ur=(e,t)=>un(lr.volume.default[e][t]),cr=(e,t,n,r=!0)=>{var o,i;if(!ir(t))return;const a=null==e||null===(o=e[t])||void 0===o||null===(i=o[null!=n?n:nr])||void 0===i?void 0:i.main;return un(a)?a:null===n?Yn(t):r?cr(e,t,null):null},pr=(e,t,n,r,o,i=!0)=>{var a,s,l;if(!ur(n,r))return;const u=null==e||null===(a=e[t])||void 0===a||null===(s=a[null!=o?o:nr])||void 0===s||null===(l=s[n])||void 0===l?void 0:l[r];return un(u)?u:null===o?Yn(t):i?pr(e,t,n,r,null):null},fr=(e,t)=>{if(!(e=>or.includes(e.setting)&&pn(e,"value")&&(!e.context||tr.includes(e.context)))(t))return e;const{setting:n,context:r,value:o,soundType:i=null,soundSpeed:a=null}=t;return i&&a?((e,t,n,r,o,i)=>ur(n,r)?Cn({},e,{[t]:{[null!=o?o:nr]:{[n]:{[r]:i}}}}):e)(e,n,i,a,r,o):((e,t,n,r)=>ir(t)?Cn({},e,{[t]:{[null!=n?n:nr]:{[rr]:r}}}):e)(e,n,r,o)};var dr=function(){},hr="undefined"!=typeof window;function yr(e,t,n){void 0===t&&(t=0),void 0===n&&(n=[]);var r=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=!0);var r=Z(!1),o=Z(),i=Z(e),a=Q((function(){return r.current}),[]),s=Q((function(){r.current=!1,o.current&&clearTimeout(o.current),o.current=setTimeout((function(){r.current=!0,i.current()}),t)}),[t]),l=Q((function(){r.current=null,o.current&&clearTimeout(o.current)}),[]);return X((function(){i.current=e}),[e]),X((function(){return n&&s(),l}),[t,n]),[a,l,s]}(e,t),o=r[0],i=r[1];return X(r[2],n),[o,i]}var mr=function(e,t,n){if(!hr)return[t,dr,dr];if(!e)throw new Error("useLocalStorage key may not be falsy");var r=n?n.raw?function(e){return e}:n.deserializer:JSON.parse,o=Z((function(e){try{var o=n?n.raw?String:n.serializer:JSON.stringify,i=localStorage.getItem(e);return null!==i?r(i):(t&&localStorage.setItem(e,o(t)),t)}catch(e){return t}})),i=Y((function(){return o.current(e)})),a=i[0],s=i[1];q((function(){return s(o.current(e))}),[e]);var l=Q((function(t){try{var o="function"==typeof t?t(a):t;if(void 0===o)return;var i=void 0;i=n?n.raw?"string"==typeof o?o:JSON.stringify(o):n.serializer?n.serializer(o):JSON.stringify(o):JSON.stringify(o),localStorage.setItem(e,i),s(r(i))}catch(e){}}),[e,s]),u=Q((function(){try{localStorage.removeItem(e),s(void 0)}catch(e){}}),[e,s]);return[a,l,u]},vr=le((function(e){ +!function(){"use strict";var e,t,n,r,o,i,a,l,s={},u=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(e,t){for(var n in t)e[n]=t[n];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function d(t,n,r){var o,i,a,l={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===l[a]&&(l[a]=t.defaultProps[a]);return h(t,l,o,i,null)}function h(e,r,o,i,a){var l={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null!=t.vnode&&t.vnode(l),l}function m(e){return e.children}function y(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?h(_.type,_.props,_.key,null,_.__v):_)){if(_.__=n,_.__b=n.__b+1,null===(y=C[f])||y&&_.key==y.key&&_.type===y.type)C[f]=void 0;else for(d=0;d2&&(l.children=arguments.length>3?e.call(arguments,2):r),h(t.type,l,o||t.key,i||t.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(g)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n},get options(){return t}}),F=0,U=[],W=t.__b,B=t.__r,V=t.diffed,K=t.__c,z=t.unmount;function $(e,n){t.__h&&t.__h(D,e,F||n),F=0;var r=D.__H||(D.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Y(e){return F=1,G(ie,e)}function G(e,t,n){var r=$(I++,2);return r.t=e,r.__c||(r.__=[n?n(t):ie(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=D),r.__}function X(e,n){var r=$(I++,3);!t.__s&&oe(r.__H,n)&&(r.__=e,r.__H=n,D.__H.__h.push(r))}function q(e,n){var r=$(I++,4);!t.__s&&oe(r.__H,n)&&(r.__=e,r.__H=n,D.__h.push(r))}function Z(e){return F=5,J((function(){return{current:e}}),[])}function J(e,t){var n=$(I++,7);return oe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Q(e,t){return F=8,J((function(){return e}),t)}function ee(){U.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(ne),e.__H.__h.forEach(re),e.__H.__h=[]}catch(n){e.__H.__h=[],t.__e(n,e.__v)}})),U=[]}t.__b=function(e){D=null,W&&W(e)},t.__r=function(e){B&&B(e),I=0;var t=(D=e.__c).__H;t&&(t.__h.forEach(ne),t.__h.forEach(re),t.__h=[])},t.diffed=function(e){V&&V(e);var n=e.__c;n&&n.__H&&n.__H.__h.length&&(1!==U.push(n)&&H===t.requestAnimationFrame||((H=t.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),te&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);te&&(t=requestAnimationFrame(n))})(ee)),D=void 0},t.__c=function(e,n){n.some((function(e){try{e.__h.forEach(ne),e.__h=e.__h.filter((function(e){return!e.__||re(e)}))}catch(r){n.some((function(e){e.__h&&(e.__h=[])})),n=[],t.__e(r,e.__v)}})),K&&K(e,n)},t.unmount=function(e){z&&z(e);var n=e.__c;if(n&&n.__H)try{n.__H.__.forEach(ne)}catch(e){t.__e(e,n.__v)}};var te="function"==typeof requestAnimationFrame;function ne(e){var t=D;"function"==typeof e.__c&&e.__c(),D=t}function re(e){var t=D;e.__c=e.__(),D=t}function oe(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ie(e,t){return"function"==typeof t?t(e):t}var ae=Object.freeze({__proto__:null,useState:Y,useReducer:G,useEffect:X,useLayoutEffect:q,useRef:Z,useImperativeHandle:function(e,t,n){F=6,q((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:J,useCallback:Q,useContext:function(e){var t=D.context[e.__c],n=$(I++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(D)),t.props.value):e.__},useDebugValue:function(e,n){t.useDebugValue&&t.useDebugValue(n?n(e):e)},useErrorBoundary:function(e){var t=$(I++,10),n=Y();return t.__=e,D.componentDidCatch||(D.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}}),le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function se(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}function ue(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}var ce=ue(ae),pe=ue(M),fe=se((function(e,t){var n=ce,r=pe;function o(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function a(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:i(this.props,e)}function o(t){return this.shouldComponentUpdate=n,r.createElement(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(a.prototype=new r.Component).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)};var s=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),s&&s(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function c(e){function t(t,n){var r=o({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:r.toChildArray(r.toChildArray(e).map(t))},f={map:p,forEach:p,count:function(e){return e?r.toChildArray(e).length:0},only:function(e){var t=r.toChildArray(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},d=r.options.__e;r.options.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);d(e,t,n)};var h=r.options.unmount;function m(){this.__u=0,this.t=null,this.__b=null}function y(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function v(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return r.createElement(n,i)}return i.displayName="Lazy",i.__f=!0,i}function _(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),h&&h(e)},(m.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=y(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},s=!0===t.__h;r.__u++||s||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},m.prototype.componentWillUnmount=function(){this.t=[]},m.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=o({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,i.__O=i.__P)}this.__b=null}var a=t.__e&&r.createElement(r.Fragment,null,e.fallback);return a&&(a.__h=null),[r.createElement(r.Fragment,null,t.__e?null:e.children),a]};var g=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),r.render(r.createElement(b,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function O(e,t){return r.createElement(E,{__v:e,i:t})}(_.prototype=new r.Component).__e=function(e){var t=this,n=y(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),g(t,e,r)):o()};n?n(i):i()}},_.prototype.render=function(e){this.u=null,this.o=new Map;var t=r.toChildArray(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},_.prototype.componentDidUpdate=_.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){g(e,n,t)}))};var w="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,C=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,k=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function x(e,t,n){return null==t.__k&&(t.textContent=""),r.render(e,t),"function"==typeof n&&n(),e?e.__c:null}function S(e,t,n){return r.hydrate(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var T=r.options.event;function N(){}function R(){return this.cancelBubble}function P(){return this.defaultPrevented}r.options.event=function(e){return T&&(e=T(e)),e.persist=N,e.isPropagationStopped=R,e.isDefaultPrevented=P,e.nativeEvent=e};var A,L={configurable:!0,get:function(){return this.class}},j=r.options.vnode;r.options.vnode=function(e){var t=e.type,n=e.props,o=n;if("string"==typeof t){for(var i in o={},n){var a=n[i];"value"===i&&"defaultValue"in n&&null==a||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===a?a="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!k(n.type)?i="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():C.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),o[i]=a)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=r.toChildArray(n.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=r.toChildArray(n.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o}t&&n.class!=n.className&&(L.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",L)),e.$$typeof=w,j&&j(e)};var I=r.options.__r;r.options.__r=function(e){I&&I(e),A=e.__c};var D={ReactCurrentDispatcher:{current:{readContext:function(e){return A.__n[e.__c].props.value}}}};function H(e){return r.createElement.bind(null,e)}function M(e){return!!e&&e.$$typeof===w}function F(e){return M(e)?r.cloneElement.apply(null,arguments):e}function U(e){return!!e.__k&&(r.render(null,e),!0)}function W(e){return e&&(e.base||1===e.nodeType&&e)||null}var B=function(e,t){return e(t)},V=function(e,t){return e(t)},K=r.Fragment,z={useState:n.useState,useReducer:n.useReducer,useEffect:n.useEffect,useLayoutEffect:n.useLayoutEffect,useRef:n.useRef,useImperativeHandle:n.useImperativeHandle,useMemo:n.useMemo,useCallback:n.useCallback,useContext:n.useContext,useDebugValue:n.useDebugValue,version:"17.0.2",Children:f,render:x,hydrate:S,unmountComponentAtNode:U,createPortal:O,createElement:r.createElement,createContext:r.createContext,createFactory:H,cloneElement:F,createRef:r.createRef,Fragment:r.Fragment,isValidElement:M,findDOMNode:W,Component:r.Component,PureComponent:a,memo:l,forwardRef:c,flushSync:V,unstable_batchedUpdates:B,StrictMode:K,Suspense:m,SuspenseList:_,lazy:v,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:D};Object.keys(n).forEach((function(e){t[e]=n[e]})),t.createElement=r.createElement,t.createContext=r.createContext,t.createRef=r.createRef,t.Fragment=r.Fragment,t.Component=r.Component,t.version="17.0.2",t.Children=f,t.render=x,t.hydrate=S,t.unmountComponentAtNode=U,t.createPortal=O,t.createFactory=H,t.cloneElement=F,t.isValidElement=M,t.findDOMNode=W,t.PureComponent=a,t.memo=l,t.forwardRef=c,t.flushSync=V,t.unstable_batchedUpdates=B,t.StrictMode=K,t.Suspense=m,t.SuspenseList=_,t.lazy=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.default=z}));function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var he=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};de(he,"ripple",!1),de(he,"locale","en"),de(he,"autoZIndex",!0),de(he,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),de(he,"appendTo",null);var me=Object.freeze({ALIGN_CENTER:"pi pi-align-center",ALIGN_JUSTIFY:"pi pi-align-justify",ALIGN_LEFT:"pi pi-align-left",ALIGN_RIGHT:"pi pi-align-right",AMAZON:"pi pi-amazon",ANDROID:"pi pi-android",ANGLE_DOUBLE_DOWN:"pi pi-angle-double-down",ANGLE_DOUBLE_LEFT:"pi pi-angle-double-left",ANGLE_DOUBLE_RIGHT:"pi pi-angle-double-right",ANGLE_DOUBLE_UP:"pi pi-angle-double-up",ANGLE_DOWN:"pi pi-angle-down",ANGLE_LEFT:"pi pi-angle-left",ANGLE_RIGHT:"pi pi-angle-right",ANGLE_UP:"pi pi-angle-up",APPLE:"pi pi-apple",ARROW_CIRCLE_DOWN:"pi pi-arrow-circle-down",ARROW_CIRCLE_LEFT:"pi pi-arrow-circle-left",ARROW_CIRCLE_RIGHT:"pi pi-arrow-circle-right",ARROW_CIRCLE_UP:"pi pi-arrow-circle-up",ARROW_DOWN:"pi pi-arrow-down",ARROW_LEFT:"pi pi-arrow-left",ARROW_RIGHT:"pi pi-arrow-right",ARROW_UP:"pi pi-arrow-up",BACKWARD:"pi pi-backward",BAN:"pi pi-ban",BARS:"pi pi-bars",BELL:"pi pi-bell",BOOK:"pi pi-book",BOOKMARK:"pi pi-bookmark",BRIEFCASE:"pi pi-briefcase",CALENDAR_MINUS:"pi pi-calendar-minus",CALENDAR_PLUS:"pi pi-calendar-plus",CALENDAR_TIMES:"pi pi-calendar-times",CALENDAR:"pi pi-calendar",CAMERA:"pi pi-camera",CARET_DOWN:"pi pi-caret-down",CARET_LEFT:"pi pi-caret-left",CARET_RIGHT:"pi pi-caret-right",CARET_UP:"pi pi-caret-up",CHART_BAR:"pi pi-chart-bar",CHART_LINE:"pi pi-chart-line",CHECK_CIRCLE:"pi pi-check-circle",CHECK_SQUARE:"pi pi-check-square",CHECK:"pi pi-check",CHEVRON_CIRCLE_DOWN:"pi pi-chevron-circle-down",CHEVRON_CIRCLE_LEFT:"pi pi-chevron-circle-left",CHEVRON_CIRCLE_RIGHT:"pi pi-chevron-circle-right",CHEVRON_CIRCLE_UP:"pi pi-chevron-circle-up",CHEVRON_DOWN:"pi pi-chevron-down",CHEVRON_LEFT:"pi pi-chevron-left",CHEVRON_RIGHT:"pi pi-chevron-right",CHEVRON_UP:"pi pi-chevron-up",CLOCK:"pi pi-clock",CLONE:"pi pi-clone",CLOUD_DOWNLOAD:"pi pi-cloud-download",CLOUD_UPLOAD:"pi pi-cloud-upload",CLOUD:"pi pi-cloud",COG:"pi pi-cog",COMMENT:"pi pi-comment",COMMENTS:"pi pi-comments",COMPASS:"pi pi-compass",COPY:"pi pi-copy",CREDIT_CARD:"pi pi-credit-card",DESKTOP:"pi pi-desktop",DISCORD:"pi pi-discord",DIRECTIONS_ALT:"pi pi-directions-alt",DIRECTIONS:"pi pi-directions",DOLLAR:"pi pi-dollar",DOWNLOAD:"pi pi-download",EJECT:"pi pi-eject",ELLIPSIS_H:"pi pi-ellipsis-h",ELLIPSIS_V:"pi pi-ellipsis-v",ENVELOPE:"pi pi-envelope",EXCLAMATION_CIRCLE:"pi pi-exclamation-circle",EXCLAMATION_TRIANGLE:"pi pi-exclamation-triangle ",EXTERNAL_LINK:"pi pi-external-link",EYE_SLASH:"pi pi-eye-slash",EYE:"pi pi-eye",FACEBOOK:"pi pi-facebook",FAST_BACKWARD:"pi pi-fast-backward",FAST_FORWARD:"pi pi-fast-forward",FILE_EXCEL:"pi pi-file-excel",FILE_O:"pi pi-file-o",FILE_PDF:"pi pi-file-pdf",FILE:"pi pi-file",FILTER:"pi pi-filter",FILTER_SLASH:"pi pi-filter-slash",FLAG:"pi pi-flag",FOLDER_OPEN:"pi pi-folder-open",FOLDER:"pi pi-folder",FORWARD:"pi pi-forward",GITHUB:"pi pi-github",GLOBE:"pi pi-globe",GOOGLE:"pi pi-google",HEART:"pi pi-heart",HOME:"pi pi-home",ID_CARD:"pi pi-id-card",IMAGE:"pi pi-image",IMAGES:"pi pi-images",INBOX:"pi pi-inbox",INFO_CIRCLE:"pi pi-info-circle",INFO:"pi pi-info",KEY:"pi pi-key",LINK:"pi pi-link",LIST:"pi pi-list",LOCK_OPEN:"pi pi-lock-open",LOCK:"pi pi-lock",MAP:"pi pi-map",MAP_MARKER:"pi pi-map-marker",MICROSOFT:"pi pi-microsoft",MINUS_CIRCLE:"pi pi-minus-circle",MINUS:"pi pi-minus",MOBILE:"pi pi-mobile",MONEY_BILL:"pi pi-money-bill",MOON:"pi pi-moon",PALETTE:"pi pi-palette",PAPERCLIP:"pi pi-paperclip",PAUSE:"pi pi-pause",PAYPAL:"pi pi-paypal",PENCIL:"pi pi-pencil",PERCENTAGE:"pi pi-percentage",PHONE:"pi pi-phone",PLAY:"pi pi-play",PLUS_CIRCLE:"pi pi-plus-circle",PLUS:"pi pi-plus",POWER_OFF:"pi pi-power-off",PRINT:"pi pi-print",QUESTION_CIRCLE:"pi pi-question-circle",QUESTION:"pi pi-question",RADIO_OFF:"pi pi-radio-off",RADIO_ON:"pi pi-radio-on",REFRESH:"pi pi-refresh",REPLAY:"pi pi-replay",REPLY:"pi pi-reply",SAVE:"pi pi-save",SEARCH_MINUS:"pi pi-search-minus",SEARCH_PLUS:"pi pi-search-plus",SEARCH:"pi pi-search",SEND:"pi pi-send",SHARE_ALT:"pi pi-share-alt",SHIELD:"pi pi-shield",SHOPPING_CART:"pi pi-shopping-cart",SIGN_IN:"pi pi-sign-in",SIGN_OUT:"pi pi-sign-out",SITEMAP:"pi pi-sitemap",SLACK:"pi pi-slack",SLIDERS_H:"pi pi-sliders-h",SLIDERS_V:"pi pi-sliders-v",SORT_ALPHA_ALT_DOWN:"pi pi-sort-alpha-alt-down",SORT_ALPHA_ALT_UP:"pi pi-sort-alpha-alt-up",SORT_ALPHA_DOWN:"pi pi-sort-alpha-down",SORT_ALPHA_UP:"pi pi-sort-alpha-up",SORT_ALT:"pi pi-sort-alt",SORT_AMOUNT_DOWN_ALT:"pi pi-sort-amount-down-alt",SORT_AMOUNT_DOWN:"pi pi-sort-amount-down",SORT_AMOUNT_UP_ALT:"pi pi-sort-amount-up-alt",SORT_AMOUNT_UP:"pi pi-sort-amount-up",SORT_DOWN:"pi pi-sort-down",SORT_NUMERIC_ALT_DOWN:"pi pi-sort-numeric-alt-down",SORT_NUMERIC_ALT_UP:"pi pi-sort-numeric-alt-up",SORT_NUMERIC_DOWN:"pi pi-sort-numeric-down",SORT_NUMERIC_UP:"pi pi-sort-numeric-up",SORT_UP:"pi pi-sort-up",SORT:"pi pi-sort",SPINNER:"pi pi-spinner",STAR_O:"pi pi-star-o",STAR:"pi pi-star",STEP_BACKWARD_ALT:"pi pi-step-backward-alt",STEP_BACKWARD:"pi pi-step-backward",STEP_FORWARD_ALT:"pi pi-step-forward-alt",STEP_FORWARD:"pi pi-step-forward",SUN:"pi pi-sun",TABLE:"pi pi-table",TABLET:"pi pi-tablet",TAG:"pi pi-tag",TAGS:"pi pi-tags",TH_LARGE:"pi pi-th-large",THUMBS_DOWN:"pi pi-thumbs-down",THUMBS_UP:"pi pi-thumbs-up",TICKET:"pi pi-ticket",TIMES_CIRCLE:"pi pi-times-circle",TIMES:"pi pi-times",TRASH:"pi pi-trash",TWITTER:"pi pi-twitter",UNDO:"pi pi-undo",UNLOCK:"pi pi-unlock",UPLOAD:"pi pi-upload",USER_EDIT:"pi pi-user-edit",USER_MINUS:"pi pi-user-minus",USER_PLUS:"pi pi-user-plus",USER:"pi pi-user",USERS:"pi pi-users",VIDEO:"pi pi-video",VIMEO:"pi pi-vimeo",VOLUME_DOWN:"pi pi-volume-down",VOLUME_OFF:"pi pi-volume-off",VOLUME_UP:"pi pi-volume-up",YOUTUBE:"pi pi-youtube",WALLET:"pi pi-wallet",WIFI:"pi pi-wifi",WINDOW_MAXIMIZE:"pi pi-window-maximize",WINDOW_MINIMIZE:"pi pi-window-minimize"});function ye(){return ye=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function _e(e,t){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(e,t)}function ge(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_e(e,t)}Object.freeze({SUCCESS:"success",INFO:"info",WARN:"warn",ERROR:"error"});function be(){}function Ee(){}Ee.resetWarningCache=be;function Oe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}se((function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ee,resetWarningCache:be};return n.PropTypes=n,n}()}));var we=!1,Ce=fe.createContext(null),ke="unmounted",xe="exited",Se="entering",Te="entered",Ne="exiting",Re=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=xe,r.appearStatus=Se):o=Te:o=t.unmountOnExit||t.mountOnEnter?ke:xe,r.state={status:o},r.nextCallback=null,r}ge(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ke?{status:xe}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Se&&n!==Te&&(t=Se):n!==Se&&n!==Te||(t=Ne)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===Se?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===xe&&this.setState({status:ke})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[fe.findDOMNode(this),r],i=o[0],a=o[1],l=this.getTimeouts(),s=r?l.appear:l.enter;!e&&!n||we?this.safeSetState({status:Te},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Se},(function(){t.props.onEntering(i,a),t.onTransitionEnd(s,(function(){t.safeSetState({status:Te},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:fe.findDOMNode(this);t&&!we?(this.props.onExit(r),this.safeSetState({status:Ne},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:xe},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:xe},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:fe.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ke)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=ve(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return fe.createElement(Ce.Provider,{value:null},"function"==typeof n?n(e,r):fe.cloneElement(fe.Children.only(n),r))},t}(fe.Component);function Pe(){}Re.contextType=Ce,Re.propTypes={},Re.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Pe,onEntering:Pe,onEntered:Pe,onExit:Pe,onExiting:Pe,onExited:Pe},Re.UNMOUNTED=ke,Re.EXITED=xe,Re.ENTERING=Se,Re.ENTERED=Te,Re.EXITING=Ne;var Ae=Re,Le=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},je=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Oe(n.className,r):n.setAttribute("class",Oe(n.className&&n.className.baseVal||"",r)));var n,r}))},Ie=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nf.height?((n=u.top+c-i)<0&&(n=c),e.style.transformOrigin="bottom"):(n=l+u.top+c,e.style.transformOrigin="top"),r=u.left+s+a>f.width?Math.max(0,u.left+p+s-a):u.left+p,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"relativePosition",value:function(e,t){if(e){var n,r,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=t.offsetHeight,a=t.getBoundingClientRect(),l=this.getViewport();a.top+i+o.height>l.height?(n=-1*o.height,a.top+n<0&&(n=-1*a.top),e.style.transformOrigin="bottom"):(n=i,e.style.transformOrigin="top"),r=o.width>l.width?-1*a.left:a.left+o.width>l.width?-1*(a.left+o.width-l.width):0,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"flipfitCollision",value:function(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",a=arguments.length>4?arguments[4]:void 0,l=n.getBoundingClientRect(),s=this.getViewport(),u=o.split(" "),c=i.split(" "),p=function(e,t){return t?+e.substring(e.search(/(\+|-)/g))||0:e.substring(0,e.search(/(\+|-)/g))||e},f={my:{x:p(u[0]),y:p(u[1]||u[0]),offsetX:p(u[0],!0),offsetY:p(u[1]||u[0],!0)},at:{x:p(c[0]),y:p(c[1]||c[0]),offsetX:p(c[0],!0),offsetY:p(c[1]||c[0],!0)}},d={left:function(){return f.my.offsetX+f.at.offsetX+l.left+("left"===f.my.x?0:-1*("center"===f.my.x?r.getOuterWidth(t)/2:r.getOuterWidth(t)))},top:function(){return f.my.offsetY+f.at.offsetY+l.top+("top"===f.my.y?0:-1*("center"===f.my.y?r.getOuterHeight(t)/2:r.getOuterHeight(t)))}},h={count:{x:0,y:0},left:function(){var n=d.left(),r=e.getWindowScrollLeft();t.style.left=n+r+"px",2===this.count.x?(t.style.left=r+"px",this.count.x=0):n<0&&(this.count.x++,f.my.x="left",f.at.x="right",f.my.offsetX*=-1,f.at.offsetX*=-1,this.right())},right:function(){var r=d.left()+e.getOuterWidth(n),o=e.getWindowScrollLeft();t.style.left=r+o+"px",2===this.count.x?(t.style.left=s.width-e.getOuterWidth(t)+o+"px",this.count.x=0):r+e.getOuterWidth(t)>s.width&&(this.count.x++,f.my.x="right",f.at.x="left",f.my.offsetX*=-1,f.at.offsetX*=-1,this.left())},top:function(){var n=d.top(),r=e.getWindowScrollTop();t.style.top=n+r+"px",2===this.count.y?(t.style.left=r+"px",this.count.y=0):n<0&&(this.count.y++,f.my.y="top",f.at.y="bottom",f.my.offsetY*=-1,f.at.offsetY*=-1,this.bottom())},bottom:function(){var r=d.top()+e.getOuterHeight(n),o=e.getWindowScrollTop();t.style.top=r+o+"px",2===this.count.y?(t.style.left=s.height-e.getOuterHeight(t)+o+"px",this.count.y=0):r+e.getOuterHeight(n)>s.height&&(this.count.y++,f.my.y="bottom",f.at.y="top",f.my.offsetY*=-1,f.at.offsetY*=-1,this.top())},center:function(r){if("y"===r){var o=d.top()+e.getOuterHeight(n)/2;t.style.top=o+e.getWindowScrollTop()+"px",o<0?this.bottom():o+e.getOuterHeight(n)>s.height&&this.top()}else{var i=d.left()+e.getOuterWidth(n)/2;t.style.left=i+e.getWindowScrollLeft()+"px",i<0?this.left():i+e.getOuterWidth(t)>s.width&&this.right()}}};h[f.at.x]("x"),h[f.at.y]("y"),this.isFunction(a)&&a(f)}},{key:"findCollisionPosition",value:function(e){if(e){var t="left"===e?"right":"left";return"top"===e||"bottom"===e?{axis:"y",my:"center ".concat("top"===e?"bottom":"top"),at:"center ".concat(e)}:{axis:"x",my:"".concat(t," center"),at:"".concat(e," center")}}}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t=[];if(e){var n,r=this.getParents(e),o=/(auto|scroll)/,i=function(e){var t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))},a=qe(r);try{for(a.s();!(n=a.n()).done;){var l=n.value,s=1===l.nodeType&&l.dataset.scrollselectors;if(s){var u,c=qe(s.split(","));try{for(c.s();!(u=c.n()).done;){var p=u.value,f=this.findSingle(l,p);f&&i(f)&&t.push(f)}}catch(e){c.e(e)}finally{c.f()}}9!==l.nodeType&&i(l)&&t.push(l)}}catch(e){a.e(e)}finally{a.f()}}return t}},{key:"getHiddenElementOuterHeight",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="",e.style.visibility="",t}return 0}},{key:"getHiddenElementOuterWidth",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="",e.style.visibility="",t}return 0}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="",e.style.visibility=""),t}},{key:"fadeIn",value:function(e,t){if(e){e.style.opacity=0;var n=+new Date,r=0;!function o(){r=+e.style.opacity+((new Date).getTime()-n)/t,e.style.opacity=r,n=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))}()}}},{key:"fadeOut",value:function(e,t){if(e)var n=1,r=50/t,o=setInterval((function(){(n-=r)<=0&&(n=0,clearInterval(o)),e.style.opacity=n}),50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"removeChild",value:function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot remove "+e+" from "+t);t.el.nativeElement.removeChild(e)}}},{key:"isElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":ze(HTMLElement))?e instanceof HTMLElement:e&&"object"===ze(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"scrollInView",value:function(e,t){var n=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=n?parseFloat(n):0,o=getComputedStyle(e).getPropertyValue("paddingTop"),i=o?parseFloat(o):0,a=e.getBoundingClientRect(),l=t.getBoundingClientRect().top+document.body.scrollTop-(a.top+document.body.scrollTop)-r-i,s=e.scrollTop,u=e.clientHeight,c=this.getOuterHeight(t);l<0?e.scrollTop=s+l:l+c>u&&(e.scrollTop=s+l-u+c)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}},{key:"calculateScrollbarWidth",value:function(e){if(e){var t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var n=document.createElement("div");n.className="p-scrollbar-measure",document.body.appendChild(n);var r=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),this.calculatedScrollbarWidth=r,r}},{key:"getBrowser",value:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}},{key:"isVisible",value:function(e){return e&&null!=e.offsetParent}},{key:"getFocusableElements",value:function(t){var n,r=[],o=qe(e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'));try{for(o.s();!(n=o.n()).done;){var i=n.value;"none"!==getComputedStyle(i).display&&"hidden"!==getComputedStyle(i).visibility&&r.push(i)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"getFirstFocusableElement",value:function(t){var n=e.getFocusableElements(t);return n.length>0?n[0]:null}},{key:"getLastFocusableElement",value:function(t){var n=e.getFocusableElements(t);return n.length>0?n[n.length-1]:null}},{key:"getCursorOffset",value:function(e,t,n,r){if(e){var o=getComputedStyle(e),i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.overflow=o.overflow,i.style.width=o.width,i.style.height=o.height,i.style.padding=o.padding,i.style.border=o.border,i.style.overflowWrap=o.overflowWrap,i.style.whiteSpace=o.whiteSpace,i.style.lineHeight=o.lineHeight,i.innerHTML=t.replace(/\r\n|\r|\n/g,"
");var a=document.createElement("span");a.textContent=r,i.appendChild(a);var l=document.createTextNode(n);i.appendChild(l),document.body.appendChild(i);var s=a.offsetLeft,u=a.offsetTop,c=a.clientHeight;return document.body.removeChild(i),{left:Math.abs(s-e.scrollLeft),top:Math.abs(u-e.scrollTop)+c}}return{top:"auto",left:"auto"}}}]),e}(),Qe=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Ye(this,e),this.element=t,this.listener=n}return Xe(e,[{key:"bindScrollListener",value:function(){this.scrollableParents=Je.getScrollableParents(this.element);for(var e=0;e=e.length)for(r=n-e.length;1+r--;)e.push(void 0);e.splice(n,0,e.splice(t,1)[0])}}},{key:"findIndexInList",value:function(e,t,n){var r=this;return t?n?t.findIndex((function(t){return r.equals(t,e,n)})):t.findIndex((function(t){return t===e})):-1}},{key:"getJSXElement",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"isEmpty",value:function(e){return null==e||""===e||Array.isArray(e)&&0===e.length||"object"===ze(e)&&0===Object.keys(e).length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}}]),e}();function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nt=0;function rt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_";return nt++,"".concat(e).concat(nt)}var ot,it,at,lt=(ot=[],it=function(e){return he.zIndex[e]||999},at=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ot||[]).reverse().find((function(t){return!!he.autoZIndex||t.key===e}))||{key:e,value:t}},{get:function(e){return e&&parseInt(e.style.zIndex,10)||0},set:function(e,t,n){t&&(t.style.zIndex=String(function(e,t){t=t||it(e);var n=at(e,t),r=n.value+(n.key===e?0:t)+1;return ot.push({key:e,value:r}),r}(e,n)))},clear:function(e){var t;e&&(t=lt.get(e),ot=ot.filter((function(e){return e.value!==t})),e.style.zIndex="")},getBase:function(e){return it(e)},getCurrent:function(e){return function(e){return at(e).value}(e)}});function st(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ut(e,t){return ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ut(e,t)}function ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ut(e,t)}function pt(e,t){return!t||"object"!==ze(t)&&"function"!=typeof t?st(e):t}function ft(e){return ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ft(e)}function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ft(e);if(t){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}var ht=function(e){ct(n,e);var t=dt(n);function n(e){var r;return Ye(this,n),(r=t.call(this,e)).onMouseDown=r.onMouseDown.bind(st(r)),r}return Xe(n,[{key:"getTarget",value:function(){return this.ink&&this.ink.parentElement}},{key:"bindEvents",value:function(){this.target&&this.target.addEventListener("mousedown",this.onMouseDown)}},{key:"unbindEvents",value:function(){this.target&&this.target.removeEventListener("mousedown",this.onMouseDown)}},{key:"onMouseDown",value:function(e){if(this.ink&&"none"!==getComputedStyle(this.ink,null).display){if(Je.removeClass(this.ink,"p-ink-active"),!Je.getHeight(this.ink)&&!Je.getWidth(this.ink)){var t=Math.max(Je.getOuterWidth(this.target),Je.getOuterHeight(this.target));this.ink.style.height=t+"px",this.ink.style.width=t+"px"}var n=Je.getOffset(this.target),r=e.pageX-n.left+document.body.scrollTop-Je.getWidth(this.ink)/2,o=e.pageY-n.top+document.body.scrollLeft-Je.getHeight(this.ink)/2;this.ink.style.top=o+"px",this.ink.style.left=r+"px",Je.addClass(this.ink,"p-ink-active")}}},{key:"onAnimationEnd",value:function(e){Je.removeClass(e.currentTarget,"p-ink-active")}},{key:"componentDidMount",value:function(){this.ink&&(this.target=this.getTarget(),this.bindEvents())}},{key:"componentDidUpdate",value:function(){this.ink&&!this.target&&(this.target=this.getTarget(),this.bindEvents())}},{key:"componentWillUnmount",value:function(){this.ink&&(this.target=null,this.unbindEvents())}},{key:"render",value:function(){var e=this;return he.ripple&&fe.createElement("span",{ref:function(t){return e.ink=t},className:"p-ink",onAnimationEnd:this.onAnimationEnd})}}]),n}(fe.Component),mt=function(){function e(){Ye(this,e)}return Xe(e,null,[{key:"isNavKeyPress",value:function(t){var n=t.keyCode;return(n=Je.getBrowser().safari&&e.SAFARI_KEYS[n]||n)>=33&&n<=40||n===e.KEYS.RETURN||n===e.KEYS.TAB||n===e.KEYS.ESC}},{key:"isSpecialKey",value:function(e){var t=e.keyCode;return 9===t||13===t||27===t||16===t||17===t||t>=18&&t<=20||Je.getBrowser().opera&&!e.shiftKey&&(8===t||t>=33&&t<=35||t>=36&&t<=39||t>=44&&t<=45)}},{key:"getKey",value:function(t){var n=t.keyCode||t.charCode;return Je.getBrowser().safari&&e.SAFARI_KEYS[n]||n}},{key:"getCharCode",value:function(e){return e.charCode||e.keyCode||e.which}},{key:"onKeyPress",value:function(t,n,r){if(!r){var o=e.DEFAULT_MASKS[n]?e.DEFAULT_MASKS[n]:n,i=Je.getBrowser();if(!t.ctrlKey&&!t.altKey){var a=this.getKey(t);if(!i.mozilla||!(this.isNavKeyPress(t)||a===e.KEYS.BACKSPACE||a===e.KEYS.DELETE&&0===t.charCode)){var l=this.getCharCode(t),s=String.fromCharCode(l);(!i.mozilla||!this.isSpecialKey(t)&&s)&&(o.test(s)||t.preventDefault())}}}}},{key:"validate",value:function(e,t){var n=e.target.value,r=!0;return n&&!t.test(n)&&(r=!1),r}}]),e}();function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ft(e);if(t){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}tt(mt,"DEFAULT_MASKS",{pint:/[\d]/,int:/[\d\-]/,pnum:/[\d\.]/,money:/[\d\.\s,]/,num:/[\d\-\.]/,hex:/[0-9a-f]/i,email:/[a-z0-9_\.\-@]/i,alpha:/[a-z_]/i,alphanum:/[a-z0-9_]/i}),tt(mt,"KEYS",{TAB:9,RETURN:13,ESC:27,BACKSPACE:8,DELETE:46}),tt(mt,"SAFARI_KEYS",{63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35});var vt=function(e){ct(n,e);var t=yt(n);function n(e){var r;return Ye(this,n),(r=t.call(this,e)).state={mounted:e.visible},r}return Xe(n,[{key:"hasDOM",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"componentDidMount",value:function(){this.hasDOM()&&!this.state.mounted&&this.setState({mounted:!0},this.props.onMounted)}},{key:"componentWillUnmount",value:function(){this.props.onUnmounted&&this.props.onUnmounted()}},{key:"render",value:function(){if(this.props.element&&this.state.mounted){var e=this.props.appendTo||he.appendTo||document.body;return"self"===e?this.props.element:fe.createPortal(this.props.element,e)}return null}}]),n}(fe.Component);function _t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ft(e);if(t){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;ti.width?(this.containerEl.style.left="0px",this.containerEl.style.right=window.innerWidth-i.width-r+"px"):(this.containerEl.style.right="",this.containerEl.style.left=r+"px"),this.containerEl.style.top=o+"px",Je.addClass(this.containerEl,"p-tooltip-active")}else{var u=Je.findCollisionPosition(this.state.position),c=this.getTargetOption(e,"my")||this.props.my||u.my,p=this.getTargetOption(e,"at")||this.props.at||u.at;this.containerEl.style.padding="0px",Je.flipfitCollision(this.containerEl,e,c,p,(function(e){var t=e.at,r=t.x,o=t.y,i=e.my.x,a=n.props.at?"center"!==r&&r!==i?r:o:e.at["".concat(u.axis)];n.containerEl.style.padding="",n.setState({position:a},(function(){n.updateContainerPosition(),Je.addClass(n.containerEl,"p-tooltip-active")}))}))}}},{key:"updateContainerPosition",value:function(){if(this.containerEl){var e=getComputedStyle(this.containerEl);"left"===this.state.position?this.containerEl.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===this.state.position&&(this.containerEl.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}}},{key:"onMouseEnter",value:function(){this.isAutoHide()||(this.allowHide=!1)}},{key:"onMouseLeave",value:function(e){this.isAutoHide()||(this.allowHide=!0,this.hide(e))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener=function(t){Je.isAndroid()||e.hide(t)},window.addEventListener("resize",this.documentResizeListener)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Qe(this.currentTarget,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindTargetEvent",value:function(e){if(e){var t=this.getEvents(e),n=t.showEvent,r=t.hideEvent;e.addEventListener(n,this.show),e.addEventListener(r,this.hide)}}},{key:"unbindTargetEvent",value:function(e){if(e){var t=this.getEvents(e),n=t.showEvent,r=t.hideEvent;e.removeEventListener(n,this.show),e.removeEventListener(r,this.hide)}}},{key:"applyDelay",value:function(e,t){this.clearTimeouts();var n=this.getTargetOption(this.currentTarget,e.toLowerCase())||this.props[e];n?this["".concat(e,"Timeout")]=setTimeout((function(){return t()}),n):t()}},{key:"sendCallback",value:function(e){if(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n{},ln=e=>"number"==typeof e&&Number.isFinite(e),sn=Array.isArray,un=e=>"object"==typeof e&&!!e&&!sn(e),cn=e=>"function"==typeof e,pn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fn=e=>`__duo-toolbox__-${e}`,dn=fn("global_variables"),hn=(e,t,n)=>{const r=t(((e,t)=>(un(window[dn])||(window[dn]={}),pn(window[dn],e)?window[dn][e]:t))(e,n));return((e,t)=>{un(window[dn])||(window[dn]={}),window[dn][e]=t})(e,r),r},mn=fn("original_function"),yn=fn("override_version"),vn=(e,t,n,r=1)=>((e,t,n,r,o=1)=>{pn(window,e)&&t(window[e])?n(window[e]):hn("pending_global_listeners",((i={})=>{var a;if(!i[e]){i[e]={};let n=window[e];Object.defineProperty(window,e,{get:()=>n,set:r=>{t(r)?(Object.defineProperty(window,e,{value:r,configurable:!0,enumerable:!0,writable:!0}),Object.values(i[e]).forEach((e=>e.callback(r)))):n=r},configurable:!0})}return o>(Number(null===(a=i[e][r])||void 0===a?void 0:a.version)||0)&&(i[e][r]={callback:n,version:o}),i}))})(e,cn,(e=>((e,t,n,r=1)=>{var o;if(un(e)&&r>(Number(null===(o=e[t])||void 0===o?void 0:o[yn])||0)){var i;const o=(null===(i=e[t])||void 0===i?void 0:i[mn])||e[t]||an;e[t]=n(o),e[t][mn]=o,e[t][yn]=r}})(null==e?void 0:e.prototype,t,n,r)),`instance_method:${t}`,r),_n=fn("logging_iframe"),gn=()=>(()=>{let e=document.getElementById(_n);return e&&e.isConnected||(e=document.createElement("iframe"),e.id=_n,e.style.display="none",document.body.appendChild(e)),e})().contentWindow.console,bn=(...e)=>gn().error(...e),En=fn("action_request"),On=async(e,t)=>wn({type:En,action:e,value:t}).then((t=>{if("success"===(null==t?void 0:t.type))return t.value||null;throw new Error((null==t?void 0:t.error)||`An error occurred while processing a "${e}" action.`)})),wn=async e=>new Promise(((t,n)=>{if("undefined"==typeof chrome)return browser.runtime.sendMessage(e);chrome.runtime.sendMessage(e,(e=>{chrome.runtime.lastError?n(chrome.runtime.lastError):t(e)}))}));var Cn=se((function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",l=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[o]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof le&&le&&le.Object===Object&&le,p="object"==typeof self&&self&&self.Object===Object&&self,f=c||p||Function("return this")(),d=t&&!t.nodeType&&t,h=d&&e&&!e.nodeType&&e,m=h&&h.exports===d,y=m&&c.process,v=function(){try{var e=h&&h.require&&h.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),_=v&&v.isTypedArray;function g(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var b,E,O,w=Array.prototype,C=Function.prototype,k=Object.prototype,x=f["__core-js_shared__"],S=C.toString,T=k.hasOwnProperty,N=(b=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",R=k.toString,P=S.call(Object),A=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?f.Buffer:void 0,j=f.Symbol,I=f.Uint8Array,D=L?L.allocUnsafe:void 0,H=(E=Object.getPrototypeOf,O=Object,function(e){return E(O(e))}),M=Object.create,F=k.propertyIsEnumerable,U=w.splice,W=j?j.toStringTag:void 0,B=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),V=L?L.isBuffer:void 0,K=Math.max,z=Date.now,$=me(f,"Map"),Y=me(Object,"create"),G=function(){function e(){}return function(t){if(!Se(t))return{};if(M)return M(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},q.prototype.set=function(e,t){var n=this.__data__,r=ne(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Z.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new($||q),string:new X}},Z.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},Z.prototype.get=function(e){return he(this,e).get(e)},Z.prototype.has=function(e){return he(this,e).has(e)},Z.prototype.set=function(e,t){var n=he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},J.prototype.clear=function(){this.__data__=new q,this.size=0},J.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var n=this.__data__;if(n instanceof q){var r=n.__data__;if(!$||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Z(r)}return n.set(e,t),this.size=n.size,this};var oe,ie=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var l=i[oe?a:++r];if(!1===t(o[l],l,o))break}return e};function ae(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W in Object(e)?function(e){var t=T.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(e){}var o=R.call(e);r&&(t?e[W]=n:delete e[W]);return o}(e):function(e){return R.call(e)}(e)}function se(e){return Te(e)&&ae(e)==o}function ue(e){return!(!Se(e)||function(e){return!!N&&N in e}(e))&&(ke(e)?A:l).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ce(e){if(!Se(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ve(e),n=[];for(var r in e)("constructor"!=r||!t&&T.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&ie(t,(function(i,l){if(o||(o=new J),Se(i))!function(e,t,n,r,o,i,l){var s=_e(e,n),u=_e(t,n),c=l.get(u);if(c)return void ee(e,n,c);var p=i?i(s,u,n+"",e,t,l):void 0,f=void 0===p;if(f){var d=Oe(u),h=!d&&Ce(u),m=!d&&!h&&Ne(u);p=u,d||h||m?Oe(s)?p=s:!function(e){return Te(e)&&we(e)}(s)?h?(f=!1,p=function(e,t){if(t)return e.slice();var n=e.length,r=D?D(n):new e.constructor(n);return e.copy(r),r}(u,!0)):m?(f=!1,y=u,v=!0?(_=y.buffer,g=new _.constructor(_.byteLength),new I(g).set(new I(_)),g):y.buffer,p=new y.constructor(v,y.byteOffset,y.length)):p=[]:p=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(de);function be(e,t){return e===t||e!=e&&t!=t}var Ee=se(function(){return arguments}())?se:function(e){return Te(e)&&T.call(e,"callee")&&!F.call(e,"callee")},Oe=Array.isArray;function we(e){return null!=e&&xe(e.length)&&!ke(e)}var Ce=V||function(){return!1};function ke(e){if(!Se(e))return!1;var t=ae(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Se(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Ne=_?function(e){return function(t){return e(t)}}(_):function(e){return Te(e)&&xe(e.length)&&!!u[ae(e)]};function Re(e){return we(e)?Q(e,!0):ce(e)}var Pe,Ae=(Pe=function(e,t,n){pe(e,t,n)},fe((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Pe.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Se(n))return!1;var r=typeof t;return!!("number"==r?we(n)&&ye(t,n.length):"string"==r&&t in n)&&be(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++nun(e)&&!!e[In],Hn=e=>e.value,Mn=e=>({[In]:!0,value:e}),Fn=(e,t)=>Ln===e&&ln(t)||jn===e&&t>=0&&t<=1,Un=(e,t)=>((e,t,n,r=1)=>{if(!un(e))return;const o=fn(`${t}_override_version`);r>(Number(e[o])||0)&&Object.defineProperty(e,t,n(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,t,(t=>({...t,set:function(n){const r=Vn[e];ln(n)?(this[r.originalValueKey]=n,pn(this,r.valueKey)&&(n=this[r.isRelativeKey]?Gn(e,n*this[r.valueKey]):this[r.valueKey])):Dn(n)&&(n=Hn(n)),ln(n)&&(this[r.listenerValueKey]=n),t.set.call(this,n)}}))),Wn=(e,t)=>vn("Howl",t,(n=>function(){const r=this,o=arguments,i=Vn[e];let a=!1;const l=r._queue.length;(1===o.length||2===o.length&&void 0===o[1])&&-1===r._getSoundIds().indexOf(o[0])&&(Dn(o[0])?(a=!0,o[0]=Hn(o[0])):Fn(e,o[0])&&(r[i.originalValueKey]=o[0],pn(r,i.valueKey)&&(a=!0,r[i.isRelativeKey]?o[0]=Gn(e,o[0]*r[i.valueKey]):o[0]=r[i.valueKey])),a&&(r[i.listenerValueKey]=o[0]));const s=n.apply(r,arguments);return a&&l({...r,functions:{audio:{applyOverride:()=>Un(e,n),getter:e=>e[t],setter:(e,n)=>e[t]=n,hasQueuedUpdate:()=>!1},howler:{applyOverride:()=>Wn(e,n),getter:e=>e[n](),setter:(e,t)=>e[n](t),hasQueuedUpdate:e=>e._queue.find((e=>e.event===n))}},priorityKey:fn(`${e}_priority`),isRelativeKey:fn(`${e}_is_relative`),valueKey:fn(`forced_${e}_value`),originalValueKey:fn(`original_${e}_value`),listenerValueKey:fn(`${e}_value`)}),Vn={[Ln]:Bn(Ln,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[jn]:Bn(jn,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},Kn=e=>{const t=Vn[e];if(!t)throw new Error(`Unknown sound setting: "${e}".`);return t},zn=e=>Kn(e).minValue,$n=e=>Kn(e).maxValue,Yn=e=>Kn(e).defaultValue,Gn=(e,t)=>Vn[e]?Math.max(Vn[e].minValue,Math.min(t,Vn[e].maxValue)):t,Xn="story",qn="forum_discussion",Zn="dictionary",Jn="unknown",Qn="listening_challenge",er="other_challenge",tr=[Qn,er,Xn,qn,Zn,Jn],nr="default",rr="main",or=[jn,Ln],ir=e=>jn===e,ar=(e,t=null,n=null)=>({[kn]:{[Rn]:t},[xn]:{[Rn]:t,[Pn]:t},[Sn]:{[Rn]:t},[Tn]:{[Rn]:t},...ir(e)?{[rr]:n}:{}}),lr=(e,t)=>Object.fromEntries([[nr,ar(e,{value:t,isRelative:!0},{value:t})],...tr.map((t=>[t,ar(e)]))]),sr=Object.fromEntries(or.map((e=>[e,lr(e,Yn(e))]))),ur=(e,t)=>un(sr.volume.default[e][t]),cr=(e,t,n,r=!0)=>{var o,i;if(!ir(t))return;const a=null==e||null===(o=e[t])||void 0===o||null===(i=o[null!=n?n:nr])||void 0===i?void 0:i.main;return un(a)?a:null===n?Yn(t):r?cr(e,t,null):null},pr=(e,t,n,r,o,i=!0)=>{var a,l,s;if(!ur(n,r))return;const u=null==e||null===(a=e[t])||void 0===a||null===(l=a[null!=o?o:nr])||void 0===l||null===(s=l[n])||void 0===s?void 0:s[r];return un(u)?u:null===o?Yn(t):i?pr(e,t,n,r,null):null},fr=(e,t)=>{if(!(e=>or.includes(e.setting)&&pn(e,"value")&&(!e.context||tr.includes(e.context)))(t))return e;const{setting:n,context:r,value:o,soundType:i=null,soundSpeed:a=null}=t;return i&&a?((e,t,n,r,o,i)=>ur(n,r)?Cn({},e,{[t]:{[null!=o?o:nr]:{[n]:{[r]:i}}}}):e)(e,n,i,a,r,o):((e,t,n,r)=>ir(t)?Cn({},e,{[t]:{[null!=n?n:nr]:{[rr]:r}}}):e)(e,n,r,o)};var dr=function(){},hr="undefined"!=typeof window;function mr(e,t,n){void 0===t&&(t=0),void 0===n&&(n=[]);var r=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=!0);var r=Z(!1),o=Z(),i=Z(e),a=Q((function(){return r.current}),[]),l=Q((function(){r.current=!1,o.current&&clearTimeout(o.current),o.current=setTimeout((function(){r.current=!0,i.current()}),t)}),[t]),s=Q((function(){r.current=null,o.current&&clearTimeout(o.current)}),[]);return X((function(){i.current=e}),[e]),X((function(){return n&&l(),s}),[t,n]),[a,s,l]}(e,t),o=r[0],i=r[1];return X(r[2],n),[o,i]}var yr=function(e,t,n){if(!hr)return[t,dr,dr];if(!e)throw new Error("useLocalStorage key may not be falsy");var r=n?n.raw?function(e){return e}:n.deserializer:JSON.parse,o=Z((function(e){try{var o=n?n.raw?String:n.serializer:JSON.stringify,i=localStorage.getItem(e);return null!==i?r(i):(t&&localStorage.setItem(e,o(t)),t)}catch(e){return t}})),i=Y((function(){return o.current(e)})),a=i[0],l=i[1];q((function(){return l(o.current(e))}),[e]);var s=Q((function(t){try{var o="function"==typeof t?t(a):t;if(void 0===o)return;var i=void 0;i=n?n.raw?"string"==typeof o?o:JSON.stringify(o):n.serializer?n.serializer(o):JSON.stringify(o):JSON.stringify(o),localStorage.setItem(e,i),l(r(i))}catch(e){}}),[e,l]),u=Q((function(){try{localStorage.removeItem(e),l(void 0)}catch(e){}}),[e,l]);return[a,s,u]},vr=se((function(e){ /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ -!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r0&&this.props.offLabel&&this.props.offLabel.length>0}},{key:"hasIcon",value:function(){return this.props.onIcon&&this.props.onIcon.length>0&&this.props.offIcon&&this.props.offIcon.length>0}},{key:"getLabel",value:function(){return this.hasLabel()?this.props.checked?this.props.onLabel:this.props.offLabel:" "}},{key:"componentDidMount",value:function(){this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(e){e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(function(e){for(var t=1;t{const r=((e,t=10)=>{let n=e.parentElement;for(;n;){if(n.clientHeight>0&&n.scrollHeight-t>n.clientHeight&&(document.documentElement===n||-1===["hidden","visible"].indexOf(window.getComputedStyle(n).overflowY)))return n;n=n.parentElement}return null})(e);if(!r)return;const o=((e,t)=>{let n=0,r=0;if(t.contains(e)){let o=e.offsetParent;for(;o&&(n+=e.offsetLeft,r+=e.offsetTop,e=o,o=o.offsetParent,t.contains(o)););}return{x:n,y:r}})(e,r).y;(or.scrollTop+r.clientHeight)&&r.scrollTo({top:o-t,behavior:n})};function Qr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0:t===e}},{key:"componentDidMount",value:function(){this.state.id||this.setState({id:rt()})}},{key:"renderTabHeader",value:function(e,t,n){var r,o=this,i=$e("p-accordion-header",{"p-highlight":t,"p-disabled":e.props.disabled},e.props.headerClassName),a=$e("p-accordion-toggle-icon",(lo(r={},"".concat(this.props.expandIcon),!t),lo(r,"".concat(this.props.collapseIcon),t),r)),s=this.state.id+"_header_"+n,l=this.state.id+"_content_"+n,u=e.props.disabled?-1:null,c=e.props.headerTemplate?et.getJSXElement(e.props.headerTemplate,e.props):fe.createElement("span",{className:"p-accordion-header-text"},e.props.header);return fe.createElement("div",{className:i,style:e.props.headerStyle},fe.createElement("a",{href:"#"+l,id:s,className:"p-accordion-header-link","aria-controls":l,role:"tab","aria-expanded":t,onClick:function(t){return o.onTabHeaderClick(t,e,n)},tabIndex:u},fe.createElement("span",{className:a}),c))}},{key:"renderTabContent",value:function(e,t,n){var r=$e("p-toggleable-content",e.props.contentClassName),o=this.state.id+"_content_"+n,i=fe.createRef();return fe.createElement(xt,{nodeRef:i,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},in:t,unmountOnExit:!0,options:this.props.transitionOptions},fe.createElement("div",{ref:i,id:o,className:r,style:e.props.contentStyle,role:"region","aria-labelledby":this.state.id+"_header_"+n},fe.createElement("div",{className:"p-accordion-content"},e.props.children)))}},{key:"renderTab",value:function(e,t){var n=this.isSelected(t),r=this.renderTabHeader(e,n,t),o=this.renderTabContent(e,n,t),i=$e("p-accordion-tab",{"p-accordion-tab-active":n});return fe.createElement("div",{key:e.props.header,className:i},r,o)}},{key:"renderTabs",value:function(){var e=this;return fe.Children.map(this.props.children,(function(t,n){if(t&&t.type===fo)return e.renderTab(t,n)}))}},{key:"render",value:function(){var e=this,t=$e("p-accordion p-component",this.props.className),n=this.renderTabs();return fe.createElement("div",{ref:function(t){return e.container=t},id:this.state.id,className:t,style:this.props.style},n)}}],n&&to(t.prototype,n),r&&to(t,r),i}(fe.Component);lo(ho,"defaultProps",{id:null,activeIndex:null,className:null,style:null,multiple:!1,expandIcon:"pi pi-chevron-right",collapseIcon:"pi pi-chevron-down",transitionOptions:null,onTabOpen:null,onTabClose:null,onTabChange:null});var yo="M:\\duo-vc\\src\\components\\Accordion.js";class mo extends ho{onTabHeaderClick(e,t,n){if(!t.props.disabled){const t=this.isSelected(n);let r;if(this.props.multiple){let e=(this.props.onTabChange?this.props.activeIndex:this.state.activeIndex)||[];e=t?e.filter((e=>e!==n)):[...e,n],r=e}else r=t?null:n;let o=t?this.props.onTabClose:this.props.onTabOpen;o&&o({originalEvent:e,index:n}),this.props.onTabChange?this.props.onTabChange({originalEvent:e,index:r}):(this.setState({activeIndex:r}),this.props.onUncontrolledTabChange&&this.props.onUncontrolledTabChange({originalEvent:e,index:r}))}e.preventDefault()}renderTabContent(e,t,n){const r=e.props.contentClassName,o=`${this.state.id}_content_${n}`;return this.isSelected(n)&&d("div",{id:o,className:r,style:e.props.contentStyle,role:"region","aria-labelledby":`${this.state.id}_header_${n}`,__source:{fileName:yo,lineNumber:60,columnNumber:7}},d("div",{className:"p-accordion-content",__source:{fileName:yo,lineNumber:67,columnNumber:9}},e.props.children))}renderTab(e,t){const n=this.isSelected(t),r=this.renderTabHeader(e,n,t),o=this.renderTabContent(e,n,t),i=vr("p-accordion-tab",{"p-accordion-tab-active":n});return d("div",{ref:e.ref,key:e.key||e.props.header,className:i,__source:{fileName:yo,lineNumber:82,columnNumber:7}},r,o)}}function vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(o=i+Math.floor(o/this.props.step-i/this.props.step)*this.props.step)}else o=Math.floor(o);this.updateValue(e,o)}},{key:"updateValue",value:function(e,t){var n=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?nthis.props.value[1]&&(n=this.props.value[1]):n>this.props.max?n=this.props.max:nthis.props.max&&(n=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:n})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,t,n){var r=this,o=$e("p-slider-handle",{"p-slider-handle-start":0===n,"p-slider-handle-end":1===n,"p-slider-handle-active":this.handleIndex===n});return fe.createElement("span",{onMouseDown:function(e){return r.onMouseDown(e,n)},onTouchStart:function(e){return r.onTouchStart(e,n)},onKeyDown:function(e){return r.onKeyDown(e,n)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:t&&t+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||t,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.props.value||[0,0],t="horizontal"===this.props.orientation,n=100*(e[0]this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),o=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),i=t?this.renderHandle(r,null,1):this.renderHandle(null,r,1),a=t?{left:n+"%",width:r-n+"%"}:{bottom:n+"%",height:r-n+"%"};return fe.createElement(fe.Fragment,null,fe.createElement("span",{className:"p-slider-range",style:a}),o,i)}},{key:"renderSingleSlider",value:function(){var e,t=this.props.value||0;e=tthis.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},r="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return fe.createElement(fe.Fragment,null,fe.createElement("span",{className:"p-slider-range",style:n}),r)}},{key:"render",value:function(){var e=this,t=$e("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),n=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return fe.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:t,onClick:this.onBarClick},n)}}],n&&go(t.prototype,n),r&&go(t,r),i}(fe.Component);!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(xo,"defaultProps",{id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null});class So extends xo{onDrag(e){this.dragging&&(this.setValue(e),e.preventDefault(),this.props.onSlideStart&&this.props.onSlideStart({value:this.props.value}))}}var To="M:\\duo-vc\\src\\components\\SettingsForm.js";const No={[Ln]:{step:.1,label:"Speed",minValue:zn(Ln),minButtonValue:Yn(Ln),minIcon:ye.PLAY,maxValue:Math.min(2.5,$n(Ln)),maxIcon:ye.FORWARD,displayScale:1,displaySuffix:"x"},[jn]:{step:.05,label:"Volume",minValue:zn(jn),minIcon:ye.VOLUME_OFF,maxValue:$n(jn),maxIcon:ye.VOLUME_UP,displayScale:100/$n(jn),displaySuffix:"%"}},Ro={[kn]:"Effect",[xn]:"Sentence",[Sn]:"Word",[Tn]:"Other"},Po={[Rn]:"Normal",[Pn]:"Slow"},Ao=((e,t)=>{const n={};for(let r=0,o=e.length;rAn.map((t=>[e,t])))).filter((e=>ur(...e))),(e=>e[0])),Lo=(e,t)=>Ro[e]+(Ao[e].length>0?` - ${Po[t]}`:""),jo={[null]:{icon:ye.PAPERCLIP,label:"Defaults"},[Qn]:{icon:ye.VOLUME_UP,label:"Challenge (listening)"},[er]:{icon:ye.PENCIL,label:"Challenge (other)"},[Xn]:{icon:ye.BOOK,label:"Story"},[qn]:{icon:ye.COMMENTS,label:"Forum"},[Zn]:{icon:ye.SEARCH,label:"Dictionary"},[Jn]:{icon:ye.QUESTION,label:"Other"}},Io=({setting:e,label:t,value:n,defaultValue:r,disabled:o=!1,onChange:i=an})=>{var a,s;const[l,u]=Y(!1),[c,p]=Y(null),f=No[e],h=null!==r,y=h&&null===n,m=null!==(a=null!=c?c:null==n?void 0:n.value)&&void 0!==a?a:null==r?void 0:r.value,v=pn(n||r,"isRelative"),_=v&&(null!==(s=null==n?void 0:n.isRelative)&&void 0!==s?s:null==r?void 0:r.isRelative),g=e=>i(n&&{...n,value:e});return yr((()=>{!l&&null!==n&&sn(c)&&c!==n.value&&(p(null),i({...n,value:c}))}),250,[n,i,l,c,p]),d("div",{className:vr(["p-field","p-grid","p-ai-center"]),__source:{fileName:To,lineNumber:201,columnNumber:7}},d("h5",{className:vr(["p-col-7","p-my-2","p-text-nowrap"]),__source:{fileName:To,lineNumber:202,columnNumber:9}},t),d("div",{className:vr(["p-col-5","p-my-2","p-d-flex","p-jc-end"]),__source:{fileName:To,lineNumber:205,columnNumber:9}},v&&d(Zr,{checked:_,disabled:o||y,onChange:e=>{return t=e.value,i(n&&{...n,isRelative:t});var t},onLabel:"",offLabel:"",onIcon:ye.PERCENTAGE,offIcon:ye.PERCENTAGE,tooltipOptions:{position:"left"},tooltip:_?"Click to ignore the Duo setting (generally not recommended).":"Click to combine the Duo setting with yours (recommended in most cases).",__source:{fileName:To,lineNumber:207,columnNumber:13}}),h&&d(Zr,{checked:y,disabled:o,onChange:e=>i(e.value?null:{...r}),onLabel:"",offLabel:"",onIcon:ye.PAPERCLIP,offIcon:ye.PAPERCLIP,tooltipOptions:{position:"left"},tooltip:y?"Click to use a custom setting for this context.":"Click to use the default setting for this context.",__source:{fileName:To,lineNumber:224,columnNumber:13}})),d("div",{className:vr(["p-col-10","p-d-flex","p-ai-center"]),__source:{fileName:To,lineNumber:241,columnNumber:9}},d(Tr,{disabled:o||y,icon:`pi ${f.minIcon}`,className:"p-button-rounded p-button-text p-button-plain",onClick:()=>g(f.minButtonValue||f.minValue),__source:{fileName:To,lineNumber:242,columnNumber:11}}),d(So,{min:f.minValue,max:f.maxValue,step:f.step,value:m,disabled:o||y,onChange:e=>p(e.value),onSlideStart:()=>u(!0),onSlideEnd:()=>u(!1),__source:{fileName:To,lineNumber:248,columnNumber:11}}),d(Tr,{disabled:o||y,icon:`pi ${f.maxIcon}`,className:"p-button-rounded p-button-text p-button-plain",onClick:()=>g(f.maxButtonValue||f.maxValue),__source:{fileName:To,lineNumber:258,columnNumber:11}})),d("div",{className:vr(["p-col-2","p-text-right"]),__source:{fileName:To,lineNumber:265,columnNumber:9}},(m*f.displayScale).toLocaleString(),f.displaySuffix))},Do=({context:e=null,config:t,disabled:n=!1,activeSetting:r=null,onSettingValueChange:o=an,onActiveSettingChange:i=an})=>{const a=or.map((r=>{const i=cr(t,r,e,!1),a=e&&cr(t,r,null),s=ir(r)&&d(Io,{key:`${r}-_main_`,setting:r,value:i,defaultValue:a,disabled:n,onChange:t=>o({setting:r,context:e,value:t}),label:"Main",__source:{fileName:To,lineNumber:286,columnNumber:9}}),l=Nn.flatMap((i=>Ao[i].map((([,a])=>{const s=pr(t,r,i,a,e,!1),l=e&&pr(t,r,i,a,null);if(void 0!==s)return d(Io,{key:`${r}-${i}-${a}`,setting:r,value:s,defaultValue:l,disabled:n,onChange:t=>o({setting:r,context:e,soundType:i,soundSpeed:a,value:t}),label:d(y,{__source:{fileName:To,lineNumber:312,columnNumber:19}},d("span",{className:"p-text-normal",__source:{fileName:To,lineNumber:313,columnNumber:21}},"Sound: "),d("span",{__source:{fileName:To,lineNumber:314,columnNumber:21}},Lo(i,a))),__source:{fileName:To,lineNumber:304,columnNumber:15}})}))));return d(Ur,{key:`${r}-panel`,header:No[r].label,headerClassName:"p-setting-tab-header p-text-center",__source:{fileName:To,lineNumber:324,columnNumber:9}},[s,...l].filter(Boolean))}));return d("div",{className:"p-fluid",__source:{fileName:To,lineNumber:335,columnNumber:7}},d(Wr,{activeIndex:or.indexOf(r)||0,onTabChange:e=>i(or[e.index]),__source:{fileName:To,lineNumber:336,columnNumber:9}},a))},Ho=({config:e,disabled:t=!1,onSettingValueChange:n=an})=>{const[r,o]=mr("popup-active-panel",0),[i,a]=mr("popup-active-setting",jn),s=Z([]),l=Q((e=>{o(e.index),s[e.index]&&setTimeout((()=>Jr(s[e.index],10,"smooth")))}),[o,s]);q((()=>l({index:r})),[]);const u=e=>d(y,{__source:{fileName:To,lineNumber:362,columnNumber:5}},d("i",{className:jo[e].icon,__source:{fileName:To,lineNumber:363,columnNumber:7}}),d("span",{className:"p-text-bold",__source:{fileName:To,lineNumber:364,columnNumber:7}},jo[e].label));return d(mo,{key:"settings-accordion",activeIndex:r,onUncontrolledTabChange:l,__source:{fileName:To,lineNumber:369,columnNumber:5}},[null,...tr].map(((r,o)=>d(fo,{key:`${r||"_default_"}-tab`,ref:e=>s[o]=e,header:u(r),__source:{fileName:To,lineNumber:375,columnNumber:9}},d(Do,{context:r,config:e,disabled:t,activeSetting:i,onSettingValueChange:n,onActiveSettingChange:a,__source:{fileName:To,lineNumber:380,columnNumber:11}})))))};var Mo="M:\\duo-vc\\src\\components\\SettingsPopup.js";j(d((()=>{const e=Z(),[t,n]=Y(lr),[r,o]=Y(!0),i=(t,n)=>{e.current&&e.current.show({summary:t,severity:"error",detail:d(y,{__source:{fileName:Mo,lineNumber:24,columnNumber:11}},"Retry by clicking ",d("a",{href:"#",onClick:()=>n(),__source:{fileName:Mo,lineNumber:25,columnNumber:31}},"here"),".")})},a=async(e,t)=>{o(!0),n(fr(e,t));try{const[,e]=await Promise.all([(r=250,new Promise((e=>setTimeout(e,r)))),On("update_current_profile",{updateRequest:t})]);n(e)}catch(r){i("Failed to update configuration",(()=>a(e,t))),bn(r),n(e)}finally{o(!1)}var r};return X((()=>{const e=async()=>{try{o(!0);const e=await On("get_current_profile");n(e)}catch(t){i("Failed to load configuration",e),bn(t),n(lr)}finally{o(!1)}};e()}),[]),d(y,{__source:{fileName:Mo,lineNumber:71,columnNumber:5}},d(Ho,{config:t,disabled:r,onSettingValueChange:e=>a(t,e),__source:{fileName:Mo,lineNumber:72,columnNumber:7}}),r&&d("div",{className:"loader-overlay",__source:{fileName:Mo,lineNumber:78,columnNumber:9}},d("div",{className:"loader-wrapper",__source:{fileName:Mo,lineNumber:79,columnNumber:11}},d(on,{strokeWidth:4,__source:{fileName:Mo,lineNumber:80,columnNumber:13}}))),d(Yt,{ref:e,__source:{fileName:Mo,lineNumber:84,columnNumber:7}}))}),{__source:{fileName:"M:\\duo-vc\\src\\popup.js",lineNumber:10,columnNumber:8}}),document.getElementById("container"))}(); +!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r0&&this.props.offLabel&&this.props.offLabel.length>0}},{key:"hasIcon",value:function(){return this.props.onIcon&&this.props.onIcon.length>0&&this.props.offIcon&&this.props.offIcon.length>0}},{key:"getLabel",value:function(){return this.hasLabel()?this.props.checked?this.props.onLabel:this.props.offLabel:" "}},{key:"componentDidMount",value:function(){this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(e){e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(function(e){for(var t=1;t{const r=((e,t=10)=>{let n=e.parentElement;for(;n;){if(n.clientHeight>0&&n.scrollHeight-t>n.clientHeight&&(document.documentElement===n||-1===["hidden","visible"].indexOf(window.getComputedStyle(n).overflowY)))return n;n=n.parentElement}return null})(e);if(!r)return;const o=((e,t)=>{let n=0,r=0;if(t.contains(e)){let o=e.offsetParent;for(;o&&(n+=e.offsetLeft,r+=e.offsetTop,e=o,o=o.offsetParent,t.contains(o)););}return{x:n,y:r}})(e,r).y;(or.scrollTop+r.clientHeight)&&r.scrollTo({top:o-t,behavior:n})};function Qr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0:t===e}},{key:"componentDidMount",value:function(){this.state.id||this.setState({id:rt()})}},{key:"renderTabHeader",value:function(e,t,n){var r,o=this,i=$e("p-accordion-header",{"p-highlight":t,"p-disabled":e.props.disabled},e.props.headerClassName),a=$e("p-accordion-toggle-icon",(so(r={},"".concat(this.props.expandIcon),!t),so(r,"".concat(this.props.collapseIcon),t),r)),l=this.state.id+"_header_"+n,s=this.state.id+"_content_"+n,u=e.props.disabled?-1:null,c=e.props.headerTemplate?et.getJSXElement(e.props.headerTemplate,e.props):fe.createElement("span",{className:"p-accordion-header-text"},e.props.header);return fe.createElement("div",{className:i,style:e.props.headerStyle},fe.createElement("a",{href:"#"+s,id:l,className:"p-accordion-header-link","aria-controls":s,role:"tab","aria-expanded":t,onClick:function(t){return o.onTabHeaderClick(t,e,n)},tabIndex:u},fe.createElement("span",{className:a}),c))}},{key:"renderTabContent",value:function(e,t,n){var r=$e("p-toggleable-content",e.props.contentClassName),o=this.state.id+"_content_"+n,i=fe.createRef();return fe.createElement(xt,{nodeRef:i,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},in:t,unmountOnExit:!0,options:this.props.transitionOptions},fe.createElement("div",{ref:i,id:o,className:r,style:e.props.contentStyle,role:"region","aria-labelledby":this.state.id+"_header_"+n},fe.createElement("div",{className:"p-accordion-content"},e.props.children)))}},{key:"renderTab",value:function(e,t){var n=this.isSelected(t),r=this.renderTabHeader(e,n,t),o=this.renderTabContent(e,n,t),i=$e("p-accordion-tab",{"p-accordion-tab-active":n});return fe.createElement("div",{key:e.props.header,className:i},r,o)}},{key:"renderTabs",value:function(){var e=this;return fe.Children.map(this.props.children,(function(t,n){if(t&&t.type===fo)return e.renderTab(t,n)}))}},{key:"render",value:function(){var e=this,t=$e("p-accordion p-component",this.props.className),n=this.renderTabs();return fe.createElement("div",{ref:function(t){return e.container=t},id:this.state.id,className:t,style:this.props.style},n)}}],n&&to(t.prototype,n),r&&to(t,r),i}(fe.Component);so(ho,"defaultProps",{id:null,activeIndex:null,className:null,style:null,multiple:!1,expandIcon:"pi pi-chevron-right",collapseIcon:"pi pi-chevron-down",transitionOptions:null,onTabOpen:null,onTabClose:null,onTabChange:null});var mo="M:\\duo-vc\\src\\components\\Accordion.js";class yo extends ho{onTabHeaderClick(e,t,n){if(!t.props.disabled){const t=this.isSelected(n);let r;if(this.props.multiple){let e=(this.props.onTabChange?this.props.activeIndex:this.state.activeIndex)||[];e=t?e.filter((e=>e!==n)):[...e,n],r=e}else r=t?null:n;let o=t?this.props.onTabClose:this.props.onTabOpen;o&&o({originalEvent:e,index:n}),this.props.onTabChange?this.props.onTabChange({originalEvent:e,index:r}):(this.setState({activeIndex:r}),this.props.onUncontrolledTabChange&&this.props.onUncontrolledTabChange({originalEvent:e,index:r}))}e.preventDefault()}renderTabContent(e,t,n){const r=e.props.contentClassName,o=`${this.state.id}_content_${n}`;return this.isSelected(n)&&d("div",{id:o,className:r,style:e.props.contentStyle,role:"region","aria-labelledby":`${this.state.id}_header_${n}`,__source:{fileName:mo,lineNumber:60,columnNumber:7}},d("div",{className:"p-accordion-content",__source:{fileName:mo,lineNumber:67,columnNumber:9}},e.props.children))}renderTab(e,t){const n=this.isSelected(t),r=this.renderTabHeader(e,n,t),o=this.renderTabContent(e,n,t),i=vr("p-accordion-tab",{"p-accordion-tab-active":n});return d("div",{ref:e.ref,key:e.key||e.props.header,className:i,__source:{fileName:mo,lineNumber:82,columnNumber:7}},r,o)}}function vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(o=i+Math.floor(o/this.props.step-i/this.props.step)*this.props.step)}else o=Math.floor(o);this.updateValue(e,o)}},{key:"updateValue",value:function(e,t){var n=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?nthis.props.value[1]&&(n=this.props.value[1]):n>this.props.max?n=this.props.max:nthis.props.max&&(n=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:n})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,t,n){var r=this,o=$e("p-slider-handle",{"p-slider-handle-start":0===n,"p-slider-handle-end":1===n,"p-slider-handle-active":this.handleIndex===n});return fe.createElement("span",{onMouseDown:function(e){return r.onMouseDown(e,n)},onTouchStart:function(e){return r.onTouchStart(e,n)},onKeyDown:function(e){return r.onKeyDown(e,n)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:t&&t+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||t,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.props.value||[0,0],t="horizontal"===this.props.orientation,n=100*(e[0]this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),o=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),i=t?this.renderHandle(r,null,1):this.renderHandle(null,r,1),a=t?{left:n+"%",width:r-n+"%"}:{bottom:n+"%",height:r-n+"%"};return fe.createElement(fe.Fragment,null,fe.createElement("span",{className:"p-slider-range",style:a}),o,i)}},{key:"renderSingleSlider",value:function(){var e,t=this.props.value||0;e=tthis.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},r="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return fe.createElement(fe.Fragment,null,fe.createElement("span",{className:"p-slider-range",style:n}),r)}},{key:"render",value:function(){var e=this,t=$e("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),n=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return fe.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:t,onClick:this.onBarClick},n)}}],n&&go(t.prototype,n),r&&go(t,r),i}(fe.Component);!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(xo,"defaultProps",{id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null});class So extends xo{onDrag(e){this.dragging&&(this.setValue(e),e.preventDefault(),this.props.onSlideStart&&this.props.onSlideStart({value:this.props.value}))}}var To="M:\\duo-vc\\src\\components\\SettingsForm.js";const No={[Ln]:{step:.1,label:"Speed",minValue:zn(Ln),minIcon:me.PLAY,minButtonValue:Yn(Ln),minButtonTitle:"Normal (default)",maxValue:Math.min(2.5,$n(Ln)),maxIcon:me.FORWARD,maxButtonValue:Math.min(2,$n(Ln)),maxButtonTitle:"Fast",displayScale:1,displaySuffix:"x"},[jn]:{step:.05,label:"Volume",minValue:zn(jn),minIcon:me.VOLUME_OFF,minButtonTitle:"Mute",maxValue:$n(jn),maxIcon:me.VOLUME_UP,maxButtonTitle:"Normal (default)",displayScale:100/$n(jn),displaySuffix:"%"}},Ro={[kn]:"Effect",[xn]:"Sentence",[Sn]:"Word",[Tn]:"Other"},Po={[Rn]:"Normal",[Pn]:"Slow"},Ao=((e,t)=>{const n={};for(let r=0,o=e.length;rAn.map((t=>[e,t])))).filter((e=>ur(...e))),(e=>e[0])),Lo=(e,t)=>Ro[e]+(Ao[e].length>1?` - ${Po[t]}`:""),jo={[null]:{icon:me.PAPERCLIP,label:"Defaults"},[Qn]:{icon:me.VOLUME_UP,label:"Challenge (listening)"},[er]:{icon:me.PENCIL,label:"Challenge (other)"},[Xn]:{icon:me.BOOK,label:"Story"},[qn]:{icon:me.COMMENTS,label:"Forum"},[Zn]:{icon:me.SEARCH,label:"Dictionary"},[Jn]:{icon:me.QUESTION,label:"Other"}},Io=({setting:e,label:t,value:n,defaultValue:r,disabled:o=!1,onChange:i=an})=>{var a,l;const[s,u]=Y(!1),[c,p]=Y(null),f=No[e],h=null!==r,m=h&&null===n,y=null!==(a=null!=c?c:null==n?void 0:n.value)&&void 0!==a?a:null==r?void 0:r.value,v=pn(n||r,"isRelative"),_=v&&(null!==(l=null==n?void 0:n.isRelative)&&void 0!==l?l:null==r?void 0:r.isRelative),g=e=>i(n&&{...n,value:e});return mr((()=>{!s&&null!==n&&ln(c)&&c!==n.value&&(p(null),i({...n,value:c}))}),250,[n,i,s,c,p]),d("div",{className:vr(["p-field","p-grid","p-ai-center"]),__source:{fileName:To,lineNumber:206,columnNumber:7}},d("h5",{className:vr(["p-col-7","p-my-2","p-text-nowrap"]),__source:{fileName:To,lineNumber:207,columnNumber:9}},t),d("div",{className:vr(["p-col-5","p-my-2","p-d-flex","p-jc-end"]),__source:{fileName:To,lineNumber:210,columnNumber:9}},v&&d(Zr,{checked:_,disabled:o||m,onChange:e=>{return t=e.value,i(n&&{...n,isRelative:t});var t},onLabel:"",offLabel:"",onIcon:me.PERCENTAGE,offIcon:me.PERCENTAGE,tooltipOptions:{position:"left"},tooltip:_?"Click to ignore the original setting (generally not recommended).":"Click to combine the original setting with yours (generally recommended).",__source:{fileName:To,lineNumber:212,columnNumber:13}}),h&&d(Zr,{checked:m,disabled:o,onChange:e=>i(e.value?null:{...r}),onLabel:"",offLabel:"",onIcon:me.PAPERCLIP,offIcon:me.PAPERCLIP,tooltipOptions:{position:"left"},tooltip:m?"Click to use a custom setting for this context.":"Click to use the default setting for this context.",__source:{fileName:To,lineNumber:229,columnNumber:13}})),d("div",{className:vr(["p-col-10","p-d-flex","p-ai-center"]),__source:{fileName:To,lineNumber:246,columnNumber:9}},d(Tr,{disabled:o||m,title:f.minButtonTitle,icon:`pi ${f.minIcon}`,className:"p-button-rounded p-button-text p-button-plain",onClick:()=>g(f.minButtonValue||f.minValue),__source:{fileName:To,lineNumber:247,columnNumber:11}}),d(So,{min:f.minValue,max:f.maxValue,step:f.step,value:y,disabled:o||m,onChange:e=>p(e.value),onSlideStart:()=>u(!0),onSlideEnd:()=>u(!1),__source:{fileName:To,lineNumber:254,columnNumber:11}}),d(Tr,{disabled:o||m,title:f.maxButtonTitle,icon:`pi ${f.maxIcon}`,className:"p-button-rounded p-button-text p-button-plain",onClick:()=>g(f.maxButtonValue||f.maxValue),__source:{fileName:To,lineNumber:264,columnNumber:11}})),d("div",{className:vr(["p-col-2","p-text-right"]),__source:{fileName:To,lineNumber:272,columnNumber:9}},(y*f.displayScale).toLocaleString(),f.displaySuffix))},Do=({context:e=null,config:t,disabled:n=!1,activeSetting:r=null,onSettingValueChange:o=an,onActiveSettingChange:i=an})=>{const a=or.map((r=>{const i=cr(t,r,e,!1),a=e&&cr(t,r,null),l=ir(r)&&d(Io,{key:`${r}-_main_`,setting:r,value:i,defaultValue:a,disabled:n,onChange:t=>o({setting:r,context:e,value:t}),label:"Main",__source:{fileName:To,lineNumber:293,columnNumber:9}}),s=Nn.flatMap((i=>Ao[i].map((([,a])=>{const l=pr(t,r,i,a,e,!1),s=e&&pr(t,r,i,a,null);if(void 0!==l)return d(Io,{key:`${r}-${i}-${a}`,setting:r,value:l,defaultValue:s,disabled:n,onChange:t=>o({setting:r,context:e,soundType:i,soundSpeed:a,value:t}),label:d(m,{__source:{fileName:To,lineNumber:319,columnNumber:19}},d("span",{className:"p-text-normal",__source:{fileName:To,lineNumber:320,columnNumber:21}},"Sound: "),d("span",{__source:{fileName:To,lineNumber:321,columnNumber:21}},Lo(i,a))),__source:{fileName:To,lineNumber:311,columnNumber:15}})}))));return d(Ur,{key:`${r}-panel`,header:No[r].label,headerClassName:"p-setting-tab-header p-text-center",__source:{fileName:To,lineNumber:331,columnNumber:9}},[l,...s].filter(Boolean))}));return d("div",{className:"p-fluid",__source:{fileName:To,lineNumber:342,columnNumber:7}},d(Wr,{activeIndex:or.indexOf(r)||0,onTabChange:e=>i(or[e.index]),__source:{fileName:To,lineNumber:343,columnNumber:9}},a))},Ho=({config:e,disabled:t=!1,onSettingValueChange:n=an})=>{const[r,o]=yr("popup-active-panel",0),[i,a]=yr("popup-active-setting",jn),l=Z([]),s=Q((e=>{o(e.index),l[e.index]&&setTimeout((()=>Jr(l[e.index],10,"smooth")))}),[o,l]);q((()=>s({index:r})),[]);const u=e=>d(m,{__source:{fileName:To,lineNumber:369,columnNumber:5}},d("i",{className:jo[e].icon,__source:{fileName:To,lineNumber:370,columnNumber:7}}),d("span",{className:"p-text-bold",__source:{fileName:To,lineNumber:371,columnNumber:7}},jo[e].label));return d(yo,{key:"settings-accordion",activeIndex:r,onUncontrolledTabChange:s,__source:{fileName:To,lineNumber:376,columnNumber:5}},[null,...tr].map(((r,o)=>d(fo,{key:`${r||"_default_"}-tab`,ref:e=>l[o]=e,header:u(r),__source:{fileName:To,lineNumber:382,columnNumber:9}},d(Do,{context:r,config:e,disabled:t,activeSetting:i,onSettingValueChange:n,onActiveSettingChange:a,__source:{fileName:To,lineNumber:387,columnNumber:11}})))))};var Mo="M:\\duo-vc\\src\\components\\SettingsPopup.js";j(d((()=>{const e=Z(),[t,n]=Y(sr),[r,o]=Y(!0),i=(t,n)=>{e.current&&e.current.show({summary:t,severity:"error",detail:d(m,{__source:{fileName:Mo,lineNumber:24,columnNumber:11}},"Retry by clicking ",d("a",{href:"#",onClick:()=>n(),__source:{fileName:Mo,lineNumber:25,columnNumber:31}},"here"),".")})},a=async(e,t)=>{o(!0),n(fr(e,t));try{const[,e]=await Promise.all([(r=250,new Promise((e=>setTimeout(e,r)))),On("update_current_profile",{updateRequest:t})]);n(e)}catch(r){i("Failed to update configuration",(()=>a(e,t))),bn(r),n(e)}finally{o(!1)}var r};return X((()=>{const e=async()=>{try{o(!0);const e=await On("get_current_profile");n(e)}catch(t){i("Failed to load configuration",e),bn(t),n(sr)}finally{o(!1)}};e()}),[]),d(m,{__source:{fileName:Mo,lineNumber:71,columnNumber:5}},d(Ho,{config:t,disabled:r,onSettingValueChange:e=>a(t,e),__source:{fileName:Mo,lineNumber:72,columnNumber:7}}),r&&d("div",{className:"loader-overlay",__source:{fileName:Mo,lineNumber:78,columnNumber:9}},d("div",{className:"loader-wrapper",__source:{fileName:Mo,lineNumber:79,columnNumber:11}},d(on,{strokeWidth:4,__source:{fileName:Mo,lineNumber:80,columnNumber:13}}))),d(Yt,{ref:e,__source:{fileName:Mo,lineNumber:84,columnNumber:7}}))}),{__source:{fileName:"M:\\duo-vc\\src\\popup.js",lineNumber:10,columnNumber:8}}),document.getElementById("container"))}(); diff --git a/package-lock.json b/package-lock.json index a7b580a..ccb1a57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "duolingo-sound-controls", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "duolingo-sound-controls", - "version": "1.1.0", + "version": "1.2.0", "license": "MIT", "dependencies": { "chrome-storage-promise": "git+https://github.com/blmage/chrome-storage-promise.git#semver:^1.0.0", diff --git a/package.json b/package.json index bbf5c6d..8059f9a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "A browser extension providing fine-grained sound controls for Duolingo.", "license": "MIT", "author": "blmage", - "version": "1.1.0", + "version": "1.2.0", "homepage": "https://github.com/blmage/duolingo-sound-controls", "scripts": { "build": "rollup -c --environment production",